about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2018-06-20Use ParamBounds in WhereRegionPredicatevarkor-3/+3
2018-06-20Lift bounds into GenericParamvarkor-2/+2
2018-06-20Rename structures in astvarkor-6/+6
2018-06-20Refactor generic parameters in rustdoc/cleanvarkor-10/+5
2018-06-20Refactor ast::GenericParam as a structvarkor-29/+44
2018-06-20Rename ast::GenericParam and ast::GenericArgvarkor-5/+5
It's so confusing to have everything having the same name, at least while refactoring.
2018-06-20Rename "parameter" to "arg"varkor-2/+2
2018-06-18Auto merge of #51414 - oli-obk:impl_trait_type_def, r=pnkfelixbors-0/+1
Add existential type definitions Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items. r? @nikomatsakis
2018-06-18Auto merge of #51605 - ericfindlay:master, r=kennytmbors-1/+1
Fixed minor error in Compiler Error Index, E0603.
2018-06-17Fixed minor error in Compiler Error Index, E0603.Eric Findlay-1/+1
2018-06-14create multiple HIR items for a use statementQuietMisdreavus-43/+13
2018-06-12Auto merge of #51519 - ExpHP:issue-51331-b, r=petrochenkovbors-3/+22
Fix for $crate var normalization in proc macro for externally defined macros Fixes #51331, a bug that has existed in at least *some* form for a year and a half. The PR includes the addition of a `fold_qpath` method to `syntax::fold::Folder`. Overriding this method is useful for folds that modify paths in a way that invalidates indices (insertion or removal of a component), as it provides the opportunity to update `qself.position` in `<A as B>::C` paths. I added it because the bugfix is messy without it. (unfortunately, grepping around the codebase, I did not see anything else that could use it.)
2018-06-12fix issue #51331 by updating qself.positionMichael Lamparski-3/+22
2018-06-11Fix extern prelude failure in rustdocGuillaume Gomez-1/+6
2018-06-11Auto merge of #51461 - estebank:e0423-doc, r=petrochenkovbors-4/+30
Update E0423 description E0423 doesn't apply only to structs, update the error index description to make this clear. Fix #42077.
2018-06-09Update E0423 descriptionEsteban Küber-4/+30
E0423 doesn't apply only to structs, update the error index description to make this clear.
2018-06-08Rollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakisMark Rousskov-2/+32
Suggest parentheses when a struct literal needs them When writing a struct literal in an expression that expects a block to be started afterwards (like an `if` statement), do not suggest using the same struct literal: ``` did you mean `S { /* fields * /}`? ``` Instead, suggest surrounding the expression with parentheses: ``` did you mean `(S { /* fields * /})`? ``` Fix #47360, #50090. Leaving #42982 open to come back to this problem with a better solution.
2018-06-08Rollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakisMark Rousskov-3/+13
Add deprecation lint for duplicated `macro_export`s cc https://github.com/rust-lang/rust/issues/35896#issuecomment-381370556
2018-06-07Add existential type definitonsOliver Schneider-0/+1
2018-06-04Suggest braces when a struct literal needs themEsteban Küber-2/+32
When writing a struct literal in an expression that expects a block to be started afterwards (like an `if` statement), do not suggest using the same struct literal: ``` did you mean `S { /* fields * /}`? ``` Instead, suggest surrounding the expression with parentheses: ``` did you mean `(S { /* fields * /})`? ```
2018-06-03Remove is_import fieldMark Simulacrum-2/+0
2018-05-31Add std/core to prelude if extern_prelude enabledMatt Brubeck-1/+11
Fixes #50605
2018-05-30resolve: Make sure indeterminate and inconsistent macro resolutions always ↵Vadim Petrochenkov-16/+58
generate errors
2018-05-30Prohibit duplicate `macro_export`sVadim Petrochenkov-3/+13
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-8/+8
2018-05-25Fix naming conventions for new lintsVadim Petrochenkov-1/+1
2018-05-24Auto merge of #50943 - oli-obk:cleanups, r=estebankbors-74/+3
impl Trait diagnostic/test cleanups
2018-05-23"crate-ify" paths that begin with a renamed crateNiko Matsakis-1/+3
2018-05-23Auto merge of #50983 - nikomatsakis:issue-50970-migration-lint-fq-path, ↵bors-20/+130
r=alexcrichton Issue 50970 migration lint fq path Similar issue, but for fully qualified paths. Fixes #50970 r? @alexcrichton
2018-05-23pacify the mercilous tidyNiko Matsakis-1/+2
2018-05-23handle fully qualified paths properly when lintingNiko Matsakis-8/+48
fixes #50970
2018-05-22thread info about `CrateLint` through more deeplyNiko Matsakis-15/+63
2018-05-22add `Span` information into `Qself`Niko Matsakis-0/+21
2018-05-22rustc: Fix another double-lint issue with `crate::`Alex Crichton-2/+8
This commit fixes another issue in the `absolute_path_not_starting_with_crate` lint where it warns twice about an import which may contain `self`. It turns out there were a few more locations that needed updating to use `root_id` and `root_span` introduced in #50970 and after that it looks to work like a charm! Closes #50978
2018-05-22Auto merge of #50969 - nikomatsakis:issue-50673-broken-migration-lint, ↵bors-39/+139
r=alexcrichton fix suggestions with nested paths Fixes #50673 cc @Manishearth @petrochenkov r? @alexcrichton
2018-05-22pacify the mercilous tidyNiko Matsakis-5/+29
2018-05-22pass down information about the root tree and use that to guide lintNiko Matsakis-34/+62
2018-05-21Improve the diagnostic around impl Trait <-> generic param mismatchOliver Schneider-74/+3
2018-05-20Auto merge of #50851 - eddyb:the-only-constant, r=nikomatsakisbors-43/+6
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants". Previously, constants in array lengths and enum variant discriminants were "merely an expression", and had no separate ID for, e.g. type-checking or const-eval, instead reusing the expression's. That complicated code working with bodies, because such constants were the only special case where the "owner" of the body wasn't the HIR parent, but rather the same node as the body itself. Also, if the body happened to be a closure, we had no way to allocate a `DefId` for both the constant *and* the closure, leading to *several* bugs (mostly ICEs where type errors were expected). This PR rectifies the situation by adding another (`{ast,hir}::AnonConst`) node around every such constant. Also, const generics are expected to rely on the new `AnonConst` nodes, as well (cc @varkor). * fixes #48838 * fixes #50600 * fixes #50688 * fixes #50689 * obsoletes #50623 r? @nikomatsakis
2018-05-20resolve: Don't add unnecessary import candidates for `prefix::{self}` importsVadim Petrochenkov-2/+2
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-43/+6
constants".
2018-05-19Auto merge of #50763 - KyleStach1678:unused-loop-label, r=petrochenkovbors-2/+14
Add lint checks for unused loop labels Previously no warning was generated when a loop label was written out but never used (i.e. in a `break` or `continue` statement): ```rust fn main() { 'unused_label: loop {} } ``` would compile without complaint. This fix introduces `-W unused_loop_label`, which generates the following warning message for the above snippet: ``` warning: unused loop label --> main.rs:2:5 | 2 | 'unused_label: loop {} | ^^^^^^^^^^^^^ | = note: #[warn(unused_loop_label)] on by default ``` Fixes: #50751.
2018-05-19Auto merge of #50760 - petrochenkov:legimp, r=nikomatsakisbors-88/+15
Turn deprecation lint `legacy_imports` into a hard error Closes https://github.com/rust-lang/rust/issues/38260 The lint was introduced in Dec 2016, then made deny-by-default in Jun 2017 when crater run found 0 regressions caused by it. This lint requires some not entirely trivial amount of import resolution logic that (surprisingly or not) interacts with `feature(use_extern_macros)` (https://github.com/rust-lang/rust/issues/35896), so it would be desirable to remove it before stabilizing `use_extern_macros`. In particular, this PR fixes the failing example in https://github.com/rust-lang/rust/issues/50725 (but not the whole issue, `use std::panic::{self}` still can cause other undesirable errors when `use_extern_macros` is enabled).
2018-05-18Reimplement unused_labels lint as a compiler builtin in the resolverKyle Stachowicz-2/+14
2018-05-18track the root `UseTree` in addition to the leafNiko Matsakis-5/+53
2018-05-17Turn some functions from `token.rs` into methods on `Ident`Vadim Petrochenkov-6/+4
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-9/+11
2018-05-17Auto merge of #50665 - alexcrichton:fix-single-item-path-warnings, r=oli-obkbors-27/+105
rustc: Fix `crate` lint for single-item paths This commit fixes recommending the `crate` prefix when migrating to 2018 for paths that look like `use foo;` or `use {bar, baz}` Closes #50660
2018-05-16Make the compiler support the label-break-value featureest31-0/+2
No error checking or feature gating yet
2018-05-15rustc: Fix `crate` lint for single-item pathsAlex Crichton-27/+105
This commit fixes recommending the `crate` prefix when migrating to 2018 for paths that look like `use foo;` or `use {bar, baz}` Closes #50660