Commit Graph

248435 Commits

Author SHA1 Message Date
Philipp Krones
1d65642a1f
Bump nightly version -> 2024-03-07 2024-03-07 17:14:39 +01:00
Philipp Krones
a6df0277ea
Merge remote-tracking branch 'upstream/master' into rustup 2024-03-07 17:14:36 +01:00
Augie Fackler
ef626d772f PassWrapper: update for llvm/llvm-project@a331937197
@rustbot label: +llvm-main
2024-03-07 10:24:48 -05:00
Kalle Wachsmuth
5ce3db2248
make std::os::unix::ucred module private 2024-03-07 16:23:35 +01:00
bors
1c580bcb70 Auto merge of #122139 - GuillaumeGomez:rollup-37vtwsc, r=GuillaumeGomez
Rollup of 10 pull requests

Successful merges:

 - #121863 (silence mismatched types errors for implied projections)
 - #122043 (Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`)
 - #122066 (Add proper cfgs for struct HirIdValidator used only with debug-assert)
 - #122104 (Rust is a proper name: rust → Rust)
 - #122110 (Make `x t miri` respect `MIRI_TEMP`)
 - #122114 (Make not finding core a fatal error)
 - #122115 (Cancel parsing ever made during recovery)
 - #122123 (Don't require specifying unrelated assoc types when trait alias is in `dyn` type)
 - #122126 (Fix `tidy --bless` on  ̶X̶e̶n̶i̶x̶ Windows)
 - #122129 (Set `RustcDocs` to only run on host)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-07 15:02:36 +00:00
DianQK
3d7f8b4e5b
Get all variants to eliminate the default branching if we cannot get the layout of type 2024-03-07 22:58:51 +08:00
DianQK
08ae8380ce
Replace the default branch with an unreachable branch If it is the last variant 2024-03-07 22:58:51 +08:00
DianQK
d8b7b5be7d
Regenerate uninhabited_enum_branching.rs 2024-03-07 22:58:51 +08:00
lcnr
f9405ed4d8 cleanup imports 2024-03-07 15:41:24 +01:00
lcnr
2339317cfb move snapshot handling into mod 2024-03-07 15:39:30 +01:00
klensy
cd549aeffd sync (try_)instantiate_mir_and_normalize_erasing_regions implementation
try_instantiate_mir_and_normalize_erasing_regions was changed in dbc2cc8717, but not instantiate_mir_and_normalize_erasing_regions
2024-03-07 17:33:08 +03:00
Oli Scherer
ae50e36dfa Merge collect_mod_item_types query into check_well_formed 2024-03-07 14:26:31 +00:00
lcnr
de3c965b76 move mod into folder 2024-03-07 15:23:36 +01:00
lcnr
6ebeb1c36b remove empty folder 2024-03-07 15:18:25 +01:00
Guillaume Gomez
ce9a6adba9
Rollup merge of #122129 - tgross35:rustcdocs-host-only, r=onur-ozkan
Set `RustcDocs` to only run on host

`./x dist` currently crashes when cross compiling. Add the fix described by `@catamorphism` in https://github.com/rust-lang/rust/issues/110071.

Fixes #110071
2024-03-07 15:07:10 +01:00
Guillaume Gomez
d03d9a4e9b
Rollup merge of #122126 - workingjubilee:every-os-in-the-world-belongs-to-unix, r=ChrisDenton
Fix `tidy --bless` on  ̶X̶e̶n̶i̶x̶ Windows

As reported in https://github.com/rust-lang/rust/pull/120628#issuecomment-1973655740 the requested `tidy --bless` implementation didn't take into account the fact that earlier the linting code canonicalized things to use the OS path separator. This makes it so that the path separator is always rewritten back as '/', which should fix the variance there.

r? ``@ChrisDenton``
2024-03-07 15:07:09 +01:00
Guillaume Gomez
bb582c6d0f
Rollup merge of #122123 - compiler-errors:object-trait-alias-bounds, r=oli-obk
Don't require specifying unrelated assoc types when trait alias is in `dyn` type

