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 error: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this #70552

Closed
dwrensha opened this issue Mar 30, 2020 · 2 comments · Fixed by #70556
Closed
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium 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):

type T = [(String, [String; u:b ()(:)])];
$ rustc main.rs
error: expected expression, found `:`
 --> main.rs:1:36
  |
1 | type T = [(String, [String; u:b ()(:)])];
  |                                    ^ expected expression

thread 'rustc' panicked at 'internal error: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this', src/librustc_parse/parser/expr.rs:641:26
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 (699f83f52 2020-03-29) running on x86_64-unknown-linux-gnu

error: aborting due to previous error
@dwrensha
Copy link
Contributor Author

dwrensha commented Mar 30, 2020

Report from cargo bisect-rustc:

searched nightlies: from nightly-2020-01-09 to nightly-2020-03-30
regressed nightly: nightly-2020-03-08
searched commits: from 2890b37 to 823ff8c
regressed commit: a039217

@Centril Centril added A-parser Area: The parsing of Rust source code to an AST I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-diagnostics Area: Messages for errors, warnings, and lints P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Mar 30, 2020
@Centril
Copy link
Contributor

Centril commented Mar 30, 2020

#68985 is the cause.

Reduced to:

type T = [_; u:b ()(:)];

clarified to:

fn main() {
    expr : fun()(:);
}

clarified further to:

expr as fun()(:);

@Centril Centril self-assigned this Mar 30, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 31, 2020
parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.

Fixes rust-lang#70552.

r? @estebank
cc @daboross
@bors bors closed this as completed in 81f19ec Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium 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.

2 participants