about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-08-07Rollup merge of #114496 - taiki-e:sparc32-atomic, r=AmanieuMatthias Krüger-1/+1
Set max_atomic_width for sparc-unknown-linux-gnu to 32 This is currently set to 64 https://github.com/rust-lang/rust/blob/90f0b24ad3e7fc0dc0e419c9da30d74629cd5736/compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs#L8 However, AFAIK, this architecture doesn't support 64-bit atomics, and LLVM generates libcalls: https://godbolt.org/z/chzThWGG1 (Currently, attempts to run `cargo test` for this target result in "undefined reference to `__sync_val_compare_and_swap_8'" error. https://github.com/taiki-e/rust-cross-toolchain/commit/02efe1e74f2280f06662eaf275690883b2f9c7ae) r? `@Amanieu`
2023-08-07Rollup merge of #114495 - taiki-e:avr-atomic, r=AmanieuMatthias Krüger-1/+1
Set max_atomic_width for AVR to 16 This is currently set to 0 https://github.com/rust-lang/rust/blob/90f0b24ad3e7fc0dc0e419c9da30d74629cd5736/compiler/rustc_target/src/spec/avr_gnu_base.rs#L26-L27 However, LLVM supports {8,16}-bit atomic load/store on AVR (support for RMW is still quite incomplete and only partially supported). https://github.com/llvm/llvm-project/blob/llvmorg-15.0.0/llvm/test/CodeGen/AVR/atomics/load8.ll#L5-L13 https://github.com/llvm/llvm-project/blob/llvmorg-15.0.0/llvm/test/CodeGen/AVR/atomics/load16.ll#L3-L12 https://github.com/llvm/llvm-project/blob/llvmorg-15.0.0/llvm/test/CodeGen/AVR/atomics/store.ll#L3-L22 cc #99668 r? `@Amanieu`
2023-08-07Rollup merge of #114485 - spastorino:add-trait-decls, r=oli-obkMatthias Krüger-17/+98
Add trait decls to SMIR r? `@oli-obk` Closes https://github.com/rust-lang/project-stable-mir/issues/20
2023-08-07Rollup merge of #114196 - compiler-errors:bubble-pls, r=lcnrMatthias Krüger-23/+44
Bubble up nested goals from equation in `predicates_for_object_candidate` This used to be needed for https://github.com/rust-lang/rust/pull/114036#discussion_r1273987510, but since it's no longer, I'm opening this as a separate PR. This also fixes one ICEing UI test: (`tests/ui/unboxed-closures/issue-53448.rs`) r? `@lcnr`
2023-08-07Rollup merge of #113568 - ferrocene:pa-spurious-weak-lang-item-2, r=b-naberMatthias Krüger-6/+6
Fix spurious test failure with `panic=abort` Description on why it happens and why the fix should work is in the code comments.
2023-08-07change test to use `if black_box(false)`Pietro Albini-14/+6
2023-08-07Add TraitDef::trait_decl methodSantiago Pastorino-0/+6
2023-08-07Add all_trait_decls to SMIRSantiago Pastorino-0/+12
2023-08-07Convert trait declaration to SMIRSantiago Pastorino-4/+76
2023-08-07Convert unsafety using the stable method and reuse mir::SafetySantiago Pastorino-13/+4
2023-08-07Auto merge of #114576 - lnicola:sync-from-ra, r=lnicolabors-1042/+4248
:arrow_up: `rust-analyzer` r? `@ghost`
2023-08-07Merge commit 'baee6b338b0ea076cd7a9f18d47f175dd2ba0e5d' into sync-from-raLaurențiu Nicola-1042/+4248
2023-08-07Auto merge of #114560 - RalfJung:miri, r=RalfJungbors-778/+1645
update Miri
2023-08-07Auto merge of #114569 - matthiaskrgr:rollup-p8tcxtz, r=matthiaskrgrbors-393/+439
Rollup of 8 pull requests Successful merges: - #98935 (Implement `Option::take_if`) - #114093 (Add regression test for `echo 'mod unknown;' | rustc -`) - #114229 (Nest tests/codegen/sanitizer*.rs tests in sanitizer dir) - #114230 (Nest other codegen test topics) - #114362 (string.rs: remove "Basic usage" text) - #114365 (str.rs: remove "Basic usage" text) - #114382 (Add a new `compare_bytes` intrinsic instead of calling `memcmp` directly) - #114549 (Style fix and refactor on resolve diagnostics) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-07Rollup merge of #114549 - chenyukang:yukang-review-resolve-part, r=petrochenkovMatthias Krüger-61/+53
Style fix and refactor on resolve diagnostics - coding style - refactor api of `span_look_ahead`
2023-08-07Rollup merge of #114382 - scottmcm:compare-bytes-intrinsic, r=cjgillotMatthias Krüger-22/+270
Add a new `compare_bytes` intrinsic instead of calling `memcmp` directly As discussed in #113435, this lets the backends be the place that can have the "don't call the function if n == 0" logic, if it's needed for the target. (I didn't actually *add* those checks, though, since as I understood it we didn't actually need them on known targets?) Doing this also let me make it `const` (unstable), which I don't think `extern "C" fn memcmp` can be. cc `@RalfJung` `@Amanieu`
2023-08-07Rollup merge of #114365 - tshepang:patch-6, r=Mark-SimulacrumMatthias Krüger-6/+0
str.rs: remove "Basic usage" text Only one example is given
2023-08-07Rollup merge of #114362 - tshepang:patch-1, r=Mark-SimulacrumMatthias Krüger-72/+1
string.rs: remove "Basic usage" text Only a single example is given
2023-08-07Rollup merge of #114230 - workingjubilee:codegen-tests-that-nest, ↵Matthias Krüger-178/+0
r=Mark-Simulacrum Nest other codegen test topics This PR is like rust-lang/rust#114229 in that it mostly pushes codegen tests around, shoving them into their own directories, but because all of the changes are very simple cleanups I pulled them into a separate PR. The other PR might involve actually evaluating the correctness of the test after changes, but here it is mostly a matter of taste. The only "functional" change is deleting a few tests that... hinge on a version of LLVM that we don't support (as of rust-lang/rust#114148 anyways). I considered a few different ways to group other topics but I feel the question of whether `tests/codegen/{vec,array,slice}` should exist is more subtle than these choices, as it might be better to group such related tests by other topics like bounds check elision, thus I avoided making it.
2023-08-07Rollup merge of #114229 - workingjubilee:nest-sanitizer-dir, r=Mark-SimulacrumMatthias Krüger-54/+54
Nest tests/codegen/sanitizer*.rs tests in sanitizer dir The sanitizer tests are the largest and most meticulously tested set of tests in tests/codegen. That's good! They all clearly belong to a subject and thus could go in a directory, but are not, instead being placed simply in tests/codegen. That's bad! Fix this by placing them in their own directory and renaming them to be less repetitive after that move. A few tests are brittle, and embed their filename in the test's checks. This is acceptable for the ones where it is used only two times, but one test embeds the test's mangled filename in the test *over 50 times*! This may have been one of the things discouraging anyone from moving it, and thus from moving the set. Fortunately, I have some knowledge of Itanium mangling (involuntarily), regex, and the FileCheck syntax. With a capturing variable, FileCheck allows us to now move this test around again without diffing it on ~50 lines, while still guaranteeing that the mangled substring is the same each time. This also clarifies why the substring is repeated a zillion times, instead of being cryptic. They don't call it mangling because the result is pretty and easy to understand, but now it is slightly easier! Yay descriptive variables!
2023-08-07Rollup merge of #114093 - Enselic:stdin-unknown-mod, r=Mark-SimulacrumMatthias Krüger-0/+26
Add regression test for `echo 'mod unknown;' | rustc -` Closes #65601 The bug is fixed since long ago, probably by #69838 (see https://github.com/rust-lang/rust/issues/65601#issuecomment-1650508071 for more details). Add a regression test so we can close the issue.
2023-08-07Rollup merge of #98935 - kellerkindt:option_retain, r=Mark-SimulacrumMatthias Krüger-0/+35
Implement `Option::take_if` Tracking issue: #98934 ACP: rust-lang/libs-team#70 [accepted]
2023-08-07Auto merge of #114206 - sethp:patch-1, r=Mark-Simulacrumbors-1/+1
fix(ci): Ensure idempotence of user creation Previously, re-running `run.sh` in the same container would fail at the useradd step, because the user already exists. Instead, change that step to "create if not exists" semantics to ease interactive debugging of CI failures. Split out from https://github.com/rust-lang/rust/pull/111891 per request by `@jackh726`
2023-08-07Auto merge of #112916 - tgross35:patch-1, r=Mark-Simulacrumbors-3/+15
Add more context to `quit_if_file_exists` in `configure.py` & delete config.toml in CI If the `obj` directory isn't empty, the error message is subtle and not very helpful: ``` == clock drift check == local time: Sun Jul 2 00:57:06 UTC 2023 network time: Sun, 02 Jul 2023 00:57:06 GMT == end clock drift check == sccache: Starting the server... configure: error: Existing 'config.toml' detected. == clock drift check == local time: Sun Jul 2 00:57:06 UTC 2023 network time: Sun, 02 Jul 2023 00:57:06 GMT == end clock drift check == ``` This makes it stand out and suggests how to resolve the issue: ``` == clock drift check == local time: Sun Jul 2 02:11:30 UTC 2023 network time: Sun, 02 Jul 2023 02:11:31 GMT == end clock drift check == sccache: Starting the server... configure: ERROR: Existing 'config.toml' detected. Exiting Is objdir '/home/tmgross/projects/rust/obj' clean? == clock drift check == local time: Sun Jul 2 02:11:31 UTC 2023 network time: Sun, 02 Jul 2023 02:11:31 GMT == end clock drift check == ```
2023-08-06Auto merge of #114565 - matthiaskrgr:rollup-p7cjs3m, r=matthiaskrgrbors-123/+103
Rollup of 6 pull requests Successful merges: - #114535 (bump schannel, miow to drop windows-sys 0.42) - #114542 (interpret: use ConstPropNonsense for more const-prop induced issues) - #114543 (add tests for some fixed ConstProp ICEs) - #114550 (Generate better function argument names in global_allocator expansion) - #114556 (Issue numbers are enforced on active features; remove FIXME) - #114558 (Remove FIXME about NLL diagnostic that is already improved) Failed merges: - #114485 (Add trait decls to SMIR) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-06Apply suggestions from code reviewscottmcm-0/+3
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-08-06Add a new `compare_bytes` intrinsic instead of calling `memcmp` directlyScott McMurray-22/+267
2023-08-07Rollup merge of #114558 - Enselic:lifetime-diagnostic-fixed, r=cjgillotMatthias Krüger-3/+1
Remove FIXME about NLL diagnostic that is already improved The FIXME was added in #46984 when the diagnostic message looked like this: // FIXME(#46983): error message should be better &s.0 //~ ERROR free region `` does not outlive free region `'static` The message was improved in #90667 and now looks like this: &s.0 //~ ERROR lifetime may not live long enough but the FIXME was not removed. The issue #46983 about that diagnostics should be improved has been closed. We can remove the FIXME now. (This PR was made for #44366.)
2023-08-07Rollup merge of #114556 - Enselic:issue-numbers-enforced, r=compiler-errorsMatthias Krüger-2/+0
Issue numbers are enforced on active features; remove FIXME Since https://github.com/rust-lang/rust/pull/51090 tidy enforces that active features have an issue number, so remove the FIXME. This PR is part of #44366 which is E-help-wanted.
2023-08-07Rollup merge of #114550 - dtolnay:globalalloc, r=compiler-errorsMatthias Krüger-30/+37
Generate better function argument names in global_allocator expansion Generated code for `#[global_allocator] static ALLOCATOR: Allocator = Allocator;`&mdash; **Before:** ```rust const _: () = { #[rustc_std_internal_symbol] unsafe fn __rust_alloc(arg0: usize, arg1: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(arg0, arg1), ) } #[rustc_std_internal_symbol] unsafe fn __rust_dealloc(arg0: *mut u8, arg1: usize, arg2: usize) -> () { ::core::alloc::GlobalAlloc::dealloc( &ALLOCATOR, arg0, ::core::alloc::Layout::from_size_align_unchecked(arg1, arg2), ) } #[rustc_std_internal_symbol] unsafe fn __rust_realloc( arg0: *mut u8, arg1: usize, arg2: usize, arg3: usize, ) -> *mut u8 { ::core::alloc::GlobalAlloc::realloc( &ALLOCATOR, arg0, ::core::alloc::Layout::from_size_align_unchecked(arg1, arg2), arg3, ) } #[rustc_std_internal_symbol] unsafe fn __rust_alloc_zeroed(arg0: usize, arg1: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc_zeroed( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(arg0, arg1), ) } }; ``` **After:** ```rust const _: () = { #[rustc_std_internal_symbol] unsafe fn __rust_alloc(size: usize, align: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(size, align), ) } #[rustc_std_internal_symbol] unsafe fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize) -> () { ::core::alloc::GlobalAlloc::dealloc( &ALLOCATOR, ptr, ::core::alloc::Layout::from_size_align_unchecked(size, align), ) } #[rustc_std_internal_symbol] unsafe fn __rust_realloc( ptr: *mut u8, size: usize, align: usize, new_size: usize, ) -> *mut u8 { ::core::alloc::GlobalAlloc::realloc( &ALLOCATOR, ptr, ::core::alloc::Layout::from_size_align_unchecked(size, align), new_size, ) } #[rustc_std_internal_symbol] unsafe fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8 { ::core::alloc::GlobalAlloc::alloc_zeroed( &ALLOCATOR, ::core::alloc::Layout::from_size_align_unchecked(size, align), ) } }; ```
2023-08-07Rollup merge of #114543 - RalfJung:test-96944, r=compiler-errorsMatthias Krüger-0/+33
add tests for some fixed ConstProp ICEs Fixes https://github.com/rust-lang/rust/issues/96944 Fixes https://github.com/rust-lang/rust/issues/111353
2023-08-07Rollup merge of #114542 - RalfJung:const-prop-nonsense, r=compiler-errorsMatthias Krüger-4/+5
interpret: use ConstPropNonsense for more const-prop induced issues
2023-08-07Rollup merge of #114535 - klensy:windows-sys-0-42, r=compiler-errorsMatthias Krüger-84/+27
bump schannel, miow to drop windows-sys 0.42 Changes contains almost only of update to windows-sys 0.48 https://github.com/steffengy/schannel-rs/compare/v0.1.21...v0.1.22 https://github.com/yoshuawuyts/miow/compare/v0.5.0...v0.6.0
2023-08-06Auto merge of #114502 - cjgillot:steal-ctfe, r=oli-obkbors-1/+8
Steal MIR for CTFE when possible. Some bodies, like constants, have CTFE MIR but no optimized MIR. In that case, have `mir_for_ctfe` steal the MIR instead of cloning it.
2023-08-06Auto merge of #114553 - matthiaskrgr:rollup-5yddunv, r=matthiaskrgrbors-46/+82
Rollup of 5 pull requests Successful merges: - #114466 (Add Allocation to SMIR) - #114505 (Add documentation to has_deref) - #114519 (use offset_of! to calculate dirent64 field offsets) - #114537 (Migrate GUI colors test to original CSS color format) - #114539 (linkchecker: Remove unneeded FIXME about intra-doc links) Failed merges: - #114485 (Add trait decls to SMIR) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-06Remove FIXME about NLL diagnostic that is already improvedMartin Nordholts-3/+1
The FIXME was added in 46984 when the diagnostic message looked like this: // FIXME(#46983): error message should be better &s.0 //~ ERROR free region `` does not outlive free region `'static` The message was improved in 90667 and now looks like this: &s.0 //~ ERROR lifetime may not live long enough but the FIXME was not removed. The issue 46983 about that diagnostics should be improved has been closed. We can remove the FIXME now.
2023-08-06Auto merge of #15406 - lowr:fix/panic-missing-impl-self-ty, r=lnicolabors-5/+34
Don't provide `generate_default_from_new` when impl self ty is missing Also don't provide the assist when the `Default` trait can't be found. Part of #15398
2023-08-07Don't provide `generate_default_from_new` when impl self ty is missingRyo Yoshida-5/+34
Also don't provide the assist when the `Default` trait can't be found.
2023-08-06Auto merge of #114516 - cjgillot:direct-module-parent, r=compiler-errorsbors-21/+15
parent_module_from_def_id does not need to be a query. r? `@ghost`
2023-08-06Issue numbers are enforced on active features; remove FIXMEMartin Nordholts-2/+0
2023-08-06Rollup merge of #114539 - Enselic:unneeded-fixme, r=ehussMatthias Krüger-1/+0
linkchecker: Remove unneeded FIXME about intra-doc links It was added by https://github.com/rust-lang/rust/pull/77971 but the adder [proposed](https://github.com/rust-lang/rust/pull/77971#issuecomment-710026798) that the added code is a good fallback to have in case rustdoc gets buggy, and I agree. So remove the FIXME. This PR is part of #44366 which is E-help-wanted. r? `@jyn514` since you added the FIXME `@rustbot` label T-dev-tools
2023-08-06Rollup merge of #114537 - GuillaumeGomez:migrate-gui-test-color-29, r=notriddleMatthias Krüger-3/+3
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ``@notriddle``
2023-08-06Rollup merge of #114519 - the8472:dirent-offset-of, r=dtolnayMatthias Krüger-25/+3
use offset_of! to calculate dirent64 field offsets r? `@dtolnay`
2023-08-06Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJungMatthias Krüger-17/+23
Add documentation to has_deref Documentation of `has_deref` needed some polish to be more clear about where it should be used and what's it's purpose. cc https://github.com/rust-lang/rust/issues/114401 r? `@RalfJung`
2023-08-06Rollup merge of #114466 - ouz-a:smir_allocation, r=oli-obkMatthias Krüger-0/+53
Add Allocation to SMIR As it's discussed [here ](https://rust-lang.zulipchat.com/#narrow/stream/320896-project-stable-mir/topic/Representing.20Constants.20in.20smir)this is an attempt to cover Constants for smir in a different way compared to https://github.com/rust-lang/rust/pull/114342 cc https://github.com/rust-lang/project-stable-mir/issues/15 r? ``@oli-obk``
2023-08-06Auto merge of #113648 - aliemjay:opaque-binder-ice, r=oli-obkbors-31/+27
don't replace opaque types under binders with infer vars Fixes an ICE in the ui test code. Fixes #109636 Fixes #109281 Fixes #86800 r? `@oli-obk`
2023-08-06refactor on span_look_aheadyukang-33/+28
2023-08-06Generate better function argument names in global_allocator expansionDavid Tolnay-30/+37
2023-08-06cleanup misinformation regarding has_derefouz-a-17/+23
2023-08-06interpret: use ConstPropNonsense for more const-prop induced issuesRalf Jung-4/+5