Skip to content
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

ICE: WellFormed .. has escaping bound vars, so it cannot be wrapped in a dummy binder. #131535

Closed
matthiaskrgr opened this issue Oct 11, 2024 · 1 comment · Fixed by #132832
Closed
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. 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):

#![feature(non_lifetime_binders)]
trait v0<> {}
fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}

original:

#![feature(non_lifetime_binders)]
trait v0<> {}
fn kind  :(v0<'_, v2 = impl v0<v4> + '_> impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}

Version information

rustc 1.83.0-nightly (0321e73d1 2024-10-11)
binary: rustc
commit-hash: 0321e73d1cb3f739caa806927344eca6f96257b5
commit-date: 2024-10-11
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.1

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

Program output

error: missing parameters for function definition
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:8
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |        ^
  |
help: add a parameter list
  |
3 | fn kind()  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |        ++

error: return types are denoted using `->`
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:10
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |          ^
  |
help: use `->` instead
  |
3 | fn kind -> (v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |         ~~

error: expected one of `!`, `)`, `+`, `,`, or `::`, found keyword `impl`
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:21
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |                    -^^^^ expected one of `!`, `)`, `+`, `,`, or `::`
  |                    |
  |                    help: missing `,`

error[E0106]: missing lifetime specifiers
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:15
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |               ^^                    ^^                     ^^ expected named lifetime parameter
  |               |                     |
  |               |                     expected named lifetime parameter
  |               expected named lifetime parameter
  |
  = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
  |
3 | fn kind  :(v0<'static, > impl for<v4> v0<'static, v2 = impl v0<v4> + 'static>) {}
  |               ~~~~~~~                    ~~~~~~~                     ~~~~~~~

warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:1:12
  |
1 | #![feature(non_lifetime_binders)]
  |            ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: trait `v0` should have an upper camel case name
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:2:7
  |
2 | trait v0<> {}
  |       ^^ help: convert the identifier to upper camel case (notice the capitalization): `V0`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

warning: type parameter `v4` should have an upper camel case name
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:30
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |                              ^^ help: convert the identifier to upper camel case (notice the capitalization): `V4`

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:67
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |                                                                   ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs`

warning: trait objects without an explicit `dyn` are deprecated
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:12
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |            ^^^^^^^^
  |
  = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
  = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
  = note: `#[warn(bare_trait_objects)]` on by default
help: if this is a dyn-compatible trait, use `dyn`
  |
3 | fn kind  :(dyn v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |            +++

error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:12
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |            ^^------ help: remove the unnecessary generics
  |            |
  |            expected 0 lifetime arguments
  |
note: trait defined here, with 0 lifetime parameters
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:2:7
  |
2 | trait v0<> {}
  |       ^^

error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:34
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |                                  ^^--------------------------- help: remove the unnecessary generics
  |                                  |
  |                                  expected 0 lifetime arguments
  |
note: trait defined here, with 0 lifetime parameters
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:2:7
  |
2 | trait v0<> {}
  |       ^^

error[E0220]: associated type `v2` not found for `v0`
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:41
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |                                         ^^ associated type `v2` not found

error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:3:51
  |
3 | fn kind  :(v0<'_, > impl for<v4> v0<'_, v2 = impl v0<v4> + '_>) {}
  |                                                   ^^---- help: remove the unnecessary generics
  |                                                   |
  |                                                   expected 0 generic arguments
  |
note: trait defined here, with 0 generic parameters
 --> /tmp/icemaker_global_tempdir.iM3UDTgNb65b/rustc_testrunner_tmpdir_reporting.HNNM9m0OzIzi/mvce.rs:2:7
  |
2 | trait v0<> {}
  |       ^^

thread 'rustc' panicked at compiler/rustc_middle/src/ty/predicate.rs:489:9:
`WellFormed(^2_"v4")` has escaping bound vars, so it cannot be wrapped in a dummy binder.
stack backtrace:
   0:     0x7ad8ec3de57a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h0c0d2e67483a7ce1
   1:     0x7ad8ecc034a6 - core::fmt::write::h19fbfdd1fd25c23b
   2:     0x7ad8edec4091 - std::io::Write::write_fmt::hf8ab2da8ebc932a0
   3:     0x7ad8ec3de3d2 - std::sys::backtrace::BacktraceLock::print::h3d864635116d695a
   4:     0x7ad8ec3e08a6 - std::panicking::default_hook::{{closure}}::h2aa94d113a45cc15
   5:     0x7ad8ec3e06f0 - std::panicking::default_hook::h97fbe8692dbb54b4
   6:     0x7ad8eb4331df - std[b2c81c0a9485f2e4]::panicking::update_hook::<alloc[c9d20cda7901ded3]::boxed::Box<rustc_driver_impl[8c3cd927c140555]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7ad8ec3e0fb8 - std::panicking::rust_panic_with_hook::hc4ff1f67175d51bb
   8:     0x7ad8ec3e0d8a - std::panicking::begin_panic_handler::{{closure}}::h064adafafa3d3d91
   9:     0x7ad8ec3dea29 - std::sys::backtrace::__rust_end_short_backtrace::hfd346037bc0f3979
  10:     0x7ad8ec3e0a4c - rust_begin_unwind
  11:     0x7ad8e9e4cd00 - core::panicking::panic_fmt::hcd11b748a515a987
  12:     0x7ad8ee656148 - <rustc_middle[3ffb7b0bf421448c]::ty::predicate::Predicate as rustc_type_ir[89eb6eb643500842]::upcast::UpcastFrom<rustc_middle[3ffb7b0bf421448c]::ty::context::TyCtxt, rustc_type_ir[89eb6eb643500842]::predicate_kind::PredicateKind<rustc_middle[3ffb7b0bf421448c]::ty::context::TyCtxt>>>::upcast_from.cold
  13:     0x7ad8eb4fe177 - <rustc_infer[e8941da21ab8c6f3]::traits::Obligation<rustc_middle[3ffb7b0bf421448c]::ty::predicate::Predicate>>::with_depth::<rustc_type_ir[89eb6eb643500842]::predicate_kind::PredicateKind<rustc_middle[3ffb7b0bf421448c]::ty::context::TyCtxt>>
  14:     0x7ad8eb6171fe - <rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a68747c3d7069c6f]::intravisit::Visitor>::visit_ty
  15:     0x7ad8eb5c9bed - <rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a68747c3d7069c6f]::intravisit::Visitor>::visit_generic_args
  16:     0x7ad8eb526bb0 - rustc_hir[a68747c3d7069c6f]::intravisit::walk_poly_trait_ref::<rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck>
  17:     0x7ad8eb61778e - <rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a68747c3d7069c6f]::intravisit::Visitor>::visit_ty
  18:     0x7ad8eb5c9ce4 - <rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a68747c3d7069c6f]::intravisit::Visitor>::visit_generic_args
  19:     0x7ad8eb526bb0 - rustc_hir[a68747c3d7069c6f]::intravisit::walk_poly_trait_ref::<rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck>
  20:     0x7ad8eb61778e - <rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a68747c3d7069c6f]::intravisit::Visitor>::visit_ty
  21:     0x7ad8eb6174d1 - <rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a68747c3d7069c6f]::intravisit::Visitor>::visit_ty
  22:     0x7ad8eb616b8e - rustc_hir_analysis[94092c3b015c4ea3]::hir_wf_check::diagnostic_hir_wf_check
  23:     0x7ad8ebed55cc - rustc_query_impl[fa1174e4896087c1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fa1174e4896087c1]::query_impl::diagnostic_hir_wf_check::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 8usize]>>
  24:     0x7ad8ebeba6c3 - <rustc_query_impl[fa1174e4896087c1]::query_impl::diagnostic_hir_wf_check::dynamic_query::{closure#2} as core[15204f05ba262a1b]::ops::function::FnOnce<(rustc_middle[3ffb7b0bf421448c]::ty::context::TyCtxt, (rustc_middle[3ffb7b0bf421448c]::ty::predicate::Predicate, rustc_middle[3ffb7b0bf421448c]::traits::WellFormedLoc))>>::call_once
  25:     0x7ad8ebe341ba - rustc_query_system[3cba1a04b5b15b8a]::query::plumbing::try_execute_query::<rustc_query_impl[fa1174e4896087c1]::DynamicConfig<rustc_query_system[3cba1a04b5b15b8a]::query::caches::DefaultCache<(rustc_middle[3ffb7b0bf421448c]::ty::predicate::Predicate, rustc_middle[3ffb7b0bf421448c]::traits::WellFormedLoc), rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[fa1174e4896087c1]::plumbing::QueryCtxt, false>
  26:     0x7ad8ebf15af5 - rustc_query_impl[fa1174e4896087c1]::query_impl::diagnostic_hir_wf_check::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7ad8ec206ac9 - <rustc_trait_selection[9580d8cfdaacc399]::error_reporting::TypeErrCtxt>::report_selection_error
  28:     0x7ad8ec28809b - <rustc_trait_selection[9580d8cfdaacc399]::error_reporting::TypeErrCtxt>::report_fulfillment_error
  29:     0x7ad8ec24f277 - <rustc_trait_selection[9580d8cfdaacc399]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
  30:     0x7ad8ecdf114d - <rustc_trait_selection[9580d8cfdaacc399]::traits::engine::ObligationCtxt<rustc_trait_selection[9580d8cfdaacc399]::traits::FulfillmentError>>::assumed_wf_types_and_report_errors
  31:     0x7ad8ed380ef5 - rustc_hir_analysis[94092c3b015c4ea3]::check::wfcheck::check_item_fn
  32:     0x7ad8ea5c061f - rustc_hir_analysis[94092c3b015c4ea3]::check::wfcheck::check_well_formed
  33:     0x7ad8ed5cee6b - rustc_query_impl[fa1174e4896087c1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fa1174e4896087c1]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 1usize]>>
  34:     0x7ad8ed5ce5d1 - rustc_query_system[3cba1a04b5b15b8a]::query::plumbing::try_execute_query::<rustc_query_impl[fa1174e4896087c1]::DynamicConfig<rustc_query_system[3cba1a04b5b15b8a]::query::caches::VecCache<rustc_span[6af75d8d312d6eec]::def_id::LocalDefId, rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[fa1174e4896087c1]::plumbing::QueryCtxt, false>
  35:     0x7ad8ed5ce250 - rustc_query_impl[fa1174e4896087c1]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7ad8ed5cf0ff - rustc_hir_analysis[94092c3b015c4ea3]::check::wfcheck::check_mod_type_wf
  37:     0x7ad8ed5cef25 - rustc_query_impl[fa1174e4896087c1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fa1174e4896087c1]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 1usize]>>
  38:     0x7ad8ed9b7b7b - rustc_query_system[3cba1a04b5b15b8a]::query::plumbing::try_execute_query::<rustc_query_impl[fa1174e4896087c1]::DynamicConfig<rustc_query_system[3cba1a04b5b15b8a]::query::caches::DefaultCache<rustc_span[6af75d8d312d6eec]::def_id::LocalModDefId, rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[fa1174e4896087c1]::plumbing::QueryCtxt, false>
  39:     0x7ad8ed9b792d - rustc_query_impl[fa1174e4896087c1]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7ad8ed0340fb - rustc_hir_analysis[94092c3b015c4ea3]::check_crate
  41:     0x7ad8ed030e57 - rustc_interface[b91e754c6773c007]::passes::run_required_analyses
  42:     0x7ad8ed71fb1e - rustc_interface[b91e754c6773c007]::passes::analysis
  43:     0x7ad8ed71faf1 - rustc_query_impl[fa1174e4896087c1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fa1174e4896087c1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 1usize]>>
  44:     0x7ad8edb26dae - rustc_query_system[3cba1a04b5b15b8a]::query::plumbing::try_execute_query::<rustc_query_impl[fa1174e4896087c1]::DynamicConfig<rustc_query_system[3cba1a04b5b15b8a]::query::caches::SingleCache<rustc_middle[3ffb7b0bf421448c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[fa1174e4896087c1]::plumbing::QueryCtxt, false>
  45:     0x7ad8edb26a8f - rustc_query_impl[fa1174e4896087c1]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7ad8ed94edde - rustc_interface[b91e754c6773c007]::interface::run_compiler::<core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>, rustc_driver_impl[8c3cd927c140555]::run_compiler::{closure#0}>::{closure#1}
  47:     0x7ad8eda32d10 - std[b2c81c0a9485f2e4]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[b91e754c6773c007]::util::run_in_thread_with_globals<rustc_interface[b91e754c6773c007]::util::run_in_thread_pool_with_globals<rustc_interface[b91e754c6773c007]::interface::run_compiler<core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>, rustc_driver_impl[8c3cd927c140555]::run_compiler::{closure#0}>::{closure#1}, core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>>::{closure#0}, core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>>
  48:     0x7ad8eda333d7 - <<std[b2c81c0a9485f2e4]::thread::Builder>::spawn_unchecked_<rustc_interface[b91e754c6773c007]::util::run_in_thread_with_globals<rustc_interface[b91e754c6773c007]::util::run_in_thread_pool_with_globals<rustc_interface[b91e754c6773c007]::interface::run_compiler<core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>, rustc_driver_impl[8c3cd927c140555]::run_compiler::{closure#0}>::{closure#1}, core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>>::{closure#0}, core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[15204f05ba262a1b]::result::Result<(), rustc_span[6af75d8d312d6eec]::ErrorGuaranteed>>::{closure#1} as core[15204f05ba262a1b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x7ad8eda342c1 - std::sys::pal::unix::thread::Thread::new::thread_start::h4694c2beab690665
  50:     0x7ad8ef1c739d - <unknown>
  51:     0x7ad8ef24c49c - <unknown>
  52:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

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.83.0-nightly (0321e73d1 2024-10-11) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [diagnostic_hir_wf_check] performing HIR wf-checking for predicate `Binder { value: TraitPredicate(<dyn v0 as core::marker::Sized>, polarity:Positive), bound_vars: [] }` at item `Param { function: DefId(0:4 ~ mvce[ff9f]::kind), param_idx: 0 }`
#1 [check_well_formed] checking that `kind` is well-formed
end of query stack
error: aborting due to 9 previous errors; 4 warnings emitted

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

@rustbot label +F-non_lifetime_binders

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. 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. labels Oct 11, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` labels Oct 11, 2024
@matthiaskrgr
Copy link
Member Author

nightly-2024-02-22

commit[0] 2024-02-20: Auto merge of #121345 - Nilstrieb:rollup-reb0xge, r=Nilstrieb
commit[1] 2024-02-20: Auto merge of #121356 - matthiaskrgr:rollup-d80af2s, r=matthiaskrgr
commit[2] 2024-02-21: Auto merge of #120904 - Nadrieril:match-lowering-intermediate-repr, r=matthewjasper
commit[3] 2024-02-21: Auto merge of #121172 - Nadrieril:simplify-empty-selection, r=matthewjasper
commit[4] 2024-02-21: Auto merge of #121380 - weihanglo:update-cargo, r=weihanglo
commit[5] 2024-02-21: Auto merge of #120588 - alexcrichton:wasm-rmeta-object, r=wesleywiser,bjorn3
commit[6] 2024-02-21: Auto merge of #120718 - saethlin:reasonable-fast-math, r=nnethercote
commit[7] 2024-02-21: Auto merge of #121383 - Dylan-DPC:rollup-735p4u4, r=Dylan-DPC
commit[8] 2024-02-21: Auto merge of #121400 - fmease:rollup-8m29g7a, r=fmease
commit[9] 2024-02-21: Auto merge of #121321 - compiler-errors:yeet-querytyperelating, r=lcnr
commit[10] 2024-02-21: Auto merge of #117658 - RalfJung:ptr-dangling, r=m-ou-se

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 15, 2024
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Oct 20, 2024
@workingjubilee workingjubilee added the A-trait-system Area: Trait system label Oct 21, 2024
@bors bors closed this as completed in a1c98ca Nov 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 17, 2024
Rollup merge of rust-lang#132832 - compiler-errors:late-ty, r=cjgillot

Deny capturing late-bound ty/const params in nested opaques

First, this reverts a7f6095. I can't exactly remember why I approved this specific bit of rust-lang#132466; specifically, I don't know that the purpose of that commit is, and afaict we will never have an opaque that captures late-bound params through a const because opaques can't be used inside of anon consts. Am I missing something `@cjgillot?` Since I can't see a case where this matters, and no tests seem to fail.

The second commit adds a `deny_late_regions: bool` to distinguish `Scope::LateBoundary` which should deny *any* late-bound params or just ty/consts. Then, when resolving opaques we wrap ourselves in a `Scope::LateBoundary { deny_late_regions: false }` so that we deny late-bound ty/const, which fixes a bunch of ICEs that all vaguely look like `impl for<T> Trait<Assoc = impl OtherTrait<T>>`.

I guess this could be achieved other ways; for example, with a different scope kind, or maybe we could just reuse `Scope::Opaque`. But this seems a bit more verbose. I'm open to feedback anyways.

Fixes rust-lang#131535
Fixes rust-lang#131637
Fixes rust-lang#132530

I opted to remove those crashes tests ^ without adding them as regular tests, since they're basically triggering uninteresting late-bound ICEs far off in the trait solver, and the reason that existing tests such as `tests/ui/type-alias-impl-trait/non-lifetime-binder-in-constraint.rs` don't ICE are kinda just coincidental (i.e. due to a missing impl block). I don't really feel motivated to add random permutations to tests just to exercise non-lifetime binders.

r? cjgillot
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants