mirror of https://github.com/rust-lang/rust
126 lines
4.0 KiB
Plaintext
126 lines
4.0 KiB
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | type Foo = impl Sized;
|
|
| ---------- the expected opaque type
|
|
...
|
|
LL | foo::<42>();
|
|
| ^^ expected opaque type, found integer
|
|
|
|
|
= note: expected opaque type `Foo`
|
|
found type `{integer}`
|
|
|
|
error[E0391]: cycle detected when computing type of `Foo::{opaque#0}`
|
|
--> $DIR/opaque_types.rs:3:12
|
|
|
|
|
LL | type Foo = impl Sized;
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: ...which requires computing type of opaque `Foo::{opaque#0}`...
|
|
--> $DIR/opaque_types.rs:3:12
|
|
|
|
|
LL | type Foo = impl Sized;
|
|
| ^^^^^^^^^^
|
|
note: ...which requires type-checking `main`...
|
|
--> $DIR/opaque_types.rs:10:1
|
|
|
|
|
LL | fn main() {
|
|
| ^^^^^^^^^
|
|
note: ...which requires evaluating type-level constant...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires const-evaluating + checking `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires caching mir of `main::{constant#0}` for CTFE...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires elaborating drops for `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
= note: ...which requires normalizing `Foo`...
|
|
= note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle
|
|
note: cycle used when checking that `Foo::{opaque#0}` is well-formed
|
|
--> $DIR/opaque_types.rs:3:12
|
|
|
|
|
LL | type Foo = impl Sized;
|
|
| ^^^^^^^^^^
|
|
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
|
|
|
error: `Foo` is forbidden as the type of a const generic parameter
|
|
--> $DIR/opaque_types.rs:7:17
|
|
|
|
|
LL | fn foo<const C: Foo>() {}
|
|
| ^^^
|
|
|
|
|
= note: the only supported types are integers, `bool` and `char`
|
|
|
|
error[E0391]: cycle detected when computing type of opaque `Foo::{opaque#0}`
|
|
--> $DIR/opaque_types.rs:3:12
|
|
|
|
|
LL | type Foo = impl Sized;
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: ...which requires type-checking `main`...
|
|
--> $DIR/opaque_types.rs:10:1
|
|
|
|
|
LL | fn main() {
|
|
| ^^^^^^^^^
|
|
note: ...which requires evaluating type-level constant...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires const-evaluating + checking `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires caching mir of `main::{constant#0}` for CTFE...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires elaborating drops for `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires borrow-checking `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires promoting constants in MIR for `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
note: ...which requires const checking `main::{constant#0}`...
|
|
--> $DIR/opaque_types.rs:11:11
|
|
|
|
|
LL | foo::<42>();
|
|
| ^^
|
|
= note: ...which requires computing whether `Foo` is freeze...
|
|
= note: ...which requires evaluating trait selection obligation `Foo: core::marker::Freeze`...
|
|
= note: ...which again requires computing type of opaque `Foo::{opaque#0}`, completing the cycle
|
|
note: cycle used when computing type of `Foo::{opaque#0}`
|
|
--> $DIR/opaque_types.rs:3:12
|
|
|
|
|
LL | type Foo = impl Sized;
|
|
| ^^^^^^^^^^
|
|
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
Some errors have detailed explanations: E0308, E0391.
|
|
For more information about an error, try `rustc --explain E0308`.
|