summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2016-11-03Fix label scopes.Jeffrey Seyfried-19/+13
2016-10-19Support importing inaccessible `extern crate`s with a warning again.Jeffrey Seyfried-1/+2
2016-09-27Auto merge of #36761 - jonathandturner:E0425_E0446_E0449, r=nrcbors-4/+9
Update E0425, E0446, E0449 This addresses https://github.com/rust-lang/rust/issues/35343, https://github.com/rust-lang/rust/issues/35923, and https://github.com/rust-lang/rust/issues/35924. Part of https://github.com/rust-lang/rust/issues/35233 Specifically, this adds labels to these error messages following the suggestions in the attached bugs. r? @nrc
2016-09-26Auto merge of #36678 - TimNN:fix-dist, r=alexcrichtonbors-2/+2
emit feature help in cheat mode (fix nightlies) This should fix the `distcheck` failure in the latest nightly. cc #36539 It's probably not ideal to check the environment that often and the code ist duplicated from `librustc/session/config.rs` but this was the easiest fix I could think of. A cleaner solution would probably be to move the `unstable_features` from `Options` to `ParseSess` and change the `diag` parameter of `emit_feature_err` to take `ParseSess` instead of a `Handler`.
2016-09-26Update E0425, E0446, E0449Jonathan Turner-4/+9
2016-09-26fix rebase falloutTim Neumann-2/+2
2016-09-26Forbid user-defined macros named "macro_rules".Jeffrey Seyfried-0/+3
2016-09-24Load macros from `#[macro_use]` extern crates in `resolve`.Jeffrey Seyfried-8/+55
2016-09-23Load extern crates in `resolve`.Jeffrey Seyfried-5/+8
2016-09-22Auto merge of #36573 - jseyfried:groundwork, r=nrcbors-154/+142
resolve: groundwork for building the module graph during expansion r? @nrc
2016-09-22Auto merge of #36154 - nrc:proc-macro-init, r=@jseyfriedbors-1/+3
Adds a `ProcMacro` form of syntax extension This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too. Supports both attribute-like and function-like macros. Note that RFC #1566 has not been accepted yet, but I think there is consensus that we want to head in vaguely that direction and so this PR will be useful in any case. It is also fairly easy to undo and does not break any existing programs. This is related to #35957 in that I hope it can be used in the implementation of macros 1.1, however, there is no direct overlap and is more of a complement than a competing proposal. There is still a fair bit of work to do before the two can be combined. r? @jseyfried cc @alexcrichton, @cgswords, @eddyb, @aturon
2016-09-22Use `Resolver::visit_expansion` only with monotonic expansions.Jeffrey Seyfried-9/+11
2016-09-23reviewer comments and rebasingNick Cameron-1/+3
2016-09-22Refactor `no_implicit_prelude: Cell<bool>` -> `no_implicit_prelude: bool`.Jeffrey Seyfried-39/+39
2016-09-22Avoid reconstructing the `BuildReducedGraphVisitor`.Jeffrey Seyfried-6/+6
2016-09-22Refactor out `BuildReducedGraphVisitor::visit_trait_item`.Jeffrey Seyfried-23/+32
2016-09-22Refactor away `ParentLink`.Jeffrey Seyfried-101/+78
2016-09-20rustc_resolve: bring back "struct called like a function" cross-crate.Eduard Burtescu-1/+5
2016-09-20rustc_metadata: move opt_item_name to TyCtxt::item_name.Eduard Burtescu-1/+2
2016-09-20rustc_metadata: split the Def description of a DefId from item_children.Eduard Burtescu-7/+18
2016-09-20rustc_metadata: group information into less tags.Eduard Burtescu-18/+12
2016-09-20rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.Eduard Burtescu-2/+2
2016-09-20rustc_metadata: move more RBML tags to auto-serialization.Eduard Burtescu-27/+11
2016-09-20rustc: replace uses of NodeId in Def, other than closures and labels.Eduard Burtescu-6/+7
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-3/+3
2016-09-20rustc_metadata: remove astencode tests.Eduard Burtescu-2/+2
2016-09-15Auto merge of #36393 - petrochenkov:ancient, r=eddybbors-2/+2
Remove some obsolete code from the compiler
2016-09-15Rollup merge of #36438 - jseyfried:node_ids_in_expansion, r=nrcManish Goregaokar-96/+234
Assign node ids during macro expansion After this PR, - The `ExtCtxt` can access `resolve`'s `Resolver` through the trait object `ext::base::Resolver`. - The `Resolver` trait object can load macros and replaces today's `MacroLoader` trait object. - The macro expander uses the `Resolver` trait object to resolve macro invocations. - The macro expander assigns node ids and builds the `Resolver`'s `macros_at_scope` map. - This is groundwork for merging import resolution and expansion. - Performance of expansion together with node id assignment improves by ~5%. **EDIT:** Since Github is reordering the commits, here is `git log`: - b54e1e399741579612f13e2df98a25ea9447989d: Differentiate between monotonic and non-monotonic expansion and only assign node ids during monotonic expansion. - 78c00398780db6f59ebf43e765fa9368dad436d2: Expand generated test harnesses and macro registries. - f3c2dca3539e6edc745f9c91898cb97d281865c1: Remove scope placeholders from the crate root. - c86c8d41a26b2037e80c9fd028a59313a78b3a66: Perform node id assignment and `macros_at_scope` construction during the `InvocationCollector` and `PlaceholderExpander` folds. - 72a636975fc5d0bb4af45af7bdd97987cc722a6a: Move macro resolution into `librustc_resolve`. - 20b43b23230ce063ccf99a4841d85790ad311bdf: Rewrite the unit tests in `ext/expand.rs` as a `compile-fail` test. - a9821e1658240bb2c056f260a4b6bc9789301fae: Refactor `ExtCtxt` to use a `Resolver` instead of a `MacroLoader`. - 60440b226d2f70bdae803443ff7ad2e2af2c9b10: Refactor `noop_fold_stmt_kind` out of `noop_fold_stmt`. - 50f94f6c95c944f08c4af264f48260e42efefd47: Avoid needless reexpansions. r? @nrc
2016-09-15Rollup merge of #36429 - durka:patch-30, r=nagisaManish Goregaokar-3/+3
fix "X is not a member of trait Y" span labels Fixes #36428.
2016-09-13Remove some ancient code providing special support for newtypesVadim Petrochenkov-2/+2
2016-09-13Perform node id assignment and `macros_at_scope` construction duringJeffrey Seyfried-93/+4
the `InvocationCollector` and `PlaceholderExpander` folds.
2016-09-13Move macro resolution into `librustc_resolve`.Jeffrey Seyfried-10/+221
2016-09-13Refactor `ExtCtxt` to use a `Resolver` instead of a `MacroLoader`.Jeffrey Seyfried-1/+17
2016-09-13fix "X is not a member of trait Y" span labelsAlex Burka-3/+3
The span labels for associated types and consts were hardcoded to `Foo` rather than substituting the name of the trait. This also normalizes the wording for associated methods', traits', and consts' span labels. Fixes #36428.
2016-09-11Documentation of what does for each typeathulappadan-0/+1
2016-09-07Auto merge of #36289 - euclio:self-suggestion, r=jseyfriedbors-1/+13
resolve: Suggest `use self` when import resolves Improves errors messages by replacing "Maybe a missing `extern crate`" messages with "Did you mean `self::...`" when the `self` import would succeed. Fixes #34191. Thank you for the help @jseyfried!
2016-09-06Add struct `AmbiguityError`.Jeffrey Seyfried-4/+11
2016-09-06Add field `used: Cell<bool>` to variant `NameBindingKind::Import`.Jeffrey Seyfried-22/+17
2016-09-06Avoid false positive unused import warnings.Jeffrey Seyfried-5/+6
2016-09-05show `self` suggestion when items are in the blockAndy Russell-8/+6
2016-09-05resolve: Suggest `use self` when import resolvesAndy Russell-1/+15
Improves errors messages by replacing "Maybe a missing `extern crate`" messages with "Did you mean `self::...`" when the `self` import would succeed.
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-11/+11
2016-09-04Replace `_, _, _` with `..`Vadim Petrochenkov-4/+5
2016-09-03Some better support for unions through the compilerVadim Petrochenkov-2/+3
2016-09-03Add unions to definition mapVadim Petrochenkov-1/+20
2016-09-02Address comments.Jeffrey Seyfried-18/+25
2016-09-01Avoid cascading name resolution errors caused by an ambiguous module.Jeffrey Seyfried-30/+40
2016-09-01Avoid reporting multiple ambiguity errors for a single use of a name.Jeffrey Seyfried-11/+19
2016-09-01item_like_imports: Allow unused ambiguous glob imports.Jeffrey Seyfried-10/+55
2016-09-01item_like_imports: Allow multiple glob imports of the same item.Jeffrey Seyfried-5/+15