1
Fork 0
Commit graph

277127 commits

Author SHA1 Message Date
Jakub Beránek
ca8b12eb54 Print how to rebless Python formatting in tidy 2024-12-31 15:45:21 +01:00
Noratrieb
a985205e08 Add more mailmap entries
The people updated in this commit have contributed under different email
addresses than the ones they have used in rust-lang/team.

A new change will use team data for thanks reviewers, which requires this to be in
sync.
Therefore, I have updated many of the people that I've noticed being
duplicated after the change.
2024-12-31 15:06:20 +01:00
Max Heller
17d512ab59 Use id attribute for <a> tags instead of deprecated name attribute (#2184) 2024-12-31 22:02:50 +08:00
onur-ozkan
6eb9ebf1d6 add test coverage for helpers::is_path_in_submodule
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-31 16:34:21 +03:00
Matthias Krüger
0c94f631d8
Rollup merge of #134956 - compiler-errors:format-args-hidden-chars, r=jieyouxu
Account for C string literals and `format_args` in `HiddenUnicodeCodepoints` lint

This is stacked on #134955, and either that can land first or both of them can land together here. I split this out because this is a bit more involved of an impl.

Fixes #94945
2024-12-31 14:30:44 +01:00
Matthias Krüger
852440ba5f
Rollup merge of #134953 - DiuDiu777:unaligned-doc, r=RalfJung
Fix doc for read&write unaligned in zst operation

### PR Description
This PR addresses an inconsistency in the Rust documentation regarding `read_unaligned ` and `write_unaligned` on zero-sized types (ZSTs). The current documentation for [pointer validity](https://doc.rust-lang.org/nightly/std/ptr/index.html#safety) states that for zero-sized types (ZSTs), null pointers are valid:
> For zero-sized types (ZSTs), every pointer is valid, including the null pointer.

However, there is an inconsistency in the documentation for the unaligned read operation in the function [ptr::read_unaligned](https://doc.rust-lang.org/nightly/std/ptr/fn.read_unaligned.html)(as well as `write_unaligned`), which states:
> Note that even if T has size 0, the pointer must be non-null.

This change is also supported by [PR #134912](https://github.com/rust-lang/rust/pull/134912)
> the _unaligned method docs should be fixed.
2024-12-31 14:30:43 +01:00
Matthias Krüger
d08d132524
Rollup merge of #134918 - ChrisDenton:issue-70093, r=jieyouxu
Windows: Enable issue 70093 link tests

Tracking issue for `-Z link-native-libraries`: #134948
Tracking issue for `-Z link-directives`: #134947

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.
2024-12-31 14:30:43 +01:00
Matthias Krüger
3e888820bd
Rollup merge of #134610 - tbu-:pr_doc_target_fmt, r=Noratrieb
Format `build.toml` consistently in platform support docs

Also fix compiler team name in target tier docs.
2024-12-31 14:30:42 +01:00
onur-ozkan
b1b576da4d handle submodules automatically on doc steps
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-31 16:24:58 +03:00
bors
7a0cde96f8 Auto merge of #134620 - ChrisDenton:line-writer, r=tgross35
Avoid short writes in LineWriter

If the bytes written to `LineWriter` contains at least one new line but doesn't end in a new line (e.g. `"abc\ndef"`) then we:

- write up to the last new line direct to the underlying `Writer`.
- copy as many of the remaining bytes as will fit into our internal buffer.

That last step is inefficient if the remaining bytes are larger than our buffer. It will needlessly split the bytes in two, requiring at least two writes to the underlying `Writer` (one to flush the buffer, one more to write the rest). This PR skips the extra buffering if the remaining bytes are larger than the buffer.
2024-12-31 13:21:27 +00:00
Noratrieb
ed63d5ead5 Make Boxy UwU 2024-12-31 13:34:13 +01:00
Jakub Beránek
787c2a2c6a Reformat Python file 2024-12-31 13:14:04 +01:00
Jakub Beránek
bbb5ca7c79 Enable Python formatting checks in tidy on CI 2024-12-31 13:13:15 +01:00
Zalathar
66fd5340ea Use struct-like syntax in tool_check_step!
This tricks rustfmt into formatting the macro arguments as expressions, instead
of giving up and ignoring them.
2024-12-31 22:26:14 +11:00
Zalathar
774e83cea1 Make tool_check_step! always assume SourceType::InTree
All of the tools that use this macro are currently in-tree, so support for
specifying a `SourceType` was not meaningfully used. It can potentially be
re-added in the future if needed.
2024-12-31 22:12:59 +11:00
Zalathar
c59ccae739 Infer tool-check-step display name from the last path component 2024-12-31 22:12:59 +11:00
Zalathar
1afeeef77d Move most of the Step::run impl out of tool_check_step!
Ordinary code is much easier to work with than macro-generated code.
2024-12-31 22:12:59 +11:00
bors
aea4e43703 Auto merge of #134959 - jhpratt:rollup-vxt40of, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - #134291 (Use python built in type annotations in LLDB visualizer scripts)
 - #134857 (Unsafe binder support in rustdoc)
 - #134957 (chore: fix some typos)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-31 10:36:06 +00:00
Jacob Pratt
77926e68d8
Rollup merge of #134957 - peicuiping:master, r=lqd
chore: fix some typos
2024-12-31 03:38:04 -05:00
Jacob Pratt
3785bc26c2
Rollup merge of #134857 - compiler-errors:rustdoc-unsafe-binders, r=camelid
Unsafe binder support in rustdoc

Adds rustdoc support for unsafe binder types: `unsafe<'a> Foo<'a>`. Doesn't add json support yet.

Tracking:
* https://github.com/rust-lang/rust/issues/130516
2024-12-31 03:38:03 -05:00
Jacob Pratt
f3d404a7be
Rollup merge of #134291 - Walnut356:type_annots, r=tgross35
Use python built in type annotations in LLDB visualizer scripts

Replaces type annotation comments with python's built-in type annotations.

Built-in type annotations were added in python 3.5. LLDB [currently recommends (and as of LLVM 21, will enforce)](https://github.com/llvm/llvm-project/pull/114807) a minimum python version of 3.8. Rust's test suite also requires python 3.10.
2024-12-31 03:38:02 -05:00
peicuiping
09541c263e chore: fix some typos
Signed-off-by: peicuiping <ezc5@sina.cn>
2024-12-31 15:11:18 +08:00
Walnut
693a0d5dcc use python built in type annotations 2024-12-31 00:53:59 -06:00
bors
41b579660c Auto merge of #134952 - Zalathar:rollup-i6g97md, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - #134919 (bootstrap: Make `./x test compiler` actually run the compiler unit tests)
 - #134927 (Make slice::as_flattened_mut unstably const)
 - #134930 (ptr docs: make it clear that we are talking only about memory accesses)
 - #134932 (explicitly set float ABI for all ARM targets)
 - #134933 (Make sure we check the future type is `Sized` in `AsyncFn*`)
 - #134934 (Fix typos)
 - #134941 (compiler: Add a statement-of-intent to `rustc_abi`)
 - #134949 (Convert some `Into` impls into `From` impls)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-31 05:51:35 +00:00
Michael Goulet
ea291e5b5f Account for format_args in HiddenUnicodeCodepoints lint 2024-12-31 05:03:22 +00:00
Michael Goulet
c6afe82b8a Make parsed string literal fields named 2024-12-31 04:55:10 +00:00
Michael Goulet
54e33bbdec Account for C string literals in HiddenUnicodeCodepoints lint 2024-12-31 04:53:00 +00:00
ericlehong
e34465f852 Fix typos
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-31 12:33:36 +08:00
Stuart Cook
2491edab30
Rollup merge of #134949 - compiler-errors:froms, r=jieyouxu
Convert some `Into` impls into `From` impls

From the [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) docs:

> One should always prefer implementing `From` over [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) because implementing `From` automatically provides one with an implementation of [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) thanks to the blanket implementation in the standard library.
>
> Only implement [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) when targeting a version prior to Rust 1.41 and converting to a type outside the current crate. `From` was not able to do these types of conversions in earlier versions because of Rust’s orphaning rules. See [Into](https://doc.rust-lang.org/std/convert/trait.Into.html) for more details.

Some of these impls are likely from before 1.41, and then some others were probably just mistakes. Building nightly rust is definitely not supported on 1.41, so let's modernize these impls :D
2024-12-31 14:12:49 +11:00
Stuart Cook
7da22aa6c3
Rollup merge of #134941 - workingjubilee:rustc-abi-normal, r=Noratrieb
compiler: Add a statement-of-intent to `rustc_abi`

This just documents the most basic idea of what the crate is even for in my view, rather than leaving that strewn about GitHub issues, PR reviews, and Zulip streams. In particular, I hope to make it clearer what code should go in `rustc_abi` and what should not, which is of immediate relevance to contributors.

I considered going even further and explaining ideas like "ABI compatibility", prologues, and so on. However, because of the cross-cutting nature of ABI, I think such explanations should probably live in the place for cross-cutting documents: the rustc dev guide. This is only meant to be a quick "by the way".
2024-12-31 14:12:48 +11:00
Stuart Cook
f3748c4fe0
Rollup merge of #134934 - Noname-Official:patch-1, r=saethlin
Fix typos
2024-12-31 14:12:48 +11:00
Stuart Cook
a93bef6161
Rollup merge of #134933 - compiler-errors:async-fn-future-sized, r=lqd
Make sure we check the future type is `Sized` in `AsyncFn*`

Fixes #134817
2024-12-31 14:12:47 +11:00
Stuart Cook
e49929e44d
Rollup merge of #134932 - RalfJung:arm-float-abi, r=workingjubilee
explicitly set float ABI for all ARM targets

We currently always set the `FloatABIType` field in the LLVM target machine to `Default`, which means LLVM infers the ARM float ABI (hard vs soft) from the LLVM target triple. This causes problems such as having to set the LLVM triple to `*-gnueabi` for our `musleabi` targets to ensure they get correctly inferred as soft-float targets. It also means rustc doesn't really know which float ABI ends up being used, which is a blocker for https://github.com/rust-lang/rust/pull/134794. So I think we should stop doing that and instead explicitly control that value. That's what this PR implements.

See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fwg-llvm/topic/Softfloat.20ABI.2C.20hardfloat.20instructions) for more context.

Best reviewed commit-by-commit. I hope I got all those `llvm_floatabi` values right...
2024-12-31 14:12:47 +11:00
Stuart Cook
fa6990c16e
Rollup merge of #134930 - RalfJung:ptr-docs-valid-access, r=jhpratt
ptr docs: make it clear that we are talking only about memory accesses

This should make it harder to take this sentence out of context and misunderstand it.
2024-12-31 14:12:46 +11:00
Stuart Cook
1200d3d733
Rollup merge of #134927 - DaniPopes:const-as_flattened_mut, r=scottmcm
Make slice::as_flattened_mut unstably const

Tracking issue: https://github.com/rust-lang/rust/issues/95629

Unblocked by const_mut_refs being stabilized: https://github.com/rust-lang/rust/pull/129195
2024-12-31 14:12:46 +11:00
Stuart Cook
a777f4a793
Rollup merge of #134919 - Zalathar:x-test-compiler, r=jieyouxu
bootstrap: Make `./x test compiler` actually run the compiler unit tests

Fixes #134916.
2024-12-31 14:12:45 +11:00
bors
80f5a81df9 Auto merge of #134929 - compiler-errors:style-edition-2024, r=ytmimi
Stabilize `style_edition = "2024"` in-tree

This PR stabilizes the `style_edition` flag in rustfmt.

**Why am I doing this in-tree?** The beta release cut is imminent (according to forge, on January 3) and this is the most lightweight approach to getting this flag stable on nightly. It's imperative (as far as I can tell -- `@traviscross` can verify or disagree) that we stabilize the `style_edition` flag so that users can control their style edition separately from the edition.

I'm happy to move this PR to the rustfmt repo and subsequently prepare a subtree sync if someone on `@rust-lang/rustfmt` believes that we should get this landed on the rustfmt side then synced. If this is the right recourse, I'd like to note that this is still quite time-sensitive. However, I'm happy to dedicate time to get this done if necessary, since I'd really like to un-jeopardize the style edition.

Tracking:

- https://github.com/rust-lang/rust/issues/123799
2024-12-31 03:05:49 +00:00
LemonJ
d9ef419c90 fix doc for read write unaligned in zst operation 2024-12-31 10:59:13 +08:00
Chris Denton
dc1f2be449
Add comments to -Zlink-* tests 2024-12-31 02:25:35 +00:00
Michael Goulet
f28e13b055 Fix span for IndexMut method call on HashMap/BTreeMap 2024-12-31 02:21:17 +00:00
Michael Goulet
6a3474e653 Use if-let in structured suggestion instead of Option::map 2024-12-31 02:21:17 +00:00
Michael Goulet
aea2a6f836 Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
Michael Goulet
b994124778 Explain how to mutate a HashMap/BTreeMap with more nuance 2024-12-31 01:20:53 +00:00
Michael Goulet
aac741a465 Unsafe binder support in rustdoc 2024-12-31 01:08:43 +00:00
Michael Goulet
f694db1e28 Stabilize style_edition 2024 in-tree 2024-12-31 00:50:21 +00:00
Michael Goulet
ed9a4cfdeb Make sure we check the future type is Sized in AsyncFn* 2024-12-31 00:46:46 +00:00
Zalathar
796835f376 Make ./x test compiler actually run the compiler unit tests 2024-12-31 10:52:33 +11:00
bors
4e5fec2f1e Auto merge of #134757 - RalfJung:const_swap, r=scottmcm
stabilize const_swap

libs-api FCP passed in https://github.com/rust-lang/rust/issues/83163.

However, I only just realized that this actually involves an intrinsic. The intrinsic could be implemented entirely with existing stable const functionality, but we choose to make it a primitive to be able to detect more UB. So nominating for `@rust-lang/lang`  to make sure they are aware; I leave it up to them whether they want to FCP this.

While at it I also renamed the intrinsic to make the "nonoverlapping" constraint more clear.

Fixes #83163
2024-12-30 23:46:42 +00:00
Jubilee Young
c0d3634af8 compiler: Add a statement-of-intent to rustc_abi 2024-12-30 15:21:27 -08:00
Chris Denton
7d5ff8b8bd
Windows: Enable issue 70093 link tests 2024-12-30 22:52:23 +00:00