Skip to content

ICE: Failed to normalize Alias(Free, AliasTy { #141380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
matthiaskrgr opened this issue May 22, 2025 · 7 comments
Open

ICE: Failed to normalize Alias(Free, AliasTy { #141380

matthiaskrgr opened this issue May 22, 2025 · 7 comments
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

trait Trait<T> {}
type Alias<P: Trait> = impl Trait<U>;

pub enum UninhabitedVariants {
    Tuple(Alias),
}

fn uwu(x: UninhabitedVariants) {
    match x {}
}

original:

// regression test for #127353

#![feature(WithEmplacableForFn)]
trait Trait<T> {}
type Alias<P: Trait> = impl Trait<U>;

pub enum UninhabitedVariants {
    Tuple(Alias),
    //~^ ERROR missing lifetime specifier
    //~| ERROR missing generics
}

#[define_opaque(Alias)]
fn uwu(x: UninhabitedVariants) {
    match x {}
    //~^ ERROR non-exhaustive patterns
}

fn main() {}

Version information

rustc 1.89.0-nightly (5df0f729f 2025-05-21)
binary: rustc
commit-hash: 5df0f729f5355cb3cd91f6bcff13566ae96dc220
commit-date: 2025-05-21
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Possibly related line of code:

fn normalize_generic_arg_after_erasing_regions(
&self,
arg: ty::GenericArg<'tcx>,
) -> ty::GenericArg<'tcx> {
let arg = self.typing_env.as_query_input(arg);
self.tcx.try_normalize_generic_arg_after_erasing_regions(arg).unwrap_or_else(|_| {
bug!(
"Failed to normalize {:?} in typing_env={:?}, \
maybe try to call `try_normalize_erasing_regions` instead",
arg.value,
self.typing_env,
)
})

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0412]: cannot find type `U` in this scope
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:2:35
  |
2 | type Alias<P: Trait> = impl Trait<U>;
  |            -                      ^ help: a type parameter with a similar name exists: `P`
  |            |
  |            similarly named type parameter `P` defined here

error[E0658]: `impl Trait` in type aliases is unstable
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:2:24
  |
2 | type Alias<P: Trait> = impl Trait<U>;
  |                        ^^^^^^^^^^^^^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
  = note: this compiler was built on 2025-05-21; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:10:2
   |
10 | }
   |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs`

error[E0107]: missing generics for trait `Trait`
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:2:15
  |
2 | type Alias<P: Trait> = impl Trait<U>;
  |               ^^^^^ expected 1 generic argument
  |
note: trait defined here, with 1 generic parameter: `T`
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:1:7
  |
1 | trait Trait<T> {}
  |       ^^^^^ -
help: add missing generic argument
  |
2 | type Alias<P: Trait<T>> = impl Trait<U>;
  |                    +++

error[E0107]: missing generics for type alias `Alias`
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:5:11
  |
5 |     Tuple(Alias),
  |           ^^^^^ expected 1 generic argument
  |
note: type alias defined here, with 1 generic parameter: `P`
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:2:6
  |
2 | type Alias<P: Trait> = impl Trait<U>;
  |      ^^^^^ -
help: add missing generic argument
  |
5 |     Tuple(Alias<P>),
  |                +++

error: unconstrained opaque type
 --> /tmp/icemaker_global_tempdir.xe1wnEfpxqbR/rustc_testrunner_tmpdir_reporting.uicvEyZQMqkA/mvce.rs:2:24
  |
2 | type Alias<P: Trait> = impl Trait<U>;
  |                        ^^^^^^^^^^^^^
  |
  = note: `Alias` must be used in combination with a concrete type within the same crate

error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:171:13: Failed to normalize Alias(Free, AliasTy { args: [{type error}], def_id: DefId(0:5 ~ mvce[5ed8]::Alias), .. }) in typing_env=TypingEnv { typing_mode: Analysis { defining_opaque_types_and_generators: [] }, param_env: ParamEnv { caller_bounds: [] } }, maybe try to call `try_normalize_erasing_regions` instead


thread 'rustc' panicked at compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:171:13:
Box<dyn Any>
stack backtrace:
   0:     0x785763574943 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hc8215a9c66aef2ea
   1:     0x785763c05a77 - core::fmt::write::h3f8319699ee957ae
   2:     0x78576507c8d1 - std::io::Write::write_fmt::h7f7ae6e4cf0613ba
   3:     0x7857635747a2 - std::sys::backtrace::BacktraceLock::print::h772c5bb915649b23
   4:     0x78576357839a - std::panicking::default_hook::{{closure}}::h5a4bb9d04f4fb636
   5:     0x785763577f1f - std::panicking::default_hook::h7a3399257665eec0
   6:     0x7857625a0003 - std[87abf682fc70726]::panicking::update_hook::<alloc[be5c6767dc16e40]::boxed::Box<rustc_driver_impl[67fa6dff91713239]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x785763578c13 - std::panicking::rust_panic_with_hook::h1d16204f4298f006
   8:     0x7857625dc471 - std[87abf682fc70726]::panicking::begin_panic::<rustc_errors[c4c2187cf855cad6]::ExplicitBug>::{closure#0}
   9:     0x7857625d04a6 - std[87abf682fc70726]::sys::backtrace::__rust_end_short_backtrace::<std[87abf682fc70726]::panicking::begin_panic<rustc_errors[c4c2187cf855cad6]::ExplicitBug>::{closure#0}, !>
  10:     0x7857625d0333 - std[87abf682fc70726]::panicking::begin_panic::<rustc_errors[c4c2187cf855cad6]::ExplicitBug>
  11:     0x7857625e6be1 - <rustc_errors[c4c2187cf855cad6]::diagnostic::BugAbort as rustc_errors[c4c2187cf855cad6]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x785762c5611a - rustc_middle[361c9b966945ad5f]::util::bug::opt_span_bug_fmt::<rustc_span[644369ff50095af5]::span_encoding::Span>::{closure#0}
  13:     0x785762c2f67a - rustc_middle[361c9b966945ad5f]::ty::context::tls::with_opt::<rustc_middle[361c9b966945ad5f]::util::bug::opt_span_bug_fmt<rustc_span[644369ff50095af5]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x785762c2f4eb - rustc_middle[361c9b966945ad5f]::ty::context::tls::with_context_opt::<rustc_middle[361c9b966945ad5f]::ty::context::tls::with_opt<rustc_middle[361c9b966945ad5f]::util::bug::opt_span_bug_fmt<rustc_span[644369ff50095af5]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x78575fe8a2b0 - rustc_middle[361c9b966945ad5f]::util::bug::bug_fmt
  16:     0x78576440cc58 - <rustc_middle[361c9b966945ad5f]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_type_ir[a70c36853e4e3da4]::fold::TypeFolder<rustc_middle[361c9b966945ad5f]::ty::context::TyCtxt>>::fold_ty
  17:     0x785764c3a8bb - <rustc_pattern_analysis[1ef3719a35dbe2f]::rustc::RustcPatCtxt as rustc_pattern_analysis[1ef3719a35dbe2f]::PatCx>::ctor_sub_tys
  18:     0x785764c3a0fb - <rustc_pattern_analysis[1ef3719a35dbe2f]::pat::WitnessPat<rustc_pattern_analysis[1ef3719a35dbe2f]::rustc::RustcPatCtxt>>::wild_from_ctor
  19:     0x785763ff7eea - <rustc_pattern_analysis[1ef3719a35dbe2f]::usefulness::WitnessMatrix<rustc_pattern_analysis[1ef3719a35dbe2f]::rustc::RustcPatCtxt>>::apply_constructor
  20:     0x785763ffaa95 - rustc_pattern_analysis[1ef3719a35dbe2f]::usefulness::compute_exhaustiveness_and_usefulness::<rustc_pattern_analysis[1ef3719a35dbe2f]::rustc::RustcPatCtxt>::{closure#0}
  21:     0x7857640a6782 - rustc_pattern_analysis[1ef3719a35dbe2f]::rustc::analyze_match
  22:     0x78576444322d - <rustc_mir_build[e66f7be2fd208f8d]::thir::pattern::check_match::MatchVisitor as rustc_middle[361c9b966945ad5f]::thir::visit::Visitor>::visit_expr
  23:     0x7857644437af - <rustc_mir_build[e66f7be2fd208f8d]::thir::pattern::check_match::MatchVisitor as rustc_middle[361c9b966945ad5f]::thir::visit::Visitor>::visit_expr
  24:     0x785764442e0d - <rustc_mir_build[e66f7be2fd208f8d]::thir::pattern::check_match::MatchVisitor as rustc_middle[361c9b966945ad5f]::thir::visit::Visitor>::visit_expr
  25:     0x7857644437af - <rustc_mir_build[e66f7be2fd208f8d]::thir::pattern::check_match::MatchVisitor as rustc_middle[361c9b966945ad5f]::thir::visit::Visitor>::visit_expr
  26:     0x785764442e0d - <rustc_mir_build[e66f7be2fd208f8d]::thir::pattern::check_match::MatchVisitor as rustc_middle[361c9b966945ad5f]::thir::visit::Visitor>::visit_expr
  27:     0x785764445c70 - rustc_mir_build[e66f7be2fd208f8d]::thir::pattern::check_match::check_match
  28:     0x78576444589b - rustc_query_impl[6163178075f45bcf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6163178075f45bcf]::query_impl::check_match::dynamic_query::{closure#2}::{closure#0}, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 1usize]>>
  29:     0x785764467825 - rustc_query_system[c023df386c88c8e7]::query::plumbing::try_execute_query::<rustc_query_impl[6163178075f45bcf]::DynamicConfig<rustc_data_structures[79350e7213dd8471]::vec_cache::VecCache<rustc_span[644369ff50095af5]::def_id::LocalDefId, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[c023df386c88c8e7]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[6163178075f45bcf]::plumbing::QueryCtxt, false>
  30:     0x785764467461 - rustc_query_impl[6163178075f45bcf]::query_impl::check_match::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7857640140ca - rustc_mir_build[e66f7be2fd208f8d]::builder::build_mir
  32:     0x785763c09db5 - rustc_mir_transform[4cfe12e99b605988]::mir_built
  33:     0x785763c09d87 - rustc_query_impl[6163178075f45bcf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6163178075f45bcf]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 8usize]>>
  34:     0x785763dca3a6 - rustc_query_system[c023df386c88c8e7]::query::plumbing::try_execute_query::<rustc_query_impl[6163178075f45bcf]::DynamicConfig<rustc_data_structures[79350e7213dd8471]::vec_cache::VecCache<rustc_span[644369ff50095af5]::def_id::LocalDefId, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[c023df386c88c8e7]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[6163178075f45bcf]::plumbing::QueryCtxt, false>
  35:     0x785763dc9ed2 - rustc_query_impl[6163178075f45bcf]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  36:     0x785764578b43 - rustc_mir_build[e66f7be2fd208f8d]::check_unsafety::check_unsafety
  37:     0x785764578937 - rustc_query_impl[6163178075f45bcf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6163178075f45bcf]::query_impl::check_unsafety::dynamic_query::{closure#2}::{closure#0}, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 0usize]>>
  38:     0x785764577f45 - rustc_query_system[c023df386c88c8e7]::query::plumbing::try_execute_query::<rustc_query_impl[6163178075f45bcf]::DynamicConfig<rustc_data_structures[79350e7213dd8471]::vec_cache::VecCache<rustc_span[644369ff50095af5]::def_id::LocalDefId, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[c023df386c88c8e7]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[6163178075f45bcf]::plumbing::QueryCtxt, false>
  39:     0x785764577c13 - rustc_query_impl[6163178075f45bcf]::query_impl::check_unsafety::get_query_non_incr::__rust_end_short_backtrace
  40:     0x785763dc8888 - <rustc_middle[361c9b966945ad5f]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[77530f27f9e4bbc4]::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  41:     0x785763dc6bb2 - rustc_interface[77530f27f9e4bbc4]::passes::run_required_analyses
  42:     0x785764b0ca9e - rustc_interface[77530f27f9e4bbc4]::passes::analysis
  43:     0x785764b0ca75 - rustc_query_impl[6163178075f45bcf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6163178075f45bcf]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 0usize]>>
  44:     0x785764b0eb7a - rustc_query_system[c023df386c88c8e7]::query::plumbing::try_execute_query::<rustc_query_impl[6163178075f45bcf]::DynamicConfig<rustc_query_system[c023df386c88c8e7]::query::caches::SingleCache<rustc_middle[361c9b966945ad5f]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[6163178075f45bcf]::plumbing::QueryCtxt, false>
  45:     0x785764b0e84f - rustc_query_impl[6163178075f45bcf]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  46:     0x785764d5cd87 - rustc_interface[77530f27f9e4bbc4]::passes::create_and_enter_global_ctxt::<core[5f9a00d7f27d7732]::option::Option<rustc_interface[77530f27f9e4bbc4]::queries::Linker>, rustc_driver_impl[67fa6dff91713239]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  47:     0x785764c9d14f - rustc_interface[77530f27f9e4bbc4]::interface::run_compiler::<(), rustc_driver_impl[67fa6dff91713239]::run_compiler::{closure#0}>::{closure#1}
  48:     0x785764c57246 - std[87abf682fc70726]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[77530f27f9e4bbc4]::util::run_in_thread_with_globals<rustc_interface[77530f27f9e4bbc4]::util::run_in_thread_pool_with_globals<rustc_interface[77530f27f9e4bbc4]::interface::run_compiler<(), rustc_driver_impl[67fa6dff91713239]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  49:     0x785764c56eeb - <<std[87abf682fc70726]::thread::Builder>::spawn_unchecked_<rustc_interface[77530f27f9e4bbc4]::util::run_in_thread_with_globals<rustc_interface[77530f27f9e4bbc4]::util::run_in_thread_pool_with_globals<rustc_interface[77530f27f9e4bbc4]::interface::run_compiler<(), rustc_driver_impl[67fa6dff91713239]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[5f9a00d7f27d7732]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  50:     0x785764c589fd - std::sys::pal::unix::thread::Thread::new::thread_start::hcb0cd5abf7f32abf
  51:     0x78575eaa57eb - <unknown>
  52:     0x78575eb2918c - <unknown>
  53:                0x0 - <unknown>

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.89.0-nightly (5df0f729f 2025-05-21) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_match] match-checking `uwu`
#1 [mir_built] building MIR for `uwu`
#2 [check_unsafety] unsafety-checking `uwu`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 7 previous errors

Some errors have detailed explanations: E0107, E0412, E0601, E0658.
For more information about an error, try `rustc --explain E0107`.

@rustbot label +F-WithEmplacableForFn

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 22, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 22, 2025

Unknown labels: F-WithEmplacableForFn

@matthiaskrgr
Copy link
Member Author

trait a {}
type b<c: a> = impl a;
enum d {
    e(b),
}
fn f(g: d) {
    match g {}
}

@fmease fmease added F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` requires-nightly This issue requires a nightly compiler in some way. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 22, 2025
@matthiaskrgr
Copy link
Member Author

also crashes on stable

@matthiaskrgr matthiaskrgr removed the requires-nightly This issue requires a nightly compiler in some way. label May 22, 2025
@compiler-errors
Copy link
Member

This may have been said before, but lowercasing all the identifier names doesn't really simplify the MCVE in a meaningful way, and on the contrary actually makes it harder to reason about since although capitalization in Rust is not semantic it does carry a lot of pragmatic weight.

Furthermore, it anonymizes the fact that this test was originally reduced from a regression test for #127353, which is useful for whoever is responsible for fixing and filing a new test for this bug.

An idea: It would be very cool to change whatever minimizer you're using to have capitalization-sensitive name reduction, or just skip sharing the "identifier reduced" version of the code at all unless the identifiers are really that misleading or complicated.

@matthiaskrgr
Copy link
Member Author

I like it because it reduces the mvce into something like a Logical Form, different reproducers may still boil down to the same LF and this helps us spot and avoid duplicates.

All the info (var names, comments etc) is still contained in the topmost report though, you could look at that, too.

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented May 22, 2025

trait Trait;
type Alias<P : Trait> = impl;
enum UninhabitedVariants { Tuple(Alias) } fn uwu(x : UninhabitedVariants) {
  match x {}
}

creduce --timeout 10 --remove-pass pass_clang rename-fun --remove-pass pass_clang rename-param --remove-pass pass_clang rename-var --remove-pass pass_clang rename-class --remove-pass pass_clang rename-cxx-method --remove-pass pass_clex rename-toks script.sh ./code.rs

@moxian
Copy link
Contributor

moxian commented May 22, 2025

Bisection points to nightly-2024-06-05, but that doesn't look useful. PRs in range:
 - #125383 (Rewrite `emit`, `mixing-formats` and `bare-outfile` `run-make` tests in `rmake.rs` format) by Oneirical
 - #122597 (Show files produced by `--emit foo` in json artifact notifications) by pacak
 - #125380 (Make `WHERE_CLAUSES_OBJECT_SAFETY` a regular object safety violation) by compiler-errors
 - #125525 (Make TLS accessors closures that return pointers) by joboet
 - #125960 (Rollup of 8 pull requests) by jieyouxu
   - #124486 (Add tracking issue and unstable book page for `"vectorcall"` ABI)
   - #125504 (Change pedantically incorrect OnceCell/OnceLock wording)
   - #125608 (Avoid follow-up errors if the number of generic parameters already doesn't match)
   - #125690 (ARM Target Docs Update)
   - #125750 (Align `Term` methods with `GenericArg` methods, add `Term::expect_*`)
   - #125818 (Handle no values cfgs with `--print=check-cfg`)
   - #125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE)
   - #125919 (Remove stray "this")
 - #125948 (rustfmt more tests) by nnethercote
 - #125976 (Rollup of 8 pull requests) by compiler-errors
   - #125667 (Silence follow-up errors directly based on error types and regions)
   - #125717 (Refactor `#[diagnostic::do_not_recommend]` support)
   - #125795 (Improve renaming suggestion for names with leading underscores)
   - #125865 (Fix ICE caused by ignoring EffectVars in type inference)
   - #125953 (Streamline `nested` calls.)
   - #125959 (Reduce `pub` exposure in `rustc_mir_build`)
   - #125967 (Split smir `Const` into `TyConst` and `MirConst`)
   - #125968 (Store the types of `ty::Expr` arguments in the `ty::Expr`)
 - #123536 (Simplify `IntVarValue`/`FloatVarValue`) by compiler-errors
 - #125426 (Update `compiler-builtins` test to not clear essential env vars) by jieyouxu
 - #125989 (Rollup of 11 pull requests) by GuillaumeGomez
   - #106186 (Add function `core::iter::chain`)
   - #125596 (Convert `proc_macro_back_compat` lint to an unconditional error.)
   - #125696 (Explain differences between `{Once,Lazy}{Cell,Lock}` types)
   - #125917 (Create `run-make` `env_var` and `env_var_os` helpers)
   - #125927 (Ignore `vec_deque_alloc_error::test_shrink_to_unwind` test on non-unwind targets)
   - #125930 (feat(opt-dist): new flag `--benchmark-cargo-config`)
   - #125932 (Fix typo in the docs of `HashMap::raw_entry_mut`)
   - #125933 (Update books)
   - #125944 (Update fuchsia maintainers)
   - #125946 (Include trailing commas in wrapped function declarations [RustDoc])
   - #125973 (Remove `tests/run-make-fulldeps/pretty-expanded`)

My best guess would be #125608

different reproducers may still boil down to the same LF and this helps us spot and avoid duplicates.

in my experience, different reproducers boil down to different "LFs" regardless, and renaming the variables makes it harder to reason about whether two LFs are same or not.
You no longer know whether, say, a is a type or a trait. So you have to fully read and de-obfuscate the example in order to comprehend it. You can no longer reason about two repros being similar based just on their general shape. And this de-obfuscation is surprisingly hard, speaking from experience of, say, #141124 (comment)

The current autorename algo probably doesn't help with automatic matching of LFs either since it's sensitive to item ordering. You would still generate two different LFs for

struct MyStruct;
trait MyTrait {}
impl MyTrait for MyStruct{}
// becomes
struct a;
trait b{}
impl a for b{}

// vs
trait MyTrait {}
struct MyStruct;
impl MyTrait for MyStruct{}
// becomes
trait a {}
struct b;
impl b for a{}    // different LF!!

And if having automatic LF matching is desirable, then this sort of rename can be trivially done within said automatic LF matching code, not on github.

I think having some sort of "canonical" represenation of a repro is valuable, but only as far as it helps understand the code better. I.e. using "standard" nomenclature of S for structs T and U for generics, Trait for traits, struct HasDrop for a struct that has impl Drop etc etc.
(And by the same token, it's probably more worth to have a code with fewer unrelated warnings. So in the last example trait Trait; should probably be trait Trait {} instead, and = impl; should probably be = impl Something; (maybe even impl Sized if not impl Trait))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants