about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
AgeCommit message (Collapse)AuthorLines
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
2022-08-06Encode index of SourceFile along with span.Camille GILLOT-69/+60
2022-08-03Compute `object_lifetime_default` per parameter.Camille GILLOT-0/+8
2022-08-01Auto merge of #95884 - cjgillot:assoc-item, r=lcnrbors-95/+20
Thin `AssocItem` This PR removes a few fields from `AssocItem` that should be easily computed using other queries. This simplifies some of the metadata decoding.
2022-08-01Remove trait_of_item query.Camille GILLOT-14/+0
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-47/+17
2022-08-01Remove visibility from AssocItem.Camille GILLOT-1/+0
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-43/+13
2022-08-01Auto merge of #99476 - dpaoliello:rawdylibvectorcall, r=michaelwoeristerbors-1/+3
Add tests for raw-dylib with vectorcall, and fix vectorcall code generation * Adds tests for using `raw-dylib` (#58713) with `vectorcall`. * Fixed code generation for `vectorcall` (parameters have to be marked with `InReg`, just like `fastcall`). * Enabled running the `raw-dylib` `fastcall` tests when using MSVC (since I had to add support in the test for running MSVC-only tests since GCC doesn't support `vectorcall`).
2022-07-29Rename local_did to def_idMiguel Guarniz-8/+8
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-8/+8
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-27Update mentions to `rustc_metadata::rmeta::Lazy`Yuki Okushi-12/+12
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-27Rollup merge of #99698 - compiler-errors:no-doc-hidden, r=cjgillotYuki Okushi-5/+15
Prefer visibility map parents that are not `doc(hidden)` first Far simpler approach to #98876. This only fixes the case where the parent is `doc(hidden)`, not where the child is `doc(hidden)` since I don't know how to get the attrs on the import statement given a `ModChild`... I'll try to follow up with that, but this is a good first step.
2022-07-26Fix vectorcallDaniel Paoliello-1/+3
2022-07-26Implement `#[rustc_default_body_unstable]`Maybe Waffle-0/+15
This attribute allows to mark default body of a trait function as unstable. This means that implementing the trait without implementing the function will require enabling unstable feature. This is useful in conjunction with `#[rustc_must_implement_one_of]`, 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.
2022-07-24Do not prefer module parents which are `doc(hidden)` in visibility mapMichael Goulet-5/+15
2022-07-24remove new allocations from imported_source_filesPietro Albini-20/+20
2022-07-23Fix typo/grammar in locator.rs doc commentDaniel Bevenius-1/+1
2022-07-20passes: improved partial stabilization diagnosticDavid Wood-0/+26
Improves the diagnostic when a feature attribute is specified unnecessarily but the feature implies another (i.e. it was partially stabilized) to refer to the implied feature. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-14Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillotbors-30/+222
Stop keeping metadata in memory before writing it to disk Fixes #96358 I created this PR according with the instruction given in the issue except for the following points: - While the issue says "Write metadata into the temporary file in `encode_and_write_metadata` even if `!need_metadata_file`", I could not do that. That is because though I tried to do that and run `x.py test`, I got a lot of test failures as follows. <details> <summary>List of failed tests</summary> <pre> <code> failures: [ui] src/test/ui/json-multiple.rs [ui] src/test/ui/json-options.rs [ui] src/test/ui/rmeta/rmeta-rpass.rs [ui] src/test/ui/save-analysis/emit-notifications.rs [ui] src/test/ui/svh/changing-crates.rs [ui] src/test/ui/svh/svh-change-lit.rs [ui] src/test/ui/svh/svh-change-significant-cfg.rs [ui] src/test/ui/svh/svh-change-trait-bound.rs [ui] src/test/ui/svh/svh-change-type-arg.rs [ui] src/test/ui/svh/svh-change-type-ret.rs [ui] src/test/ui/svh/svh-change-type-static.rs [ui] src/test/ui/svh/svh-use-trait.rs test result: FAILED. 12915 passed; 12 failed; 100 ignored; 0 measured; 0 filtered out; finished in 71.41s Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu Build completed unsuccessfully in 0:01:58 </code> </pre> </details> - I could not resolve the extra tasks about `create_rmeta_file` and `create_compressed_metadata_file` for my lack of ability.
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-4/+2
Move abstract const to middle Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`. This allows for const resolution in infer to use abstract consts to walk consts and check if they are resolvable. This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved. r? `@lcnr`
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-17/+17
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-12Move abstract const to rustc_middle::tykadmin-4/+2
2022-07-07Auto merge of #99024 - matthiaskrgr:rollup-8ygpcpg, r=matthiaskrgrbors-1/+1
Rollup of 9 pull requests Successful merges: - #97917 (Implement ExitCodeExt for Windows) - #98844 (Reword comments and rename HIR visiting methods.) - #98979 (interpret: use AllocRange in UninitByteAccess) - #98986 (Fix missing word in comment) - #98994 (replace process exit with more detailed exit in src/bootstrap/*.rs) - #98995 (Add a test for #80471) - #99002 (suggest adding a derive for #[default] applied to variants) - #99004 (Add a test for #70408) - #99017 (Replace boolean argument for print_where_clause with an enum to make code more clear) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup