Commit Graph

256073 Commits

Author SHA1 Message Date
bors
1ba35e9bb4 Auto merge of #125515 - weihanglo:target-toml-override, r=onur-ozkan
bootstrap: support target specific config overrides

Can't find any previous discussion about not supporting this,
so I get it done.

The motivation of this is from <https://github.com/rust-lang/rust/pull/125473#issuecomment-2129954990>.
2024-05-25 20:15:11 +00:00
Mathew Horner
afa8dfc51f
Avoid clone when constructing runnable label. 2024-05-25 15:00:15 -05:00
ltdk
0d42cf7afe Stabilise ip_bits feature 2024-05-25 15:00:59 -04:00
bors
48f00110d0 Auto merge of #121571 - clarfonthey:unchecked-math-preconditions, r=saethlin
Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methods

(Old PR is haunted, opening a new one. See #117494 for previous discussion.)

This ensures that these preconditions are actually checked in debug mode, and hopefully should let people know if they messed up. I've also replaced the calls (I could find) in the code that use these intrinsics directly with those that use these methods, so that the asserts actually apply.

More discussions on people misusing these methods in the tracking issue: https://github.com/rust-lang/rust/issues/85122.
2024-05-25 18:07:32 +00:00
bors
14562ddf8c Auto merge of #125502 - weihanglo:update-rustc-perf, r=Kobzol
Update rustc-perf

Just check if the latest commit works.

4f313add60...cc81f9654d

See discussion on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/tempfile.20in.20rustc-perf.20make.20it.20hard.20to.20configure.20vendor/near/440442827

r? ghost
2024-05-25 15:31:40 +00:00
Jonas Rinke
09677b03dd Formatting 2024-05-25 17:08:17 +02:00
Jonas Rinke
78fe45e273 Semicolon 2024-05-25 17:04:48 +02:00
Jonas Rinke
2315c6b764 Use correct format for setting environment variables when debugging with cpptools 2024-05-25 16:53:01 +02:00
bors
0b2f194b83 Auto merge of #125541 - matthiaskrgr:rollup-4gwt4xp, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #125271 (use posix_memalign on almost all Unix targets)
 - #125451 (Fail relating constants of different types)
 - #125478 (Bump bootstrap compiler to the latest beta compiler)
 - #125498 (Stop using the avx512er and avx512pf x86 target features)
 - #125510 (remove proof tree formatting, make em shallow)
 - #125513 (Don't eagerly monomorphize drop for types that are impossible to instantiate)
 - #125514 (Structurally resolve before `builtin_index` in EUV)
 - #125527 (Add manual Sync impl for ReentrantLockGuard)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-25 12:52:43 +00:00
bors
331bb3f10d Auto merge of #3630 - rust-lang:rustup-2024-05-25, r=saethlin
Automatic Rustup
2024-05-25 12:46:16 +00:00
Urgau
bebcb4e4b8 Also mention my-self for check-cfg docs changes 2024-05-25 13:56:19 +02:00
Matthias Krüger
1d54ba8402
Rollup merge of #125527 - programmerjake:patch-2, r=workingjubilee
Add manual Sync impl for ReentrantLockGuard

Fixes: #125526
Tracking Issue: #121440

this impl is even shown in the summary in the tracking issue, but apparently was forgotten in the actual implementation
2024-05-25 12:54:38 +02:00
Matthias Krüger
d747148ba8
Rollup merge of #125514 - compiler-errors:builtin-index, r=lcnr
Structurally resolve before `builtin_index` in EUV

r? lcnr
2024-05-25 12:54:37 +02:00
Matthias Krüger
3fc8fe0490
Rollup merge of #125513 - compiler-errors:impossible-drop, r=jackh726
Don't eagerly monomorphize drop for types that are impossible to instantiate

Self-explanatory title I think

Fixes #125509
2024-05-25 12:54:36 +02:00
Matthias Krüger
00c51bda3f
Rollup merge of #125510 - lcnr:change-proof-trees-to-be-shallow, r=compiler-errors
remove proof tree formatting, make em shallow

Debugging via tracing `RUSTC_LOG=rustc_trait_selection::solve=debug` is now imo slightly more readable then the actual proof tree formatter. Removing everything that's not needed for the `analyse` visitor allows us to remove a bunch of code.

I personally believe that we should continue to use tracing over proof trees for debugging:
- it eagerly prints, allowing us to debug ICEs
- the proof tree builder ends up going out of sync with the actual runtime behavior, which is confusing
- using shallow proof trees is a lot more performant as we frequently do not recurse into all nested goals when using an analyse visitor
- this allows us to clean up the implementation and remove some code

r? ```@compiler-errors```
2024-05-25 12:54:36 +02:00
Matthias Krüger
4d13c96c65
Rollup merge of #125498 - zmodem:avx512er, r=workingjubilee
Stop using the avx512er and avx512pf x86 target features

They are no longer supported by LLVM 19.

Fixes #125492
2024-05-25 12:54:35 +02:00
Matthias Krüger
e58a0a8961
Rollup merge of #125478 - Urgau:check-cfg-config-bump-stage0, r=Mark-Simulacrum
Bump bootstrap compiler to the latest beta compiler

This PR updates the bootstrap compiler, aka stage0 to the latest beta version, since it contains rust-lang/cargo#13925.

It removes those unconditional Cargo warnings:

```
warning: [...]/rust/library/core/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
warning: [...]/rust/library/std/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
warning: [...]/rust/library/alloc/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
```

for all contributors/users of this repository (including CI).

I don't know if that's something we do, or if it's even advisable, feel free to close.

r? `@Mark-Simulacrum`
2024-05-25 12:54:35 +02:00
Matthias Krüger
7ea507e041
Rollup merge of #125451 - oli-obk:const_type_mismatch, r=compiler-errors
Fail relating constants of different types

fixes #121585
fixes #121858
fixes #124151

I gave this several attempts before, but we lost too many important diagnostics until I managed to make compilation never bail out early. We have reached this point, so now we can finally fix all those ICEs by bubbling up an error instead of continueing when we encounter a bug.
2024-05-25 12:54:34 +02:00
Matthias Krüger
f28d36899c
Rollup merge of #125271 - RalfJung:posix_memalign, r=workingjubilee
use posix_memalign on almost all Unix targets

Seems nice to be able to use a single common codepath for all of them. :) The `libc` crate says this symbol exists for all Unix targets. I did locally do check-builds to ensure this still builds, but I can't really test more than that.

