Skip to content

Commit 918f70f

Browse files
committed
Removed an unneeded instance of // revisions; the compare-mode NLL shows the output is identical now.
1 parent 653da4f commit 918f70f

3 files changed

+52
-202
lines changed

src/test/ui/lint/lint-unused-mut-variables.nll.stderr

-150
This file was deleted.

src/test/ui/lint/lint-unused-mut-variables.rs

+36-36
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// revisions: lexical nll
12-
#![cfg_attr(nll, feature(nll))]
11+
12+
1313

1414
// Exercise the unused_mut attribute in some positive and negative cases
1515

@@ -21,68 +21,68 @@
2121

2222
fn main() {
2323
// negative cases
24-
let mut a = 3; //[lexical]~ ERROR: variable does not need to be mutable
25-
//[nll]~^ ERROR: variable does not need to be mutable
26-
let mut a = 2; //[lexical]~ ERROR: variable does not need to be mutable
27-
//[nll]~^ ERROR: variable does not need to be mutable
28-
let mut b = 3; //[lexical]~ ERROR: variable does not need to be mutable
29-
//[nll]~^ ERROR: variable does not need to be mutable
30-
let mut a = vec![3]; //[lexical]~ ERROR: variable does not need to be mutable
31-
//[nll]~^ ERROR: variable does not need to be mutable
32-
let (mut a, b) = (1, 2); //[lexical]~ ERROR: variable does not need to be mutable
33-
//[nll]~^ ERROR: variable does not need to be mutable
34-
let mut a; //[lexical]~ ERROR: variable does not need to be mutable
35-
//[nll]~^ ERROR: variable does not need to be mutable
24+
let mut a = 3; //~ ERROR: variable does not need to be mutable
25+
26+
let mut a = 2; //~ ERROR: variable does not need to be mutable
27+
28+
let mut b = 3; //~ ERROR: variable does not need to be mutable
29+
30+
let mut a = vec![3]; //~ ERROR: variable does not need to be mutable
31+
32+
let (mut a, b) = (1, 2); //~ ERROR: variable does not need to be mutable
33+
34+
let mut a; //~ ERROR: variable does not need to be mutable
35+
3636
a = 3;
3737

38-
let mut b; //[lexical]~ ERROR: variable does not need to be mutable
39-
//[nll]~^ ERROR: variable does not need to be mutable
38+
let mut b; //~ ERROR: variable does not need to be mutable
39+
4040
if true {
4141
b = 3;
4242
} else {
4343
b = 4;
4444
}
4545

4646
match 30 {
47-
mut x => {} //[lexical]~ ERROR: variable does not need to be mutable
48-
//[nll]~^ ERROR: variable does not need to be mutable
47+
mut x => {} //~ ERROR: variable does not need to be mutable
48+
4949
}
5050
match (30, 2) {
51-
(mut x, 1) | //[lexical]~ ERROR: variable does not need to be mutable
52-
//[nll]~^ ERROR: variable does not need to be mutable
51+
(mut x, 1) | //~ ERROR: variable does not need to be mutable
52+
5353
(mut x, 2) |
5454
(mut x, 3) => {
5555
}
5656
_ => {}
5757
}
5858

59-
let x = |mut y: isize| 10; //[lexical]~ ERROR: variable does not need to be mutable
60-
//[nll]~^ ERROR: variable does not need to be mutable
61-
fn what(mut foo: isize) {} //[lexical]~ ERROR: variable does not need to be mutable
62-
//[nll]~^ ERROR: variable does not need to be mutable
59+
let x = |mut y: isize| 10; //~ ERROR: variable does not need to be mutable
60+
61+
fn what(mut foo: isize) {} //~ ERROR: variable does not need to be mutable
62+
63+
64+
let mut a = &mut 5; //~ ERROR: variable does not need to be mutable
6365

64-
let mut a = &mut 5; //[lexical]~ ERROR: variable does not need to be mutable
65-
//[nll]~^ ERROR: variable does not need to be mutable
6666
*a = 4;
6767

6868
let mut a = 5;
69-
let mut b = (&mut a,); //[lexical]~ ERROR: variable does not need to be mutable
70-
*b.0 = 4; //[nll]~^ ERROR: variable does not need to be mutable
69+
let mut b = (&mut a,); //~ ERROR: variable does not need to be mutable
70+
*b.0 = 4;
71+
72+
let mut x = &mut 1; //~ ERROR: variable does not need to be mutable
7173

72-
let mut x = &mut 1; //[lexical]~ ERROR: variable does not need to be mutable
73-
//[nll]~^ ERROR: variable does not need to be mutable
7474
let mut f = || {
7575
*x += 1;
7676
};
7777
f();
7878

7979
fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] {
80-
&mut arg[..] //[lexical]~^ ERROR: variable does not need to be mutable
81-
//[nll]~^^ ERROR: variable does not need to be mutable
80+
&mut arg[..] //~^ ERROR: variable does not need to be mutable
81+
8282
}
8383

84-
let mut v : &mut Vec<()> = &mut vec![]; //[lexical]~ ERROR: variable does not need to be mutable
85-
//[nll]~^ ERROR: variable does not need to be mutable
84+
let mut v : &mut Vec<()> = &mut vec![]; //~ ERROR: variable does not need to be mutable
85+
8686
v.push(());
8787

8888
// positive cases
@@ -140,6 +140,6 @@ fn foo(mut a: isize) {
140140
fn bar() {
141141
#[allow(unused_mut)]
142142
let mut a = 3;
143-
let mut b = vec![2]; //[lexical]~ ERROR: variable does not need to be mutable
144-
//[nll]~^ ERROR: variable does not need to be mutable
143+
let mut b = vec![2]; //~ ERROR: variable does not need to be mutable
144+
145145
}

0 commit comments

Comments
 (0)