mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Rollup merge of #83671 - JohnTitor:issue-75801-test, r=Dylan-DPC
Add a regression test for issue-75801 Closes #75801 r? ``@Aaron1011``
This commit is contained in:
commit
f1ad4bd97c
13
src/test/ui/proc-macro/auxiliary/issue-75801.rs
Normal file
13
src/test/ui/proc-macro/auxiliary/issue-75801.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// force-host
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_type = "proc-macro"]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn foo(_args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
item
|
||||
}
|
19
src/test/ui/proc-macro/issue-75801.rs
Normal file
19
src/test/ui/proc-macro/issue-75801.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// aux-build: issue-75801.rs
|
||||
|
||||
// Regression test for #75801.
|
||||
|
||||
#[macro_use]
|
||||
extern crate issue_75801;
|
||||
|
||||
macro_rules! foo {
|
||||
($arg:expr) => {
|
||||
#[foo]
|
||||
fn bar() {
|
||||
let _bar: u32 = $arg;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
foo!("baz"); //~ ERROR: mismatched types [E0308]
|
||||
|
||||
fn main() {}
|
12
src/test/ui/proc-macro/issue-75801.stderr
Normal file
12
src/test/ui/proc-macro/issue-75801.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-75801.rs:17:6
|
||||
|
|
||||
LL | let _bar: u32 = $arg;
|
||||
| --- expected due to this
|
||||
...
|
||||
LL | foo!("baz");
|
||||
| ^^^^^ expected `u32`, found `&str`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
Reference in New Issue
Block a user