1
1
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
2
- --> $DIR/overcaptures-2024.rs:6 :29
2
+ --> $DIR/overcaptures-2024.rs:7 :29
3
3
|
4
4
LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
5
5
| ^^^^^^^^^^
6
6
|
7
7
= warning: this changes meaning in Rust 2024
8
8
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
9
9
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
10
- --> $DIR/overcaptures-2024.rs:6 :10
10
+ --> $DIR/overcaptures-2024.rs:7 :10
11
11
|
12
12
LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
13
13
| ^^
14
14
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
15
15
note: the lint level is defined here
16
- --> $DIR/overcaptures-2024.rs:4 :9
16
+ --> $DIR/overcaptures-2024.rs:5 :9
17
17
|
18
18
LL | #![deny(impl_trait_overcaptures)]
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,15 +23,15 @@ LL | fn named<'a>(x: &'a i32) -> impl Sized + use<> { *x }
23
23
| +++++++
24
24
25
25
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
26
- --> $DIR/overcaptures-2024.rs:10 :25
26
+ --> $DIR/overcaptures-2024.rs:11 :25
27
27
|
28
28
LL | fn implicit(x: &i32) -> impl Sized { *x }
29
29
| ^^^^^^^^^^
30
30
|
31
31
= warning: this changes meaning in Rust 2024
32
32
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
33
33
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
34
- --> $DIR/overcaptures-2024.rs:10 :16
34
+ --> $DIR/overcaptures-2024.rs:11 :16
35
35
|
36
36
LL | fn implicit(x: &i32) -> impl Sized { *x }
37
37
| ^
@@ -42,15 +42,15 @@ LL | fn implicit(x: &i32) -> impl Sized + use<> { *x }
42
42
| +++++++
43
43
44
44
error: `impl Sized + '_` will capture more lifetimes than possibly intended in edition 2024
45
- --> $DIR/overcaptures-2024.rs:16 :33
45
+ --> $DIR/overcaptures-2024.rs:17 :33
46
46
|
47
47
LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
48
48
| ^^^^^^^^^^^^^^^
49
49
|
50
50
= warning: this changes meaning in Rust 2024
51
51
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
52
52
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
53
- --> $DIR/overcaptures-2024.rs:16 :24
53
+ --> $DIR/overcaptures-2024.rs:17 :24
54
54
|
55
55
LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
56
56
| ^
@@ -61,15 +61,15 @@ LL | fn hello(&self, x: &i32) -> impl Sized + '_ + use<'_> { self }
61
61
| +++++++++
62
62
63
63
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
64
- --> $DIR/overcaptures-2024.rs:28 :47
64
+ --> $DIR/overcaptures-2024.rs:29 :47
65
65
|
66
66
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
67
67
| ^^^^^^^^^^
68
68
|
69
69
= warning: this changes meaning in Rust 2024
70
70
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
71
71
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
72
- --> $DIR/overcaptures-2024.rs:28 :23
72
+ --> $DIR/overcaptures-2024.rs:29 :23
73
73
|
74
74
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
75
75
| ^^
@@ -79,5 +79,24 @@ help: use the precise capturing `use<...>` syntax to make the captures explicit
79
79
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized + use<>> {}
80
80
| +++++++
81
81
82
- error: aborting due to 4 previous errors
82
+ error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
83
+ --> $DIR/overcaptures-2024.rs:33:37
84
+ |
85
+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
86
+ | ^^^^^^^^^^
87
+ |
88
+ = warning: this changes meaning in Rust 2024
89
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
90
+ note: specifically, this lifetime is in scope but not mentioned in the type's bounds
91
+ --> $DIR/overcaptures-2024.rs:33:19
92
+ |
93
+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
94
+ | ^^
95
+ = note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
96
+ help: use the precise capturing `use<...>` syntax to make the captures explicit
97
+ |
98
+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized + use<> {}
99
+ | +++++++
100
+
101
+ error: aborting due to 5 previous errors
83
102
0 commit comments