Commit graph

284990 commits

Author SHA1 Message Date
Michael Goulet
6756e3da5a
Rollup merge of #138509 - reddevilmidzy:add-test, r=compiler-errors
Add test to ensure no index out of bounds panic (#135474)

Adds test for #135474
2025-03-23 14:59:31 -04:00
Michael Goulet
856ba39bd9
Rollup merge of #138293 - clubby789:doc-cfg-gate, r=GuillaumeGomez
rustdoc: Gate unstable `doc(cfg())` predicates

Fixes #138113

Since the extraction process treats `cfg(true)` as having no cfg attribute, we have to do the gating during parsing; so we remove the unused `features` arg from `Cfg::matches`
2025-03-23 14:59:30 -04:00
Michael Goulet
d7c5f5f319
Rollup merge of #138236 - Ayush1325:uefi-event, r=petrochenkov
uefi: Add OwnedEvent abstraction

- Events are going to become quite important for Networking, so needed owned abstractions.
- Switch to OwnedEvent abstraction for Exit boot services event.

cc ````@nicholasbishop````
2025-03-23 14:59:30 -04:00
Michael Goulet
145fe2d648
Rollup merge of #136040 - mu001999-contrib:cleanup, r=Mark-Simulacrum
Remove unused trait BoundedSize

Detected by #128637

The usage of this trait is removed in #135104

r? `@the8472`
2025-03-23 14:59:29 -04:00
Urgau
7210df1a9a Rework --print options documentation 2025-03-23 19:52:58 +01:00
Michael Goulet
fad34c603c Explicitly don't fold coroutine obligations in writeback 2025-03-23 18:34:33 +00:00
Michael Goulet
d588bc2a2b Don't super fold const in Resolver 2025-03-23 18:18:47 +00:00
Michael Goulet
575f129faa Obligation::as_goal 2025-03-23 18:18:47 +00:00
Michael Goulet
77a106e61f Remove STILL_FURTHER_SPECIALIZABLE special casing 2025-03-23 18:13:52 +00:00
Michael Goulet
e4f13e3ccd Remove HAS_TY_COROUTINE 2025-03-23 18:03:09 +00:00
Michael Goulet
e934975339 Visit coroutine kind ty in FlagComputation 2025-03-23 18:03:09 +00:00
Michael Goulet
eb3707e4b4 Stabilize precise_capturing_in_traits 2025-03-23 14:11:04 +00:00
bors
aa8f0fd716 Auto merge of #136929 - joboet:move_process_pal, r=Mark-Simulacrum
std: move process implementations to `sys`

As per #117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
2025-03-23 14:10:35 +00:00
Jieyou Xu
f10b58714e
Say which test failed the COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS assertion 2025-03-23 19:28:33 +08:00
Jieyou Xu
f2cde8eeb4
Adjust rustc-print-info-issue-138612.rs
- Document test intent to check for `-Whelp` suggestion if
  `--print=lints` was specified.
- Move this test under `tests/ui/print-request/` and rename it to
  `print-lints-help.rs` to better reflect what it is checking.
2025-03-23 19:08:56 +08:00
Jieyou Xu
f1b8d89659
Rebless tests with changed help due to new print request option 2025-03-23 19:08:55 +08:00
Jieyou Xu
13530afc08
Document supported-crate-types print request in unstable book 2025-03-23 19:08:55 +08:00
Jieyou Xu
0e7dbab1fc
Implement supported-crate-types print request
As an unstable print request.
2025-03-23 19:08:54 +08:00
bors
97fc1f62d8 Auto merge of #138602 - Veykril:push-purxoytpktpu, r=SparrowLii
Slim `rustc_parse_format` dependencies down

`rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead. This allows the crate to built without having to wait for `syn` (pulled in by `rustc_index_macros`)

Alternatively we could inline the macro, though from the looks of it that will run into trouble with `rustc_randomized_layouts`
2025-03-23 10:00:10 +00:00
Takayuki Maeda
34b7d51b95 fix typo 2025-03-23 17:47:10 +09:00
Takayuki Maeda
20f4a0d586 fix ICE #138415 2025-03-23 17:02:42 +09:00
Lukas Wirth
5950c862bd Slim rustc_parse_format dependencies down
`rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead
2025-03-23 07:30:18 +01:00
bors
60a3084f64 Auto merge of #136769 - thaliaarchi:io-optional-methods/stdio, r=joboet
Provide optional `Read`/`Write` methods for stdio

Override more of the default methods for `io::Read` and `io::Write` for stdio types, when efficient to do so, and deduplicate unsupported types.

Tracked in https://github.com/rust-lang/rust/issues/136756.

try-job: x86_64-msvc-1
2025-03-23 06:23:51 +00:00
Chiichen
fa0c951a27 doc: rename reference #create-a-configtoml to #create-a-bootstraptoml 2025-03-23 12:41:23 +08:00
bors
f08d5c01e6 Auto merge of #138833 - joboet:optimize-repeat-n, r=thomcc
core: optimize `RepeatN`

...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
2025-03-23 03:11:13 +00:00
bors
756bff97ea Auto merge of #138841 - matthiaskrgr:rollup-bfkls57, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #138018 (rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.)
 - #138294 (Mark some std tests as requiring `panic = "unwind"`)
 - #138468 (rustdoc js: add nonnull helper and typecheck src-script.js)
 - #138675 (Add release notes for 1.85.1)
 - #138765 (Fix Thread::set_name on cygwin)
 - #138786 (Move some driver code around)
 - #138793 (target spec check: better error when llvm-floatabi is missing)
 - #138822 (De-Stabilize `file_lock`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-22 23:59:01 +00:00
bors
b48576b4db Auto merge of #138831 - matthiaskrgr:rollup-3t0dqiz, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #138609 (Add stack overflow handler for cygwin)
 - #138639 (Clean UI tests 2 of n)
 - #138773 (catch_unwind intrinsic: document return value)
 - #138782 (test(ui): add tuple-struct-where-clause-suggestion ui test for #91520)
 - #138794 (expand: Do not report `cfg_attr` traces on macros as unused attributes)
 - #138801 (triagebot: add autolabel rules for D-* and L-*)
 - #138804 (Allow inlining for `Atomic*::from_ptr`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-22 20:52:30 +00:00
Matthias Krüger
3f59916a30
Rollup merge of #138822 - moxian:unlock, r=joshtriplett
De-Stabilize `file_lock`

This reverts #136794

FCP on the tracking issue (#130994) passsed successfully https://github.com/rust-lang/rust/issues/130994#issuecomment-2646158607 but there are now concerns about the suitability of the proposed API (https://github.com/rust-lang/rust/issues/130994#issuecomment-2734608366)

On zullip it was [suggested](506823067) that it would be better to temporarily(?) destabilize the feature ASAP to buy us some more time reflecting on the API.

This PR implements the revert.

The feature is not currently on beta (https://github.com/rust-lang/rust/blob/beta/library/std/src/fs.rs#L672) so a beta backport is not yet neccessary.

If this revert is accepted, the tracking issue (#130994) should be reopened
2025-03-22 21:34:40 +01:00
Matthias Krüger
7372f2812b
Rollup merge of #138793 - RalfJung:arm-floatabi, r=Noratrieb
target spec check: better error when llvm-floatabi is missing
2025-03-22 21:34:39 +01:00
Matthias Krüger
4457da3dc4
Rollup merge of #138786 - bjorn3:driver_code_move, r=compiler-errors
Move some driver code around

`--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run before codegen and thus work even if codegen fails. This can help with debugging.
2025-03-22 21:34:39 +01:00
Matthias Krüger
9a9859637a
Rollup merge of #138765 - Berrysoft:cygwin-thread-name, r=joboet
Fix Thread::set_name on cygwin

Just like Linux, Cygwin also sets a limitation to thread name.

8e50c7af7c/winsup/cygwin/thread.cc (L3175)
2025-03-22 21:34:38 +01:00
Matthias Krüger
8986c532c4
Rollup merge of #138675 - cuviper:release-1.85.1, r=Urgau
Add release notes for 1.85.1

Closes #138819.
2025-03-22 21:34:37 +01:00
Matthias Krüger
26ecbc68ef
Rollup merge of #138468 - lolbinarycat:rustdoc-js-less-expect-error-part3, r=notriddle
rustdoc js: add nonnull helper and typecheck src-script.js

this removes ``@ts-nocheck`` from `src-script.js` and adds a `nonnull` helper function that assists in adding null checks to places where null values should be impossible.

r? `@notriddle`
2025-03-22 21:34:37 +01:00
Matthias Krüger
53076de369
Rollup merge of #138294 - paulmenage:test-panic-unwind, r=bjorn3
Mark some std tests as requiring `panic = "unwind"`

This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
2025-03-22 21:34:36 +01:00
Matthias Krüger
c5a5f8a74a
Rollup merge of #138018 - obi1kenobi:pg/librustdoc_repr_attr, r=aDotInTheVoid
rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.

Switch away from `Debug`-like representation of `#[repr(..)]` attributes, and start using rustdoc's own logic for pretty-printing `#[repr(..)]` in rustdoc JSON.

Part of addressing #137645 but not a complete solution for it.

r? `@aDotInTheVoid`
2025-03-22 21:34:35 +01:00
Predrag Gruevski
bafdbcadd5 rustdoc: Use own logic to print #[repr(..)] attributes in JSON output. 2025-03-22 18:47:12 +00:00
binarycat
b46412f6d7 rustdoc: be more strict about "Methods from Deref"
hack: is_doc_subtype_of always returns true for TyAlias

it's worth noting that this function is only used in
the handling of "Methods from Deref", and we were previously
assuming all generic parameters were meaningless,
so this is still an improvment from the status quo.

this change means that we will have strictly less false positives
without adding any new false negitives.

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-03-22 12:47:05 -05:00
Vadim Petrochenkov
c25e4bfe68 resolve: Avoid some unstable iteration 3 2025-03-22 20:45:06 +03:00
Josh Stone
f39478f8a5 Clarify "Windows 1607" 2025-03-22 09:50:07 -07:00
bors
d93f678fa5 Auto merge of #138830 - matthiaskrgr:rollup-gaxgfwl, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #138410 (Couple mir building cleanups)
 - #138490 (Forward `stream_position` in `Arc<File>` as well)
 - #138535 (Cleanup `LangString::parse`)
 - #138536 (stable_mir: Add `MutMirVisitor`)
 - #138673 (Fix build failure on Trusty)
 - #138750 (Make `crate_hash` not iterate over `hir_crate` owners anymore)
 - #138763 (jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-22 14:03:50 +00:00
Jakub Beránek
e9ddf54d16 Group test diffs by stage in post-merge analysis 2025-03-22 14:00:30 +01:00
joboet
51d51c8666
core: optimize RepeatN
...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
2025-03-22 13:35:46 +01:00
joboet
89f85cbfa7
std: move process implementations to sys
As per #117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
2025-03-22 12:42:34 +01:00
Matthias Krüger
2644500bff
Rollup merge of #138804 - tgross35:atomic-from-ptr-inline, r=RalfJung
Allow inlining for `Atomic*::from_ptr`

Currently this cannot be inlined, which among other things means it can't be used in `compiler-builtins` [1]. These are trivial functions that should be inlineable, so add `#[inline]`.

[1]: https://github.com/rust-lang/compiler-builtins/pull/790#issuecomment-2744371738
2025-03-22 12:00:51 +01:00
Matthias Krüger
5a9d98d1d3
Rollup merge of #138801 - lolbinarycat:triagebot-autolabel-138565, r=Noratrieb
triagebot: add autolabel rules for D-* and L-*

fixes #138565

r? `@Noratrieb`
2025-03-22 12:00:51 +01:00
Matthias Krüger
66c3566b88
Rollup merge of #138794 - petrochenkov:cfgtracefix, r=jieyouxu
expand: Do not report `cfg_attr` traces on macros as unused attributes

Fixes https://github.com/rust-lang/rust/issues/138779
2025-03-22 12:00:50 +01:00
Matthias Krüger
f463e473d9
Rollup merge of #138782 - karolzwolak:where-test-91520, r=compiler-errors
test(ui): add tuple-struct-where-clause-suggestion ui test for #91520

Fixes #91520

I tried to also make it a .fixed test, but I failed to accomplish that.
That's because of the 'consider annotating `Inner<T>` with `#[derive(Clone)]`' suggestion does not compile (conflicting Clone implementations), and I can't isolate them with `rustfix-only-machine-applicable` as both suggestions are not marked as `MachineApplicable`.
Instead I just test that the where clause suggestion is applied to the correct line.
2025-03-22 12:00:50 +01:00
Matthias Krüger
ca86dd5036
Rollup merge of #138773 - RalfJung:catch_unwind_docs, r=jhpratt
catch_unwind intrinsic: document return value

Seems like we forgot to document this. The comment reflects what Miri does, which seems to also match what codegen does at least [in `codegen_gnu_try`](b754ef727c/compiler/rustc_codegen_llvm/src/intrinsic.rs (L953-L964)).
2025-03-22 12:00:49 +01:00
Matthias Krüger
f01d0960e9
Rollup merge of #138639 - spencer3035:clean-ui-tests-2-of-n, r=jieyouxu
Clean UI tests 2 of n

Modified 4 tests in tests/ui. Cleaned 3 and deleted one.

I have a final commit changing the values in `src/tools/tidy/src/ui_tests.rs`.
I wasn't sure if it was best practice to change this value as you go along or
once at the end. I can rebase to something that incrementally changes the value
in the "cleaned" commits if that is preferred.

Related Issues:
#73494
#133895

r? jieyouxu
2025-03-22 12:00:48 +01:00
Matthias Krüger
92caac41ff
Rollup merge of #138609 - Berrysoft:cygwin-stackoverflow, r=joboet
Add stack overflow handler for cygwin

The cygwin runtime handles stack overflow exception and converts it to `SIGSEGV`, but the passed `si_addr` is obtained from `ExceptionInformation[1]` which is actually an undocumented value when stack overflows. Thus I choose to use Windows API directly to register handler, just like how std does on native Windows. The code is basically copied from the Windows one.

Ref:
* 5ec497dc80/winsup/cygwin/exceptions.cc (L822-L823)
* https://learn.microsoft.com/zh-cn/windows/win32/api/winnt/ns-winnt-exception_record
2025-03-22 12:00:48 +01:00