summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/encoder.rs
AgeCommit message (Collapse)AuthorLines
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/+1
2022-05-06use def_span and def_kind queries instead of calling tcx.hir() methodsMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-03Add support for a new attribute `#[debugger_visualizer]` to support ↵ridwanabdillahi-20/+33
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-25Auto merge of #95604 - nbdd0121:used2, r=petrochenkovbors-3/+3
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-19rustc_metadata: Store a flag telling whether an item may have doc links in ↵Vadim Petrochenkov-3/+11
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-1/+1
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 #94493 - ↵Dylan DPC-3/+4
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-3/+3
This is currently a wrapper to `SymbolExportLevel` but it allows later addition of extra information.
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-1/+1
`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-38/+20
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-16Provide a better diagnostic on failure to meet send bound on futures in a ↵oribenshir-3/+4
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-13rustc_metadata: Do not encode unnecessary module childrenVadim Petrochenkov-14/+20
2022-04-10Directly encode DefId in metadata.Camille GILLOT-4/+3
2022-04-10Directly encode DefPathHash in metadata.Camille GILLOT-3/+2
2022-04-10Directly encode DefKind in metadata.Camille GILLOT-3/+3
2022-04-10Directly encode IsAsync in metadata.Camille GILLOT-4/+4
2022-04-10Directly encode Defaultness in metadata.Camille GILLOT-1/+1
2022-04-10Directly encode Constness in metadata.Camille GILLOT-9/+9
2022-04-10Directly encode ImplPolarity in metadata.Camille GILLOT-1/+1
2022-04-09use ItemId.def_id and avoid fetching ItemMiguel Guarniz-16/+12
2022-04-08remove ItemLikeVisitor impls and add fast paths using DefKindMiguel Guarniz-39/+21
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-04-08remove some uses of visit_all_item_likes in incremental, metadata and ↵Miguel Guarniz-1/+5
interface crates Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-03-31Merge impl_constness and is_const_fn_raw.Camille GILLOT-0/+4
2022-03-31Create trait_def table.Camille GILLOT-11/+8
2022-03-31Store fn constness in impl_constness.Camille GILLOT-37/+26
2022-03-31Introduce repr_options table.Camille GILLOT-22/+23
2022-03-31Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errorsDylan DPC-1/+1
Spellchecking compiler comments This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30Auto merge of #95436 - cjgillot:static-mut, r=oli-obkbors-12/+8
Remember mutability in `DefKind::Static`. This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-30Spellchecking compiler commentsYuri Astrakhan-1/+1
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30rework implementation for inherent impls for builtin typeslcnr-3/+35
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-12/+8
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-15/+15
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-03-03Rollup merge of #94057 - lcnr:simplify_type-uwu, r=nikomatsakisMatthias Krüger-2/+2
improve comments for `simplify_type` Should now correctly describe what's going on. Experimented with checking the invariant for projections but that ended up requiring fairly involved changes. I assume that it is not possible to get unsoundness here, at least for now and I can pretty much guarantee that it's impossible to trigger it by accident. r? `````@nikomatsakis````` cc #92721
2022-02-25Rollup merge of #94252 - lcnr:def_kind-encoding, r=cjgillotMatthias Krüger-7/+2
don't special case `DefKind::Ctor` in encoding considering that we still use `DefKind::Ctor` for these in `Res`, this seems weird and definitely felt like a bug when encountering it while working on #89862. r? `@cjgillot`
2022-02-24metadata: Tweak the way in which declarative macros are encodedVadim Petrochenkov-1/+1
To make the `macro_rules` flag more readily available without decoding everything else
2022-02-24resolve: Fix incorrect results of `opt_def_kind` query for some built-in macrosVadim Petrochenkov-1/+1
Previously it always returned `MacroKind::Bang` while some of those macros are actually attributes and derives
2022-02-24don't special case `DefKind::Ctor` in encodinglcnr-7/+2
2022-02-21update docs for `simplify_type`lcnr-2/+2
2022-02-19Add generator_kind table.Camille GILLOT-1/+2
2022-02-19Add fn_arg_names table.Camille GILLOT-18/+12
2022-02-19Add asyncness table.Camille GILLOT-8/+5
2022-02-19Add rendered_const table.Camille GILLOT-16/+13
2022-02-19Add mir_const_qualifs table.Camille GILLOT-4/+6
2022-02-19Drop ImplData.Camille GILLOT-27/+19
2022-02-19Encode metadata using queries.Camille GILLOT-22/+22