Commit Graph

253652 Commits

Author SHA1 Message Date
Jacob Pratt
c8beab7f46
Rollup merge of #124383 - Urgau:port-print-native-static-libs, r=jieyouxu
Port run-make `--print=native-static-libs` to rmake.rs

This PR port the run-make `--print=native-static-libs` test to rmake.rs

The dedup was really awful in the `Makefile`, I'm glad to finally have a proper dedup detection for this.

Related to https://github.com/rust-lang/rust/issues/121876

r? `@jieyouxu`
2024-04-26 19:25:55 -04:00
Jacob Pratt
645a4d34fb
Rollup merge of #124341 - petrochenkov:nomacvisit, r=compiler-errors
resolve: Remove two cases of misleading macro call visiting

Macro calls are ephemeral, they should not add anything to the definition tree, even if their AST could contains something with identity.
Thankfully, macro call AST cannot contain anything like that, so these walks are just noops.
In majority of other places in def_collector / build_reduced_graph they are already not visited.

(Also, a minor match reformatting is included.)
2024-04-26 19:25:54 -04:00
Urgau
7688f798d5 Also support MSVC in print-native-static-libs test 2024-04-27 00:26:06 +02:00
bors
aa6a8ee270 Auto merge of #124296 - cuviper:dist-cargo-tests, r=onur-ozkan
bootstrap: keep all cargo test files in dist rustc-src

Cargo tests use some files that we would otherwise exclude, especially
the `cargo init` tests that are meant to deal with pre-existing `.git`
and `.hg` repos and their ignore files. Keeping these in our dist
tarball doesn't take much space, and allows distro builds to run these
tests successfully.
2024-04-26 22:22:47 +00:00
bors
3a74fae72d Auto merge of #3517 - RalfJung:env-vars, r=RalfJung
env: split up Windows and Unix environment variable handling

On Windows, manage them entirely outside the AM state; this also means we no longer report any data races for environment variable memory.

Fixes https://github.com/rust-lang/rust/issues/124411
2024-04-26 20:17:35 +00:00
Ralf Jung
454f09d891 env: split up Windows and Unix environment variable handling 2024-04-26 22:16:16 +02:00
Weihang Lo
c5eda4199c
Update cargo 2024-04-26 13:53:34 -04:00
Ralf Jung
26af88aced add test for concurrent env var access 2024-04-26 19:47:35 +02:00
Urgau
74cbc09fc9 Port run-make --print=native-static-libs to rmake.rs 2024-04-26 19:45:45 +02:00
bors
4d570eea02 Auto merge of #123909 - dtolnay:utf8chunks, r=joboet
Stabilize `Utf8Chunks`

Pending FCP in https://github.com/rust-lang/rust/issues/99543.

This PR includes the proposed modification in https://github.com/rust-lang/libs-team/issues/190 as agreed in https://github.com/rust-lang/rust/issues/99543#issuecomment-2050406568.
2024-04-26 17:41:24 +00:00
Ralf Jung
c47978a241 PathBuf: replace transmuting by accessor functions 2024-04-26 18:09:09 +02:00
bors
d7c89cfbf8 Auto merge of #3516 - RalfJung:pathbuf, r=RalfJung
add smoke tests for basic PathBuf interactions

