1
Fork 0
Commit graph

274191 commits

Author SHA1 Message Date
bors
e5f0d6ffbd Auto merge of #134803 - clubby789:strip-debuginfo, r=Kobzol
Strip debuginfo from rustc-main and rustdoc

r? `@Kobzol`
Split from #134690
2024-12-27 16:50:53 +00:00
bors
6d3db555e6 Auto merge of #134822 - jieyouxu:rollup-5xuaq82, r=jieyouxu
Rollup of 8 pull requests

Successful merges:

 - #134606 (ptr::copy: fix docs for the overlapping case)
 - #134622 (Windows: Use WriteFile to write to a UTF-8 console)
 - #134759 (compiletest: Remove the `-test` suffix from normalize directives)
 - #134787 (Spruce up the docs of several queries related to the type/trait system and const eval)
 - #134806 (rustdoc: use shorter paths as preferred canonical paths)
 - #134815 (Sort triples by name in platform_support.md)
 - #134816 (tools: fix build failure caused by PR #134420)
 - #134819 (Fix mistake in windows file open)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-27 13:01:07 +00:00
许杰友 Jieyou Xu (Joe)
5544091054
Rollup merge of #134819 - ChrisDenton:trunc, r=Mark-Simulacrum
Fix mistake in windows file open

In #134722 this should have been `c::FileAllocationInfo` not `c::FileEndOfFileInfo`. Oops.
2024-12-27 20:44:15 +08:00
许杰友 Jieyou Xu (Joe)
f65dc4f375
Rollup merge of #134816 - Integral-Tech:pathbuf-refactor, r=lqd
tools: fix build failure caused by PR #134420

Someone reports build failure after merging pull request #134420: https://github.com/rust-lang/rust/pull/134420#discussion_r1898081258

This pull request fixes the build failure.
2024-12-27 20:44:15 +08:00
许杰友 Jieyou Xu (Joe)
3980cc6521
Rollup merge of #134815 - 9names:sort_platform_md_targets, r=jieyouxu
Sort triples by name in platform_support.md

