Commit Graph

265028 Commits

Author SHA1 Message Date
clubby789
5b96ae7106 Don't codegen expect in opt-level=0 2024-09-04 11:49:00 +00:00
bors
842d6fc32e Auto merge of #129356 - nikic:llvm19-host, r=Mark-Simulacrum
Update x86_64-linux host compiler to LLVM 19 rc 3
2024-09-04 02:55:57 +00:00
bors
d6c8169c18 Auto merge of #129922 - matthiaskrgr:rollup-4vqx8ct, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #129152 (custom/external clippy support for bootstrapping)
 - #129311 (don't copy `.rustc-dev-contents` from CI rustc)
 - #129800 (Move the Windows remove_dir_all impl into a module and make it more race resistant)
 - #129860 (update `object` dependency to remove duplicate `wasmparser`)
 - #129885 (chore: remove repetitive words)
 - #129913 (Add missing read_buf stub for x86_64-unknown-l4re-uclibc)
 - #129916 (process.rs: remove "Basic usage" text where not useful)
 - #129917 (Fix parsing of beta version in dry-run mode)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-03 05:44:18 +00:00
Matthias Krüger
29bcf8062a
Rollup merge of #129917 - Kobzol:fix-beta-git, r=Mark-Simulacrum
Fix parsing of beta version in dry-run mode

This was blocking beta release.

r? `@BoxyUwU`
2024-09-03 06:05:42 +02:00
Matthias Krüger
6e38c9bc83
Rollup merge of #129916 - tshepang:basic-usage, r=ChrisDenton
process.rs: remove "Basic usage" text where not useful

Is not useful because just a single example is given.
2024-09-03 06:05:42 +02:00
Matthias Krüger
f943c53c59
Rollup merge of #129913 - saethlin:l4re-read-buf, r=Noratrieb
Add missing read_buf stub for x86_64-unknown-l4re-uclibc

Before this PR, `x check library/std --target x86_64-unknown-l4re-uclibc` will fail with
```
error[E0599]: no method named `read_buf` found for struct `Socket` in the current scope
   --> std/src/os/unix/net/stream.rs:598:16
    |
598 |         self.0.read_buf(buf)
    |                ^^^^^^^^
    |
   ::: std/src/sys/pal/unix/l4re.rs:23:5
    |
23  |     pub struct Socket(FileDesc);
    |     ----------------- method `read_buf` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
```

This target doesn't have a maintainer to cc.
2024-09-03 06:05:42 +02:00
Matthias Krüger
afb92329dc
Rollup merge of #129885 - cuishuang:master, r=scottmcm
chore: remove repetitive words
2024-09-03 06:05:41 +02:00
Matthias Krüger
e9cd99670a
Rollup merge of #129860 - lqd:remove-duplicate-deps, r=alexcrichton
update `object` dependency to remove duplicate `wasmparser`

``@alexcrichton`` in #129762 you bumped a few wasm-related dependencies and tried to avoid duplicates.

If I understand correctly, `object` 0.36.4 wasn't yet released at the time, and therefore #129762 ended up duplicating `wasmparser`. Now that the release happened, we can remove the duplicate.

r? ``@alexcrichton``
2024-09-03 06:05:41 +02:00
Matthias Krüger
72cc383a7f
Rollup merge of #129800 - ChrisDenton:remove-dir-all2, r=Amanieu
Move the Windows remove_dir_all impl into a module and make it more race resistant

This attempts to make the Windows implementation of `remove_dir_all` easier to understand and work with by separating out different concerns into their own functions. The code is mostly the same as before just moved around. There are some changes to make it more robust against races (e.g. two calls to `remove_dir_all` running concurrently). The module level comment explains the issue.

try-job: x86_64-msvc
try-job: i686-msvc
2024-09-03 06:05:40 +02:00
Matthias Krüger
44187d667c
Rollup merge of #129311 - onur-ozkan:multiple-candidates-fix, r=Kobzol
don't copy `.rustc-dev-contents` from CI rustc

Since https://github.com/rust-lang/rust/pull/127188, copying files from `.rustc-dev-contents` regressed https://github.com/rust-lang/rust/issues/108767 again. Since `rustc-src` is already included in the CI rustc sysroot, we don't need to copy these files to have `rustc-src` component.

