forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#69896 - petrochenkov:reqname2, r=Centril
parse: Tweak the function parameter edition check Follow-up to rust-lang#69801. Edition of a code fragment is inferred from "the place where the code is written". For individual tokens like edition-specific keywords it may be the span of the token itself ("uninterpolated" span), but for larger code fragments it's probably not, in the test example the trait method is obviously written in "2015 edition code". r? @Centril
- Loading branch information
Showing
8 changed files
with
23 additions
and
3 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
// check-pass | ||
// edition:2018 | ||
// aux-build:anon-params-edition-hygiene.rs | ||
|
||
#[macro_use] | ||
extern crate anon_params_edition_hygiene; | ||
|
||
generate_trait_2015!(u8); | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs
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,12 @@ | ||
// edition:2015 | ||
|
||
#[macro_export] | ||
macro_rules! generate_trait_2015 { | ||
($Type: ident) => { | ||
trait Trait { | ||
fn method($Type) {} | ||
} | ||
}; | ||
} | ||
|
||
fn main() {} |