about summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
2019-04-21Remove mutability from `Def::Static`Vadim Petrochenkov-2/+2
2019-04-21Introduce query `static_mutability`Vadim Petrochenkov-0/+10
2019-04-14Rollup merge of #59936 - petrochenkov:confict, r=davidtwcoMazdak Farrokhzad-1/+12
Fix cross-crate visibility of fictive variant constructors After merging https://github.com/rust-lang/rust/pull/59376 I realized that the code in the decoder wasn't entirely correct - we "decoded" fictive variant constructors with their variant's visibility, which could be public, rather than demoted to `pub(crate)`. Fictive constructors are not directly usable in expression/patterns, but the effect still can be observed with imports. r? @davidtwco
2019-04-14Address review commentsVadim Petrochenkov-8/+10
2019-04-14Fix cross-crate visibility of fictive variant constructorsVadim Petrochenkov-1/+10
2019-04-14HirIdify hir::Defljedrz-1/+1
2019-03-28Rollup merge of #58581 - varkor:const-generics-encoder-refactor, r=eddybMazdak Farrokhzad-0/+2
Refactor generic parameter encoder functions Addresses https://github.com/rust-lang/rust/pull/58503#discussion_r257488950. r? @eddyb
2019-03-24Re-order fields in `Def::Ctor`.David Wood-3/+2
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-3/+3
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24Revert changes to creation of fictive constructors for struct variantsVadim Petrochenkov-8/+10
2019-03-24Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`Vadim Petrochenkov-2/+2
2019-03-24Separate variant id and variant constructor id.David Wood-30/+38
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-17Do not complain about non-existing fields after parse recoveryEsteban Küber-1/+2
When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it.
2019-03-14Add `EntryKind::TypeParam` and `EntryKind::ConstParam`varkor-0/+2
2019-03-05Encode proc macro stabilityJohn Kåre Alsaker-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-08librustc_metadata => 2018Taiki Endo-3/+4
2019-01-22Fix some cross crate existential type ICEsOliver Scherer-0/+3
2019-01-10integrate trait aliases into def-paths / metadataNiko Matsakis-16/+30
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2018-12-26Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.Alexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-12Use type safe `VariantIdx` instead of `usize` everywhereOliver Scherer-1/+1
2018-10-31Make `-Z ls` list the actual filename of external dependenciesAidan Hobson Sayers-1/+1
2018-10-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-1/+1
2018-09-28Auto merge of #54338 - orium:fix-macro-inc-comp, r=nrcbors-2/+2
Use full name to identify a macro in a `FileName`. Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see #53097) since two different macros would map out to the same `StableFilemapId`. Fixes #53097. r? @nrc
2018-09-25Auto merge of #53693 - scottmcm:marker-trait-attribute, r=nikomatsakisbors-0/+1
Support an explicit annotation for marker traits From the tracking issue for rust-lang/rfcs#1268: > It seems obvious that we should make a `#[marker]` annotation. ~ https://github.com/rust-lang/rust/issues/29864#issuecomment-368959441 This PR allows you to put `#[marker]` on a trait, at which point: - [x] The trait must not have any items ~~All of the trait's items must have defaults~~ - [x] Any impl of the trait must be empty (not override any items) - [x] But impls of the trait are allowed to overlap r? @nikomatsakis
2018-09-22avoid loading constructor attributes in AdtDef decodingAriel Ben-Yehuda-2/+6
During metadata loading, the AdtDefs for every ADT in the universe need to be loaded (for example, for coherence of builtin traits). For that, the attributes of the AdtDef need to be loaded too. The attributes of a struct are duplicated between 2 def ids - the constructor def-id, and the "type" def id. Loading attributes for both def-ids, which was done in #53721, slowed the compilation of small crates by 2-3%. This PR makes sure we only load the attributes for the "type" def-id, avoiding the slowdown.
2018-09-19Add an is_marker flag to TraitDefScott McMurray-0/+1
2018-09-19Use full name to identify a macro in a `FileName`.Diogo Sousa-2/+2
Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see #53097) since two different macros would map out to the same `StableFilemapId`. Fixes #53097.
2018-09-15avoid leaking host details in proc macro metadata decodingAriel Ben-Yehuda-18/+53
proc macro crates are essentially implemented as dynamic libraries using a dlopen-based ABI. They are also Rust crates, so they have 2 worlds - the "host" world in which they are defined, and the "target" world in which they are used. For all the "target" world knows, the proc macro crate might not even be implemented in Rust, so leaks of details from the host to the target must be avoided for correctness. Because the "host" DefId space is different from the "target" DefId space, any leak involving a DefId will have a nonsensical or out-of-bounds DefKey, and will cause all sorts of crashes. This PR fixes all leaks I have found in `decoder`. In particular, #54059 was caused by host native libraries leaking into the target, which feels like it might even be a correctness issue if it doesn't cause an ICE. Fixes #54059
2018-09-06Auto merge of #53721 - arielb1:exhaustively-unpun, r=nikomatsakisbors-10/+18
fix `is_non_exhaustive` confusion between structs and enums Structs and enums can both be non-exhaustive, with a very different meaning. This PR splits `is_non_exhaustive` to 2 separate functions - 1 for structs, and another for enums, and fixes the places that got the usage confused. Fixes #53549. r? @eddyb
2018-09-01move the is_field_list_non_exhaustive flag to VariantDefAriel Ben-Yehuda-10/+18
This completely splits the IS_NON_EXHAUSTIVE flag. No functional changes intended.
2018-08-26create a valid DefIdTable for proc macro cratesAriel Ben-Yehuda-22/+45
At least the incremental compilation code, and a few other places in the compiler, require the CrateMetadata for a loaded target crate to contain a valid DefIdTable for the DefIds in the target. Previously, the CrateMetadata for a proc macro contained the crate's "host" DefIdTable, which is of course incompatible with the "target" DefIdTable, causing ICEs. This creates a DefIdTable that properly refers to the "proc macro" DefIds. Fixes #49482.
2018-08-22Replace TyForeign with ForeignTyvarkor-1/+1
2018-08-22Rename Def::{Param, Foreign} to Def::{TyParam, TyForeign}varkor-1/+1
2018-08-22Remove Ty prefix from Ty{Foreign|Param}varkor-1/+1
2018-08-19fix tidy errorsDonato Sciarra-2/+4
2018-08-19mv codemap source_mapDonato Sciarra-19/+19
2018-08-19mv codemap() source_map()Donato Sciarra-1/+1
2018-08-19mv (mod) codemap source_mapDonato Sciarra-2/+2
2018-08-19mv filemap source_fileDonato Sciarra-32/+32
2018-08-19mv FileMap SourceFileDonato Sciarra-11/+11
2018-08-19mv CodeMap SourceMapDonato Sciarra-2/+2
2018-08-09Move Fingerprint to data structuresMark Rousskov-1/+1
2018-08-07Rollup merge of #52886 - petrochenkov:noga, r=alexcrichtonkennytm-1/+1
cleanup: Remove `Def::GlobalAsm` Global asm is not something that needs to have a `Def` or `DefId`.
2018-08-05Improve query efficiencyvarkor-4/+2
2018-08-05Fix incremental testsvarkor-2/+4
2018-08-05Add lint for unknown feature attributesvarkor-0/+8
2018-08-04cleanup: Remove `Def::GlobalAsm`Vadim Petrochenkov-1/+1
2018-07-18Implement existential typesOliver Schneider-0/+1