summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-12 10:58:18 +0200
committerGitHub <noreply@github.com>2019-08-12 10:58:18 +0200
commit33f53d699c9c4891df89d2f11ac51cd8523f5278 (patch)
treeb1fc7f9c67d0a0ff20b6f6ec4e04b9cbd868c1fd /src/libsyntax
parente19ce5d16a10ddb56ffac054f1bc7c6d7b022410 (diff)
parentfa7fe196018e5fec39dee7ca6567c2024e60daf6 (diff)
downloadrust-33f53d699c9c4891df89d2f11ac51cd8523f5278.tar.gz
rust-33f53d699c9c4891df89d2f11ac51cd8523f5278.zip
Rollup merge of #63449 - petrochenkov:builtinagain, r=eddyb
resolve: Remove remaining special cases from built-in macros

Edition and definition sites of the macros are now also taken from the `#[rustc_builtin_macro]` definitions in `libcore`.

---
The edition switch may be a breaking change for `Rustc{Encodable,Decodable}` derives if they are used in combination with the unstable crate `serialize` from sysroot like this
```rust
extern crate serialize;
use serialize as rustc_serialize;

#[derive(RustcEncodable)]
struct S;
```
(see the updated `ui-fulldeps` tests).
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/base.rs4
-rw-r--r--src/libsyntax/ext/build.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index d69822c7c7f..7f4feff6be6 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -592,8 +592,8 @@ pub struct SyntaxExtension {
     pub helper_attrs: Vec<Symbol>,
     /// Edition of the crate in which this macro is defined.
     pub edition: Edition,
-    /// Built-in macros have a couple of special properties (meaning of `$crate`,
-    /// availability in `#[no_implicit_prelude]` modules), so we have to keep this flag.
+    /// Built-in macros have a couple of special properties like availability
+    /// in `#[no_implicit_prelude]` modules, so we have to keep this flag.
     pub is_builtin: bool,
     /// We have to identify macros providing a `Copy` impl early for compatibility reasons.
     pub is_derive_copy: bool,
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index db562840e8d..22962499a2b 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -495,7 +495,7 @@ impl<'a> ExtCtxt<'a> {
         let expr_loc_ptr = self.expr_addr_of(span, expr_loc_tuple);
         self.expr_call_global(
             span,
-            self.std_path(&[sym::rt, sym::begin_panic]),
+            [sym::std, sym::rt, sym::begin_panic].iter().map(|s| Ident::new(*s, span)).collect(),
             vec![
                 self.expr_str(span, msg),
                 expr_loc_ptr])