Commit Graph

277127 Commits

Author SHA1 Message Date
Matthias Krüger
fa5acdc36f
Rollup merge of #134984 - compiler-errors:obligation-tweaks, r=lqd
`ObligationCause` construction tweaks in typeck

Mostly just consolidating the way we construct obligations in `FnCtxt`.
2025-01-01 22:04:17 +01:00
Matthias Krüger
92f56fc150
Rollup merge of #134973 - ericlehong:fix-typo, r=GuillaumeGomez
Fix typos

This PR fixes typos errors in comments and docs.

Thank you very much.
2025-01-01 22:04:16 +01:00
Matthias Krüger
afdb6270ef
Rollup merge of #134967 - onur-ozkan:auto-submodule-handler, r=jieyouxu
handle submodules automatically on `doc` steps

Helps to make `doc` macros less complicated.
2025-01-01 22:04:15 +01:00
Manuel Drehwald
d753cbf779 upstream rustc_codegen_llvm changes for enzyme/autodiff 2025-01-01 21:42:45 +01:00
Michael Goulet
d3c6067275 Fix ICE when opaque captures a duplicated/invalid lifetime 2025-01-01 19:32:51 +00:00
bors
45d11e51bb Auto merge of #134080 - kleisauke:avoid-lfs64-emscripten, r=Noratrieb
Avoid use of LFS64 symbols on Emscripten

Since Emscripten uses musl libc internally.

Non-functional change: all LFS64 symbols were aliased to their non-LFS64 counterparts in rust-lang/libc@7c952dceaa.
2025-01-01 18:55:10 +00:00
Jakub Beránek
3d69dd1661 Do not pass LLD flags to targets flags of compiletest
Not all targets support these flags, so we cannot just pass them to the tests unconditionally. Before, we were using a linker arg (`-Clink-arg=-fuse-ld=lld`), which circumvented this in a hacky way.
2025-01-01 18:50:03 +01:00
Jakub Beránek
ab5446c992 Actually use self-contained lld in bootstrap when use-lld = "self-contained" is used
Before, we just used the global `lld` anyway.
2025-01-01 18:49:07 +01:00
bors
372442fe5f Auto merge of #134964 - Kobzol:tidy-full-check, r=onur-ozkan
Run Python formatting check in tidy on CI

I don't think that there's a reason why we should ignore Python formatting on CI, when we already check Python lints and C++ formatting.

r? `@onur-ozkan`
2025-01-01 16:08:17 +00:00
Jakub Beránek
47e2baa1c9 Remove mention of rustc-dev-guide from toolstate 2025-01-01 17:06:58 +01:00
Jakub Beránek
1820e612d3 Modify rustc-dev-guide triagebot ping list 2025-01-01 17:06:27 +01:00
Jakub Beránek
5c0c0f41f4 Remove obsolete RustcGuide bootstrap step
It was not working for a long time.
2025-01-01 17:06:27 +01:00
Jakub Beránek
59d5328e0a Fix source code path in comment 2025-01-01 17:06:27 +01:00
Jakub Beránek
8decc04e75 Add rustc-dev-guide as a josh subtree 2025-01-01 17:06:11 +01:00
Jakub Beránek
ccee38a930 Removed rustc-dev-guide as a submodule 2025-01-01 17:05:53 +01:00
John Kåre Alsaker
4bf85c25ec Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
Kleis Auke Wolthuizen
b6af0c4836 std::fs::DirEntry.metadata(): prefer use of lstat() on Emscripten
Align it with musl, which also prefers using lstat() here.
2025-01-01 13:21:19 +01:00
Kleis Auke Wolthuizen
ef58e8b989 Avoid use of LFS64 symbols on Emscripten
Since Emscripten uses musl libc internally.

Non-functional change: all LFS64 symbols were aliased to their non-LFS64
counterparts in rust-lang/libc@7c952dceaa.
2025-01-01 13:21:19 +01:00
bors
eeeff9a66c Auto merge of #134969 - Marcondiro:master, r=jhpratt,programmerjake
char to_digit: avoid unnecessary casts to u64

