Skip to content

Commit 404f81d

Browse files
committed
Auto merge of #153672 - JonathanBrouwer:rollup-I0JFK6s, r=JonathanBrouwer
Rollup of 13 pull requests Successful merges: - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`) - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks) - #153471 (Refactor `ActiveJobGuard`) - #153595 (`QueryLatch` cleanups) - #153653 (scalable vector: type renames and simple checks) - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself) - #153283 (feat(rustdoc-json): Add optional support for rkyv (de)serialization) - #153479 (Add rationale for intentional potential_query_instability allows) - #153533 (Fix LegacyKeyValueFormat report from docker build: miscellaneous) - #153600 (add test for proc-macros with custom panic payloads) - #153643 (Avoid projection-only suggestions for inherent assoc types) - #153657 (triagebot: remove myself from some mention groups) - #153659 (Mark an unreachable match arm as such)
2 parents 0c68443 + 313da71 commit 404f81d

83 files changed

Lines changed: 1742 additions & 371 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,41 @@ version = "3.19.0"
376376
source = "registry+https://github.com/rust-lang/crates.io-index"
377377
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
378378

379+
[[package]]
380+
name = "bytecheck"
381+
version = "0.8.2"
382+
source = "registry+https://github.com/rust-lang/crates.io-index"
383+
checksum = "0caa33a2c0edca0419d15ac723dff03f1956f7978329b1e3b5fdaaaed9d3ca8b"
384+
dependencies = [
385+
"bytecheck_derive",
386+
"ptr_meta",
387+
"rancor",
388+
"simdutf8",
389+
]
390+
391+
[[package]]
392+
name = "bytecheck_derive"
393+
version = "0.8.2"
394+
source = "registry+https://github.com/rust-lang/crates.io-index"
395+
checksum = "89385e82b5d1821d2219e0b095efa2cc1f246cbf99080f3be46a1a85c0d392d9"
396+
dependencies = [
397+
"proc-macro2",
398+
"quote",
399+
"syn 2.0.110",
400+
]
401+
379402
[[package]]
380403
name = "bytecount"
381404
version = "0.6.9"
382405
source = "registry+https://github.com/rust-lang/crates.io-index"
383406
checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e"
384407

408+
[[package]]
409+
name = "bytes"
410+
version = "1.11.1"
411+
source = "registry+https://github.com/rust-lang/crates.io-index"
412+
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
413+
385414
[[package]]
386415
name = "camino"
387416
version = "1.2.1"
@@ -2476,6 +2505,26 @@ dependencies = [
24762505
name = "miropt-test-tools"
24772506
version = "0.1.0"
24782507

2508+
[[package]]
2509+
name = "munge"
2510+
version = "0.4.7"
2511+
source = "registry+https://github.com/rust-lang/crates.io-index"
2512+
checksum = "5e17401f259eba956ca16491461b6e8f72913a0a114e39736ce404410f915a0c"
2513+
dependencies = [
2514+
"munge_macro",
2515+
]
2516+
2517+
[[package]]
2518+
name = "munge_macro"
2519+
version = "0.4.7"
2520+
source = "registry+https://github.com/rust-lang/crates.io-index"
2521+
checksum = "4568f25ccbd45ab5d5603dc34318c1ec56b117531781260002151b8530a9f931"
2522+
dependencies = [
2523+
"proc-macro2",
2524+
"quote",
2525+
"syn 2.0.110",
2526+
]
2527+
24792528
[[package]]
24802529
name = "new_debug_unreachable"
24812530
version = "1.0.6"
@@ -3047,6 +3096,26 @@ dependencies = [
30473096
"cc",
30483097
]
30493098

3099+
[[package]]
3100+
name = "ptr_meta"
3101+
version = "0.3.1"
3102+
source = "registry+https://github.com/rust-lang/crates.io-index"
3103+
checksum = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79"
3104+
dependencies = [
3105+
"ptr_meta_derive",
3106+
]
3107+
3108+
[[package]]
3109+
name = "ptr_meta_derive"
3110+
version = "0.3.1"
3111+
source = "registry+https://github.com/rust-lang/crates.io-index"
3112+
checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1"
3113+
dependencies = [
3114+
"proc-macro2",
3115+
"quote",
3116+
"syn 2.0.110",
3117+
]
3118+
30503119
[[package]]
30513120
name = "pulldown-cmark"
30523121
version = "0.11.3"
@@ -3092,6 +3161,15 @@ version = "5.3.0"
30923161
source = "registry+https://github.com/rust-lang/crates.io-index"
30933162
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
30943163

3164+
[[package]]
3165+
name = "rancor"
3166+
version = "0.1.1"
3167+
source = "registry+https://github.com/rust-lang/crates.io-index"
3168+
checksum = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee"
3169+
dependencies = [
3170+
"ptr_meta",
3171+
]
3172+
30953173
[[package]]
30963174
name = "rand"
30973175
version = "0.8.5"
@@ -3275,6 +3353,15 @@ dependencies = [
32753353
name = "remote-test-server"
32763354
version = "0.1.0"
32773355

3356+
[[package]]
3357+
name = "rend"
3358+
version = "0.5.3"
3359+
source = "registry+https://github.com/rust-lang/crates.io-index"
3360+
checksum = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6"
3361+
dependencies = [
3362+
"bytecheck",
3363+
]
3364+
32783365
[[package]]
32793366
name = "replace-version-placeholder"
32803367
version = "0.1.0"
@@ -3283,6 +3370,36 @@ dependencies = [
32833370
"walkdir",
32843371
]
32853372

3373+
[[package]]
3374+
name = "rkyv"
3375+
version = "0.8.15"
3376+
source = "registry+https://github.com/rust-lang/crates.io-index"
3377+
checksum = "1a30e631b7f4a03dee9056b8ef6982e8ba371dd5bedb74d3ec86df4499132c70"
3378+
dependencies = [
3379+
"bytecheck",
3380+
"bytes",
3381+
"hashbrown 0.16.1",
3382+
"indexmap",
3383+
"munge",
3384+
"ptr_meta",
3385+
"rancor",
3386+
"rend",
3387+
"rkyv_derive",
3388+
"tinyvec",
3389+
"uuid",
3390+
]
3391+
3392+
[[package]]
3393+
name = "rkyv_derive"
3394+
version = "0.8.15"
3395+
source = "registry+https://github.com/rust-lang/crates.io-index"
3396+
checksum = "8100bb34c0a1d0f907143db3149e6b4eea3c33b9ee8b189720168e818303986f"
3397+
dependencies = [
3398+
"proc-macro2",
3399+
"quote",
3400+
"syn 2.0.110",
3401+
]
3402+
32863403
[[package]]
32873404
name = "run_make_support"
32883405
version = "0.0.0"
@@ -4790,6 +4907,7 @@ name = "rustdoc-json-types"
47904907
version = "0.1.0"
47914908
dependencies = [
47924909
"bincode",
4910+
"rkyv",
47934911
"rustc-hash 2.1.1",
47944912
"serde",
47954913
"serde_derive",
@@ -5128,6 +5246,12 @@ version = "0.3.7"
51285246
source = "registry+https://github.com/rust-lang/crates.io-index"
51295247
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
51305248

5249+
[[package]]
5250+
name = "simdutf8"
5251+
version = "0.1.5"
5252+
source = "registry+https://github.com/rust-lang/crates.io-index"
5253+
checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
5254+
51315255
[[package]]
51325256
name = "similar"
51335257
version = "2.7.0"

compiler/rustc_abi/src/callconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
8383
}))
8484
}
8585

86-
BackendRepr::ScalableVector { .. } => {
86+
BackendRepr::SimdScalableVector { .. } => {
8787
unreachable!("`homogeneous_aggregate` should not be called for scalable vectors")
8888
}
8989

compiler/rustc_abi/src/layout.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
210210
VariantIdx: Idx,
211211
F: AsRef<LayoutData<FieldIdx, VariantIdx>> + fmt::Debug,
212212
{
213-
vector_type_layout(VectorKind::Scalable, self.cx.data_layout(), element, count)
213+
vector_type_layout(SimdVectorKind::Scalable, self.cx.data_layout(), element, count)
214214
}
215215

216216
pub fn simd_type<FieldIdx, VariantIdx, F>(
@@ -224,7 +224,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
224224
VariantIdx: Idx,
225225
F: AsRef<LayoutData<FieldIdx, VariantIdx>> + fmt::Debug,
226226
{
227-
let kind = if repr_packed { VectorKind::PackedFixed } else { VectorKind::Fixed };
227+
let kind = if repr_packed { SimdVectorKind::PackedFixed } else { SimdVectorKind::Fixed };
228228
vector_type_layout(kind, self.cx.data_layout(), element, count)
229229
}
230230

@@ -484,7 +484,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
484484
BackendRepr::Scalar(..)
485485
| BackendRepr::ScalarPair(..)
486486
| BackendRepr::SimdVector { .. }
487-
| BackendRepr::ScalableVector { .. }
487+
| BackendRepr::SimdScalableVector { .. }
488488
| BackendRepr::Memory { .. } => repr,
489489
},
490490
};
@@ -557,7 +557,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
557557
hide_niches(b);
558558
}
559559
BackendRepr::SimdVector { element, .. }
560-
| BackendRepr::ScalableVector { element, .. } => hide_niches(element),
560+
| BackendRepr::SimdScalableVector { element, .. } => hide_niches(element),
561561
BackendRepr::Memory { sized: _ } => {}
562562
}
563563
st.largest_niche = None;
@@ -1524,7 +1524,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
15241524
}
15251525
}
15261526

1527-
enum VectorKind {
1527+
enum SimdVectorKind {
15281528
/// `#[rustc_scalable_vector]`
15291529
Scalable,
15301530
/// `#[repr(simd, packed)]`
@@ -1534,7 +1534,7 @@ enum VectorKind {
15341534
}
15351535

