about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2016-10-24Import macros in `resolve` instead of in `metadata::macro_import`.Jeffrey Seyfried-58/+336
2016-10-22Fix label scopes.Jeffrey Seyfried-19/+13
2016-10-21Auto merge of #37247 - jseyfried:future_proof_no_link, r=nrcbors-1/+1
macros: Future proof `#[no_link]` This PR future proofs `#[no_link]` for macro modularization (cc #35896). First, we resolve all `#[no_link] extern crate`s. `#[no_link]` crates without `#[macro_use]` or `#[macro_reexport]` are not resolved today, this is a [breaking-change]. For example, ```rust ``` Any breakage can be fixed by simply removing the `#[no_link] extern crate`. Second, `#[no_link] extern crate`s will define an empty module in type namespace to eventually allow importing the crate's macros with `use`. This is a [breaking-change], for example: ```rust mod syntax {} //< This becomes a duplicate error. ``` r? @nrc
2016-10-19Future proof `#[no_link]`.Jeffrey Seyfried-1/+1
2016-10-19Improve `$crate`.Jeffrey Seyfried-3/+31
2016-10-19Use `Ident`s instead of `Name`s in `ImportDirective`'s paths.Jeffrey Seyfried-44/+37
2016-10-19nit: Import `Ident` in `resolve`.Jeffrey Seyfried-14/+14
2016-10-19Rollup merge of #37198 - jseyfried:future_proof_macros_11, r=nrcEduard-Mihai Burtescu-50/+42
macros 1.1: future proofing and cleanup This PR - uses the macro namespace for custom derives (instead of a dedicated custom derive namespace), - relaxes the shadowing rules for `#[macro_use]`-imported custom derives to match the shadowing rules for ordinary `#[macro_use]`-imported macros, and - treats custom derive `extern crate`s like empty modules so that we can eventually allow, for example, `extern crate serde_derive; use serde_derive::Serialize;` backwards compatibly. r? @alexcrichton
2016-10-15Treat custom derive extern crates like empty modules.Jeffrey Seyfried-0/+6
2016-10-15Use the macro namespace for custom derives.Jeffrey Seyfried-33/+27
2016-10-15Refactor `syntax::ext::base::Resolver::resolve_invoc`.Jeffrey Seyfried-17/+9
2016-10-14Rollup merge of #36307 - faebser:E0408_new_error_format, r=GuillaumeGomezJonathan Turner-2/+4
Changed error message E0408 to new format Followed your text and was able to change the ouput to the new format. I did not encounter any broken test therefore this is a really small commit. Thanks for letting me hack on the compiler :) r? @jonathandturner
2016-10-13Changed error message E0408 to new formatFabian Frei-2/+4
r? @jonathandturner
2016-10-12Rollup merge of #37084 - jseyfried:cleanup_expanded_macro_use_scopes, r=nrcAlex Crichton-127/+212
macros: clean up scopes of expanded `#[macro_use]` imports This PR changes the scope of macro-expanded `#[macro_use]` imports to match that of unexpanded `#[macro_use]` imports. For example, this would be allowed: ```rust example!(); macro_rules! m { () => { #[macro_use(example)] extern crate example_crate; } } m!(); ``` This PR also enforces the full shadowing restrictions from RFC 1560 on `#[macro_use]` imports (currently, we only enforce the weakened restrictions from #36767). This is a [breaking-change], but I believe it is highly unlikely to cause breakage in practice. r? @nrc
2016-10-12Rollup merge of #37023 - jseyfried:fix_extern_crate_back_compat, r=nrcAlex Crichton-1/+2
Fix importing inaccessible `extern crate`s (with a warning) Fixes #36747, fixes #37020, and fixes #37021. r? @nrc
2016-10-11Auto merge of #36871 - petrochenkov:pdderr, r=nikomatsakisbors-5/+1
Turn compatibility lint `match_of_unit_variant_via_paren_dotdot` into a hard error The lint was introduced 10 months ago and made deny-by-default 7 months ago. In case someone is still using it, https://github.com/rust-lang/rust/pull/36868 contains a stable replacement. r? @nikomatsakis
2016-10-11Remove `LegacyBindingKind::MacroUse`.Jeffrey Seyfried-34/+15
2016-10-11Clean up the scopes of expanded `#[macro_use]` imports.Jeffrey Seyfried-23/+25
2016-10-11Add support for undetermined macro invocations.Jeffrey Seyfried-12/+7
2016-10-11Merge branch 'persistent_macro_scopes' into cleanup_expanded_macro_use_scopesJeffrey Seyfried-117/+224
2016-10-11Check for shadowing errors after all invocations have been expanded.Jeffrey Seyfried-17/+26
2016-10-10Avoid quadratic complexity.Jeffrey Seyfried-2/+18
2016-10-08Persistent macro scopes.Jeffrey Seyfried-99/+167
2016-10-07Rename `resolve::macros::{ExpansionData -> InvocationData}`.Jeffrey Seyfried-29/+29
2016-10-07Immutable `ExpansionData`.Jeffrey Seyfried-23/+37
2016-10-07Auto merge of #36945 - alexcrichton:proc-macro-rename, r=nrcbors-2/+2
rustc: Rename rustc_macro to proc_macro This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-10-07Support importing inaccessible `extern crate`s with a warning again.Jeffrey Seyfried-1/+2
2016-10-06rustc: Rename rustc_macro to proc_macroAlex Crichton-2/+2
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-10-05Turn compatibility lint `match_of_unit_variant_via_paren_dotdot` into a hard ↵Vadim Petrochenkov-5/+1
error
2016-10-04Remove some unused methods from metadataVadim Petrochenkov-0/+1
Address comments + Fix rebase
2016-10-04Turn some impossible definitions into ICEsVadim Petrochenkov-2/+1
2016-10-04Eliminate ty::VariantKind in favor of def::CtorKindVadim Petrochenkov-2/+2
2016-10-04Move pattern resolution checks from typeck to resolveVadim Petrochenkov-12/+19
Make error messages more precise
2016-10-04Further cleanup in resolveVadim Petrochenkov-76/+52
`try_define` is not used in build_reduced_graph anymore Collection of field names for error reporting is optimized Some comments added
2016-10-04Fix cross-crate resolution of half-items created by export shadowingVadim Petrochenkov-24/+10
2016-10-04Separate Def::StructCtor/Def::VariantCtor from Def::Struct/Def::VariantVadim Petrochenkov-21/+28
2016-10-04Fix an ICE in BuildReducedGraphVisitor::visit_trait_item.Nicholas Nethercote-1/+5
This ICE occurs in the futures-rs-test-all benchmark in rustc-benchmarks.
2016-10-03Auto merge of #36767 - jseyfried:enforce_rfc_1560_shadowing, r=nrcbors-43/+112
Enforce the shadowing restrictions from RFC 1560 for today's macros This PR enforces a weakened version of the shadowing restrictions from RFC 1560. More specifically, - If a macro expansion contains a `macro_rules!` macro definition that is used outside of the expansion, the defined macro may not shadow an existing macro. - If a macro expansion contains a `#[macro_use] extern crate` macro import that is used outside of the expansion, the imported macro may not shadow an existing macro. This is a [breaking-change]. For example, ```rust macro_rules! m { () => {} } macro_rules! n { () => { macro_rules! m { () => {} } //< This shadows an existing macro. m!(); //< This is inside the expansion that generated `m`'s definition, so it is OK. } } n!(); m!(); //< This use of `m` is outside the expansion, so it causes the shadowing to be an error. ``` r? @nrc
2016-10-02Enforce the weakened shadowing restriction.Jeffrey Seyfried-17/+68
2016-10-02Record macro import site spans.Jeffrey Seyfried-4/+4
2016-10-02Refactor out `resolve_macro_name`.Jeffrey Seyfried-11/+16
2016-10-02Add field `backtrace: SyntaxContext` to `ExpansionData`.Jeffrey Seyfried-2/+6
2016-10-02Refactor `ext::base::Resolver::add_ext` to only define macros in the crate root.Jeffrey Seyfried-8/+11
2016-10-02Refactor field `expansion_data` of `Resolver` to use a `Mark` instead of a ↵Jeffrey Seyfried-10/+10
`u32`.
2016-10-02Add struct `macros::NameBinding`.Jeffrey Seyfried-6/+12
2016-10-01Rollup merge of #36882 - jseyfried:fix_36881, r=eddybManish Goregaokar-1/+1
resolve: fix incorrect code in `module_to_string` Fixes #36881. r? @nrc or @eddyb
2016-10-01Fix `module_to_string`.Jeffrey Seyfried-1/+1
2016-09-30Auto merge of #36819 - jseyfried:fix_ast_const_integer_ice, r=nrcbors-3/+6
Fix ICE on some macros in const integer positions (e.g. `[u8; m!()]`) Fixes #36816. r? @nrc
2016-09-28Rollup merge of #36787 - jseyfried:fix_test_harness_reexport_errors, r=nrcJonathan Turner-3/+2
Avoid re-export errors in the generated test harness Fixes #36768. r? @nrc
2016-09-29Fix ICE on a macro in a constant integer position that expands into other ↵Jeffrey Seyfried-3/+6
macros.