2024-04-21 15:27:27 +00:00
|
|
|
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:7:29
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2024-08-26 06:46:56 +00:00
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
2024-04-21 15:27:27 +00:00
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:7:10
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
|
|
|
|
| ^^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
note: the lint level is defined here
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:5:9
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | #![deny(impl_trait_overcaptures)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
2024-06-05 20:18:52 +00:00
|
|
|
LL | fn named<'a>(x: &'a i32) -> impl Sized + use<> { *x }
|
|
|
|
| +++++++
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:11:25
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn implicit(x: &i32) -> impl Sized { *x }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2024-08-26 06:46:56 +00:00
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
2024-04-21 15:27:27 +00:00
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:11:16
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn implicit(x: &i32) -> impl Sized { *x }
|
|
|
|
| ^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
2024-06-05 20:18:52 +00:00
|
|
|
LL | fn implicit(x: &i32) -> impl Sized + use<> { *x }
|
|
|
|
| +++++++
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
error: `impl Sized + '_` will capture more lifetimes than possibly intended in edition 2024
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:17:33
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
2024-08-26 06:46:56 +00:00
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
2024-04-21 15:27:27 +00:00
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:17:24
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
|
|
|
|
| ^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
2024-06-05 20:18:52 +00:00
|
|
|
LL | fn hello(&self, x: &i32) -> impl Sized + '_ + use<'_> { self }
|
|
|
|
| +++++++++
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:29:47
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2024-08-26 06:46:56 +00:00
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
2024-04-21 15:27:27 +00:00
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:29:23
|
2024-04-21 15:27:27 +00:00
|
|
|
|
|
|
|
|
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
|
|
|
|
| ^^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
2024-06-05 20:18:52 +00:00
|
|
|
LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized + use<>> {}
|
|
|
|
| +++++++
|
2024-04-21 15:27:27 +00:00
|
|
|
|
2024-11-09 19:16:43 +00:00
|
|
|
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:33:28
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
|
LL | fn apit(_: &impl Sized) -> impl Sized {}
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:33:12
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
|
LL | fn apit(_: &impl Sized) -> impl Sized {}
|
|
|
|
| ^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:33:13
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
|
LL | fn apit(_: &impl Sized) -> impl Sized {}
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - fn apit(_: &impl Sized) -> impl Sized {}
|
|
|
|
LL + fn apit<T: Sized>(_: &T) -> impl Sized + use<T> {}
|
|
|
|
|
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:37:38
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
|
LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:37:16
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
|
LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
|
|
|
|
| ^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
|
2024-11-09 18:21:03 +00:00
|
|
|
--> $DIR/overcaptures-2024.rs:37:17
|
2024-11-09 19:16:43 +00:00
|
|
|
|
|
|
|
|
LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
|
|
|
|
LL + fn apit2<U, T: Sized>(_: &T, _: U) -> impl Sized + use<U, T> {}
|
|
|
|
|
|
2024-11-09 19:16:43 +00:00
|
|
|
|
2024-11-09 18:21:03 +00:00
|
|
|
error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
|
|
|
|
--> $DIR/overcaptures-2024.rs:41:37
|
|
|
|
|
|
|
|
|
LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
|
|
|
--> $DIR/overcaptures-2024.rs:41:19
|
|
|
|
|
|
|
|
|
LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
|
|
|
|
| ^^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
|
|
|
LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized + use<> {}
|
|
|
|
| +++++++
|
|
|
|
|
2024-12-10 20:41:24 +00:00
|
|
|
error: `impl Clone` will capture more lifetimes than possibly intended in edition 2024
|
|
|
|
--> $DIR/overcaptures-2024.rs:45:28
|
|
|
|
|
|
|
|
|
LL | pub fn parens(x: &i32) -> &impl Clone { x }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= warning: this changes meaning in Rust 2024
|
|
|
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
|
|
|
|
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
|
|
|
|
--> $DIR/overcaptures-2024.rs:45:18
|
|
|
|
|
|
|
|
|
LL | pub fn parens(x: &i32) -> &impl Clone { x }
|
|
|
|
| ^
|
|
|
|
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
|
|
|
|
help: use the precise capturing `use<...>` syntax to make the captures explicit
|
|
|
|
|
|
|
|
|
LL | pub fn parens(x: &i32) -> &(impl Clone + use<>) { x }
|
|
|
|
| + ++++++++
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2024-04-21 15:27:27 +00:00
|
|
|
|