Closed
Description
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
Metadata
Metadata
Assignees
Labels
Area: Dynamically-sized types (DSTs)Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️High priorityRelevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.Performance or correctness regression from one stable version to another.