about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-18 16:17:23 +0000
committerbors <bors@rust-lang.org>2020-12-18 16:17:23 +0000
commite4297ba39ce07a0b0000841b50154ea53783a024 (patch)
treef4dcb5224492beb60c03024ce6e1e95b2be5278e /src
parent6340607acaab10eed3cf11ef7ad3564db58ec981 (diff)
parent441a33e81bf0351c5f91fb06232514c077cccffc (diff)
downloadrust-e4297ba39ce07a0b0000841b50154ea53783a024.tar.gz
rust-e4297ba39ce07a0b0000841b50154ea53783a024.zip
Auto merge of #80156 - RalfJung:rollup-m3poz8z, r=RalfJung
Rollup of 6 pull requests

Successful merges:

 - #80121 (Change the message for `if_let_guard` feature gate)
 - #80130 (docs: Edit rustc_span::symbol::Symbol method)
 - #80135 (Don't allow `const` to begin a nonterminal)
 - #80145 (Fix typo in rustc_typeck docs)
 - #80146 (Edit formatting in Rust Prelude docs)
 - #80147 (Add missing punctuation to std::alloc docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/inline-const/macro-with-const.rs20
-rw-r--r--src/test/ui/rfc-2294-if-let-guard/feature-gate.rs4
-rw-r--r--src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr4
3 files changed, 24 insertions, 4 deletions
diff --git a/src/test/ui/inline-const/macro-with-const.rs b/src/test/ui/inline-const/macro-with-const.rs
new file mode 100644
index 00000000000..e7393166d8d
--- /dev/null
+++ b/src/test/ui/inline-const/macro-with-const.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+macro_rules! exp {
+    (const $n:expr) => {
+        $n
+    };
+}
+
+macro_rules! stmt {
+    (exp $e:expr) => {
+        $e
+    };
+    (exp $($t:tt)+) => {
+        exp!($($t)+)
+    };
+}
+
+fn main() {
+    stmt!(exp const 1);
+}
diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs b/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
index 311d1afcfc0..4ba7e1eeefa 100644
--- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
+++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
@@ -5,7 +5,7 @@ use std::ops::Range;
 fn _if_let_guard() {
     match () {
         () if let 0 = 1 => {}
-        //~^ ERROR `if let` guard is not implemented
+        //~^ ERROR `if let` guards are experimental
 
         () if (let 0 = 1) => {}
         //~^ ERROR `let` expressions in this position are experimental
@@ -74,7 +74,7 @@ fn _macros() {
     match () {
         #[cfg(FALSE)]
         () if let 0 = 1 => {}
-        //~^ ERROR `if let` guard is not implemented
+        //~^ ERROR `if let` guards are experimental
         _ => {}
     }
     use_expr!(let 0 = 1);
diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
index 1670078e0d3..113870c19f5 100644
--- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
+++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
@@ -7,7 +7,7 @@ LL |     macro_rules! use_expr {
 LL |     use_expr!(let 0 = 1);
    |               ^^^ no rules expected this token in macro call
 
-error[E0658]: `if let` guard is not implemented
+error[E0658]: `if let` guards are experimental
   --> $DIR/feature-gate.rs:7:12
    |
 LL |         () if let 0 = 1 => {}
@@ -16,7 +16,7 @@ LL |         () if let 0 = 1 => {}
    = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
    = help: add `#![feature(if_let_guard)]` to the crate attributes to enable
 
-error[E0658]: `if let` guard is not implemented
+error[E0658]: `if let` guards are experimental
   --> $DIR/feature-gate.rs:76:12
    |
 LL |         () if let 0 = 1 => {}