Commit Graph

270023 Commits

Author SHA1 Message Date
Michael Goulet
82f8b8f0e3 Use opt functions to not ICE in fallback suggestion 2024-11-02 15:25:12 +00:00
bjorn3
c959f6e5fd Update tidy license exceptions and allowed dependencies 2024-11-02 15:21:38 +00:00
bjorn3
60f0cd87e8 Merge commit '5b1246bb4bed72fd0bb8fa497d8e5ed2c7f3515c' into sync_cg_clif-2024-11-02 2024-11-02 14:53:30 +00:00
bjorn3
5b1246bb4b Rustup to rustc 1.84.0-nightly (705cfe0e9 2024-11-01) 2024-11-02 14:16:06 +00:00
bors
07cbbdd693 Auto merge of #132513 - matthiaskrgr:rollup-y98jvsl, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #132481 (rustdoc: skip stability inheritance for some item kinds)
 - #132482 (library: fix some stability annotations)
 - #132493 (Fix type reference in documents which was being confused with html tags.)
 - #132494 (make `download-rustc="if-unchanged"` default for library profile)
 - #132495 (Remove unintended link)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-02 14:12:12 +00:00
bjorn3
b856716b81 Sync from rust 705cfe0e96 2024-11-02 14:08:50 +00:00
ranger-ross
b9196757a0
Added regression test for 117446 2024-11-02 22:17:46 +09:00
Zalathar
90f2075b66 Port most of LLVMRustPrintTargetCPUs to Rust 2024-11-02 23:39:29 +11:00
Zalathar
0fa86f9660 Use a dedicated safe wrapper for LLVMRustGetHostCPUName 2024-11-02 23:39:29 +11:00
Zalathar
36040aacc2 Add a run-make test for same-arch --print=target-cpus 2024-11-02 23:39:29 +11:00
Matthias Krüger
f341a19366 NFC add known bug nr to test 2024-11-02 13:33:39 +01:00
Zalathar
afe190204b coverage: Regression test for inlining into an uninstrumented crate 2024-11-02 23:20:14 +11:00
Remo Senekowitsch
8837fc7542 make codegen help output more consistent
The output of `rustc -C help` generally has one option per line. There was one
exception because of a (presumably) forgotten line continuation escape.
2024-11-02 12:35:48 +01:00
Matthias Krüger
c4024585a4
Rollup merge of #132495 - Houtamelo:remove_unintended_link, r=jieyouxu
Remove unintended link

Since `#[link_section]` is enclosed in braces, it was being confused with a link during docs compilation.

This caused compilation to fail when running `x dist` since it emitted a warning regarding broken links.
2024-11-02 12:14:15 +01:00
Matthias Krüger
bfcd9ecea6
Rollup merge of #132494 - onur-ozkan:library-profile-default, r=jieyouxu
make `download-rustc="if-unchanged"` default for library profile

Since `download-rustc` is tested on CI and https://github.com/rust-lang/rust/pull/132267 makes it effective for library development, we can now make it default for the library profile.

