about summary refs log tree commit diff
path: root/src/librustc_save_analysis
AgeCommit message (Collapse)AuthorLines
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-26Hygiene serialization implementationAaron Hill-1/+1
2020-07-17Auto merge of #72983 - Lezzz:rename-typeck, r=nikomatsakisbors-32/+34
Rename TypeckTables to TypeckResults. Originally suggested by @eddyb.
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-32/+34
2020-07-16apply bootstrap cfgsMark Rousskov-1/+0
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-1/+1
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-03Use 'tcx for references to AccessLevels wherever possible.Eduard-Mihai Burtescu-73/+34
2020-07-02rustc_save_analysis: avoid using TypeckTables::empty for SaveContext.Eduard-Mihai Burtescu-23/+31
2020-06-19save_analysis: improve handling of enum struct variantmarmeladema-19/+6
Fixes #61385
2020-06-15make all uses of ty::Error or ConstKind::Error delay a span bugmark-1/+1
2020-06-15Auto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakisbors-4/+2
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-12Rollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnayDylan DPC-1/+1
Migrate to numeric associated consts The deprecation PR is #72885 cc #68490 cc rust-lang/rfcs#2700
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-2/+2
2020-06-11Remove associated opaque typesMatthew Jasper-2/+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-10Migrate to numeric associated constsLzu Tao-1/+1
2020-06-09save_analysis: fix enum reference to point to variant rather than constructormarmeladema-11/+7
Fixes #61302
2020-06-09save_analysis: improve pretty printing of enummarmeladema-5/+4
2020-06-09save_analysis: better handle functions signaturemarmeladema-35/+36
2020-06-09save_analysis: better handle pathsmarmeladema-27/+74
2020-06-06save_analysis: fix panic in `write_sub_paths_truncated`marmeladema-3/+5
2020-06-06save_analysis: fix ice in `get_expr_data`marmeladema-3/+7
2020-06-04save_analysis: work on HIR tree instead of ASTmarmeladema-986/+874
2020-05-29Split payload of FileName::Real to track both real and virutalized paths.Felix S. Klock II-2/+3
Such splits arise from metadata refs into libstd. This way, we can (in a follow on commit) continue to emit the virtual name into things like the like the StableSourceFileId that ends up in incremetnal build artifacts, while still using the devirtualized file path when we want to access the file. Note that this commit is intended to be a refactoring; the actual fix to the bug in question is in a follow-on commit.
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-3/+2
2020-05-18Fix ICE in -Zsave-analysisNathan Corbyn-1/+5
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-11/+14
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-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-33/+41
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-22/+43
2020-04-10librustc_middle: return LocalDefId instead of DefId in ↵marmeladema-3/+3
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-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-6/+6
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-6/+6
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
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-25/+25
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-2/+2
2020-03-24rustc: remove rustc_hir_pretty dependency.Mazdak Farrokhzad-5/+7
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-11/+8
2020-03-21Rollup merge of #69965 - mark-i-m:codegen-utils, r=eddybMazdak Farrokhzad-3/+2
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