Skip to content

Commit a17780d

Browse files
committed
Auto merge of #142997 - workingjubilee:rollup-6lxec87, r=workingjubilee
Rollup of 15 pull requests Successful merges: - #135731 (Implement parsing of pinned borrows) - #138780 (Add `#[loop_match]` for improved DFA codegen) - #142453 (Windows: make `read_dir` stop iterating after the first error is encountered) - #142633 (Error on invalid signatures for interrupt ABIs) - #142768 (Avoid a bitcast FFI call in transmuting) - #142825 (Port `#[track_caller]` to the new attribute system) - #142844 (Enable short-ice for Windows) - #142934 (Tweak `-Zmacro-stats` measurement.) - #142955 (Couple of test suite fixes for cg_clif) - #142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠) - #142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect) - #142982 (Corrected spelling mistake in c_str.rs) - #142983 (Taint body on invalid call ABI) - #142988 (Update wasm-component-ld to 0.5.14) - #142993 (Update cargo) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2c2bb99 + 2d73e6c commit a17780d

File tree

163 files changed

+4231
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+4231
-431
lines changed

Cargo.lock

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3282,6 +3282,7 @@ dependencies = [
32823282
"rustc_abi",
32833283
"rustc_ast",
32843284
"rustc_ast_pretty",
3285+
"rustc_attr_data_structures",
32853286
"rustc_attr_parsing",
32863287
"rustc_data_structures",
32873288
"rustc_errors",
@@ -3316,6 +3317,7 @@ dependencies = [
33163317
"rustc_parse",
33173318
"rustc_session",
33183319
"rustc_span",
3320+
"rustc_target",
33193321
"thin-vec",
33203322
]
33213323

@@ -4116,6 +4118,7 @@ dependencies = [
41164118
"rustc_apfloat",
41174119
"rustc_arena",
41184120
"rustc_ast",
4121+
"rustc_attr_data_structures",
41194122
"rustc_data_structures",
41204123
"rustc_errors",
41214124
"rustc_fluent_macro",
@@ -5796,9 +5799,9 @@ dependencies = [
57965799

57975800
[[package]]
57985801
name = "wasi-preview1-component-adapter-provider"
5799-
version = "31.0.0"
5802+
version = "34.0.1"
58005803
source = "registry+https://github.com/rust-lang/crates.io-index"
5801-
checksum = "86fabda09a0d89ffd1615b297b4a5d4b4d99df9598aeb24685837e63019e927b"
5804+
checksum = "aafa1e6af9a954a4bcf6ef420c33355d0ce84ddc6afbcba7bb6f05126f9120ae"
58025805

58035806
[[package]]
58045807
name = "wasm-bindgen"
@@ -5860,17 +5863,17 @@ dependencies = [
58605863

58615864
[[package]]
58625865
name = "wasm-component-ld"
5863-
version = "0.5.13"
5866+
version = "0.5.14"
58645867
source = "registry+https://github.com/rust-lang/crates.io-index"
5865-
checksum = "a60a07a994a3538b57d8c5f8caba19f4793fb4c7156276e5e90e90acbb829e20"
5868+
checksum = "b015ec93764aa5517bc8b839efa9941b90be8ce680b1134f8224644ba1e48e3f"
58665869
dependencies = [
58675870
"anyhow",
58685871
"clap",
58695872
"lexopt",
58705873
"libc",
58715874
"tempfile",
58725875
"wasi-preview1-component-adapter-provider",
5873-
"wasmparser 0.229.0",
5876+
"wasmparser 0.234.0",
58745877
"wat",
58755878
"windows-sys 0.59.0",
58765879
"winsplit",
@@ -5897,12 +5900,12 @@ dependencies = [
58975900

58985901
[[package]]
58995902
name = "wasm-encoder"
5900-
version = "0.229.0"
5903+
version = "0.234.0"
59015904
source = "registry+https://github.com/rust-lang/crates.io-index"
5902-
checksum = "38ba1d491ecacb085a2552025c10a675a6fddcbd03b1fc9b36c536010ce265d2"
5905+
checksum = "170a0157eef517a179f2d20ed7c68df9c3f7f6c1c047782d488bf5a464174684"
59035906
dependencies = [
59045907
"leb128fmt",
5905-
"wasmparser 0.229.0",
5908+
"wasmparser 0.234.0",
59065909
]
59075910

59085911
[[package]]
@@ -5917,14 +5920,14 @@ dependencies = [
59175920

59185921
[[package]]
59195922
name = "wasm-metadata"
5920-
version = "0.229.0"
5923+
version = "0.234.0"
59215924
source = "registry+https://github.com/rust-lang/crates.io-index"
5922-
checksum = "78fdb7d29a79191ab363dc90c1ddd3a1e880ffd5348d92d48482393a9e6c5f4d"
5925+
checksum = "a42fe3f5cbfb56fc65311ef827930d06189160038e81db62188f66b4bf468e3a"
59235926
dependencies = [
59245927
"anyhow",
59255928
"indexmap",
5926-
"wasm-encoder 0.229.0",
5927-
"wasmparser 0.229.0",
5929+
"wasm-encoder 0.234.0",
5930+
"wasmparser 0.234.0",
59285931
]
59295932

59305933
[[package]]
@@ -5939,9 +5942,9 @@ dependencies = [
59395942

59405943
[[package]]
59415944
name = "wasmparser"
5942-
version = "0.229.0"
5945+
version = "0.234.0"
59435946
source = "registry+https://github.com/rust-lang/crates.io-index"
5944-
checksum = "0cc3b1f053f5d41aa55640a1fa9b6d1b8a9e4418d118ce308d20e24ff3575a8c"
5947+
checksum = "be22e5a8f600afce671dd53c8d2dd26b4b7aa810fd18ae27dfc49737f3e02fc5"
59455948
dependencies = [
59465949
"bitflags",
59475950
"hashbrown",
@@ -5950,15 +5953,6 @@ dependencies = [
59505953
"serde",
59515954
]
59525955

5953-
[[package]]
5954-
name = "wasmparser"
5955-
version = "0.234.0"
5956-
source = "registry+https://github.com/rust-lang/crates.io-index"
5957-
checksum = "be22e5a8f600afce671dd53c8d2dd26b4b7aa810fd18ae27dfc49737f3e02fc5"
5958-
dependencies = [
5959-
"bitflags",
5960-
]
5961-
59625956
[[package]]
59635957
name = "wasmparser"
59645958
version = "0.235.0"
@@ -6411,9 +6405,9 @@ dependencies = [
64116405

64126406
[[package]]
64136407
name = "wit-component"
6414-
version = "0.229.0"
6408+
version = "0.234.0"
64156409
source = "registry+https://github.com/rust-lang/crates.io-index"
6416-
checksum = "7f550067740e223bfe6c4878998e81cdbe2529dd9a793dc49248dd6613394e8b"
6410+
checksum = "5a8888169acf4c6c4db535beb405b570eedac13215d6821ca9bd03190f7f8b8c"
64176411
dependencies = [
64186412
"anyhow",
64196413
"bitflags",
@@ -6422,17 +6416,17 @@ dependencies = [
64226416
"serde",
64236417
"serde_derive",
64246418
"serde_json",
6425-
"wasm-encoder 0.229.0",
6419+
"wasm-encoder 0.234.0",
64266420
"wasm-metadata",
6427-
"wasmparser 0.229.0",
6421+
"wasmparser 0.234.0",
64286422
"wit-parser",
64296423
]
64306424

64316425
[[package]]
64326426
name = "wit-parser"
6433-
version = "0.229.0"
6427+
version = "0.234.0"
64346428
source = "registry+https://github.com/rust-lang/crates.io-index"
6435-
checksum = "459c6ba62bf511d6b5f2a845a2a736822e38059c1cfa0b644b467bbbfae4efa6"
6429+
checksum = "465492df47d8dcc015a3b7f241aed8ea03688fee7c5e04162285c5b1a3539c8b"
64366430
dependencies = [
64376431
"anyhow",
64386432
"id-arena",
@@ -6443,7 +6437,7 @@ dependencies = [
64436437
"serde_derive",
64446438
"serde_json",
64456439
"unicode-xid",
6446-
"wasmparser 0.229.0",
6440+
"wasmparser 0.234.0",
64476441
]
64486442

64496443
[[package]]

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ pub enum ExternAbi {
3636
/// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
3737
RustCold,
3838

39+
/// An always-invalid ABI that's used to test "this ABI is not supported by this platform"
40+
/// in a platform-agnostic way.
41+
RustInvalid,
42+
3943
/// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
4044
/// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
4145
Unadjusted,
@@ -157,6 +161,7 @@ abi_impls! {
157161
RiscvInterruptS =><= "riscv-interrupt-s",
158162
RustCall =><= "rust-call",
159163
RustCold =><= "rust-cold",
164+
RustInvalid =><= "rust-invalid",
160165
Stdcall { unwind: false } =><= "stdcall",
161166
Stdcall { unwind: true } =><= "stdcall-unwind",
162167
System { unwind: false } =><= "system",

compiler/rustc_ast/src/ast.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ pub enum BorrowKind {
904904
/// The resulting type is either `*const T` or `*mut T`
905905
/// where `T = typeof($expr)`.
906906
Raw,
907+
/// A pinned borrow, `&pin const $expr` or `&pin mut $expr`.
908+
/// The resulting type is either `Pin<&'a T>` or `Pin<&'a mut T>`
909+
/// where `T = typeof($expr)` and `'a` is some lifetime.
910+
Pin,
907911
}
908912

909913
#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic)]

compiler/rustc_ast_lowering/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ doctest = false
1111
rustc_abi = { path = "../rustc_abi" }
1212
rustc_ast = { path = "../rustc_ast" }
1313
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
14+
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
1415
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
1516
rustc_data_structures = { path = "../rustc_data_structures" }
1617
rustc_errors = { path = "../rustc_errors" }

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::sync::Arc;
44
use rustc_ast::ptr::P as AstP;
55
use rustc_ast::*;
66
use rustc_ast_pretty::pprust::expr_to_string;
7+
use rustc_attr_data_structures::{AttributeKind, find_attr};
78
use rustc_data_structures::stack::ensure_sufficient_stack;
89
use rustc_hir as hir;
910
use rustc_hir::HirId;
@@ -831,7 +832,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
831832
) {
832833
if self.tcx.features().async_fn_track_caller()
833834
&& let Some(attrs) = self.attrs.get(&outer_hir_id.local_id)
834-
&& attrs.into_iter().any(|attr| attr.has_name(sym::track_caller))
835+
&& find_attr!(*attrs, AttributeKind::TrackCaller(_))
835836
{
836837
let unstable_span = self.mark_span_with_reason(
837838
DesugaringKind::Async,

compiler/rustc_ast_lowering/src/stability.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
9696
ExternAbi::RustCold => {
9797
Err(UnstableAbi { abi, feature: sym::rust_cold_cc, explain: GateReason::Experimental })
9898
}
99+
ExternAbi::RustInvalid => {
100+
Err(UnstableAbi { abi, feature: sym::rustc_attrs, explain: GateReason::ImplDetail })
101+
}
99102
ExternAbi::GpuKernel => Err(UnstableAbi {
100103
abi,
101104
feature: sym::abi_gpu_kernel,

compiler/rustc_ast_passes/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ rustc_macros = { path = "../rustc_macros" }
1818
rustc_parse = { path = "../rustc_parse" }
1919
rustc_session = { path = "../rustc_session" }
2020
rustc_span = { path = "../rustc_span" }
21+
rustc_target = { path = "../rustc_target" }
2122
thin-vec = "0.2.12"
2223
# tidy-alphabetical-end

compiler/rustc_ast_passes/messages.ftl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
ast_passes_abi_custom_coroutine =
2-
functions with the `"custom"` ABI cannot be `{$coroutine_kind_str}`
1+
ast_passes_abi_cannot_be_coroutine =
2+
functions with the {$abi} ABI cannot be `{$coroutine_kind_str}`
33
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definiton
44
5-
ast_passes_abi_custom_invalid_signature =
6-
invalid signature for `extern "custom"` function
7-
.note = functions with the `"custom"` ABI cannot have any parameters or return type
8-
.suggestion = remove the parameters and return type
9-
105
ast_passes_abi_custom_safe_foreign_function =
11-
foreign functions with the `"custom"` ABI cannot be safe
6+
foreign functions with the "custom" ABI cannot be safe
127
.suggestion = remove the `safe` keyword from this definition
138
149
ast_passes_abi_custom_safe_function =
15-
functions with the `"custom"` ABI must be unsafe
10+
functions with the "custom" ABI must be unsafe
1611
.suggestion = add the `unsafe` keyword to this definition
1712
13+
ast_passes_abi_must_not_have_parameters_or_return_type=
14+
invalid signature for `extern {$abi}` function
15+
.note = functions with the {$abi} ABI cannot have any parameters or return type
16+
.suggestion = remove the parameters and return type
17+
18+
ast_passes_abi_must_not_have_return_type=
19+
invalid signature for `extern {$abi}` function
20+
.note = functions with the "custom" ABI cannot have a return type
21+
.help = remove the return type
22+
1823
ast_passes_assoc_const_without_body =
1924
associated constant in `impl` without body
2025
.suggestion = provide a definition for the constant

0 commit comments

Comments
 (0)