@@ -4,6 +4,8 @@ error: `impl Sized` will capture more lifetimes than possibly intended in editio
4
4
LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
5
5
| ^^^^^^^^^^
6
6
|
7
+ = warning: this changes meaning in Rust 2024
8
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
7
9
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
8
10
--> $DIR/overcaptures-2024.rs:6:10
9
11
|
@@ -21,13 +23,15 @@ LL | fn named<'a>(x: &'a i32) -> impl Sized + use<> { *x }
21
23
| +++++++
22
24
23
25
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
24
- --> $DIR/overcaptures-2024.rs:9 :25
26
+ --> $DIR/overcaptures-2024.rs:10 :25
25
27
|
26
28
LL | fn implicit(x: &i32) -> impl Sized { *x }
27
29
| ^^^^^^^^^^
28
30
|
31
+ = warning: this changes meaning in Rust 2024
32
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
29
33
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
30
- --> $DIR/overcaptures-2024.rs:9 :16
34
+ --> $DIR/overcaptures-2024.rs:10 :16
31
35
|
32
36
LL | fn implicit(x: &i32) -> impl Sized { *x }
33
37
| ^
@@ -38,13 +42,15 @@ LL | fn implicit(x: &i32) -> impl Sized + use<> { *x }
38
42
| +++++++
39
43
40
44
error: `impl Sized + '_` will capture more lifetimes than possibly intended in edition 2024
41
- --> $DIR/overcaptures-2024.rs:14 :33
45
+ --> $DIR/overcaptures-2024.rs:16 :33
42
46
|
43
47
LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
44
48
| ^^^^^^^^^^^^^^^
45
49
|
50
+ = warning: this changes meaning in Rust 2024
51
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
46
52
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
47
- --> $DIR/overcaptures-2024.rs:14 :24
53
+ --> $DIR/overcaptures-2024.rs:16 :24
48
54
|
49
55
LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
50
56
| ^
@@ -55,13 +61,15 @@ LL | fn hello(&self, x: &i32) -> impl Sized + '_ + use<'_> { self }
55
61
| +++++++++
56
62
57
63
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
58
- --> $DIR/overcaptures-2024.rs:25 :47
64
+ --> $DIR/overcaptures-2024.rs:28 :47
59
65
|
60
66
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
61
67
| ^^^^^^^^^^
62
68
|
69
+ = warning: this changes meaning in Rust 2024
70
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
63
71
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
64
- --> $DIR/overcaptures-2024.rs:25 :23
72
+ --> $DIR/overcaptures-2024.rs:28 :23
65
73
|
66
74
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
67
75
| ^^
0 commit comments