summary refs log tree commit diff
path: root/src/librustc_save_analysis/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-3/+2
2020-05-18Fix ICE in -Zsave-analysisNathan Corbyn-1/+5
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-2/+3
2020-04-24Split out the `Generator` case from `DefKind::Closure`.Eduard-Mihai Burtescu-1/+2
2020-04-24add a few more DefKindsmark-2/+15
make Map::def_kind take LocalDefId Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> crates are DefKind::Mod
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-23/+30
2020-04-10librustc_middle: return LocalDefId instead of DefId in local_def_id_from_node_idmarmeladema-10/+23
2020-04-10librustc_middle: return LocalDefId instead of DefId in ↵marmeladema-1/+1
opt_local_def_id_from_node_id
2020-03-31more clippy fixesMatthias Krüger-1/+1
use is_empty() instead of len comparison (clippy::len_zero) use if let instead of while let loop that never loops (clippy::never_loop) remove redundant returns (clippy::needless_return) remove redundant closures (clippy::redundant_closure) use if let instead of match and wildcard pattern (clippy::single_match) don't repeat field names redundantly (clippy::redundant_field_names)
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-4/+4
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-4/+4
2020-03-27clarify hir_id <-> node_id method namesBastian Kauschke-8/+8
2020-03-24rustc: remove rustc_hir_pretty dependency.Mazdak Farrokhzad-3/+4
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-10/+7
2020-03-21Rollup merge of #69965 - mark-i-m:codegen-utils, r=eddybMazdak Farrokhzad-1/+1
Refactorings to get rid of rustc_codegen_utils r? @eddyb cc #45276 After this, the only modules left in `rustc_codegen_utils` are - `link`: a bunch of linking-related functions (many dealing with file names). These are mostly consumed by save analysis, rustc_driver, rustc_interface, and of course codegen. I assume they live here because we don't want a dependency of save analysis on codegen... Perhaps they can be moved to librustc? - ~`symbol_names` and `symbol_names_test`: honestly it seems odd that `symbol_names_test` is not a submodule of `symbol_names`. It seems like these could honestly live in their own crate or move to librustc. Already name mangling is exported as the `symbol_name` query.~ (move it to its own crate) I don't mind doing either of the above as part of this PR or a followup if you want.
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-2/+2
2020-03-19Refactorings to begin getting rid of rustc_codegen_utilsMark Mansi-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-03-15Rollup merge of #69988 - petrochenkov:nomacrodef, r=CentrilMazdak Farrokhzad-13/+0
rustc_metadata: Remove `rmeta::MacroDef` And other related cleanups. Follow-up to https://github.com/rust-lang/rust/pull/66364. r? @Centril
2020-03-15Rollup merge of #69589 - petrochenkov:maccall, r=CentrilMazdak Farrokhzad-1/+1
ast: `Mac`/`Macro` -> `MacCall` It's now obvious that these refer to macro calls rather than to macro definitions. It's also a single name instead of two different names in different places. `rustc_expand` usually calls macro calls in a wide sense (including attributes and derives) "macro invocations", but structures and variants renamed in this PR are only relevant to fn-like macros, so it's simpler and clearer to just call them calls. cc https://github.com/rust-lang/rust/pull/63586#discussion_r314232513 r? @eddyb
2020-03-14rustc_metadata: Remove `rmeta::MacroDef`Vadim Petrochenkov-13/+0
Use `ast::MacroDef` instead. Also remove `Session::imported_macro_spans`, external macros have spans now.
2020-03-12ast: `Mac`/`Macro` -> `MacCall`Vadim Petrochenkov-1/+1
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-1/+1
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-08Rollup merge of #69422 - JohnTitor:remove-unwrap, r=XanewokMazdak Farrokhzad-2/+5
Remove use of `unwrap()` from save-analysis Fix #69409, fix #69416
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2020-03-06Auto merge of #69586 - petrochenkov:unmerge, r=Centrilbors-2/+1
ast: Unmerge structures for associated items and foreign items Follow-up to https://github.com/rust-lang/rust/pull/69194. r? @Centril
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-1/+1
2020-03-01ast: Unmerge structures for associated items and foreign itemsVadim Petrochenkov-2/+1
2020-03-01Rollup merge of #69605 - JohnTitor:opt-def-id, r=petrochenkovYuki Okushi-1/+1
Use `opt_def_id()` over `def_id()` Fixes #69588
2020-03-01Use `opt_def_id()` over `def_id()`Yuki Okushi-1/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-3/+3
2020-02-25Address review commentYuki Okushi-11/+11
2020-02-24Remove use of `unwrap()` from save-analysisYuki Okushi-8/+11
2020-02-24parse/ast: move `Defaultness` into variants.Mazdak Farrokhzad-4/+5
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-5/+5
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-9/+10
2020-02-18Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkovMazdak Farrokhzad-2/+2
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-2/+2
2020-02-15parse extern constsMazdak Farrokhzad-1/+1
2020-02-15ast/parser: fuse `static` & `const` grammars in all contexts.Mazdak Farrokhzad-1/+1
2020-02-15ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`.Mazdak Farrokhzad-1/+1
2020-02-08Make `associated_items` query return a sliceJonas Schievink-0/+2
2020-02-05parser: merge `fn` grammars wrt. bodies & headersMazdak Farrokhzad-2/+2
also refactor `FnKind` and `visit_assoc_item` visitors
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-8/+6
2020-01-26Don't use ExpnKind::descr to get the name of a bang macro.Eduard-Mihai Burtescu-7/+14
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-2/+2
2020-01-17Use named fields for `ast::ItemKind::Impl`Dylan MacKenzie-6/+6
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-4/+4
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1