diff options
| author | bors <bors@rust-lang.org> | 2018-08-02 21:39:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-02 21:39:14 +0000 |
| commit | 40e4b6ee3dd70a05007915bd1c15c150a7b7899f (patch) | |
| tree | b9ca402630b5a091d7fb317c270af3b8d83683bf /src/rustllvm/RustWrapper.cpp | |
| parent | 40cb4478a3f550bf12d81cdcf08cc9ef3985ed41 (diff) | |
| parent | c3e54217e855a2492d9b707eb3fb7cdb6702d45a (diff) | |
| download | rust-40e4b6ee3dd70a05007915bd1c15c150a7b7899f.tar.gz rust-40e4b6ee3dd70a05007915bd1c15c150a7b7899f.zip | |
Auto merge of #52841 - petrochenkov:premacro, r=alexcrichton
resolve: Implement prelude search for macro paths, implement tool attributes When identifier is macro path is resolved in scopes (i.e. the first path segment - `foo` in `foo::mac!()` or `foo!()`), 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 in `fn resolve_lexical_macro_path_segment` for more details. "Tool prelude" currently contains two "tool modules" `rustfmt` and `clippy`, and is searched immediately after extern prelude. This makes the [possible long-term solution](https://github.com/rust-lang/rfcs/blob/master/text/2103-tool-attributes.md#long-term-solution) for tool attributes exactly equivalent to the existing extern prelude scheme, except that `--extern=my_crate` making crate names available in scope is replaced with something like `--tool=my_tool` making tool names available in scope. The `tool_attributes` feature is still unstable and `#![feature(tool_attributes)]` now implicitly enables `#![feature(use_extern_macros)]`. `use_extern_macros` is a prerequisite for `tool_attributes`, so their stabilization will happen in the same order. If `use_extern_macros` is not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway). Fixes https://github.com/rust-lang/rust/issues/52576 Fixes https://github.com/rust-lang/rust/issues/52512 Fixes https://github.com/rust-lang/rust/issues/51277 cc https://github.com/rust-lang/rust/issues/52269
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
