about summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustc_metadataflip1995-5/+5
2019-04-21AST/HIR: Use `Mutability` instead of bool in foreign staticsVadim Petrochenkov-2/+2
2019-03-30Rollup merge of #59376 - davidtwco:finally-rfc-2008-variants, ↵Mazdak Farrokhzad-2/+7
r=petrochenkov,QuietMisdreavus RFC 2008: Enum Variants Part of #44109. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov cc @nikomatsakis
2019-03-28Implement `#[non_exhaustive]` on variants.David Wood-2/+7
This commit removes the check that disallows the `#[non_exhaustive]` attribute from being placed on enum variants and removes the associated tests. Further, this commit lowers the visibility of enum variant constructors when the variant is marked as non-exhaustive.
2019-03-28Rollup merge of #59413 - Zoxc:hirid, r=oli-obkMazdak Farrokhzad-1/+1
HirIdify hir::ItemId Version of https://github.com/rust-lang/rust/pull/59092. r? @oli-obk
2019-03-28Rollup merge of #58581 - varkor:const-generics-encoder-refactor, r=eddybMazdak Farrokhzad-41/+32
Refactor generic parameter encoder functions Addresses https://github.com/rust-lang/rust/pull/58503#discussion_r257488950. r? @eddyb
2019-03-25hir: replace NodeId with HirId in ItemIdljedrz-1/+1
2019-03-24Remove `VariantDef::parent_did`Vadim Petrochenkov-12/+9
2019-03-24Separate variant id and variant constructor id.David Wood-24/+78
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-14Add `EntryKind::TypeParam` and `EntryKind::ConstParam`varkor-20/+35
2019-03-13Rename encode_info_for_generic_param to encode_info_for_ty_in_generic_paramvarkor-3/+3
2019-03-13Refactor generic parameter encoder functionsvarkor-42/+18
2019-03-08Auto merge of #58915 - ljedrz:deprecate_nodeid_methods, r=Zoxcbors-8/+7
HirIdification: almost there The next iteration of HirIdification (#57578). Replaces a bunch of `NodeId` method calls (mostly `as_local_node_id`) with `HirId` ones. Removes `NodeId` from: - [x] `PathSegment` - [x] `PatKind` - [x] `Destination` (replaces it with `HirId`) In addition this PR also removes `Visitor::visit_def_mention`, which doesn't seem to be doing anything.
2019-03-07hir: remove some obsolete NodeId methodsljedrz-2/+2
2019-03-07hir: remove NodeId from PatKindljedrz-1/+1
2019-03-07HirIdification: replace NodeId method callsljedrz-7/+6
2019-03-05Encode proc macro stabilityJohn Kåre Alsaker-1/+5
2019-03-02hir: remove NodeId from VariantDataljedrz-2/+2
2019-03-02hir: remove NodeId from Itemljedrz-15/+13
2019-03-02hir: remove NodeId from ForeignItemljedrz-3/+6
2019-03-01hir: remove NodeId from AnonConstljedrz-2/+2
2019-02-24hir: remove NodeId from Exprljedrz-1/+1
2019-02-24hir: remove NodeId from MacroDefljedrz-2/+2
2019-02-24hir: remove NodeId from GenericParamljedrz-2/+2
2019-02-20hir: HirId-ify intravisitljedrz-1/+1
2019-02-15Take Const into account in HIRvarkor-0/+28
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-13Rollup merge of #58137 - ljedrz:cleanup_node_id_to_type, r=estebankMazdak Farrokhzad-1/+1
Cleanup: rename node_id_to_type(_opt) Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here. In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).
2019-02-11Auto merge of #58153 - ljedrz:HirIdify_typeck, r=Zoxcbors-1/+1
Partially Hiridify typeck Another step towards https://github.com/rust-lang/rust/pull/57578.
2019-02-09cleanup: rename node_id_to_type(_opt)ljedrz-1/+1
2019-02-08librustc_metadata => 2018Taiki Endo-5/+6
2019-02-05typeck: partially HirIdifyljedrz-1/+1
2019-02-02hir: add HirId to main Hir nodesljedrz-1/+1
2019-01-19Rollup merge of #57502 - nikomatsakis:fix-trait-alias-1b, r=nikomatsakisMazdak Farrokhzad-4/+13
make trait-aliases work across crates This is rebase of a small part of @alexreg's PR #55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects. The stylistic edits I also rebased and can open a separate PR. The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it. Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working. Fixes #56488. Fixes #57023.
2019-01-13Querify local plugin_registrar_fnIgor Matuszewski-4/+1
2019-01-13Querify local proc_macro_decls_staticIgor Matuszewski-2/+2
2019-01-10integrate trait aliases into def-paths / metadataNiko Matsakis-4/+13
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-08Auto merge of #56616 - estebank:issue-56539, r=davidtwcobors-2/+2
Encode `TraitAlias` as if they were `Trait` Fix #56539.
2018-12-07Encode `TraitAlias` as if they were `Trait`Esteban Küber-2/+2
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-42/+42
2018-11-30proc_macro: introduce a "bridge" between clients (proc macros) and servers ↵Eduard-Mihai Burtescu-2/+2
(compiler front-ends).
2018-11-12Use type safe `VariantIdx` instead of `usize` everywhereOliver Scherer-4/+5
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-10-26Auto merge of #54626 - alexcrichton:dwarf-generics, r=michaelwoeristerbors-24/+18
rustc: Tweak filenames encoded into metadata This commit is a fix for #54408 where on nightly right now whenever generics are inlined the path name listed for the inlined function's debuginfo is a relative path to the cwd, which surely doesn't exist! Previously on beta/stable the debuginfo mentioned an absolute path which still didn't exist, but more predictably didn't exist. The change between stable/nightly is that nightly is now compiled with `--remap-path-prefix` to give a deterministic prefix to all rustc-generated paths in debuginfo. By using `--remap-path-prefix` the previous logic would recognize that the cwd was remapped, causing the original relative path name of the standard library to get emitted. If `--remap-path-prefix` *wasn't* passed in then the logic would create an absolute path name and then create a new source file entry. The fix in this commit is to apply the "recreate the source file entry with an absolute path" logic a bit more aggresively. If the source file's name was remapped then we don't touch it, but otherwise we always take the working dir (which may have been remapped) and then join it to the file to ensure that we process all relative file names as well. The end result is that the standard library should have an absolute path for all file names in debuginfo (using our `--remap-path-prefix` argument) as it does on stable after this patch. Closes #54408
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-09-27rustc: Tweak filenames encoded into metadataAlex Crichton-24/+18
This commit is a fix for #54408 where on nightly right now whenever generics are inlined the path name listed for the inlined function's debuginfo is a relative path to the cwd, which surely doesn't exist! Previously on beta/stable the debuginfo mentioned an absolute path which still didn't exist, but more predictably didn't exist. The change between stable/nightly is that nightly is now compiled with `--remap-path-prefix` to give a deterministic prefix to all rustc-generated paths in debuginfo. By using `--remap-path-prefix` the previous logic would recognize that the cwd was remapped, causing the original relative path name of the standard library to get emitted. If `--remap-path-prefix` *wasn't* passed in then the logic would create an absolute path name and then create a new source file entry. The fix in this commit is to apply the "recreate the source file entry with an absolute path" logic a bit more aggresively. If the source file's name was remapped then we don't touch it, but otherwise we always take the working dir (which may have been remapped) and then join it to the file to ensure that we process all relative file names as well. The end result is that the standard library should have an absolute path for all file names in debuginfo (using our `--remap-path-prefix` argument) as it does on stable after this patch. Closes #54408
2018-09-19Add an is_marker flag to TraitDefScott McMurray-0/+1
2018-09-11renamed emit_nil to emit_unitkenta7777-1/+1
2018-09-11Revert "renamed emit_nil to emit_unit"kenta7777-1/+1
This reverts commit d02a5ffaed9c395ae62ee12d0f4e04946c62edb1.