about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
AgeCommit message (Collapse)AuthorLines
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
2022-07-07Reword comments and rename HIR visiting methods.Camille GILLOT-1/+1
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-12/+11
2022-07-02Auto merge of #97235 - nbdd0121:unwind, r=Amanieubors-17/+17
Fix FFI-unwind unsoundness with mixed panic mode UB maybe introduced when an FFI exception happens in a `C-unwind` foreign function and it propagates through a crate compiled with `-C panic=unwind` into a crate compiled with `-C panic=abort` (#96926). To prevent this unsoundness from happening, we will disallow a crate compiled with `-C panic=unwind` to be linked into `panic-abort` *if* it contains a call to `C-unwind` foreign function or function pointer. If no such call exists, then we continue to allow such mixed panic mode linking because it's sound (and stable). In fact we still need the ability to do mixed panic mode linking for std, because we only compile std once with `-C panic=unwind` and link it regardless panic strategy. For libraries that wish to remain compile-once-and-linkable-to-both-panic-runtimes, a `ffi_unwind_calls` lint is added (gated under `c_unwind` feature gate) to flag any FFI unwind calls that will cause the linkable panic runtime be restricted. In summary: ```rust #![warn(ffi_unwind_calls)] mod foo { #[no_mangle] pub extern "C-unwind" fn foo() {} } extern "C-unwind" { fn foo(); } fn main() { // Call to Rust function is fine regardless ABI. foo::foo(); // Call to foreign function, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. unsafe { foo(); } //~^ WARNING call to foreign function with FFI-unwind ABI let ptr: extern "C-unwind" fn() = foo::foo; // Call to function pointer, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. ptr(); //~^ WARNING call to function pointer with FFI-unwind ABI } ``` Fix #96926 `@rustbot` label: T-compiler F-c_unwind
2022-07-02fall back on the blank path if out_filename is blankYoshiki Matsuda-1/+1
2022-07-02seek instead of opening a new file handleYoshiki Matsuda-4/+7
2022-07-02avoid holding the temp_dir for empty metadata fileYoshiki Matsuda-1/+1
2022-07-02add a comment about counting zero bytesYoshiki Matsuda-0/+1
2022-07-02add some comments for encode_and_write_metadataYoshiki Matsuda-0/+6
2022-07-02fix an incorrect filename for an error messageYoshiki Matsuda-1/+1
2022-07-02refactor encode_and_write_metadataYoshiki Matsuda-44/+31
2022-07-02Revert "write the root position at the end"Yoshiki Matsuda-13/+16
This reverts commit 44f66429e1fdba2cd167b4033f04f462a368b717.
2022-07-02add a comment about the drop order for EncodedMetadataYoshiki Matsuda-0/+1
2022-07-02create an empty file even in case of MetadataKind::NoneYoshiki Matsuda-6/+16
2022-07-02flush and assert when counting zero bytesYoshiki Matsuda-1/+5
2022-07-02define MmapMut and use it in Decodable implYoshiki Matsuda-13/+12
2022-07-02use &Path instead of AsRef<Path>Yoshiki Matsuda-3/+3
2022-07-02create tmp directory if there is no parent directoryYoshiki Matsuda-1/+1
2022-07-02insert dummy 4 bytes to avoid the breaking changeYoshiki Matsuda-1/+6
2022-07-02seek before counting zero bytesYoshiki Matsuda-1/+2
2022-07-02call EncodedMetadata::empty in case of MetadataKind::NoneYoshiki Matsuda-25/+36
2022-07-02write the root position at the endYoshiki Matsuda-18/+10
2022-07-02add Send to the argument type of encode_metadataYoshiki Matsuda-1/+1
2022-07-02use BufReader for counting zero bytesYoshiki Matsuda-14/+14
2022-07-02seek and write the root position to the metadata fileYoshiki Matsuda-10/+15
2022-07-02write to a temporary file in Decodable for EncodedMetadataYoshiki Matsuda-19/+32
2022-07-02hold Mmap in EncodedMetadataYoshiki Matsuda-12/+33