about summary refs log tree commit diff
path: root/compiler/rustc_metadata
AgeCommit message (Collapse)AuthorLines
2022-07-14Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillotbors-30/+223
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
2022-07-02construct EncodedMetadata in encode_and_write_metadataYoshiki Matsuda-12/+17
2022-07-02call emit_metadata only when metadata_kind is NoneYoshiki Matsuda-3/+6
2022-07-02use rustc_serialize::opaque::FileEncoderYoshiki Matsuda-38/+46
2022-07-02move encode_and_write_metadata to rustc_metadata::fsYoshiki Matsuda-1/+90
2022-07-02move emit_metadata to rustc_metadata::fsYoshiki Matsuda-0/+26
2022-06-29Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqdbors-1/+1
Update `smallvec` to 1.8.1. This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc. r? `@lqd`
2022-06-29Rollup merge of #97786 - ferrocene:pa-fix-simulate-remap-prefix, ↵Dylan DPC-16/+22
r=Mark-Simulacrum Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths Discovered in #97682, `-Z simulate-remapped-rust-src-base` only partially simulated the behavior of `remap-debuginfo = true`. While the flag successfully simulates the remapping when stdlib's `rmeta` file is loaded, the simulated prefix was not accounted for when the remapped path's local path was being discovered. This caused the flag to not fully simulate the behavior of `remap-debuginfo = true`, leading to inconsistent behaviors. This PR fixes https://github.com/rust-lang/rust/issues/97682 by also accounting for the simulated path.
2022-06-27Update `smallvec` to 1.8.1.Nicholas Nethercote-1/+1
This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc.
2022-06-20Fix panic by checking if `CStore` has the crate data we want before actually ↵Guillaume Gomez-0/+4
querying it
2022-06-19Rollup merge of #98136 - fee1-dead-contrib:rename_impl_constness, r=oli-obkDylan DPC-11/+11
Rename `impl_constness` to `constness` The current code is a basis for `is_const_fn_raw`, and `impl_constness` is no longer a valid name, which is previously used for determining the constness of impls, and not items in general. r? `@oli-obk`
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-2/+2
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-16Move `finish` out of the `Encoder` trait.Nicholas Nethercote-8/+1
This simplifies things, but requires making `CacheEncoder` non-generic. (This was previously merged as commit 4 in #94732 and then was reverted in #97905 because it caused a perf regression.)
2022-06-15Rename `impl_constness` to `constness`Deadbeef-11/+11
The current code is a basis for `is_const_fn_raw`, and `impl_constness` is no longer a valid name, which is previously used for determining the constness of impls, and not items in general.
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-1/+1
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-14Separate Definitions and CrateStore from ResolverOutputs.Camille GILLOT-2/+2
2022-06-14Rename rustc_serialize::opaque::Encoder as MemEncoder.Nicholas Nethercote-14/+16
This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports). (This was previously merged as commit 5 in #94732 and then was reverted in #97905 because of a perf regression caused by commit 4 in #94732.)
2022-06-13account for simulated remap-debuginfo when resolving remapped pathsPietro Albini-16/+22
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-1/+1
2022-06-11Auto merge of #95880 - cjgillot:def-ident-span, r=petrochenkovbors-23/+6
Handle `def_ident_span` like `def_span`. `def_ident_span` had an ad-hoc status in the compiler. This PR refactors it to be a first-class citizen like `def_span`: - it gets encoded in the main metadata loop, instead of the visitor; - its implementation is updated to mirror the one of `def_span`. We do not remove the `Option` in the return type, since some items do not have an ident, AnonConsts for instance.