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

debug ice if we pass superfluous args after panic to fn: no errors reported for args #112437

Closed
matthiaskrgr opened this issue Jun 8, 2023 · 1 comment · Fixed by #112500
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jun 8, 2023

Code

#![feature(never_type)]
fn f(a: !) {}

fn main() {
    f(panic!(), 1);
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (a97c36dd2 2023-06-07)
binary: rustc
commit-hash: a97c36dd2e6f711949fc9b790476e93bd9e6d1f4
commit-date: 2023-06-07
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

warning: unreachable expression
 --> g.rs:5:17
  |
5 |     f(panic!(), 1);
  |       --------  ^ unreachable expression
  |       |
  |       any code following this expression is unreachable
  |
  = note: `#[warn(unreachable_code)]` on by default

error[E0061]: this function takes 1 argument but 2 arguments were supplied
 --> g.rs:5:5
  |
5 |     f(panic!(), 1);
  |     ^         - - unexpected argument of type `{integer}`
  |               |
  |               help: remove the extra argument
  |
note: function defined here
 --> g.rs:2:4
  |
2 | fn f(a: !) {}
  |    ^ ----

error: aborting due to previous error; 1 warning emitted
Backtrace

too long

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. A-diagnostics Area: Messages for errors, warnings, and lints requires-debug-assertions This issue requires debug-assertions in some way labels Jun 8, 2023
@matthiaskrgr
Copy link
Member Author

ice.log.tar.gz

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 C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
1 participant