Skip to content

Commit

Permalink
Added text after error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Henry committed Oct 18, 2019
1 parent a1387e3 commit 95d98af
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/lint/unused_parens_json_suggestion.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
fn main() {
// We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
// the malformed `1 / (2 + 3`
let _a = 1 / (2 + 3); //~ERROR
let _a = 1 / (2 + 3); //~ERROR unnecessary parentheses
f();
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/unused_parens_json_suggestion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
fn main() {
// We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
// the malformed `1 / (2 + 3`
let _a = (1 / (2 + 3)); //~ERROR
let _a = (1 / (2 + 3)); //~ERROR unnecessary parentheses
f();
}

Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/lint/unused_parens_remove_json_suggestion.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {

let _b = false;

if _b { //~ ERROR
if _b { //~ ERROR unnecessary parentheses
println!("hello");
}

Expand All @@ -25,29 +25,29 @@ fn main() {
fn f() -> bool {
let c = false;

if c { //~ ERROR
if c { //~ ERROR unnecessary parentheses
println!("next");
}

if c { //~ ERROR
if c { //~ ERROR unnecessary parentheses
println!("prev");
}

while false && true {
if c { //~ ERROR
if c { //~ ERROR unnecessary parentheses
println!("norm");
}

}

while true && false { //~ ERROR
for _ in 0 .. 3 { //~ ERROR
while true && false { //~ ERROR unnecessary parentheses
for _ in 0 .. 3 { //~ ERROR unnecessary parentheses
println!("e~")
}
}

for _ in 0 .. 3 { //~ ERROR
while true && false { //~ ERROR
for _ in 0 .. 3 { //~ ERROR unnecessary parentheses
while true && false { //~ ERROR unnecessary parentheses
println!("e~")
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/lint/unused_parens_remove_json_suggestion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {

let _b = false;

if (_b) { //~ ERROR
if (_b) { //~ ERROR unnecessary parentheses
println!("hello");
}

Expand All @@ -25,29 +25,29 @@ fn main() {
fn f() -> bool {
let c = false;

if(c) { //~ ERROR
if(c) { //~ ERROR unnecessary parentheses
println!("next");
}

if (c){ //~ ERROR
if (c){ //~ ERROR unnecessary parentheses
println!("prev");
}

while (false && true){
if (c) { //~ ERROR
if (c) { //~ ERROR unnecessary parentheses
println!("norm");
}

}

while(true && false) { //~ ERROR
for _ in (0 .. 3){ //~ ERROR
while(true && false) { //~ ERROR unnecessary parentheses
for _ in (0 .. 3){ //~ ERROR unnecessary parentheses
println!("e~")
}
}

for _ in (0 .. 3) { //~ ERROR
while (true && false) { //~ ERROR
for _ in (0 .. 3) { //~ ERROR unnecessary parentheses
while (true && false) { //~ ERROR unnecessary parentheses
println!("e~")
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/lint/unused_parens_remove_json_suggestion.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,56 @@ LL | #![deny(unused_parens)]
| ^^^^^^^^^^^^^

"}
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":607,"byte_end":610,"line_start":28,"line_end":28,"column_start":7,"column_end":10,"is_primary":true,"text":[{"text":" if(c) {
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":631,"byte_end":634,"line_start":28,"line_end":28,"column_start":7,"column_end":10,"is_primary":true,"text":[{"text":" if(c) {
--> $DIR/unused_parens_remove_json_suggestion.rs:28:7
|
LL | if(c) {
| ^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":663,"byte_end":666,"line_start":32,"line_end":32,"column_start":8,"column_end":11,"is_primary":true,"text":[{"text":" if (c){
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":711,"byte_end":714,"line_start":32,"line_end":32,"column_start":8,"column_end":11,"is_primary":true,"text":[{"text":" if (c){
--> $DIR/unused_parens_remove_json_suggestion.rs:32:8
|
LL | if (c){
| ^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":721,"byte_end":736,"line_start":36,"line_end":36,"column_start":11,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":721,"byte_end":736,"line_start":36,"line_end":36,"column_start":11,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":26}],"label":null,"suggested_replacement":"false && true ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":793,"byte_end":808,"line_start":36,"line_end":36,"column_start":11,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":793,"byte_end":808,"line_start":36,"line_end":36,"column_start":11,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":26}],"label":null,"suggested_replacement":"false && true ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition
--> $DIR/unused_parens_remove_json_suggestion.rs:36:11
|
LL | while (false && true){
| ^^^^^^^^^^^^^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":749,"byte_end":752,"line_start":37,"line_end":37,"column_start":12,"column_end":15,"is_primary":true,"text":[{"text":" if (c) {
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":821,"byte_end":824,"line_start":37,"line_end":37,"column_start":12,"column_end":15,"is_primary":true,"text":[{"text":" if (c) {
--> $DIR/unused_parens_remove_json_suggestion.rs:37:12
|
LL | if (c) {
| ^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":822,"byte_end":837,"line_start":43,"line_end":43,"column_start":10,"column_end":25,"is_primary":true,"text":[{"text":" while(true && false) {
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":918,"byte_end":933,"line_start":43,"line_end":43,"column_start":10,"column_end":25,"is_primary":true,"text":[{"text":" while(true && false) {
--> $DIR/unused_parens_remove_json_suggestion.rs:43:10
|
LL | while(true && false) {
| ^^^^^^^^^^^^^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `for` head expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":867,"byte_end":875,"line_start":44,"line_end":44,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){
{"message":"unnecessary parentheses around `for` head expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":987,"byte_end":995,"line_start":44,"line_end":44,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){
--> $DIR/unused_parens_remove_json_suggestion.rs:44:18
|
LL | for _ in (0 .. 3){
| ^^^^^^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `for` head expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":944,"byte_end":952,"line_start":49,"line_end":49,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {
{"message":"unnecessary parentheses around `for` head expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1088,"byte_end":1096,"line_start":49,"line_end":49,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {
--> $DIR/unused_parens_remove_json_suggestion.rs:49:14
|
LL | for _ in (0 .. 3) {
| ^^^^^^^^ help: remove these parentheses

"}
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":979,"byte_end":994,"line_start":50,"line_end":50,"column_start":15,"column_end":30,"is_primary":true,"text":[{"text":" while (true && false) {
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1147,"byte_end":1162,"line_start":50,"line_end":50,"column_start":15,"column_end":30,"is_primary":true,"text":[{"text":" while (true && false) {
--> $DIR/unused_parens_remove_json_suggestion.rs:50:15
|
LL | while (true && false) {
Expand Down

0 comments on commit 95d98af

Please sign in to comment.