Skip to content

Commit c6f4ff1

Browse files
committed
Auto merge of #140329 - matthiaskrgr:rollup-9itify0, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #123239 (Implement a lint for implicit autoref of raw pointer dereference - take 2) - #140215 (transmutability: Support char, NonZeroXxx) - #140226 (Update wasm-component-ld to 0.5.13) - #140302 (Move inline asm check to typeck, properly handle aliases) - #140317 (Remove redundant check) - #140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`) - #140325 (Grammar fixes for BufRead::has_data_left docs) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5ae50d3 + af18438 commit c6f4ff1

File tree

44 files changed

+1094
-217
lines changed

Some content is hidden

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

44 files changed

+1094
-217
lines changed

Cargo.lock

+27-62
Original file line numberDiff line numberDiff line change
@@ -3757,7 +3757,6 @@ dependencies = [
37573757
"rustc_middle",
37583758
"rustc_session",
37593759
"rustc_span",
3760-
"rustc_target",
37613760
"rustc_trait_selection",
37623761
"smallvec",
37633762
"tracing",
@@ -3796,6 +3795,7 @@ dependencies = [
37963795
"rustc_middle",
37973796
"rustc_session",
37983797
"rustc_span",
3798+
"rustc_target",
37993799
"rustc_trait_selection",
38003800
"smallvec",
38013801
"tracing",
@@ -4918,15 +4918,6 @@ dependencies = [
49184918
"color-eyre",
49194919
]
49204920

4921-
[[package]]
4922-
name = "spdx"
4923-
version = "0.10.8"
4924-
source = "registry+https://github.com/rust-lang/crates.io-index"
4925-
checksum = "58b69356da67e2fc1f542c71ea7e654a361a79c938e4424392ecf4fa065d2193"
4926-
dependencies = [
4927-
"smallvec",
4928-
]
4929-
49304921
[[package]]
49314922
name = "spdx-expression"
49324923
version = "0.5.2"
@@ -5746,9 +5737,9 @@ dependencies = [
57465737

57475738
[[package]]
57485739
name = "wasi-preview1-component-adapter-provider"
5749-
version = "29.0.1"
5740+
version = "31.0.0"
57505741
source = "registry+https://github.com/rust-lang/crates.io-index"
5751-
checksum = "dcd9f21bbde82ba59e415a8725e6ad0d0d7e9e460b1a3ccbca5bdee952c1a324"
5742+
checksum = "86fabda09a0d89ffd1615b297b4a5d4b4d99df9598aeb24685837e63019e927b"
57525743

57535744
[[package]]
57545745
name = "wasm-bindgen"
@@ -5810,17 +5801,17 @@ dependencies = [
58105801

58115802
[[package]]
58125803
name = "wasm-component-ld"
5813-
version = "0.5.12"
5804+
version = "0.5.13"
58145805
source = "registry+https://github.com/rust-lang/crates.io-index"
5815-
checksum = "580305a8e3f1b7a79859a8db897de643533b2851c5eb080fe5800233f16dec88"
5806+
checksum = "a60a07a994a3538b57d8c5f8caba19f4793fb4c7156276e5e90e90acbb829e20"
58165807
dependencies = [
58175808
"anyhow",
58185809
"clap",
58195810
"lexopt",
58205811
"libc",
58215812
"tempfile",
58225813
"wasi-preview1-component-adapter-provider",
5823-
"wasmparser 0.223.1",
5814+
"wasmparser 0.229.0",
58245815
"wat",
58255816
"windows-sys 0.59.0",
58265817
"winsplit",
@@ -5847,39 +5838,24 @@ dependencies = [
58475838

58485839
[[package]]
58495840
name = "wasm-encoder"
5850-
version = "0.223.1"
5841+
version = "0.229.0"
58515842
source = "registry+https://github.com/rust-lang/crates.io-index"
5852-
checksum = "7a0a96fdeaee8fbeb4bd917fb8157d48c0d61c3b1f4ee4c363c8e8d68b2f4fe8"
5853-
dependencies = [
5854-
"leb128",
5855-
"wasmparser 0.223.1",
5856-
]
5857-
5858-
[[package]]
5859-
name = "wasm-encoder"
5860-
version = "0.228.0"
5861-
source = "registry+https://github.com/rust-lang/crates.io-index"
5862-
checksum = "05d30290541f2d4242a162bbda76b8f2d8b1ac59eab3568ed6f2327d52c9b2c4"
5843+
checksum = "38ba1d491ecacb085a2552025c10a675a6fddcbd03b1fc9b36c536010ce265d2"
58635844
dependencies = [
58645845
"leb128fmt",
5865-
"wasmparser 0.228.0",
5846+
"wasmparser 0.229.0",
58665847
]
58675848

58685849
[[package]]
58695850
name = "wasm-metadata"
5870-
version = "0.223.1"
5851+
version = "0.229.0"
58715852
source = "registry+https://github.com/rust-lang/crates.io-index"
5872-
checksum = "e2e7e37883181704d96b89dbd8f1291be13694c71cd0663aebb94b46d235a377"
5853+
checksum = "78fdb7d29a79191ab363dc90c1ddd3a1e880ffd5348d92d48482393a9e6c5f4d"
58735854
dependencies = [
58745855
"anyhow",
58755856
"indexmap",
5876-
"serde",
5877-
"serde_derive",
5878-
"serde_json",
5879-
"spdx",
5880-
"url",
5881-
"wasm-encoder 0.223.1",
5882-
"wasmparser 0.223.1",
5857+
"wasm-encoder 0.229.0",
5858+
"wasmparser 0.229.0",
58835859
]
58845860

58855861
[[package]]
@@ -5903,9 +5879,9 @@ dependencies = [
59035879

59045880
[[package]]
59055881
name = "wasmparser"
5906-
version = "0.223.1"
5882+
version = "0.229.0"
59075883
source = "registry+https://github.com/rust-lang/crates.io-index"
5908-
checksum = "664b980991ed9a8c834eb528a8979ab1109edcf52dc05dd5751e2cc3fb31035d"
5884+
checksum = "0cc3b1f053f5d41aa55640a1fa9b6d1b8a9e4418d118ce308d20e24ff3575a8c"
59095885
dependencies = [
59105886
"bitflags",
59115887
"hashbrown",
@@ -5914,35 +5890,24 @@ dependencies = [
59145890
"serde",
59155891
]
59165892

5917-
[[package]]
5918-
name = "wasmparser"
5919-
version = "0.228.0"
5920-
source = "registry+https://github.com/rust-lang/crates.io-index"
5921-
checksum = "4abf1132c1fdf747d56bbc1bb52152400c70f336870f968b85e89ea422198ae3"
5922-
dependencies = [
5923-
"bitflags",
5924-
"indexmap",
5925-
"semver",
5926-
]
5927-
59285893
[[package]]
59295894
name = "wast"
5930-
version = "228.0.0"
5895+
version = "229.0.0"
59315896
source = "registry+https://github.com/rust-lang/crates.io-index"
5932-
checksum = "9e5aae124478cb51439f6587f074a3a5e835afd22751c59a87b2e2a882727c97"
5897+
checksum = "63fcaff613c12225696bb163f79ca38ffb40e9300eff0ff4b8aa8b2f7eadf0d9"
59335898
dependencies = [
59345899
"bumpalo",
59355900
"leb128fmt",
59365901
"memchr",
59375902
"unicode-width 0.2.0",
5938-
"wasm-encoder 0.228.0",
5903+
"wasm-encoder 0.229.0",
59395904
]
59405905

59415906
[[package]]
59425907
name = "wat"
5943-
version = "1.228.0"
5908+
version = "1.229.0"
59445909
source = "registry+https://github.com/rust-lang/crates.io-index"
5945-
checksum = "7ec29c89a8d055df988de7236483bf569988ac3d6905899f6af5ef920f9385ad"
5910+
checksum = "4189bad08b70455a9e9e67dc126d2dcf91fac143a80f1046747a5dde6d4c33e0"
59465911
dependencies = [
59475912
"wast",
59485913
]
@@ -6401,9 +6366,9 @@ dependencies = [
64016366

64026367
[[package]]
64036368
name = "wit-component"
6404-
version = "0.223.1"
6369+
version = "0.229.0"
64056370
source = "registry+https://github.com/rust-lang/crates.io-index"
6406-
checksum = "3fc2fcc52a79f6f010a89c867e53e06d4227f86c58984add3e37f32b8e7af5f0"
6371+
checksum = "7f550067740e223bfe6c4878998e81cdbe2529dd9a793dc49248dd6613394e8b"
64076372
dependencies = [
64086373
"anyhow",
64096374
"bitflags",
@@ -6412,17 +6377,17 @@ dependencies = [
64126377
"serde",
64136378
"serde_derive",
64146379
"serde_json",
6415-
"wasm-encoder 0.223.1",
6380+
"wasm-encoder 0.229.0",
64166381
"wasm-metadata",
6417-
"wasmparser 0.223.1",
6382+
"wasmparser 0.229.0",
64186383
"wit-parser",
64196384
]
64206385

64216386
[[package]]
64226387
name = "wit-parser"
6423-
version = "0.223.1"
6388+
version = "0.229.0"
64246389
source = "registry+https://github.com/rust-lang/crates.io-index"
6425-
checksum = "263fde17f1fbe55a413f16eb59094bf751795c6da469a05c3d45ea6c77df6b40"
6390+
checksum = "459c6ba62bf511d6b5f2a845a2a736822e38059c1cfa0b644b467bbbfae4efa6"
64266391
dependencies = [
64276392
"anyhow",
64286393
"id-arena",
@@ -6433,7 +6398,7 @@ dependencies = [
64336398
"serde_derive",
64346399
"serde_json",
64356400
"unicode-xid",
6436-
"wasmparser 0.223.1",
6401+
"wasmparser 0.229.0",
64376402
]
64386403

64396404
[[package]]

compiler/rustc_feature/src/builtin_attrs.rs

+4
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,10 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
918918
EncodeCrossCrate::Yes,
919919
"#[rustc_never_returns_null_ptr] is used to mark functions returning non-null pointers."
920920
),
921+
rustc_attr!(
922+
rustc_no_implicit_autorefs, AttributeType::Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes,
923+
"`#[rustc_no_implicit_autorefs]` is used to mark functions for which an autoref to the dereference of a raw pointer should not be used as an argument."
924+
),
921925
rustc_attr!(
922926
rustc_coherence_is_core, AttributeType::CrateLevel, template!(Word), ErrorFollowing, EncodeCrossCrate::No,
923927
"#![rustc_coherence_is_core] allows inherent methods on builtin types, only intended to be used in `core`."

compiler/rustc_hir_analysis/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ rustc_macros = { path = "../rustc_macros" }
2626
rustc_middle = { path = "../rustc_middle" }
2727
rustc_session = { path = "../rustc_session" }
2828
rustc_span = { path = "../rustc_span" }
29-
rustc_target = { path = "../rustc_target" }
3029
rustc_trait_selection = { path = "../rustc_trait_selection" }
3130
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
3231
tracing = "0.1"

compiler/rustc_hir_analysis/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,6 @@ hir_analysis_recursive_generic_parameter = {$param_def_kind} `{$param_name}` is
450450
hir_analysis_redundant_lifetime_args = unnecessary lifetime parameter `{$victim}`
451451
.note = you can use the `{$candidate}` lifetime directly, in place of `{$victim}`
452452
453-
hir_analysis_register_type_unstable =
454-
type `{$ty}` cannot be used with this register class in stable
455-
456453
hir_analysis_requires_note = the `{$trait_name}` impl for `{$ty}` requires that `{$error_predicate}`
457454
458455
hir_analysis_return_type_notation_equality_bound =

compiler/rustc_hir_analysis/src/check/check.rs

-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
730730
.is_ok()
731731
{
732732
check_impl_items_against_trait(tcx, def_id, impl_trait_header);
733-
check_on_unimplemented(tcx, def_id);
734733
}
735734
}
736735
}

compiler/rustc_hir_analysis/src/check/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ mod check;
6767
mod compare_impl_item;
6868
mod entry;
6969
pub mod intrinsic;
70-
pub mod intrinsicck;
7170
mod region;
7271
pub mod wfcheck;
7372

compiler/rustc_hir_analysis/src/errors.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1675,14 +1675,6 @@ pub(crate) struct CmseEntryGeneric {
16751675
pub span: Span,
16761676
}
16771677

1678-
#[derive(Diagnostic)]
1679-
#[diag(hir_analysis_register_type_unstable)]
1680-
pub(crate) struct RegisterTypeUnstable<'a> {
1681-
#[primary_span]
1682-
pub span: Span,
1683-
pub ty: Ty<'a>,
1684-
}
1685-
16861678
#[derive(LintDiagnostic)]
16871679
#[diag(hir_analysis_supertrait_item_shadowing)]
16881680
pub(crate) struct SupertraitItemShadowing {

compiler/rustc_hir_typeck/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rustc_macros = { path = "../rustc_macros" }
2222
rustc_middle = { path = "../rustc_middle" }
2323
rustc_session = { path = "../rustc_session" }
2424
rustc_span = { path = "../rustc_span" }
25+
rustc_target = { path = "../rustc_target" }
2526
rustc_trait_selection = { path = "../rustc_trait_selection" }
2627
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2728
tracing = "0.1"

compiler/rustc_hir_typeck/messages.ftl

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ hir_typeck_ptr_cast_add_auto_to_object = cannot add {$traits_len ->
179179
.help = use `transmute` if you're sure this is sound
180180
.label = unsupported cast
181181
182+
hir_typeck_register_type_unstable =
183+
type `{$ty}` cannot be used with this register class in stable
184+
182185
hir_typeck_remove_semi_for_coerce = you might have meant to return the `match` expression
183186
hir_typeck_remove_semi_for_coerce_expr = this could be implicitly returned but it is a statement, not a tail expression
184187
hir_typeck_remove_semi_for_coerce_ret = the `match` arms can conform to this return type

compiler/rustc_hir_typeck/src/errors.rs

+8
Original file line numberDiff line numberDiff line change
@@ -963,3 +963,11 @@ pub(crate) enum SupertraitItemShadowee {
963963
traits: DiagSymbolList,
964964
},
965965
}
966+
967+
#[derive(Diagnostic)]
968+
#[diag(hir_typeck_register_type_unstable)]
969+
pub(crate) struct RegisterTypeUnstable<'a> {
970+
#[primary_span]
971+
pub span: Span,
972+
pub ty: Ty<'a>,
973+
}

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use rustc_hir::def::{CtorOf, DefKind, Res};
88
use rustc_hir::def_id::DefId;
99
use rustc_hir::intravisit::Visitor;
1010
use rustc_hir::{ExprKind, HirId, Node, QPath};
11-
use rustc_hir_analysis::check::intrinsicck::InlineAsmCtxt;
1211
use rustc_hir_analysis::check::potentially_plural_count;
1312
use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer;
1413
use rustc_index::IndexVec;
@@ -33,6 +32,7 @@ use crate::errors::SuggestPtrNullMut;
3332
use crate::fn_ctxt::arg_matrix::{ArgMatrix, Compatibility, Error, ExpectedIdx, ProvidedIdx};
3433
use crate::fn_ctxt::infer::FnCall;
3534
use crate::gather_locals::Declaration;
35+
use crate::inline_asm::InlineAsmCtxt;
3636
use crate::method::MethodCallee;
3737
use crate::method::probe::IsSuggestion;
3838
use crate::method::probe::Mode::MethodCall;
@@ -98,13 +98,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
9898
debug!("FnCtxt::check_asm: {} deferred checks", deferred_asm_checks.len());
9999
for (asm, hir_id) in deferred_asm_checks.drain(..) {
100100
let enclosing_id = self.tcx.hir_enclosing_body_owner(hir_id);
101-
InlineAsmCtxt::new(
102-
enclosing_id,
103-
&self.infcx,
104-
self.typing_env(self.param_env),
105-
&*self.typeck_results.borrow(),
106-
)
107-
.check_asm(asm);
101+
InlineAsmCtxt::new(self, enclosing_id).check_asm(asm);
108102
}
109103
}
110104

0 commit comments

Comments
 (0)