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

internal compiler error: no entry found for key #71297

Closed
dwrensha opened this issue Apr 18, 2020 · 6 comments · Fixed by #71557
Closed

internal compiler error: no entry found for key #71297

dwrensha opened this issue Apr 18, 2020 · 6 comments · Fixed by #71557
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dwrensha
Copy link
Contributor

I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

async fn a(x | s: String) {}
fn main() {}
$ rustc --edition=2018 main.rs 
error: an or-pattern parameter must be wrapped in parenthesis
 --> main.rs:1:12
  |
1 | async fn a(x | s: String) {}
  |            ^^^^^ help: wrap the pattern in parenthesis: `(x | s)`

error[E0408]: variable `x` is not bound in all patterns
 --> main.rs:1:16
  |
1 | async fn a(x | s: String) {}
  |            -   ^ pattern doesn't bind `x`
  |            |
  |            variable not in all patterns

error[E0408]: variable `s` is not bound in all patterns
 --> main.rs:1:12
  |
1 | async fn a(x | s: String) {}
  |            ^   - variable not in all patterns
  |            |
  |            pattern doesn't bind `s`

thread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:343:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (ce93331e2 2020-04-17) running on x86_64-unknown-linux-gnu

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0408`.
@dwrensha
Copy link
Contributor Author

Report from cargo-bisect-rustc:

searched nightlies: from nightly-2020-02-10 to nightly-2020-04-18
regressed nightly: nightly-2020-02-16
searched commits: from 433aae9 to 61d9231
regressed commit: 19288dd

@jonas-schievink jonas-schievink added A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-prioritize Issue: Indicates that prioritization has been requested for this issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Apr 18, 2020
@jonas-schievink
Copy link
Contributor

cc @matthewjasper

Panic happens here:

fn var_local_id(&self, id: hir::HirId, for_guard: ForGuard) -> Local {
self.var_indices[&id].local_id(for_guard)
}

@estebank
Copy link
Contributor

I think that or-patterns should be disallowed in arguments to begin with.

@Mark-Simulacrum
Copy link
Member

@estebank hm, so at least in principle it seems quite reasonable -- e.g., I might want something like Result<u32, u32> to be taken as Ok(x) | Err(x), right?

I don't see why we'd want such an arbitrary restriction; can you elaborate?

@estebank
Copy link
Contributor

@Mark-Simulacrum you're right, I hadn't thought of the possibility of different enough variants having the same type binding.

@LeSeulArtichaut
Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 19, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 20, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 9, 2020
…tern, r=oli-obk

Fix ICE for broken or-pattern in async fn

closes rust-lang#71297
@bors bors closed this as completed in 6f5c782 May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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.

6 participants