Add a regression test for issue-66286
This commit is contained in:
parent
3ff10e74a7
commit
ab121e3afe
14
src/test/ui/proc-macro/auxiliary/issue-66286.rs
Normal file
14
src/test/ui/proc-macro/auxiliary/issue-66286.rs
Normal 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()
|
||||
}
|
13
src/test/ui/proc-macro/issue-66286.rs
Normal file
13
src/test/ui/proc-macro/issue-66286.rs
Normal 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() {}
|
12
src/test/ui/proc-macro/issue-66286.stderr
Normal file
12
src/test/ui/proc-macro/issue-66286.stderr
Normal 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`.
|
Loading…
x
Reference in New Issue
Block a user