-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.Issue: Problems and improvements with respect to memory usage during compilation.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priorityMedium priorityregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
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
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.Issue: Problems and improvements with respect to memory usage during compilation.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priorityMedium priorityregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Projects
Relationships
Development
Select code repository
Activity
matthiaskrgr commentedon May 8, 2024
matthiaskrgr commentedon May 8, 2024
This gave an error back in
1.76
but in1.77
it started just OOM without giving any output.1.76:
cuviper commentedon May 10, 2024
Infinite recursion from
cycle_error
? Here's a more detailed backtrace from a debug build:Since
stacker::maybe_grow
is in there, it can recurse until OOM.apiraino commentedon May 10, 2024
Bisection points to fb4bca0 (but unsure if directly related) cc @reitermarkus @dtolnay
bisected with cargo-bisect-rustc v0.6.8
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
apiraino commentedon May 10, 2024
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-medium
cuviper commentedon May 10, 2024
This frame is suspicious, since the code around it is already trying to avoid infinite recursion:
rust/compiler/rustc_query_impl/src/plumbing.rs
Lines 328 to 334 in cf77474
cc @Zoxc who added that
reduce_queries
check.I think maybe it should set the reduced state here, e.g. this seems to work:
8 remaining items