about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-11 04:33:17 +0200
committerGitHub <noreply@github.com>2019-07-11 04:33:17 +0200
commit7697b2927f7eb161412487727a063e228862aa74 (patch)
treef7969692747b3f5d5ace9cec97854d9b9363041b /src/libcore
parente07df9c9df149b48ef7e035ddaa5ba5a22cb719c (diff)
parente86e5cb38ffb9a55f6d9ab6ebda2d384fb154626 (diff)
downloadrust-7697b2927f7eb161412487727a063e228862aa74.tar.gz
rust-7697b2927f7eb161412487727a063e228862aa74.zip
Rollup merge of #62476 - petrochenkov:expref, r=matthewjasper
Continue refactoring macro expansion and resolution

This PR continues the work started in https://github.com/rust-lang/rust/pull/62042.
It contains a set of more or less related refactorings with the general goal of making things simpler and more orthogonal.
Along the way most of the issues uncovered in https://github.com/rust-lang/rust/pull/62086 are fixed.

The PR is better read in per-commit fashion with whitespace changes ignored.
I tried to leave some more detailed commit messages describing the motivation behind the individual changes.

Fixes https://github.com/rust-lang/rust/issues/44692
Fixes https://github.com/rust-lang/rust/issues/52363
Unblocks https://github.com/rust-lang/rust/pull/62086
r? @matthewjasper
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/macros.rs3
-rw-r--r--src/libcore/ops/try.rs4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 2e999a0682b..293a2dd9492 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -1244,12 +1244,14 @@ mod builtin {
 
     /// Attribute macro applied to a function to turn it into a unit test.
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[allow_internal_unstable(test, rustc_attrs)]
     #[rustc_builtin_macro]
     #[rustc_macro_transparency = "semitransparent"]
     pub macro test($item:item) { /* compiler built-in */ }
 
     /// Attribute macro applied to a function to turn it into a benchmark test.
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[allow_internal_unstable(test, rustc_attrs)]
     #[rustc_builtin_macro]
     #[rustc_macro_transparency = "semitransparent"]
     pub macro bench($item:item) { /* compiler built-in */ }
@@ -1257,6 +1259,7 @@ mod builtin {
     /// An implementation detail of the `#[test]` and `#[bench]` macros.
     #[unstable(feature = "custom_test_frameworks", issue = "50297",
                reason = "custom test frameworks are an unstable feature")]
+    #[allow_internal_unstable(test, rustc_attrs)]
     #[rustc_builtin_macro]
     #[rustc_macro_transparency = "semitransparent"]
     pub macro test_case($item:item) { /* compiler built-in */ }
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs
index 9fa2c81954e..76fec1020f1 100644
--- a/src/libcore/ops/try.rs
+++ b/src/libcore/ops/try.rs
@@ -8,12 +8,12 @@
 #[rustc_on_unimplemented(
    on(all(
        any(from_method="from_error", from_method="from_ok"),
-       from_desugaring="?"),
+       from_desugaring="QuestionMark"),
       message="the `?` operator can only be used in a \
                function that returns `Result` or `Option` \
                (or another type that implements `{Try}`)",
       label="cannot use the `?` operator in a function that returns `{Self}`"),
-   on(all(from_method="into_result", from_desugaring="?"),
+   on(all(from_method="into_result", from_desugaring="QuestionMark"),
       message="the `?` operator can only be applied to values \
                that implement `{Try}`",
       label="the `?` operator cannot be applied to type `{Self}`")