rust/compiler/rustc_ast_passes/src
bors cb3c4ee718 Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwco
Handle C-variadic arguments properly when reporting region errors

This pull request fixes #86053. The issue is that for a C-variadic function
```rust
#![feature(c_variadic)]
unsafe extern "C" fn foo(_: (), ...) {}
```
`foo`'s signature will contain only the first parameter (and have `c_variadic` set to `true`), whereas its body has a second argument (a `hir::Pat` for the `...`).

The code for reporting region errors iterates over the body's parameters and tries to fetch the corresponding parameter from the signature; this causes an out-of-bounds ICE for the `...` (though not in the example above, because there are no region errors to report).

I have simply restricted the iteration over the body parameters to exclude `...`, which is fine because `...` cannot cause a region error.
2021-06-17 06:34:12 +00:00
..
ast_validation.rs Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwco 2021-06-17 06:34:12 +00:00
feature_gate.rs Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
lib.rs Remove unused feature gates 2021-05-31 13:55:43 +02:00
node_count.rs ast/hir: Rename field-related structures 2021-03-16 11:41:24 +03:00
show_span.rs rustc_ast: Do not panic by default when visiting macro calls 2020-11-03 20:38:20 +03:00