1
Fork 0
Commit graph

282976 commits

Author SHA1 Message Date
Chris Denton
f3399516fa
Revert "Fix 32-bit MSVC CI"
This reverts commit 6ea4823733.
2025-02-28 00:47:45 +00:00
bors
e6059f5222 Auto merge of #137669 - DianQK:fn-atts-virtual, r=saethlin
Don't infer attributes of virtual calls based on the function body

Fixes (after backport) #137646.
Since we don't know the exact implementation of the virtual call, it might write to parameters, we can't infer the readonly attribute.
2025-02-28 00:31:26 +00:00
Samuel Tardieu
059c0abeee Fix method name in TyCtxt::hir_crate() documentation 2025-02-27 23:47:37 +01:00
DaniPopes
775cb23dbc
doc: update Wasmtime flags
Wasmtime's `--wasm-features` and `--wasi-modules` flags have been renamed
since these docs were initially written.

Additionally, from my testing I don't believe `--wasm threads` is needed if
`--wasi threads` is passed already.
2025-02-27 23:10:54 +01:00
Nicholas Nethercote
50076cdeb9 Remove NtPath. 2025-02-28 08:42:14 +11:00
Nicholas Nethercote
7ea59e053b Remove NtMeta.
Note: there was an existing code path involving `Interpolated` in
`MetaItem::from_tokens` that was dead. This commit transfers that to the
new form, but puts an `unreachable!` call inside it.
2025-02-28 08:42:06 +11:00
Nicholas Nethercote
ef1114a964 Remove NtPat.
The one notable test change is `tests/ui/macros/trace_faulty_macros.rs`.
This commit removes the complicated `Interpolated` handling in
`expected_expression_found` that results in a longer error message. But
I think the new, shorter message is actually an improvement.

The original complaint was in #71039, when the error message started
with "error: expected expression, found `1 + 1`". That was confusing
because `1 + 1` is an expression. Other than that, the reporter said
"the whole error message is not too bad if you ignore the first line".

Subsequently, extra complexity and wording was added to the error
message. But I don't think the extra wording actually helps all that
much. In particular, it still says of the `1+1` that "this is expected
to be expression". This repeats the problem from the original complaint!