Blocker for #122709
2024-09-03 06:05:39 +02:00
Matthias Krüger
11398eded1
Rollup merge of #129152 - onur-ozkan:custom-clippy, r=Kobzol
custom/external clippy support for bootstrapping

Similar to cargo, rustc, and rustfmt, this adds the support of using custom clippy on bootstrap. It’s designed for those who want to test their own clippy builds or avoid downloading the stage0 clippy.

Closes #121518
2024-09-03 06:05:39 +02:00
bors
6199b69c53 Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau
Add `unreachable_pub`, round 4

A follow-up to #129732.

r? `@Urgau`
2024-09-03 01:27:20 +00:00
bors
2251572086 Auto merge of #129915 - matthiaskrgr:rollup-56h2xp2, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - #129748 (Box validity: update for new zero-sized rules)
 - #129829 (Make decoding non-optional `LazyArray` panic if not set)
 - #129856 (compiler_fence documentation: emphasize synchronization, not reordering)
 - #129868 (Remove kobzol vacation status)
 - #129875 (chore: Fix typos in 'compiler' (batch 1))
 - #129877 (chore: Fix typos in 'compiler' (batch 2))
 - #129878 (chore: Fix typos in 'compiler' (batch 3))
 - #129890 (Remove stray word in a comment)
 - #129892 (Clarify language around ptrs in slice::raw)
 - #129905 (mailmap: add new email for davidtwco)
 - #129906 (mailmapper?)
 - #129907 (Fix compile error in solid's remove_dir_all)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-02 22:54:39 +00:00
Nicholas Nethercote
88b6a78d0b Add warn(unreachable_pub) to rustc_const_eval. 2024-09-03 08:50:33 +10:00
Nicholas Nethercote
d7caea129d Add warn(unreachable_pub) to rustc_ty_utils. 2024-09-03 08:50:33 +10:00
Nicholas Nethercote
3e09c450b4 Add warn(unreachable_pub) to rustc_type_ir. 2024-09-03 08:50:31 +10:00
Nicholas Nethercote
e4b1e28033 Add warn(unreachable_pub) to rustc_transmute. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
2e358e633d Add warn(unreachable_pub) to rustc_trait_selection. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
c4f6f52139 Add warn(unreachable_pub) to rustc_traits. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
0fb3a509cf Add warn(unreachable_pub) to rustc_target. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
89deb3c742 Add warn(unreachable_pub) to rustc_symbol_mangling. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
b0f22ff98f Add warn(unreachable_pub) to rustc_span. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
b457ab3186 Add warn(unreachable_pub) to rustc_smir. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
19ff6e6e63 Add warn(unreachable_pub) to rustc_session. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
21a37da268 Add warn(unreachable_pub) to rustc_serialize. 2024-09-03 08:49:54 +10:00
Nicholas Nethercote
19843bba64 Add warn(unreachable_pub) to rustc_sanitizers. 2024-09-03 08:49:54 +10:00
Jakub Beránek
f1e5191807
Fix parsing of beta version in dry-run mode 2024-09-02 23:16:15 +02:00
Tshepang Mbambo
0a89f72065 process.rs: remove "Basic usage" text where not useful
Is not useful because just a single example is given.
2024-09-02 22:36:25 +02:00
Matthias Krüger
d6298d3736
Rollup merge of #129907 - saethlin:solid-io-error, r=WaffleLapkin
Fix compile error in solid's remove_dir_all

Before this PR, `x check library/std --target=aarch64-kmc-solid_asp3` will fail with:
```
error[E0382]: use of partially moved value: `result`
   --> std/src/sys/pal/solid/fs.rs:544:20
    |
541 |         if let Err(err) = result
    |                    --- value partially moved here
...
544 |             return result;
    |                    ^^^^^^ value used here after partial move
    |
    = note: partial move occurs because value has type `io::error::Error`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
    |
541 |         if let Err(ref err) = result
    |                    +++

```

cc `@kawadakk` I think this will clear up https://solid-rs.github.io/toolstate/ :)
2024-09-02 22:35:23 +02:00
Matthias Krüger
b1b8e3ef0d
Rollup merge of #129906 - BoxyUwU:boxy_mailmap, r=lqd
mailmapper?

