Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test style in unused parentheses lint test #65507

Merged
merged 5 commits into from
Oct 23, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replaced warn attribute by deny
  • Loading branch information
Lucas Henry committed Oct 17, 2019

Verified

This commit was signed with the committer’s verified signature.
Kikobeats Kiko Beats
commit 43b5dcaabb527126830f721318037bb270e21d4a
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
@@ -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 unused parentheses wrap expression
let _a = 1 / (2 + 3); //~ERROR
f();
}

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
@@ -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 unused parentheses wrap expression
let _a = (1 / (2 + 3)); //~ERROR
f();
}

19 changes: 9 additions & 10 deletions src/test/ui/lint/unused_parens_remove_json_suggestion.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// compile-flags: --error-format pretty-json -Zunstable-options
// build-pass
// run-rustfix

// The output for humans should just highlight the whole span without showing
@@ -8,14 +7,14 @@
// stripping away any starting or ending parenthesis characters—hence this
// test of the JSON error format.

#![warn(unused_parens)]
#![deny(unused_parens)]
#![allow(unreachable_code)]

fn main() {

let _b = false;

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

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

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

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

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

}

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

for _ in 0 .. 3 {
while true && false {
for _ in 0 .. 3 { //~ ERROR
while true && false { //~ ERROR
println!("e~")
}
}
19 changes: 9 additions & 10 deletions src/test/ui/lint/unused_parens_remove_json_suggestion.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// compile-flags: --error-format pretty-json -Zunstable-options
// build-pass
// run-rustfix

// The output for humans should just highlight the whole span without showing
@@ -8,14 +7,14 @@
// stripping away any starting or ending parenthesis characters—hence this
// test of the JSON error format.

#![warn(unused_parens)]
#![deny(unused_parens)]
#![allow(unreachable_code)]

fn main() {

let _b = false;

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

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

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

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

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

}

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

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