//@ build-pass // Regression test for #56870: Internal compiler error (traits & associated consts) use std::fmt::Debug; pub trait Foo { const FOO: *const u8; } impl Foo for dyn Debug { const FOO: *const u8 = ::fmt as *const u8; } pub trait Bar { const BAR: *const u8; } pub trait Baz { type Data: Debug; } pub struct BarStruct(S); impl Bar for BarStruct { const BAR: *const u8 = ::Data>>::FOO; } struct AnotherStruct; #[derive(Debug)] struct SomeStruct; impl Baz for AnotherStruct { type Data = SomeStruct; } fn main() { let _x = as Bar>::BAR; }