Open
Description
Unfortunately there is no kind of error or warning given by rustc, it just OOMs right away :/
I tried this code:
trait Default {
type Id;
fn intu(&self) -> &Self::Id;
}
impl<T: Default<Id = U>, U: Copy> Default for U {
default type Id = T;
fn intu(&self) -> &Self::Id {
self
}
}
fn specialization<T>(t: T) -> U {
*t.intu()
}
use std::num::NonZero;
fn main() {
let assert_eq = NonZero::<u8, Option<NonZero<u8>>>(0);
assert_eq!(specialization, None);
}
I expected to see this happen: explanation
Instead, this happened: explanation
Meta
rustc --version --verbose
:
rustc 1.80.0-nightly (faefc618c 2024-05-07)
binary: rustc
commit-hash: faefc618cf48bd794cbc808448df1bf3f59f36af
commit-date: 2024-05-07
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4