Auto merge of #79712 - JohnTitor:test-issue-66286, r=estebank

Add a regression test for issue-66286

Fixes #66422
This commit is contained in:
bors 2020-12-08 06:25:31 +00:00
commit 5e48ea9a40
3 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,14 @@
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn vec_ice(_attr: TokenStream, input: TokenStream) -> TokenStream {
// This redundant convert is necessary to reproduce ICE.
input.into_iter().collect()
}

View file

@ -0,0 +1,13 @@
// aux-build:issue-66286.rs
// Regression test for #66286.
extern crate issue_66286;
#[issue_66286::vec_ice]
pub extern fn foo(_: Vec(u32)) -> u32 {
//~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait
0
}
fn main() {}

View file

@ -0,0 +1,12 @@
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-66286.rs:8:22
|
LL | pub extern fn foo(_: Vec(u32)) -> u32 {
| ^^^^^^^^
| |
| only `Fn` traits may use parentheses
| help: use angle brackets instead: `Vec<u32>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0214`.