Hello,
in the `char::to_digit` method there are a few `as u64` casts that are not strictly necessary.
I assume that the reason behind these casts is to avoid possible overflows in the `+ 10` add.

This PR removes the aforementioned casts, avoiding the overflow issue by slightly modifying the ASCII letter to int mapping.

Thanks,
Happy new year.
2025-01-01 10:54:12 +00:00
bors
bc3e3015b6 Auto merge of #134992 - Zalathar:rollup-pldy5w6, r=Zalathar
Rollup of 6 pull requests

Successful merges:

 - #131439 (Remove allowing static_mut_refs lint)
 - #133292 (E0277: suggest dereferencing function arguments in more cases)
 - #134877 (add suggestion for wrongly ordered format parameters)
 - #134945 (Some small nits to the borrowck suggestions for mutating a map through index)
 - #134950 (bootstrap: Overhaul and simplify the `tool_check_step!` macro)
 - #134979 (Provide structured suggestion for `impl Default` of type where all fields have defaults)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-01 08:10:15 +00:00
Stuart Cook
65cb7c66d0
Rollup merge of #134979 - estebank:default-lint-sugg, r=compiler-errors
Provide structured suggestion for `impl Default` of type where all fields have defaults

```
error: `Default` impl doesn't use the declared default field values
  --> $DIR/manual-default-impl-could-be-derived.rs:28:1
   |
LL | / impl Default for B {
LL | |     fn default() -> Self {
LL | |         B {
LL | |             x: s(),
   | |                --- this field has a default value
LL | |             y: 0,
   | |                - this field has a default value
...  |
LL | | }
   | |_^
   |
help: to avoid divergence in behavior between `Struct { .. }` and `<Struct as Default>::default()`, derive the `Default`
   |
LL ~ #[derive(Default)] struct B {
   |
```

Note that above the structured suggestion also includes completely removing the manual `impl`, but the rendering doesn't.
2025-01-01 16:35:32 +11:00
Stuart Cook
cf7d7f5096
Rollup merge of #134950 - Zalathar:tool-check-step, r=jieyouxu
bootstrap: Overhaul and simplify the `tool_check_step!` macro

Main changes:

- Pull most of `run` out of the macro and into a regular helper function
- Reduce the number of redundant/unnecessary macro arguments
- Switch to struct-like syntax so that optional arguments are clearer, and so that rustfmt is happy

~~The one “functional” change is that the `-check.stamp` files now get their name from the final path segment, instead of the struct name; in practice this means that they now contain more hyphens in some cases. As far as I'm aware, the exact filename doesn't matter so this should be fine.~~ (that change has been removed from this PR)
2025-01-01 16:35:31 +11:00
Stuart Cook
f91bfd97bf
Rollup merge of #134945 - compiler-errors:map-mutate-nits, r=estebank
Some small nits to the borrowck suggestions for mutating a map through index

1. Suggesting users to either use `.insert` or `.get_mut` (which do totally different things) can be a bit of a footgun, so let's make that a bit more nuanced.
2. I find the suggestion of `.get_mut(|val| { *val = whatever; })` to be a bit awkward. I changed this to be an if-let instead.
3. Fix a bug which was suppressing the structured suggestion for some mutations via the index operator on `HashMap`/`BTreeMap`.

r? estebank or reassign
2025-01-01 16:35:31 +11:00
Stuart Cook
1ea1db5b08
Rollup merge of #134877 - DavisRayM:129966-format-string-help-message, r=estebank
add suggestion for wrongly ordered format parameters

Add suggestion for wrongly ordered format parameters like `?#`.

Supersedes #131004
Fix #129966
2025-01-01 16:35:30 +11:00
Stuart Cook
0204259780
Rollup merge of #133292 - dianne:e0277-suggest-deref, r=estebank
E0277: suggest dereferencing function arguments in more cases

