rust/tests/ui/const-generics/assoc_const_eq_diagnostic.rs
León Orell Valerian Liehr 55559d93e7
Resolve assoc item bindings by namespace
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.
2023-12-07 22:33:56 +01:00

20 lines
368 B
Rust

#![feature(associated_const_equality)]
pub enum Mode {
Cool,
}
pub trait Parse {
const MODE: Mode;
}
pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
//~^ ERROR expected type, found variant
//~| ERROR expected constant, found type
//~| ERROR expected constant, found type
fn no_help() -> Mode::Cool {}
//~^ ERROR expected type, found variant
fn main() {}