File: bad-params.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (43 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download | duplicates (3)
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
error[E0800]: cannot find type or const parameter `T` in this scope
  --> $DIR/bad-params.rs:1:34
   |
LL | fn missing() -> impl Sized + use<T> {}
   |                                  ^ not found in this scope
   |
help: you might be missing a type parameter
   |
LL | fn missing<T>() -> impl Sized + use<T> {}
   |           +++

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

error[E0799]: expected type or const parameter, found function `hello`
  --> $DIR/bad-params.rs:13:32
   |
LL | fn hello() -> impl Sized + use<hello> {}
   |                                ^^^^^ not a type or const parameter

error[E0799]: expected type or const parameter, found local variable `x`
  --> $DIR/bad-params.rs:16:35
   |
LL | fn arg(x: ()) -> impl Sized + use<x> {}
   |                                   ^ not a type or const parameter

error[E0799]: `Self` can't be captured in `use<...>` precise captures list, since it is an alias
  --> $DIR/bad-params.rs:9:48
   |
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 Sized + use<Self> {}
   |                                                ^^^^

error: aborting due to 5 previous errors

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