Open wxie7 opened 3 weeks ago
@wxie7 it would be nice if you could minimize your examples to have as few errors as possible. when confronted with an example that has many errors, it is very confusing to try to figure out what's going on. I suspect only one or two of the errors are actually necessary.
also helpful:
<details>
blocks so they are collapsed by defaultReduced:
trait LendingIterator {
type Item<'q>;
fn for_each(&self, _f: Box<fn(Self::Item<'_>)>) {}
}
fn f(_: ()) {}
fn main() {
LendingIterator::for_each(&(), f);
}
Also ICEs in 1.70.0.
Bisects to nightly-2022-07-23
get_commits_between returning commits, len: 8
commit[0] 2022-07-21: Auto merge of #99501 - lcnr:check-regions-infcx, r=oli-obk
commit[1] 2022-07-21: Auto merge of #99530 - RalfJung:miri, r=oli-obk
commit[2] 2022-07-22: Auto merge of #99420 - RalfJung:vtable, r=oli-obk
commit[3] 2022-07-22: Auto merge of #99592 - Dylan-DPC:rollup-xlw4wax, r=Dylan-DPC
commit[4] 2022-07-22: Auto merge of #99491 - workingjubilee:sync-psimd, r=workingjubilee
commit[5] 2022-07-22: Auto merge of #99521 - fee1-dead-contrib:const_fix_hax, r=oli-obk
commit[6] 2022-07-22: Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddle
commit[7] 2022-07-22: Auto merge of #98017 - RalfJung:dereferenceable, r=nikic
thread 'rustc' panicked at /rust/deps/ena-0.14.3/src/snapshot_vec.rs:199:10
Dig some more digging, the suggestion seems valid, at least in the sense that it doesn't like that the user hasn't fully defined a parameter that the f
parameter is expecting in the trait's function.
$ RUSTC_LOG=debug rustc 132765.rs
...
18ms DEBUG rustc_trait_selection::error_reporting::infer::suggest suggest_accessing_field_where_appropriate(cause=ObligationCause { span: 132765.rs:10:48: 10:56 (#0), body_id: DefId(0:12 ~ 132765[0e75]::data), code: Misc }, exp_found=ExpectedFound { expected: std::boxed::Box<dyn [Binder { value: Trait(std::ops::FnMut<(_,)>), bound_vars: [Region(BrNamed(DefId(0:14 ~ 132765[0e75]::LendingIterator::for_each::'_), '_))] }, Binder { value: Projection(Output = ()), bound_vars: [Region(BrNamed(DefId(0:14 ~ 132765[0e75]::LendingIterator::for_each::'_), '_))] }] + 'static, std::alloc::Global>, found: FnDef(DefId(5:571 ~ alloc[bf7f]::boxed::{impl#0}::new), [?6t]) })
thread 'rustc' panicked at /Users/kaden/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ena-0.14.3/src/snapshot_vec.rs:199:10:
Code
Affected release channels
Rust Version
rustc 1.84.0-nightly (b91a3a056 2024-11-07) binary: rustc commit-hash: b91a3a05609a46f73d23e0995ae7ebb4a4f429a5 commit-date: 2024-11-07 host: x86_64-unknown-linux-gnu release: 1.84.0-nightly LLVM version: 19.1.3
Current error output
Backtrace
Anything else?
This issue is similar to https://github.com/rust-lang/rust/issues/122098; however, https://github.com/rust-lang/rust/issues/122098 does not report an ICE on the current nightly version. The difference is the addition of a
main
function.