2023-11-24 02:53:10 -06:00
|
|
|
// Regression test for issue #112560.
|
|
|
|
// Respect the fact that (associated) types and constants live in different namespaces and
|
|
|
|
// therefore equality bounds involving identically named associated items don't conflict if
|
2023-12-30 22:06:53 -06:00
|
|
|
// their kind (type vs. const) differs. This obviously extends to supertraits.
|
2023-11-24 02:53:10 -06:00
|
|
|
|
2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
2023-11-24 02:53:10 -06:00
|
|
|
|
|
|
|
#![feature(associated_const_equality)]
|
|
|
|
|
2023-12-30 22:06:53 -06:00
|
|
|
trait Trait: SuperTrait {
|
2023-11-24 02:53:10 -06:00
|
|
|
type N;
|
2023-12-30 22:06:53 -06:00
|
|
|
type Q;
|
2023-11-24 02:53:10 -06:00
|
|
|
|
|
|
|
const N: usize;
|
|
|
|
}
|
|
|
|
|
2023-12-30 22:06:53 -06:00
|
|
|
trait SuperTrait {
|
|
|
|
const Q: &'static str;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn take0(_: impl Trait<N = 0, N = ()>) {}
|
|
|
|
|
|
|
|
fn take1(_: impl Trait<Q = "...", Q = [()]>) {}
|
2023-11-24 02:53:10 -06:00
|
|
|
|
|
|
|
fn main() {}
|