15361536
fn vector_type_layout<FieldIdx, VariantIdx, F>(
1537-
kind: VectorKind,
1537+
kind: SimdVectorKind,
15381538
dl: &TargetDataLayout,
15391539
element: F,
15401540
count: u64,
@@ -1559,16 +1559,16 @@ where
15591559
let size =
15601560
elt.size.checked_mul(count, dl).ok_or_else(|| LayoutCalculatorError::SizeOverflow)?;
15611561
let (repr, align) = match kind {
1562-
VectorKind::Scalable => {
1563-
(BackendRepr::ScalableVector { element, count }, dl.llvmlike_vector_align(size))
1562+
SimdVectorKind::Scalable => {
1563+
(BackendRepr::SimdScalableVector { element, count }, dl.llvmlike_vector_align(size))
15641564
}
15651565
// Non-power-of-two vectors have padding up to the next power-of-two.
15661566
// If we're a packed repr, remove the padding while keeping the alignment as close
15671567
// to a vector as possible.
1568-
VectorKind::PackedFixed if !count.is_power_of_two() => {
1568+
SimdVectorKind::PackedFixed if !count.is_power_of_two() => {
15691569
(BackendRepr::Memory { sized: true }, Align::max_aligned_factor(size))
15701570
}
1571-
VectorKind::PackedFixed | VectorKind::Fixed => {
1571+
SimdVectorKind::PackedFixed | SimdVectorKind::Fixed => {
15721572
(BackendRepr::SimdVector { element, count }, dl.llvmlike_vector_align(size))
15731573
}
15741574
};

compiler/rustc_abi/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ impl AddressSpace {
17311731
pub enum BackendRepr {
17321732
Scalar(Scalar),
17331733
ScalarPair(Scalar, Scalar),
1734-
ScalableVector {
1734+
SimdScalableVector {
17351735
element: Scalar,
17361736
count: u64,
17371737
},
@@ -1758,7 +1758,7 @@ impl BackendRepr {
17581758
// fully implemented, scalable vectors will remain `Sized`, they just won't be
17591759
// `const Sized` - whether `is_unsized` continues to return `false` at that point will
17601760
// need to be revisited and will depend on what `is_unsized` is used for.
1761-
| BackendRepr::ScalableVector { .. }
1761+
| BackendRepr::SimdScalableVector { .. }
17621762
| BackendRepr::SimdVector { .. } => false,
17631763
BackendRepr::Memory { sized } => !sized,
17641764
}
@@ -1801,7 +1801,7 @@ impl BackendRepr {
18011801
// The align of a Vector can vary in surprising ways
18021802
BackendRepr::SimdVector { .. }
18031803
| BackendRepr::Memory { .. }
1804-
| BackendRepr::ScalableVector { .. } => None,
1804+
| BackendRepr::SimdScalableVector { .. } => None,
18051805
}
18061806
}
18071807

@@ -1825,7 +1825,7 @@ impl BackendRepr {
18251825
// The size of a Vector can vary in surprising ways
18261826
BackendRepr::SimdVector { .. }
18271827
| BackendRepr::Memory { .. }
1828-
| BackendRepr::ScalableVector { .. } => None,
1828+
| BackendRepr::SimdScalableVector { .. } => None,
18291829
}
18301830
}
18311831

@@ -1840,8 +1840,8 @@ impl BackendRepr {
18401840
BackendRepr::SimdVector { element: element.to_union(), count }
18411841
}
18421842
BackendRepr::Memory { .. } => BackendRepr::Memory { sized: true },
1843-
BackendRepr::ScalableVector { element, count } => {
1844-
BackendRepr::ScalableVector { element: element.to_union(), count }
1843+
BackendRepr::SimdScalableVector { element, count } => {
1844+
BackendRepr::SimdScalableVector { element: element.to_union(), count }
18451845
}
18461846
}
18471847
}
@@ -2085,7 +2085,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
20852085
match self.backend_repr {
20862086
BackendRepr::Scalar(_)
20872087
| BackendRepr::SimdVector { .. }
2088-
| BackendRepr::ScalableVector { .. } => false,
2088+
| BackendRepr::SimdScalableVector { .. } => false,
20892089
BackendRepr::ScalarPair(..) | BackendRepr::Memory { .. } => true,
20902090
}
20912091
}
@@ -2182,13 +2182,13 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
21822182

21832183
/// Returns `true` if the size of the type is only known at runtime.
21842184
pub fn is_runtime_sized(&self) -> bool {
2185-
matches!(self.backend_repr, BackendRepr::ScalableVector { .. })
2185+
matches!(self.backend_repr, BackendRepr::SimdScalableVector { .. })
21862186
}
21872187

21882188
/// Returns the elements count of a scalable vector.
21892189
pub fn scalable_vector_element_count(&self) -> Option<u64> {
21902190
match self.backend_repr {
2191-
BackendRepr::ScalableVector { count, .. } => Some(count),
2191+
BackendRepr::SimdScalableVector { count, .. } => Some(count),
21922192
_ => None,
21932193
}
21942194
}
@@ -2201,7 +2201,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
22012201
match self.backend_repr {
22022202
BackendRepr::Scalar(_)
22032203
| BackendRepr::ScalarPair(..)
2204-
| BackendRepr::ScalableVector { .. }
2204+
| BackendRepr::SimdScalableVector { .. }
22052205
| BackendRepr::SimdVector { .. } => false,
22062206
BackendRepr::Memory { sized } => sized && self.size.bytes() == 0,
22072207
}

0 commit comments

Comments
 (0)