about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
AgeCommit message (Collapse)AuthorLines
2022-09-09RPITIT placeholder itemsMichael Goulet-0/+6
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-9/+21
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-06Rollup merge of #101434 - ↵Guillaume Gomez-6/+6
JhonnyBillM:replace-session-for-handler-in-into-diagnostic, r=davidtwco Update `SessionDiagnostic::into_diagnostic` to take `Handler` instead of `ParseSess` Suggested by the team in [this Zulip Topic](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler). `Handler` already has almost all the capabilities of `ParseSess` when it comes to diagnostic emission, in this migration we only needed to add the ability to access `source_map` from the emitter in order to get a `Snippet` and the `start_point`. Not sure if adding these two methods [`span_to_snippet_from_emitter` and `span_start_point_from_emitter`] is the best way to address this gap. P.S. If this goes in the right direction, then we probably may want to move `SessionDiagnostic` to `rustc_errors` and rename it to `DiagnosticHandler` or something similar. r? `@davidtwco` r? `@compiler-errors`
2022-09-05Rollup merge of #101391 - matthiaskrgr:perf0309, r=oli-obkDylan DPC-13/+5
more clippy::perf fixes
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-6/+6
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-03more clippy::perf fixesMatthias Krüger-13/+5
2022-09-03Do not call object_lifetime_default on lifetime params.Camille GILLOT-4/+3
2022-09-03Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwcoDylan DPC-451/+911
Migrate rustc_metadata to SessionDiagnostics Migrate rustc_metadata to SessionDiagnostics. Part of https://github.com/rust-lang/rust/issues/100717
2022-09-01Auto merge of #98960 - cjgillot:entry-kind, r=estebankbors-354/+250
Remove EntryKind from metadata. This PR continues the refactor of metadata emission to be more systematic, iterating on definitions and filtering based on each definition's `DefKind`. This allows to remove the large `EntryKind` enum, replaced by linear tables in metadata.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-9/+7
by module
2022-08-31port 5 new diagnostics that appeared in masterNathan Stocks-20/+52
2022-08-31respond to review feedback: mainly eliminate as many conversions as possible...Nathan Stocks-224/+193
- ... when creating diagnostics in rustc_metadata - use the error_code! macro - pass macro output to diag.code() - use fluent from within manual implementation of SessionDiagnostic - emit the untested errors in case they occur in the wild - stop panicking in the probably-not-dead code, add fixme to write test
2022-08-31port of locator.rs to SessionDiagnostics, fix some of the errorsNathan Stocks-213/+393
revealed by tests, manually add a panic to test for dead code
2022-08-31port fs.rs to SessionDiagnosticsNathan Stocks-9/+43
2022-08-31port creader.rs to SessionDiagnosticsNathan Stocks-34/+74
2022-08-31port encoder.rs to SessionDiagnosticsNathan Stocks-3/+22
2022-08-31port native_libs.rs to SessionDiagnosticsNathan Stocks-128/+286
2022-08-31set up rustc_metadata for SessionDiagnostics, port dependency_format.rsNathan Stocks-53/+81
2022-08-30Stabilize GATsJack Huey-1/+1
2022-08-30Handle MIR in a single place.Camille GILLOT-17/+19
2022-08-30Remove fn_has_self_parameter table.Camille GILLOT-16/+15
2022-08-30Separate macro_rules and macro_definition.Camille GILLOT-10/+12
2022-08-30Remove EntryKind.Camille GILLOT-148/+32
2022-08-30Create a module-reexports table.Camille GILLOT-18/+11
2022-08-30Fix the panic message.Camille GILLOT-1/+1
2022-08-30Create a table for fn_has_self_parameter.Camille GILLOT-15/+17
2022-08-30Use tables for macros.Camille GILLOT-11/+27
2022-08-30Move AssocContainer to a metadata table.Camille GILLOT-17/+24
2022-08-30Move VariantData to a metadata table.Camille GILLOT-24/+25
2022-08-30Simplify recursion scheme.Camille GILLOT-79/+51
2022-08-30Encode consts in metadata main loop.Camille GILLOT-32/+51
2022-08-30Encode type in the main loop.Camille GILLOT-56/+55
2022-08-30Auto merge of #100812 - Nilstrieb:revert-let-chains-nightly, r=Mark-Simulacrumbors-0/+1
Revert let_chains stabilization This is the revert against master, the beta revert was already done in #100538. Bumps the stage0 compiler which already has it reverted.
2022-08-29Revert let_chains stabilizationNilstrieb-0/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-29Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errorsDylan DPC-0/+8
Remove separate indexing of early-bound regions ~Based on https://github.com/rust-lang/rust/pull/99728.~ This PR copies some modifications from https://github.com/rust-lang/rust/pull/97839 around object lifetime defaults. These modifications allow to stop counting generic parameters during lifetime resolution, and rely on the indexing given by `rustc_typeck::collect`.
2022-08-26Implementation of import_name_typeDaniel Paoliello-7/+76
2022-08-25Auto merge of #100436 - jyn514:macro-query-system, r=cjgillotbors-12/+12
try and simplify some things in the query system
2022-08-23get rid of another unnecessary lifetime macro argumentJoshua Nelson-12/+12
2022-08-20rmeta/query cache: don't write string values of preinterned symbolsklensy-11/+23
2022-08-19Auto merge of #100209 - cjgillot:source-file-index, r=estebankbors-211/+194
Lazily decode SourceFile from metadata Currently, source files from foreign crates are decoded up-front from metadata. Spans from those crates were matched with the corresponding source using binary search among those files. This PR changes the strategy by matching spans to files during encoding. This allows to decode source files on-demand, instead of up-front. The on-disk format for spans becomes: `<tag> <position from start of file> <length> <file index> <crate (if foreign file)>`.
2022-08-15cache strings while encoding/decoding to compiler artifactsklensy-0/+54
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-08-09Add error if link_ordinal used without raw-dylibDaniel Paoliello-1/+25
2022-08-09Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011Dylan DPC-0/+15
Implement `#[rustc_default_body_unstable]` This PR implements a new stability attribute — `#[rustc_default_body_unstable]`. `#[rustc_default_body_unstable]` controls the stability of default bodies in traits. For example: ```rust pub trait Trait { #[rustc_default_body_unstable(feature = "feat", isssue = "none")] fn item() {} } ``` In order to implement `Trait` user needs to either - implement `item` (even though it has a default implementation) - enable `#![feature(feat)]` This is useful in conjunction with [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/pull/92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable. r? `@Aaron1011` cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`) P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
2022-08-08Remove unused parameter.Camille GILLOT-1/+0
2022-08-07Only encode position from start of file.Camille GILLOT-23/+21
2022-08-06Support parallel compiler.Camille GILLOT-4/+3
2022-08-06Simplify encoding a bit.Camille GILLOT-34/+35
2022-08-06Remove unused cache.Camille GILLOT-10/+0
2022-08-06Decode SourceFile out of order.Camille GILLOT-149/+154