I think I have done this right? lol
2024-09-02 22:35:23 +02:00
Matthias Krüger
f065302f09
Rollup merge of #129905 - davidtwco:update-davidtwco-mailmap, r=lqd
mailmap: add new email for davidtwco
2024-09-02 22:35:23 +02:00
Matthias Krüger
9dad90a22a
Rollup merge of #129892 - oskgo:clarify-slice-from-raw, r=RalfJung
Clarify language around ptrs in slice::raw

More specifically we explicitly mention that the pointer should be non-null as a top level requirement. Nullptrs are always valid for zero sized operations, so just validity (and alignment) does not guarantee non-nullness as implied in the existing docs.

We also explicitly call out ZSTs as an additional example where perhaps unintuitively alignment and non-nullness still have to hold.

Finally we change `data` in the range functions to `start`, which seems like a typo to me.

Touches docs for #89792

r? RalfJung
2024-09-02 22:35:22 +02:00
Matthias Krüger
3ddf061926
Rollup merge of #129890 - alex:patch-1, r=workingjubilee
Remove stray word in a comment
2024-09-02 22:35:22 +02:00
Matthias Krüger
929b308579
Rollup merge of #129878 - Sajjon:sajjon_fix_typos_batch_3, r=jieyouxu
chore: Fix typos in 'compiler' (batch 3)

Batch 3/3: Fixes typos in `compiler`

