Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --code from <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
This crashes on master/nightly but not on
This is an overlooked case for , I can add it to the type-checking claim
I couldn't find a regression-from-beta-to-nightly label so using label +regression-from-stable-to-nightly
How did this not get caught by CI?
Assigning and removing as in the prioritization working group.
How did this not get caught by CI? I guess the original code (which triggers the ice) got changed. I found this by running todays rustc on the testcases from a couple of releases/years ago. :)
Yep, the test case was changed as part of the original PR. I didn't think to add the trait case to the new test, I've fixed that oversight (And one or two other possible cases) in the fix.
Regression is on beta now.

Discussion:
Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Fn(header, ..), .. }) => Some(header), <ins> Node::TraitItem(hir::TraitItem { kind: hir::TraitItemKind::Fn(header, ..), .. }) => Some(header), </ins> // Closures are RustCall, but they tuple their arguments, so shouldn't be checked Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => None, node => bug!("Item being checked wasn't a function/closure: {:?}", node),

extern "rust-call" fn b(_i: i32) {} //~^ ERROR A function with the "rust-call" ABI must take a single non-self argument that is a tuple <ins> trait Tr { extern "rust-call" fn a(); extern "rust-call" fn b() {} //~^ ERROR A function with the "rust-call" ABI must take a single non-self argument } struct Foo; impl Foo { extern "rust-call" fn bar() {} //~^ ERROR A function with the "rust-call" ABI must take a single non-self argument } impl Tr for Foo { extern "rust-call" fn a() {} //~^ ERROR A function with the "rust-call" ABI must take a single non-self argument } </ins> fn main () { b(10); <ins> Foo::bar(); <Foo as Tr>::a(); <Foo as Tr>::b(); </ins> }

LL | extern "rust-call" fn b(_i: i32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <del> error: aborting due to previous error </del> <ins> error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple --> $DIR/issue-22565-rust-call.rs:9:5 | LL |     extern "rust-call" fn b() {} |     ^^^^^^^^^^^^^^^^^^^^^^^^^ error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple --> $DIR/issue-22565-rust-call.rs:16:5 | LL |     extern "rust-call" fn bar() {} |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple --> $DIR/issue-22565-rust-call.rs:21:5 | LL |     extern "rust-call" fn a() {} |     ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors </ins>