about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-08-04Auto merge of #3011 - saethlin:spellck, r=RalfJungbors-7/+7
A bit of spell-checking I noticed the one error in miri-script and took care of a few more shallow ones.
2023-08-04Auto merge of #3012 - rust-lang:rustup-2023-08-04, r=oli-obkbors-1693/+3274
Automatic sync from rustc
2023-08-04Merge from rustcThe Miri Conjob Bot-1692/+3273
2023-08-04Auto merge of #114449 - matthiaskrgr:rollup-cekswes, r=matthiaskrgrbors-488/+715
Rollup of 8 pull requests Successful merges: - #113534 (Forbid old-style `simd_shuffleN` intrinsics) - #113999 (Specify macro is invalid in certain contexts) - #114348 (Migrate GUI colors test to original CSS color format) - #114373 (unix/kernel_copy.rs: copy_file_range_candidate allows empty output files) - #114404 (Migrate GUI colors test to original CSS color format) - #114409 (builtin impl confirmation wuhu) - #114429 (compiletest: Handle non-utf8 paths (fix FIXME)) - #114431 (Enable tests on rustc_codegen_ssa) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-04Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-08-04Rollup merge of #114431 - ehuss:ssa-test, r=est31Matthias Krüger-3/+0
Enable tests on rustc_codegen_ssa This enables unittests in rustc_codegen_ssa. There are some tests, primarily in [`back/rpath/tests.rs`](https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs) that haven't ever been running since the unittests are disabled. From what I can tell, this was just a consequence of how things evolved. When testing was initially added in https://github.com/rust-lang/rust/pull/33282, `librustc_trans` had test=false because it didn't have any tests. `rustc_codegen_ssa` eventually split off from that (https://github.com/rust-lang/rust/pull/55627), and the rpath module eventually got merged in too (from `librustc_back` where it used to live). That migration didn't enable the tests. This also includes some fluent diagnostic tests, though I'm not sure what exactly they are testing.
2023-08-04Rollup merge of #114429 - Enselic:compiletest-fix, r=est31Matthias Krüger-10/+14
compiletest: Handle non-utf8 paths (fix FIXME) Removes the last FIXME in the code for #9639 🎉 (which was closed 8 years ago) Part of #44366 which is E-help-wanted. (The other two PRs that does this are #114377 and #114427)
2023-08-04Rollup merge of #114409 - lcnr:confirmation, r=compiler-errorsMatthias Krüger-23/+17
builtin impl confirmation wuhu
2023-08-04Rollup merge of #114404 - GuillaumeGomez:migrate-gui-test-color-26, r=notriddleMatthias Krüger-1/+1
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. Seems like this one was forgotten... r? `@notriddle`
2023-08-04Rollup merge of #114373 - xstaticxgpx:dev, r=the8472Matthias Krüger-4/+14
unix/kernel_copy.rs: copy_file_range_candidate allows empty output files This is for https://github.com/rust-lang/rust/issues/114341 The `meta.len() > 0` condition here is intended for inputs only, ie. when input is in the `/proc` filesystem as documented. That inaccurately included empty output files which are then shunted to the sendfile() routine leading to higher than nescessary IO util in some cases, specifically with CoW filesystems like btrfs. Simply, determine what is input or output given the passed boolean.
2023-08-04Rollup merge of #114348 - GuillaumeGomez:migrate-gui-test-color-25, r=notriddleMatthias Krüger-43/+30
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? `@notriddle`
2023-08-04Rollup merge of #113999 - Centri3:macro-arm-expand, r=wesleywiserMatthias Krüger-24/+246
Specify macro is invalid in certain contexts Adds a note when a macro is used where it really shouldn't be. Closes #113766
2023-08-04Rollup merge of #113534 - oli-obk:simd_shuffle_dehackify, r=workingjubileeMatthias Krüger-380/+393
Forbid old-style `simd_shuffleN` intrinsics Don't merge before https://github.com/rust-lang/packed_simd/pull/350 has made its way to crates.io We used to support specifying the lane length of simd_shuffle ops by attaching the lane length to the name of the intrinsic (like `simd_shuffle16`). After this PR, you cannot do that anymore, and need to instead either rely on inference of the `idx` argument type or specify it as `simd_shuffle::<_, [u32; 16], _>`. r? `@workingjubilee`
2023-08-04Auto merge of #114305 - lqd:bootstrap-strip, r=ozkanonurbors-11/+63
Strip unexpected debuginfo from `libLLVM.so` and `librustc_driver.so` when not requesting any debuginfo As seen in #114175 and in [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Artifact.20sizes/near/379302655), there's still some small amount of debuginfo in LLVM's shared library on linux, even when not requesting it (nightly CI), coming from `libstdc++`. ``` $ readelf --debug-dump=info ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM-16-rust-1.73.0-nightly.so | grep DW_TAG_compile_unit -A5 | grep DW_AT_comp_dir | cut -d ":" -f 2- | counts 101 counts ( 1) 39 (38.6%, 38.6%): (indirect string, offset: 0x7): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++ ( 2) 38 (37.6%, 76.2%): (indirect string, offset: 0x43fb2): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11 ( 3) 23 (22.8%, 99.0%): (indirect string, offset: 0x18ed8): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++98 ( 4) 1 ( 1.0%,100.0%): (indirect string, offset: 0x53f04): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src ``` Similarly, here's `librustc_driver.so` when not requesting debuginfo from either rustc or the tools (nightly CI), coming e.g. from our LLVM wrapper: ``` $ readelf --debug-dump=info ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e534b3a316089f5f.so | grep DW_TAG_compile_unit -A5 | grep DW_AT_comp_dir | cut -d ":" -f 2- | counts 116 counts ( 1) 34 (29.3%, 29.3%): (indirect string, offset: 0x3c11): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++ ( 2) 32 (27.6%, 56.9%): (indirect string, offset: 0x9753c): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11 ( 3) 25 (21.6%, 78.4%): (indirect string, offset: 0x393bd): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++98 ( 4) 23 (19.8%, 98.3%): (indirect string, offset: 0x33ed3): /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.98 ( 5) 1 ( 0.9%, 99.1%): (indirect string, offset: 0xaffff): /rustc/0d95f9132909ae7c5f2456748d0ffd1c3ba4a8e8 ( 6) 1 ( 0.9%,100.0%): (indirect string, offset: 0xb604a): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src ``` To reduce the size of distributed artifacts, this PR strips debuginfo from the LLVM and `rustc_driver` shared libraries, when: - no debuginfo is requested when building LLVM: `link-shared` is true, `optimize` is true and `release-debuginfo` is false - no debuginfo is requested when building the rustc driver: - `debuginfo-level-rustc` and `debuginfo-level-tools` are off. - when building with a stage != 0 compiler: since this is about the distributed artifacts, there's no need to do this at other stages. - for both: on a x64 linux host and target where `strip -g` is available and fixes the issue (I don't know how to strip debuginfo from a `.dylib` on mac). The LLVM BOLTed .so, and `librustc_driver.so` are big there, and this will help a little. Other targets/hosts can be added in the future if we want to. #114175 did the same thing unconditionally in `opt-dist`, prior to BOLTing LLVM. But this should only be used in conjunction with the other config options mentioned above, and which `opt-dist` doesn't know about. Therefore, it makes more sense as in bootstrap when building LLVM and rustc when applicable and no debuginfo is requested. This shouldn't interact badly with CI caching builds and artifacts, right? --- From the other PR, `libLLVM-16-rust-1.73.0-nightly.so` prior to #114141: - master: 173.13 MiB - stripped debuginfo: 165.12 MiB (-8 MiB, -4.6%) `libLLVM-16-rust-1.73.0-nightly.so` after #114141: - master: 121.13 MiB - stripped debuginfo: 113.12 MiB (still -8 MiB, -6.6%) `librustc_driver.so`: - master: 118.58 MiB - stripped debuginfo: 106.46 MiB (-12 MiB, -10.2%) (Results are also available in this most recent [perf run's artifact sizes](https://perf.rust-lang.org/compare.html?start=b321edd1b2d4bd00c7b4611e8f20a03ee7b77023&end=810ab570d5d27facb91806e5d9847815d9dac22a&stat=instructions%3Au&tab=artifact-size))
2023-08-04Auto merge of #110833 - compiler-errors:rustc-call-inliner-ice, r=cjgillotbors-159/+255
Only unpack tupled args in inliner if we expect args to be unpacked `"rust-call"` is a strange function abi. sometimes, it expects the arguments to be unpacked by the caller and passed as individual args (closure bodies), and sometimes it does not (user functions annotated with the `"rust-call"` abi). make sure the mir inliner respects this difference when checking that arguments are compatible, and doesn't try to ICE when we call a `extern "rust-call"` function in a generic context. fixes #110829
2023-08-03unix/kernel_copy.rs: copy_file_range_candidate allows empty output filesxstaticxgpx-4/+14
This is for https://github.com/rust-lang/rust/issues/114341 The `meta.len() > 0` condition here is intended for inputs only, ie. when input is in the `/proc` filesystem as documented. That inaccurately included empty output files which are then shunted to the sendfile() routine leading to higher than nescessary IO util in some cases, specifically with CoW filesystems like btrfs. Further, `NoneObtained` is not relevant in this context, so remove it. Simply, determine what is input or output given the passed enum Unit.
2023-08-03Auto merge of #108955 - Nilstrieb:dont-use-me-pls, r=oli-obkbors-49/+209
Add `internal_features` lint Implements https://github.com/rust-lang/compiler-team/issues/596 Also requires some more test blessing for codegen tests etc `@jyn514` had the idea of just `allow`ing the lint by default in the test suite. I'm not sure whether this is a good idea, but it's definitely one worth considering. Additional input encouraged.
2023-08-03A bit of spell-checkingBen Kimock-7/+7
2023-08-03Auto merge of #114424 - matthiaskrgr:rollup-cegblvo, r=matthiaskrgrbors-685/+1229
Rollup of 8 pull requests Successful merges: - #113657 (Expand, rename and improve `incorrect_fn_null_checks` lint) - #114237 (parser: more friendly hints for handling `async move` in the 2015 edition) - #114300 (Suggests turbofish in patterns) - #114372 (const validation: point at where we found a pointer but expected an integer) - #114395 ([rustc_span][perf] Hoist lookup sorted by words out of the loop.) - #114403 (fix the span in the suggestion of remove question mark) - #114408 (Temporary remove myself from review rotation) - #114415 (Skip checking of `rustc_codegen_gcc` with vendoring enabled) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-03Enable tests on rustc_codegen_ssaEric Huss-3/+0
2023-08-03compiletest: Handle non-utf8 paths (fix FIXME)Martin Nordholts-10/+14
2023-08-03blessMichael Goulet-0/+79
2023-08-03Explicitly don't inline user-written rust-call fnsMichael Goulet-201/+102
2023-08-03Only unpack tupled args in inliner if we expect args to be unpackedMichael Goulet-12/+89
2023-08-03Negative test for inlining `<Box<dyn Fn()> as Fn<()>>::call`Michael Goulet-0/+39
2023-08-03Auto merge of #114420 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo (CVE-2023-38497 fix included) 2 commits in 020651c52257052d28f6fd83fbecf5cfa1ed516c..d78bbf4bde3c6b95caca7512f537c6f9721426ff 2023-08-02 16:00:37 +0000 to 2023-08-03 12:58:25 +0000 - Fix CVE-2023-38497 for master (rust-lang/cargo#12443) - Don't attempt to read a token from stdin if a cmdline token is provided (rust-lang/cargo#12440) r? `@ghost`
2023-08-03Rollup merge of #114415 - Kobzol:bootstrap-check-vendor-gcc, r=ozkanonurMatthias Krüger-0/+6
Skip checking of `rustc_codegen_gcc` with vendoring enabled `rustc_codegen_gcc` currently cannot be vendored, which [breaks](https://github.com/rust-lang/rust/issues/112393) `x.py check` with vendoring enabled. Until the vendoring issue is resolved, it would be nice if `x.py check` could succeed (and just skip `gcc`) with `vendor = true`. With this PR, it does. Related issue: https://github.com/rust-lang/rust/issues/112393 r? bootstrap
2023-08-03Rollup merge of #114408 - WaffleLapkin:waffle-on-vacation, r=wesleywiserMatthias Krüger-1/+1
Temporary remove myself from review rotation I'm going on vacation from 7-th to 15-th and won't be reviewing PRs or writing code. Feel free to still ping me if you want, I'll read everything when I'm back, but most likely not sooner =)
2023-08-03Rollup merge of #114403 - bvanjoi:fix-114392, r=estebankMatthias Krüger-1/+32
fix the span in the suggestion of remove question mark Fixes #114392 Use a more precise span.
2023-08-03Rollup merge of #114395 - ttsugriy:hoist-lookup, r=lqdMatthias Krüger-1/+2
[rustc_span][perf] Hoist lookup sorted by words out of the loop. ```@lqd``` commented on https://github.com/rust-lang/rust/pull/114351 asking if `sort_by_words(lookup)` is computed repeatedly. I was assuming that rustc should have no difficulties to hoist it automatically outside of the loop to avoid repeated pure computation, but according to https://godbolt.org/z/frs8Kj1rq it seems like I was wrong: original version seems to have 2 calls per loop iteration ``` .LBB16_3: mov rbx, qword ptr [r13] mov r14, qword ptr [r13 + 8] lea rdi, [rsp + 40] mov rsi, rbx mov rdx, r14 call example::sort_by_words lea rdi, [rsp + 64] mov rsi, qword ptr [rsp + 8] mov rdx, qword ptr [rsp + 16] call example::sort_by_words mov rdi, qword ptr [rsp + 40] mov rdx, qword ptr [rsp + 56] mov rsi, qword ptr [rsp + 64] cmp rdx, qword ptr [rsp + 80] mov qword ptr [rsp + 32], rdi mov qword ptr [rsp + 24], rsi jne .LBB16_5 call qword ptr [rip + bcmp@GOTPCREL] test eax, eax sete al mov dword ptr [rsp + 4], eax mov rsi, qword ptr [rsp + 72] test rsi, rsi jne .LBB16_8 jmp .LBB16_9 ``` but the manually hoisted version just 1: ``` .LBB16_3: mov r13, qword ptr [r15] mov r14, qword ptr [r15 + 8] lea rdi, [rsp + 64] mov rsi, r13 mov rdx, r14 call example::sort_by_words mov rdi, qword ptr [rsp + 64] mov rdx, qword ptr [rsp + 16] cmp qword ptr [rsp + 80], rdx mov qword ptr [rsp + 32], rdi jne .LBB16_5 mov rsi, qword ptr [rsp + 8] call qword ptr [rip + bcmp@GOTPCREL] test eax, eax sete bpl mov rsi, qword ptr [rsp + 72] test rsi, rsi jne .LBB16_8 jmp .LBB16_9 ``` This code is probably not very hot, but there is no reason to leave such a low hanging fruit.
2023-08-03Rollup merge of #114372 - RalfJung:const-pointer-as-int, r=oli-obkMatthias Krüger-411/+547
const validation: point at where we found a pointer but expected an integer Instead of validation just printing "unable to turn pointer into bytes", make this a regular validation error that says where in the value the bad pointer was found. Also distinguish "expected integer, got pointer" from "expected pointer, got partial pointer or mix of pointers". To avoid duplicating things too much I refactored the diagnostics for validity a bit, so that "got uninit, expected X" and "got pointer, expected X" can share the "X" part. Also all the errors emitted for validation are now grouped under `const_eval_validation` so that they are in a single group in the ftl file. r? `@oli-obk`
2023-08-03Rollup merge of #114300 - MU001999:fix/turbofish-pat, r=estebankMatthias Krüger-42/+125
Suggests turbofish in patterns Fixes #114112 r? ```@estebank```
2023-08-03Rollup merge of #114237 - bvanjoi:fix-114219, r=cjgillotMatthias Krüger-4/+32
parser: more friendly hints for handling `async move` in the 2015 edition Fixes #114219 An error is emitted when encountering an async move block in the 2015 edition. Another appropriate location to raise an error is after executing [let path = this.parse_path(PathStyle::Expr)?](https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/stmt.rs#L152), but it seems somewhat premature to invoke `create_err` at that stage.
2023-08-03Rollup merge of #113657 - Urgau:expand-incorrect_fn_null_check-lint, r=cjgillotMatthias Krüger-225/+484
Expand, rename and improve `incorrect_fn_null_checks` lint This PR, - firstly, expand the lint by now linting on references - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks` - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut` Fixes https://github.com/rust-lang/rust/issues/113601 cc ```@est31```
2023-08-03strip librustc_driver.so even at stage 1Rémy Rakic-4/+2
2023-08-03Update cargoWeihang Lo-0/+0
2023-08-03Skip checking of `rustc_codegen_gcc` with vendoring enabledJakub Beránek-0/+6
2023-08-03Add `internal_features` lintNilstrieb-49/+209
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-08-03Auto merge of #3009 - oli-obk:auto_actions, r=oli-obkbors-9/+16
Avoid infinite recursion for auto-fmt and auto-clippy I got stack overflows after I fixed the `-`/`_` typo 😆
2023-08-03Auto merge of #3010 - RalfJung:assign_overlapping, r=RalfJungbors-0/+9
add test checking that overlapping assignments work
2023-08-03add test checking that overlapping assignments workRalf Jung-0/+9
2023-08-03builtin impl confirmation wuhulcnr-23/+17
2023-08-03Auto merge of #113199 - b-naber:slice-pattern-type-inference, r=lcnrbors-105/+489
Infer type in irrefutable slice patterns with fixed length as array Fixes https://github.com/rust-lang/rust/issues/76342 In irrefutable slice patterns with a fixed length, we can infer the type as an array type. We now choose to prefer some implementations over others, e.g. in: ``` struct Zeroes; const ARR: [usize; 2] = [0; 2]; const ARR2: [usize; 2] = [2; 2]; impl Into<&'static [usize; 2]> for Zeroes { fn into(self) -> &'static [usize; 2] { &ARR } } impl Into<&'static [usize]> for Zeroes { fn into(self) -> &'static [usize] { &ARR2 } } fn main() { let &[a, b] = Zeroes.into(); } ``` We now prefer the impl candidate `impl Into<&'static [usize; 2]> for Zeroes`, it's not entirely clear to me that this is correct, but given that the slice impl would require a type annotation anyway, this doesn't seem unreasonable. r? `@lcnr`
2023-08-03Avoid infinite recursion for auto-fmt and auto-clippyOli Scherer-9/+16
2023-08-03Reduce arbitrary self type suggestionsr0cky-32/+15
2023-08-03Auto merge of #112043 - ↵bors-10/+314
jieyouxu:suggestion_macro_expansion_source_callsites, r=cjgillot Fix suggestion spans for expr from macro expansions ### Issue #112007: rustc shows expanded `writeln!` macro in code suggestion #### Before This PR ``` help: consider using a semicolon here | 6 | }; | + help: you might have meant to return this value --> C:\Users\hayle\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\macros\mod.rs:557:9 | 55| return $dst.write_fmt($crate::format_args_nl!($($arg)*)); | ++++++ + ``` #### After This PR ``` help: consider using a semicolon here | LL | }; | + help: you might have meant to return this value | LL | return writeln!(w, "but not here"); | ++++++ + ``` ### Issue #110017: `format!` `.into()` suggestion deletes the `format` macro #### Before This PR ``` help: call `Into::into` on this expression to convert `String` into `Box<dyn std::error::Error>` --> /Users/eric/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/macros.rs:121:12 | 12| res.into() | +++++++ ``` #### After This PR ``` help: call `Into::into` on this expression to convert `String` into `Box<dyn std::error::Error>` | LL | Err(format!("error: {x}").into()) | +++++++ ``` --- Fixes #112007. Fixes #110017.
2023-08-03Forbid old-style `simd_shuffleN` intrinsicsOli Scherer-380/+393
2023-08-03Migrate GUI colors test to original CSS color formatGuillaume Gomez-1/+1
2023-08-03Also add label with original type for function pointersUrgau-13/+40
2023-08-03Avoid too many expected symbols and reduce `None`sr0cky-64/+58