summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder.rs
AgeCommit message (Collapse)AuthorLines
2024-11-02Rename target triple to target tuple in many places in the compilerNoratrieb-1/+1
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
2024-10-30Remove dead code stemming from the old effects desugaringLeón Orell Valerian Liehr-4/+1
2024-10-11Auto merge of #131045 - compiler-errors:remove-unnamed_fields, r=wesleywiserbors-3/+0
Retire the `unnamed_fields` feature for now `#![feature(unnamed_fields)]` was implemented in part in #115131 and #115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature. However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly. Fixes #117942 Fixes #121161 Fixes #121263 Fixes #121299 Fixes #121722 Fixes #121799 Fixes #126969 Fixes #131041 Tracking: * https://github.com/rust-lang/rust/issues/49804 [^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields [^2]: https://github.com/rust-lang/rust/issues/49804#issuecomment-1972619108
2024-10-01add unstable support for outputting file checksums for use in cargoJacob Kiesel-0/+2
2024-10-01Remove unnamed field featureMichael Goulet-3/+0
2024-09-27Implement RFC3137 trim-paths sysroot changesUrgau-49/+56
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-08-31Rollup merge of #129723 - compiler-errors:extern-providers, r=lcnrMatthias Krüger-32/+0
Simplify some extern providers Simplifies some extern crate providers: 1. Generalize the `ProcessQueryValue` identity impl to work on non-`Option` types. 2. Allow `ProcessQueryValue` to wrap its output in an `EarlyBinder`, to simplify `explicit_item_bounds`/`explicit_item_super_predicates`. 3. Use `{ table }` and friends more when possible.
2024-08-29Simplify some extern providersMichael Goulet-32/+0
2024-08-29Add `warn(unreachable_pub)` to `rustc_metadata`.Nicholas Nethercote-5/+5
2024-08-28Move 'tcx lifetime off of impl and onto methodsMichael Goulet-14/+18
2024-08-24Fix `elided_named_lifetimes` in codePavel Grigorenko-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-10/+9
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-25Rollup merge of #127528 - estebank:ascii-control-chars, r=oli-obkMatthias Krüger-2/+0
Replace ASCII control chars with Unicode Control Pictures Replace ASCII control chars like `CR` with Unicode Control Pictures like `␍`: ``` error: bare CR not allowed in doc-comment --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:3:32 | LL | /// doc comment with bare CR: '␍' | ^ ``` Centralize the checking of unicode char width for the purposes of CLI display in one place. Account for the new replacements. Remove unneeded tracking of "zero-width" unicode chars, as we calculate these in the `SourceMap` as needed now.
2024-07-18Avoid unnecessary sorting of traitsMichael Goulet-2/+3
2024-07-18Be more accurate about calculating `display_col` from a `BytePos`Esteban Küber-2/+0
No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter. This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2): ``` error: this file contains an unclosed delimiter --> $DIR/issue-68629.rs:5:17 | LL | ␜␟ts␀![{i | -- unclosed delimiter | | | unclosed delimiter LL | ␀␀ fn rݻoa>rݻm | ^ ```
2024-07-11report pat no field error no recoverd struct variantyukang-1/+1
2024-06-28implement new effects desugaringDeadbeef-1/+4
2024-06-16rustc_span: Minor improvementsVadim Petrochenkov-2/+2
Introduce `{IndexNewtype,SyntaxContext}::from_u16` for convenience because small indices are sometimes encoded as `u16`. Use `SpanData::span` instead of `Span::new` where appropriate. Add a clarifying comment about decoding span parents.
2024-05-26Give EarlyBinder a tcx parameterMichael Goulet-2/+2
We are gonna need it to uplift EarlyBinder
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_metadata`.Nicholas Nethercote-0/+1
2024-05-21PR feedbackBen Kimock-2/+5
2024-05-21Add a footer in FileEncoder and check for it in MemDecoderBen Kimock-6/+22
2024-05-13Remove `extern crate rustc_middle` from `rustc_metadata`.Nicholas Nethercote-0/+1
2024-05-01Step bootstrap cfgsMark Rousskov-1/+1
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-19/+23
And suggest adding the `#[coroutine]` to the closure
2024-04-17consistency rename: language item -> lang itemRalf Jung-1/+1
2024-03-20Split item bounds and item super predicatesMichael Goulet-0/+14
2024-03-16less useless array builds in imported_source_fileklensy-10/+10
2024-03-08Move metadata header and version checks togetherbjorn3-6/+18
This will make it easier to report rustc versions for older metadata formats.
2024-03-06Auto merge of #119455 - Mark-Simulacrum:relative-spans, r=cjgillotbors-1/+5
Embed length of offset/position into Span tag byte This cuts the average bytes/relative span from 3.5 to 3.2 on libcore, ultimately saving ~400kb of data.
2024-03-05Auto merge of #120675 - oli-obk:intrinsics3.0, r=pnkfelixbors-1/+1
Add a scheme for moving away from `extern "rust-intrinsic"` entirely All `rust-intrinsic`s can become free functions now, either with a fallback body, or with a dummy body and an attribute, requiring backends to actually implement the intrinsic. This PR demonstrates the dummy-body scheme with the `vtable_size` intrinsic. cc https://github.com/rust-lang/rust/issues/63585 follow-up to #120500 MCP at https://github.com/rust-lang/compiler-team/issues/720
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-1/+1
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
2024-03-04Return a struct from `query intrinsic` to be able to add another field in ↵Oli Scherer-1/+1
the next commit
2024-02-18By tracking import use types to check whether it is scope uses or the other ↵surechen-1/+1
situations like module-relative uses, we can do more accurate redundant import checking. fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-16Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkinbors-2/+2
Implement intrinsics with fallback bodies fixes #93145 (though we can port many more intrinsics) cc #63585 The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for * codegen_ssa (so llvm and gcc) * codegen_cranelift other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body). cc `@scottmcm` `@WaffleLapkin` ### todo * [ ] miri support * [x] default intrinsic name to name of function instead of requiring it to be specified in attribute * [x] make sure that the bodies are always available (must be collected for metadata)
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-6/+4
2024-02-15Use generic `NonZero` internally.Markus Reiter-6/+8
2024-02-12Implement intrinsics with fallback bodiesOli Scherer-2/+2
2024-02-12Make `is_intrinsic` query return the intrinsic nameOli Scherer-2/+2
2024-02-12Lower anonymous structs or unions to HIRFrank King-0/+3
2024-02-06resolve: Unload speculatively resolved crates before freezing cstoreVadim Petrochenkov-0/+7
2024-01-17Improved collapse_debuginfo attribute, added command-line flag (no|external|yes)Andrew Zhogin-0/+1
2024-01-06Embed length of offset/position into Span tag byteMark Rousskov-1/+5
This cuts the average bytes/relative span from 3.5 to 3.2 on libcore, ultimately saving ~400kb of data.
2024-01-06Auto merge of #119478 - bjorn3:no_serialize_specialization, r=wesleywiserbors-70/+59
Avoid specialization in the metadata serialization code With the exception of a perf-only specialization for byte slices and byte vectors. This uses the same trick of introducing a new trait and having the Encodable and Decodable derives add a bound to it as used for TyEncoder/TyDecoder. The new code is clearer about which encoder/decoder uses which impl and it reduces the dependency of rustc on specialization, making it easier to remove support for specialization entirely or turn it into a construct that is only allowed for perf optimizations if we decide to do this.
2024-01-04cstore: Remove unnecessary locking from `CrateMetadata`Vadim Petrochenkov-20/+19
2023-12-31Avoid specialization for AttrId deserializationbjorn3-6/+3
2023-12-31Remove almost all uses of specialization from the metadata encoding codebjorn3-57/+49
2023-12-31Avoid specialization for the Span Encodable and Decodable implsbjorn3-9/+9
2023-12-29Shrink span encoding furtherMark Rousskov-21/+19
Spans are now stored in a more compact form which cuts down on at least 1 byte per span (indirect/direct encoding) and at most 3 bytes per span (indirect/direct encoding, context byte, length byte). As a result, libcore metadata shrinks by 1.5MB.