Skip to content

Add a regression test for issue-66286 #79712

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

Merged
merged 1 commit into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/test/ui/proc-macro/auxiliary/issue-66286.rs
Original file line number Diff line number Diff line change
@@ -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()
}
13 changes: 13 additions & 0 deletions src/test/ui/proc-macro/issue-66286.rs
Original file line number Diff line number Diff line change
@@ -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() {}
12 changes: 12 additions & 0 deletions src/test/ui/proc-macro/issue-66286.stderr
Original file line number Diff line number Diff line change
@@ -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`.