Commit Graph

230758 Commits

Author SHA1 Message Date
Ralf Jung
9d3e35ceaa Add tests for #102403 and #113407 2023-07-26 13:31:54 -04:00
yukang
98dd81e4e3 Add test case for #109567 2023-07-26 13:31:54 -04:00
bors
601a34de8c Auto merge of #113457 - davidtwco:lint-ctypes-issue-113436, r=oli-obk
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-26 15:27:36 +00:00
Eric Huss
9914ae3292 Squelch a noisy rustc_expand unittest 2023-07-26 08:12:08 -07:00
klensy
31630859cc replace atty crate with std's isTerminal 2023-07-26 18:09:50 +03:00
Wesley Wiser
47a4484a78 Remove unused NCSA license 2023-07-26 10:20:15 -04:00
Wesley Wiser
6f5d960389 Fix miri 2023-07-26 10:20:15 -04:00
Wesley Wiser
15e9f56088 Replace in-tree rustc_apfloat with the new version of the crate 2023-07-26 10:20:15 -04:00
Guillaume Gomez
51eb0c3b36 Fix regression for private in public 2023-07-26 15:29:45 +02:00
MoskalykA
48e7f3e313 Have a better file name than just the issue id 2023-07-26 15:07:57 +02:00
bors
bd9785cce8 Auto merge of #114071 - RalfJung:interpret-generic-read-write, r=oli-obk
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-26 13:06:25 +00:00
Santiago Pastorino
7af1697138
Add Bound ty to SMIR 2023-07-26 09:26:39 -03:00
Santiago Pastorino
648cf070eb
Add Param ty to SMIR 2023-07-26 09:26:39 -03:00
Bruce Mitchener
9f47ff84e3 docs: fmt::Debug*: Fix comments for finish method.
In the code sample for the `finish` method on `DebugList`,
`DebugMap`, and `DebugSet`, refer to finishing the list, map, or
set, rather than struct as it did.
2023-07-26 19:02:26 +07:00
Martin Nordholts
075a6bbef9 Regression test println!() panic message on ErrorKind::BrokenPipe
No existing test failed if the [`panic!()`][1] of the `println!()`
family of functions was removed, or if its message was changed.

So add such a test.

