@@ -7,29 +7,24 @@ LL | #![feature(precise_capturing)]
7
7
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
8
8
= note: `#[warn(incomplete_features)]` on by default
9
9
10
- error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
11
- --> $DIR/forgot-to-capture-type.rs:4:58
10
+ error: `impl Trait` must mention all type parameters in scope
11
+ --> $DIR/forgot-to-capture-type.rs:4:15
12
12
|
13
- LL | fn lifetime_in_bounds<'a>(x: &'a ()) -> impl use<> Into<&'a ()> { x }
14
- | -- -----------------^^----
15
- | | |
16
- | | lifetime captured due to being mentioned in the bounds of the `impl Trait`
17
- | this lifetime parameter is captured
18
-
19
- error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
20
- --> $DIR/forgot-to-capture-type.rs:7:60
13
+ LL | fn type_param<T>() -> impl use<> Sized {}
14
+ | ^ ---------------- type parameter is implicitly captured by this `impl Trait`
21
15
|
22
- LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl use<> Sized { x }
23
- | -- ---------------- ^
24
- | | |
25
- | | opaque type defined here
26
- | hidden type `&'a ()` captures the lifetime `'a` as defined here
16
+ = note: currently, all type parameters are required to be mentioned in the precise captures list
17
+
18
+ error: `impl Trait` must mention all type parameters in scope
19
+ --> $DIR/forgot-to-capture-type.rs:7:1
27
20
|
28
- help: to declare that `impl Sized` captures `'a`, you can add an explicit `'a` lifetime bound
21
+ LL | trait Foo {
22
+ | ^^^^^^^^^
23
+ LL |
24
+ LL | fn bar() -> impl use<> Sized;
25
+ | ---------------- type parameter is implicitly captured by this `impl Trait`
29
26
|
30
- LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl use<> Sized + 'a { x }
31
- | ++++
27
+ = note: currently, all type parameters are required to be mentioned in the precise captures list
32
28
33
29
error: aborting due to 2 previous errors; 1 warning emitted
34
30
35
- For more information about this error, try `rustc --explain E0700`.
0 commit comments