about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_parse/parser/item.rs4
-rw-r--r--src/test/ui/anon-params/anon-params-denied-2018.rs (renamed from src/test/ui/anon-params-denied-2018.rs)0
-rw-r--r--src/test/ui/anon-params/anon-params-denied-2018.stderr (renamed from src/test/ui/anon-params-denied-2018.stderr)0
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.fixed (renamed from src/test/ui/anon-params-deprecated.fixed)0
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.rs (renamed from src/test/ui/anon-params-deprecated.rs)0
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.stderr (renamed from src/test/ui/anon-params-deprecated.stderr)0
-rw-r--r--src/test/ui/anon-params/anon-params-edition-hygiene.rs10
-rw-r--r--src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs12
8 files changed, 23 insertions, 3 deletions
diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs
index 126686c8def..a9c4de04c0a 100644
--- a/src/librustc_parse/parser/item.rs
+++ b/src/librustc_parse/parser/item.rs
@@ -1544,9 +1544,7 @@ impl<'a> Parser<'a> {
 
         let is_name_required = match self.token.kind {
             token::DotDotDot => false,
-            // FIXME: Consider using interpolated token for this edition check,
-            // it should match the intent of edition hygiene better.
-            _ => req_name(self.token.uninterpolate().span.edition()),
+            _ => req_name(self.token.span.edition()),
         };
         let (pat, ty) = if is_name_required || self.is_named_param() {
             debug!("parse_param_general parse_pat (is_name_required:{})", is_name_required);
diff --git a/src/test/ui/anon-params-denied-2018.rs b/src/test/ui/anon-params/anon-params-denied-2018.rs
index 5721f5d2357..5721f5d2357 100644
--- a/src/test/ui/anon-params-denied-2018.rs
+++ b/src/test/ui/anon-params/anon-params-denied-2018.rs
diff --git a/src/test/ui/anon-params-denied-2018.stderr b/src/test/ui/anon-params/anon-params-denied-2018.stderr
index e7a806a8468..e7a806a8468 100644
--- a/src/test/ui/anon-params-denied-2018.stderr
+++ b/src/test/ui/anon-params/anon-params-denied-2018.stderr
diff --git a/src/test/ui/anon-params-deprecated.fixed b/src/test/ui/anon-params/anon-params-deprecated.fixed
index fe42113eb2e..fe42113eb2e 100644
--- a/src/test/ui/anon-params-deprecated.fixed
+++ b/src/test/ui/anon-params/anon-params-deprecated.fixed
diff --git a/src/test/ui/anon-params-deprecated.rs b/src/test/ui/anon-params/anon-params-deprecated.rs
index dc0357721ec..dc0357721ec 100644
--- a/src/test/ui/anon-params-deprecated.rs
+++ b/src/test/ui/anon-params/anon-params-deprecated.rs
diff --git a/src/test/ui/anon-params-deprecated.stderr b/src/test/ui/anon-params/anon-params-deprecated.stderr
index 4520559845f..4520559845f 100644
--- a/src/test/ui/anon-params-deprecated.stderr
+++ b/src/test/ui/anon-params/anon-params-deprecated.stderr
diff --git a/src/test/ui/anon-params/anon-params-edition-hygiene.rs b/src/test/ui/anon-params/anon-params-edition-hygiene.rs
new file mode 100644
index 00000000000..14e11c5696f
--- /dev/null
+++ b/src/test/ui/anon-params/anon-params-edition-hygiene.rs
@@ -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() {}
diff --git a/src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs b/src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs
new file mode 100644
index 00000000000..aa4221becc2
--- /dev/null
+++ b/src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs
@@ -0,0 +1,12 @@
+// edition:2015
+
+#[macro_export]
+macro_rules! generate_trait_2015 {
+    ($Type: ident) => {
+        trait Trait {
+            fn method($Type) {}
+        }
+    };
+}
+
+fn main() {}