Files
rust/tests/ui/statics/static-generic-param-soundness.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
882 B
Plaintext
Raw Normal View History

2023-09-10 23:06:14 +02:00
error[E0401]: can't use generic parameters from outer item
2025-06-12 20:49:48 +05:00
--> $DIR/static-generic-param-soundness.rs:16:19
2018-08-08 14:28:26 +02:00
|
LL | fn foo<T>() {
2023-09-10 23:06:14 +02:00
| - type parameter from outer item
2018-08-08 14:28:26 +02:00
LL | static a: Bar<T> = Bar::What;
2023-09-10 23:06:14 +02:00
| ^ use of generic parameter from outer item
|
= note: a `static` is a separate item from the item that contains it
2018-08-08 14:28:26 +02:00
error[E0392]: type parameter `T` is never used
2025-06-12 20:49:48 +05:00
--> $DIR/static-generic-param-soundness.rs:10:10
2018-08-08 14:28:26 +02:00
|
2025-06-12 20:49:48 +05:00
LL | enum Bar<T> {
| ^ unused type parameter
2018-08-08 14:28:26 +02:00
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
2018-08-08 14:28:26 +02:00
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0392, E0401.
2018-08-08 14:28:26 +02:00
For more information about an error, try `rustc --explain E0392`.