about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
AgeCommit message (Collapse)AuthorLines
2022-05-23Fix iterator implementation, add some inlinesMichael Goulet-3/+20
2022-05-23refine comments, disambiguate len for array and tablesMichael Goulet-36/+41
2022-05-23split out the various responsibilities of LazyMichael Goulet-420/+370
2022-05-23rustc: Fix ICE in native library error reportingVadim Petrochenkov-4/+5
2022-05-21Auto merge of #97239 - jhpratt:remove-crate-vis, r=joshtriplettbors-66/+65
Remove `crate` visibility modifier FCP to remove this syntax is just about complete in #53120. Once it completes, this should be merged ASAP to avoid merge conflicts. The first two commits remove usage of the feature in this repository, while the last removes the feature itself.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-66/+65
2022-05-20Auto merge of #95418 - cjgillot:more-disk, r=davidtwcobors-13/+0
Cache more queries on disk One of the principles of incremental compilation is to allow saving results on disk to avoid recomputing them. This PR investigates persisting a lot of queries whose result are to be saved into metadata. Some of the queries are cheap reads from HIR, but we may also want to get rid of these reads for incremental lowering.
2022-05-19Auto merge of #97024 - lcnr:simplify_type-sus, r=<try>bors-1/+1
`simplify_type` improvements and cursed docs the existing `TreatParams` enum pretty much mixes everything up. Not sure why this looked right to me in #94057 This also includes two changes which impact perf: - `ty::Projection` with inference vars shouldn't be treated as a rigid type, even if fully normalized - `ty::Placeholder` only unifies with itself, so actually return `Some` for them r? `@nikomatsakis`
2022-05-18Properly apply path prefix remapping paths emitted into debuginfo.Michael Woerister-0/+7
2022-05-18Move logic for making potentially remapped paths absolute into helper method.Michael Woerister-64/+29
2022-05-18fix `simplify_type`lcnr-1/+1
2022-05-17Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwcobors-0/+15
Add a query for checking whether a function is an intrinsic. work towards #93145 This will reduce churn when we add more ways to declare intrinsics r? `@scottmcm`
2022-05-17Auto merge of #96825 - kckeiks:remove-item-like-visitor-trait, r=cjgillotbors-18/+7
Retire `ItemLikeVisitor` trait Issue #95004 cc `@cjgillot`
2022-05-16Add a query for checking whether a function is an intrinsic.Oli Scherer-0/+15
2022-05-15rustc: Stricter checking for #[link] attributesVadim Petrochenkov-240/+276
2022-05-13rename visit item-like methodsMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove TraitVisitorMiguel Guarniz-17/+6
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13Cache more queries on disk.Camille GILLOT-13/+0
2022-05-10only_local: always check for misuselcnr-7/+9
2022-05-10don't encode only locally used attrslcnr-3/+7
2022-05-09reviewlcnr-1/+1
2022-05-09only compute `codegen_fn_attrs` where neededlcnr-1/+3
2022-05-09store `codegen_fn_attrs` in crate metadatalcnr-0/+4
2022-05-06use def_span and def_kind queries instead of calling tcx.hir() methodsMiguel Guarniz-3/+3
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-03Add support for a new attribute `#[debugger_visualizer]` to support ↵ridwanabdillahi-20/+39
embedding debugger visualizers into a generated PDB. Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries. Merge the queries for debugger visualizers into a single query. Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`. Respond to PR comments. Load visualizer files into opaque bytes `Vec<u8>`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate. Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature. Respond to PR comments and minor cleanups.
2022-04-30Box HIR Generics and Impl.Camille GILLOT-2/+2
2022-04-27Add --json unused-externs-silent with original behaviourJeremy Fitzhardinge-3/+9
Since Cargo wants to do its own fatal error handling for unused dependencies, add the option `--json unused-externs-silent` which has the original behaviour of not indicating non-zero exit status for `deny`/`forbid`-level unused dependencies.
2022-04-27Plumb through rustc_lint_defs::Level as enum rather than string.Jeremy Fitzhardinge-4/+1
2022-04-25Auto merge of #95604 - nbdd0121:used2, r=petrochenkovbors-9/+9
Generate synthetic object file to ensure all exported and used symbols participate in the linking Fix #50007 and #47384 This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed. Related #93791, #95363 r? `@petrochenkov` cc `@carbotaniuman`
2022-04-23Add support for `nounused` --extern flagJeremy Fitzhardinge-0/+4
This adds `nounused` to the set of extern flags: `--extern nounused:core=/path/to/core/libcore.rlib`. The effect of this flag is to suppress `unused-crate-dependencies` warnings relating to the crate.
2022-04-21[WIP] rustdoc: Resolve some more doc links earlyVadim Petrochenkov-0/+8
2022-04-19rustc_metadata: Store a flag telling whether an item may have doc links in ↵Vadim Petrochenkov-3/+34
its attributes This should be cheap on rustc side, but it's significant optimization for rustdoc that won't need to decode and process attributes unnecessarily
2022-04-19Rollup merge of #96142 - cjgillot:no-crate-def-index, r=petrochenkovDylan DPC-3/+3
Stop using CRATE_DEF_INDEX outside of metadata encoding. `CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want. We should not manipulate raw `DefIndex` outside of metadata encoding.
2022-04-19Rollup merge of #96086 - jsgf:remove-extern-location, r=davidtwcoDylan DPC-18/+2
Remove `--extern-location` and all associated code `--extern-location` was an experiment to investigate the best way to generate useful diagnostics for unused dependency warnings by enabling a build system to identify the corresponding build config. While I did successfully use this, I've since been convinced the alternative `--json unused-externs` mechanism is the way to go, and there's no point in having two mechanisms with basically the same functionality. This effectively reverts https://github.com/rust-lang/rust/pull/72603
2022-04-19Rollup merge of #94493 - ↵Dylan DPC-3/+26
oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco Improved diagnostic on failure to meet send bound on future in a foreign crate Provide a better diagnostic on failure to meet send bound on futures in a foreign crate. fixes #78543
2022-04-18Add `SymbolExportInfo`Gary Guo-9/+9
This is currently a wrapper to `SymbolExportLevel` but it allows later addition of extra information.
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-3/+3
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-17Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillotbors-70/+43
Refactor HIR item-like traversal (part 1) Issue #95004 - Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems - use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId - use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel; Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com> cc `@cjgillot`
2022-04-16Auto merge of #95899 - petrochenkov:modchild2, r=cjgillotbors-71/+71
rustc_metadata: Do not encode unnecessary module children This should remove the syntax context shift and the special case for `ExternCrate` in decoder in https://github.com/rust-lang/rust/pull/95880. This PR also shifts some work from decoding to encoding, which is typically useful for performance (but probably not much in this case). r? `@cjgillot`
2022-04-16Provide a better diagnostic on failure to meet send bound on futures in a ↵oribenshir-3/+26
foreign crate Adding diagnostic data on generators to the crate metadata and using it to provide a better diagnostic on failure to meet send bound on futures originated from a foreign crate
2022-04-15Remove `--extern-location` and all associated codeJeremy Fitzhardinge-18/+2
`--extern-location` was an experiment to investigate the best way to generate useful diagnostics for unused dependency warnings by enabling a build system to identify the corresponding build config. While I did successfully use this, I've since been convinced the alternative `--json unused-externs` mechanism is the way to go, and there's no point in having two mechanisms with basically the same functionality. This effectively reverts https://github.com/rust-lang/rust/pull/72603
2022-04-14library: Move `CStr` to libcore, and `CString` to liballocVadim Petrochenkov-9/+16
2022-04-13rustc_metadata: Do not encode unnecessary module childrenVadim Petrochenkov-71/+71
2022-04-10Simplify FixedSizeEncoding using const generics.Camille GILLOT-107/+86
2022-04-10Directly encode DefId in metadata.Camille GILLOT-10/+77
2022-04-10Directly encode DefPathHash in metadata.Camille GILLOT-7/+25
2022-04-10Directly encode DefKind in metadata.Camille GILLOT-14/+64
2022-04-10Directly encode IsAsync in metadata.Camille GILLOT-5/+12
2022-04-10Directly encode Defaultness in metadata.Camille GILLOT-2/+10