about summary refs log tree commit diff
path: root/src/librustc_save_analysis/dump_visitor.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1517/+0
2020-08-29Move retokenize hack to save_analysisAleksey Kladov-4/+2
2020-08-17Auto merge of #75120 - JulianKnodt:rm_reps, r=oli-obkbors-1/+1
rust_ast::ast => rustc_ast Rework of #71199 which is a rework #70621 Still working on this but just made the PR to track progress r? @Dylan-DPC
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-16save_analysis: support `QPath::LangItem`David Wood-18/+12
This commit implements support for `QPath::LangItem` and `GenericBound::LangItemTrait` in save analysis. Signed-off-by: David Wood <david@davidtw.co>
2020-08-16hir: introduce `QPath::LangItem`David Wood-0/+4
This commit introduces `QPath::LangItem` to the HIR and uses it in AST lowering instead of constructing a `hir::Path` from a slice of symbols. This might be better for performance, but is also much cleaner as the previous approach is fragile. In addition, it resolves a bug (#61019) where an extern crate imported as "std" would result in the paths created during AST lowering being resolved incorrectly (or not at all). Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-20/+22
2020-07-03Use 'tcx for references to AccessLevels wherever possible.Eduard-Mihai Burtescu-6/+6
2020-07-02rustc_save_analysis: avoid using TypeckTables::empty for SaveContext.Eduard-Mihai Burtescu-9/+9
2020-06-15Auto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakisbors-2/+1
Clean up type alias impl trait implementation - Removes special case for top-level impl trait - Removes associated opaque types - Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types. - Handle lifetimes in type alias impl trait more uniformly with other parameters cc #69323 cc #63063 Closes #57188 Closes #62988 Closes #69136 Closes #73061
2020-06-11Rollup merge of #73182 - Aaron1011:feature/call-fn-span, r=matthewjasperDylan DPC-1/+3
Track span of function in method calls, and use this in #[track_caller] Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
2020-06-11Rename `TyKind::Def` to `OpaqueDef`Matthew Jasper-1/+1
2020-06-11Remove associated opaque typesMatthew Jasper-1/+0
They're unused now.
2020-06-10Track span of function in method calls, and use this in #[track_caller]Aaron Hill-1/+3
Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
2020-06-09save_analysis: better handle functions signaturemarmeladema-2/+3
2020-06-09save_analysis: better handle pathsmarmeladema-23/+51
2020-06-06save_analysis: fix panic in `write_sub_paths_truncated`marmeladema-3/+5
2020-06-04save_analysis: work on HIR tree instead of ASTmarmeladema-505/+411
2020-05-15Rollup merge of #71809 - marmeladema:fix-issue-71104, r=eddybDylan DPC-29/+41
Use `LocalDefId` in `DumpVisitor::nest_tables` This is a partial fix for #71104
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-2/+3
2020-05-03Use `LocalDefId` in `DumpVisitor::nest_tables`marmeladema-29/+41
This is a partial fix for #71104
2020-04-27Accept `LocalDefId` as keyt for `names_imported_by_glob_use`marmeladema-1/+1
and `maybe_unused_trait_import` queries
2020-04-27Use `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queriesmarmeladema-1/+1
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-7/+10
2020-04-14Do not use `DUMMY_HIR_ID` as placeholder value in node_id_to_hir_id tablemarmeladema-5/+8
Some helpers functions have been introduced to deal with (buggy) cases where either a `NodeId` or a `DefId` do not have a corresponding `HirId`. Those cases are tracked in issue #71104.
2020-04-10librustc_middle: return LocalDefId instead of DefId in local_def_id_from_node_idmarmeladema-12/+20
2020-04-10librustc_middle: return LocalDefId instead of DefId in ↵marmeladema-2/+2
opt_local_def_id_from_node_id
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-4/+3
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-2/+2
2020-03-28Auto merge of #70261 - Centril:angle-args-partition, r=varkorbors-2/+2
Move arg/constraint partition check to validation & improve recovery - In the first commit, we move the check rejecting e.g., `<'a, Item = u8, String>` from the parser into AST validation. - We then use this to improve the code for parsing generic arguments. - And we add recovery for e.g., `<Item = >` (missing), `<Item = 42>` (constant), and `<Item = 'a>` (lifetime). This is also preparatory work for supporting https://github.com/rust-lang/rust/issues/70256. r? @varkor
2020-03-27clarify hir_id <-> node_id method namesBastian Kauschke-17/+17
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-2/+2
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-03-12ast: `Mac`/`Macro` -> `MacCall`Vadim Petrochenkov-4/+4
2020-03-01ast: Unmerge structures for associated items and foreign itemsVadim Petrochenkov-6/+3
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-6/+6
2020-02-24parse/ast: move `Defaultness` into variants.Mazdak Farrokhzad-12/+13
2020-02-23Rollup merge of #69375 - Menschenkindlein:master, r=Dylan-DPCDylan DPC-2/+2
Rename CodeMap to SourceMap follow up See https://github.com/rust-lang/rust/issues/51574
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-2/+2
2020-02-22parse: allow `type Foo: Ord` syntactically.Mazdak Farrokhzad-3/+6
2020-02-18Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkovMazdak Farrokhzad-15/+17
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-5/+5
2020-02-15parse extern constsMazdak Farrokhzad-1/+1
2020-02-15parse associated statics.Mazdak Farrokhzad-2/+4
2020-02-15ast/parser: fuse `static` & `const` grammars in all contexts.Mazdak Farrokhzad-1/+1
2020-02-15ast: make `= <expr>;` optional in free statics/consts.Mazdak Farrokhzad-4/+4
2020-02-15ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`.Mazdak Farrokhzad-1/+1