Closed
Description
snippet:
#![feature(arbitrary_self_types, dispatch_from_dyn)]
use std::ops::{Deref, DispatchFromDyn};
trait Trait<T: Deref<Target = Self> + DispatchFromDyn<T>> {
fn MONO_BUF(self: T) -> dyn Trait<T>;
}
fn main() {}
Version information
rustc 1.80.0-nightly (366da30d5 2024-05-31)
binary: rustc
commit-hash: 366da30d554719e7490950aeea5d3f3a5927e313
commit-date: 2024-05-31
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
warning: trait `Trait` is never used
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:5:7
|
5 | trait Trait<T: Deref<Target = Self> + DispatchFromDyn<T>> {
| ^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: trait method `MONO_BUF` should have a snake case name
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:8
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^ help: convert the identifier to snake case: `mono_buf`
|
= note: `#[warn(non_snake_case)]` on by default
warning: 2 warnings emitted
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: error: the type `T` has an unknown layout
while computing layout for type T/#1
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:5
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: delayed at compiler/rustc_trait_selection/src/traits/object_safety.rs:507:35 - disabled backtrace
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:5
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: internal compiler error: receiver when `Self = ()` should have a Scalar ABI; found None
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:5
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: delayed at compiler/rustc_trait_selection/src/traits/object_safety.rs:523:31 - disabled backtrace
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:5
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: internal compiler error: receiver when `Self = (dyn Trait<T> + 'static)` should have a ScalarPair ABI; found None
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:5
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: delayed at compiler/rustc_trait_selection/src/traits/object_safety.rs:541:31 - disabled backtrace
--> /tmp/icemaker_global_tempdir.LMPz7J6APUgI/rustc_testrunner_tmpdir_reporting.JILMpr3PO0Dq/mvce.rs:6:5
|
6 | fn MONO_BUF(self: T) -> dyn Trait<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please make sure that you have updated to the latest nightly
note: rustc 1.80.0-nightly (366da30d5 2024-05-31) running on x86_64-unknown-linux-gnu
query stack during panic:
end of query stack
@rustbot label +F-arbitrary_self_types +F-dispatch_from_dyn
Metadata
Metadata
Assignees
Labels
Area: Memory layout of typesCategory: This is a bug.`#![feature(arbitrary_self_types)]``#![feature(dispatch_from_dyn)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: This bug is tracked inside the repo by a `known-bug` test.Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.