diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-12 10:58:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-12 10:58:18 +0200 |
| commit | 33f53d699c9c4891df89d2f11ac51cd8523f5278 (patch) | |
| tree | b1fc7f9c67d0a0ff20b6f6ec4e04b9cbd868c1fd /src/libsyntax | |
| parent | e19ce5d16a10ddb56ffac054f1bc7c6d7b022410 (diff) | |
| parent | fa7fe196018e5fec39dee7ca6567c2024e60daf6 (diff) | |
| download | rust-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.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 2 |
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]) |
