about summary refs log tree commit diff
path: root/compiler/rustc_save_analysis/src
AgeCommit message (Collapse)AuthorLines
2023-02-16Remove save-analysis.Nicholas Nethercote-3660/+0
Most tests involving save-analysis were removed, but I kept a few where the `-Zsave-analysis` was an add-on to the main thing being tested, rather than the main thing being tested. For `x.py install`, the `rust-analysis` target has been removed. For `x.py dist`, the `rust-analysis` target has been kept in a degenerate form: it just produces a single file `reduced.json` indicating that save-analysis has been removed. This is necessary for rustup to keep working. Closes #43606.
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-1/+1
2023-01-31Review changesMaybe Waffle-3/+2
2023-01-30Use `Mutability::{is_mut, is_not}`Maybe Waffle-2/+1
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-112/+111
2023-01-16Avoid an unnecessary allocationOli Scherer-7/+1
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-7/+9
2023-01-04rename get_parent_node to parent_idMichael Goulet-1/+1
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-1/+1
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-3/+3
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-7/+7
2022-12-01rustc_hir: Change representation of import paths to support multiple resolutionsVadim Petrochenkov-3/+5
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-2/+2
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-1/+1
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-2/+2
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-2/+2
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-24Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiserbors-1/+1
Use `as_deref` in compiler (but only where it makes sense) This simplifies some code :3 (there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
2022-11-23Add `Mutability::{is_mut,is_not}`Maybe Waffle-2/+2
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-1/+1
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-1/+1
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-9/+9
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-47/+47
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-8/+8
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-23Migrate all diagnosticsNilstrieb-1/+1
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-1/+1
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-4/+6
`Res::SelfTy` currently has two `Option`s. When the second one is `Some` the first one is never consulted. So we can split it into two variants, `Res::SelfTyParam` and `Res::SelfTyAlias`, reducing the size of `Res` from 24 bytes to 12. This then shrinks `hir::Path` and `hir::PathSegment`, which are the HIR types that take up the most space.
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-25/+25
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-2/+2
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-2/+2
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-12Remove `path_span` argument to the `visit_path_segment` methods.Nicholas Nethercote-1/+1
The `visit_path_segment` method of both the AST and HIR visitors has a `path_span` argument that isn't necessary. This commit removes it. There are two very small and inconsequential functional changes. - One call to `NodeCollector::insert` now is passed a path segment identifier span instead of a full path span. This span is only used in a panic message printed in the case of an internal compiler bug. - Likewise, one call to `LifetimeCollectVisitor::record_elided_anchor` now uses a path segment identifier span instead of a full path span. This span is used to make some `'_` lifetimes.
2022-09-09Handle generic parameters.Camille GILLOT-8/+9
2022-09-09RPITIT placeholder itemsMichael Goulet-0/+6
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-13/+2
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-05Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, ↵bors-1/+5
r=cjgillot Separate the receiver from arguments in HIR Related to #100232 cc `@cjgillot`
2022-09-05Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkovbors-6/+10
Simplify `hir::PathSegment` r? `@petrochenkov`
2022-09-05separate the receiver from arguments in HIRTakayuki Maeda-1/+5
2022-09-05Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwcoDylan DPC-1/+1
Improve HIR stats #100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2022-09-05Address review comments.Nicholas Nethercote-1/+1
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-2/+5
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-5/+6
2022-09-02Refactor and re-use BindingAnnotationCameron Steffen-13/+2
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-4/+3
by module
2022-08-29Use `&'hir Expr` everywhere.Nicholas Nethercote-1/+1
For consistency, and because it makes HIR measurement simpler and more accurate.
2022-08-24save_analysis: Migrate diagnosticsWonchul Lee-1/+15
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-2/+2
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-1/+1
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-1/+1
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``