Code
use std::ops::BitOr;
pub trait IntWrapper {
type InternalStorage;
}
impl<T> BitOr for dyn IntWrapper<InternalStorage = T>
where
Self: Sized,
T: BitOr + BitOr<Output = T>,
{
type Output = Self;
fn bitor(self, _other: Self) -> Self {
todo!()
}
}
Meta
Via the playground on all of stable, beta, and nightly.
note: rustc 1.48.0 (7eac88a 2020-11-16) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
Error output
Compiling playground v0.0.1 (/playground)
error: internal compiler error: `!Sized` return type
--> src/lib.rs:13:37
|
13 | fn bitor(self, _other: Self) -> Self {
| ^^^^
|
= note: delayed at compiler/rustc_typeck/src/check/check.rs:154:18
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
Credit
Discovered by rectang as reported on the user forum.
Code
Meta
Via the playground on all of stable, beta, and nightly.
Error output
Credit
Discovered by rectang as reported on the user forum.