Skip to content

Commit 5e48ea9

Browse files
committed
Auto merge of #79712 - JohnTitor:test-issue-66286, r=estebank
Add a regression test for issue-66286 Fixes #66422
2 parents 7913250 + ab121e3 commit 5e48ea9

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// force-host
2+
// no-prefer-dynamic
3+
4+
#![crate_type = "proc-macro"]
5+
6+
extern crate proc_macro;
7+
8+
use proc_macro::TokenStream;
9+
10+
#[proc_macro_attribute]
11+
pub fn vec_ice(_attr: TokenStream, input: TokenStream) -> TokenStream {
12+
// This redundant convert is necessary to reproduce ICE.
13+
input.into_iter().collect()
14+
}

src/test/ui/proc-macro/issue-66286.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// aux-build:issue-66286.rs
2+
3+
// Regression test for #66286.
4+
5+
extern crate issue_66286;
6+
7+
#[issue_66286::vec_ice]
8+
pub extern fn foo(_: Vec(u32)) -> u32 {
9+
//~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait
10+
0
11+
}
12+
13+
fn main() {}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
2+
--> $DIR/issue-66286.rs:8:22
3+
|
4+
LL | pub extern fn foo(_: Vec(u32)) -> u32 {
5+
| ^^^^^^^^
6+
| |
7+
| only `Fn` traits may use parentheses
8+
| help: use angle brackets instead: `Vec<u32>`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0214`.

0 commit comments

Comments
 (0)