about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2020-02-28late resolve, visit_fn: bail early if there's no body.Mazdak Farrokhzad-2/+3
2020-02-27Remove unneeded calls to format!()Björn Steinbrink-2/+2
2020-02-27use char instead of &str for single char patternsMatthias Krüger-2/+2
2020-02-27Rollup merge of #69439 - petrochenkov:latelife, r=matthewjasperYuki Okushi-246/+246
resolve: `lifetimes.rs` -> `late/lifetimes.rs` Lifetime resolution should ideally be merged into the late resolution pass, at least for named lifetimes. Let's move it closer to it for a start.
2020-02-24resolve: `lifetimes.rs` -> `late/lifetime.rs`Vadim Petrochenkov-246/+246
2020-02-24don't explicitly compare against true or falseMatthias Krüger-1/+1
2020-02-24rustc_metadata: Load metadata for indirect macro-only dependenciesVadim Petrochenkov-5/+0
2020-02-24parse/ast: move `Defaultness` into variants.Mazdak Farrokhzad-14/+16
2020-02-23Rollup merge of #69375 - Menschenkindlein:master, r=Dylan-DPCDylan DPC-18/+18
Rename CodeMap to SourceMap follow up See https://github.com/rust-lang/rust/issues/51574
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-18/+18
2020-02-22parse: allow `type Foo: Ord` syntactically.Mazdak Farrokhzad-3/+3
2020-02-18Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkovMazdak Farrokhzad-103/+110
parse: fuse associated and extern items up to defaultness Language changes: - The grammar of extern `type` aliases is unified with associated ones, and becomes: ```rust TypeItem = "type" ident generics {":" bounds}? where_clause {"=" type}? ";" ; ``` Semantic restrictions (`ast_validation`) are added to forbid any parameters in `generics`, any bounds in `bounds`, and any predicates in `where_clause`, as well as the presence of a type expression (`= u8`). (Work still remains to fuse this with free `type` aliases, but this can be done later.) - The grammar of constants and static items (free, associated, and extern) now permits the absence of an expression, and becomes: ```rust GlobalItem = {"const" {ident | "_"} | "static" "mut"? ident} {"=" expr}? ";" ; ``` - A semantic restriction is added to enforce the presence of the expression (the body). - A semantic restriction is added to reject `const _` in associated contexts. Together, these changes allow us to fuse the grammar of associated items and extern items up to `default`ness which is the main goal of the PR. ----------------------- We are now very close to fully fusing the entirely of item parsing and their ASTs. To progress further, we must make a decision: should we parse e.g. `default use foo::bar;` and whatnot? Accepting that is likely easiest from a parsing perspective, as it does not require using look-ahead, but it is perhaps not too onerous to only accept it for `fn`s (and all their various qualifiers), `const`s, `static`s, and `type`s. r? @petrochenkov
2020-02-17Rename `FunctionRetTy` to `FnRetTy`Yuki Okushi-3/+3
2020-02-16Make librustc_infer compile.Camille GILLOT-0/+1
2020-02-15parse extern constsMazdak Farrokhzad-2/+2
2020-02-15parse associated statics.Mazdak Farrokhzad-4/+8
2020-02-15ast: make `= <expr>;` optional in free statics/consts.Mazdak Farrokhzad-3/+3
2020-02-15ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`.Mazdak Farrokhzad-3/+4
2020-02-15ast: move Generics into AssocItemKindsMazdak Farrokhzad-93/+95
2020-02-13Rollup merge of #69108 - cjgillot:trait_candidate, r=ZoxcDylan DPC-3/+3
Use HirId in TraitCandidate. I had to duplicate the `TraitMap` type to hold `NodeId`s until AST->HIR lowering is done. r? @Zoxc
2020-02-13Rollup merge of #68938 - Areredify:gat_lifetime_shadowing, r=estebankDylan DPC-2/+4
fix lifetime shadowing check in GATs closes #67512
2020-02-13Make TraitCandidate generic.Camille GILLOT-6/+6
2020-02-13Use HirId in TraitCandidate.Camille GILLOT-3/+3
2020-02-13IsAsync -> enum Async { Yes { span: Span, .. }, No }Mazdak Farrokhzad-7/+7
use new span for better diagnostics.
2020-02-11Auto merge of #69062 - Dylan-DPC:rollup-7wpjpqu, r=Dylan-DPCbors-1/+0
Rollup of 8 pull requests Successful merges: - #66498 (Remove unused feature gates) - #68816 (Tweak borrow error on `FnMut` when `Fn` is expected) - #68824 (Enable Control Flow Guard in rustbuild) - #69022 (traits: preallocate 2 Vecs of known initial size) - #69031 (Use `dyn Trait` more in tests) - #69044 (Don't run coherence twice for future-compat lints) - #69047 (Don't rustfmt check the vendor directory.) - #69055 (Clean up E0307 explanation) Failed merges: r? @ghost
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-1/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11Run RustFmtjumbatm-5/+14
2020-02-11Invert control in struct_lint_level.jumbatm-28/+31
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-08fix lifetime shadowing check in GATsMikhail Babenko-2/+4
2020-02-07Rollup merge of #68889 - Zoxc:hir-krate, r=eddybDylan DPC-1/+1
Move the `hir().krate()` method to a query and remove the `Krate` dep node r? @eddyb cc @michaelwoerister
2020-02-07Remove unused feature gate from librustc_resolvebjorn3-1/+0
2020-02-06Rollup merge of #68788 - Centril:unified-fn-bodies, r=petrochenkovDylan DPC-56/+58
Towards unified `fn` grammar Part of https://github.com/rust-lang/rust/pull/68728. - Syntactically, `fn` items in `extern { ... }` blocks can now have bodies (`fn foo() { ... }` as opposed to `fn foo();`). As above, we use semantic restrictions instead. - Syntactically, `fn` items in free contexts (directly in a file or a module) can now be without bodies (`fn foo();` as opposed to `fn foo() { ... }`. As above, we use semantic restrictions instead, including for non-ident parameter patterns. - We move towards unifying the `fn` front matter; this is fully realized in https://github.com/rust-lang/rust/pull/68728. r? @petrochenkov
2020-02-06Move the `krate` method to Hir and remove the Krate dep nodeJohn Kåre Alsaker-1/+1
2020-02-05Account for `impl Trait`Esteban Küber-34/+55
Address #49287
2020-02-05Move code to `diagnostics.rs`Esteban Küber-200/+214
2020-02-05review commentsEsteban Küber-37/+26
2020-02-05review comments: wordingEsteban Küber-2/+2
2020-02-05Account for `fn()` types in lifetime suggestionsEsteban Küber-28/+60
2020-02-05Account for `'_` in suggestionsEsteban Küber-0/+3
2020-02-05review commentsEsteban Küber-12/+12
2020-02-05Suggest `'r` instead of `'lifetime`Esteban Küber-8/+8
2020-02-05When suggesting lifetimes, propose adding the new lifetime to all argumentsEsteban Küber-4/+17
2020-02-05Use spans for input borrowed types unrelated to return typeEsteban Küber-8/+19
2020-02-05Account for HKTB when suggesting introduction of named lifetimeEsteban Küber-35/+120
2020-02-05parser: merge `fn` grammars wrt. bodies & headersMazdak Farrokhzad-56/+58
also refactor `FnKind` and `visit_assoc_item` visitors
2020-02-04Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbinibors-1/+0
Step stage0 to bootstrap from 1.42 This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
2020-02-02Rollup merge of #68740 - JohnTitor:do-not-sugg-underscore, r=CentrilYuki Okushi-0/+5
Do not suggest things named underscore Fixes #68719 r? @estebank
2020-02-02Do not suggest things named underscoreYuki Okushi-0/+5
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-3/+4
2020-02-011. move node_id to syntaxMazdak Farrokhzad-2/+2
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir