1
Fork 0
Commit graph

281545 commits

Author SHA1 Message Date
Pavel Grigorenko
f53d0f502d invalid_from_utf8[_unchecked]: also lint inherent methods 2025-02-16 16:34:51 +03:00
Urgau
2a8fbb5f56 Re-add missing empty lines in the releases notes 2025-02-16 12:15:55 +01:00
bors
23032f31c9 Auto merge of #136363 - notriddle:notriddle/unresolved-link-unused-refdef, r=GuillaumeGomez
rustdoc: improve refdef handling in the unresolved link lint

This commit takes advantage of a feature in pulldown-cmark that makes the list of link definitions available to the consuming application. It produces unresolved link warnings for refdefs that aren't used, and can now produce exact spans for the dest even when it has escapes.

Closes #133150 since this lint would have caught the mistake in that issue, and, along with https://github.com/rust-lang/rust-clippy/pull/13707, most mistakes in this class should produce a warning from one of them.
2025-02-16 10:59:42 +00:00
许杰友 Jieyou Xu (Joe)
05ba1a450a rustc-dev-guide: document COMPILER and COMPILER_FOR tracing targets 2025-02-16 18:47:57 +08:00
许杰友 Jieyou Xu (Joe)
7b118168c7 bootstrap: take target by value in is_builder_target 2025-02-16 18:47:57 +08:00
许杰友 Jieyou Xu (Joe)
b621a485fa bootstrap: add more tracing to compiler/std/llvm flows 2025-02-16 18:47:57 +08:00
Chris Denton
95a5ecc995
Enable relative-path-include-bytes on Windows 2025-02-16 10:40:04 +00:00
onur-ozkan
56f8f48e05 fix broken x {doc, build} core
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-16 12:14:34 +03:00
Chris Denton
8ae3ca98e5
Fix test that relies on error language 2025-02-16 09:08:24 +00:00
Chris Denton
f396a31075
Add an example for std::error::Error 2025-02-16 08:14:41 +00:00
bit-aloo
f6c911ab43
add unit test for cc-detect 2025-02-16 13:31:20 +05:30
bit-aloo
6bdf3407b4
add docs to cc-detect 2025-02-16 13:31:20 +05:30
bors
4229b80f50 Auto merge of #137111 - jhpratt:rollup-izd98sx, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - #135797 (Import initial generated 1.85 relnotes)
 - #135909 (Export kernel descriptor for amdgpu kernels)
 - #136545 (nvptx64: update default alignment to match LLVM 21)
 - #137092 (abi_unsupported_vector_types: say which type is the problem)
 - #137097 (Ignore Self in bounds check for associated types with Self:Sized)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-16 07:54:08 +00:00
Scott McMurray
7e35729bfc Don't project into NonNull when dropping a Box 2025-02-15 23:20:52 -08:00
Jacob Pratt
7884e171f7
Rollup merge of #137097 - compiler-errors:sized-bound-self, r=oli-obk
Ignore Self in bounds check for associated types with Self:Sized

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

This is morally a fix of https://github.com/rust-lang/rust/pull/112319, since the `Self: Sized` check was just missing here.

r? oli-obk
2025-02-16 00:51:25 -05:00
Jacob Pratt
f10f0f09c8
Rollup merge of #137092 - RalfJung:abi_unsupported_vector_types-better-error, r=compiler-errors
abi_unsupported_vector_types: say which type is the problem
2025-02-16 00:51:25 -05:00
Jacob Pratt
d3556c6644
Rollup merge of #136545 - durin42:nvptx64-align, r=nikic
nvptx64: update default alignment to match LLVM 21

This changed in llvm/llvm-project@91cb8f5d32. The commit itself is mostly about some intrinsic instructions, but as an aside it also mentions something about addrspace for tensor memory, which I believe is what this string is telling us.

`@rustbot` label: +llvm-main
2025-02-16 00:51:24 -05:00
Jacob Pratt
20004d4bdd
Rollup merge of #135909 - Flakebi:amdgpu-kd, r=jieyouxu,workingjubilee
Export kernel descriptor for amdgpu kernels

The host runtime (HIP or HSA) expects a kernel descriptor object for each kernel in the ELF file. The amdgpu LLVM backend generates the object. It is created as a symbol with the name of the kernel plus a `.kd` suffix.

Add it to the exported symbols in the linker script, so that it can be found.

For reference, the symbol is created here in LLVM: d5457e4c16/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp (L966)
I wrote [a test](6a9115b121) for this as well, I’ll add that once the target is merged and working.
With this, all PRs to get working code for amdgpu are open (this + the target + the two patches adding addrspacecasts for alloca and global variables).

Tracking issue: #135024

r? `@workingjubilee`
2025-02-16 00:51:24 -05:00
Jacob Pratt
aa37d799fc
Rollup merge of #135797 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
Import initial generated 1.85 relnotes

https://forge.rust-lang.org/release/release-notes.html#release-team-step-5-publish-relnotes-pr

r? rust-lang/release
2025-02-16 00:51:23 -05:00
bors
c3fe9e7e4d Auto merge of #137078 - bjorn3:sync_cg_clif-2025-02-15, r=bjorn3
Subtree sync for rustc_codegen_cranelift

This fixes a miscompilation (https://github.com/rust-lang/rustc_codegen_cranelift/issues/1560)

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-02-16 04:42:16 +00:00
Zachary S
0f220efb1a Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str. 2025-02-15 21:02:00 -06:00
bors
500a686ba8 Auto merge of #137093 - matthiaskrgr:rollup-72j7mut, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #127581 (Fix crate name validation)
 - #136490 (Do not allow attributes on struct field rest patterns)
 - #136808 (Try to recover from path sep error in type parsing)
 - #137055 (rustdoc: Properly restore search input placeholder)
 - #137068 (fix(rustdoc): Fixed `Copy Item Path` in rust doc)
 - #137070 (Do not generate invalid links in job summaries)
 - #137074 (compiletest: add `{ignore,only}-rustc_abi-x86-sse2` directives)
 - #137076 (triagebot.toml: ping me on changes to `tests/rustdoc-json`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-16 01:29:09 +00:00
Mark Rousskov
8aa2290b86 Add relnotes for 1.85 2025-02-15 18:16:05 -05:00
León Orell Valerian Liehr
84bdc5de6e
HIR analysis: Remove unnecessary abstraction over list of clauses 2025-02-15 23:54:53 +01:00
bors
e72df78268 Auto merge of #137034 - cuviper:version-1.87.0, r=cuviper
Bump to version 1.87.0

https://forge.rust-lang.org/release/process.html#bump-the-stable-version-number-friday-the-week-before

r? cuviper
2025-02-15 22:19:13 +00:00
Michael Goulet
17071ff8a5 Rework name_regions to not rely on reverse scc graph for non-member-constrain usages 2025-02-15 21:49:53 +00:00
Michael Goulet
309e371f7b Ignore Self in bounds check for associated types with Self:Sized 2025-02-15 20:38:14 +00:00
Michael Howell
4d551dd754 docs: fix broken intra-doc links that never worked 2025-02-15 12:21:38 -07:00
Michael Howell
61a97448e5 rustdoc: improve refdef handling in the unresolved link lint
This commit takes advantage of a feature in pulldown-cmark that
makes the list of link definitions available to the consuming
application. It produces unresolved link warnings for refdefs
that aren't used, and can now produce exact spans for the dest
even when it has escapes.
2025-02-15 12:21:35 -07:00
Matthias Krüger
b3d5a770f6
Rollup merge of #137076 - aDotInTheVoid:pingme-pingme-pingme, r=jieyouxu
triagebot.toml: ping me on changes to `tests/rustdoc-json`
2025-02-15 20:15:03 +01:00
Matthias Krüger
77ed54ad7d
Rollup merge of #137074 - jieyouxu:rustc_abi, r=onur-ozkan
compiletest: add `{ignore,only}-rustc_abi-x86-sse2` directives

As requested in https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/compiletest.20target.20selection.20is.20way.20too.20rigid, cc `@RalfJung`

r? bootstrap (or compiler)
2025-02-15 20:15:02 +01:00
Matthias Krüger
6a7bff2915
Rollup merge of #137070 - Kobzol:ci-summary-invalid-link, r=marcoieni
Do not generate invalid links in job summaries

Avoid [this](https://github.com/rust-lang-ci/rust/actions/runs/13341911341#summary-37267605606). It has bugged me for quite some time :) When a directory is empty, the `*.xz` bash glob "expands" to a file called `*.xz`.

r? `@marcoieni`
2025-02-15 20:15:01 +01:00
Matthias Krüger
29e2caf7c3
Rollup merge of #137068 - tapanprakasht:fix-copy-item-path, r=aDotInTheVoid
fix(rustdoc): Fixed `Copy Item Path` in rust doc

This PR aims to address the issue reported by https://github.com/rust-lang/rust/issues/137048
Issue caused by previous changes for removing `@ts-expect-error` by this change 2ea95f8670
2025-02-15 20:15:00 +01:00
Matthias Krüger
df7002fac0
Rollup merge of #137055 - fmease:rustdoc-js-fix-input-placeholder-logic, r=notriddle
rustdoc: Properly restore search input placeholder

Fix the search input placeholder literally getting set to the string *undefined* on blur/defocus.
This was caused by us trying to access an undefined property in the event listener.
To prevent this from regressing again, stop typescript from ignoring the relevant site.

Steps to reproduce the bug fixed in this PR:

1. Focus the search input field by clicking on it and clear the input if necessary
2. Blur/defocus it by clicking somewhere outside of it

---

First bug that would've been caught by TSC if we had had it earlier! Type (quasi-)safety, ahoy! :)
2025-02-15 20:15:00 +01:00
Matthias Krüger
f06b75d86d
Rollup merge of #136808 - chenyukang:yukang-fix-arg-list-error-129273, r=estebank
Try to recover from path sep error in type parsing

Fixes #129273

Error using `:` in the argument list may mess up the parser.

case `tests/ui/suggestions/struct-field-type-including-single-colon` also changed, seems it's  the same meaning, should be OK.

r? `@estebank`
2025-02-15 20:14:59 +01:00
Matthias Krüger
06b2f6208a
Rollup merge of #136490 - Skepfyr:no-field-rest-pattern-attrs, r=compiler-errors
Do not allow attributes on struct field rest patterns

Fixes #81282.

This removes support for attributes on struct field rest patterns (the `..` bit) from the parser. Previously any attributes were being parsed but dropped from the AST, so didn't work and were deleted by rustfmt.

This needs an equivalent change to the reference but I wanted to see how this PR is received first.
The error message it produces isn't great, however it does match the error you get if you try to add attributes to .. in struct expressions atm, although I can understand wanting to do better given this was previously accepted. I think I could move attribute parsing back up to where it was and then emit a specific new error for this case, however I might need some guidance as this is the first time I've messed around inside the compiler.

While this is technically breaking I don't think it's much of an issue: attributes in this position don't currently do anything and rustfmt outright deletes them, meaning it's incredibly unlikely to affect anyone. I have already made the equivalent change to *add* support for attributes (mostly) but the conversation in the linked issue suggested it would be more reasonable to just remove them (and pointed out it's much easier to add support later if we realise we need them).
2025-02-15 20:14:58 +01:00
Matthias Krüger
522c8f7617
Rollup merge of #127581 - fmease:fix-crate_name-validation, r=bjorn3
Fix crate name validation

Reject macro calls inside attribute `#![crate_name]` like in `#![crate_name = concat!("na", "me")]`.

Prior to #117584, the result of the expansion (here: `"name"`) would actually be properly picked up by the compiler and used as the crate name. However since #117584 / on master, we extract the "value" (i.e., the *literal* string literal) of the `#![crate_name]` much earlier in the pipeline way before macro expansion and **skip**/**ignore** any `#![crate_name]`s "assigned to" a macro call. See also #122001.

T-lang has ruled to reject `#![crate_name = MACRO!(...)]` outright very similar to other built-in attributes whose value we need early like `#![crate_type]`. See accepted FCP: https://github.com/rust-lang/rust/issues/122001#issuecomment-2023203182.

Note that the check as implemented in this PR is even more "aggressive" compared to the one of `#![crate_type]` by running as early as possible in order to reject `#![crate_name = MACRO!(...)]` even in "non-normal" executions of `rustc`, namely on *print requests* (e.g., `--print=crate-name` and `--print=file-names`). If I were to move the validation step a bit further back close to the `#![crate_type]` one, `--print=crate-name` (etc.) would *not* exit fatally with an error in this kind of situation but happily report an incorrect crate name (i.e., the "crate name" as if `#![crate_name]` didn't exist / deduced from other sources like `--crate-name` or the file name) which would match the behavior on master. Again, see also #122001.

I'm mentioning this explicitly because I'm not sure if it was that clear in the FCP'ed issue. I argue that my current approach is the most reasonable one. I know (from reading the code and from past experiments) that various print requests are still quite broken (mostly lack of validation).

To the best of my knowledge, there's no print request whose output references/contains a crate *type*, so there's no "inherent need" to move `#![crate_type]`'s validation to happen earlier.

---

Fixes #122001.

https://github.com/rust-lang/rust/labels/relnotes: Compatibility. Breaking change.
2025-02-15 20:14:58 +01:00
Ralf Jung
313e8526dc abi_unsupported_vector_types: say which type is the problem 2025-02-15 20:02:16 +01:00
Ben Kimock
1d7cf0ff40 Replace some u64 hashes with Hash64 2025-02-15 13:59:09 -05:00
bors
9cd60bd2cc Auto merge of #137057 - weihanglo:update-cargo, r=weihanglo
Update cargo

13 commits in 2928e32734b04925ee51e1ae88bea9a83d2fd451..ce948f4616e3d4277e30c75c8bb01e094910df39
2025-02-07 16:50:22 +0000 to 2025-02-14 20:32:07 +0000
- util: provide a better error message for invalid SSH URLs (rust-lang/cargo#15185)
- Fix the description of the `"root"` field of the `cargo metadata`'s output (rust-lang/cargo#15182)
- refactor: Consolidate creation of SourceId from manifest path (rust-lang/cargo#15172)
- docs(embedded): Note the shebang deviation (rust-lang/cargo#15173)
- refactor(embedded): Integrate cargo-script logic into main parser (rust-lang/cargo#15168)
- feat: implement workspace feature unification (rust-lang/cargo#15157)
- Fix race condition in panic_abort_tests (rust-lang/cargo#15169)
- Update all dependencies (rust-lang/cargo#15166)
- Update curl from 8.9.0 to 8.12.0 (rust-lang/cargo#15162)
- Update annotate-snippets from 0.11.4 to 0.11.5 (rust-lang/cargo#15165)
- Update deny.toml (rust-lang/cargo#15164)
- Update rusqlite from 0.32.1 to 0.33.0 (rust-lang/cargo#15163)
- fix: align first line of unordered list with following (rust-lang/cargo#15161)
2025-02-15 17:58:43 +00:00
Urgau
6ec3cf9abc Load all builtin targets at once instead of one by one
This should give us some performance improvements as we won't need to
do the lookup for the _currently_ 287 targets we have.
2025-02-15 18:49:26 +01:00
León Orell Valerian Liehr
9b6fd35738
Reject macro calls inside of #![crate_name] 2025-02-15 16:47:30 +01:00
许杰友 Jieyou Xu (Joe)
d419da1a49 rustc-dev-guide: document {ignore,only}-rustc_abi-x86-sse2 2025-02-15 23:17:07 +08:00
许杰友 Jieyou Xu (Joe)
880d8c0000 compiletest: add {ignore,only}-rustc_abi-x86-sse2 directives 2025-02-15 23:17:07 +08:00
bors
608e228ca9 Auto merge of #137066 - onur-ozkan:137034-blocker, r=jieyouxu
check if CI-LLVM is enabled before testing it

Blocker for #137034
2025-02-15 14:58:47 +00:00
bjorn3
7a6206e9c4 Merge commit '557ed8ebb7' into sync_cg_clif-2025-02-15 2025-02-15 14:13:01 +00:00
Alona Enraght-Moony
f065a5588e triagebot.toml: ping me on changes to tests/rustdoc-json 2025-02-15 13:07:44 +00:00
bjorn3
557ed8ebb7 Rustup to rustc 1.86.0-nightly (d8810e3e2 2025-02-14) 2025-02-15 12:30:44 +00:00
bors
69fd5e4059 Auto merge of #136828 - yotamofek:pr/rustdoc/more-laziness, r=GuillaumeGomez,aDotInTheVoid
Do more lazy-formatting in `librustdoc` 🦥

Modify some formatting to be lazy, i.e. to not allocate interim strings that are later formatted into different strings.
Commits are small and stand on their own, and should mostly compile separately. (The first one doesn't compile due to `dead_code` because all it does is introduce a helper used in later commits)

Really excited about this one, local perf results are really good. I'd love a perf run to see how this looks on CI. This is the comparison of `instructions:u` count between master and this PR, on my computer:

# Summary
| | Range | Mean | Count |
|:---:|:---:|:---:|:---:|
| Regressions | - | 0.00% | 0 |
| Improvements | -8.03%, -0.40% | -2.93% | 5 |
| All | -8.03%, -0.40% | -2.93% | 5 |

# Primary benchmarks
| Benchmark | Profile | Scenario | % Change | Significance Factor |
|:---:|:---:|:---:|:---:|:---:|
| typenum-1.17.0 | doc | full | -8.03% | 40.16x |
| nalgebra-0.33.0 | doc | full | -4.19% | 20.97x |
| stm32f4-0.14.0 | doc | full | -1.35% | 6.73x |
| libc-0.2.124 | doc | full | -0.67% | 3.33x |
| cranelift-codegen-0.82.1 | doc | full | -0.40% | 1.99x |
2025-02-15 11:57:15 +00:00
bjorn3
91397074fc Sync from rust d8810e3e2d 2025-02-15 11:24:22 +00:00