summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/bad-params.stderr
blob: 27bf05302f9b17787a31c38dec680f83f9c0103d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
error[E0412]: cannot find type `T` in this scope
  --> $DIR/bad-params.rs:4:26
   |
LL | fn missing() -> impl use<T> Sized {}
   |                          ^ not found in this scope
   |
help: you might be missing a type parameter
   |
LL | fn missing<T>() -> impl use<T> Sized {}
   |           +++

error[E0411]: cannot find type `Self` in this scope
  --> $DIR/bad-params.rs:7:31
   |
LL | fn missing_self() -> impl use<Self> Sized {}
   |    ------------               ^^^^ `Self` is only available in impls, traits, and type definitions
   |    |
   |    `Self` not allowed in a function

warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/bad-params.rs:1:12
   |
LL | #![feature(precise_capturing)]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
   = note: `#[warn(incomplete_features)]` on by default

error: `Self` can't be captured in `use<...>` precise captures list, since it is an alias
  --> $DIR/bad-params.rs:12:40
   |
LL | impl MyType {
   | ----------- `Self` is not a generic argument, but an alias to the type of the implementation
LL |     fn self_is_not_param() -> impl use<Self> Sized {}
   |                                        ^^^^

error: expected type or const parameter in `use<...>` precise captures list, found function
  --> $DIR/bad-params.rs:16:24
   |
LL | fn hello() -> impl use<hello> Sized {}
   |                        ^^^^^

error: aborting due to 4 previous errors; 1 warning emitted

Some errors have detailed explanations: E0411, E0412.
For more information about an error, try `rustc --explain E0411`.