about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src/error_codes/E0799.md
blob: 38ebc84060497be12afbb113811008e50ca01274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Something other than a type or const parameter has been used when one was
expected.

Erroneous code example:

```compile_fail,E0799
fn bad1() -> impl Sized + use<main> {}

fn bad2(x: ()) -> impl Sized + use<x> {}

fn main() {}
```

In the given examples, for `bad1`, the name `main` corresponds to a function
rather than a type or const parameter. In `bad2`, the name `x` corresponds to
a function argument rather than a type or const parameter.

Only type and const parameters, including `Self`, may be captured by
`use<...>` precise capturing bounds.