Implements the 3rd item from [this tracking issue](https://github.com/rust-lang/rust/issues/131744).
2024-11-02 12:14:14 +01:00
Matthias Krüger
52ff41ccaa
Rollup merge of #132493 - Houtamelo:doc_type-ref_html-tag, r=jieyouxu
Fix type reference in documents which was being confused with html tags.

Running `x dist` was failing due to it invoking commands with `-D warnings`, which emitted a warning about unclosed html tags.
2024-11-02 12:14:13 +01:00
Matthias Krüger
90c5f86298
Rollup merge of #132482 - lukas-code:stab-attrs, r=Noratrieb
library: fix some stability annotations

This PR updates some stability attributes to correctly reflect when some items actually got stabilized. Found while testing https://github.com/rust-lang/rust/pull/132481.

### `core::char` / `std::char`

In https://github.com/rust-lang/rust/pull/26192, the `core::char` module got "stabilized" for 1.2.0, but the `core` crate itself was still unstable until 1.6.0.

In https://github.com/rust-lang/rust/pull/49698, the `std::char` module was changed to a re-export of `core::char`, making `std::char` appear as "stable since 1.2.0", even though it was already stable in 1.0.0.

By marking `core::char` as stable since 1.0.0, the docs will show correct versions for both `core::char` (since 1.6.0) and `std::char` (since 1.0.0). This is also consistent with the stabilities of similar re-exported modules like `core::mem`/`std::mem` for example.

### `{core,std}::array` and `{core,std}::array::TryFromSliceError`

In https://github.com/rust-lang/rust/pull/58302, the `core::array::TryFromSliceError` type got stabilized for 1.34.0, together with `TryFrom`. At that point the `core::array` module was still unstable and a `std::array` re-export didn't exist, but `core::array::TryFromSliceError` could still be named due to https://github.com/rust-lang/rust/pull/95956 to existing yet.

Then, `core::array` got stabilized and `std::array` got added, first targeting 1.36.0 in https://github.com/rust-lang/rust/pull/60657, but then getting backported for 1.35.0 in https://github.com/rust-lang/rust/pull/60838.

This means that `core::array` and `std::array` actually got stabilized in 1.35.0 and `core::array::TryFromSliceError` was accessible through the unstable module in 1.34.0 -- mark them as such so that the docs display the correct versions.
2024-11-02 12:14:13 +01:00
Matthias Krüger
6eeb286289
Rollup merge of #132481 - lukas-code:doc-stab3, r=GuillaumeGomez
rustdoc: skip stability inheritance for some item kinds

For some item kinds it's incorrect to inherit their parent's stability, because they might be accessible without referring to the parent directly -- This PR removes the stability inheritance for these items and reverts their displayed stability to that before https://github.com/rust-lang/rust/pull/130798.

Impl items, both inherent and trait impls, have a stability, but it is ignored when checking for enabled features. However, impl items are automatically unstable if they're nested inside an unstable module -- this caused the children of impl to inherit the instability and lead to https://github.com/rust-lang/rust/issues/132440.

Furthermore, for associated items only the stability of the associated item itself is checked and not that of its parent impl. This is true even for trait impls and we have [relied on this behavior in the standard library in the past](https://doc.rust-lang.org/1.37.0/std/slice/trait.SliceConcatExt.html#tymethod.concat), so these also shouldn't inherit the impl's stability.

I've also removed the stability inheritance for primitives and keywords so that viewing e.g. [the `i32` docs on `core`](https://doc.rust-lang.org/nightly/core/primitive.i32.html) will no longer show "since 1.6.0". Note that we currently don't annotate stability for the keyword docs, but if we start doing so in the future then this is probably more correct.

fixes (after backport) https://github.com/rust-lang/rust/issues/132440
2024-11-02 12:14:12 +01:00
Jubilee Young
a953b3251f miri: Directly use rustc_abi 2024-11-02 04:06:23 -07:00
Ralf Jung
52666238cf remove const_hash feature leftovers 2024-11-02 11:27:14 +01:00
Ralf Jung
34432f7494 const_with_hasher test: actually construct a usable HashMap 2024-11-02 11:27:14 +01:00
Ralf Jung
720d618b5f unicode_data.rs: show command for generating file 2024-11-02 10:06:52 +01:00
Ralf Jung
66351a6184 get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
bors
588a420350 Auto merge of #132497 - matthiaskrgr:rollup-gaskcn0, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`)
 - #132170 (Add a Few Codegen Tests)
 - #132333 (rust_analyzer_helix.toml: add library/ manifest)
 - #132398 (Add a couple of intra-doc links to str)
 - #132411 (CI: switch dist-x86_64-musl to free runner)
 - #132453 (Also treat `impl` definition parent as transparent regarding modules)
 - #132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test)
 - #132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`)
 - #132466 (Account for late-bound depth when capturing all opaque lifetimes.)
 - #132471 (Add a bunch of mailmap entries)
 - #132488 (Remove or fix some more `FIXME(async_closure)`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-02 08:25:59 +00:00
Matthias Krüger
30497b05cd
Rollup merge of #132488 - compiler-errors:more-fixmes-bye, r=jieyouxu
Remove or fix some more `FIXME(async_closure)`

Self-explanatory
2024-11-02 08:33:15 +01:00
Matthias Krüger
b9798d3f22
Rollup merge of #132471 - Noratrieb:lots-of-mailmapping, r=Mark-Simulacrum
Add a bunch of mailmap entries

This adds a bunch of missing mailmap entries for many people. These are needed when using rust-lang/team information in rust-lang/thanks (https://github.com/rust-lang/thanks/pull/53), as the emails there may differ.

These are "easy" ones, where there was a mailmap entry already, making it clear which one is the preferred email address.
2024-11-02 08:33:15 +01:00
Matthias Krüger
020b63aebc
Rollup merge of #132466 - cjgillot:opaque-late, r=compiler-errors
Account for late-bound depth when capturing all opaque lifetimes.

Fixes https://github.com/rust-lang/rust/issues/132429

r? ````@compiler-errors````
2024-11-02 08:33:14 +01:00
Matthias Krüger
737cc83c3f
Rollup merge of #132465 - ismailarilik:refactor/config/remove-fixme-comment-for-omit-git-hash, r=jieyouxu
refactor(config): remove FIXME statement in comment of `omit-git-hash`

It is already fixed.
2024-11-02 08:33:14 +01:00
Matthias Krüger
b1d059fc2b
Rollup merge of #132457 - taiki-e:needless-feature, r=workingjubilee
Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test

inline assembly is already stable on this architecture.
2024-11-02 08:33:13 +01:00
Matthias Krüger
fa69b671a9
Rollup merge of #132453 - Urgau:non_local_defs-impl-mod-transparent, r=jieyouxu
Also treat `impl` definition parent as transparent regarding modules

This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules.

See tests and explanation in the changes.

``````@rustbot`````` label +L-non_local_definitions
Fixes *(after beta-backport)* #132427
cc ``````@leighmcculloch``````
r? ``````@jieyouxu``````
2024-11-02 08:33:13 +01:00
Matthias Krüger
e5269bba2d
Rollup merge of #132411 - MarcoIeni:ci-switch-to-free-runners, r=Kobzol
CI: switch dist-x86_64-musl to free runner

try-job: dist-x86_64-musl
2024-11-02 08:33:12 +01:00
Matthias Krüger
ec1cebfcb6
Rollup merge of #132398 - krtab:add_doc_link, r=Noratrieb
Add a couple of intra-doc links to str
2024-11-02 08:33:11 +01:00
Matthias Krüger
4b7bfaaf69
Rollup merge of #132333 - tshepang:patch-4, r=workingjubilee
rust_analyzer_helix.toml: add library/ manifest
2024-11-02 08:33:11 +01:00
Matthias Krüger
a513e0e983
Rollup merge of #132170 - veera-sivarajan:codegen-tests, r=jieyouxu
Add a Few Codegen Tests

Closes #86109
Closes #64219

Those issues somehow got fixed over time.

So, this PR adds a couple of codegen tests to ensure we don't regress in the future.
2024-11-02 08:33:10 +01:00
Matthias Krüger
bb544f863f
Rollup merge of #131037 - madsmtm:move-llvm-target-versioning, r=petrochenkov
Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`

Fully specified LLVM targets contain the OS version on macOS/iOS/tvOS/watchOS/visionOS, and this version depends on the deployment target environment variables like `MACOSX_DEPLOYMENT_TARGET`, `IPHONEOS_DEPLOYMENT_TARGET` etc.

We would like to move this to later in the compilation pipeline, both because it feels impure to access environment variables when fetching target information, but mostly because we need access to more information from https://github.com/rust-lang/rust/pull/130883 to do https://github.com/rust-lang/rust/issues/118204. See also https://github.com/rust-lang/rust/pull/129342#issuecomment-2335156119 for some discussion.

The first and second commit does the actual refactor, it should be a non-functional change, the third commit adds diagnostics for invalid deployment targets, which are now possible to do because we have access to the session.

Tested with the same commands as in https://github.com/rust-lang/rust/pull/130435.

r? ``````@petrochenkov``````
2024-11-02 08:33:10 +01:00
onur-ozkan
329dacff10 add change entry for library profile update
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-02 10:18:09 +03:00
onur-ozkan
7fd3ce4b4b make download-rustc="if-unchanged" default for library profile
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-02 10:13:55 +03:00
Houtamelo
102fac7af6
Remove unintended link
Since `#[link_section]` is enclosed in braces, it was being confused with a link during docs compilation.
2024-11-02 04:09:17 -03:00
Houtamelo
1acb1043fe
Fix type reference in documents which was being confused with html tags. 2024-11-02 04:02:32 -03:00
Veera
d2aa91054b Add a Few Codegen Tests 2024-11-02 05:33:56 +00:00
bors
b5f4883a06 Auto merge of #132352 - DianQK:llvm/19.1.3, r=nikic
Update LLVM to 19.1.3

Closes #131031.

r? nikic
2024-11-02 04:59:26 +00:00
Michael Goulet
9e5e47fc32 Remove or fix some FIXME(async_closure) 2024-11-02 03:33:31 +00:00
Esteban Küber
143b072c62 Account for negative bounds in E0277 note and suggestion
Do not suggest `#[derive(Copy)]` when we wanted a `!Copy` type.

Do not say "`Copy` is not implemented for `T` but `Copy` is".

Do not talk about `Trait` having no implementations when `!Trait` was desired.
2024-11-02 03:08:04 +00:00
Esteban Küber
1a0c502183 On long E0277 primary span label, move it to a help
Long span labels don't read well.
2024-11-02 03:08:04 +00:00
Esteban Küber
092ecca5b9 Point at tail expression on rpit E0277
```
error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}: Coroutine` is not satisfied
  --> $DIR/gen_block_is_coro.rs:6:13
   |
LL | fn foo() -> impl Coroutine<Yield = u32, Return = ()> {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}`
LL |     gen { yield 42 }
   |     ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` here
```

The secondary span label is new.
2024-11-02 03:08:04 +00:00
Esteban Küber
86b5965608 Use short_ty_string 2024-11-02 03:08:04 +00:00
Esteban Küber
c6017badb4 Fix type shortening writing to file
Make sure that we append to the file for long ty paths. Do not write the same type more than once. Shorten the calculated width a bit.
2024-11-02 03:08:04 +00:00
Esteban Küber
7b9105dd88 Trim output of E0277 in some cases
Remove default note for "trait is not implemented" in favor of the
more colorful diff output from the previous commit. Removes
duplicated output.
2024-11-02 03:08:04 +00:00
Esteban Küber
b7fc1a7431 Add trait diff highlighting logic and use it in E0277
When a trait is not implemented for a type, but there *is* an `impl`
for another type or different trait params, we format the output to
use highlighting in the same way that E0308 does for types.

The logic accounts for 3 cases:
- When both the type and trait in the expected predicate and the candidate are different
- When only the types are different
- When only the trait generic params are different

For each case, we use slightly different formatting and wording.
2024-11-02 03:08:04 +00:00
bors
ef972a3466 Auto merge of #132475 - weihanglo:update-cargo, r=weihanglo
Update cargo

18 commits in e75214ea4936d2f2c909a71a1237042cc0e14b07..0310497822a7a673a330a5dd068b7aaa579a265e
2024-10-25 16:34:32 +0000 to 2024-11-01 19:27:56 +0000
- Add more metadata to `rustc_fingerprint` (rust-lang/cargo#14761)
- test(rustfix): switch to a simpler case for dedup-suggestions (rust-lang/cargo#14765)
- chore(deps): update rust crate security-framework to v3 (rust-lang/cargo#14766)
- chore(deps): update rust crate gix to 0.67.0 (rust-lang/cargo#14762)
- fix(util): Respect all `..`s in `normalize_path` (rust-lang/cargo#14750)
- test(doc): Resolve flaky test (rust-lang/cargo#14760)
- refactor(test): Remove dead 'expect_stdout_contains_n' check (rust-lang/cargo#14759)
- add unstable -Zroot-dir flag to configure the path from which rustc should be invoked (rust-lang/cargo#14752)
- docs(resolver): Further v3 prep (rust-lang/cargo#14753)
- fix: track version in fingerprint dep-info files (rust-lang/cargo#14751)
- test: Remove unused msrv-policy (rust-lang/cargo#14748)
- download targeted transitive deps of with artifact deps'  target platform (rust-lang/cargo#14723)
- Remove requirement for --target when invoking Cargo with -Zbuild-std (rust-lang/cargo#14317)
- docs(fingerprint): document the encoding of Cargo's depinfo (rust-lang/cargo#14745)
- Allow build scripts to report error messages through `cargo::error` (rust-lang/cargo#14743)
- fix(publish): Downgrade version-exists error to warning on dry-run (rust-lang/cargo#14742)
- fix: clean up for deprecated and removed commands (rust-lang/cargo#14739)
- Deprecate `cargo verify-project` (rust-lang/cargo#14736)
2024-11-02 01:04:59 +00:00