Object types must specify the associated types for all of the principal trait ref's supertraits. However, we weren't doing elaboration properly, so we incorrectly errored with erroneous suggestions to specify associated types that were unrelated to that principal trait ref. To fix this, use proper supertrait elaboration when expanding trait aliases in `conv_object_ty_poly_trait_ref`.

**NOTE**: Please use the ignore-whitespace option when reviewing. This only touches a handful of lines.

r? oli-obk or please feel free to reassign.

Fixes #122118
2024-03-07 15:07:09 +01:00
Guillaume Gomez
9bda4e47c7
Rollup merge of #122115 - clubby789:cancel-recoverr, r=compiler-errors
Cancel parsing ever made during recovery

Fixes #122112

It would be nice if diagnostics from recovery were automatically cancelled... 🤔
2024-03-07 15:07:08 +01:00
Guillaume Gomez
66a062af86
Rollup merge of #122114 - saethlin:cant-find-crate-spam, r=WaffleLapkin
Make not finding core a fatal error

Similar to https://github.com/rust-lang/rust/pull/120472, this prevents terminal spam. In particular, it makes the good diagnostic visible when you try to use a target that's not installed.
2024-03-07 15:07:08 +01:00
Guillaume Gomez
d7106d27ab
Rollup merge of #122110 - WaffleLapkin:miri-temp, r=RalfJung
Make `x t miri` respect `MIRI_TEMP`

