about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2017-02-25rustc: introduce a query system for type information in ty::maps.Eduard Burtescu-2/+2
2017-02-25rustc: store type parameter defaults outside of ty::Generics.Eduard-Mihai Burtescu-16/+89
2017-02-25Rollup merge of #39953 - keeperofdakeys:macro-error, r=jseyfriedEduard-Mihai Burtescu-29/+45
Provide suggestions for unknown macros imported with `use` cc https://github.com/rust-lang/rust/issues/30197 r? @jseyfried
2017-02-25Rollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakisEduard-Mihai Burtescu-12/+18
Normalize labeled and unlabeled breaks Part of #39849.
2017-02-23Add macro suggestions for macros imported with `use`Josh Driver-25/+38
This commit searchs modules for macro suggestions. It also removes imported macro_rules from macro_names, and adds more corner case checks for which macros should be suggested in specific contexts.
2017-02-23Move MacroKind into Def::MacroJosh Driver-4/+7
2017-02-22Don't assume plugin-whitelisted attributes are proc macro attributesAustin Bonander-0/+5
closes #40001
2017-02-19Privatize fields of PathResolutionVadim Petrochenkov-43/+38
Ensure Def::Err has depth == 0
2017-02-18Properly implement labeled breaks in while conditionsTaylor Cramer-12/+18
2017-02-16Refactor macro resolution errors + add derive macro suggestionsJosh Driver-53/+77
2017-02-12Allow using inert attributes from `proc_macro_derive`s with ↵Jeffrey Seyfried-16/+11
`#![feature(proc_macro)]`.
2017-02-12Move legacy custom derives collection into `resolver.find_attr_invoc()`.Jeffrey Seyfried-2/+55
2017-02-05Rollup merge of #39443 - phungleson:remove-unresolved-things, r=nikomatsakisCorey Farwell-1/+13
Don't suggest to use things which weren't found either Fixes #38054 The best code I can come up with, suggestions are welcome. Basically, removing ```. Did you mean to use `DoesntExist1`?``` in the code below, because it is useless. ```rust error[E0432]: unresolved import `DoesntExist1` --> src/lib.rs:1:5 | 1 | use DoesntExist1; | ^^^^^^^^^^^^ no `DoesntExist1` in the root error[E0432]: unresolved import `DoesntExist2` --> src/lib.rs:2:5 | 2 | use DoesntExist2; | ^^^^^^^^^^^^ no `DoesntExist2` in the root. Did you mean to use `DoesntExist1`? ```
2017-02-05Move derive macro expansion into the MacroExpanderJosh Driver-0/+26
This removes the expand_derives function, and sprinkles the functionality throughout the Invocation Collector, Expander and Resolver.
2017-02-05Rename CustomDerive to ProcMacroDerive for macros 1.1Josh Driver-1/+1
2017-02-02Suggest only if resolution was previously resolvedSon-1/+13
2017-01-29Improve diagnostics for inaccessible constructorsVadim Petrochenkov-9/+25
2017-01-29Implement compatibility lint for legacy constructor visibilitiesVadim Petrochenkov-2/+25
2017-01-29Privatize constructors of tuple structs with private fieldsVadim Petrochenkov-9/+13
2017-01-25Auto merge of #38920 - petrochenkov:selfimpl, r=eddybbors-53/+61
Partially implement RFC 1647 (`Self` in impl headers) The name resolution part is easy, but the typeck part contains an unexpected problem. It turns out that `Self` type *depends* on bounds and `where` clauses, so we need to convert them first to determine what the `Self` type is! If bounds/`where` clauses can refer to `Self` then we have a cyclic dependency. This is required to support impls like this: ``` // Found in libcollections impl<I: IntoIterator> SpecExtend<I> for LinkedList<I::Item> { .... } ^^^^^ associated type `Item` is found using information from bounds ``` I'm not yet sure how to resolve this issue. One possible solution (that feels hacky) is to make two passes over generics - first collect predicates ignoring everything involving `Self`, then determine `Self`, then collect predicates again without ignoring anything. (Some kind of lazy on-demand checking or something looks like a proper solution.) This patch in its current state doesn't solve the problem with `Self` in bounds, so the only observable things it does is improving error messages and supporting `impl Trait<Self> for Type {}`. There's also a question about feature gating. It's non-trivial to *detect* "newly resolved" `Self`s to feature gate them, but it's simple to *enable* the new resolution behavior when the feature gate is already specified. Alternatively this can be considered a bug fix and merged without a feature gate. cc https://github.com/rust-lang/rust/issues/38864 r? @nikomatsakis cc @eddyb Whitespace ignoring diff https://github.com/rust-lang/rust/pull/38920/files?w=1
2017-01-22Warn on unused `#[macro_use]` imports.Jeffrey Seyfried-8/+38
2017-01-21Resolve `Self` in impl headersVadim Petrochenkov-53/+61
2017-01-21Improve `unused_extern_crate` warnings.Jeffrey Seyfried-31/+36
2017-01-20Rollup merge of #39168 - estebank:multiline-candidate, r=petrochenkovAlex Crichton-16/+17
Use multiline Diagnostic for candidate in other module ``` error[E0574]: expected struct, variant or union type, found enum `Result` --> $DIR/issue-16058.rs:19:9 | 19 | Result { | ^^^^^^ not a struct, variant or union type | = help: possible better candidates are found in other modules, you can import them into scope: `use std::fmt::Result;` `use std::io::Result;` `use std::thread::Result;` error: aborting due to previous error ```
2017-01-20Rollup merge of #39077 - jseyfried:crate_var_imports, r=nrcAlex Crichton-1/+4
Improve the warning cycle for `use $crate;` Fixes #39049. r? @nrc
2017-01-18Use multiline Diagnostic for candidate in other moduleEsteban Küber-16/+17
2017-01-16Implement `#[proc_macro_attribute]`Austin Bonander-3/+86
* Add support for `#[proc_macro]` * Reactivate `proc_macro` feature and gate `#[proc_macro_attribute]` under it * Have `#![feature(proc_macro)]` imply `#![feature(use_extern_macros)]`, error on legacy import of proc macros via `#[macro_use]`
2017-01-15Improve the warning cycle for `use $crate;`.Jeffrey Seyfried-1/+4
2017-01-13resolve: Levenshtein-based suggestions for non-import pathsVadim Petrochenkov-16/+65
2017-01-13Auto merge of #38890 - petrochenkov:noresolve, r=nrcbors-13/+24
resolve: Do not use "resolve"/"resolution" in error messages Use less jargon-y wording instead. `cannot find <struct> <S> in <this scope>` and `cannot find <struct> <S> in <module a::b>` are used for base messages (this also harmonizes nicely with "you can import it into scope" suggestions) and `not found in <this scope>` and `not found in <a::b>` are used for short labels in fall-back case. I tweaked some other diagnostics to avoid using "resolve" (see, e.g., `librustc_resolve/macros.rs`), but haven't touched messages for imports. Closes https://github.com/rust-lang/rust/issues/38750 r? @nrc
2017-01-12resolve: Do not use "resolve"/"resolution" in error messagesVadim Petrochenkov-13/+24
2017-01-11Auto merge of #38313 - jseyfried:self_imports, r=nrcbors-11/+45
resolve: clean up the semantics of `self` in an import list Change `self` in an import list `use foo::bar::{self, ...};` to import `bar` only in the type namespace. Today, `bar` is imported in every namespace in which `foo::bar` is defined. This is a [breaking-change], see https://github.com/rust-lang/rust/issues/38293#issue-194817974 for examples of code that would break. Fixes #38293. r? @nrc
2017-01-10Start warning cycle.Jeffrey Seyfried-1/+31
2017-01-10Change `self` in an import list `use foo::{self, ...}` to only import a ↵Jeffrey Seyfried-10/+14
module or enum `foo`.
2017-01-08Fix ICE when variant is used as a part of associated typeVadim Petrochenkov-3/+5
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2017-01-06Auto merge of #38793 - jseyfried:fix_macro_export_duplicates, r=nrcbors-1/+7
Fix regression with duplicate `#[macro_export] macro_rules!` Fixes #38715. r? @nrc
2017-01-04Fix regression with duplicate `#[macro_export] macro_rules!`.Jeffrey Seyfried-1/+7
2017-01-04Don't `unused_qualifications`-check global paths.Jeffrey Seyfried-13/+12
2016-12-31Auto merge of #38482 - est31:i128, r=eddybbors-2/+16
i128 and u128 support Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs. Rebased version of #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue... [plugin-breaking-change] cc #35118 (tracking issue)
2016-12-31Style fixesJosh Driver-2/+1
2016-12-31Stop macro calls in structs for proc_macro_derive from panicingJosh Driver-0/+5
2016-12-30Fix rebase falloutSimonas Kazlauskas-2/+2
This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-30Feature gate the 128 bit typesSimonas Kazlauskas-1/+14
Dangling a carrot in front of a donkey. This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-1/+2
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-0/+13
2016-12-28hir: lower `ImplicitSelf` to resolved `Self` TyQPath's.Eduard-Mihai Burtescu-0/+12
2016-12-26More systematic error reporting in path resolutionVadim Petrochenkov-777/+663
2016-12-25Auto merge of #38490 - jseyfried:def_id_vis, r=nrcbors-76/+70
Use `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities This is groundwork for hygiene 2.0, specifically privacy checking hygienic intercrate name resolutions. r? @nrc