This unifies and generalizes some of the logic in `TypeErrCtxt::suggest_dereferences` so that it will suggest dereferencing arguments to function/method calls in order to satisfy trait bounds in more cases.

Previously it would only fire on reference types, and it had two separate cases (one specifically to get through custom `Deref` impls when passing by-reference, and one specifically to catch #87437). I've based the new checks loosely on what's done for `E0308` in `FnCtxt::suggest_deref_or_ref`: it will suggest dereferences to satisfy trait bounds whenever the referent is `Copy`, is boxed (& so can be moved out of the boxes), or is being passed by reference.

This doesn't make the suggestion fire in contexts other than function arguments or binary operators (which are in a separate case that this doesn't touch), and doesn't make it suggest a combination of `&`-removal and dereferences. Those would require a bit more restructuring, so I figured just doing this would be a decent first step.

Closes #90997
2025-01-01 16:35:30 +11:00
Stuart Cook
f4db757cb5
Rollup merge of #131439 - mu001999-contrib:cleanup/static-mut, r=estebank
Remove allowing static_mut_refs lint
2025-01-01 16:35:29 +11:00
bors
a8953d83cf Auto merge of #134926 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

13 commits in ad2011d3bcad9f152d034faf7635c22506839d58..04d06dfe541607e6419f3d028c3f9b245f3be4d9
2024-12-20 22:44:11 UTC to 2024-12-16 18:18:21 UTC

