-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not eagerly recover for bad impl-trait in macros
- Loading branch information
1 parent
bd39bbb
commit 0017822
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// check-pass | ||
|
||
// edition:2021 | ||
// for the `impl` + keyword test | ||
|
||
macro_rules! impl_primitive { | ||
($ty:ty) => { | ||
compile_error!("whoops"); | ||
}; | ||
(impl async) => {}; | ||
} | ||
|
||
impl_primitive!(impl async); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// check-pass | ||
|
||
macro_rules! impl_primitive { | ||
($ty:ty) => { impl_primitive!(impl $ty); }; | ||
(impl $ty:ty) => { fn a(_: $ty) {} } | ||
} | ||
|
||
impl_primitive! { u8 } | ||
|
||
macro_rules! test { | ||
($ty:ty) => { compile_error!("oh no"); }; | ||
(impl &) => {}; | ||
} | ||
|
||
test!(impl &); | ||
|
||
fn main() {} |