This commit removes the extra complexity, reverting to a simpler error
message. This is primarily because the traversal is a pain without
`Interpolated` tokens. Nonetheless, I think the error message is
*improved*. It now starts with "expected expression, found `pat`
metavariable", which is much clearer and the real problem. It also
doesn't say anything specific about `1+1`, which is good, because the
`1+1` isn't really relevant to the error -- it's the `$e:pat` that's
important.
2025-02-28 08:36:12 +11:00
Samuel Tardieu
baadee8fd3 New lint: manual_midpoint 2025-02-27 22:12:16 +01:00
Samuel Tardieu
06175f43b3 Add is_float_literal utility 2025-02-27 22:10:57 +01:00
Philipp Krones
715d3f9224
Rustup (#14300)
Out of cycle sync, as it is complicated and confusing to resolve merge
conflicts on the Rust side. This needs review for
eda3e649a41e0e73cb2e3ee6b98cbf8d7c12acae and
4d8766caaf11a14194406b8997243bb626000aae as well as the comment I'll
leave below.

changelog: none
2025-02-27 21:02:32 +00:00
Philipp Krones
b3d35b1af6 Bump nightly version -> 2025-02-27 2025-02-27 21:51:42 +01:00
Philipp Krones
28555d1231 Split must_use_unit test into an unfixable part
With the attribute refactor in rustc, making this case machine applicable is not
easily possible anymore. This splits up the tests properly.
2025-02-27 21:51:42 +01:00
Philipp Krones
53a1ff70e8 Check os_str_display MSRV instead of feature
This feature was stabilized, so the FormatArgs lints should check if the MSRV of
the stabilization is met, rather than checking if the feature is enabled.
2025-02-27 21:51:42 +01:00
Philipp Krones
02e812af4d Merge remote-tracking branch 'upstream/master' into rustup 2025-02-27 21:51:42 +01:00
bors
f45d4acf1b Auto merge of #137749 - Kobzol:fix-ci-2, r=Kobzol
Fix 32-bit MSVC CI

By throwing more hardware at it. The large runners should still use the old image. This could buy us a couple of... hours? Days? Who knows.

See https://github.com/rust-lang/rust/issues/137733 for context.

r? `@ghost`

try-job: i686-msvc-1
try-job: i686-msvc-2
try-job: dist-i686-msvc
2025-02-27 20:40:04 +00:00
Jakub Beránek
6ea4823733 Fix 32-bit MSVC CI
By throwing more hardware at it.
2025-02-27 21:36:28 +01:00
Boxy
6c3243f008 Bless 2025-02-27 20:02:25 +00:00
Boxy
dc6db192c4 Defer repeat expr Copy check 2025-02-27 20:02:25 +00:00
Boxy
cdd8895d72 Add inference constraining Copy impl test 2025-02-27 20:02:25 +00:00
Catherine Flores
15180d4eb9
macro_use_import: Don't check is attribute comes from expansion (#14317)
It is not possible to write a declarative macro, that produces an
attribute w/o
an item attached to it. This means that the `check_item` will already
insert the
span in the map, if it came from an expansion. So additionally checking
if the
macro came from an expansion doesn't add anything here. So the
`check_attribute` function, and with that the problematic `attr.span()`
call can
be completely removed.

Fixes https://github.com/rust-lang/rust-clippy/issues/14303

r? @y21

cc @jdonszelmann

changelog: Fix ICE in [`macro_use_import`] lint
2025-02-27 19:51:57 +00:00
Philipp Krones
063d6aef0e
macro_use_import: Don't check is attribute comes from expansion
It is not possible to write a declarative macro, that produces an attribute w/o
an item attached to it. This means that the `check_item` will already insert the
span in the map, if it came from an expansion. So additionally checking if the
macro came from an expansion doesn't add anything here. So the
`check_attribute` function, and with that the problematic `attr.span()` call can
be completely removed.

Fixes #14303
2025-02-27 20:42:56 +01:00
Mu001999
d504f70ec9 Unconditionally lower match arm even if it's unneeded for never pattern in match 2025-02-28 01:29:58 +08:00
Eric Huss
6cc6b86e40 Update E0133 docs for 2024 edition 2025-02-27 08:33:44 -08:00
Alex Macleod
4a9b8c6415
fix: map_entry FP inside closure (#14307)
Closes #11976

changelog: [`map_entry`]: fix FP inside closure
2025-02-27 14:42:00 +00:00
Ralf Jung
31388f5280 checked_ilog tests: deal with a bit of float imprecision 2025-02-27 15:38:22 +01:00
Vayun Biyani
c85f038307 switch #[cfg(not(llvm_enzyme))] to cfg!(llvm_enzyme) 2025-02-27 19:32:30 +05:30
yanglsh
329acde93e fix: map_entry FP inside closure 2025-02-27 21:28:00 +08:00
Yotam Ofek
0881dba5d3 Move "unused_exter_crate" test from rustdoc-ui to rustdoc 2025-02-27 13:22:46 +00:00
Yotam Ofek
660241d1d4 Fix test directives that were accidentally ignored 2025-02-27 13:22:16 +00:00
Folkert de Vries
038f4e2ff6
use the right feature in codegen tests 2025-02-27 12:23:00 +01:00
Folkert de Vries
4e961dc015
make simd_insert and simd_extract const fns 2025-02-27 12:23:00 +01:00
Folkert de Vries
a837e9966b
simplify some imports with simd::* 2025-02-27 12:22:59 +01:00
Folkert de Vries
d8a067b931
remove most simd_ intrinsic declaration in tests
instead, we can just import the intrinsics from core
2025-02-27 12:22:59 +01:00
Guillaume Gomez
4747bb6017 Add missing case explanation for doc inlined re-export of doc hidden item 2025-02-27 11:53:30 +01:00
Jakub Beránek
f20dd49b74 Use original command for showing sccache stats 2025-02-27 11:45:37 +01:00
dswij
527ab050fa
fix: Avoid ICE in doc_nested_refdefs check by checking range (#14308)
The `looks_like_refdef` function was assuming the range was valid, this
just adds a check to ensure that is the case. It also works around a
subtraction underflow due to the same invalid range.

changelog: [`doc_nested_refdefs`]: Fix #14287 by avoiding invalid ranges
2025-02-27 10:45:31 +00:00
Fridtjof Stoldt
f50266a423
Split needless_lifetime '_ suggestions into elidable_lifetime_names (#13960)
Fixes https://github.com/rust-lang/rust-clippy/issues/13514

changelog: Added [`elidable_lifetime_names`] to `pedantic` (Split off
from [`needless_lifetime`] for suggestions with `'_`)
[#13960](https://github.com/rust-lang/rust-clippy/pull/13960)

changelog: Enhancement: [`needless_lifetime`] No longer lints for
elidable lifetimes `'_`, use [`elidable_lifetime_names`] to lint these.
[#13960](https://github.com/rust-lang/rust-clippy/pull/13960)
2025-02-27 09:21:50 +00:00
Maja Kądziołka
5765005a7f
Clean up TypeckResults::extract_binding_mode
- Remove the `Option` from the result type, as `None` is never returned.
- Document the difference from the `BindingMode` in `PatKind::Binding`.
2025-02-27 10:19:12 +01:00
Jake Shadle
e399e152e8 Fix ICE 2025-02-27 10:18:44 +01:00
Nikita Popov
3a715798bc Update to LLVM 20 rc 3 2025-02-27 09:34:19 +01:00
Matthias Krüger
89a202d179
Rollup merge of #137694 - aDotInTheVoid:aDotInTheVoid-patch-1, r=jdonszelmann
Spruce up `AttributeKind` docs

- Remove dead link to `rustc_attr` crate.
- Add link to `rustc_attr_parsing` crate.
- Split up first paragraph so it looks better at crate-level summary

r? `@jdonszelmann`
2025-02-27 08:56:40 +01:00
Matthias Krüger
f19d4b5f97
Rollup merge of #137480 - fuzzypixelz:fix/124466, r=workingjubilee
Return unexpected termination error instead of panicing in `Thread::join`

There is a time window during which the OS can terminate a thread before stdlib can retreive its `Packet`. Currently the `Thread::join` panics with no message in such an event, which makes debugging difficult; fixes #124466.
2025-02-27 08:56:39 +01:00
Matthias Krüger
25db95ec4a
Rollup merge of #137455 - compiler-errors:drop-lint-dtor, r=oli-obk
Reuse machinery from `tail_expr_drop_order` for `if_let_rescope`

Namely, it defines its own `extract_component_with_significant_dtor` which is a bit more accurate than `Ty::has_significant_drop`, since it has a hard-coded list of types from the ecosystem which are opted out of the lint.[^a]

Also, since we extract the dtors themselves, adopt the same *label* we use in `tail_expr_drop_order` to point out the destructor impl. This makes it much clear what's actually being dropped, so it should be clearer to know when it's a false positive.

This conflicts with #137444, but I will rebase whichever lands first.

[^a]: Side-note, it's kinda a shame that now there are two functions that presumably do the same thing. But this isn't my circus, nor are these my monkeys.
2025-02-27 08:56:39 +01:00
Matthias Krüger
3499846073
Rollup merge of #137304 - pitaj:rangebounds-is_empty-intersect, r=ibraheemdev
add `IntoBounds::intersect` and `RangeBounds::is_empty`

- ACP: https://github.com/rust-lang/libs-team/issues/539
- Tracking issue for `is_empty`: #137300
- Tracking issue for `IntoBounds`: #136903
2025-02-27 08:56:38 +01:00
Matthias Krüger
4ecca4c09c
Rollup merge of #136846 - nnethercote:make-AssocOp-more-like-ExprKind, r=spastorino
Make `AssocOp` more like `ExprKind`

This is step 1 of [MCP 831](https://github.com/rust-lang/compiler-team/issues/831).

r? ``@estebank``
2025-02-27 08:56:37 +01:00
Matthias Krüger
88dcab75b0
Rollup merge of #136688 - fee1-dead-contrib:push-nppsusmpokqo, r=compiler-errors
require trait impls to have matching const stabilities as the traits

This resolves https://github.com/rust-lang/project-const-traits/issues/5 by implementing the suggested solution in the given thread

r? ``@RalfJung``
cc ``@rust-lang/project-const-traits``
2025-02-27 08:56:36 +01:00
Matthias Krüger
18c47ad639
Rollup merge of #136579 - bjorn3:fix_thinvec_ext_ub, r=BoxyUwU
Fix UB in ThinVec::flat_map_in_place

`thin_vec.as_ptr()` goes through the `Deref` impl of `ThinVec`, which will not allow access to any memory as we did call `set_len(0)` first.

Found in the process of investigating https://github.com/rust-lang/rust/issues/135870.
2025-02-27 08:56:36 +01:00
Matthias Krüger
f435138da9
Rollup merge of #136542 - jieyouxu:build-base, r=onur-ozkan
[`compiletest`-related cleanups 4/7] Make the distinction between root build directory vs test suite specific build directory in compiletest less confusing

Reference for overall changes: https://github.com/rust-lang/rust/pull/136437
Part **4** of **7** of the *`compiletest`-related cleanups* PR series.

### Summary

- Remove `--build-base` compiletest flag, and introduce `--build-{root,test-suite-root}` flags instead. `--build-base` previously actually is test suite specific build directory, not the root `build/` directory.
- Feed the root build directory directly from bootstrap to compiletest via `--build-root` instead of doing multiple layers of parent unwrapping[^parent] based on the test suite specific build directory.
- Remove a redundant `to_path_buf()`.

[^parent]: Please do not unwrap the parents.

r? bootstrap
2025-02-27 08:56:35 +01:00
Nicholas Nethercote
a36d8acd83 Optimize empty provenance range checks.
Currently it gets the pointers in the range and checks if the result is
empty, but it can be done faster if you combine those two steps.
2025-02-27 18:10:17 +11:00
DianQK
fbe0075a86
Don't infer unwinding of virtual calls based on the function attributes 2025-02-27 12:58:18 +08:00