When looking for riscv32emc support, I missed it at first because it was at the end of the tier3 target list [here](https://doc.rust-lang.org/rustc/platform-support.html#tier-3). These lists are *mostly* dictionary sorted so I assumed it should be near the riscv32i* targets.

This PR puts all targets back in dictionary order. There were only a few outside of tier3.

I ended up writing a small program to sort them because I did not trust myself to do it manually, but I stopped short of fully automating it.
I have manually reviewed the output to confirm it still has the same number of entries, and that the changed values do follow the ordering I would expect.

For folks who would prefer to review code than manual textual changes, the sorting program (including inputs) is [here.](https://github.com/9names/platform_sort_arch/blob/main/src/main.rs)
2024-12-27 20:44:14 +08:00
许杰友 Jieyou Xu (Joe)
d419cc7c6a
Rollup merge of #134806 - notriddle:notriddle/parent-path-is-better, r=GuillaumeGomez
rustdoc: use shorter paths as preferred canonical paths

This is a solution to [the `std::sync::poison` linking problem](https://github.com/rust-lang/rust/pull/134692#issuecomment-2560373308), and, in general, makes intra-doc links shorter and clearer.

> Done. This helped with the search, but not with the things like `MutexGuard`'s doc's reference to `Mutex::lock` being converted to the absolute (unstable) `std::sync::poison::Mutex` path.

cc `@tgross35`

r? `@GuillaumeGomez`
2024-12-27 20:44:13 +08:00
许杰友 Jieyou Xu (Joe)
72ef16f519
Rollup merge of #134787 - fmease:spruce-up-queries, r=compiler-errors
Spruce up the docs of several queries related to the type/trait system and const eval

- Editorial
  - Proper rustdoc summary/synopsis line by making use of extra paragraphs: Leads to better rendered output on module pages, in search result lists and overall, too
  - Use rustdoc warning blocks for admonitions of the form "do not call / avoid calling this query directly"
  - Use intra-doc links of the form ``[`Self::$query`]`` to cross-link queries. Indeed, such links are generally a bit brittle due to the existence of `TyCtxtFeed` which only contains a subset of queries. Therefore the docs of `feedable` queries cannot cross-link to non-`feedable` ones. I'd say it's fine to use intra-doc links despite the potential/unlikely occasional future breakage (if a query with the aforementioned characteristics becomes `feedable`). `Self::` is nicer than `TyCtxt::` (which would be more stable) since it accounts for other contexts like `TyCtxt{Feed,At,Ensure{,WithValue}}`
- Informative
  - Generally add, flesh out and correct some doc comments
  - Add *Panic* sections (to a few selected queries only). The lists of panics aren't necessarily exhaustive and focus on the more "obvious" or "important" panics.
  - Where applicable add a paragraph calling attention to the relevant [`#[rustc_*]` TEST attribute](https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#rustc_-test-attributes)

The one non-doc change (it's internal and not observable):
Be even more defensive in `query constness`'s impl (spiritual follow-up to #134122) (see self review comment).

Fixes #133494.

r\? **any**(compiler-errors, oli-obk)
2024-12-27 20:44:13 +08:00
许杰友 Jieyou Xu (Joe)
bc3e8917e3
Rollup merge of #134759 - Zalathar:normalize, r=jieyouxu
compiletest: Remove the `-test` suffix from normalize directives

This suffix was an artifact of using the same condition-checking engine as the `ignore-*` and `only-*` directives, but in practice we have only 2 tests that legitimately use a condition, and both of them only care about 32-bit vs 64-bit.

This PR detaches `normalize-*` directives from the condition checker, and replaces it with a much simpler system of four explicit `NormalizeKind` values. It then takes advantage of that simplicity to get rid of the `-test` suffix.

---

Addresses one of the points of #126372.

The new name-checking code is a bit quaint, but I think it's a definite improvement over the status quo.

---

The corresponding dev-guide update is https://github.com/rust-lang/rustc-dev-guide/pull/2172.

r? jieyouxu
2024-12-27 20:44:12 +08:00
许杰友 Jieyou Xu (Joe)
7bbbfc650d
Rollup merge of #134622 - ChrisDenton:write-file-utf8, r=Mark-Simulacrum
Windows: Use WriteFile to write to a UTF-8 console

If the console code page is UTF-8 then we can simply write to it without needing to convert to UTF-16 and calling `WriteConsole`.
2024-12-27 20:44:11 +08:00
许杰友 Jieyou Xu (Joe)
b9df376189
Rollup merge of #134606 - RalfJung:ptr-copy-docs, r=Mark-Simulacrum
ptr::copy: fix docs for the overlapping case

Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/549

As discussed in that issue, it doesn't make any sense for `copy` to read a byte via `src` after it was already written via `dst`. The entire point of this method is that is copies correctly even if they overlap, and that requires always reading any given location before writing it.

Cc `@rust-lang/opsem`
2024-12-27 20:44:11 +08:00
León Orell Valerian Liehr
454c09e355
Spruce up the docs of several queries related to the type/trait system and const eval 2024-12-27 11:44:23 +01:00
bors
42591a4cc0 Auto merge of #134786 - ChrisDenton:fix-rename-symlink, r=tgross35
Fix renaming symlinks on Windows

Previously we only detected mount points and not other types of links when determining reparse point behaviour.

Also added some tests to avoid this regressing again in the future.
2024-12-27 10:14:53 +00:00
Chris Denton
54b130afa2
Fix renaming symlinks on Windows
Previously we only detected mount points and not other types of links when determining reparse point behaviour.
2024-12-27 10:07:10 +00:00
Chris Denton
0af396f183
Fix mistake in windows file open 2024-12-27 09:20:37 +00:00
Zalathar
835fbcbcab Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
Zalathar
5ba0dd4ef6 Don't use parse_cfg_name_directive for normalize directives
This is a little more verbose, but also more explicit, and avoids invoking the
full condition engine when only the pointer-width conditions are used.
2024-12-27 19:58:14 +11:00
Integral
c5e4b72a41
tools: fix build failure caused by PR #134420 2024-12-27 16:36:48 +08:00
9names
2855098a51 Sort triples by name in platform_support.md 2024-12-27 17:51:11 +11:00
bors
207ed1b185 Auto merge of #134812 - jhpratt:rollup-a9klvez, r=jhpratt
Rollup of 8 pull requests

Successful merges:

 - #131522 ([macro_metavar_expr_concat] Fix #128346)
 - #134379 (Add `into_array` conversion destructors for `Box`, `Rc`, and `Arc`.)
 - #134644 (Document collection `From` and `FromIterator` impls that drop duplicate keys.)
 - #134649 (Fix forgetting to save statx availability on success)
 - #134728 (Use scoped threads in `std::sync::Barrier` examples)
 - #134782 (Update Code Example for `Iterator::rposition`)
 - #134789 (unwinding: bump version to fix naked_asm on Xous)
 - #134791 (docs: inline `std::ffi::c_str` types to `std::ffi`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-27 03:28:21 +00:00
Jacob Pratt
c1447e3449
Rollup merge of #134791 - notriddle:notriddle/inline-ffi-error-types, r=tgross35
docs: inline `std::ffi::c_str` types to `std::ffi`

Rustdoc has no way to show that an item is stable, but only at a different path. `std::ffi::c_str::NulError` is not stable, but `std::ffi::NulError` is.

To avoid marking these types as unstable when someone just wants to follow a link from `CString`, inline them into their stable paths.

Fixes #134702

r? `@tgross35`
2024-12-26 21:56:51 -05:00
Jacob Pratt
5a57d10589
Rollup merge of #134789 - betrusted-io:bump-unwinding-to-0.25.0, r=Mark-Simulacrum
unwinding: bump version to fix naked_asm on Xous

With #80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream.

Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes #134403.
2024-12-26 21:56:51 -05:00
Jacob Pratt
0bfd367612
Rollup merge of #134782 - wtlin1228:docs/iter-rposition, r=Mark-Simulacrum
Update Code Example for `Iterator::rposition`

Added an additional assertion to the example to show the behavior of `iter.next_back` after using `iter.rposition`.
2024-12-26 21:56:50 -05:00
Jacob Pratt
50c3696735
Rollup merge of #134728 - deltragon:barrier-doc, r=tgross35
Use scoped threads in `std::sync::Barrier` examples

This removes boilerplate around `Arc`s and makes the code more clear.
2024-12-26 21:56:50 -05:00
Jacob Pratt
0521d6cf2c
Rollup merge of #134649 - SUPERCILEX:statx-remember, r=thomcc
Fix forgetting to save statx availability on success

Looks like we forgot to save the statx state on success which means the first failure (common when checking if a file exists) will always require spending an invalid statx to confirm the failure is real.

r? `@thomcc`
2024-12-26 21:56:49 -05:00
Jacob Pratt
9551808f42
Rollup merge of #134644 - kpreid:duplicates, r=Mark-Simulacrum
Document collection `From` and `FromIterator` impls that drop duplicate keys.

This behavior is worth documenting because there are other plausible alternatives, such as panicking when a duplicate is encountered, and it reminds the programmer to consider whether they should, for example, coalesce duplicate keys first.

Followup to #89869.
2024-12-26 21:56:48 -05:00
Jacob Pratt
b618af13cf
Rollup merge of #134379 - bjoernager:slice-as-array, r=dtolnay
Add `into_array` conversion destructors for `Box`, `Rc`, and `Arc`.

Tracking issue: #133508

This PR adds the `into_array` destructor for `alloc::boxed::Box<[T]>`, `alloc::rc::Rc<[T]>`, and `alloc::sync::Arc<[T]>`.

Note that this PR assumes the initial proposal of these functions returning `Option`. It is still an open question whether this should instead be `Result`. We can, however, easily change this in a follow-up PR with the necessary consensus.
2024-12-26 21:56:48 -05:00
Jacob Pratt
b919afa70f
Rollup merge of #131522 - c410-f3r:unlock-rfc-2011, r=chenyukang
[macro_metavar_expr_concat] Fix #128346

Fix #128346
Fix #131393

The syntax is invalid in both issues so I guess that theoretically the compiler should have aborted early.

This PR tries to fix a local problem but let me know if there are better options.

cc `@petrochenkov` if you are interested
2024-12-26 21:56:47 -05:00
Zalathar
d997bc998e Simplify or delete normalize directives that don't care about bit-width 2024-12-27 12:42:07 +11:00
Michael Howell
da1c1c33ab Adjust test for slightly changed inlining behavior 2024-12-26 18:31:55 -07:00
Michael Howell
fc8a541eaa docs: inline core::ffi::c_str types to core::ffi 2024-12-26 15:51:45 -07:00
Michael Howell
16a4ad7d7b rustdoc: use shorter paths as preferred canonical paths
This is a solution to the `std::sync::poison` linking problem,
and, in general, makes intra-doc links shorter and clearer.
2024-12-26 15:46:36 -07:00
clubby789
e5f676521c Strip debuginfo from rustc-main and rustdoc 2024-12-26 22:34:09 +00:00
bors
917bfa7847 Auto merge of #134795 - GuillaumeGomez:rollup-9x8n7pi, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #134656 (Migrate `incr-add-rust-src-component` to rmake)
 - #134664 (Account for removal of multiline span in suggestion)
 - #134772 (Improve/cleanup rustdoc code)
 - #134781 (Add more `begin_panic` normalizations to panic backtrace tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-26 21:04:12 +00:00
Guillaume Gomez
3d50eba781
Rollup merge of #134781 - Zalathar:backtrace, r=SparrowLii,jieyouxu
Add more `begin_panic` normalizations to panic backtrace tests

Since #123244, these tests have started failing locally on some systems (#133997) due to minor variations in how `begin_panic` is printed in the backtrace.

The variation appears to occur on macOS when `rust.debuginfo-level = "line-tables-only"` is set, which is the default in `config.compiler.toml`. It does not occur when the debuginfo level is set to 1.

The variation doesn't seem relevant to these tests, so this PR simply adds another custom normalization rule to account for the variation.

---

Will conflict with #134759.
2024-12-26 19:30:29 +01:00
Guillaume Gomez
3e02ddb234
Rollup merge of #134772 - GuillaumeGomez:improve-rustdoc, r=notriddle
Improve/cleanup rustdoc code

Ran clippy on rustdoc, always beneficial. :)

r? `@notriddle`
2024-12-26 19:30:29 +01:00
Guillaume Gomez
88687d4459
Rollup merge of #134664 - estebank:sugg-highlighting, r=jieyouxu
Account for removal of multiline span in suggestion

When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line.

Fix #134485.

![Screenshot of the highlighted output](https://github.com/user-attachments/assets/18bcd9bc-3bec-4b79-a9d7-e4ea4e6289ad)
2024-12-26 19:30:28 +01:00
Guillaume Gomez
c016cd8670
Rollup merge of #134656 - jieyouxu:migrate-incr-add-rust-src-component, r=wesleywiser
Migrate `incr-add-rust-src-component` to rmake

This PR partially supersedes #128562, and ports the Makefile-based `tests/run-make/incr-add-rust-src-component` to use rmake.rs infra.

Part of #121876.

This run-make test is a regression test for https://github.com/rust-lang/rust/issues/70924. It (tries to) checks that if we add the `rust-src` component in between two incremental compiles, that the compiler doesn't ICE on the second invocation.

- Original issue:https://github.com/rust-lang/rust/issues/70924
- Fix PR: https://github.com/rust-lang/rust/pull/72767
- PR adding this regression test: https://github.com/rust-lang/rust/pull/72952

However, the Makefile version of this used `$SYSROOT/lib/rustlib/src/rust/src/libstd/lib.rs`, but that actually got moved around and reorganized over the years. As of Dec 2024, the `rust-src` component is more like (specific for our purposes):

```
$SYSROOT/lib/rustlib/src/rust/
    library/std/src/lib.rs
    src/
```

However, this run-make test is ancient and it exercises incr-comp system logic. I'm not sure if this test would actually catch the original regression.

This PR was co-authored with `@Oneirical.`

r? incremental

try-job: i686-msvc
try-job: x86_64-mingw-1
try-job: x86_64-msvc
try-job: aarch64-apple
2024-12-26 19:30:28 +01:00
bors
19e75f4fb3 Auto merge of #134788 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update

r? `@Manishearth`
2024-12-26 18:19:55 +00:00
Esteban Küber
12d66d9506 Account for removal of multiline span in suggestion
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line.

Fix #134485.
2024-12-26 17:41:43 +00:00
Michael Howell
40b0026a2f docs: inline std::ffi::c_str types to std::ffi
Rustdoc has no way to show that an item is stable,
but only at a different path. `std::ffi::c_str::NulError` is
not stable, but `std::ffi::NulError` is.

To avoid marking these types as unstable when someone just
wants to follow a link from `CString`, inline them into their
stable paths.
2024-12-26 08:58:17 -07:00
bors
4ed8cf4237 Auto merge of #134774 - jyn514:rustc-dev-short-backtraces, r=jieyouxu
fix default-backtrace-ice test

when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error:
```
failures:

---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ----
Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr"
diff of stderr:

7
8	aborting due to `-Z treat-err-as-bug=1`
9	stack backtrace:
-	(end_short_backtrace)
-	(begin_short_backtrace)
-	(end_short_backtrace)
-	(begin_short_backtrace)
+	      [... omitted 22 frames ...]
+
```
(note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.)

this is a regression from setting RUST_BACKTRACE=1 by default in https://github.com/rust-lang/rust/pull/134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests.

cc https://github.com/rust-lang/rust/pull/129658#issuecomment-2561988081

r? `@jieyouxu`
2024-12-26 15:41:37 +00:00
Sean Cross
f806357999 unwinding: bump version to fix asm
With #80608 the `unwinding` crate no longer builds. The upstream crate
has been updated to build by manually adding directives to the naked_asm
stream.

Bump the dependency in Rust to get this newer version. This fixes the
build for Xous, and closes #134403.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-12-26 16:11:44 +01:00
Philipp Krones
8a7d8ece32
Merge commit '609cd310be' into clippy-subtree-update 2024-12-26 15:15:54 +01:00
Philipp Krones
609cd310be
Rustup (#13881)
r? @ghost

changelog: none
2024-12-26 13:52:31 +00:00
Philipp Krones
416f7e84c0
Bump nightly version -> 2024-12-26 2024-12-26 14:47:30 +01:00
Philipp Krones
14af404672
Merge remote-tracking branch 'upstream/master' into rustup 2024-12-26 14:46:57 +01:00
bors
e2848a05a9 Auto merge of #134784 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-12-26 13:02:16 +00:00
Philipp Krones
dff0294ab3
fix examples using Ty.kind() in the book (#13875)
`Ty.kind()` is a method.

changelog: none
2024-12-26 12:31:32 +00:00
bors
78af7da26d Auto merge of #132431 - shahn:from_iterator_more_tuples, r=Amanieu
From iterator for more tuples
2024-12-26 09:11:06 +00:00
Ralf Jung
60e3bf4374
Merge pull request #4109 from RalfJung/flags
Error on some invalid flag combinations
2024-12-26 08:12:36 +00:00