- Update section name (rust-lang/book#4175)
- Update text to reflect the change from '&str' to 'char' in example (rust-lang/book#4173)
- Update figure number in text and file name (rust-lang/book#4172)
- Fix chapter number (rust-lang/book#4171)
- Delete unused reference (rust-lang/book#4170)
- Remove orphaned half-sentence (rust-lang/book#4169)
- Fix chapter number (rust-lang/book#4168)
- A better phrasing for generic methods. (rust-lang/book#3428)
- Fix minor grammatical error (rust-lang/book#4098)
- Update appendix-06-translation.md to add another Chinese translation. (rust-lang/book#3608)
- Change Korean translation repo to newer (rust-lang/book#3625)
- Clarify/improve readability in Ch. 02 discussion of `Result` variants (rust-lang/book#4167)
- Ch. 20: conclude §01 with a reference to the Rustonomicon (rust-lang/book#4166)

## rust-lang/nomicon

1 commits in 97e84a38c94bf9362b11284c20b2cb4adaa1e868..7ef05b9777c94836bc92f50f23e6e00981521a89
2024-12-30 10:38:10 UTC to 2024-12-30 10:38:10 UTC

- Fix URL fragment to MutexGuard's negative impl of Send (rust-lang/nomicon#472)

## rust-lang/reference

3 commits in 9f41bc11342d46544ae0732caf14ec0bcaf27376..acd6794e712d5e2ef6f5c84fb95688d32a69b816
2024-12-18 23:04:30 +0000 to 2024-12-30 22:12:57 +0000

- Revert "`coverage` attribute" (rust-lang/reference#1706)
- Document Rust 2024 match ergonomics reservations (rust-lang/reference#1702)
- Add documentation for `#[diagnostic::do_not_recommend]` (rust-lang/reference#1663)

## rust-lang/edition-guide

5 commits in bc4ce51e1d4dacb9350a92e95f6159a42de2f8c6..d56e0f3a0656b7702ca466d4b191e16c28262b82
2024-12-18 05:34:59 +0000 to 2024-12-31 20:04:52 +0000

- 2024: Document rustfmt overflow_delimited_expr (rust-lang/edition-guide#352)
- 2024: Document rustfmt fixes (rust-lang/edition-guide#351)
- Update the transitioning steps (rust-lang/edition-guide#350)
- Revert "2024: Assignment operator RHS indentation" (rust-lang/edition-guide#343)
- Revert "2024: Add chapter on single-line `where` clauses" (rust-lang/edition-guide#344)

## rust-lang/rust-by-example

1 commits in 76406337f4131253443aea0ed7e7f451b464117c..093397535b48ae13ec76bc526b7e6eb8c096a85c
2024-12-18 17:29:56 UTC to 2024-12-18 17:29:56 UTC

- Mention that you're not allowed to partially move Drop types (rust-lang/rust-by-example#1902)

## rust-lang/rustc-dev-guide

18 commits in 7f7ba48f04abc2ad25e52f30b5e2bffa286b019f..ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e
2024-12-30 09:22:22 UTC to 2024-12-17 17:00:38 UTC

- Opt into, rather than out of, linkcheck (rust-lang/rustc-dev-guide#2180)
- Remove stale implementation details of coverage instrumentation (rust-lang/rustc-dev-guide#2179)
- Remove properly tracked config file from .gitignore & add support for skipping of link-checking (rust-lang/rustc-dev-guide#2023)
- Add a couple of linkcheck exceptions: (rust-lang/rustc-dev-guide#2120)
- Add missing link for [Node] (rust-lang/rustc-dev-guide#2177)
- Fix 403 received for HEAD request (rust-lang/rustc-dev-guide#2176)
- Start using mdbook-linkcheck2 (rust-lang/rustc-dev-guide#2103)
- Document `x test --no-capture` (rust-lang/rustc-dev-guide#2174)
- Remove the `-test` suffix from normalize directives (rust-lang/rustc-dev-guide#2172)
- Rework the driver docs (rust-lang/rustc-dev-guide#2162)
- Document `forbid-output` for UI tests (rust-lang/rustc-dev-guide#2171)
- completions: Zsh is now supported (rust-lang/rustc-dev-guide#2173)
- region-outlives propagation (rust-lang/rustc-dev-guide#2169)
- compiletest: Document the `--debugger` flag (rust-lang/rustc-dev-guide#2170)
- document the public ci dashboard (rust-lang/rustc-dev-guide#2167)
- Fix trivial typo of "query-fied" (rust-lang/rustc-dev-guide#2165)
- Fix some typos (rust-lang/rustc-dev-guide#2166)
- Add suggestion for `--keep-stage 0` (rust-lang/rustc-dev-guide#2164)
2025-01-01 05:25:45 +00:00
bors
2085bce154 Auto merge of #134988 - tgross35:rollup-s59bx7c, r=tgross35
Rollup of 8 pull requests

Successful merges:

 - #132474 (Add more mailmap entries)
 - #133486 (borrowck diagnostics: make `add_move_error_suggestions` use the HIR rather than `SourceMap`)
 - #134861 (Add GUI test for item info elements color)
 - #134968 (Print how to rebless Python formatting in tidy)
 - #134971 (chore: fix typos)
 - #134972 (add .mailmap entry for myself)
 - #134974 (Revert #119515 single line where clause style guide)
 - #134975 (Revert style guide rhs break)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-01 01:34:29 +00:00
Trevor Gross
9472d32842
Rollup merge of #134975 - ehuss:revert-style-guide-rhs-break, r=compiler-errors
Revert style guide rhs break

This reverts https://github.com/rust-lang/rust/pull/132369 and https://github.com/rust-lang/rust/pull/119838. The style-guide change for indentation of rhs was not implemented in time for the 2024 style edition.
See tracking issue https://github.com/rust-lang/rust/issues/132380.

cc #134974 for the other style guide change in 2024.

r? ``@compiler-errors``
2024-12-31 18:42:26 -05:00
Trevor Gross
fee79a2900
Rollup merge of #134974 - ehuss:revert-single-line-where, r=compiler-errors
Revert #119515 single line where clause style guide

This did not get implemented for the style edition in 2024, so this PR removes it from the documentation.
See tracking issue https://github.com/rust-lang/rust/issues/132381.

This can be added back in the next edition if it gets implemented. I'm a little unclear on what the style team intends for how future changes are documented. For example, the current style-guide documented behavior that rustfmt does not support. I'm not sure who the audience for this document is, or how this is intended to stay in sync with rustfmt. For example, if I read this and assume this is how it is supposed to work, and then rustfmt breaks that, it seems like that is confusing. Similarly, if I'm staying on an older edition, this documentation would be incorrect for my crate.

Perhaps changes like this could be "teed-up" in a PR, but not merged until the edition is stabilized (similar to how the reference works)? And include notes for parts that are edition-specific (so if I am using an older edition, I can see that something is different). In general, I'm a little confused on how this is intended to work.

Reverts:

- https://github.com/rust-lang/rust/pull/119515
2024-12-31 18:42:25 -05:00
Trevor Gross
8a2979c18f
Rollup merge of #134972 - Skgland:master, r=Noratrieb
add .mailmap entry for myself

Seeing #132474 in the bors queue I decided to check myself and noticed I was listed four times.
This fixed that by cannonicalizing all entries to use my username and the github no-reply email address, rather than some combination of name or username and different email addresses.
2024-12-31 18:42:25 -05:00
Trevor Gross
ac4546c9fd
Rollup merge of #134971 - dxsullivan:fix-typo, r=lqd
chore: fix typos

I hope my typo corrections will help you. Thank you for your work.
2024-12-31 18:42:24 -05:00
Trevor Gross
53b99dee15
Rollup merge of #134968 - Kobzol:tidy-bless-log, r=Noratrieb
Print how to rebless Python formatting in tidy

Suggested [here](https://github.com/rust-lang/rust/pull/134964#discussion_r1900124882).

r? ``@Noratrieb``
2024-12-31 18:42:24 -05:00
Trevor Gross
63d5b72482
Rollup merge of #134861 - GuillaumeGomez:item-info-colors, r=fmease
Add GUI test for item info elements color

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

r? ``@fmease``
2024-12-31 18:42:23 -05:00
Trevor Gross
3d3d898a2e
Rollup merge of #133486 - dianne:fix-move-error-suggestion, r=estebank
borrowck diagnostics: make `add_move_error_suggestions` use the HIR rather than `SourceMap`

This PR aims to fix #132806 by rewriting `add_move_error_suggestions`[^1]. Previously, it manually scanned the source text to find a leading `&`, which isn't always going to produce a correct result (see: that issue). Admittedly, the HIR visitor in this PR introduces a lot of boilerplate, but hopefully the logic at its core isn't too complicated (I go over it in the comments). I also tried a simpler version that didn't use a HIR visitor and suggested adding `ref` always, but the `&ref x` suggestions really didn't look good. As a bonus for the added complexity though, it's now able to produce nice `&`-removing suggestions in more cases.

I tried to do this such that it avoids edition-dependent checks and its suggestions can be applied together with those from the match ergonomics 2024 migration lint. I haven't added tests for that since the details of match ergonomics 2024 are still being sorted out, but I can try if desired once that's finalized.

[^1]: In brief, it fires on patterns where users try to bind by-value in such a way that moves out of a reference to a non-Copy type (including slice references with non-copy elements). The suggestions are to change the binding's mode to be by-reference, either by removing[^2] an enclosing `&`/`&mut` or adding `ref` to the binding.

[^2]: Incidentally, I find the terminology of "consider removing the borrow" a bit confusing for a suggestion to remove a `&` pattern in order to make bindings borrow rather than move. I'm not sure what a good, concise way to explain that would be though, and that should go in a separate PR anyway.
2024-12-31 18:42:23 -05:00
Trevor Gross
ecfb85b3e1
Rollup merge of #132474 - Noratrieb:lots-of-mailmapping-round-2, r=Mark-Simulacrum
Add more mailmap entries

If you have been pinged: I'm adding a mailmap entry for you to keep thanks.rust-lang.org working properly.

**I have picked the canonical address mostly arbitrarily. If you want a different one as the canonical address, please tell me here**.

<details>
<summary>more details on the change</summary>

builds on top of #132471, this containing the less obvious changes that add new canonical email addresses instead of just adding new current ones.

The people updated in this commit have contributed under different email
addresses than the ones they have used in rust-lang/team.
https://github.com/rust-lang/thanks/pull/53 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.

</details>

I'm adding a novel entry for you: ``@apiraino`` ``@KodrAus`` ``@cramertj`` ``@sunfishcode`` ``@Eh2406`` ``@skade`` ``@huonw`` ``@jsha`` ``@shepmaster`` ``@workingjubilee`` ``@rbtcollins``  ``@nrc`` ``@fitzgen`` ``@sophiajt`` ``@tmiasko`` ``@notriddle`` ``@TimNN`` ``@WaffleLapkin``
2024-12-31 18:42:22 -05:00
bors
4e59b1da80 Auto merge of #134987 - weihanglo:update-cargo, r=weihanglo
Update cargo

5 commits in c86f4b3a1b153218e6e50861214b0b4b4e695f23..d73d2caf9e41a39daf2a8d6ce60ec80bf354d2a7
2024-12-24 17:49:48 +0000 to 2024-12-31 20:51:21 +0000
- fix(package): warn if symlinks checked out as plain text files (rust-lang/cargo#14994)
- test: track caller for `.crate` file publish verification (rust-lang/cargo#14992)
- test: relax panic output assertion (rust-lang/cargo#14989)
- test: relax `bad_crate_type` to only match error message prefix (rust-lang/cargo#14990)
- refactor(package): split `cargo_package` to modules (rust-lang/cargo#14982)

r? ghost
2024-12-31 22:37:20 +00:00
Weihang Lo
acb38ec197
Update cargo 2024-12-31 17:05:16 -05:00
Michael Sloan
cdd55bfda2 Remove qualification of std::cmp::Ordering in Ord doc 2024-12-31 14:29:03 -07:00
Michael Goulet
1638948890 Obligation tweaks 2024-12-31 20:46:06 +00:00
Eric Huss
40b2cd9dde Update reference, edition-guide 2024-12-31 12:29:50 -08:00
bors
d117b7f211 Auto merge of #132195 - clarfonthey:bigint-mul, r=scottmcm
Tidy up bigint multiplication methods

This tidies up the library version of the bigint multiplication methods after the addition of the intrinsics in #133663. It follows [this summary](https://github.com/rust-lang/rust/issues/85532#issuecomment-2403442775) of what's desired for these methods.

Note that, if `2H = N`, then `uH::MAX * uH::MAX + uH::MAX + uH::MAX` is `uN::MAX`, and that we can effectively add two "carry" values without overflowing.

For ease of terminology, the "low-order" or "least significant" or "wrapping" half of multiplication will be called the low part, and the "high-order" or "most significant" or "overflowing" half of multiplication will be called the high part. In all cases, the return convention is `(low, high)` and left unchanged by this PR, to be litigated later.

## API Changes

The original API:

```rust
impl uN {
    // computes self * rhs
    pub const fn widening_mul(self, rhs: uN) -> (uN, uN);

    // computes self * rhs + carry
    pub const fn carrying_mul(self, rhs: uN, carry: uN) -> (uN, uN);
}
```

The added API:

```rust
impl uN {
    // computes self * rhs + carry1 + carry2
    pub const fn carrying2_mul(self, rhs: uN, carry: uN, add: uN) -> (uN, uN);
}
impl iN {
    // note that the low part is unsigned
    pub const fn widening_mul(self, rhs: iN) -> (uN, iN);
    pub const fn carrying_mul(self, rhs: iN, carry: iN) -> (uN, iN);
    pub const fn carrying_mul_add(self, rhs: iN, carry: iN, add: iN) -> (uN, iN);
}
```

Additionally, a naive implementation has been added for `u128` and `i128` since there are no double-wide types for those. Eventually, an intrinsic will be added to make these more efficient, but rather than doing this all at once, the library changes are added first.

## Justifications for API

The unsigned parts are done to ensure consistency with overflowing addition: for a two's complement integer, you want to have unsigned overflow semantics for all parts of the integer except the highest one. This is because overflow for unsigned integers happens on the highest bit (from `MAX` to zero), whereas overflow for signed integers happens on the second highest bit (from `MAX` to `MIN`). Since the sign information only matters in the highest part, we use unsigned overflow for everything but that part.

There is still discussion on the merits of signed bigint *addition* methods, since getting the behaviour right is very subtle, but at least for signed bigint *multiplication*, the sign of the operands does make a difference. So, it feels appropriate that at least until we've nailed down the final API, there should be an option to do signed versions of these methods.

Additionally, while it's unclear whether we need all three versions of bigint multiplication (widening, carrying-1, and carrying-2), since it's possible to have up to two carries without overflow, there should at least be a method to allow that. We could potentially only offer the carry-2 method and expect that adding zero carries afterword will optimise correctly, but again, this can be litigated before stabilisation.

## Note on documentation

While a lot of care was put into the documentation for the `widening_mul` and `carrying_mul` methods on unsigned integers, I have not taken this same care for `carrying_mul_add` or the signed versions. While I have updated the doc tests to be more appropriate, there will likely be many documentation changes done before stabilisation.

## Note on tests

Alongside this change, I've added several tests to ensure that these methods work as expected. These are alongside the codegen tests for the intrinsics.
2024-12-31 18:49:36 +00:00
Esteban Küber
2b2ea9e875 Provide structured suggestion for impl Default of type where all fields have defaults
```
error: `Default` impl doesn't use the declared default field values
  --> $DIR/manual-default-impl-could-be-derived.rs:28:1
   |
LL | / impl Default for B {
LL | |     fn default() -> Self {
LL | |         B {
LL | |             x: s(),
   | |                --- this field has a default value
LL | |             y: 0,
   | |                - this field has a default value
...  |
LL | | }
   | |_^
   |
help: to avoid divergence in behavior between `Struct { .. }` and `<Struct as Default>::default()`, derive the `Default`
   |
LL ~ #[derive(Default)] struct B {
   |
```

Note that above the structured suggestion also includes completely removing the manual `impl`, but the rendering doesn't.
2024-12-31 18:06:01 +00:00
Eric Huss
7a46c7b112 Revert "Rollup merge of #119838 - joshtriplett:style-guide-binop-indent, r=compiler-errors"
This reverts commit 36287830a2, reversing
changes made to 31026b7fe3.
2024-12-31 08:50:28 -08:00
Eric Huss
a6ba04ae6a Revert "Rollup merge of #132369 - joshtriplett:style-guide-binop-heuristic-assignment-only, r=calebcartwright"
This reverts commit 348d28052b, reversing
changes made to 526c67f37b.
2024-12-31 08:50:04 -08:00
bors
34719e8c40 Auto merge of #134966 - matthiaskrgr:rollup-lmhmgsv, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #134610 (Format `build.toml` consistently in platform support docs)
 - #134918 (Windows: Enable issue 70093 link tests)
 - #134953 (Fix doc for read&write unaligned in zst operation)
 - #134956 (Account for C string literals and `format_args` in `HiddenUnicodeCodepoints` lint)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-31 16:05:41 +00:00
Skgland
19387e6518
add .mailmap entry for myself 2024-12-31 17:02:29 +01:00
Eric Huss
b4a092662c Revert "Rollup merge of #119515 - joshtriplett:style-guide-gat-where-clause-same-line, r=compiler-errors"
This reverts commit 4d1cce9de5, reversing
changes made to 030a12ce2b.
2024-12-31 07:57:06 -08:00
dxsullivan
bb16267a65 chore: fix typos
Signed-off-by: dxsullivan <193140725+dxsullivan@users.noreply.github.com>
2024-12-31 23:46:39 +08:00
Marcondiro
aa685bccca
char to_digit: avoid unnecessary casts to u64 2024-12-31 16:17:10 +01:00