- For redox, I found indications posix_memalign really exists [here](https://gitlab.redox-os.org/redox-os/relibc/-/merge_requests/271)
- For esp-idf, I found indications [here](c5b297a86f)
- ~~For horizon and vita (these seem to be gaming console OSes? "Horizon OS" also has some hits for a Facebook product but that seems unrelated), they seem to be based on "newlib", where posix_memalign [seems to exist](https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=3ba2c39fb2a12cd7332ef16b1b3e3df994f7c6f5).~~ Turns out no, this 20-year-old standard POSIX function is unfortunately [not supported](https://github.com/rust-lang/rust/pull/125271#issuecomment-2119221419) here.
2024-05-25 12:54:34 +02:00
bors
77d4115655 Auto merge of #125524 - weihanglo:update-cargo, r=weihanglo
Update cargo

7 commits in 84dc5dc11a9007a08f27170454da6097265e510e..a8d72c675ee52dd57f0d8f2bae6655913c15b2fb
2024-05-20 18:57:08 +0000 to 2024-05-24 03:34:17 +0000
- Improve error description when deserializing partial field struct (rust-lang/cargo#13956)
- fix: remove symlink dir on Windows (rust-lang/cargo#13910)
- Fix wrong type of rustc-flags in documentation (rust-lang/cargo#13957)
- Add more high level traces (rust-lang/cargo#13951)
- upgrade gix from 0.62 to 0.63 (rust-lang/cargo#13948)
- Use `i32` rather than `usize` as "default integer" in library template (rust-lang/cargo#13939)
- fetch specific commits even if the github fast path fails (rust-lang/cargo#13946)

r? ghost
2024-05-25 10:44:58 +00:00
Scott McMurray
d7248d7b71 Stop SRoA'ing DynMetadata in MIR 2024-05-25 00:44:47 -07:00
onur-ozkan
c76477d909 add change entry
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-25 10:37:36 +03:00
onur-ozkan
56dddd4c7e Remove deprecated field dist.missing-tools
It's been 5 months since this field was deprecated.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-25 10:35:07 +03:00
The Miri Cronjob Bot
1d0ad04993 Merge from rustc 2024-05-25 05:23:12 +00:00
The Miri Cronjob Bot
3cfcfbf083 Preparing for merge from rustc 2024-05-25 05:15:32 +00:00
Santiago Pastorino
41d4a95fca
Add "better" edition handling on lint-docs tool 2024-05-24 23:58:27 -03:00
SparrowLii
278212342e cleanup dependence of ExtCtxt in transcribe when macro expansion 2024-05-25 10:38:18 +08:00
Michael Goulet
045f448e26 Don't eagerly monomorphize drop for types that are impossible to instantiate 2024-05-24 21:53:39 -04:00
Ben Kimock
18cb2fa851 Stabilize the runtime of libtest-padding
The body of these benchmarks is close to empty but not literally empty.
This was making the runtime of the benchmarks (which are compiled
without optimizations!) flicker between 9 ns and 10 ns runtime, which
changes the padding and breaks the test. Recent changes to the standard
library have pushed the runtime closer to 10 ns when unoptimized, which
is why we haven't seen such failures before in CI.

Contributors can also induce such failures before this PR by running the
run-make tests while the system is under heavy load.
2024-05-24 21:23:12 -04:00
bors
21e6de7eb6 Auto merge of #124187 - compiler-errors:self-ctor, r=petrochenkov
Warn (or error) when `Self` ctor from outer item is referenced in inner nested item

This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned https://github.com/rust-lang/rust/pull/117246#discussion_r1374648388.

This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do.

This also reverts part of https://github.com/rust-lang/rust/pull/117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
2024-05-25 01:17:55 +00:00
Ben Kimock
9763222f59 Move the checks for Arguments constructors to inline const 2024-05-24 21:09:15 -04:00
Jacob Lifshay
f4b9ac68f3
Add manual Sync impl for ReentrantLockGuard
Fixes: #125526
2024-05-24 17:44:37 -07:00
Weihang Lo
2d9a4c71c8
Update cargo 2024-05-24 17:49:48 -04:00
Ben Kimock
f1a18da4bb Exit the process a short time after entering our ctrl-c handler 2024-05-24 17:43:02 -04:00
bors
36153f1a4e Auto merge of #125521 - matthiaskrgr:rollup-ph2bz3h, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #125467 (Only suppress binop error in favor of semicolon suggestion if we're in an assignment statement)
 - #125483 (compiler: validate.rs belongs next to what it validates)
 - #125485 (Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs`)
 - #125497 (Fix some SIMD intrinsics documentation)
 - #125501 (Resolve anon const's parent predicates to direct parent instead of opaque's parent)
 - #125503 (rustdoc-json: Add test for keywords with `--document-private-items`)
 - #125519 (tag more stuff with `WG-trait-system-refactor`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-24 21:10:48 +00:00
Matthias Krüger
ee54e29333
Rollup merge of #125519 - lcnr:tag-next-solver, r=compiler-errors
tag more stuff with `WG-trait-system-refactor`

r? `@compiler-errors`
2024-05-24 23:01:12 +02:00
Matthias Krüger
f1eef384bb
Rollup merge of #125503 - aDotInTheVoid:rdj-keyword-attr, r=GuillaumeGomez
rustdoc-json: Add test for keywords with `--document-private-items`

Turns out this does work as-expected. I was worried that the rustdoc's clean would produce a `ItemKind::KeywordItem` for the module, and loose the module itself. But turns out we get this right.

Prompted by [this discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Where.20to.20find.20keyword.20entries.20in.20JSON.20rustdoc)

r? `@GuillaumeGomez`
2024-05-24 23:01:12 +02:00
Matthias Krüger
104e1a4bf2
Rollup merge of #125501 - compiler-errors:opaque-opaque-anon-ct, r=BoxyUwU
Resolve anon const's parent predicates to direct parent instead of opaque's parent

When an anon const is inside of an opaque, #99801 added a hack to resolve the anon const's parent predicates *not* to the opaque's predicates, but to the opaque's *parent's* predicates. This is insufficient when considering nested opaques.

This means that the `predicates_of` an anon const might reference duplicated lifetimes (installed by `compute_bidirectional_outlives_predicates`) when computing known outlives in MIR borrowck, leading to these ICEs:
Fixes #121574
Fixes #118403

~~Instead, we should be using the `OpaqueTypeOrigin` to acquire the owner item (fn/type alias/etc) of the opaque, whose predicates we're fine to mention.~~

~~I think it's a bit sketchy that we're doing this at all, tbh; I think it *should* be fine for the anon const to inherit the predicates of the opaque it's located inside. However, that would also mean that we need to make sure the `generics_of` that anon const line up in the same way.~~

~~None of this is important to solve right now; I just want to fix these ICEs so we can land #125468, which accidentally fixes these issues in a different and unrelated way.~~

edit: We don't need this special case anyways because we install the right parent item in `generics_of` anyways:
213ad10c8f/compiler/rustc_hir_analysis/src/collect/generics_of.rs (L150)

r? `@BoxyUwU`
2024-05-24 23:01:11 +02:00
Matthias Krüger
363fbb967e
Rollup merge of #125497 - meesfrensel:patch-1, r=calebzulawski
Fix some SIMD intrinsics documentation

Spotted some mistakes in the docs of some SIMD intrinsics.
2024-05-24 23:01:10 +02:00
Matthias Krüger
09047b8700
Rollup merge of #125485 - GuillaumeGomez:migrate-rmake-rustdoc, r=jieyouxu
Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`
2024-05-24 23:01:10 +02:00
Matthias Krüger
f23ebf0410
Rollup merge of #125483 - workingjubilee:move-transform-validate-to-mir-transform, r=oli-obk
compiler: validate.rs belongs next to what it validates

It's hard to find code that is deeply nested and far away from its callsites, so let's move `rustc_const_eval::transform::validate` into `rustc_mir_transform`, where all of its callers are. As `rustc_mir_transform` already depends on `rustc_const_eval`, the added visible dependency edge doesn't mean the dependency tree got any worse.

This also lets us unnest the `check_consts` module.

I did look into moving everything inside `rustc_const_eval::transform` into `rustc_mir_transform`. It turned out to be a much more complex operation, with more concerns and real edges into the `const_eval` crate, whereas this was both faster and more obvious.
2024-05-24 23:01:09 +02:00
Matthias Krüger
fafe13aea4
Rollup merge of #125467 - compiler-errors:binop-in-bool-expectation, r=estebank
Only suppress binop error in favor of semicolon suggestion if we're in an assignment statement

Similar to #123722, we are currently too aggressive when delaying a binop error with the expectation that we'll emit another error elsewhere. This adjusts that heuristic to be more accurate, at the cost of some possibly poorer suggestions.

Fixes #125458
2024-05-24 23:01:09 +02:00
lcnr
24b5466892 drop region constraints for ambiguous goals 2024-05-24 20:32:35 +00:00
lcnr
c97ed58c38 tag more stuff with WG-trait-system-refactor 2024-05-24 20:27:47 +00:00
Michael Goulet
61aac551b8 Structurally resolve before builtin_index in EUV 2024-05-24 16:20:48 -04:00
Weihang Lo
d1f0bc7562
bootstrap: test target specific config overrides
Debug, PartialEq, and Eq are derived for testing purposes.
2024-05-24 15:53:39 -04:00
Weihang Lo
9185ddb019
bootstrap: support target specific config overrides 2024-05-24 15:48:34 -04:00
Michael Goulet
1af490de42 Better ICE message for unresolved upvars 2024-05-24 15:47:50 -04:00
Boxy
ed8e436916 move generics_of call outside of iter 2024-05-24 20:15:54 +01:00
bors
697ac29a80 Auto merge of #125499 - matthiaskrgr:rollup-84i5z5w, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #125455 (Make `clamp` inline)
 - #125477 (Run rustfmt on files that need it.)
 - #125481 (Fix the dead link in the bootstrap README)
 - #125482 (Notify kobzol after changes to `opt-dist`)
 - #125489 (Revert problematic opaque type change)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-24 18:53:03 +00:00