about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-07-30refactor tests/utils a bit, and move some FS functions thereRalf Jung-112/+77
2023-07-29Auto merge of #2993 - Vanille-N:tb-protector, r=RalfJungbors-151/+264
TB: Redefine trigger condition for protectors The Coq formalization revealed that as currently implemented, read accesses did not always commute. Indeed starting from a lazily initialized `Active` protected tag, applying a foreign read then a child read produces `Frozen`, but child read then foreign read triggers UB (because the child read initializes _before_ the `Active -> Frozen`). This reformulation of when protectors trigger fixes that issue: - instead of `Active + foreign read -> Frozen` and `Active -> Frozen` when protected is UB - we do `Active + foreign read -> if protected { Disabled } else { Frozen }` There is already precedent for transitions being dependent on the presence of a protector (`Reserved + foreign read -> if protected { Frozen } else { Reserved }`), and this has the nice side-effect of simplifying the protector trigger condition to just an equality check against `Disabled` since now there is protector UB iff a protected tag becomes `Disabled`. In order not to introduce an extra `if`, it was decided that `Disabled -> Disabled` would be UB when protected, which was not the case previously. This is merely a theoretical for now because a protected `Disabled` is unreachable in the first place. The extra test is not directly related to this modification, but also checks things related to protectors and lazy initialization.
2023-07-29doc comment suggestionsNeven Villani-25/+57
2023-07-28exract a perform_access, check read-read commutation exhaustivelyNeven Villani-100/+193
2023-07-27Auto merge of #2994 - RalfJung:rustup, r=RalfJungbors-8410/+1023
Rustup
2023-07-27fmtRalf Jung-20/+11
2023-07-27Merge from rustcRalf Jung-8395/+1017
2023-07-27Preparing for merge from rustcRalf Jung-1/+1
2023-07-27Auto merge of #113708 - rcvalle:rust-cfi-fix-100778, r=compiler-errorsbors-34/+104
CFI: Fix ICE: encode_const: unexpected type [usize Fixes #100778 and #113366, and complements #106547 by adding support for encoding const parameters.
2023-07-27Auto merge of #114034 - Amanieu:riscv-atomicbool, r=thomccbors-8/+54
Optimize `AtomicBool` for target that don't support byte-sized atomics `AtomicBool` is defined to have the same layout as `bool`, which means that we guarantee that it has a size of 1 byte. However on certain architectures such as RISC-V, LLVM will emulate byte atomics using a masked CAS loop on an aligned word. We can take advantage of the fact that `bool` only ever has a value of 0 or 1 to replace `swap` operations with `and`/`or` operations that LLVM can lower to word-sized atomic `and`/`or` operations. This takes advantage of the fact that the incoming value to a `swap` or `compare_exchange` for `AtomicBool` is often a compile-time constant. ### Example ```rust pub fn swap_true(atomic: &AtomicBool) -> bool { atomic.swap(true, Ordering::Relaxed) } ``` ### Old ```asm andi a1, a0, -4 slli a0, a0, 3 li a2, 255 sllw a2, a2, a0 li a3, 1 sllw a3, a3, a0 slli a3, a3, 32 srli a3, a3, 32 .LBB1_1: lr.w a4, (a1) mv a5, a3 xor a5, a5, a4 and a5, a5, a2 xor a5, a5, a4 sc.w a5, a5, (a1) bnez a5, .LBB1_1 srlw a0, a4, a0 andi a0, a0, 255 snez a0, a0 ret ``` ### New ```asm andi a1, a0, -4 slli a0, a0, 3 li a2, 1 sllw a2, a2, a0 amoor.w a1, a2, (a1) srlw a0, a1, a0 andi a0, a0, 255 snez a0, a0 ret ```
2023-07-26Auto merge of #113843 - wesleywiser:replace_rustc_apfloat, r=pnkfelixbors-7774/+49
Replace in-tree `rustc_apfloat` with the new version of the crate Replace the in-tree version of `rustc_apfloat` with the new version of the crate which has been correctly licensed. The new crate incorporates upstream changes from LLVM since the original port was done including many correctness fixes and has been extensively fuzz tested to validate correctness. Fixes #100233 Fixes #102403 Fixes #113407 Fixes #113409 Fixes #55993 Fixes #93224 Closes #93225 Closes #109573
2023-07-26Auto merge of #114103 - matthiaskrgr:rollup-01m6l2w, r=matthiaskrgrbors-44/+122
Rollup of 7 pull requests Successful merges: - #101994 (rand: freebsd update, using getrandom.) - #113930 (Add Param and Bound ty to SMIR) - #113942 (Squelch a noisy rustc_expand unittest) - #113996 (Define CMAKE_SYSTEM_NAME on a cross build targeting DragonFly.) - #114070 (Add `sym::iter_mut` + `sym::as_mut_ptr` for Clippy) - #114073 (Remove -Z diagnostic-width) - #114090 (compiletest: remove ci-specific remap-path-prefix) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-26Rollup merge of #114090 - mdibaiee:remove-remap-path-prefix-ci, r=wesleywiserMatthias Krüger-8/+0
compiletest: remove ci-specific remap-path-prefix Now that we have fixed the underlying cause of long type name inconsistencies in #113893, we can remove the remap-path-prefix logic from CI resolves #113424
2023-07-26Rollup merge of #114073 - ehuss:remove-z-diagnostic-width, r=fee1-deadMatthias Krüger-2/+0
Remove -Z diagnostic-width This removes the `-Z diagnostic-width` option since it is ignored and does nothing. `-Z diagnostic-width` was stabilized as `--diagnostic-width` in #95635. It is not entirely clear why the `-Z` flag was kept, but in part its final use was removed in #102216, but the `-Z` flag itself was not removed.
2023-07-26Rollup merge of #114070 - blyxyas:iter_mut_symbol, r=oli-obkMatthias Krüger-3/+5
Add `sym::iter_mut` + `sym::as_mut_ptr` for Clippy We currently have `sym::iter` and `sym::iter_repeat`, this PR adds `sym::iter_mut` as it's useful for https://github.com/rust-lang/rust-clippy/pull/11038 and another Clippy lint, it also adds `sym::as_mut_ptr` as it's useful for https://github.com/rust-lang/rust-clippy/pull/10962.
2023-07-26Rollup merge of #113996 - inferiorhumanorgans:dragonfly-cmake-system-name, ↵Matthias Krüger-1/+8
r=ozkanonur Define CMAKE_SYSTEM_NAME on a cross build targeting DragonFly. Without `CMAKE_SYSTEM_NAME` set to the target a cross compile will generally fail. Related to #109170.
2023-07-26Rollup merge of #113942 - ehuss:squelch-bad_path_expr_1, r=fee1-deadMatthias Krüger-24/+57
Squelch a noisy rustc_expand unittest The test `rustc_parse::tests::bad_path_expr_1` prints an error message to stderr, circumventing libtest's stderr intercept. This causes noise when running tests, in particular they show up 16 times on the GitHub Actions summary page. The solution here is to not use an error emitter that prints to stderr, and instead check that the correct error is generated.
2023-07-26Rollup merge of #113930 - spastorino:smir-types-6, r=oli-obkMatthias Krüger-2/+34
Add Param and Bound ty to SMIR r? ``@oli-obk``
2023-07-26Rollup merge of #101994 - devnexen:rand_fbsd_update, r=workingjubileeMatthias Krüger-4/+18
rand: freebsd update, using getrandom. supported since the 12th release, while 11.4 is EOL since 2021.
2023-07-26Auto merge of #114012 - GuillaumeGomez:fix-113982, r=notriddlebors-18/+61
Fix missing attribute merge on glob foreign re-exports Fixes https://github.com/rust-lang/rust/issues/113982. The attributes were not merged with the import's in case of glob re-export of foreign items. r? `@notriddle`
2023-07-26Add tests for #102403 and #113407Ralf Jung-0/+24
2023-07-26Add test case for #109567yukang-0/+15
2023-07-26Auto merge of #113457 - davidtwco:lint-ctypes-issue-113436, r=oli-obkbors-46/+136
lint/ctypes: fix `()` return type checks Fixes #113436. `()` is normally FFI-unsafe, but is FFI-safe when used as a return type. It is also desirable that a transparent newtype for `()` is FFI-safe when used as a return type. In order to support this, when a type was deemed FFI-unsafe, because of a `()` type, and was used in return type - then the type was considered FFI-safe. However, this was the wrong approach - it didn't check that the `()` was part of a transparent newtype! The consequence of this is that the presence of a `()` type in a more complex return type would make it the entire type be considered safe (as long as the `()` type was the first that the lint found) - which is obviously incorrect. Instead, this logic is removed, and after [consultation with t-lang](https://github.com/rust-lang/rust/issues/113436#issuecomment-1640756721), I've fixed the bugs and inconsistencies and made `()` FFI-safe within types. I also refactor a function, but that's not too exciting.
2023-07-26Squelch a noisy rustc_expand unittestEric Huss-24/+57
2023-07-26Remove unused NCSA licenseWesley Wiser-15/+0
2023-07-26Fix miriWesley Wiser-10/+0
2023-07-26Replace in-tree `rustc_apfloat` with the new version of the crateWesley Wiser-7749/+10
2023-07-26Auto merge of #114071 - RalfJung:interpret-generic-read-write, r=oli-obkbors-371/+403
interpret: make read/write methods generic Instead of always having to call `into()` to convert things to `PlaceTy`/`OpTy`, make the relevant methods generic. This also means that when we read from an `MPlaceTy`, we avoid creating an intermediate `PlaceTy`. This makes it feasible to remove the `Copy` from `MPlaceTy`. All the other `*Ty` interpreter types already had their `Copy` removed a while ago so this is only consistent. (And in fact we had one function that accidentally took `MPlaceTy` instead of `&MPlaceTy`.)
2023-07-26Add Bound ty to SMIRSantiago Pastorino-1/+18
2023-07-26Add Param ty to SMIRSantiago Pastorino-1/+16
2023-07-26we correctly check that the perm is not lazy when triggering protectorsNeven Villani-0/+16
2023-07-26fix protectors so that all reads actually commuteNeven Villani-87/+59
2023-07-26Auto merge of #114054 - oli-obk:cleanups, r=estebankbors-108/+69
Split some functions with many arguments into builder pattern functions r? `@estebank` This doesn't resolve all of the ones in rustc, mostly because I need to do other cleanups in order to be able to use some builder derives from crates.io Works around https://github.com/rust-lang/rust/issues/90672 by making `x test rustfmt --bless` format itself instead of testing that it is formatted
2023-07-26compiletest: remove ci-specific remap-path-prefixMahdi Dibaiee-8/+0
Now that we have fixed the underlying cause of long type name inconsistencies in #113893, we can remove the remap-path-prefix logic from CI
2023-07-26valtree: a bit of cleanupRalf Jung-15/+15
2023-07-26Auto merge of #2991 - rust-lang:rustup-2023-07-26, r=RalfJungbors-3363/+9258
Automatic sync from rustc
2023-07-26normalize tree borrow diagnostics across targetsRalf Jung-52/+54
2023-07-26Make `x test src/tools/rustfmt --bless` format rustfmt with the freshly ↵Oli Scherer-9/+17
built in-tree version
2023-07-26Auto merge of #102757 - pcc:android-std-tests, r=workingjubileebors-0/+20
Make std tests pass on newer Android Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android if we see an EACCES from one of these syscalls. To achieve this, introduce a macro with the horrible name of or_panic_or_skip_on_android_eacces (better suggestions welcome) which skips (returns from) the test if an EACCES return value is seen on Android.
2023-07-26Auto merge of #2992 - RalfJung:ci, r=RalfJungbors-8/+5
CI tweaks
2023-07-26move CI var uses after their declarationRalf Jung-4/+4
2023-07-26sparse registry has been stable for a bit nowRalf Jung-3/+0
2023-07-26move nightly cron job a little earlierRalf Jung-1/+1
2023-07-26fmtThe Miri Conjob Bot-2/+3
2023-07-26Merge from rustcThe Miri Conjob Bot-3310/+9202
2023-07-26Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-07-26Auto merge of #113583 - asquared31415:tidy_no_issue_tests, r=workingjubileebors-6/+4329
add tidy check that forbids issue-XXXX and ice-XXXX test filenames Helps with #113345 by preventing any future tests with non-descriptive names from being added. This PR only checks modified ui test files because there are far too many existing problematic tests to be fixed at once: 3063/15424 (~19.86%) `*.rs` ui test files match `^issue[-_ ]?\d+$`. Another 1349 files, totaling ~28.60% of all ui test files, contain that pattern in addition to some other text, where they should probably omit it in favor of a comment. note: between the creation of this PR and 2023-07-25 (14 days), 10 more tests were added that failed this check. r? `@workingjubilee`
2023-07-26add tidy check that forbids issue ui test filenamesasquared31415-6/+4329
2023-07-26Auto merge of #113928 - nicholasbishop:bishop-update-cb-4, r=workingjubileebors-3/+3
Bump compiler_builtins to 0.1.98 Change list: https://github.com/rust-lang/compiler-builtins/compare/0.1.95...0.1.98
2023-07-26Auto merge of #113893 - mdibaiee:type-name-spill-flag, r=compiler-errorsbors-30/+25
new unstable option: -Zwrite-long-types-to-disk This option guards the logic of writing long type names in files and instead using short forms in error messages in rustc_middle/ty/error behind a flag. The main motivation for this change is to disable this behaviour when running ui tests. This logic can be triggered by running tests in a directory that has a long enough path, e.g. /my/very-long-path/where/rust-codebase/exists/ This means ui tests can fail depending on how long the path to their file is. Some ui tests actually rely on this behaviour for their assertions, so for those we enable the flag manually.