(See [issue](https://github.com/rust-lang/rust/issues/129874) tracking all PRs with typos fixes)
2024-09-02 22:35:21 +02:00
Matthias Krüger
1d9eb9df7f
Rollup merge of #129877 - Sajjon:sajjon_fix_typos_batch_2, r=fee1-dead
chore: Fix typos in 'compiler' (batch 2)

Batch 2/3: Fixes typos in `compiler`

(See [issue](https://github.com/rust-lang/rust/issues/129874) tracking all PRs with typos fixes)
2024-09-02 22:35:21 +02:00
Matthias Krüger
cfb12716e9
Rollup merge of #129875 - Sajjon:sajjon_fix_typos_batch_1, r=compiler-errors,jieyouxu
chore: Fix typos in 'compiler' (batch 1)

Batch 1/3: Fixes typos in `compiler`

(See [issue](https://github.com/rust-lang/rust/issues/129874) tracking all PRs with typos fixes)
2024-09-02 22:35:20 +02:00
Matthias Krüger
912931d64a
Rollup merge of #129868 - Kobzol:kobzol-vacation-remove, r=lqd
Remove kobzol vacation status

Conflicts with https://github.com/rust-lang/rust/pull/129843, so should be merged after it.
2024-09-02 22:35:20 +02:00
Matthias Krüger
f0072bf274
Rollup merge of #129856 - RalfJung:compiler_fence, r=thomcc
compiler_fence documentation: emphasize synchronization, not reordering

Our `fence` docs have at some point been update to explain that they are about synchronization, not about "preventing reordering". This updates the `compiler_fence` docs n the same vein, mostly by referring to the `fence` docs.

The old docs make it sound like I can put a compiler_fence in the middle of a bunch of non-atomic operations and that would achieve any kind of guarantee. It does not, atomic operations are still required to do synchronization.

I also slightly tweaked the `fence` docs, to put the synchronization first and the "prevent reordering" second.

Cc `@rust-lang/opsem` `@chorman0773` `@m-ou-se`

Fixes https://github.com/rust-lang/rust/issues/129189
Fixes https://github.com/rust-lang/rust/issues/54962
2024-09-02 22:35:19 +02:00
Matthias Krüger
c6410f5066
Rollup merge of #129829 - compiler-errors:decode-non-optional, r=lcnr
Make decoding non-optional `LazyArray` panic if not set

Tables may be [defined](9649706ead/compiler/rustc_metadata/src/rmeta/mod.rs (L377)) as `optional:` or `defaulted:`. If optional, if we try to read a value from a key that was never encoded, we should panic. This has high value in ensuring correctness over a defaulted table, so the tradeoff is worth considering, since it signals the compiler has a buggy encode impl, rather than just defaulting to a value.

HOWEVER, `optional:` arrays were side-stepping this. So this PR fixes that, and makes `optional:` tables of `LazyArray` act like `LazyValue`, and panic if it's not assigned a value during encoding.

During this PR, I found that `deduced_param_attrs` has buggy (?? i think??) implementation where it will refuse to encode cross-crate `deduced_param_attrs` unless we're codegening, we're optimizing the library, and incremental is disabled. This seems incredibly wrong, but I don't want to fix it in this PR.
9649706ead/compiler/rustc_metadata/src/rmeta/encoder.rs (L1733-L1747)
2024-09-02 22:35:19 +02:00
Matthias Krüger
003ddec7a6
Rollup merge of #129748 - RalfJung:box-validity, r=workingjubilee
Box validity: update for new zero-sized rules

Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/529

Cc `@joshlf` `@rust-lang/opsem`
2024-09-02 22:35:18 +02:00
Ben Kimock
fcb7d3fdf3 Add missing read_buf stub for x86_64-unknown-l5re-uclibc 2024-09-02 16:14:28 -04:00
Ben Kimock
8be9fed672 Fix compile error in solid's remove_dir_all 2024-09-02 14:58:00 -04:00
Jakub Beránek
fa77b9d21c
Remove kobzol vacation status 2024-09-02 20:06:37 +02:00
Boxy
5d47b4d198 mailmapper? 2024-09-02 18:15:26 +01:00
David Wood
7ac5fdaf99
mailmap: add new email for davidtwco
Signed-off-by: David Wood <david@davidtw.co>
2024-09-02 18:12:20 +01:00
bors
bd53aa3bf7 Auto merge of #129317 - compiler-errors:expectation-subtyping, r=lcnr
Use equality when relating formal and expected type in arg checking

#129059 uncovered an interesting issue in argument checking. When we check arguments, we create three sets of types:
* Formals
* Expected
* Actuals

The **actuals** are the types of the argument expressions themselves. The **formals** are the types from the signature that we're checking. The **expected** types are the formal types, but passed through `expected_inputs_for_expected_outputs`:

a971212545/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs (L691-L725)

This method attempts to constrain the formal inputs by relating the [expectation](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/expectation/enum.Expectation.html) of the call expression and the formal output.

When we check an argument, we get the expression's actual type, and then we first attempt to coerce it to the expected type:

a971212545/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs (L280-L293)

Then we subtype the expected type and the formal type:

a971212545/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs (L299-L305)

However, since we are now recording the right coercion target (since #129059), we now end up recording the expected type to the typeck results, rather than the actual.

Since that expected type was [fudged](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#method.fudge_inference_if_ok), it has fresh variables. And since the expected type is only subtyped against the formal type, if that expected type has a bivariant parameter, it will likely remain unconstrained since `Covariant * Bivariant = Bivariant` according to [xform](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.Variance.html#method.xform). This leads to an unconstrained type variable in writeback.

AFAICT, there's no reason for us to be using subtyping here, though. The expected output is already related to the expectation by subtyping:

a971212545/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs (L713)

So the formals don't need "another" indirection of subtyping in the argument checking... So I've changed it to use equality here. We could alternatively fix this by requiring WF for all the expected types to constrain their bivariant parameters, but this seems a bit overkill.

Fixes #129286
2024-09-02 16:08:50 +00:00
oskgo
7494224e74 clarify language around non-null ptrs in slice::raw 2024-09-02 15:49:18 +02:00
Alex Gaynor
06e3552ad0
Remove stray word in a comment 2024-09-02 09:44:03 -04:00
bors
a4601859ae Auto merge of #129873 - matthiaskrgr:rollup-bv849ud, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #127474 (doc: Make block of inline Deref methods foldable)
 - #129678 (Deny imports of `rustc_type_ir::inherent` outside of type ir + new trait solver)
 - #129738 (`rustc_mir_transform` cleanups)
 - #129793 (add extra linebreaks so rustdoc can identify the first sentence)
 - #129804 (Fixed some typos in the standard library documentation/comments)
 - #129837 (Actually parse stdout json, instead of using hacky contains logic.)
 - #129842 (Fix LLVM ABI NAME for riscv64imac-unknown-nuttx-elf)
 - #129843 (Mark myself as on vacation for triagebot)
 - #129858 (Replace walk with visit so we dont skip outermost expr kind in def collector)

Failed merges:

 - #129777 (Add `unreachable_pub`, round 4)
 - #129868 (Remove kobzol vacation status)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-02 13:41:42 +00:00
cuishuang
25c4aa8979 chore: remove repetitive words
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-02 19:02:28 +08:00