resolve: Filter away macro prelude in modules with #[no_implicit_prelude] on 2018 edition#55630
Conversation
…lude]` on 2018 edition
|
r? @nikomatsakis |
Centril
left a comment
There was a problem hiding this comment.
This seems like the sane expected behavior given that macros can be used now.
|
Is |
|
@Centril Argh, I wish we could exclude copies of the Rust repo! |
|
@rfcbot fcp merge Seems like a good idea. I propose we do this -- I also propose that we land before FCP expires, as is our wont for smaller things. |
|
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams:
No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
@nikomatsakis I think if we keep |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@petrochenkov I think we can land this now. :) |
|
@bors r=Centril |
|
📌 Commit 9ed9d6d has been approved by |
|
⌛ Testing commit 9ed9d6d with merge 31871eb78127c8e0564eec957164787c4f206524... |
|
💔 Test failed - status-travis |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition
This is a tiny thing.
For historical reasons macro prelude (macros from `#[macro_use] extern crate ...`, including `extern crate std`) is still available in modules with `#[no_implicit_prelude]`.
This PR provides proper isolation and removes those names from scope.
`#[no_implicit_prelude]` modules still have built-in types (`u8`), built-in attributes (`#[inline]`) and built-in macros (`env!("PATH")`) in scope. We can introduce some `#[no_implicit_prelude_at_all]` to remove those as well, but that's a separate issue.
The change is done only on 2018 edition for backward compatibility.
I'm pretty sure this can be done on 2015 as well because `#[no_implicit_prelude]` is rarely used, but I don't want to go through the crater/deprecation process right now, maybe later.
cc rust-lang#53977
r? @ghost
Rollup of 17 pull requests Successful merges: - #55630 (resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition) - #55687 (Take supertraits into account when calculating associated types) - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.) - #55764 (Fix Rc/Arc allocation layout) - #55792 (Prevent ICE in const-prop array oob check) - #55799 (Removed unneeded instance of `// revisions` from a lint test) - #55800 (Fix ICE in `return_type_impl_trait`) - #55801 (NLL: Update box insensitivity test) - #55802 (Don't inline virtual calls (take 2)) - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.) - #55819 (Typecheck patterns of all match arms first, so we get types for bindings) - #55822 (ICE with #![feature(nll)] and elided lifetimes) - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`) - #55839 (Fix docstring spelling mistakes) - #55844 (Fix documentation typos.) - #55845 (Set BINARYEN_TRAP_MODE=clamp) - #55856 (rustdoc: refactor: move all static-file include!s into a single module)
|
Accepted for beta backport by T-compiler. Small change, breaking for 2018, which makes it fairly important. |
[beta] Rollup backports Merged and approved: * #55947: xLTO: Don't pass --plugin-opt=thin to LLD. That's not supported anymore. * #55852: Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint * #55800: Fix ICE in `return_type_impl_trait` * #55630: resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition r? @ghost
This is a tiny thing.
For historical reasons macro prelude (macros from
#[macro_use] extern crate ..., includingextern crate std) is still available in modules with#[no_implicit_prelude].This PR provides proper isolation and removes those names from scope.
#[no_implicit_prelude]modules still have built-in types (u8), built-in attributes (#[inline]) and built-in macros (env!("PATH")) in scope. We can introduce some#[no_implicit_prelude_at_all]to remove those as well, but that's a separate issue.The change is done only on 2018 edition for backward compatibility.
I'm pretty sure this can be done on 2015 as well because
#[no_implicit_prelude]is rarely used, but I don't want to go through the crater/deprecation process right now, maybe later.cc #53977
r? @ghost