-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE: compiler/rustc_typeck/src/check/upvar.rs:1701:13: Drop location span error: need to handle more #96258
Comments
Do you have a codebase that can be shared instead? Unfortunately, it's kinda difficult to investigate this without seeing what triggered the ICE. |
might be a duplicate of #93117 |
@compiler-errors I tried my hands at minimizing this, and it turned out way easier than I thought. Updated the original comment with reproduction code. |
I subscribed to this thread for curiosity about ICEs on #![warn(rust_2021_incompatible_closure_captures)]
impl Numberer {
pub(crate) async fn new(
interval: Duration, |
Managed to minimize it more: #![warn(rust_2021_incompatible_closure_captures)]
fn main() {}
pub(crate) struct Numberer {}
impl Numberer {
pub(crate) async fn new(
interval: Duration,
) -> Numberer {
Numberer {}
}
} $ rustc --edition=2021 main.rs
error[E0412]: cannot find type `Duration` in this scope
--> main.rs:9:19
|
9 | interval: Duration,
| ^^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
3 | use core::time::Duration;
|
3 | use std::time::Duration;
|
error: internal compiler error: compiler/rustc_typeck/src/check/upvar.rs:1701:13: Drop location span error: need to handle more Node ImplItem(ImplItem { ident: new#0, def_id: DefId(0:6 ~ main[a756]::{impl#0}::new), vis: Spanned { node: Crate(PubCrate), span: main.rs:8:5: 8:15 (#0) }, defaultness: Final, generics: Generics { params: [], where_clause: WhereClause { predicates: [], span: main.rs:10:18: 10:18 (#0) }, span: main.rs:8:28: 8:28 (#0) }, kind: Fn(FnSig { header: FnHeader { unsafety: Normal, constness: NotConst, asyncness: Async, abi: Rust }, decl: FnDecl { inputs: [Ty { hir_id: HirId { owner: DefId(0:6 ~ main[a756]::{impl#0}::new), local_id: 20 }, kind: Path(Resolved(None, Path { span: main.rs:9:19: 9:27 (#0), res: Err, segments: [PathSegment { ident: Duration#0, hir_id: Some(HirId { owner: DefId(0:6 ~ main[a756]::{impl#0}::new), local_id: 21 }), res: Some(Err), args: None, infer_args: false }] })), span: main.rs:9:19: 9:27 (#0) }], output: Return(Ty { hir_id: HirId { owner: DefId(0:6 ~ main[a756]::{impl#0}::new), local_id: 22 }, kind: OpaqueDef(ItemId { def_id: DefId(0:7 ~ main[a756]::{impl#0}::new::{opaque#0}) }, []), span: main.rs:10:10: 10:18 (#82) }), c_variadic: false, implicit_self: None }, span: main.rs:8:5: 10:18 (#0) }, BodyId { hir_id: HirId { owner: DefId(0:6 ~ main[a756]::{impl#0}::new), local_id: 19 } }), span: main.rs:8:5: 12:6 (#0) })
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1169:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: 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: rustc 1.59.0 (9d1b2106e 2022-02-23) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [typeck] type-checking `<impl at main.rs:7:1: 13:2>::new`
#1 [mir_built] building MIR for `<impl at main.rs:7:1: 13:2>::new`
end of query stack
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0412`. |
@matthiaskrgr you might be right, especially after I narrowed down the reproduction code. |
…_inc_clos_cap, r=lcnr fix ICE with -Wrust-2021-incompatible-closure-captures Fixes rust-lang#93117 Fixes rust-lang#96258
Fix test for rust-lang#96258 rust-lang#98644 did not properly test enabling the problematic lint as a warning due to improper use of `compile-flags:` (missing `:`). This makes it use `#![warn]` instead, like in the reproducer. cc rust-lang#96258
…llaumeGomez Rollup of 4 pull requests Successful merges: - rust-lang#112918 (display PID of process holding lock) - rust-lang#112990 (Add a regression test for rust-lang#96699) - rust-lang#113011 (Add enum for `can_access_statics` boolean) - rust-lang#113018 (Fix test for rust-lang#96258) r? `@ghost` `@rustbot` modify labels: rollup
Code
Works even with calling just
rustc
- no need for a project, and does not needgpio_cdev
as a dependency inCargo.toml
.Meta
Bug exists on 1.59, 1.60, beta and nightly.
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: