-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: trimmed_def_paths
called, diagnostics were expected but none were emitted.
#138979
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
reduction: trait Storage {
type Buffer: ?Sized;
}
struct Array<const N: usize>;
impl<const N: usize> Storage for Array<N> {
type Buffer = [(); N];
}
struct Slice;
impl Storage for Slice {
type Buffer = [()];
}
struct Wrap<S: Storage> {
_b: S::Buffer,
}
fn coerce<const N: usize>(this: &Wrap<Array<N>>) -> &Wrap<Slice>
where
Array<N>: Storage,
{
coerce_again(this)
}
fn coerce_again<const N: usize>(this: &Wrap<Array<N>>) -> &Wrap<Slice> {
this
}
fn main() {
let inner: Wrap<Array<1>> = Wrap { _b: [(); 1] };
let _: &Wrap<Slice> = coerce(&inner);
} requires |
bisection: Regression in nightly-2024-09-28 fetching https://static.rust-lang.org/dist/2024-09-27/channel-rust-nightly-git-commit-hash.txt @rustbot label S-has-bisection |
also |
I get a different result when bisecting the provided repro. Regression in rust-lang-ci@5b5ad01 searched nightlies: from nightly-2024-08-30 to nightly-2025-03-27 bisected with cargo-bisect-rustc v0.6.9Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc 2024-08-30 --script test.sh cc @lqd does it ring a bell? thanks |
Seeing that I only changed the ICE message, you likely were bisecting too precisely for that and not the ICE in general? |
I had a quick look and nothing in either bisection stands out to me... I looked at the first bisection and tried to revert a few potential ones, didn't fix the ICE. The second bisection seems unrelated too as that shouldn't be causing a new ICE. EDIT: I'm getting 2024-09-26, not 2024-09-28. |
Regression in nightly-2024-09-26 fetching https://static.rust-lang.org/dist/2024-09-25/channel-rust-nightly-git-commit-hash.txt |
It's probably (at least root cause) due to 8fc8e03, which added new validation to the MIR validator. |
Rollup merge of rust-lang#139025 - compiler-errors:trim-validator-err, r=jieyouxu Do not trim paths in MIR validator From my inline comment: ``` // The type checker formats a bunch of strings with type names in it, but these strings // are not always going to be encountered on the error path since the inliner also uses // the validator, and there are certain kinds of inlining (even for valid code) that // can cause validation errors (mostly around where clauses and rigid projections). ``` Fixes rust-lang#138979 r? `@jieyouxu`
Thanks for the quick fix! I'm not sure how it falls in the release schedule. Will this fix be included as part of 1.86 or will it have to wait for 1.87 since 1.86 is already branched of main ? And if we have to wait for 1.87, are you aware of a workaround we could use in the meantime? |
A simple workaround could be to intentionally cause a warning temporarily, such as adding |
Thanks. Looks like it's even possible to silence the warning and still make it work by using |
Code
The error shows up on a
heapless
PR: https://github.com/rust-embedded/heapless/actions/runs/14080602762/job/39432486570Meta
The error reproduces on the latest nightly.
rustc --version --verbose
:Error output
The file Rustc tells me to include in the report: rustc-ice-2025-03-26T10_16_27-247085.txt
Backtrace
I saw #135673, which seems to be the same issue, but should be fixed (at least in the latest nightly), but as tested on nightly it fails.
The text was updated successfully, but these errors were encountered: