Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upresolve: Implement prelude search for macro paths, implement tool attributes #52841
Conversation
rust-highfive
assigned
cramertj
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
label
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @alexcrichton |
rust-highfive
assigned
alexcrichton
and unassigned
cramertj
Jul 30, 2018
petrochenkov
referenced this pull request
Jul 30, 2018
Closed
tool_attributes feature stops working when rust_2018_preview feature is enabled #51277
petrochenkov
reviewed
Jul 30, 2018
| Err(Determinacy::Determined) | ||
| } | ||
| } | ||
| WhereToResolve::StdLibPrelude => { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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 |
mati865
referenced this pull request
Jul 30, 2018
Merged
Replace cfg_attr(rustfmt... with rustfmt::skip #2823
This comment has been minimized.
This comment has been minimized.
|
Looks great to me, thanks for the detailed comments! It looks like tool attributes like |
petrochenkov
force-pushed the
petrochenkov:premacro
branch
from
d28b1c6
to
dd93535
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors p=1 edition critical |
petrochenkov
referenced this pull request
Jul 31, 2018
Merged
#[feature(uniform_paths)]: allow `use x::y;` to resolve through `self::x`, not just `::x`. #52923
This comment has been minimized.
This comment has been minimized.
|
This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
bors
added
S-waiting-on-author
and removed
S-waiting-on-bors
labels
Aug 1, 2018
This comment has been minimized.
This comment has been minimized.
|
This is also blocking edition crater runs. |
petrochenkov
force-pushed the
petrochenkov:premacro
branch
from
dd93535
to
c3e5421
Aug 1, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-author
labels
Aug 1, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 1, 2018
bors
added
S-waiting-on-bors
and removed
S-waiting-on-author
labels
Aug 2, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors p=1 |
This comment has been minimized.
This comment has been minimized.
|
@bors: rollup- |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 2, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit c3e5421
into
rust-lang:master
Aug 2, 2018
alexcrichton
added a commit
to rust-lang/rust-clippy
that referenced
this pull request
Aug 3, 2018
This comment has been minimized.
This comment has been minimized.
|
This breaks Servo in a weird way. I'm unable to reproduce this out of tree https://travis-ci.org/servo/servo-with-rust-nightly/jobs/411851355
any idea what's going on? seems like a regression |
This comment has been minimized.
This comment has been minimized.
|
cc @pietroalbini might want to be careful about that regression before cutting a beta ^^ |
This comment has been minimized.
This comment has been minimized.
|
I'll look what happens. |
Mark-Simulacrum
added
the
beta-nominated
label
Aug 5, 2018
This comment has been minimized.
This comment has been minimized.
|
@Manishearth In this case macro expanded name (macro_rules macro Minimized reproduction: macro_rules! my_include {() => {
#[macro_use] extern crate log;
}}
my_include!();
fn main() {
warn!("");
}In this case, since breakage affects stable channel, built-in attributes can be somehow special-cased to avoid the error, or perhaps some more general solution can be found, but I'd prefer to see crater results before proceeding with a fix. |
This comment has been minimized.
This comment has been minimized.
|
Since #53072 doesn't include this PR, we need a separate crater run for it. |
This comment has been minimized.
This comment has been minimized.
|
Queued a crater run for this PR (check only) here: #53089 |
petrochenkov
removed
the
beta-nominated
label
Aug 5, 2018
SimonSapin
referenced this pull request
Aug 8, 2018
Closed
Regression importing log’s warn! macro inside of include!()ed file #53205
This comment has been minimized.
This comment has been minimized.
|
Good news! This PR improved compile speed on a few benchmarks, the best by 3.7%: |
petrochenkov commentedJul 30, 2018
•
edited
When identifier is macro path is resolved in scopes (i.e. the first path segment -
fooinfoo::mac!()orfoo!()), scopes are searched in the same order as for non-macro paths - items in modules, extern prelude, tool prelude (see later), standard library prelude, language prelude, but with some extra shadowing restrictions (names from globs and macro expansions cannot shadow names from outer scopes). See the comment infn resolve_lexical_macro_path_segmentfor more details."Tool prelude" currently contains two "tool modules"
rustfmtandclippy, and is searched immediately after extern prelude.This makes the possible long-term solution for tool attributes exactly equivalent to the existing extern prelude scheme, except that
--extern=my_cratemaking crate names available in scope is replaced with something like--tool=my_toolmaking tool names available in scope.The
tool_attributesfeature is still unstable and#![feature(tool_attributes)]now implicitly enables#![feature(use_extern_macros)].use_extern_macrosis a prerequisite fortool_attributes, so their stabilization will happen in the same order.If
use_extern_macrosis not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway).Fixes #52576
Fixes #52512
Fixes #51277
cc #52269