mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
55559d93e7
If a const is expected, resolve a const. If a type is expected, resolve a type. Don't try to resolve a type first falling back to consts.
24 lines
370 B
Rust
24 lines
370 B
Rust
// Checking that none of these ICE, which was introduced in
|
|
// https://github.com/rust-lang/rust/issues/93553
|
|
trait Foo {
|
|
type Bar;
|
|
}
|
|
|
|
trait Baz: Foo {
|
|
const Bar: Self::Bar;
|
|
}
|
|
|
|
trait Baz2: Foo {
|
|
const Bar: u32;
|
|
|
|
fn foo() -> Self::Bar;
|
|
}
|
|
|
|
trait Baz3 {
|
|
const BAR: usize;
|
|
const QUX: Self::BAR;
|
|
//~^ ERROR expected type, found constant
|
|
}
|
|
|
|
fn main() {}
|