Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 918f70f

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

File tree

3 files changed

+52
-202
lines changed

3 files changed

+52
-202
lines changed
 

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

Lines changed: 0 additions & 150 deletions
This file was deleted.

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

Lines changed: 36 additions & 36 deletions
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
}

‎src/test/ui/lint/lint-unused-mut-variables.lexical.stderr renamed to ‎src/test/ui/lint/lint-unused-mut-variables.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: variable does not need to be mutable
22
--> $DIR/lint-unused-mut-variables.rs:59:14
33
|
4-
LL | let x = |mut y: isize| 10; //[lexical]~ ERROR: variable does not need to be mutable
4+
LL | let x = |mut y: isize| 10; //~ ERROR: variable does not need to be mutable
55
| ----^
66
| |
77
| help: remove this `mut`
@@ -15,111 +15,111 @@ LL | #![deny(unused_mut)]
1515
error: variable does not need to be mutable
1616
--> $DIR/lint-unused-mut-variables.rs:24:9
1717
|
18-
LL | let mut a = 3; //[lexical]~ ERROR: variable does not need to be mutable
18+
LL | let mut a = 3; //~ ERROR: variable does not need to be mutable
1919
| ----^
2020
| |
2121
| help: remove this `mut`
2222

2323
error: variable does not need to be mutable
2424
--> $DIR/lint-unused-mut-variables.rs:26:9
2525
|
26-
LL | let mut a = 2; //[lexical]~ ERROR: variable does not need to be mutable
26+
LL | let mut a = 2; //~ ERROR: variable does not need to be mutable
2727
| ----^
2828
| |
2929
| help: remove this `mut`
3030

3131
error: variable does not need to be mutable
3232
--> $DIR/lint-unused-mut-variables.rs:28:9
3333
|
34-
LL | let mut b = 3; //[lexical]~ ERROR: variable does not need to be mutable
34+
LL | let mut b = 3; //~ ERROR: variable does not need to be mutable
3535
| ----^
3636
| |
3737
| help: remove this `mut`
3838

3939
error: variable does not need to be mutable
4040
--> $DIR/lint-unused-mut-variables.rs:30:9
4141
|
42-
LL | let mut a = vec![3]; //[lexical]~ ERROR: variable does not need to be mutable
42+
LL | let mut a = vec![3]; //~ ERROR: variable does not need to be mutable
4343
| ----^
4444
| |
4545
| help: remove this `mut`
4646

4747
error: variable does not need to be mutable
4848
--> $DIR/lint-unused-mut-variables.rs:32:10
4949
|
50-
LL | let (mut a, b) = (1, 2); //[lexical]~ ERROR: variable does not need to be mutable
50+
LL | let (mut a, b) = (1, 2); //~ ERROR: variable does not need to be mutable
5151
| ----^
5252
| |
5353
| help: remove this `mut`
5454

5555
error: variable does not need to be mutable
5656
--> $DIR/lint-unused-mut-variables.rs:34:9
5757
|
58-
LL | let mut a; //[lexical]~ ERROR: variable does not need to be mutable
58+
LL | let mut a; //~ ERROR: variable does not need to be mutable
5959
| ----^
6060
| |
6161
| help: remove this `mut`
6262

6363
error: variable does not need to be mutable
6464
--> $DIR/lint-unused-mut-variables.rs:38:9
6565
|
66-
LL | let mut b; //[lexical]~ ERROR: variable does not need to be mutable
66+
LL | let mut b; //~ ERROR: variable does not need to be mutable
6767
| ----^
6868
| |
6969
| help: remove this `mut`
7070

7171
error: variable does not need to be mutable
7272
--> $DIR/lint-unused-mut-variables.rs:47:9
7373
|
74-
LL | mut x => {} //[lexical]~ ERROR: variable does not need to be mutable
74+
LL | mut x => {} //~ ERROR: variable does not need to be mutable
7575
| ----^
7676
| |
7777
| help: remove this `mut`
7878

7979
error: variable does not need to be mutable
8080
--> $DIR/lint-unused-mut-variables.rs:51:8
8181
|
82-
LL | (mut x, 1) | //[lexical]~ ERROR: variable does not need to be mutable
82+
LL | (mut x, 1) | //~ ERROR: variable does not need to be mutable
8383
| ----^
8484
| |
8585
| help: remove this `mut`
8686

8787
error: variable does not need to be mutable
8888
--> $DIR/lint-unused-mut-variables.rs:64:9
8989
|
90-
LL | let mut a = &mut 5; //[lexical]~ ERROR: variable does not need to be mutable
90+
LL | let mut a = &mut 5; //~ ERROR: variable does not need to be mutable
9191
| ----^
9292
| |
9393
| help: remove this `mut`
9494

9595
error: variable does not need to be mutable
9696
--> $DIR/lint-unused-mut-variables.rs:69:9
9797
|
98-
LL | let mut b = (&mut a,); //[lexical]~ ERROR: variable does not need to be mutable
98+
LL | let mut b = (&mut a,); //~ ERROR: variable does not need to be mutable
9999
| ----^
100100
| |
101101
| help: remove this `mut`
102102

103103
error: variable does not need to be mutable
104104
--> $DIR/lint-unused-mut-variables.rs:72:9
105105
|
106-
LL | let mut x = &mut 1; //[lexical]~ ERROR: variable does not need to be mutable
106+
LL | let mut x = &mut 1; //~ ERROR: variable does not need to be mutable
107107
| ----^
108108
| |
109109
| help: remove this `mut`
110110

111111
error: variable does not need to be mutable
112112
--> $DIR/lint-unused-mut-variables.rs:84:9
113113
|
114-
LL | let mut v : &mut Vec<()> = &mut vec![]; //[lexical]~ ERROR: variable does not need to be mutable
114+
LL | let mut v : &mut Vec<()> = &mut vec![]; //~ ERROR: variable does not need to be mutable
115115
| ----^
116116
| |
117117
| help: remove this `mut`
118118

119119
error: variable does not need to be mutable
120120
--> $DIR/lint-unused-mut-variables.rs:61:13
121121
|
122-
LL | fn what(mut foo: isize) {} //[lexical]~ ERROR: variable does not need to be mutable
122+
LL | fn what(mut foo: isize) {} //~ ERROR: variable does not need to be mutable
123123
| ----^^^
124124
| |
125125
| help: remove this `mut`
@@ -135,7 +135,7 @@ LL | fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] {
135135
error: variable does not need to be mutable
136136
--> $DIR/lint-unused-mut-variables.rs:143:9
137137
|
138-
LL | let mut b = vec![2]; //[lexical]~ ERROR: variable does not need to be mutable
138+
LL | let mut b = vec![2]; //~ ERROR: variable does not need to be mutable
139139
| ----^
140140
| |
141141
| help: remove this `mut`

0 commit comments

Comments
 (0)
Please sign in to comment.