[1] 104f4300cf/library/std/src/io/stdio.rs (L1007-L1009)
2023-07-26 13:41:39 +02:00
Neven Villani
5a460a08ae
we correctly check that the perm is not lazy when triggering protectors 2023-07-26 13:32:54 +02:00
Neven Villani
efc2af4851
fix protectors so that all reads actually commute 2023-07-26 13:32:49 +02:00
bors
52bdc37727 Auto merge of #114054 - oli-obk:cleanups, r=estebank
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-26 11:17:35 +00:00
joboet
29e3f8b793
std: add auto traits to TAIT bound 2023-07-26 12:30:52 +02:00
Mahdi Dibaiee
7d773c3304 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
2023-07-26 10:55:51 +01:00
Ralf Jung
571e8ce777 valtree: a bit of cleanup 2023-07-26 11:45:35 +02:00
bors
6ac86bb19f Auto merge of #2991 - rust-lang:rustup-2023-07-26, r=RalfJung
Automatic sync from rustc
2023-07-26 09:09:06 +00:00
Ralf Jung
38665a12be normalize tree borrow diagnostics across targets 2023-07-26 11:08:41 +02:00
Oli Scherer
ad8303739f Bump syn dependency 2023-07-26 08:42:40 +00:00
Oli Scherer
cf325e8187 Bump syn now that it doesn't affect diagnostics anymore 2023-07-26 08:26:50 +00:00
Oli Scherer
841f8dc19f Make x test src/tools/rustfmt --bless format rustfmt with the freshly built in-tree version 2023-07-26 08:22:52 +00:00
bors
a6236fa460 Auto merge of #102757 - pcc:android-std-tests, r=workingjubilee
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-26 07:57:32 +00:00
bors
cba1df1b66 Auto merge of #2992 - RalfJung:ci, r=RalfJung
CI tweaks
2023-07-26 07:40:36 +00:00
Ralf Jung
d81ab0d917 move CI var uses after their declaration 2023-07-26 09:11:25 +02:00
Ralf Jung
b452f50317 sparse registry has been stable for a bit now 2023-07-26 09:10:50 +02:00
Ralf Jung
58cb4849d3 move nightly cron job a little earlier 2023-07-26 09:09:57 +02:00
The Miri Conjob Bot
363fce5a92 fmt 2023-07-26 06:34:30 +00:00
The Miri Conjob Bot
eb3ccfd841 Merge from rustc 2023-07-26 06:32:12 +00:00
The Miri Conjob Bot
c5b26cd3ea Preparing for merge from rustc 2023-07-26 06:24:12 +00:00
bors
cf34adb0dd Auto merge of #113583 - asquared31415:tidy_no_issue_tests, r=workingjubilee
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-26 04:35:37 +00:00
Eric Mark Martin
933fc180bd add stable NullaryOp 2023-07-26 00:22:38 -04:00
asquared31415
13e2abf6b3 add tidy check that forbids issue ui test filenames 2023-07-26 00:03:10 -04:00
Nicholas Nethercote
34b218e454 Add a comment to TokenCursor::desugar_doc_comments.
Useful information that took me some time to discern.
2023-07-26 13:38:56 +10:00
bors
98db99f5f6 Auto merge of #113928 - nicholasbishop:bishop-update-cb-4, r=workingjubilee
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-26 02:50:58 +00:00
Nicholas Nethercote
8bfc692851 Remove desugar_doc_comments arguments from TokenCursor::{inlined_,}next.
Because it's now always `self.desugar_doc_comments`.
2023-07-26 12:46:43 +10:00
Nicholas Nethercote
395e95c490 Tweak Parser::look_ahead.
It doesn't really matter what the `desugar_doc_comments` argument is
here, because in practice we never look ahead through doc comments.
Changing it to `cursor.desugar_doc_comments` will allow some follow-up
simplifications.
2023-07-26 12:44:49 +10:00
Michael Goulet
808e174dfc Don't treat negative trait predicates as always knowable 2023-07-26 01:35:51 +00:00
bors
bd1ae282f1 Auto merge of #113893 - mdibaiee:type-name-spill-flag, r=compiler-errors
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.
2023-07-26 00:46:06 +00:00
León Orell Valerian Liehr
28d40f1959
rustdoc: fix cross-crate impl-Sized 2023-07-26 02:11:35 +02:00
León Orell Valerian Liehr
f68f37d006
rustdoc: stylistic changes 2023-07-26 02:10:17 +02:00
blyxyas
654b924340 Add sym::iter_mut + sym::as_mut_ptr 2023-07-25 23:33:08 +00:00
Nicholas Nethercote
39d51bd51c Remove Parser::desugar_doc_comments.
It's currently stored twice: once in `Parser`, once in the `TokenStream`
within `Parser`. We only need the latter.
2023-07-26 09:11:18 +10:00
Amanieu d'Antras
3dbee5bc71 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.
2023-07-26 00:09:49 +01:00
bors
0dd5730e0f Auto merge of #114076 - matthiaskrgr:rollup-cpqq1n9, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #112995 (Check for `<&NotClone as Clone>::clone()` calls and suggest to add Clone trait appropriately)
 - #113578 (Don't say that a type is uncallable if its fn signature has errors in it)
 - #113661 (Double check that hidden types match the expected hidden type)
 - #114044 (factor out more stable impls)
 - #114062 (CI: split nested GHA groups instead of panicking)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-25 22:37:08 +00:00
Matthias Krüger
c80a9fa870
Rollup merge of #114062 - Kobzol:ci-group-splitting, r=Mark-Simulacrum
CI: split nested GHA groups instead of panicking

Bootstrap uses Github Actions groups to reduce clutter in CI job output. However, GHA doesn't support group nesting, and currently, when a group would be nested, bootstrap would panic. This is causing intermittent CI failures, because it's not trivial to make sure that groups won't be nested, and subtle changes in bootstrap (or even in caches being present) can cause nesting.

This PR changes the logic so that groups are never nested. Instead, when a group would be nested, the previous group is ended, and only then is the subgroup started. When the subgroup finishes, it will then restart any previously ended parent group.

r? `@Mark-Simulacrum`
2023-07-25 23:34:08 +02:00