Skip to content

Commit 2b80ed9

Browse files
committed
remove feature(nll) in more cases.
1 parent b638aa1 commit 2b80ed9

33 files changed

+47
-81
lines changed

src/test/ui/issues/issue-27282-move-match-input-into-guard.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// reaches the panic code when executed, despite the compiler warning
88
// about that match arm being unreachable.
99

10-
#![feature(nll)]
11-
1210
fn main() {
1311
let b = &mut true;
1412
match b {

src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `b`
2-
--> $DIR/issue-27282-move-match-input-into-guard.rs:18:14
2+
--> $DIR/issue-27282-move-match-input-into-guard.rs:16:14
33
|
44
LL | let b = &mut true;
55
| - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait

src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Issue 27282: Example 1: This sidesteps the AST checks disallowing
22
// mutable borrows in match guards by hiding the mutable borrow in a
33
// guard behind a move (of the ref mut pattern id) within a closure.
4-
//
5-
// This example is not rejected by AST borrowck (and then reliably
6-
// segfaults when executed).
7-
8-
#![feature(nll)]
94

105
fn main() {
116
match Some(&4) {

src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0507]: cannot move out of `foo` in pattern guard
2-
--> $DIR/issue-27282-move-ref-mut-into-guard.rs:14:19
2+
--> $DIR/issue-27282-move-ref-mut-into-guard.rs:9:19
33
|
44
LL | if { (|| { let bar = foo; bar.take() })(); false } => {},
55
| ^^ ---

src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// diverges, and therefore a single final fake-read at the very end
1010
// after the final match arm would not suffice.
1111

12-
#![feature(nll)]
13-
1412
struct ForceFnOnce;
1513

1614
fn main() {

src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0510]: cannot mutably borrow `x` in match guard
2-
--> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:23:14
2+
--> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:21:14
33
|
44
LL | match x {
55
| - value is immutable in match guard

src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// occurs in the pattern-match itself, and not in the guard
1414
// expression.
1515

16-
#![feature(nll)]
17-
1816
struct ForceFnOnce;
1917

2018
fn main() {

src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0510]: cannot mutably borrow `x` in match guard
2-
--> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:28:18
2+
--> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:26:18
33
|
44
LL | match x {
55
| - value is immutable in match guard

src/test/ui/issues/issue-27282-mutate-before-diverging-arm-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// This case is interesting because a borrow of **x is untracked, because **x is
99
// immutable. However, for matches we care that **x refers to the same value
1010
// until we have chosen a match arm.
11-
#![feature(nll)]
11+
1212
struct ForceFnOnce;
1313
fn main() {
1414
let mut x = &mut &Some(&2);

src/test/ui/issues/issue-29723.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(nll)]
2-
31
// test for https://github.com/rust-lang/rust/issues/29723
42

53
fn main() {

src/test/ui/issues/issue-29723.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `s`
2-
--> $DIR/issue-29723.rs:12:13
2+
--> $DIR/issue-29723.rs:10:13
33
|
44
LL | let s = String::new();
55
| - move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait

src/test/ui/nll/borrowed-match-issue-45045.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Regression test for issue #45045
22

3-
#![feature(nll)]
4-
53
enum Xyz {
64
A,
75
B,

src/test/ui/nll/borrowed-match-issue-45045.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0503]: cannot use `e` because it was mutably borrowed
2-
--> $DIR/borrowed-match-issue-45045.rs:15:9
2+
--> $DIR/borrowed-match-issue-45045.rs:13:9
33
|
44
LL | let f = &mut e;
55
| ------ borrow of `e` occurs here

src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Test that the 'static bound from the Copy impl is respected. Regression test for #29149.
22

3-
#![feature(nll)]
4-
53
#[derive(Clone)] struct Foo<'a>(&'a u32);
64
impl Copy for Foo<'static> {}
75

src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: `s` does not live long enough
2-
--> $DIR/do-not-ignore-lifetime-bounds-in-copy.rs:10:17
2+
--> $DIR/do-not-ignore-lifetime-bounds-in-copy.rs:8:17
33
|
44
LL | let a = Foo(&s);
55
| ^^ borrowed value does not live long enough

src/test/ui/nll/enum-drop-access.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(nll)]
2-
31
enum DropOption<T> {
42
Some(T),
53
None,

src/test/ui/nll/enum-drop-access.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0713]: borrow may still be in use when destructor runs
2-
--> $DIR/enum-drop-access.rs:15:31
2+
--> $DIR/enum-drop-access.rs:13:31
33
|
44
LL | fn drop_enum(opt: DropOption<&mut i32>) -> Option<&mut i32> {
55
| - let's call the lifetime of this reference `'1`
@@ -13,7 +13,7 @@ LL | }
1313
| - here, drop of `opt` needs exclusive access to `*opt.0`, because the type `DropOption<&mut i32>` implements the `Drop` trait
1414

1515
error[E0713]: borrow may still be in use when destructor runs
16-
--> $DIR/enum-drop-access.rs:24:36
16+
--> $DIR/enum-drop-access.rs:22:36
1717
|
1818
LL | fn optional_drop_enum(opt: Option<DropOption<&mut i32>>) -> Option<&mut i32> {
1919
| - let's call the lifetime of this reference `'1`

src/test/ui/nll/issue-21232-partial-init-and-use.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// tests that are meant to continue failing to compile once
1313
// rust-lang/rust#54987 is implemented.
1414

15-
#![feature(nll)]
16-
1715
struct S<Y> {
1816
x: u32,
1917

src/test/ui/nll/issue-21232-partial-init-and-use.stderr

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0381]: assign to part of possibly-uninitialized variable: `s`
2-
--> $DIR/issue-21232-partial-init-and-use.rs:99:5
2+
--> $DIR/issue-21232-partial-init-and-use.rs:97:5
33
|
44
LL | s.x = 10; s.y = Box::new(20);
55
| ^^^^^^^^ use of possibly-uninitialized `s`
66

77
error[E0381]: assign to part of possibly-uninitialized variable: `t`
8-
--> $DIR/issue-21232-partial-init-and-use.rs:106:5
8+
--> $DIR/issue-21232-partial-init-and-use.rs:104:5
99
|
1010
LL | t.0 = 10; t.1 = Box::new(20);
1111
| ^^^^^^^^ use of possibly-uninitialized `t`
1212

1313
error[E0382]: assign to part of moved value: `s`
14-
--> $DIR/issue-21232-partial-init-and-use.rs:113:5
14+
--> $DIR/issue-21232-partial-init-and-use.rs:111:5
1515
|
1616
LL | let mut s: S<B> = S::new(); drop(s);
1717
| ----- - value moved here
@@ -21,7 +21,7 @@ LL | s.x = 10; s.y = Box::new(20);
2121
| ^^^^^^^^ value partially assigned here after move
2222

2323
error[E0382]: assign to part of moved value: `t`
24-
--> $DIR/issue-21232-partial-init-and-use.rs:120:5
24+
--> $DIR/issue-21232-partial-init-and-use.rs:118:5
2525
|
2626
LL | let mut t: T = (0, Box::new(0)); drop(t);
2727
| ----- - value moved here
@@ -31,19 +31,19 @@ LL | t.0 = 10; t.1 = Box::new(20);
3131
| ^^^^^^^^ value partially assigned here after move
3232

3333
error[E0381]: assign to part of possibly-uninitialized variable: `s`
34-
--> $DIR/issue-21232-partial-init-and-use.rs:127:5
34+
--> $DIR/issue-21232-partial-init-and-use.rs:125:5
3535
|
3636
LL | s.x = 10;
3737
| ^^^^^^^^ use of possibly-uninitialized `s`
3838

3939
error[E0381]: assign to part of possibly-uninitialized variable: `t`
40-
--> $DIR/issue-21232-partial-init-and-use.rs:134:5
40+
--> $DIR/issue-21232-partial-init-and-use.rs:132:5
4141
|
4242
LL | t.0 = 10;
4343
| ^^^^^^^^ use of possibly-uninitialized `t`
4444

4545
error[E0382]: assign to part of moved value: `s`
46-
--> $DIR/issue-21232-partial-init-and-use.rs:141:5
46+
--> $DIR/issue-21232-partial-init-and-use.rs:139:5
4747
|
4848
LL | let mut s: S<B> = S::new(); drop(s);
4949
| ----- - value moved here
@@ -53,7 +53,7 @@ LL | s.x = 10;
5353
| ^^^^^^^^ value partially assigned here after move
5454

5555
error[E0382]: assign to part of moved value: `t`
56-
--> $DIR/issue-21232-partial-init-and-use.rs:148:5
56+
--> $DIR/issue-21232-partial-init-and-use.rs:146:5
5757
|
5858
LL | let mut t: T = (0, Box::new(0)); drop(t);
5959
| ----- - value moved here
@@ -63,31 +63,31 @@ LL | t.0 = 10;
6363
| ^^^^^^^^ value partially assigned here after move
6464

6565
error[E0381]: assign to part of possibly-uninitialized variable: `s`
66-
--> $DIR/issue-21232-partial-init-and-use.rs:155:5
66+
--> $DIR/issue-21232-partial-init-and-use.rs:153:5
6767
|
6868
LL | s.x = 10;
6969
| ^^^^^^^^ use of possibly-uninitialized `s`
7070

7171
error[E0381]: assign to part of possibly-uninitialized variable: `t`
72-
--> $DIR/issue-21232-partial-init-and-use.rs:162:5
72+
--> $DIR/issue-21232-partial-init-and-use.rs:160:5
7373
|
7474
LL | t.0 = 10;
7575
| ^^^^^^^^ use of possibly-uninitialized `t`
7676

7777
error[E0381]: assign to part of possibly-uninitialized variable: `q`
78-
--> $DIR/issue-21232-partial-init-and-use.rs:178:5
78+
--> $DIR/issue-21232-partial-init-and-use.rs:176:5
7979
|
8080
LL | q.r.f.x = 10; q.r.f.y = Box::new(20);
8181
| ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f`
8282

8383
error[E0381]: assign to part of possibly-uninitialized variable: `q`
84-
--> $DIR/issue-21232-partial-init-and-use.rs:185:5
84+
--> $DIR/issue-21232-partial-init-and-use.rs:183:5
8585
|
8686
LL | q.r.f.0 = 10; q.r.f.1 = Box::new(20);
8787
| ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f`
8888

8989
error[E0382]: assign to part of moved value: `q.r`
90-
--> $DIR/issue-21232-partial-init-and-use.rs:192:5
90+
--> $DIR/issue-21232-partial-init-and-use.rs:190:5
9191
|
9292
LL | let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
9393
| --- value moved here
@@ -97,7 +97,7 @@ LL | q.r.f.x = 10; q.r.f.y = Box::new(20);
9797
= note: move occurs because `q.r` has type `R<S<std::boxed::Box<u32>>>`, which does not implement the `Copy` trait
9898

9999
error[E0382]: assign to part of moved value: `q.r`
100-
--> $DIR/issue-21232-partial-init-and-use.rs:199:5
100+
--> $DIR/issue-21232-partial-init-and-use.rs:197:5
101101
|
102102
LL | let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
103103
| --- value moved here
@@ -107,19 +107,19 @@ LL | q.r.f.0 = 10; q.r.f.1 = Box::new(20);
107107
= note: move occurs because `q.r` has type `R<(u32, std::boxed::Box<u32>)>`, which does not implement the `Copy` trait
108108

109109
error[E0381]: assign to part of possibly-uninitialized variable: `q`
110-
--> $DIR/issue-21232-partial-init-and-use.rs:206:5
110+
--> $DIR/issue-21232-partial-init-and-use.rs:204:5
111111
|
112112
LL | q.r.f.x = 10;
113113
| ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f`
114114

115115
error[E0381]: assign to part of possibly-uninitialized variable: `q`
116-
--> $DIR/issue-21232-partial-init-and-use.rs:213:5
116+
--> $DIR/issue-21232-partial-init-and-use.rs:211:5
117117
|
118118
LL | q.r.f.0 = 10;
119119
| ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f`
120120

121121
error[E0382]: assign to part of moved value: `q.r`
122-
--> $DIR/issue-21232-partial-init-and-use.rs:220:5
122+
--> $DIR/issue-21232-partial-init-and-use.rs:218:5
123123
|
124124
LL | let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
125125
| --- value moved here
@@ -129,7 +129,7 @@ LL | q.r.f.x = 10;
129129
= note: move occurs because `q.r` has type `R<S<std::boxed::Box<u32>>>`, which does not implement the `Copy` trait
130130

131131
error[E0382]: assign to part of moved value: `q.r`
132-
--> $DIR/issue-21232-partial-init-and-use.rs:227:5
132+
--> $DIR/issue-21232-partial-init-and-use.rs:225:5
133133
|
134134
LL | let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
135135
| --- value moved here
@@ -139,19 +139,19 @@ LL | q.r.f.0 = 10;
139139
= note: move occurs because `q.r` has type `R<(u32, std::boxed::Box<u32>)>`, which does not implement the `Copy` trait
140140

141141
error[E0381]: assign to part of possibly-uninitialized variable: `q`
142-
--> $DIR/issue-21232-partial-init-and-use.rs:234:5
142+
--> $DIR/issue-21232-partial-init-and-use.rs:232:5
143143
|
144144
LL | q.r.f.x = 10;
145145
| ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f`
146146

147147
error[E0381]: assign to part of possibly-uninitialized variable: `q`
148-
--> $DIR/issue-21232-partial-init-and-use.rs:241:5
148+
--> $DIR/issue-21232-partial-init-and-use.rs:239:5
149149
|
150150
LL | q.r.f.0 = 10;
151151
| ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f`
152152

153153
error[E0382]: assign to part of moved value: `c`
154-
--> $DIR/issue-21232-partial-init-and-use.rs:259:13
154+
--> $DIR/issue-21232-partial-init-and-use.rs:257:13
155155
|
156156
LL | let mut c = (1, "".to_owned());
157157
| ----- move occurs because `c` has type `(i32, std::string::String)`, which does not implement the `Copy` trait
@@ -162,7 +162,7 @@ LL | c.0 = 2;
162162
| ^^^^^^^ value partially assigned here after move
163163

164164
error[E0382]: assign to part of moved value: `c`
165-
--> $DIR/issue-21232-partial-init-and-use.rs:269:13
165+
--> $DIR/issue-21232-partial-init-and-use.rs:267:13
166166
|
167167
LL | let mut c = (1, (1, "".to_owned()));
168168
| ----- move occurs because `c` has type `(i32, (i32, std::string::String))`, which does not implement the `Copy` trait
@@ -173,7 +173,7 @@ LL | (c.1).0 = 2;
173173
| ^^^^^^^^^^^ value partially assigned here after move
174174

175175
error[E0382]: assign to part of moved value: `c.1`
176-
--> $DIR/issue-21232-partial-init-and-use.rs:277:13
176+
--> $DIR/issue-21232-partial-init-and-use.rs:275:13
177177
|
178178
LL | c2 => {
179179
| -- value moved here

src/test/ui/nll/issue-48238.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Regression test for issue #48238
22

3-
#![feature(nll)]
4-
53
fn use_val<'a>(val: &'a u8) -> &'a u8 {
64
val
75
}

src/test/ui/nll/issue-48238.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-48238.rs:11:13
2+
--> $DIR/issue-48238.rs:9:13
33
|
44
LL | move || use_val(&orig);
55
| ------- ^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`

src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// one of its fields, it is useful to be reminded of the significance
44
// of the fact that the type implements Drop.
55

6-
#![feature(nll)]
7-
86
pub struct S<'a> { url: &'a mut String }
97

108
impl<'a> Drop for S<'a> { fn drop(&mut self) { } }

src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0713]: borrow may still be in use when destructor runs
2-
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:13:5
2+
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:11:5
33
|
44
LL | fn finish_1(s: S) -> &mut String {
55
| - has type `S<'1>`
@@ -9,7 +9,7 @@ LL | }
99
| - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
1010

1111
error[E0713]: borrow may still be in use when destructor runs
12-
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:18:13
12+
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:16:13
1313
|
1414
LL | fn finish_2(s: S) -> &mut String {
1515
| - has type `S<'1>`
@@ -19,7 +19,7 @@ LL | }
1919
| - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
2020

2121
error[E0713]: borrow may still be in use when destructor runs
22-
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:23:21
22+
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:21:21
2323
|
2424
LL | fn finish_3(s: S) -> &mut String {
2525
| - has type `S<'1>`
@@ -29,7 +29,7 @@ LL | }
2929
| - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
3030

3131
error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait
32-
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:28:13
32+
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:26:13
3333
|
3434
LL | let p = s.url; p
3535
| ^^^^^

src/test/ui/nll/issue-53040.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(nll)]
2-
31
fn main() {
42
let mut v: Vec<()> = Vec::new();
53
|| &mut v;

0 commit comments

Comments
 (0)