I wrote these while debugging [this](https://github.com/rust-lang/miri-test-libstd/actions/runs/8849912635/job/24302962983); it turns out the issue is [more complicated](https://github.com/rust-lang/rust/issues/124409) but these tests still seemed worth keeping.
2024-04-26 15:47:17 +00:00
Ralf Jung
2935cd93c2 add smoke tests for basic PathBuf interactions 2024-04-26 17:44:37 +02:00
bors
1b3a32958b Auto merge of #122385 - lcnr:analyze-obligations-for-infer, r=compiler-errors
`obligations_for_self_ty`: use `ProofTreeVisitor` for nested goals

As always, dealing with proof trees continues to be a hacked together mess. After this PR and #124380 the only remaining blocker for core is https://github.com/rust-lang/trait-system-refactor-initiative/issues/90. There is also a `ProofTreeVisitor` issue causing an ICE when compiling `alloc` which I will handle in a separate PR. This issue likely affects coherence diagnostics more generally.

The core idea is to extend the proof tree visitor to support visiting nested candidates without using a `probe`. We then simply recurse into nested candidates if they are the only potentially applicable candidate for a given goal and check whether the self type matches the expected one.

For that to work, we need to improve `CanonicalState` to also handle unconstrained inference variables created inside of the trait solver. This is done by extending the `var_values` of `CanoncalState` with each fresh inference variables. Furthermore, we also store the state of all inference variables at the end of each probe. When recursing into `InspectCandidates` we then unify the values of all these states.

r? `@compiler-errors`
2024-04-26 15:37:05 +00:00
Matthias Krüger
60c0fa1285 crashes: add more tests 2024-04-26 17:20:16 +02:00
Alex Macleod
5b5ee0e7bd Remove unused [patch] for clippy_lints 2024-04-26 15:35:43 +01:00
Ralf Jung
babead5b58 miri core/alloc tests: do not test a 2nd target 2024-04-26 16:33:37 +02:00
bors
9adafa7f8d Auto merge of #124321 - JoverZhang:run-make-support-tests, r=onur-ozkan
Add support for run-make-support unit tests to be run with bootstrap

The `run-make-support` library needs to run its unit tests to ensure it is correct.

Close #124267
2024-04-26 13:22:13 +00:00
bors
5ff8fbb2d8 Auto merge of #124393 - scottmcm:do-the-macros-still-matter, r=joboet
Convert some iter macros to normal functions

With all the MIR optimization changes that have happened since these were written, let's see if they still actually matter.

\*perf comes back\*

Well, it looks like it's not longer relevant for instruction, cycle, nor wall-time perf.  Looks like a bunch of things are maybe 10kb bigger in debug, but some are also 50k *smaller* in debug.

So I think they should switch to being normal functions as the "greatly improves performance" justification for them being macros seems to no longer be true -- probably thanks to us always building `core` with `-Z inline-mir` so the difference is negligible.
2024-04-26 11:16:05 +00:00
Jover Zhang
c028782c67 Add support for run-make-support unit tests to be run with bootstrap command
Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com>
2024-04-26 15:31:18 +08:00
bors
82921058e7 Auto merge of #3515 - rust-lang:rustup-2024-04-26, r=oli-obk
Automatic Rustup
2024-04-26 05:27:00 +00:00
Scott McMurray
cd47a0ed08 Convert some iter macros to normal functions
With all the MIR optimization changes that have happened since these were written, let's see if they still actually matter.
2024-04-25 22:16:02 -07:00
The Miri Cronjob Bot
4be9c689f6 Merge from rustc 2024-04-26 05:08:12 +00:00
The Miri Cronjob Bot
4dcc2fac06 Preparing for merge from rustc 2024-04-26 04:58:30 +00:00
Nicholas Nethercote
30d6f63b4e Adjust some pubs. 2024-04-26 13:29:20 +10:00
bors
6acb9e75eb Auto merge of #120845 - petrochenkov:debmac, r=oli-obk
debuginfo: Stabilize `-Z debug-macros`, `-Z collapse-macro-debuginfo` and `#[collapse_debuginfo]`

`-Z debug-macros` is "stabilized" by enabling it by default and removing.

`-Z collapse-macro-debuginfo` is stabilized as `-C collapse-macro-debuginfo`.
It now supports all typical boolean values (`parse_opt_bool`) in addition to just yes/no.

Default value of `collapse_debuginfo` was changed from `false` to `external` (i.e. collapsed if external, not collapsed if local) - https://github.com/rust-lang/rust/issues/100758#issuecomment-1935815625 describes some debugging scenarios that motivate this default as reasonable.
`#[collapse_debuginfo]` attribute without a value is no longer supported to avoid guessing the default.

Stabilization report: https://github.com/rust-lang/rust/pull/120845#issuecomment-1939145242

Closes https://github.com/rust-lang/rust/issues/100758
Closes https://github.com/rust-lang/rust/issues/41743
Closes https://github.com/rust-lang/rust/issues/39153
2024-04-26 02:13:08 +00:00
Vadim Petrochenkov
683ad6b607 Update lldb only tests 2024-04-26 04:11:05 +03:00
bors
e59f2c544a Auto merge of #124388 - compiler-errors:rollup-v17b8fm, r=compiler-errors
Rollup of 4 pull requests

Successful merges:

 - #124076 (Stablise io_error_downcast)
 - #124378 (Keep the LIB env var in the compiler-builtins test)
 - #124379 (Remove special-casing for `SimplifiedType` for next solver)
 - #124381 (Renamed `DerivedObligation` to `WellFormedDeriveObligation`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-26 00:10:56 +00:00
Michael Goulet
88eae31261
Rollup merge of #124381 - compiler-errors:derived-for-wf, r=lcnr
Renamed `DerivedObligation` to `WellFormedDeriveObligation`

It's used when computing `WellFormed` obligations, so let's give it a less ambiguous name.
2024-04-25 20:07:41 -04:00
Michael Goulet
4494140244
Rollup merge of #124379 - compiler-errors:remove-new-solver-lookup-behavior, r=lcnr
Remove special-casing for `SimplifiedType` for next solver

It's unnecessary due to the way that we fully normalize the self type before assembly begins.

r? lcnr
2024-04-25 20:07:41 -04:00
Michael Goulet
ef5e42af59
Rollup merge of #124378 - dpaoliello:keeplib, r=jieyouxu
Keep the LIB env var in the compiler-builtins test

The `tests/run-make/compiler-builtins` test was failing for me with Visual Studio 2022, complaining that it couldn't find `kernel32.lib`.

For whatever reason, with VS 2022 we need to keep the `LIB` environment variable when invoking Cargo so that the linker can find the Windows SDK libs.
2024-04-25 20:07:41 -04:00
Michael Goulet
6f5c69e65f
Rollup merge of #124076 - NobodyXu:patch-1, r=dtolnay
Stablise io_error_downcast

Tracking issue #99262
Closes #99262

FCP completed in https://github.com/rust-lang/rust/issues/99262#issuecomment-2077374397
2024-04-25 20:07:40 -04:00
Nicholas Nethercote
8dc84fa7d1 Move some functions from rustc_expand to rustc_builtin_macros.
These functions are only used in `rustc_builtin_macros`, so it makes
sense for them to live there. This allows them to be changed from `pub`
to `pub(crate)`.
2024-04-26 09:24:33 +10:00
Nicholas Nethercote
e2d2b1c698 Introduce DeriveResolution.
Making this a proper struct, and giving its fields names, makes things
easier to understand.
2024-04-26 07:55:21 +10:00
Michael Goulet
132f8ce3dc Renamed DerivedObligation to WellFormedDeriveObligation 2024-04-25 16:55:15 -04:00
Daniel Paoliello
29f2e27156 Keep the LIB env var in the compiler-builtins test 2024-04-25 13:49:46 -07:00
bors
3a36386dc1 Auto merge of #124386 - matthiaskrgr:rollup-0a6yr00, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124313 (Detect borrow error involving sub-slices and suggest `split_at_mut`)
 - #124374 (Don't ICE when `codegen_select_candidate` returns ambiguity in new solver)
 - #124380 (`Range` iteration specialization: remove trivial bounds)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-25 20:31:14 +00:00
lcnr
146f637826 add triage bot mentions 2024-04-25 20:21:38 +00:00
lcnr
b64f687cb0 use EagerResolver 2024-04-25 20:19:01 +00:00
Vadim Petrochenkov
7517a4f882 ast: Visit item components in "natural" order 2024-04-25 22:50:06 +03:00
Vadim Petrochenkov
5be9fdd636 ast: Generalize item kind visiting
And avoid duplicating logic for visiting `Item`s with different kinds (regular, associated, foreign).
2024-04-25 22:49:58 +03:00
Jubilee Young
43f21a6871 thread_local: split refs to fields of Key 2024-04-25 12:45:21 -07:00
lcnr
03878c682a hir typeck: look into nested goals
uses a `ProofTreeVisitor` to look into nested
goals when looking at the pending obligations
during hir typeck. Used by closure signature
inference, coercion, and for async functions.
2024-04-25 19:44:00 +00:00
Jubilee Young
538ddb0ac2 thread_local: use less &mut T in LazyKeyInner::take
Instead, use raw pointers to accomplish internal mutability throughout.
2024-04-25 12:33:09 -07:00
Vadim Petrochenkov
98804c1786 debuginfo: Stabilize -Z debug-macros, -Z collapse-macro-debuginfo and #[collapse_debuginfo]
`-Z debug-macros` is "stabilized" by enabling it by default and removing.

`-Z collapse-macro-debuginfo` is stabilized as `-C collapse-macro-debuginfo`.
It now supports all typical boolean values (`parse_opt_bool`) in addition to just yes/no.

Default value of `collapse_debuginfo` was changed from `false` to `external` (i.e. collapsed if external, not collapsed if local).
`#[collapse_debuginfo]` attribute without a value is no longer supported to avoid guessing the default.
2024-04-25 22:14:47 +03:00
Matthias Krüger
3c0c5b4e46
Rollup merge of #124380 - lcnr:std-unnecessary-params, r=Nilstrieb
`Range` iteration specialization: remove trivial bounds

These bounds on impl items are trivially true and never checked by a caller. They end up shadowing the actual impls, currently preventing normalization in the new solver. While we may have to fix the underlying issue in the new solver at some point, for now this is an easy way to get us closer to compiling core with `-Znext-solver`.

r? `@Nilstrieb`
2024-04-25 21:12:18 +02:00
Matthias Krüger
6c21abf291
Rollup merge of #124374 - compiler-errors:fix-ambiguity-ice, r=lcnr
Don't ICE when `codegen_select_candidate` returns ambiguity in new solver

Because we merge identical candidates, we may have >1 impl candidate to in `codegen_select_error` but *not* have a trait error.

r? lcnr
2024-04-25 21:12:17 +02:00
Matthias Krüger
60c825f1e1
Rollup merge of #124313 - estebank:split-at-mut, r=fee1-dead
Detect borrow error involving sub-slices and suggest `split_at_mut`

```
error[E0499]: cannot borrow `foo` as mutable more than once at a time
  --> $DIR/suggest-split-at-mut.rs:13:18
   |
LL |     let a = &mut foo[..2];
   |                  --- first mutable borrow occurs here
LL |     let b = &mut foo[2..];
   |                  ^^^ second mutable borrow occurs here
LL |     a[0] = 5;
   |     ---- first borrow later used here
   |
   = help: use `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
```

Address most of #58792.

For follow up work, we should emit a structured suggestion for cases where we can identify the exact `let (a, b) = foo.split_at_mut(2);` call that is needed.
2024-04-25 21:12:17 +02:00
Michael Goulet
f2518cd798 Remove special-casing for SimplifiedType for next solver 2024-04-25 14:27:39 -04:00
Esteban Küber
64a4cdcfd4 review comment: rename method 2024-04-25 18:26:36 +00:00