(I don't want to override `TMPDIR`, as that might affect other things)

r? ``@RalfJung``
2024-03-07 15:07:07 +01:00
Guillaume Gomez
6b045184a8
Rollup merge of #122104 - RalfJung:rust, r=ChrisDenton
Rust is a proper name: rust → Rust

I only went over the library where it might be user-visible -- I noticed this in the `time` docs.
2024-03-07 15:07:07 +01:00
Guillaume Gomez
f1fb720734
Rollup merge of #122066 - mu001999:clean, r=oli-obk
Add proper cfgs for struct HirIdValidator used only with debug-assert

See https://github.com/rust-lang/rust/pull/122065#issuecomment-1980118572.
I think it's due to #121752.
2024-03-07 15:07:06 +01:00
Guillaume Gomez
e52c5411bb
Rollup merge of #122043 - Y-Nak:move-early-binder, r=lcnr
Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`

Resolves #121852

This PR
1. Moves `EarlyBinder` to `TraitRef` inside `ImplTraitHeader`,
2. Changes visibility of `coherence::builtin::check_trait` to `pub(super)` from `pub` as it seems not being re-exported from the `coherence` module.
2024-03-07 15:07:06 +01:00
Guillaume Gomez
0e3764889d
Rollup merge of #121863 - lukas-code:silence-mismatched-super-projections, r=lcnr
silence mismatched types errors for implied projections

Currently, if a trait bound is not satisfied, then we suppress any errors for the trait's supertraits not being satisfied, but still report errors for super projections not being satisfied.

For example:
```rust
trait Super {
    type Assoc;
}
trait Sub: Super<Assoc = ()> {}
```
Before this PR, if `T: Sub` is not satisfied, then errors for `T: Super` are suppressed, but errors for `<T as Super>::Assoc == ()` are still shown. This PR makes it so that errors about super projections not being satisfied are also suppressed.

The errors are only suppressed if the span of the trait obligation matches the span of the super predicate obligation to avoid silencing error that are not related. This PR removes some differences between the spans of supertraits and super projections to make the suppression work correctly.

This PR fixes the majority of the diagnostics fallout when making `Thin` a supertrait of `Sized` (in a future PR).
cc https://github.com/rust-lang/rust/pull/120354#issuecomment-1930585382
cc `@lcnr`
2024-03-07 15:07:05 +01:00
bors
ba80e06537 Auto merge of #12429 - Alexendoo:redundant-field-names-macro-ctxt, r=Manishearth
Don't lint `redundant_field_names` across macro boundaries

Fixes #12426

The `field.span.eq_ctxt(field.ident.span)` addition is the relevant line for the bugfix

The current implementation checks that the field's name and the path are in the same context by comparing the idents, but not that the two are in the same context as the entire field itself, so in local macros `SomeStruct { $ident: $ident }` would get linted

changelog: none
2024-03-07 13:56:36 +00:00
Oli Scherer
42ab88d747 Remove redundant query invocations in rustdoc 2024-03-07 13:37:06 +00:00
Oli Scherer
ebf1b92417 Use the same collection order as check_mod_type_wf 2024-03-07 13:37:06 +00:00
Yoshitomo Nakanishi
9669934798 Apply EarlyBinder only to TraitRef in ImplTraitHeader 2024-03-07 13:56:29 +01:00
Rémy Rakic
1c3fe15f6c record mtime in llvm linker script
This will avoid rebuilds due to the script being more recent than the
rest of the original files.
2024-03-07 12:56:17 +00:00
Rémy Rakic
b91ceb88de use file to write llvm linker script 2024-03-07 12:56:13 +00:00
Oli Scherer
de3fb8d429 Collect mod item types in parallel, just like wfcheck 2024-03-07 12:42:49 +00:00
bors
52f8aec14c Auto merge of #121985 - RalfJung:interpret-return-place, r=oli-obk
interpret: avoid a long-lived PlaceTy in stack frames

`PlaceTy` uses a representation that's not very stable under changes to the stack. I'd feel better if we didn't have one in the long-term machine state.

r? `@oli-obk`
2024-03-07 12:33:19 +00:00
Alex Macleod
ac643a278b Don't lint redundant_field_names across macro boundaries 2024-03-07 12:21:16 +00:00
Lukas Markeffsky
db48b93454 improve debug logging 2024-03-07 13:20:56 +01:00
Zalathar
570376c496 Don't pass a break scope to Builder::break_for_else
This method would previously take a target scope, and then verify that it
was equal to the scope on top of the if-then scope stack.

In practice, this means that callers have to go out of their way to pass around
redundant scope information that's already on the if-then stack.

So it's easier to just retrieve the correct scope directly from the if-then
stack, and simplify the other code that was passing it around.
2024-03-07 23:11:18 +11:00
Gary Guo
0ee0f290a6 Bless aarch64 asm test 2024-03-07 11:57:26 +00:00
Jakub Beránek
4a1f4ff474 Include all library files in artifact summary on CI 2024-03-07 12:19:13 +01:00
bors
8c9a75b323 Auto merge of #121154 - oli-obk:track_errors11, r=estebank
Merge `check_mod_impl_wf` and `check_mod_type_wf`

This still causes some funny diagnostics, but I'm not sure they can be fixed without a larger change, which I'd like to avoid here.

Reducing the number of times we iterate over the same items at this high level helps avoid parallel-compiler bottlenecks.
2024-03-07 10:18:00 +00:00
r0cky
71d35d8d0c remove the --generate-link-to-definition flags from bootstrap 2024-03-07 17:38:13 +08:00
Trevor Gross
9d9e78e942 Set RustcDocs to only run on host
`./x dist` currently crashes when cross compiling. Add the fix described
by @catamorphism in https://github.com/rust-lang/rust/issues/110071.

Fixes #110071
2024-03-07 02:50:06 -05:00
bors
51f483944d Auto merge of #121866 - Kobzol:opt-dist-find-llvm, r=Mark-Simulacrum
Modify opt-dist logic for finding LLVM artifacts

This is the `rustc` side of fixing https://github.com/rust-lang/rust/pull/121395#issuecomment-1973572885.
2024-03-07 07:31:34 +00:00
Ralf Jung
1a2bc1102d Rust is a proper name: rust → Rust 2024-03-07 07:49:22 +01:00
Oli Scherer
8206cffc48 Merge check_mod_impl_wf and check_mod_type_wf 2024-03-07 06:27:09 +00:00
bors
1508a031fb Auto merge of #122054 - weihanglo:update-cargo, r=weihanglo
Update cargo

14 commits in f772ec0224d3755ce52ac5128a80319fb2eb45d0..a4c63fe5388beaa09e5f91196c86addab0a03580
2024-03-01 22:57:35 +0000 to 2024-03-06 22:15:17 +0000
- fix(cli): Skip tracing-chrome for platforms without 64bit atomics (rust-lang/cargo#13551)
- chore: downgrade to openssl v1.1.1 (again) (rust-lang/cargo#13550)
- fix(cli): Add traces to clarify where time is going (rust-lang/cargo#13545)
- fix(rustdoc-map): dedup `--extern-html-too-url` for same unit (rust-lang/cargo#13544)
- test: Add test for packaging a public dependency (rust-lang/cargo#13536)
- doc: Edits for git/path dependency sections (rust-lang/cargo#13341)
- feat(cli): Allow logging to chrome traces (rust-lang/cargo#13399)
- fix(log): Trace parameters to align with profile (rust-lang/cargo#13538)
- fix(toml): Don't warn on unset Edition if only 2015 is compatible (rust-lang/cargo#13533)
- fix(cli): Trace core cargo operations (rust-lang/cargo#13532)
- chore: update pulldown-cmark to 0.10.0 (rust-lang/cargo#13517)
- feat(add): Fallback to `rustc -v` when no MSRV is set (rust-lang/cargo#13516)
- chore(ci): Ensure lockfile is respected during MSRV testing (rust-lang/cargo#13523)
- feat: Use consistent colors when testing (rust-lang/cargo#13520)
2024-03-07 05:04:49 +00:00
Jubilee Young
bf9782dd9d Fix tidy --bless on Windows 2024-03-06 20:14:12 -08:00
bors
aa029ce4d8 Auto merge of #122113 - matthiaskrgr:rollup-5d1jnwi, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #121958 (Fix redundant import errors for preload extern crate)
 - #121976 (Add an option to have an external download/bootstrap cache)
 - #122022 (loongarch: add frecipe and relax target feature)
 - #122026 (Do not try to format removed files)
 - #122027 (Uplift some feeding out of `associated_type_for_impl_trait_in_impl` and into queries)
 - #122063 (Make the lowering of `thir::ExprKind::If` easier to follow)
 - #122074 (Add missing PartialOrd trait implementation doc for array)
 - #122082 (remove outdated fixme comment)
 - #122091 (Note why we're using a new thread in `test_get_os_named_thread`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-07 02:30:40 +00:00
Daniel Paoliello
a6a556c2a9 Add arm64ec-pc-windows-msvc target
Introduces the `arm64ec-pc-windows-msvc` target for building Arm64EC ("Emulation Compatible") binaries for Windows.

For more information about Arm64EC see <https://learn.microsoft.com/en-us/windows/arm/arm64ec>.

Tier 3 policy:

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I will be the maintainer for this target.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

Target uses the `arm64ec` architecture to match LLVM and MSVC, and the `-pc-windows-msvc` suffix to indicate that it targets Windows via the MSVC environment.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

Target name exactly specifies the type of code that will be produced.

> If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo.

Done.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

> The target must not introduce license incompatibilities.

Uses the same dependencies, requirements and licensing as the other `*-pc-windows-msvc` targets.

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

Understood.

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

Uses the same dependencies, requirements and licensing as the other `*-pc-windows-msvc` targets.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

Understood, I am not a member of the Rust team.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

Both `core` and `alloc` are supported.

Support for `std` dependends on making changes to the standard library, `stdarch` and `backtrace` which cannot be done yet as the bootstrapping compiler raises a warning ("unexpected `cfg` condition value") for `target_arch = "arm64ec"`.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Documentation is provided in src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

Understood.
2024-03-06 17:49:37 -08:00
Michael Goulet
850cc34da2 Don't require specifying unrelated assoc types when trait alias is in dyn type 2024-03-07 01:32:01 +00:00
Erik Desjardins
e349900339 add test for extern type 2024-03-06 19:53:45 -05:00
beetrees
2d7d0bda43
Use rustc_driver::args::raw_args() in Miri 2024-03-07 00:20:01 +00:00