about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustc_metadataflip1995-5/+5
2019-04-27Auto merge of #59887 - eddyb:safer-metadata, r=Zoxcbors-45/+80
rustc_metadata: more safely read/write the index positions. This is a small part of a larger refactor, that I want to benchmark independently. The final code would be even cleaner than this, so this is sort of an "worst case" test.
2019-04-25Update mir_const_qualifJohn Kåre Alsaker-1/+1
2019-04-21AST/HIR: Use `Mutability` instead of bool in foreign staticsVadim Petrochenkov-2/+2
2019-04-21Remove mutability from `Def::Static`Vadim Petrochenkov-2/+2
2019-04-21Introduce query `static_mutability`Vadim Petrochenkov-0/+11
2019-04-18Auto merge of #60025 - JohnTitor:rename-files, r=petrochenkovbors-1/+1
Rename files about error codes fixes #60017 This PR will be failed in tidy. <details> <summary>The log is here:</summary> ``` tidy check tidy error: duplicate error code: 411 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:83: __diagnostic_used!(E0411); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:84: err.code(DiagnosticId::Error("E0411".to_owned())); tidy error: duplicate error code: 424 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:90: debug!("smart_resolve_path_fragment: E0424, source={:?}", source); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:92: __diagnostic_used!(E0424); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:93: err.code(DiagnosticId::Error("E0424".to_owned())); some tidy checks failed ``` </details> I'd like to fix this but I don't know what to do. I will work on later. Please let me know if you have any solutions. r? @petrochenkov
2019-04-17Rename modulesYuki OKUSHI-1/+1
2019-04-17Rename diagnostics to error_codesYuki OKUSHI-0/+0
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-16rustc_metadata: more safely read/write the index positions.Eduard-Mihai Burtescu-45/+80
2019-04-14Auto merge of #59335 - Aaron1011:fix/extern-priv-final, r=Aaron1011bors-10/+28
Properly parse '--extern-private' with name and path It turns out that https://github.com/rust-lang/rust/pull/57586 didn't properly parse `--extern-private name=path`. This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path. Part of https://github.com/rust-lang/rust/issues/44663
2019-04-14Refactor structure of ExternEntryAaron Hill-18/+8
2019-04-14Improve formattingAaron Hill-1/+0
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-4/+9
2019-04-14Combine 'Extern' and 'ExternPrivate'Aaron Hill-7/+8
2019-04-14Properly parse '--extern-private' with name and pathAaron Hill-5/+33
2019-04-11Clean up handling of -Zpgo-gen commandline option.Michael Woerister-1/+1
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
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-42/+39
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-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-24Remove `VariantDef::parent_did`Vadim Petrochenkov-12/+9
2019-03-24Separate variant id and variant constructor id.David Wood-60/+127
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-23Fix rebaseEsteban Küber-1/+1
2019-03-23Swap primary/secondary spans for E0458Esteban Küber-2/+3
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-1/+2
Do not complain about non-existing fields after parse recovery 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. Fix #57361.
2019-03-20Auto merge of #57018 - dcreager:redundant-linker, r=alexcrichtonbors-25/+27
Keep last redundant linker flag, not first When a library (L1) is passed to the linker multiple times, this is sometimes purposeful: there might be several other libraries in the linker command (L2 and L3) that all depend on L1. You'd end up with a (simplified) linker command that looks like: ``` -l2 -l1 -l3 -l1 ``` With the previous behavior, when rustc encountered a redundant library, it would keep the first instance, and remove the later ones, resulting in: ``` -l2 -l1 -l3 ``` This can cause a linker error, because on some platforms (e.g. Linux), the linker will only include symbols from L1 that are needed *at the point it's referenced in the command line*. So if L3 depends on additional symbols from L1, which aren't needed by L2, the linker won't know to include them, and you'll end up with "undefined symbols" errors. A better behavior is to keep the *last* instance of the library: ``` -l2 -l3 -l1 ``` This ensures that all "downstream" libraries have been included in the linker command before the "upstream" library is referenced. Fixes rust-lang#47989
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-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-1/+1
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-14Add `EntryKind::TypeParam` and `EntryKind::ConstParam`varkor-21/+42
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-08Auto merge of #58903 - estebank:forgetful-delims, r=petrochenkovbors-2/+2
Always emit unclosed delimiter diagnostics Fix #58886.
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-06Emit missing unclosed delimiter errorsEsteban Küber-2/+2
2019-03-05Move locate_ctxt backJohn Kåre Alsaker-21/+21
2019-03-05Encode proc macro stabilityJohn Kåre Alsaker-2/+7