Commit Graph

285822 Commits

Author SHA1 Message Date
Nicholas Crothers
af0c8b7f25 Add anchor for intra-doc links to associated items 2025-02-27 16:39:07 -06:00
Nicholas Nethercote
9a0513ad71 Optimize Trace.
`Trace::FromOutlivesConstraint` contains an `OutlivesConstraint`, which
is 72 bytes. Lots of these are created but never used.

This commit splits `Trace::FromOutlivesConstraint` into three new
variants: `FromVanilla`, `FromStatic`, `FromMember`. Each of these
contains just enough data to construct an `OutlivesConstraint`, if
necessary. This reduces the size of `Trace` from 72 bytes to 16 bytes.
All this avoids some memory traffic.
2025-02-28 09:36:18 +11:00
Nicholas Nethercote
afc5e1fba5 Split the Edges iterator.
The `Edges` iterator returns `OutlivesConstraint` elements, which are 72
bytes. This is big enough to affect performance. Return
`&OutlivesConstraint` would be better. However, each `Edges` iterator is
really one of two different iterators. The "from graph" case does a
graph traversal and could return `&OutlivesConstraint`. But the "from
static" case just does a `0..n` iteration and constructs a new
`OutlivesConstraint` from that, so it can't return a reference.

This commit splits `Edges into `EdgesFromGraph` and `EdgesFromStatic`,
which allows them to have different return types. This is a perf win for
the `wg-grammar` benchmark.
2025-02-28 09:25:01 +11: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
Laurențiu Nicola
13eb83413a Merge pull request #19194 from BenjaminBrienen/node
Update Node.js and vscode
2025-02-27 21:24:48 +00:00
Nicholas Nethercote
60bf07a26c Adjust ConstraintGraphDirection methods.
This facilitates the next commit.
2025-02-28 08:23:29 +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
BenjaminBrienen
d6f5377826 Update Node.js, vscode, and ts deps 2025-02-27 20:53:48 +01: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
Niels Saurer
b5f0c82eba Add note to Thir struct about necessity of Clone derive 2025-02-27 18:33:44 +01:00
Niels Saurer
fb3aa33418 Revert "Derive Clone on fewer THIR types."
This reverts commit f0b6d660c9.
2025-02-27 18:32:09 +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
Josh Stone
396c2a8659 Stop using hash_raw_entry in CodegenCx::const_str
That unstable feature completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
2025-02-27 09:09:52 -08:00
Lukas Wirth
f19b205df4 Warn when the used toolchain looks too old for rust-analyzer 2025-02-27 17:59:39 +01:00
Laurențiu Nicola
239a6864c7 Merge pull request #19237 from BenjaminBrienen/doc-tests
Doc tests
2025-02-27 16:53:59 +00:00
Lukas Wirth
66368aa629 Allow unsetting default cfgs 2025-02-27 17:34:29 +01:00
Eric Huss
6cc6b86e40 Update E0133 docs for 2024 edition 2025-02-27 08:33:44 -08:00
Michał Kostrubiec
e100fd4d52 Changed the dependency graph to start preallocated with 128 capacity 2025-02-27 16:11:39 +01:00
BenjaminBrienen
1b6c4b7770 ignore another test that fails on windows 2025-02-27 16:09:00 +01:00
BenjaminBrienen
0404156654 ignore doc test that only fails on windows 2025-02-27 15:57:08 +01: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
Alice Ryhl
8cab0ba91a Remove unneeded import 2025-02-27 14:15:23 +00:00
Vayun Biyani
c85f038307 switch #[cfg(not(llvm_enzyme))] to cfg!(llvm_enzyme) 2025-02-27 19:32:30 +05:30
BenjaminBrienen
df903a55dd fix doc tests 2025-02-27 14:58:46 +01:00
BenjaminBrienen
8c16ded966 enable doctest 2025-02-27 14:58:46 +01:00
Ralf Jung
d775aa24e7 Merge pull request #4215 from RalfJung/before_terminator
before_terminator: add some minor clarifying comments
2025-02-27 13:47:48 +00:00
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
Ralf Jung
ac2ddc14af before_terminator: add some minor clarifying comments 2025-02-27 14:18:38 +01:00
Lukas Wirth
494192b12e Merge pull request #19241 from Veykril/push-lqumoruvuyvo
Fix sysroot crate-graph construction not mapping crate-ids for proc-macros
2025-02-27 12:34:03 +00:00
Lukas Wirth
cabb08ded5 Fix sysroot crate-graph construction not mapping crate-ids for proc-macros 2025-02-27 13:20:19 +01:00
Laurențiu Nicola
d4b92f4b68 Merge pull request #19230 from lnicola/zig
internal: set up Zig on CI and start using it in rust-analyzer
2025-02-27 11:34:41 +00:00
Folkert de Vries
038f4e2ff6 use the right feature in codegen tests 2025-02-27 12:23:00 +01:00