``` #![allow(incomplete_features)] #![feature(const_generics)] use std::mem; pub trait Trait { type Associated : Sized; fn associated_size(&self) -> usize { [0u8; mem::size_of::<Self::Associated>()]; 0 } } fn main() { } ``` results in: ``` error: internal compiler error: src/librustc_traits/normalize_erasing_regions.rs:34: could not fully normalize `fn() -> usize {std::mem::size_of::<<Self as Trait>::Associated>}` thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:889:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.42.0-nightly (da3629b05 2019-12-29) running on x86_64-unknown-linux-gnu error: aborting due to previous error ``` Removing the const_generics feature flag gets the expected error message: ``` error[E0220]: associated type `Associated` not found for `Self` --> normalize-err.rs:10:36 | 10 | [0u8; mem::size_of::<Self::Associated>()]; | ^^^^^^^^^^ associated type `Associated` not found error: aborting due to previous error For more information about this error, try `rustc --explain E0220`. ``` (IIUC that itself is a bug related to #43408) Using `mem::size_of::<Self::Associated>()` directly outside of a const-context works, which I guess is something const_generics enables that isn't otherwise allowed. Finally, the error message is the same whether or not the code is in a provided method or a impl block; I actually ran into the bug in the later.