rust/tests/ui/const-generics/associated-const-bindings/dyn-compat-const-projection-behind-trait-alias-mentions-self.stderr
2026-02-10 06:28:03 +01:00

23 lines
980 B
Text

error: the constant `Hold::<Self>` is not of type `i32`
--> $DIR/dyn-compat-const-projection-behind-trait-alias-mentions-self.rs:17:21
|
LL | trait Bound = Trait<Y = { Hold::<Self> }>;
| ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct constructor
|
note: required by a const generic parameter in `Bound`
--> $DIR/dyn-compat-const-projection-behind-trait-alias-mentions-self.rs:17:21
|
LL | trait Bound = Trait<Y = { Hold::<Self> }>;
| ^^^^^^^^^^^^^^^^^^^^ required by this const generic parameter in `Bound`
error: associated constant binding in trait object type mentions `Self`
--> $DIR/dyn-compat-const-projection-behind-trait-alias-mentions-self.rs:21:12
|
LL | trait Bound = Trait<Y = { Hold::<Self> }>;
| -------------------- this binding mentions `Self`
...
LL | let _: dyn Bound;
| ^^^^^^^^^ contains a mention of `Self`
error: aborting due to 2 previous errors