1
Fork 0
Commit graph

284702 commits

Author SHA1 Message Date
Alejandra González
31497d68fb
fix: option_if_let_else FP when value partially moved (#14209)
fixes #13964

The lint `option_map_unwrap_or` used to have a similar issue in #10579,
so I borrowed its solution to fix this one.

changelog: [`option_if_let_else`]: fix FP when value partially moved
2025-03-19 15:34:53 +00:00
Oli Scherer
14cd467001 Fix next solver handling of shallow trait impl check 2025-03-19 14:40:14 +00:00
Oli Scherer
055d31c7a5 Demonstrate next-solver missing diagnostic 2025-03-19 14:38:23 +00:00
Jakub Beránek
9b88fd09d7
Update GCC submodule 2025-03-19 15:35:47 +01:00
Jakub Beránek
b24dc75ee4
Respect --src bootstrap flag
Previously it was simply ignored.
2025-03-19 14:57:06 +01:00
Jakub Beránek
2139a783b0
Fix bug in get_git_modified_files
It was ignoring files without extension.
2025-03-19 14:55:52 +01:00
Jakub Beránek
599dc823c9
Simplify get_git_modified_files
It only ever returned `Some`, so `Option` was useless in its return type.
2025-03-19 14:55:37 +01:00
Mara Bos
6c865c1e14 Allow builtin macros to be used more than once.
This removes E0773 "A builtin-macro was defined more than once."
2025-03-19 14:12:47 +01:00
bors
a7fc463dd8 Auto merge of #138693 - matthiaskrgr:rollup-ejq8mwp, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #136177 (clarify BufRead::{fill_buf, consume} docs)
 - #138654 (Remove the regex dependency from coretests)
 - #138655 (rustc-dev-guide sync)
 - #138656 (Remove double nesting in post-merge workflow)
 - #138658 (CI: mirror alpine and centos images to ghcr)
 - #138659 (coverage: Don't store a body span in `FunctionCoverageInfo`)
 - #138661 (Revert: Add *_value methods to proc_macro lib)
 - #138670 (Remove existing AFIDT implementation)
 - #138674 (Various codegen_llvm cleanups)
 - #138684 (use then in docs for `fuse` to enhance readability)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-19 12:39:34 +00:00
xizheyin
5a52b5d92a Suggest -Whelp when pass --print lints to rustc
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-19 18:48:00 +08:00
Nicholas Nethercote
f27cab806e Use Option<Ident> for lowered param names.
Parameter patterns are lowered to an `Ident` by
`lower_fn_params_to_names`, which is used when lowering bare function
types, trait methods, and foreign functions. Currently, there are two
exceptional cases where the lowered param can become an empty `Ident`.

- If the incoming pattern is an empty `Ident`. This occurs if the
  parameter is anonymous, e.g. in a bare function type.

- If the incoming pattern is neither an ident nor an underscore. Any
  such parameter will have triggered a compile error (hence the
  `span_delayed_bug`), but lowering still occurs.

This commit replaces these empty `Ident` results with `None`, which
eliminates a number of `kw::Empty` uses, and makes it impossible to fail
to check for these exceptional cases.

Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It
actually should have been removed in #138482, the precursor to this PR.
That PR changed the lowering of wild patterns to `_` symbols instead of
empty symbols, which made the mentioned underscore check load-bearing.
2025-03-19 20:54:10 +11:00
Nikita Popov
80f8f00fa4 Update to LLVM 20.1.1 2025-03-19 10:36:30 +01:00
bors
c4b38a5967 Auto merge of #138653 - matthiaskrgr:rollup-fwwqmr7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #136320 (exit: document interaction with C)
 - #138080 (Leave a breadcrumb towards bootstrap config documentation in `bootstrap.toml`)
 - #138301 (Implement `read_buf` for Hermit)
 - #138569 (rustdoc-json: Add tests for `#[repr(...)]`)
 - #138635 (Extract `for_each_immediate_subpat` from THIR pattern visitors)
 - #138642 (Unvacation myself)
 - #138644 (Add `#[cfg(test)]` for Transition in dfa in `rustc_transmute`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-19 09:28:24 +00:00
LuuuXXX
027423d2c4 Fix: add ohos target notes 2025-03-19 17:23:34 +08:00
Jan Verbeek
d793c0abfa Add MSRV check for question_mark 2025-03-19 09:33:58 +01:00
Matthias Krüger
3b7faca09c
Rollup merge of #138684 - bend-n:use_then, r=jhpratt
use then in docs for `fuse` to enhance readability

use the more-idiomatic `then_some` rather than an `if { some } else { none }` for `fused` docs
2025-03-19 08:17:19 +01:00
Matthias Krüger
5661e98058
Rollup merge of #138674 - oli-obk:llvm-cleanups, r=compiler-errors
Various codegen_llvm cleanups

Mostly just adding safe wrappers and deduplicating code
2025-03-19 08:17:19 +01:00
Matthias Krüger
351ba39d54
Rollup merge of #138670 - compiler-errors:remove-afidt, r=oli-obk
Remove existing AFIDT implementation

This experiment will need to be reworked differently; I don't think we'll be going with the `dyn* Future` approach that is currently implemented.

r? oli-obk

Fixes #136286
Fixes #137706
Fixes #137895

Tracking:
* #133119
2025-03-19 08:17:18 +01:00
Matthias Krüger
8b713e2cde
Rollup merge of #138661 - RalfJung:revert-rustc-dev-breakage, r=petrochenkov
Revert: Add *_value methods to proc_macro lib

This reverts https://github.com/rust-lang/rust/pull/136355. That PR caused unexpected breakage:
- the rustc-dev component can no longer be loaded by cargo, which impacts Miri and clippy and likely others
- rustc_lexer can no longer be published to crates.io, which impacts RA

See https://github.com/rust-lang/rust/issues/138647 for context.
Cc `@GuillaumeGomez` `@Amanieu`
2025-03-19 08:17:17 +01:00
Matthias Krüger
00dddc6ecd
Rollup merge of #138659 - Zalathar:no-body-span, r=oli-obk
coverage: Don't store a body span in `FunctionCoverageInfo`

We aren't using this body span for anything truly essential, and having it around will be awkward when we eventually start to support expansion regions, since they aren't necessarily within the main body.
2025-03-19 08:17:17 +01:00
Matthias Krüger
cc06501b4b
Rollup merge of #138658 - marcoieni:mirror-alpine-and-centos, r=Kobzol
CI: mirror alpine and centos images to ghcr
2025-03-19 08:17:16 +01:00
Matthias Krüger
09c28f8d3d
Rollup merge of #138656 - Kobzol:post-merge-unnest, r=marcoieni
Remove double nesting in post-merge workflow

See [this](https://github.com/rust-lang/rust/pull/138630#issuecomment-2732224491) :)

Can be tested with:
```bash
#!/bin/bash

PARENT_COMMIT=493c38ba371929579fe136df26eccd9516347c7a
SHA=259fdb521200c9abba547302fc2c826479ef26b2

printf "<details>\n<summary>What is this?</summary>\n" >> output.log
printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log
printf "</details>\n\n" >> output.log

cargo run --release post-merge-report ${PARENT_COMMIT} ${SHA} >> output.log
```

I think that it's better to leave the notice in CI, to avoid generating it in citool, which can also be executed locally.

r? `@marcoieni`
2025-03-19 08:17:16 +01:00
Matthias Krüger
67d3e5e53f
Rollup merge of #138655 - Kobzol:rdg-sync, r=jieyouxu
rustc-dev-guide sync

r? `@jieyouxu`
2025-03-19 08:17:15 +01:00
Matthias Krüger
a4c32b1d18
Rollup merge of #138654 - bjorn3:remove_coretests_regex, r=tgross35
Remove the regex dependency from coretests

It is only used by a single test, yet would take up unnecessary space once stdlib deps get vendored.
2025-03-19 08:17:14 +01:00
Matthias Krüger
b52275fd01
Rollup merge of #136177 - hkBst:patch-24, r=ibraheemdev
clarify BufRead::{fill_buf, consume} docs

Fixes #85394
2025-03-19 08:17:14 +01:00
bors
1370611c0a Auto merge of #138690 - jieyouxu:temp-disable-fuchsia, r=Kobzol
Temporarily disable Fuchsia test job to unblock queue

See <https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/fuchsia.20failure/with/506637259> for efforts to fix the test job.

This PR temporarily disables the Fuchsia test job to unblock the queue, so that neither the Fuchsia maintainers nor T-infra maintainers should feel pressured to fix the job ASAP.

Please feel free to re-enable once the test job is fixed.
FYI `@erickt` since you or other Fuchsia maintainers will need to revert this change to merge Fuchsia test job fixes in the future.

r? infra-ci
2025-03-19 06:16:45 +00:00
Jieyou Xu
351e0f7a31
Temporarily disable Fuchsia test job to unblock queue
See
<https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/fuchsia.20failure/with/506637259>
for efforts to fix the test job.
2025-03-19 13:43:34 +08:00
Caleb Zulawski
3c705b810d Merge commit 'c14f2fc3eb' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
bendn
7a8cdf00e6
use then 2025-03-19 10:45:42 +07:00
Eric Holk
2bd7f73c21
Refactor YieldKind so postfix yield must have an expression 2025-03-18 12:19:43 -07:00
Michael Goulet
0a6a0e47d2 Dont consider fields that are forced unstable due to -Zforce-unstable-if-unmarked to be uninhabited 2025-03-18 18:24:02 +00:00
Michael Goulet
f6107ca173 Consider fields to be inhabited if they are unstable 2025-03-18 18:23:36 +00:00
Eric Holk
299e5d0514
Apply suggestions from code review
Co-authored-by: Travis Cross <tc@traviscross.com>
2025-03-18 10:50:33 -07:00
Michael Goulet
93b31d9b21 Remove existing AFIDT implementation 2025-03-18 17:35:26 +00:00
Oli Scherer
f4b0984854 Create a safe wrapper around LLVMRustDIBuilderCreateMemberType 2025-03-18 17:15:02 +00:00
Oli Scherer
1f34b19596 Avoid splitting up a layout 2025-03-18 17:01:09 +00:00
aaishwarymishra@gmail.com
a3669b8982 updated compiler tests for rustc_intrinsic'
Update compiler/rustc_error_codes/src/error_codes/E0622.md

Co-authored-by: Ralf Jung <post@ralfj.de>

reverted chages on E0622.md

updated E0622.md
2025-03-18 16:22:42 +00:00
Caleb Zulawski
c14f2fc3eb
Merge pull request #452 from folkertdev/element-rotate-example
add examples for `shift_elements_{left, right}` and `rotate_elements_{left, right}`
2025-03-18 10:08:53 -04:00
Alex Macleod
a422d9e68c
fix: bad indent in doc comments (#14419)
TLDR
```diff
- ///    01234
+ ///     01234
     12345
```

Sometimes, in doc comments, there are 3 spaces + 1 instead of 4 spaces +
1.
To make it coherent with the rest of the clippy codebase, I `fd -t f -X
sed -E -i 's,///\s{4}(\S),/// \1,g'` and manually verified and fixed the
relevant part of code that had bad indentation.

### Example

```rs
/// fn a() {
///    01234
/// }
```
Becomes
```rs
/// fn a() {
///     01234
/// }
```

changelog: none
2025-03-18 13:59:53 +00:00
Alex Macleod
d443f38f73
Reinstate single_match/single_match_else lints with comments (#14420)
Commit efe3fe9b8c removed the ability for
`single_match` and `single_match_else` to trigger if comments were
present outside of the arms, as those comments would be lost while
rewriting the `match` expression.

This reinstates the lint, but prevents the suggestion from being applied
automatically in the presence of comments by using the `MaybeIncorrect`
applicability. Also, a note is added to the lint message to warn the
user about the need to preserve the comments if acting upon the
suggestion.

changelog: [`single_match`, `single_match_else`]: reinstate lint when
comments are inside the `match` but do not autofix the code

Fix #14418
2025-03-18 12:45:19 +00:00
Alejandra González
ea30a09fe1
Leave assignments for now (#14428)
I love this project but I (again) don't have the time nor energy at the
moment. Will go through my current assignments over time and still
review occasionally.

PS: sorry about the branch on upstream!
changelog: none
2025-03-18 12:29:56 +00:00
Ralf Jung
20d04d8a40 Revert "Rollup merge of #136355 - GuillaumeGomez:proc-macro_add_value_retrieval_methods, r=Amanieu"
This reverts commit 08dfbf49e3, reversing
changes made to 10bcdad7df.
2025-03-18 13:28:56 +01:00
Zalathar
cc8336b6c1 coverage: Don't store a body span in FunctionCoverageInfo 2025-03-18 23:18:24 +11:00
Zalathar
cd2b978433 coverage: Don't refer to the body span when enlarging empty spans
Given that we now only enlarge empty spans to "{" or "}", there shouldn't be
any danger of enlarging beyond a function body.
2025-03-18 23:18:23 +11:00
MarcoIeni
d76e89f363
CI: mirror alpine and centos images to ghcr 2025-03-18 11:35:16 +01:00
Philipp Krones
a07e887e24
Improve string_to_string lint in case it is in a map call (#14396)
Fixes https://github.com/rust-lang/rust-clippy/issues/14175.

There are two "big" cases to handle: `.map(|x| x.to_string())` and
`.map(String::to_string)`. If the closure has more than one expression,
we should not suggest `.cloned()`.

changelog: Improve `string_to_string` lint in case it is in a map call

r? @samueltardieu
2025-03-18 10:29:10 +00:00
Marijn Schouten
e5b86e2c73
Apply suggestions from code review
Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
2025-03-18 11:16:18 +01:00
Guillaume Gomez
269b913bfd Better handle blocks with just one expression 2025-03-18 11:09:20 +01:00
Folkert de Vries
85a494bd91
add examples for shift_elements_{left, right} and rotate_elements_{left, right} 2025-03-18 10:34:02 +01:00
bjorn3
7f4d3bd6af Remove the regex dependency from coretests
It is only used by a single test, yet would take up unnecessary space
once stdlib deps get vendored.
2025-03-18 09:34:01 +00:00