authorbors <bors@rust-lang.org> 2026-07-01 06:26:48 UTC
committerbors <bors@rust-lang.org> 2026-07-01 06:26:48 UTC
log7c5dac9c7476a30e09a5aa87b4df2c5663fe7734
tree4094fa87d8ec1808fcee5c4a4c2bca2625e7f693
parent17aa77551e89d5e80d4b506c9a32fc151264b8e4
parent38002bb365a890f5c80d857a602432b96ad581ff

Auto merge of #158639 - jhpratt:rollup-sDKhJ0G, r=jhpratt

Rollup of 6 pull requests Successful merges: - rust-lang/rust#157718 (Do not increase depth when evaluating nested goals of `NormalizesTo`) - rust-lang/rust#158449 (QNX target renaming) - rust-lang/rust#158483 (signed strict division: just use normal division) - rust-lang/rust#158516 ( Deduplicate codegen backends in bootstrap config) - rust-lang/rust#158542 (Rename `align` to `default_align` on `Scalar` and `Primitive`) - rust-lang/rust#158636 (linkchecker: upgrade to `html5ever v0.39`)

78 files changed, 648 insertions(+), 491 deletions(-)

Cargo.lock+44-65
......@@ -1556,16 +1556,6 @@ version = "1.3.0"
15561556source = "registry+https://github.com/rust-lang/crates.io-index"
15571557checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
15581558
1559[[package]]
1560name = "futf"
1561version = "0.1.5"
1562source = "registry+https://github.com/rust-lang/crates.io-index"
1563checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"
1564dependencies = [
1565 "mac",
1566 "new_debug_unreachable",
1567]
1568
15691559[[package]]
15701560name = "generate-copyright"
15711561version = "0.1.0"
......@@ -1791,14 +1781,12 @@ dependencies = [
17911781
17921782[[package]]
17931783name = "html5ever"
1794version = "0.29.1"
1784version = "0.39.0"
17951785source = "registry+https://github.com/rust-lang/crates.io-index"
1796checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c"
1786checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8"
17971787dependencies = [
17981788 "log",
1799 "mac",
18001789 "markup5ever",
1801 "match_token",
18021790]
18031791
18041792[[package]]
......@@ -2424,35 +2412,15 @@ dependencies = [
24242412 "pkg-config",
24252413]
24262414
2427[[package]]
2428name = "mac"
2429version = "0.1.1"
2430source = "registry+https://github.com/rust-lang/crates.io-index"
2431checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
2432
24332415[[package]]
24342416name = "markup5ever"
2435version = "0.14.1"
2417version = "0.39.0"
24362418source = "registry+https://github.com/rust-lang/crates.io-index"
2437checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18"
2419checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de"
24382420dependencies = [
24392421 "log",
2440 "phf 0.11.3",
2441 "phf_codegen",
2442 "string_cache",
2443 "string_cache_codegen",
24442422 "tendril",
2445]
2446
2447[[package]]
2448name = "match_token"
2449version = "0.1.0"
2450source = "registry+https://github.com/rust-lang/crates.io-index"
2451checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b"
2452dependencies = [
2453 "proc-macro2",
2454 "quote",
2455 "syn",
2423 "web_atoms",
24562424]
24572425
24582426[[package]]
......@@ -2986,56 +2954,57 @@ dependencies = [
29862954
29872955[[package]]
29882956name = "phf"
2989version = "0.11.3"
2957version = "0.12.1"
29902958source = "registry+https://github.com/rust-lang/crates.io-index"
2991checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
2959checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
29922960dependencies = [
2993 "phf_shared 0.11.3",
2961 "phf_shared 0.12.1",
29942962]
29952963
29962964[[package]]
29972965name = "phf"
2998version = "0.12.1"
2966version = "0.13.1"
29992967source = "registry+https://github.com/rust-lang/crates.io-index"
3000checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
2968checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
30012969dependencies = [
3002 "phf_shared 0.12.1",
2970 "phf_shared 0.13.1",
2971 "serde",
30032972]
30042973
30052974[[package]]
30062975name = "phf_codegen"
3007version = "0.11.3"
2976version = "0.13.1"
30082977source = "registry+https://github.com/rust-lang/crates.io-index"
3009checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
2978checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
30102979dependencies = [
30112980 "phf_generator",
3012 "phf_shared 0.11.3",
2981 "phf_shared 0.13.1",
30132982]
30142983
30152984[[package]]
30162985name = "phf_generator"
3017version = "0.11.3"
2986version = "0.13.1"
30182987source = "registry+https://github.com/rust-lang/crates.io-index"
3019checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
2988checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
30202989dependencies = [
3021 "phf_shared 0.11.3",
3022 "rand 0.8.5",
2990 "fastrand",
2991 "phf_shared 0.13.1",
30232992]
30242993
30252994[[package]]
30262995name = "phf_shared"
3027version = "0.11.3"
2996version = "0.12.1"
30282997source = "registry+https://github.com/rust-lang/crates.io-index"
3029checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
2998checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
30302999dependencies = [
30313000 "siphasher",
30323001]
30333002
30343003[[package]]
30353004name = "phf_shared"
3036version = "0.12.1"
3005version = "0.13.1"
30373006source = "registry+https://github.com/rust-lang/crates.io-index"
3038checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
3007checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
30393008dependencies = [
30403009 "siphasher",
30413010]
......@@ -5425,25 +5394,24 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
54255394
54265395[[package]]
54275396name = "string_cache"
5428version = "0.8.9"
5397version = "0.9.0"
54295398source = "registry+https://github.com/rust-lang/crates.io-index"
5430checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f"
5399checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
54315400dependencies = [
54325401 "new_debug_unreachable",
54335402 "parking_lot",
5434 "phf_shared 0.11.3",
5403 "phf_shared 0.13.1",
54355404 "precomputed-hash",
5436 "serde",
54375405]
54385406
54395407[[package]]
54405408name = "string_cache_codegen"
5441version = "0.5.4"
5409version = "0.6.1"
54425410source = "registry+https://github.com/rust-lang/crates.io-index"
5443checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"
5411checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
54445412dependencies = [
54455413 "phf_generator",
5446 "phf_shared 0.11.3",
5414 "phf_shared 0.13.1",
54475415 "proc-macro2",
54485416 "quote",
54495417]
......@@ -5533,12 +5501,11 @@ dependencies = [
55335501
55345502[[package]]
55355503name = "tendril"
5536version = "0.4.3"
5504version = "0.5.0"
55375505source = "registry+https://github.com/rust-lang/crates.io-index"
5538checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"
5506checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24"
55395507dependencies = [
5540 "futf",
5541 "mac",
5508 "new_debug_unreachable",
55425509 "utf-8",
55435510]
55445511
......@@ -6503,6 +6470,18 @@ dependencies = [
65036470 "wasm-bindgen",
65046471]
65056472
6473[[package]]
6474name = "web_atoms"
6475version = "0.2.5"
6476source = "registry+https://github.com/rust-lang/crates.io-index"
6477checksum = "075474b12bcb3d2e3d4546580e9de478eeeead668a1761e2a8860c836b7ef297"
6478dependencies = [
6479 "phf 0.13.1",
6480 "phf_codegen",
6481 "string_cache",
6482 "string_cache_codegen",
6483]
6484
65066485[[package]]
65076486name = "winapi-util"
65086487version = "0.1.11"
compiler/rustc_abi/src/layout.rs+6-3
......@@ -477,12 +477,14 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
477477 Ok(Some((repr, _))) => match repr {
478478 // Mismatched alignment (e.g. union is #[repr(packed)]): disable opt
479479 BackendRepr::Scalar(_) | BackendRepr::ScalarPair(_, _)
480 if repr.scalar_align(dl).unwrap() != align =>
480 if repr.scalar_platform_align(dl).unwrap() != align =>
481481 {
482482 BackendRepr::Memory { sized: true }
483483 }
484484 // Vectors require at least element alignment, else disable the opt
485 BackendRepr::SimdVector { element, count: _ } if element.align(dl).abi > align => {
485 BackendRepr::SimdVector { element, count: _ }
486 if element.default_align(dl).abi > align =>
487 {
486488 BackendRepr::Memory { sized: true }
487489 }
488490 // the alignment tests passed and we can use this
......@@ -986,7 +988,8 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
986988 // roundtripping pointers through ptrtoint/inttoptr.
987989 (p @ Primitive::Pointer(_), i @ Primitive::Int(..))
988990 | (i @ Primitive::Int(..), p @ Primitive::Pointer(_))
989 if p.size(dl) == i.size(dl) && p.align(dl) == i.align(dl) =>
991 if p.size(dl) == i.size(dl)
992 && p.default_align(dl) == i.default_align(dl) =>
990993 {
991994 p
992995 }
compiler/rustc_abi/src/layout/simple.rs+3-3
......@@ -49,7 +49,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
4949 pub fn scalar<C: HasDataLayout>(cx: &C, scalar: Scalar) -> Self {
5050 let largest_niche = Niche::from_scalar(cx, Size::ZERO, scalar);
5151 let size = scalar.size(cx);
52 let align = scalar.align(cx);
52 let align = scalar.default_align(cx);
5353
5454 let range = scalar.valid_range(cx);
5555
......@@ -90,8 +90,8 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
9090
9191 pub fn scalar_pair<C: HasDataLayout>(cx: &C, a: Scalar, b: Scalar) -> Self {
9292 let dl = cx.data_layout();
93 let b_align = b.align(dl).abi;
94 let align = a.align(dl).abi.max(b_align).max(dl.aggregate_align);
93 let b_align = b.default_align(dl).abi;
94 let align = a.default_align(dl).abi.max(b_align).max(dl.aggregate_align);
9595 let b_offset = a.size(dl).align_to(b_align);
9696 let size = (b_offset + b.size(dl)).align_to(align);
9797
compiler/rustc_abi/src/lib.rs+30-8
......@@ -1404,7 +1404,11 @@ impl Primitive {
14041404 }
14051405 }
14061406
1407 pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
1407 /// The *platform-specific* ABI alignment of this primitive.
1408 ///
1409 /// This is the type alignment for the corresponding built-in.
1410 /// In other contexts it might have different alignment.
1411 pub fn default_align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
14081412 use Primitive::*;
14091413 let dl = cx.data_layout();
14101414
......@@ -1579,8 +1583,12 @@ impl Scalar {
15791583 }
15801584 }
15811585
1582 pub fn align(self, cx: &impl HasDataLayout) -> AbiAlign {
1583 self.primitive().align(cx)
1586 /// The *platform-specific* ABI alignment of this scalar.
1587 ///
1588 /// This is the type alignment for the corresponding built-in.
1589 /// This is *not* necessarily the correct alignment for a type that has this `BackendRepr::Scalar`!
1590 pub fn default_align(self, cx: &impl HasDataLayout) -> AbiAlign {
1591 self.primitive().default_align(cx)
15841592 }
15851593
15861594 pub fn size(self, cx: &impl HasDataLayout) -> Size {
......@@ -1792,6 +1800,14 @@ impl IntoDiagArg for NumScalableVectors {
17921800#[cfg_attr(feature = "nightly", derive(StableHash))]
17931801pub enum BackendRepr {
17941802 Scalar(Scalar),
1803 /// The data contained in this type can be entirely represented by two scalars.
1804 /// The two scalars are listed in *memory* order, so the first is at offset zero
1805 /// and the second at a non-zero offset.
1806 /// These need not be `FieldIdx(0)` and `FieldIdx(1)`.
1807 ///
1808 /// As of June 2026 the offset to the second scalar is the size of the first
1809 /// scalar rounded up to the platform alignment of the second scalar.
1810 /// That may soon change, however; see MCP#1007.
17951811 ScalarPair(Scalar, Scalar),
17961812 SimdScalableVector {
17971813 element: Scalar,
......@@ -1857,10 +1873,16 @@ impl BackendRepr {
18571873 /// The psABI alignment for a `Scalar` or `ScalarPair`
18581874 ///
18591875 /// `None` for other variants.
1860 pub fn scalar_align<C: HasDataLayout>(&self, cx: &C) -> Option<Align> {
1876 ///
1877 /// It's unclear whether this is a meaningful operation, and MCP#1007 proposes changes.
1878 /// You should generally be using the alignment of the place or the type,
1879 /// not calculating something from the `Scalar`s.
1880 pub fn scalar_platform_align<C: HasDataLayout>(&self, cx: &C) -> Option<Align> {
18611881 match *self {
1862 BackendRepr::Scalar(s) => Some(s.align(cx).abi),
1863 BackendRepr::ScalarPair(s1, s2) => Some(s1.align(cx).max(s2.align(cx)).abi),
1882 BackendRepr::Scalar(s) => Some(s.default_align(cx).abi),
1883 BackendRepr::ScalarPair(s1, s2) => {
1884 Some(s1.default_align(cx).max(s2.default_align(cx)).abi)
1885 }
18641886 // The align of a Vector can vary in surprising ways
18651887 BackendRepr::SimdVector { .. }
18661888 | BackendRepr::Memory { .. }
......@@ -1877,9 +1899,9 @@ impl BackendRepr {
18771899 BackendRepr::Scalar(s) => Some(s.size(cx)),
18781900 // May have some padding between the pair.
18791901 BackendRepr::ScalarPair(s1, s2) => {
1880 let field2_offset = s1.size(cx).align_to(s2.align(cx).abi);
1902 let field2_offset = s1.size(cx).align_to(s2.default_align(cx).abi);
18811903 let size = (field2_offset + s2.size(cx)).align_to(
1882 self.scalar_align(cx)
1904 self.scalar_platform_align(cx)
18831905 // We absolutely must have an answer here or everything is FUBAR.
18841906 .unwrap(),
18851907 );
compiler/rustc_codegen_cranelift/src/value_and_place.rs+1-1
......@@ -56,7 +56,7 @@ fn codegen_field<'tcx>(
5656}
5757
5858fn scalar_pair_calculate_b_offset(tcx: TyCtxt<'_>, a_scalar: Scalar, b_scalar: Scalar) -> Offset32 {
59 let b_offset = a_scalar.size(&tcx).align_to(b_scalar.align(&tcx).abi);
59 let b_offset = a_scalar.size(&tcx).align_to(b_scalar.default_align(&tcx).abi);
6060 Offset32::new(b_offset.bytes().try_into().unwrap())
6161}
6262
compiler/rustc_codegen_gcc/src/builder.rs+1-1
......@@ -1065,7 +1065,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
10651065 },
10661066 )
10671067 } else if let abi::BackendRepr::ScalarPair(ref a, ref b) = place.layout.backend_repr {
1068 let b_offset = a.size(self).align_to(b.align(self).abi);
1068 let b_offset = a.size(self).align_to(b.default_align(self).abi);
10691069
10701070 let mut load = |i, scalar: &abi::Scalar, align| {
10711071 let ptr = if i == 0 {
compiler/rustc_codegen_gcc/src/type_of.rs+2-1
......@@ -325,7 +325,8 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
325325 return cx.type_i1();
326326 }
327327
328 let offset = if index == 0 { Size::ZERO } else { a.size(cx).align_to(b.align(cx).abi) };
328 let offset =
329 if index == 0 { Size::ZERO } else { a.size(cx).align_to(b.default_align(cx).abi) };
329330 self.scalar_gcc_type_at(cx, scalar, offset)
330331 }
331332
compiler/rustc_codegen_llvm/src/builder.rs+1-1
......@@ -794,7 +794,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
794794 });
795795 OperandValue::Immediate(llval)
796796 } else if let abi::BackendRepr::ScalarPair(a, b) = place.layout.backend_repr {
797 let b_offset = a.size(self).align_to(b.align(self).abi);
797 let b_offset = a.size(self).align_to(b.default_align(self).abi);
798798
799799 let mut load = |i, scalar: abi::Scalar, layout, align, offset| {
800800 let llptr = if i == 0 {
compiler/rustc_codegen_ssa/src/mir/operand.rs+3-3
......@@ -227,7 +227,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
227227 b @ abi::Scalar::Initialized { .. },
228228 ) => {
229229 let (a_size, b_size) = (a.size(bx), b.size(bx));
230 let b_offset = (offset + a_size).align_to(b.align(bx).abi);
230 let b_offset = (offset + a_size).align_to(b.default_align(bx).abi);
231231 assert!(b_offset.bytes() > 0);
232232 let a_val = read_scalar(
233233 offset,
......@@ -388,7 +388,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
388388 assert_eq!(field.size, a.size(bx.cx()));
389389 (Some(a), a_llval)
390390 } else {
391 assert_eq!(offset, a.size(bx.cx()).align_to(b.align(bx.cx()).abi));
391 assert_eq!(offset, a.size(bx.cx()).align_to(b.default_align(bx.cx()).abi));
392392 assert_eq!(field.size, b.size(bx.cx()));
393393 (Some(b), b_llval)
394394 }
......@@ -962,7 +962,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandValue<V> {
962962 let BackendRepr::ScalarPair(a_scalar, b_scalar) = dest.layout.backend_repr else {
963963 bug!("store_with_flags: invalid ScalarPair layout: {:#?}", dest.layout);
964964 };
965 let b_offset = a_scalar.size(bx).align_to(b_scalar.align(bx).abi);
965 let b_offset = a_scalar.size(bx).align_to(b_scalar.default_align(bx).abi);
966966
967967 let val = bx.from_immediate(a);
968968 let align = dest.val.align;
compiler/rustc_const_eval/src/interpret/operand.rs+2-2
......@@ -419,7 +419,7 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
419419 Immediate::from(if offset.bytes() == 0 {
420420 a_val
421421 } else {
422 assert_eq!(offset, a.size(cx).align_to(b.align(cx).abi));
422 assert_eq!(offset, a.size(cx).align_to(b.default_align(cx).abi));
423423 b_val
424424 })
425425 }
......@@ -614,7 +614,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
614614 // We would anyway check against `ptr_align.restrict_for_offset(b_offset)`,
615615 // which `ptr.offset(b_offset)` cannot possibly fail to satisfy.
616616 let (a_size, b_size) = (a.size(self), b.size(self));
617 let b_offset = a_size.align_to(b.align(self).abi);
617 let b_offset = a_size.align_to(b.default_align(self).abi);
618618 assert!(b_offset.bytes() > 0); // in `operand_field` we use the offset to tell apart the fields
619619 let a_val = alloc.read_scalar(
620620 alloc_range(Size::ZERO, a_size),
compiler/rustc_const_eval/src/interpret/place.rs+1-1
......@@ -733,7 +733,7 @@ where
733733 )
734734 };
735735 let a_size = a_val.size();
736 let b_offset = a_size.align_to(b.align(&tcx).abi);
736 let b_offset = a_size.align_to(b.default_align(&tcx).abi);
737737 assert!(b_offset.bytes() > 0); // in `operand_field` we use the offset to tell apart the fields
738738
739739 // It is tempting to verify `b_offset` against `layout.fields.offset(1)`,
compiler/rustc_mir_transform/src/gvn.rs+1-1
......@@ -742,7 +742,7 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
742742 a1.size(&self.ecx) == a2.size(&self.ecx)
743743 && b1.size(&self.ecx) == b2.size(&self.ecx)
744744 // The alignment of the second component determines its offset, so that also needs to match.
745 && b1.align(&self.ecx) == b2.align(&self.ecx)
745 && b1.default_align(&self.ecx) == b2.default_align(&self.ecx)
746746 // None of the inputs may be a pointer.
747747 && !matches!(a1.primitive(), Primitive::Pointer(..))
748748 && !matches!(b1.primitive(), Primitive::Pointer(..))
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs+7-3
......@@ -8,7 +8,7 @@ use rustc_type_ir::inherent::*;
88use rustc_type_ir::region_constraint::RegionConstraint;
99use rustc_type_ir::relate::Relate;
1010use rustc_type_ir::relate::solver_relating::RelateExt;
11use rustc_type_ir::search_graph::{CandidateHeadUsages, PathKind};
11use rustc_type_ir::search_graph::{CandidateHeadUsages, IncreaseDepthForNested, PathKind};
1212use rustc_type_ir::solve::{
1313 AccessedOpaques, ExternalRegionConstraints, FetchEligibleAssocItemResponse, MaybeInfo,
1414 NoSolutionOrRerunNonErased, OpaqueTypesJank, QueryResultOrRerunNonErased, RerunCondition,
......@@ -484,7 +484,7 @@ where
484484 stalled_on: Option<GoalStalledOn<I>>,
485485 ) -> Result<GoalEvaluation<I>, NoSolutionOrRerunNonErased> {
486486 let (normalization_nested_goals, goal_evaluation) =
487 self.evaluate_goal_raw(source, goal, stalled_on)?;
487 self.evaluate_goal_raw(source, goal, stalled_on, IncreaseDepthForNested::Yes)?;
488488 assert!(normalization_nested_goals.is_empty());
489489 Ok(goal_evaluation)
490490 }
......@@ -576,6 +576,7 @@ where
576576 source: GoalSource,
577577 goal: Goal<I, I::Predicate>,
578578 stalled_on: Option<GoalStalledOn<I>>,
579 increase_depth_for_nested: IncreaseDepthForNested,
579580 ) -> Result<(NestedNormalizationGoals<I>, GoalEvaluation<I>), NoSolutionOrRerunNonErased> {
580581 if let RerunStalled::WontMakeProgress(stalled_certainty) =
581582 self.rerunning_stalled_goal_may_make_progress(stalled_on.as_ref())
......@@ -591,7 +592,7 @@ where
591592 ));
592593 }
593594
594 self.evaluate_goal_cold(source, goal)
595 self.evaluate_goal_cold(source, goal, increase_depth_for_nested)
595596 }
596597
597598 #[cold]
......@@ -600,6 +601,7 @@ where
600601 &mut self,
601602 source: GoalSource,
602603 goal: Goal<I, I::Predicate>,
604 increase_depth_for_nested: IncreaseDepthForNested,
603605 ) -> Result<(NestedNormalizationGoals<I>, GoalEvaluation<I>), NoSolutionOrRerunNonErased> {
604606 // We only care about one entry per `OpaqueTypeKey` here,
605607 // so we only canonicalize the lookup table and ignore
......@@ -663,6 +665,7 @@ where
663665 self.cx(),
664666 canonical_goal,
665667 step_kind,
668 increase_depth_for_nested,
666669 &mut inspect::ProofTreeBuilder::new_noop(),
667670 );
668671
......@@ -702,6 +705,7 @@ where
702705 self.cx(),
703706 canonical_goal,
704707 step_kind,
708 increase_depth_for_nested,
705709 &mut inspect::ProofTreeBuilder::new_noop(),
706710 );
707711 assert!(
compiler/rustc_next_trait_solver/src/solve/project_goals/mod.rs+14-1
......@@ -3,6 +3,7 @@ mod free_alias;
33mod inherent;
44mod opaque_types;
55
6use rustc_type_ir::search_graph::IncreaseDepthForNested;
67use rustc_type_ir::solve::QueryResultOrRerunNonErased;
78use rustc_type_ir::{self as ty, Interner, ProjectionPredicate};
89use tracing::{instrument, trace};
......@@ -67,7 +68,19 @@ where
6768 let (
6869 NestedNormalizationGoals(nested_goals),
6970 GoalEvaluation { goal: _, certainty, stalled_on: _, has_changed: _ },
70 ) = self.evaluate_goal_raw(GoalSource::TypeRelating, normalizes_to, None)?;
71 ) = self.evaluate_goal_raw(
72 GoalSource::TypeRelating,
73 normalizes_to,
74 None,
75 // We don't increase depth for nested goals for this `NormalizesTo` goal, as
76 // evaluating `NormalizesTo` is an extra step only exists in the new solver
77 // that behaves like a function call rather than an independent nested goal
78 // evaluation, so increasing the depth may end up regressions which hit the
79 // recursion limits for crates compiled well with the old solver. Furthermore,
80 // those nested goals from `NormalizesTo` will be evaluated again as the
81 // caller's nested goals with increased depths anyway.
82 IncreaseDepthForNested::No,
83 )?;
7184
7285 trace!(?nested_goals);
7386
compiler/rustc_target/src/callconv/mod.rs+1-1
......@@ -399,7 +399,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
399399 BackendRepr::Scalar(scalar) => PassMode::Direct(scalar_attrs(scalar, Size::ZERO)),
400400 BackendRepr::ScalarPair(a, b) => PassMode::Pair(
401401 scalar_attrs(a, Size::ZERO),
402 scalar_attrs(b, a.size(cx).align_to(b.align(cx).abi)),
402 scalar_attrs(b, a.size(cx).align_to(b.default_align(cx).abi)),
403403 ),
404404 BackendRepr::SimdVector { .. } => PassMode::Direct(ArgAttributes::new()),
405405 BackendRepr::Memory { .. } => Self::indirect_pass_mode(&layout),
compiler/rustc_target/src/spec/base/mod.rs+1-1
......@@ -26,8 +26,8 @@ pub(crate) mod managarm_mlibc;
2626pub(crate) mod motor;
2727pub(crate) mod msvc;
2828pub(crate) mod netbsd;
29pub(crate) mod nto_qnx;
3029pub(crate) mod openbsd;
30pub(crate) mod qnx_sdp;
3131pub(crate) mod redox;
3232pub(crate) mod solaris;
3333pub(crate) mod solid;
compiler/rustc_target/src/spec/base/nto_qnx.rs deleted-116
......@@ -1,116 +0,0 @@
1use crate::spec::{
2 Cc, LinkArgs, LinkerFlavor, Lld, Os, RelroLevel, Target, TargetMetadata, TargetOptions, cvs,
3};
4
5pub(crate) fn opts() -> TargetOptions {
6 TargetOptions {
7 crt_static_respected: true,
8 dynamic_linking: true,
9 executables: true,
10 families: cvs!["unix"],
11 has_rpath: true,
12 has_thread_local: false,
13 linker: Some("qcc".into()),
14 os: Os::Nto,
15 // We want backtraces to work by default and they rely on unwind tables
16 // (regardless of `-C panic` strategy).
17 default_uwtable: true,
18 position_independent_executables: true,
19 static_position_independent_executables: true,
20 relro_level: RelroLevel::Full,
21 ..Default::default()
22 }
23}
24
25pub(crate) fn meta() -> TargetMetadata {
26 TargetMetadata { description: None, tier: Some(3), host_tools: Some(false), std: Some(true) }
27}
28
29pub(crate) fn aarch64() -> Target {
30 Target {
31 llvm_target: "aarch64-unknown-unknown".into(),
32 metadata: meta(),
33 pointer_width: 64,
34 // from: https://llvm.org/docs/LangRef.html#data-layout
35 // e = little endian
36 // m:e = ELF mangling: Private symbols get a .L prefix
37 // i8:8:32 = 8-bit-integer, minimum_alignment=8, preferred_alignment=32
38 // i16:16:32 = 16-bit-integer, minimum_alignment=16, preferred_alignment=32
39 // i64:64 = 64-bit-integer, minimum_alignment=64, preferred_alignment=64
40 // i128:128 = 128-bit-integer, minimum_alignment=128, preferred_alignment=128
41 // n32:64 = 32 and 64 are native integer widths; Elements of this set are considered to support most general arithmetic operations efficiently.
42 // S128 = 128 bits are the natural alignment of the stack in bits.
43 data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
44 arch: crate::spec::Arch::AArch64,
45 options: TargetOptions {
46 features: "+v8a".into(),
47 max_atomic_width: Some(128),
48 ..opts()
49 }
50 }
51}
52
53pub(crate) fn x86_64() -> Target {
54 Target {
55 llvm_target: "x86_64-pc-unknown".into(),
56 metadata: meta(),
57 pointer_width: 64,
58 data_layout:
59 "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
60 arch: crate::spec::Arch::X86_64,
61 options: TargetOptions {
62 cpu: "x86-64".into(),
63 plt_by_default: false,
64 max_atomic_width: Some(64),
65 vendor: "pc".into(),
66 ..opts()
67 },
68 }
69}
70
71pub(crate) fn pre_link_args(api_var: ApiVariant, arch: Arch) -> LinkArgs {
72 let (qcc_arg, arch_lib_dir) = match arch {
73 Arch::Aarch64 => ("-Vgcc_ntoaarch64le_cxx", "aarch64le"),
74 Arch::I586 => {
75 ("-Vgcc_ntox86_cxx", "notSupportedByQnx_compiler/rustc_target/src/spec/base/nto_qnx.rs")
76 }
77 Arch::X86_64 => ("-Vgcc_ntox86_64_cxx", "x86_64"),
78 };
79 match api_var {
80 ApiVariant::Default => {
81 TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[qcc_arg])
82 }
83 ApiVariant::IoSock => TargetOptions::link_args(
84 LinkerFlavor::Gnu(Cc::Yes, Lld::No),
85 &[qcc_arg, get_iosock_param(arch_lib_dir)],
86 ),
87 }
88}
89
90pub(crate) enum ApiVariant {
91 Default,
92 IoSock,
93}
94
95pub(crate) enum Arch {
96 Aarch64,
97 I586,
98 X86_64,
99}
100
101// When using `io-sock` on QNX, we must add a search path for the linker so
102// that it prefers the io-sock version.
103// The path depends on the host, i.e. we cannot hard-code it here, but have
104// to determine it when the compiler runs.
105// When using the QNX toolchain, the environment variable QNX_TARGET is always set.
106// More information:
107// https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.io_sock/topic/migrate_app.html
108fn get_iosock_param(arch_lib_dir: &str) -> &'static str {
109 let target_dir = std::env::var("QNX_TARGET")
110 .unwrap_or_else(|_| "QNX_TARGET_not_set_please_source_qnxsdp-env.sh".into());
111 let linker_param = format!("-L{target_dir}/{arch_lib_dir}/io-sock/lib");
112
113 // FIXME: leaking this is kind of weird: we're feeding these into something that expects an
114 // `AsRef<OsStr>`, but often converts to `OsString` anyways, so shouldn't we just demand an `OsString`?
115 linker_param.leak()
116}
compiler/rustc_target/src/spec/base/qnx_sdp.rs created+116
......@@ -0,0 +1,116 @@
1use crate::spec::{
2 Cc, LinkArgs, LinkerFlavor, Lld, Os, RelroLevel, Target, TargetMetadata, TargetOptions, cvs,
3};
4
5pub(crate) fn opts() -> TargetOptions {
6 TargetOptions {
7 crt_static_respected: true,
8 dynamic_linking: true,
9 executables: true,
10 families: cvs!["unix"],
11 has_rpath: true,
12 has_thread_local: false,
13 linker: Some("qcc".into()),
14 os: Os::Nto,
15 // We want backtraces to work by default and they rely on unwind tables
16 // (regardless of `-C panic` strategy).
17 default_uwtable: true,
18 position_independent_executables: true,
19 static_position_independent_executables: true,
20 relro_level: RelroLevel::Full,
21 ..Default::default()
22 }
23}
24
25pub(crate) fn meta() -> TargetMetadata {
26 TargetMetadata { description: None, tier: Some(3), host_tools: Some(false), std: Some(true) }
27}
28
29pub(crate) fn aarch64() -> Target {
30 Target {
31 llvm_target: "aarch64-unknown-unknown".into(),
32 metadata: meta(),
33 pointer_width: 64,
34 // from: https://llvm.org/docs/LangRef.html#data-layout
35 // e = little endian
36 // m:e = ELF mangling: Private symbols get a .L prefix
37 // i8:8:32 = 8-bit-integer, minimum_alignment=8, preferred_alignment=32
38 // i16:16:32 = 16-bit-integer, minimum_alignment=16, preferred_alignment=32
39 // i64:64 = 64-bit-integer, minimum_alignment=64, preferred_alignment=64
40 // i128:128 = 128-bit-integer, minimum_alignment=128, preferred_alignment=128
41 // n32:64 = 32 and 64 are native integer widths; Elements of this set are considered to support most general arithmetic operations efficiently.
42 // S128 = 128 bits are the natural alignment of the stack in bits.
43 data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
44 arch: crate::spec::Arch::AArch64,
45 options: TargetOptions {
46 features: "+v8a".into(),
47 max_atomic_width: Some(128),
48 ..opts()
49 }
50 }
51}
52
53pub(crate) fn x86_64() -> Target {
54 Target {
55 llvm_target: "x86_64-pc-unknown".into(),
56 metadata: meta(),
57 pointer_width: 64,
58 data_layout:
59 "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
60 arch: crate::spec::Arch::X86_64,
61 options: TargetOptions {
62 cpu: "x86-64".into(),
63 plt_by_default: false,
64 max_atomic_width: Some(64),
65 vendor: "pc".into(),
66 ..opts()
67 },
68 }
69}
70
71pub(crate) fn pre_link_args(api_var: ApiVariant, arch: Arch) -> LinkArgs {
72 let (qcc_arg, arch_lib_dir) = match arch {
73 Arch::Aarch64 => ("-Vgcc_ntoaarch64le_cxx", "aarch64le"),
74 Arch::I586 => {
75 ("-Vgcc_ntox86_cxx", "notSupportedByQnx_compiler/rustc_target/src/spec/base/nto_qnx.rs")
76 }
77 Arch::X86_64 => ("-Vgcc_ntox86_64_cxx", "x86_64"),
78 };
79 match api_var {
80 ApiVariant::Default => {
81 TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[qcc_arg])
82 }
83 ApiVariant::IoSock => TargetOptions::link_args(
84 LinkerFlavor::Gnu(Cc::Yes, Lld::No),
85 &[qcc_arg, get_iosock_param(arch_lib_dir)],
86 ),
87 }
88}
89
90pub(crate) enum ApiVariant {
91 Default,
92 IoSock,
93}
94
95pub(crate) enum Arch {
96 Aarch64,
97 I586,
98 X86_64,
99}
100
101// When using `io-sock` on QNX, we must add a search path for the linker so
102// that it prefers the io-sock version.
103// The path depends on the host, i.e. we cannot hard-code it here, but have
104// to determine it when the compiler runs.
105// When using the QNX toolchain, the environment variable QNX_TARGET is always set.
106// More information:
107// https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.io_sock/topic/migrate_app.html
108fn get_iosock_param(arch_lib_dir: &str) -> &'static str {
109 let target_dir = std::env::var("QNX_TARGET")
110 .unwrap_or_else(|_| "QNX_TARGET_not_set_please_source_qnxsdp-env.sh".into());
111 let linker_param = format!("-L{target_dir}/{arch_lib_dir}/io-sock/lib");
112
113 // FIXME: leaking this is kind of weird: we're feeding these into something that expects an
114 // `AsRef<OsStr>`, but often converts to `OsString` anyways, so shouldn't we just demand an `OsString`?
115 linker_param.leak()
116}
compiler/rustc_target/src/spec/mod.rs+3-3
......@@ -1791,10 +1791,10 @@ supported_targets! {
17911791 ("aarch64-unknown-nto-qnx700", aarch64_unknown_nto_qnx700),
17921792 ("aarch64-unknown-nto-qnx710", aarch64_unknown_nto_qnx710),
17931793 ("aarch64-unknown-nto-qnx710_iosock", aarch64_unknown_nto_qnx710_iosock),
1794 ("aarch64-unknown-nto-qnx800", aarch64_unknown_nto_qnx800),
1794 ("aarch64-unknown-qnx", aarch64_unknown_qnx),
17951795 ("x86_64-pc-nto-qnx710", x86_64_pc_nto_qnx710),
17961796 ("x86_64-pc-nto-qnx710_iosock", x86_64_pc_nto_qnx710_iosock),
1797 ("x86_64-pc-nto-qnx800", x86_64_pc_nto_qnx800),
1797 ("x86_64-pc-qnx", x86_64_pc_qnx),
17981798 ("i686-pc-nto-qnx700", i686_pc_nto_qnx700),
17991799
18001800 ("aarch64-unknown-linux-ohos", aarch64_unknown_linux_ohos),
......@@ -2001,6 +2001,7 @@ crate::target_spec_enum! {
20012001 OpenBsd = "openbsd",
20022002 Psp = "psp",
20032003 Psx = "psx",
2004 Qnx = "qnx",
20042005 Qurt = "qurt",
20052006 Redox = "redox",
20062007 Rtems = "rtems",
......@@ -2041,7 +2042,6 @@ crate::target_spec_enum! {
20412042 Nto70 = "nto70",
20422043 Nto71 = "nto71",
20432044 Nto71IoSock = "nto71_iosock",
2044 Nto80 = "nto80",
20452045 Ohos = "ohos",
20462046 Relibc = "relibc",
20472047 Sgx = "sgx",
compiler/rustc_target/src/spec/targets/aarch64_unknown_nto_qnx700.rs+5-4
......@@ -1,11 +1,12 @@
1use crate::spec::base::nto_qnx;
1use crate::spec::base::qnx_sdp;
22use crate::spec::{Env, Target};
33
44pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::aarch64();
6 target.metadata.description = Some("ARM64 QNX Neutrino 7.0 RTOS".into());
5 let mut target = qnx_sdp::aarch64();
6 target.metadata.description = Some("ARM64 QNX SDP 7.0".into());
77 target.options.pre_link_args =
8 nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64);
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::Aarch64);
9 // for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
910 target.options.env = Env::Nto70;
1011 target
1112}
compiler/rustc_target/src/spec/targets/aarch64_unknown_nto_qnx710.rs+5-5
......@@ -1,12 +1,12 @@
1use crate::spec::base::nto_qnx;
1use crate::spec::base::qnx_sdp;
22use crate::spec::{Env, Target};
33
44pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::aarch64();
6 target.metadata.description =
7 Some("ARM64 QNX Neutrino 7.1 RTOS with io-pkt network stack".into());
5 let mut target = qnx_sdp::aarch64();
6 target.metadata.description = Some("ARM64 QNX SDP 7.1 with io-pkt network stack".into());
87 target.options.pre_link_args =
9 nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64);
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::Aarch64);
9 // for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
1010 target.options.env = Env::Nto71;
1111 target
1212}
compiler/rustc_target/src/spec/targets/aarch64_unknown_nto_qnx710_iosock.rs+5-5
......@@ -1,12 +1,12 @@
1use crate::spec::base::nto_qnx;
1use crate::spec::base::qnx_sdp;
22use crate::spec::{Env, Target};
33
44pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::aarch64();
6 target.metadata.description =
7 Some("ARM64 QNX Neutrino 7.1 RTOS with io-sock network stack".into());
5 let mut target = qnx_sdp::aarch64();
6 target.metadata.description = Some("ARM64 QNX SDP 7.1 with io-sock network stack".into());
87 target.options.pre_link_args =
9 nto_qnx::pre_link_args(nto_qnx::ApiVariant::IoSock, nto_qnx::Arch::Aarch64);
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::IoSock, qnx_sdp::Arch::Aarch64);
9 // for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
1010 target.options.env = Env::Nto71IoSock;
1111 target
1212}
compiler/rustc_target/src/spec/targets/aarch64_unknown_nto_qnx800.rs deleted-11
......@@ -1,11 +0,0 @@
1use crate::spec::base::nto_qnx;
2use crate::spec::{Env, Target};
3
4pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::aarch64();
6 target.metadata.description = Some("ARM64 QNX Neutrino 8.0 RTOS".into());
7 target.options.pre_link_args =
8 nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64);
9 target.options.env = Env::Nto80;
10 target
11}
compiler/rustc_target/src/spec/targets/aarch64_unknown_qnx.rs created+12
......@@ -0,0 +1,12 @@
1use crate::spec::base::qnx_sdp;
2use crate::spec::{Os, Target};
3
4pub(crate) fn target() -> Target {
5 let mut target = qnx_sdp::aarch64();
6 target.metadata.description = Some("ARM64 QNX SDP 8.0+".into());
7 target.options.pre_link_args =
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::Aarch64);
9 // for QNX SDP 8.0, we have target_os = "qnx" and no target_env
10 target.options.os = Os::Qnx;
11 target
12}
compiler/rustc_target/src/spec/targets/i686_pc_nto_qnx700.rs+8-7
......@@ -1,9 +1,9 @@
1use crate::spec::base::nto_qnx;
1use crate::spec::base::qnx_sdp;
22use crate::spec::{Arch, Env, RustcAbi, StackProbeType, Target, TargetOptions, base};
33
44pub(crate) fn target() -> Target {
5 let mut meta = nto_qnx::meta();
6 meta.description = Some("32-bit x86 QNX Neutrino 7.0 RTOS".into());
5 let mut meta = qnx_sdp::meta();
6 meta.description = Some("32-bit x86 QNX SDP 7.0".into());
77 meta.std = Some(false);
88 Target {
99 llvm_target: "i586-pc-unknown".into(),
......@@ -17,14 +17,15 @@ pub(crate) fn target() -> Target {
1717 rustc_abi: Some(RustcAbi::X86Sse2),
1818 cpu: "pentium4".into(),
1919 max_atomic_width: Some(64),
20 pre_link_args: nto_qnx::pre_link_args(
21 nto_qnx::ApiVariant::Default,
22 nto_qnx::Arch::I586,
20 pre_link_args: qnx_sdp::pre_link_args(
21 qnx_sdp::ApiVariant::Default,
22 qnx_sdp::Arch::I586,
2323 ),
24 // for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
2425 env: Env::Nto70,
2526 vendor: "pc".into(),
2627 stack_probes: StackProbeType::Inline,
27 ..base::nto_qnx::opts()
28 ..base::qnx_sdp::opts()
2829 },
2930 }
3031}
compiler/rustc_target/src/spec/targets/x86_64_pc_nto_qnx710.rs+5-5
......@@ -1,12 +1,12 @@
1use crate::spec::base::nto_qnx;
1use crate::spec::base::qnx_sdp;
22use crate::spec::{Env, Target};
33
44pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::x86_64();
6 target.metadata.description =
7 Some("x86 64-bit QNX Neutrino 7.1 RTOS with io-pkt network stack".into());
5 let mut target = qnx_sdp::x86_64();
6 target.metadata.description = Some("x86 64-bit QNX SDP 7.1 with io-pkt network stack".into());
87 target.options.pre_link_args =
9 nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::X86_64);
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::X86_64);
9 // for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
1010 target.options.env = Env::Nto71;
1111 target
1212}
compiler/rustc_target/src/spec/targets/x86_64_pc_nto_qnx710_iosock.rs+5-5
......@@ -1,12 +1,12 @@
1use crate::spec::base::nto_qnx;
1use crate::spec::base::qnx_sdp;
22use crate::spec::{Env, Target};
33
44pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::x86_64();
6 target.metadata.description =
7 Some("x86 64-bit QNX Neutrino 7.1 RTOS with io-sock network stack".into());
5 let mut target = qnx_sdp::x86_64();
6 target.metadata.description = Some("x86 64-bit QNX SDP 7.1 with io-sock network stack".into());
87 target.options.pre_link_args =
9 nto_qnx::pre_link_args(nto_qnx::ApiVariant::IoSock, nto_qnx::Arch::X86_64);
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::IoSock, qnx_sdp::Arch::X86_64);
9 // for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
1010 target.options.env = Env::Nto71IoSock;
1111 target
1212}
compiler/rustc_target/src/spec/targets/x86_64_pc_nto_qnx800.rs deleted-11
......@@ -1,11 +0,0 @@
1use crate::spec::base::nto_qnx;
2use crate::spec::{Env, Target};
3
4pub(crate) fn target() -> Target {
5 let mut target = nto_qnx::x86_64();
6 target.metadata.description = Some("x86 64-bit QNX Neutrino 8.0 RTOS".into());
7 target.options.pre_link_args =
8 nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::X86_64);
9 target.options.env = Env::Nto80;
10 target
11}
compiler/rustc_target/src/spec/targets/x86_64_pc_qnx.rs created+12
......@@ -0,0 +1,12 @@
1use crate::spec::base::qnx_sdp;
2use crate::spec::{Os, Target};
3
4pub(crate) fn target() -> Target {
5 let mut target = qnx_sdp::x86_64();
6 target.metadata.description = Some("x86 64-bit QNX SDP 8.0+".into());
7 target.options.pre_link_args =
8 qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::X86_64);
9 // for QNX SDP 8.0, we have target_os = "qnx" and no target_env
10 target.options.os = Os::Qnx;
11 target
12}
compiler/rustc_ty_utils/src/layout/invariant.rs+5-5
......@@ -84,7 +84,7 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou
8484
8585 fn check_layout_abi<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayout<'tcx>) {
8686 // Verify the ABI-mandated alignment and size for scalars.
87 let align = layout.backend_repr.scalar_align(cx);
87 let align = layout.backend_repr.scalar_platform_align(cx);
8888 let size = layout.backend_repr.scalar_size(cx);
8989 if let Some(align) = align {
9090 assert_eq!(
......@@ -208,9 +208,9 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou
208208 };
209209 // The fields should be at the right offset, and match the `scalar` layout.
210210 let size1 = scalar1.size(cx);
211 let align1 = scalar1.align(cx).abi;
211 let align1 = scalar1.default_align(cx).abi;
212212 let size2 = scalar2.size(cx);
213 let align2 = scalar2.align(cx).abi;
213 let align2 = scalar2.default_align(cx).abi;
214214 assert_eq!(
215215 offset1,
216216 Size::ZERO,
......@@ -251,7 +251,7 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou
251251 BackendRepr::SimdVector { element, count } => {
252252 let align = layout.align.abi;
253253 let size = layout.size;
254 let element_align = element.align(cx).abi;
254 let element_align = element.default_align(cx).abi;
255255 let element_size = element.size(cx);
256256 // Currently, vectors must always be aligned to at least their elements:
257257 assert!(align >= element_align);
......@@ -321,7 +321,7 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou
321321 }
322322 // The top-level ABI and the ABI of the variants should be coherent.
323323 let scalar_coherent = |s1: Scalar, s2: Scalar| {
324 s1.size(cx) == s2.size(cx) && s1.align(cx) == s2.align(cx)
324 s1.size(cx) == s2.size(cx) && s1.default_align(cx) == s2.default_align(cx)
325325 };
326326 let abi_coherent = match (layout.backend_repr, variant.backend_repr) {
327327 (BackendRepr::Scalar(s1), BackendRepr::Scalar(s2)) => scalar_coherent(s1, s2),
compiler/rustc_type_ir/src/search_graph/mod.rs+37-14
......@@ -263,6 +263,12 @@ impl CandidateHeadUsages {
263263}
264264
265265#[derive(Debug, Clone, Copy)]
266pub enum IncreaseDepthForNested {
267 Yes,
268 No,
269}
270
271#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
266272struct AvailableDepth(usize);
267273impl AvailableDepth {
268274 /// Returns the remaining depth allowed for nested goals.
......@@ -276,6 +282,13 @@ impl AvailableDepth {
276282 stack: &Stack<D::Cx>,
277283 ) -> Option<AvailableDepth> {
278284 if let Some(last) = stack.last() {
285 match last.increase_depth_for_nested {
286 IncreaseDepthForNested::Yes => {}
287 IncreaseDepthForNested::No => {
288 return Some(last.available_depth);
289 }
290 }
291
279292 if last.available_depth.0 == 0 {
280293 return None;
281294 }
......@@ -566,7 +579,7 @@ impl<X: Cx> EvaluationResult<X> {
566579 encountered_overflow,
567580 // Unlike `encountered_overflow`, we share `heads`, `required_depth`,
568581 // and `nested_goals` between evaluations.
569 required_depth: final_entry.required_depth,
582 required_depth: final_entry.required_depth(),
570583 heads: final_entry.heads,
571584 nested_goals: final_entry.nested_goals,
572585 // We only care about the final result.
......@@ -597,7 +610,7 @@ pub struct SearchGraph<D: Delegate<Cx = X>, X: Cx = <D as Delegate>::Cx> {
597610/// don't need to track the nested goals used while computing a provisional
598611/// cache entry.
599612enum UpdateParentGoalCtxt<'a, X: Cx> {
600 Ordinary(&'a NestedGoals<X>),
613 Ordinary { nested_goals: &'a NestedGoals<X>, min_reachable_available_depth: AvailableDepth },
601614 CycleOnStack(X::Input),
602615 ProvisionalCacheHit,
603616}
......@@ -619,13 +632,11 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
619632 fn update_parent_goal(
620633 stack: &mut Stack<X>,
621634 step_kind_from_parent: PathKind,
622 required_depth_for_nested: usize,
623635 heads: impl Iterator<Item = (StackDepth, CycleHead)>,
624636 encountered_overflow: bool,
625637 context: UpdateParentGoalCtxt<'_, X>,
626638 ) {
627639 if let Some((parent_index, parent)) = stack.last_mut_with_index() {
628 parent.required_depth = parent.required_depth.max(required_depth_for_nested + 1);
629640 parent.encountered_overflow |= encountered_overflow;
630641
631642 for (head_index, head) in heads {
......@@ -650,7 +661,9 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
650661 }
651662 }
652663 let parent_depends_on_cycle = match context {
653 UpdateParentGoalCtxt::Ordinary(nested_goals) => {
664 UpdateParentGoalCtxt::Ordinary { nested_goals, min_reachable_available_depth } => {
665 parent.min_reached_available_depth =
666 parent.min_reached_available_depth.min(min_reachable_available_depth);
654667 parent.nested_goals.extend_from_child(step_kind_from_parent, nested_goals);
655668 !nested_goals.is_empty()
656669 }
......@@ -739,8 +752,9 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
739752 input,
740753 step_kind_from_parent,
741754 available_depth,
755 min_reached_available_depth: available_depth,
742756 provisional_result: None,
743 required_depth: 0,
757 increase_depth_for_nested: IncreaseDepthForNested::Yes,
744758 heads: Default::default(),
745759 encountered_overflow: false,
746760 usages: None,
......@@ -761,6 +775,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
761775 cx: X,
762776 input: X::Input,
763777 step_kind_from_parent: PathKind,
778 increase_depth_for_nested: IncreaseDepthForNested,
764779 inspect: &mut D::ProofTreeBuilder,
765780 ) -> X::Result {
766781 let Some(available_depth) =
......@@ -816,7 +831,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
816831 step_kind_from_parent,
817832 available_depth,
818833 provisional_result: None,
819 required_depth: 0,
834 min_reached_available_depth: available_depth,
835 increase_depth_for_nested,
820836 heads: Default::default(),
821837 encountered_overflow: false,
822838 usages: None,
......@@ -838,10 +854,14 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
838854 Self::update_parent_goal(
839855 &mut self.stack,
840856 step_kind_from_parent,
841 evaluation_result.required_depth,
842857 evaluation_result.heads.iter(),
843858 evaluation_result.encountered_overflow,
844 UpdateParentGoalCtxt::Ordinary(&evaluation_result.nested_goals),
859 UpdateParentGoalCtxt::Ordinary {
860 nested_goals: &evaluation_result.nested_goals,
861 min_reachable_available_depth: AvailableDepth(
862 available_depth.0 - evaluation_result.required_depth,
863 ),
864 },
845865 );
846866 let result = evaluation_result.result;
847867
......@@ -1116,7 +1136,6 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
11161136 Self::update_parent_goal(
11171137 &mut self.stack,
11181138 step_kind_from_parent,
1119 0,
11201139 heads.iter(),
11211140 encountered_overflow,
11221141 UpdateParentGoalCtxt::ProvisionalCacheHit,
......@@ -1239,10 +1258,14 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
12391258 Self::update_parent_goal(
12401259 &mut self.stack,
12411260 step_kind_from_parent,
1242 required_depth,
12431261 heads,
12441262 encountered_overflow,
1245 UpdateParentGoalCtxt::Ordinary(nested_goals),
1263 UpdateParentGoalCtxt::Ordinary {
1264 nested_goals,
1265 min_reachable_available_depth: AvailableDepth(
1266 available_depth.0 - required_depth,
1267 ),
1268 },
12461269 );
12471270
12481271 debug!(?required_depth, "global cache hit");
......@@ -1271,7 +1294,6 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
12711294 Self::update_parent_goal(
12721295 &mut self.stack,
12731296 step_kind_from_parent,
1274 0,
12751297 iter::once((head_index, head)),
12761298 false,
12771299 UpdateParentGoalCtxt::CycleOnStack(input),
......@@ -1407,7 +1429,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
14071429 provisional_result: Some(result),
14081430 // We can keep these goals from previous iterations as they are only
14091431 // ever read after finalizing this evaluation.
1410 required_depth: stack_entry.required_depth,
1432 min_reached_available_depth: stack_entry.min_reached_available_depth,
1433 increase_depth_for_nested: stack_entry.increase_depth_for_nested,
14111434 heads: stack_entry.heads,
14121435 nested_goals: stack_entry.nested_goals,
14131436 // We reset these two fields when rerunning this goal. We could
compiler/rustc_type_ir/src/search_graph/stack.rs+22-3
......@@ -4,7 +4,8 @@ use derive_where::derive_where;
44use rustc_index::IndexVec;
55
66use crate::search_graph::{
7 AvailableDepth, CandidateHeadUsages, Cx, CycleHeads, HeadUsages, NestedGoals, PathKind,
7 AvailableDepth, CandidateHeadUsages, Cx, CycleHeads, HeadUsages, IncreaseDepthForNested,
8 NestedGoals, PathKind,
89};
910
1011rustc_index::newtype_index! {
......@@ -28,8 +29,20 @@ pub(super) struct StackEntry<X: Cx> {
2829 /// The available depth of a given goal, immutable.
2930 pub available_depth: AvailableDepth,
3031
31 /// The maximum depth required while evaluating this goal.
32 pub required_depth: usize,
32 /// The minimum available depth encountered while evaluating this goal's nested goals.
33 /// If there's no nested goal, this is equal to the `available_depth`.
34 pub min_reached_available_depth: AvailableDepth,
35
36 /// Whether evaluating nested goals of a given goal should increase the depth.
37 ///
38 /// Normally, it should be `Yes`, but among rustc's predicate goals, `normalizes-to`
39 /// goals are exceptions. They act like functions that used for normalizing associated
40 /// terms while evaluating projection goals and since their expected terms are always fully
41 /// unconstrained intentionally, they often return ambiguous nested goals to the caller's
42 /// context. As these nested goals are evaluated again in the caller's context, we don't
43 /// want to increase depths when they are evaluated as nested goals for `normalizes-to`
44 /// goals, otherwise we will encounter recursion limit overflows more often.
45 pub increase_depth_for_nested: IncreaseDepthForNested,
3346
3447 /// Starts out as `None` and gets set when rerunning this
3548 /// goal in case we encounter a cycle.
......@@ -57,6 +70,12 @@ pub(super) struct StackEntry<X: Cx> {
5770 pub nested_goals: NestedGoals<X>,
5871}
5972
73impl<X: Cx> StackEntry<X> {
74 pub(super) fn required_depth(&self) -> usize {
75 self.available_depth.0 - self.min_reached_available_depth.0
76 }
77}
78
6079/// The stack of goals currently being computed.
6180///
6281/// An element is *deeper* in the stack if its index is *lower*.
library/core/src/num/imp/overflow_panic.rs-6
......@@ -20,12 +20,6 @@ pub(in crate::num) const fn mul() -> ! {
2020 panic!("attempt to multiply with overflow")
2121}
2222
23#[cold]
24#[track_caller]
25pub(in crate::num) const fn div() -> ! {
26 panic!("attempt to divide with overflow")
27}
28
2923#[cold]
3024#[track_caller]
3125pub(in crate::num) const fn rem() -> ! {
library/core/src/num/int_macros.rs+12-6
......@@ -983,9 +983,12 @@ macro_rules! int_impl {
983983 /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
984984 ///
985985 /// The only case where such an overflow can occur is when one divides `MIN / -1` on a signed type (where
986 /// [`MIN`](Self::MIN) is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value
986 /// [`MIN`](Self::MIN) is the negative minimal value for the type); the result of this is `-MIN`, a positive value
987987 /// that is too large to represent in the type.
988988 ///
989 /// Note that this is equivalent to normal division: `MIN / -1` will also panic both in
990 /// debug and release builds.
991 ///
989992 /// # Examples
990993 ///
991994 /// ```
......@@ -1010,8 +1013,8 @@ macro_rules! int_impl {
10101013 #[inline]
10111014 #[track_caller]
10121015 pub const fn strict_div(self, rhs: Self) -> Self {
1013 let (a, b) = self.overflowing_div(rhs);
1014 if b { imp::overflow_panic::div() } else { a }
1016 // Normal division already checks for "div-by-minus-1".
1017 self / rhs
10151018 }
10161019
10171020 /// Checked Euclidean division. Computes `self.div_euclid(rhs)`,
......@@ -1050,9 +1053,12 @@ macro_rules! int_impl {
10501053 /// This function will always panic on overflow, regardless of whether overflow checks are enabled.
10511054 ///
10521055 /// The only case where such an overflow can occur is when one divides `MIN / -1` on a signed type (where
1053 /// [`MIN`](Self::MIN) is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value
1056 /// [`MIN`](Self::MIN) is the negative minimal value for the type); the result of this is `-MIN`, a positive value
10541057 /// that is too large to represent in the type.
10551058 ///
1059 /// Note that this is equivalent to `div_euclid`: `MIN.div_euclid(-1)` will also panic both
1060 /// in debug and release builds.
1061 ///
10561062 /// # Examples
10571063 ///
10581064 /// ```
......@@ -1077,8 +1083,8 @@ macro_rules! int_impl {
10771083 #[inline]
10781084 #[track_caller]
10791085 pub const fn strict_div_euclid(self, rhs: Self) -> Self {
1080 let (a, b) = self.overflowing_div_euclid(rhs);
1081 if b { imp::overflow_panic::div() } else { a }
1086 // Normal `div_euclid` already checks for "div-by-minus-1".
1087 self.div_euclid(rhs)
10821088 }
10831089
10841090 /// Checked integer division without remainder. Computes `self / rhs`,
library/std/build.rs+1
......@@ -48,6 +48,7 @@ fn main() {
4848 || target_os == "vita"
4949 || target_os == "aix"
5050 || target_os == "nto"
51 || target_os == "qnx"
5152 || target_os == "xous"
5253 || target_os == "hurd"
5354 || target_os == "uefi"
library/std/src/env.rs+1
......@@ -1096,6 +1096,7 @@ pub mod consts {
10961096 /// * `"netbsd"`
10971097 /// * `"nto"`
10981098 /// * `"openbsd"`
1099 /// * `"qnx"`
10991100 /// * `"redox"`
11001101 /// * `"solaris"`
11011102 /// * `"solid_asp3"`
library/std/src/net/tcp/tests.rs+7-1
......@@ -733,7 +733,13 @@ fn debug() {
733733// no longer has rounding errors.
734734// VxWorks ignores SO_SNDTIMEO.
735735#[cfg_attr(
736 any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks", target_os = "nto"),
736 any(
737 target_os = "netbsd",
738 target_os = "openbsd",
739 target_os = "vxworks",
740 target_os = "nto",
741 target_os = "qnx"
742 ),
737743 ignore
738744)]
739745#[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
library/std/src/net/udp/tests.rs+7-1
......@@ -188,7 +188,13 @@ fn debug() {
188188// no longer has rounding errors.
189189// VxWorks ignores SO_SNDTIMEO.
190190#[cfg_attr(
191 any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks", target_os = "nto"),
191 any(
192 target_os = "netbsd",
193 target_os = "openbsd",
194 target_os = "vxworks",
195 target_os = "nto",
196 target_os = "qnx"
197 ),
192198 ignore
193199)]
194200#[cfg_attr(target_os = "wasi", ignore)] // timeout not supported
library/std/src/os/mod.rs+1-1
......@@ -121,7 +121,7 @@ pub mod macos;
121121pub mod motor;
122122#[cfg(target_os = "netbsd")]
123123pub mod netbsd;
124#[cfg(target_os = "nto")]
124#[cfg(any(target_os = "nto", target_os = "qnx"))]
125125pub mod nto;
126126#[cfg(target_os = "nuttx")]
127127pub mod nuttx;
library/std/src/os/unix/mod.rs+1-1
......@@ -69,7 +69,7 @@ mod platform {
6969 pub use crate::os::linux::*;
7070 #[cfg(target_os = "netbsd")]
7171 pub use crate::os::netbsd::*;
72 #[cfg(target_os = "nto")]
72 #[cfg(any(target_os = "nto", target_os = "qnx"))]
7373 pub use crate::os::nto::*;
7474 #[cfg(target_os = "nuttx")]
7575 pub use crate::os::nuttx::*;
library/std/src/os/unix/net/datagram.rs+2
......@@ -9,6 +9,7 @@
99 target_os = "illumos",
1010 target_os = "haiku",
1111 target_os = "nto",
12 target_os = "qnx",
1213 target_os = "cygwin"
1314))]
1415use libc::MSG_NOSIGNAL;
......@@ -36,6 +37,7 @@ use crate::{fmt, io};
3637 target_os = "illumos",
3738 target_os = "haiku",
3839 target_os = "nto",
40 target_os = "qnx",
3941 target_os = "cygwin"
4042)))]
4143const MSG_NOSIGNAL: core::ffi::c_int = 0x0;
library/std/src/os/unix/net/mod.rs+2
......@@ -20,6 +20,7 @@ mod tests;
2020 target_os = "netbsd",
2121 target_os = "openbsd",
2222 target_os = "nto",
23 target_os = "qnx",
2324 target_vendor = "apple",
2425 target_os = "cygwin"
2526))]
......@@ -44,6 +45,7 @@ pub use self::stream::*;
4445 target_os = "netbsd",
4546 target_os = "openbsd",
4647 target_os = "nto",
48 target_os = "qnx",
4749 target_vendor = "apple",
4850 target_os = "cygwin",
4951))]
library/std/src/os/unix/net/stream.rs+2-1
......@@ -6,7 +6,7 @@ cfg_select! {
66 target_os = "openbsd", target_os = "netbsd",
77 target_os = "solaris", target_os = "illumos",
88 target_os = "haiku", target_os = "nto",
9 target_os = "cygwin",
9 target_os = "qnx", target_os = "cygwin",
1010 ) => {
1111 use libc::MSG_NOSIGNAL;
1212 }
......@@ -26,6 +26,7 @@ use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_wi
2626 target_os = "netbsd",
2727 target_os = "openbsd",
2828 target_os = "nto",
29 target_os = "qnx",
2930 target_vendor = "apple",
3031 target_os = "cygwin"
3132))]
library/std/src/os/unix/net/tests.rs+1-1
......@@ -176,7 +176,7 @@ fn long_path() {
176176}
177177
178178#[test]
179#[cfg(not(target_os = "nto"))]
179#[cfg(not(any(target_os = "nto", target_os = "qnx")))]
180180#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
181181#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin connect needs handshake
182182#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
library/std/src/os/unix/net/ucred.rs+3-1
......@@ -30,7 +30,8 @@ pub(super) use self::impl_apple::peer_cred;
3030 target_os = "freebsd",
3131 target_os = "openbsd",
3232 target_os = "netbsd",
33 target_os = "nto"
33 target_os = "nto",
34 target_os = "qnx"
3435))]
3536pub(super) use self::impl_bsd::peer_cred;
3637#[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
......@@ -79,6 +80,7 @@ mod impl_linux {
7980 target_os = "openbsd",
8081 target_os = "netbsd",
8182 target_os = "nto",
83 target_os = "qnx",
8284))]
8385mod impl_bsd {
8486 use super::UCred;
library/std/src/os/unix/process.rs+1-1
......@@ -16,7 +16,7 @@ cfg_select! {
1616 type UserId = u16;
1717 type GroupId = u16;
1818 }
19 target_os = "nto" => {
19 any(target_os = "nto", target_os = "qnx") => {
2020 // Both IDs are signed, see `sys/target_nto.h` of the QNX Neutrino SDP.
2121 // Only positive values should be used, see e.g.
2222 // https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/s/setuid.html
library/std/src/sys/args/unix.rs+1
......@@ -81,6 +81,7 @@ pub fn args() -> Args {
8181 target_os = "horizon",
8282 target_os = "aix",
8383 target_os = "nto",
84 target_os = "qnx",
8485 target_os = "hurd",
8586 target_os = "rtems",
8687 target_os = "nuttx",
library/std/src/sys/env_consts.rs+11
......@@ -224,6 +224,17 @@ pub mod os {
224224 pub const EXE_EXTENSION: &str = "";
225225}
226226
227#[cfg(target_os = "qnx")]
228pub mod os {
229 pub const FAMILY: &str = "unix";
230 pub const OS: &str = "qnx";
231 pub const DLL_PREFIX: &str = "lib";
232 pub const DLL_SUFFIX: &str = ".so";
233 pub const DLL_EXTENSION: &str = "so";
234 pub const EXE_SUFFIX: &str = "";
235 pub const EXE_EXTENSION: &str = "";
236}
237
227238#[cfg(target_os = "nuttx")]
228239pub mod os {
229240 pub const FAMILY: &str = "unix";
library/std/src/sys/fd/unix.rs+4
......@@ -76,6 +76,7 @@ const fn max_iov() -> usize {
7676 target_os = "emscripten",
7777 target_os = "linux",
7878 target_os = "nto",
79 target_os = "qnx",
7980))]
8081const fn max_iov() -> usize {
8182 libc::UIO_MAXIOV as usize
......@@ -91,6 +92,7 @@ const fn max_iov() -> usize {
9192 target_os = "netbsd",
9293 target_os = "nuttx",
9394 target_os = "nto",
95 target_os = "qnx",
9496 target_os = "openbsd",
9597 target_os = "horizon",
9698 target_os = "vita",
......@@ -561,6 +563,7 @@ impl FileDesc {
561563 target_os = "redox",
562564 target_os = "vxworks",
563565 target_os = "nto",
566 target_os = "qnx",
564567 target_os = "wasi",
565568 )))]
566569 pub fn set_cloexec(&self) -> io::Result<()> {
......@@ -585,6 +588,7 @@ impl FileDesc {
585588 target_os = "redox",
586589 target_os = "vxworks",
587590 target_os = "nto",
591 target_os = "qnx",
588592 target_os = "wasi",
589593 ))]
590594 pub fn set_cloexec(&self) -> io::Result<()> {
library/std/src/sys/fs/unix.rs+28-2
......@@ -28,6 +28,7 @@ use libc::fstatat64;
2828 target_os = "fuchsia",
2929 target_os = "illumos",
3030 target_os = "nto",
31 target_os = "qnx",
3132 target_os = "redox",
3233 target_os = "solaris",
3334 target_os = "vita",
......@@ -45,6 +46,7 @@ use libc::readdir as readdir64;
4546 target_os = "l4re",
4647 target_os = "linux",
4748 target_os = "nto",
49 target_os = "qnx",
4850 target_os = "redox",
4951 target_os = "solaris",
5052 target_os = "vita",
......@@ -282,6 +284,7 @@ cfg_select! {
282284 target_os = "horizon",
283285 target_os = "vita",
284286 target_os = "nto",
287 target_os = "qnx",
285288 target_os = "vxworks",
286289 ) => {
287290 pub use crate::sys::fs::common::Dir;
......@@ -410,6 +413,7 @@ fn get_path_from_fd(fd: c_int) -> Option<PathBuf> {
410413 target_os = "illumos",
411414 target_os = "linux",
412415 target_os = "nto",
416 target_os = "qnx",
413417 target_os = "redox",
414418 target_os = "solaris",
415419 target_os = "vita",
......@@ -436,6 +440,7 @@ pub struct DirEntry {
436440 target_os = "illumos",
437441 target_os = "linux",
438442 target_os = "nto",
443 target_os = "qnx",
439444 target_os = "redox",
440445 target_os = "solaris",
441446 target_os = "vita",
......@@ -448,6 +453,7 @@ struct dirent64_min {
448453 target_os = "illumos",
449454 target_os = "aix",
450455 target_os = "nto",
456 target_os = "qnx",
451457 target_os = "vita",
452458 )))]
453459 d_type: u8,
......@@ -462,6 +468,7 @@ struct dirent64_min {
462468 target_os = "illumos",
463469 target_os = "linux",
464470 target_os = "nto",
471 target_os = "qnx",
465472 target_os = "redox",
466473 target_os = "solaris",
467474 target_os = "vita",
......@@ -611,7 +618,13 @@ impl FileAttr {
611618 }
612619}
613620
614#[cfg(not(any(target_os = "netbsd", target_os = "nto", target_os = "aix", target_os = "wasi")))]
621#[cfg(not(any(
622 target_os = "netbsd",
623 target_os = "nto",
624 target_os = "qnx",
625 target_os = "aix",
626 target_os = "wasi"
627)))]
615628impl FileAttr {
616629 #[cfg(not(any(
617630 target_os = "vxworks",
......@@ -736,7 +749,7 @@ impl FileAttr {
736749 }
737750}
738751
739#[cfg(any(target_os = "nto", target_os = "wasi"))]
752#[cfg(any(target_os = "nto", target_os = "qnx", target_os = "wasi"))]
740753impl FileAttr {
741754 pub fn modified(&self) -> io::Result<SystemTime> {
742755 SystemTime::new(self.stat.st_mtim.tv_sec, self.stat.st_mtim.tv_nsec.into())
......@@ -854,6 +867,7 @@ impl Iterator for ReadDir {
854867 target_os = "illumos",
855868 target_os = "linux",
856869 target_os = "nto",
870 target_os = "qnx",
857871 target_os = "redox",
858872 target_os = "solaris",
859873 target_os = "vita",
......@@ -927,6 +941,7 @@ impl Iterator for ReadDir {
927941 target_os = "illumos",
928942 target_os = "aix",
929943 target_os = "nto",
944 target_os = "qnx",
930945 )))]
931946 d_type: (*entry_ptr).d_type as u8,
932947 };
......@@ -952,6 +967,7 @@ impl Iterator for ReadDir {
952967 target_os = "illumos",
953968 target_os = "linux",
954969 target_os = "nto",
970 target_os = "qnx",
955971 target_os = "redox",
956972 target_os = "solaris",
957973 target_os = "vita",
......@@ -1015,6 +1031,7 @@ impl Drop for DirStream {
10151031 miri,
10161032 target_os = "redox",
10171033 target_os = "nto",
1034 target_os = "qnx",
10181035 target_os = "vita",
10191036 target_os = "hurd",
10201037 target_os = "espidf",
......@@ -1103,6 +1120,7 @@ impl DirEntry {
11031120 target_os = "vxworks",
11041121 target_os = "aix",
11051122 target_os = "nto",
1123 target_os = "qnx",
11061124 target_os = "vita",
11071125 ))]
11081126 pub fn file_type(&self) -> io::Result<FileType> {
......@@ -1116,6 +1134,7 @@ impl DirEntry {
11161134 target_os = "vxworks",
11171135 target_os = "aix",
11181136 target_os = "nto",
1137 target_os = "qnx",
11191138 target_os = "vita",
11201139 )))]
11211140 pub fn file_type(&self) -> io::Result<FileType> {
......@@ -1146,6 +1165,7 @@ impl DirEntry {
11461165 target_os = "l4re",
11471166 target_os = "linux",
11481167 target_os = "nto",
1168 target_os = "qnx",
11491169 target_os = "redox",
11501170 target_os = "rtems",
11511171 target_os = "solaris",
......@@ -1205,6 +1225,7 @@ impl DirEntry {
12051225 target_os = "redox",
12061226 target_os = "aix",
12071227 target_os = "nto",
1228 target_os = "qnx",
12081229 target_os = "vita",
12091230 target_os = "hurd",
12101231 target_os = "wasi",
......@@ -1222,6 +1243,7 @@ impl DirEntry {
12221243 target_os = "redox",
12231244 target_os = "aix",
12241245 target_os = "nto",
1246 target_os = "qnx",
12251247 target_os = "vita",
12261248 target_os = "hurd",
12271249 target_os = "wasi",
......@@ -1419,6 +1441,7 @@ impl File {
14191441 target_os = "netbsd",
14201442 target_os = "openbsd",
14211443 target_os = "nto",
1444 target_os = "qnx",
14221445 target_os = "hurd",
14231446 ))]
14241447 unsafe fn os_datasync(fd: c_int) -> c_int {
......@@ -1433,6 +1456,7 @@ impl File {
14331456 target_os = "netbsd",
14341457 target_os = "openbsd",
14351458 target_os = "nto",
1459 target_os = "qnx",
14361460 target_os = "hurd",
14371461 target_vendor = "apple",
14381462 )))]
......@@ -2405,6 +2429,7 @@ pub use remove_dir_impl::remove_dir_all;
24052429 target_os = "horizon",
24062430 target_os = "vita",
24072431 target_os = "nto",
2432 target_os = "qnx",
24082433 target_os = "vxworks",
24092434 miri
24102435))]
......@@ -2419,6 +2444,7 @@ mod remove_dir_impl {
24192444 target_os = "horizon",
24202445 target_os = "vita",
24212446 target_os = "nto",
2447 target_os = "qnx",
24222448 target_os = "vxworks",
24232449 miri
24242450)))]
library/std/src/sys/io/error/unix.rs+1
......@@ -27,6 +27,7 @@ unsafe extern "C" {
2727 )]
2828 #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), link_name = "___errno")]
2929 #[cfg_attr(target_os = "nto", link_name = "__get_errno_ptr")]
30 #[cfg_attr(target_os = "qnx", link_name = "__get_errno_ptr")]
3031 #[cfg_attr(any(target_os = "freebsd", target_vendor = "apple"), link_name = "__error")]
3132 #[cfg_attr(target_os = "haiku", link_name = "_errnop")]
3233 #[cfg_attr(target_os = "aix", link_name = "_Errno")]
library/std/src/sys/net/connection/socket/mod.rs+4-2
......@@ -46,6 +46,7 @@ cfg_select! {
4646 target_os = "haiku",
4747 target_os = "l4re",
4848 target_os = "nto",
49 target_os = "qnx",
4950 target_os = "nuttx",
5051 target_vendor = "apple",
5152 ) => {
......@@ -65,7 +66,8 @@ cfg_select! {
6566 target_os = "dragonfly", target_os = "freebsd",
6667 target_os = "openbsd", target_os = "netbsd",
6768 target_os = "solaris", target_os = "illumos",
68 target_os = "haiku", target_os = "nto",
69 target_os = "haiku",
70 target_os = "nto", target_os = "qnx",
6971 target_os = "cygwin",
7072 ) => {
7173 use libc::MSG_NOSIGNAL;
......@@ -80,7 +82,7 @@ cfg_select! {
8082 target_os = "dragonfly", target_os = "freebsd",
8183 target_os = "openbsd", target_os = "netbsd",
8284 target_os = "solaris", target_os = "illumos",
83 target_os = "nto",
85 target_os = "nto", target_os = "qnx",
8486 ) => {
8587 use crate::ffi::c_uchar;
8688 type IpV4MultiCastType = c_uchar;
library/std/src/sys/net/connection/socket/unix.rs+2
......@@ -76,6 +76,7 @@ impl Socket {
7676 target_os = "openbsd",
7777 target_os = "cygwin",
7878 target_os = "nto",
79 target_os = "qnx",
7980 target_os = "solaris",
8081 ) => {
8182 // On platforms that support it we pass the SOCK_CLOEXEC
......@@ -124,6 +125,7 @@ impl Socket {
124125 target_os = "openbsd",
125126 target_os = "cygwin",
126127 target_os = "nto",
128 target_os = "qnx",
127129 ) => {
128130 // Like above, set cloexec atomically
129131 cvt(libc::socketpair(fam, ty | libc::SOCK_CLOEXEC, 0, fds.as_mut_ptr()))?;
library/std/src/sys/pal/unix/sync/condvar.rs+4-4
......@@ -1,9 +1,9 @@
11use super::Mutex;
22use crate::cell::UnsafeCell;
33use crate::pin::Pin;
4#[cfg(not(target_os = "nto"))]
4#[cfg(not(any(target_os = "nto", target_os = "qnx")))]
55use crate::sys::pal::time::TIMESPEC_MAX;
6#[cfg(target_os = "nto")]
6#[cfg(any(target_os = "nto", target_os = "qnx"))]
77use crate::sys::pal::time::TIMESPEC_MAX_CAPPED;
88use crate::time::Duration;
99
......@@ -69,10 +69,10 @@ impl Condvar {
6969
7070 let timeout = Timespec::now(Self::CLOCK).checked_add_duration(&dur);
7171
72 #[cfg(not(target_os = "nto"))]
72 #[cfg(not(any(target_os = "nto", target_os = "qnx")))]
7373 let timeout = timeout.and_then(|t| t.to_timespec()).unwrap_or(TIMESPEC_MAX);
7474
75 #[cfg(target_os = "nto")]
75 #[cfg(any(target_os = "nto", target_os = "qnx"))]
7676 let timeout = timeout.and_then(|t| t.to_timespec_capped()).unwrap_or(TIMESPEC_MAX_CAPPED);
7777
7878 let r = unsafe { libc::pthread_cond_timedwait(self.raw(), mutex, &timeout) };
library/std/src/sys/pal/unix/time.rs+1-1
......@@ -16,7 +16,7 @@ pub const TIMESPEC_MAX: libc::timespec = {
1616
1717// This additional constant is only used when calling
1818// `libc::pthread_cond_timedwait`.
19#[cfg(target_os = "nto")]
19#[cfg(any(target_os = "nto", target_os = "qnx"))]
2020pub(in crate::sys) const TIMESPEC_MAX_CAPPED: libc::timespec = libc::timespec {
2121 tv_sec: (u64::MAX / NSEC_PER_SEC) as i64,
2222 tv_nsec: (u64::MAX % NSEC_PER_SEC) as i64,
library/std/src/sys/paths/unix.rs+1-1
......@@ -269,7 +269,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
269269 }
270270}
271271
272#[cfg(target_os = "nto")]
272#[cfg(any(target_os = "nto", target_os = "qnx"))]
273273pub fn current_exe() -> io::Result<PathBuf> {
274274 let mut e = crate::fs::read("/proc/self/exefile")?;
275275 // Current versions of QNX Neutrino provide a null-terminated path.
library/std/src/sys/process/unix/unix.rs+21-8
......@@ -20,7 +20,7 @@ use crate::sys::process::PidFd;
2020use crate::{fmt, mem, sys};
2121
2222cfg_select! {
23 target_os = "nto" => {
23 any(target_os = "nto", target_os = "qnx") => {
2424 use crate::thread;
2525 use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t};
2626 use crate::time::Duration;
......@@ -183,7 +183,12 @@ impl Command {
183183
184184 // Attempts to fork the process. If successful, returns Ok((0, -1))
185185 // in the child, and Ok((child_pid, -1)) in the parent.
186 #[cfg(not(any(target_os = "watchos", target_os = "tvos", target_os = "nto")))]
186 #[cfg(not(any(
187 target_os = "watchos",
188 target_os = "tvos",
189 target_os = "nto",
190 target_os = "qnx"
191 )))]
187192 unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
188193 cvt(libc::fork())
189194 }
......@@ -192,7 +197,7 @@ impl Command {
192197 // or closed a file descriptor while the fork() was occurring".
193198 // Documentation says "... or try calling fork() again". This is what we do here.
194199 // See also https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/f/fork.html
195 #[cfg(target_os = "nto")]
200 #[cfg(any(target_os = "nto", target_os = "qnx"))]
196201 unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
197202 use crate::sys::io::errno;
198203
......@@ -424,6 +429,7 @@ impl Command {
424429 all(target_os = "linux", target_env = "gnu"),
425430 all(target_os = "linux", target_env = "musl"),
426431 target_os = "nto",
432 target_os = "qnx",
427433 target_vendor = "apple",
428434 target_os = "cygwin",
429435 )))]
......@@ -443,6 +449,7 @@ impl Command {
443449 all(target_os = "linux", target_env = "gnu"),
444450 all(target_os = "linux", target_env = "musl"),
445451 target_os = "nto",
452 target_os = "qnx",
446453 target_vendor = "apple",
447454 target_os = "cygwin",
448455 ))]
......@@ -550,7 +557,7 @@ impl Command {
550557 // or closed a file descriptor while the posix_spawn() was occurring".
551558 // Documentation says "... or try calling posix_spawn() again". This is what we do here.
552559 // See also http://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/p/posix_spawn.html
553 #[cfg(target_os = "nto")]
560 #[cfg(any(target_os = "nto", target_os = "qnx"))]
554561 unsafe fn retrying_libc_posix_spawnp(
555562 pid: *mut pid_t,
556563 file: *const c_char,
......@@ -763,9 +770,9 @@ impl Command {
763770 let _env_lock = sys::env::env_read_lock();
764771 let envp = envp.map(|c| c.as_ptr()).unwrap_or_else(|| *sys::env::environ() as *const _);
765772
766 #[cfg(not(target_os = "nto"))]
773 #[cfg(not(any(target_os = "nto", target_os = "qnx")))]
767774 let spawn_fn = libc::posix_spawnp;
768 #[cfg(target_os = "nto")]
775 #[cfg(any(target_os = "nto", target_os = "qnx"))]
769776 let spawn_fn = retrying_libc_posix_spawnp;
770777
771778 #[cfg(target_os = "linux")]
......@@ -822,7 +829,7 @@ impl Command {
822829 envp as *const _,
823830 );
824831
825 #[cfg(target_os = "nto")]
832 #[cfg(any(target_os = "nto", target_os = "qnx"))]
826833 let spawn_res = spawn_res?;
827834
828835 cvt_nz(spawn_res)?;
......@@ -1202,7 +1209,12 @@ fn signal_string(signal: i32) -> &'static str {
12021209 )
12031210 ))]
12041211 libc::SIGSTKFLT => " (SIGSTKFLT)",
1205 #[cfg(any(target_os = "linux", target_os = "nto", target_os = "cygwin"))]
1212 #[cfg(any(
1213 target_os = "linux",
1214 target_os = "nto",
1215 target_os = "qnx",
1216 target_os = "cygwin"
1217 ))]
12061218 libc::SIGPWR => " (SIGPWR)",
12071219 #[cfg(any(
12081220 target_os = "freebsd",
......@@ -1210,6 +1222,7 @@ fn signal_string(signal: i32) -> &'static str {
12101222 target_os = "openbsd",
12111223 target_os = "dragonfly",
12121224 target_os = "nto",
1225 target_os = "qnx",
12131226 target_vendor = "apple",
12141227 target_os = "cygwin",
12151228 ))]
library/std/src/sys/random/mod.rs+1
......@@ -54,6 +54,7 @@ cfg_select! {
5454 target_os = "hurd",
5555 target_os = "l4re",
5656 target_os = "nto",
57 target_os = "qnx",
5758 ) => {
5859 mod unix_legacy;
5960 pub use unix_legacy::fill_bytes;
library/std/src/sys/thread/unix.rs+6-1
......@@ -12,7 +12,12 @@ use crate::mem::{self, DropGuard, ManuallyDrop};
1212use crate::num::NonZero;
1313#[cfg(all(target_os = "linux", target_env = "gnu"))]
1414use crate::sys::weak::dlsym;
15#[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "nto",))]
15#[cfg(any(
16 target_os = "solaris",
17 target_os = "illumos",
18 target_os = "nto",
19 target_os = "qnx",
20))]
1621use crate::sys::weak::weak;
1722use crate::thread::ThreadInit;
1823use crate::time::Duration;
library/unwind/src/lib.rs+1-1
......@@ -193,7 +193,7 @@ unsafe extern "C" {}
193193#[link(name = "unwind")]
194194unsafe extern "C" {}
195195
196#[cfg(target_os = "nto")]
196#[cfg(any(target_os = "nto", target_os = "qnx"))]
197197cfg_select! {
198198 target_env = "nto70" => {
199199 #[link(name = "gcc")]
src/bootstrap/src/core/config/tests.rs+10
......@@ -11,6 +11,7 @@ use serde::Deserialize;
1111
1212use super::flags::Flags;
1313use super::toml::change_id::ChangeIdWrapper;
14use super::toml::rust::parse_codegen_backends;
1415use super::{Config, RUSTC_IF_UNCHANGED_ALLOWED_PATHS};
1516use crate::ChangeId;
1617use crate::core::build_steps::clippy::{LintConfig, get_clippy_rules_in_order};
......@@ -206,6 +207,15 @@ fn rust_optimize() {
206207 assert_eq!(parse("rust.optimize = \"s\"").rust_optimize.get_opt_level(), Some("s".to_string()));
207208}
208209
210#[test]
211#[should_panic(expected = "Duplicate value 'llvm' for 'rust.codegen-backends'")]
212fn rejects_duplicate_codegen_backends() {
213 parse_codegen_backends(
214 vec!["llvm", "llvm", "cranelift"].into_iter().map(str::to_owned).collect(),
215 "rust",
216 );
217}
218
209219#[test]
210220#[should_panic]
211221fn invalid_rust_optimize() {
src/bootstrap/src/core/config/toml/rust.rs+20-10
......@@ -422,23 +422,33 @@ pub(crate) fn parse_codegen_backends(
422422 Please, use '{stripped}' instead."
423423 )
424424 }
425 if !BUILTIN_CODEGEN_BACKENDS.contains(&backend.as_str()) {
425 let backend = match backend.as_str() {
426 "llvm" => CodegenBackendKind::Llvm,
427 "cranelift" => CodegenBackendKind::Cranelift,
428 "gcc" => CodegenBackendKind::Gcc,
429 backend => CodegenBackendKind::Custom(backend.to_string()),
430 };
431
432 if found_backends.contains(&backend) {
433 panic!(
434 "Duplicate value '{}' for '{section}.codegen-backends'. \
435 Each codegen backend should only be specified once.",
436 backend.name()
437 );
438 }
439
440 if !BUILTIN_CODEGEN_BACKENDS.contains(&backend.name()) {
426441 if CiEnv::is_rust_lang_managed_ci_job() {
427 eprintln!("Unknown codegen backend {backend}");
442 eprintln!("Unknown codegen backend {}", backend.name());
428443 exit!(1);
429444 }
430445
431446 println!(
432 "HELP: '{backend}' for '{section}.codegen-backends' might fail. \
433 List of known codegen backends: {BUILTIN_CODEGEN_BACKENDS:?}"
447 "HELP: '{}' for '{section}.codegen-backends' might fail. \
448 List of known codegen backends: {BUILTIN_CODEGEN_BACKENDS:?}",
449 backend.name()
434450 );
435451 }
436 let backend = match backend.as_str() {
437 "llvm" => CodegenBackendKind::Llvm,
438 "cranelift" => CodegenBackendKind::Cranelift,
439 "gcc" => CodegenBackendKind::Gcc,
440 backend => CodegenBackendKind::Custom(backend.to_string()),
441 };
442452 found_backends.push(backend);
443453 }
444454 if found_backends.is_empty() {
src/bootstrap/src/core/sanity.rs+2
......@@ -39,6 +39,8 @@ const STAGE0_MISSING_TARGETS: &[&str] = &[
3939 // just a dummy comment so the list doesn't get onelined
4040 "powerpc64-unknown-linux-gnuelfv2",
4141 "aarch64-unknown-linux-pauthtest", // Stage 0 compiler is not guaranteed to see the target yet.
42 "aarch64-unknown-qnx",
43 "x86_64-pc-qnx",
4244];
4345
4446/// Minimum version threshold for libstdc++ required when using prebuilt LLVM
src/doc/rustc/src/platform-support.md+2-2
......@@ -278,7 +278,7 @@ target | std | host | notes
278278[`aarch64-unknown-nto-qnx700`](platform-support/nto-qnx.md) | ? | | ARM64 QNX Neutrino 7.0 RTOS |
279279[`aarch64-unknown-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS with default network stack (io-pkt) |
280280[`aarch64-unknown-nto-qnx710_iosock`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS with new network stack (io-sock) |
281[`aarch64-unknown-nto-qnx800`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 8.0 RTOS |
281[`aarch64-unknown-qnx`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX SDP 8.0+ |
282282[`aarch64-unknown-nuttx`](platform-support/nuttx.md) | ✓ | | ARM64 with NuttX
283283[`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD
284284[`aarch64-unknown-redox`](platform-support/redox.md) | ✓ | | ARM64 Redox OS
......@@ -451,7 +451,7 @@ target | std | host | notes
451451[`x86_64-pc-cygwin`](platform-support/x86_64-pc-cygwin.md) | ✓ | | 64-bit x86 Cygwin |
452452[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with default network stack (io-pkt) |
453453[`x86_64-pc-nto-qnx710_iosock`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with new network stack (io-sock) |
454[`x86_64-pc-nto-qnx800`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 8.0 RTOS |
454[`x86_64-pc-qnx`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX SDP 8.0+ |
455455[`x86_64-unikraft-linux-musl`](platform-support/unikraft-linux-musl.md) | ✓ | | 64-bit Unikraft with musl 1.2.5
456456`x86_64-unknown-dragonfly` | ✓ | ✓ | 64-bit DragonFlyBSD
457457`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku
src/doc/rustc/src/platform-support/nto-qnx.md+99-120
......@@ -1,15 +1,22 @@
1# nto-qnx
1# QNX
22
33**Tier: 3**
44
5The [QNX®][qnx.com] Neutrino (nto) Real-time operating system. Known as QNX OS
6from version 8 onwards.
5Support for the [QNX®][qnx.com] [QNX Software Development Platform (SDP)], version 7.0, 7.1 and 8.0.
76
8This support has been implemented jointly by [Elektrobit Automotive GmbH][Elektrobit]
9and [QNX][qnx.com].
7[QNX Software Development Platform (SDP)]: https://qnx.software/en/software/products-and-solutions/qnx-software-development-platform
108
11[qnx.com]: https://blackberry.qnx.com
12[Elektrobit]: https://www.elektrobit.com
9The [QNX Software Development Platform (SDP)] is a development environment that
10you download and install on a host computer. It includes a C toolchain for your
11host, an IDE, and various board support packages for different target platforms.
12You can then use QNX SDP to build a custom run-time environment which you deploy
13onto an embedded device. That run-time environment will include a microkernel,
14whatever services you have selected, and perhaps one or more applications
15written in Rust.
16
17In QNX SDP 7.x the run-time environment is based on QNX Neutrino RTOS 7.x, while
18in QNX SDP 8.0 the run-time environment is based on QNX OS 8.0. The name change
19reflects architectural changes in the RTOS, but both use a microkernel design.
1320
1421## Target maintainers
1522
......@@ -20,107 +27,52 @@ and [QNX][qnx.com].
2027
2128## Requirements
2229
23Currently, the following QNX versions and compilation targets are supported:
30The following QNX SDP versions and compilation targets are supported:
2431
2532| Target Tuple | QNX Version | Target Architecture | Full support | `no_std` support |
2633| ----------------------------------- | ----------------------------- | ------------------- | :----------: | :--------------: |
27| `aarch64-unknown-nto-qnx800` | QNX OS 8.0 | AArch64 | ? | ✓ |
28| `x86_64-pc-nto-qnx800` | QNX OS 8.0 | x86_64 | ? | ✓ |
29| `aarch64-unknown-nto-qnx710` | QNX Neutrino 7.1 with io-pkt | AArch64 | ✓ | ✓ |
30| `x86_64-pc-nto-qnx710` | QNX Neutrino 7.1 with io-pkt | x86_64 | ✓ | ✓ |
31| `aarch64-unknown-nto-qnx710_iosock` | QNX Neutrino 7.1 with io-sock | AArch64 | ? | ✓ |
32| `x86_64-pc-nto-qnx710_iosock` | QNX Neutrino 7.1 with io-sock | x86_64 | ? | ✓ |
33| `aarch64-unknown-nto-qnx700` | QNX Neutrino 7.0 | AArch64 | ? | ✓ |
34| `i686-pc-nto-qnx700` | QNX Neutrino 7.0 | x86 | | ✓ |
35
36On QNX Neutrino 7.0 and 7.1, `io-pkt` is used as network stack by default.
37QNX Neutrino 7.1 includes the optional network stack `io-sock`.
38QNX OS 8.0 always uses `io-sock`. QNX OS 8.0 support is currently work in progress.
39
40Adding other architectures that are supported by QNX is possible.
41
42In the table above, 'full support' indicates support for building Rust applications with the full standard library. A '?' means that support is in-progress.
43'`no_std` support' is for building `#![no_std]` applications where only `core` and `alloc` are available.
44
45For building or using the Rust toolchain for QNX, the
46[QNX Software Development Platform (SDP)](https://blackberry.qnx.com/en/products/foundation-software/qnx-software-development-platform)
47must be installed and initialized.
48Initialization is usually done by sourcing `qnxsdp-env.sh` (this will be installed as part of the SDP, see also installation instruction provided with the SDP).
49Afterwards [`qcc`](https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html) (QNX C/C++ compiler)
50should be available (in the `$PATH` variable).
51`qcc` will be called e.g. for linking executables.
52
53When linking `no_std` applications, they must link against `libc.so` (see example). This is
54required because applications always link against the `crt` library and `crt` depends on `libc.so`.
55This is done automatically when using the standard library.
56
57### Disabling RELocation Read-Only (RELRO)
58
59While not recommended by default, some QNX kernel setups may require the `RELRO` to be disabled with `-C relro_level=off`, e.g. by adding it to the `.cargo/config.toml` file:
60
61```toml
62[target.aarch64-unknown-nto-qnx700]
63rustflags = ["-C", "relro_level=off"]
64```
65
66If your QNX kernel does not allow it, and `relro` is not disabled, running compiled binary would fail with `syntax error: ... unexpected` or similar. This is due to kernel trying to interpret compiled binary with `/bin/sh`, and obviously failing. To verify that this is really the case, run your binary with the `DL_DEBUG=all` env var, and look for this output. If you see it, you should disable `relro` as described above.
67
68```text
69Resolution scope for Executable->/bin/sh:
70 Executable->/bin/sh
71 libc.so.4->/usr/lib/ldqnx-64.so.2
72```
73
74### Small example application
75
76Small `no_std` example is shown below. Applications using the standard library work as well.
77
78```rust,ignore (platform-specific)
79#![no_std]
80#![no_main]
81#![feature(lang_items)]
82
83// We must always link against libc, even if no external functions are used
84// "extern C" - Block can be empty but must be present
85#[link(name = "c")]
86extern "C" {
87 pub fn printf(format: *const core::ffi::c_char, ...) -> core::ffi::c_int;
88}
89
90#[no_mangle]
91pub extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
92 const HELLO: &'static str = "Hello World, the answer is %d\n\0";
93 unsafe {
94 printf(HELLO.as_ptr() as *const _, 42);
95 }
96 0
97}
98
99use core::panic::PanicInfo;
100
101#[panic_handler]
102fn panic(_panic: &PanicInfo<'_>) -> ! {
103 loop {}
104}
105
106#[lang = "eh_personality"]
107#[no_mangle]
108pub extern "C" fn rust_eh_personality() {}
109```
110
111The QNX support in Rust has been tested with QNX Neutrino 7.0 and 7.1. Support for QNX OS 8.0 is a work in progress.
112
113There are no further known requirements.
34| `aarch64-unknown-qnx` | QNX SDP 8.0+ | AArch64 | ? | ✓ |
35| `x86_64-pc-qnx` | QNX SDP 8.0+ | x86_64 | ? | ✓ |
36| `aarch64-unknown-nto-qnx710_iosock` | QNX SDP 7.1 with io-sock | AArch64 | ? | ✓ |
37| `x86_64-pc-nto-qnx710_iosock` | QNX SDP 7.1 with io-sock | x86_64 | ? | ✓ |
38| `aarch64-unknown-nto-qnx710` | QNX SDP 7.1 with io-pkt | AArch64 | ✓ | ✓ |
39| `x86_64-pc-nto-qnx710` | QNX SDP 7.1 with io-pkt | x86_64 | ✓ | ✓ |
40| `aarch64-unknown-nto-qnx700` | QNX SDP 7.0 | AArch64 | ? | ✓ |
41| `i686-pc-nto-qnx700` | QNX SDP 7.0 | x86 | - | ✓ |
42
43* QNX SDP 7.0 only offers the `io-pkt` network stack
44* QNX SDP 7.1 uses the `io-pkt` network stack by default, but also includes the optional `io-sock` network stack
45* QNX SDP 8.0 only offers the `io-sock` network stack
46
47In the table above, 'full support' indicates support for building Rust
48applications with the full standard library. A '?' means that support is
49in-progress. `no_std` support is for building `#![no_std]` applications where
50only `core` and `alloc` are available.
51
52For building or using the Rust toolchain for QNX, the relevant version of the
53[QNX Software Development Platform (SDP)] must be installed and initialized.
54Initialization is usually done by sourcing `qnxsdp-env.sh` (this will be
55installed as part of the SDP, so see the installation instruction provided with
56the SDP). Afterwards [`qcc`] (the QNX C/C++ compiler) should be available in
57your system PATH because it will be called during Rust compilation (e.g. for
58linking executables).
59
60[`qcc`]: https://www.qnx.com/developers/docs/latest/com.qnx.doc.neutrino.utilities/topic/q/qcc.html
61
62When linking `no_std` applications, they must link against `libc.so` (see
63example). This is required because applications always link against the `crt`
64library and `crt` depends on `libc.so`. This is done automatically when using
65the standard library.
11466
11567## Conditional compilation
11668
117For conditional compilation, following QNX specific attributes are defined:
69For conditional compilation, the following QNX specific attributes are defined:
11870
11971- `target_os` = `"nto"`
120- `target_env` = `"nto71"` (for QNX Neutrino 7.1 with "classic" network stack "io_pkt")
121- `target_env` = `"nto71_iosock"` (for QNX Neutrino 7.1 with network stack "io_sock")
122- `target_env` = `"nto70"` (for QNX Neutrino 7.0)
123- `target_env` = `"nto80"` (for QNX OS 8.0)
72 - `target_env` = `"nto70"` (for QNX SDP 7.0)
73 - `target_env` = `"nto71"` (for QNX SDP 7.1 with "classic" network stack "io_pkt")
74 - `target_env` = `"nto71_iosock"` (for QNX SDP 7.1 with "new" network stack "io_sock")
75- `target_os` = `"qnx"` (for QNX SDP 8.0 or higher)
12476
12577## Building the target
12678
......@@ -176,18 +128,37 @@ For conditional compilation, following QNX specific attributes are defined:
176128 rustc library/core library/alloc library/std
177129 ```
178130
131## Building Rust programs
132
133Rust does not ship pre-compiled artifacts for this target. To compile for this
134target, you must either build Rust with the target enabled (see "Building the
135target" above), or build your own copy of `core` by using `build-std` or
136similar.
137
138Compiled executables can run directly on QNX, either by including them in the
139disk image, or copying them over the network to a running system.
140
141Compiling C code requires the same environment variables to be set as compiling
142the Rust toolchain (see above), to ensure `qcc` is used with proper arguments.
143To ensure compatibility, do not specify any further arguments that for example
144change calling conventions or memory layout.
145
179146## Running the Rust test suite
180147
181The test suites of the Rust compiler and standard library can be executed much like other Rust targets.
182The environment for testing should match the one used during compiler compilation (refer to `build_env` and `qcc`/`PATH` above) with the
183addition of the TEST_DEVICE_ADDR environment variable.
184The TEST_DEVICE_ADDR variable controls the remote runner and should point to the target, despite localhost being shown in the following example.
185Note that some tests are failing which is why they are currently excluded by the target maintainers which can be seen in the following example.
148The test suites of the Rust compiler and standard library can be executed much
149like other Rust targets. The environment for testing should match the one used
150during compiler compilation (refer to `build_env` and `qcc`/`PATH` above) with
151the addition of the `TEST_DEVICE_ADDR` environment variable. The
152`TEST_DEVICE_ADDR` variable controls the remote runner and should point to a
153target running the `remote-test-server` executable.
154
155Note that some tests are failing which is why they are currently excluded by the
156target maintainers which can be seen in the following example.
186157
187158To run all tests on a x86_64 QNX Neutrino 7.1 target:
188159
189160```bash
190export TEST_DEVICE_ADDR="localhost:12345" # must address the test target, can be a SSH tunnel
161export TEST_DEVICE_ADDR="1.2.3.4:12345" # must address the test target, can be a SSH tunnel
191162export build_env=<see above>
192163
193164# Disable tests that only work on the host or don't make sense for this target.
......@@ -210,16 +181,6 @@ env $build_env \
210181 --target x86_64-pc-nto-qnx710
211182```
212183
213## Building Rust programs
214
215Rust does not yet ship pre-compiled artifacts for this target.
216To compile for this target, you must either build Rust with the target enabled (see "Building the target" above),
217or build your own copy of `core` by using `build-std` or similar.
218
219## Testing
220
221Compiled executables can run directly on QNX.
222
223184### Rust std library test suite
224185
225186The target needs sufficient resources to execute all tests. The commands below assume that a QEMU image
......@@ -279,8 +240,26 @@ is used.
279240 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=1 ms
280241 ```
281242
282## Cross-compilation toolchains and C code
243## Disabling RELocation Read-Only (RELRO)
244
245While not recommended by default, some QNX kernel setups may require the `RELRO`
246to be disabled with `-C relro_level=off`, e.g. by adding it to the
247`.cargo/config.toml` file:
283248
284Compiling C code requires the same environment variables to be set as compiling the Rust toolchain (see above),
285to ensure `qcc` is used with proper arguments.
286To ensure compatibility, do not specify any further arguments that for example change calling conventions or memory layout.
249```toml
250[target.aarch64-unknown-nto-qnx700]
251rustflags = ["-C", "relro_level=off"]
252```
253
254If your QNX kernel does not allow it, and `relro` is not disabled, running the
255compiled binary would fail with `syntax error: ... unexpected` or similar. This
256is due to kernel trying to interpret the compiled binary with `/bin/sh`, and
257obviously failing. To verify that this is really the case, run your binary with
258the `DL_DEBUG=all` env var, and look for this output. If you see it, you should
259disable `relro` as described above.
260
261```text
262Resolution scope for Executable->/bin/sh:
263 Executable->/bin/sh
264 libc.so.4->/usr/lib/ldqnx-64.so.2
265```
src/librustdoc/clean/cfg.rs+5-5
......@@ -638,11 +638,12 @@ fn human_readable_target_os(os: Symbol) -> Option<&'static str> {
638638 Motor => "Motor OS",
639639 NetBsd => "NetBSD",
640640 None => "bare-metal",
641 Nto => "QNX Neutrino",
641 Nto => "QNX SDP 7.x",
642642 NuttX => "NuttX",
643643 OpenBsd => "OpenBSD",
644644 Psp => "Play Station Portable",
645645 Psx => "Play Station 1",
646 Qnx => "QNX SDP 8.0+",
646647 Qurt => "QuRT",
647648 Redox => "Redox OS",
648649 Rtems => "RTEMS OS",
......@@ -718,10 +719,9 @@ fn human_readable_target_env(env: Symbol) -> Option<&'static str> {
718719 Msvc => "MSVC",
719720 Musl => "musl",
720721 Newlib => "Newlib",
721 Nto70 => "Neutrino 7.0",
722 Nto71 => "Neutrino 7.1",
723 Nto71IoSock => "Neutrino 7.1 with io-sock",
724 Nto80 => "Neutrino 8.0",
722 Nto70 => "QNX SDP 7.0",
723 Nto71 => "QNX SDP 7.1",
724 Nto71IoSock => "QNX SDP 7.1 with io-sock",
725725 Ohos => "OpenHarmony",
726726 P1 => "WASIp1",
727727 P2 => "WASIp2",
src/tools/linkchecker/Cargo.toml+1-1
......@@ -9,5 +9,5 @@ path = "main.rs"
99
1010[dependencies]
1111regex = "1"
12html5ever = "0.29.0"
12html5ever = "0.39.0"
1313urlencoding = "2.1.3"
src/tools/miri/src/shims/native_lib/mod.rs+1-1
......@@ -321,7 +321,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
321321 imm.layout
322322 )
323323 };
324 a.size(this).align_to(b.align(this).abi).bytes_usize()
324 a.size(this).align_to(b.default_align(this).abi).bytes_usize()
325325 };
326326
327327 write_scalar(this, sc_first, 0)?;
src/tools/miri/tests/pass-dep/shims/gettid.rs+1-1
......@@ -9,7 +9,7 @@ fn gettid() -> u64 {
99 any(target_os = "android", target_os = "linux") => {
1010 gettid_linux_like()
1111 }
12 target_os = "nto" => {
12 any(target_os = "nto", target_os = "qnx") => {
1313 unsafe { libc::gettid() as u64 }
1414 }
1515 target_os = "openbsd" => {
tests/assembly-llvm/targets/targets-elf.rs+6-6
......@@ -88,9 +88,9 @@
8888//@ revisions: aarch64_unknown_nto_qnx710_iosock
8989//@ [aarch64_unknown_nto_qnx710_iosock] compile-flags: --target aarch64-unknown-nto-qnx710_iosock
9090//@ [aarch64_unknown_nto_qnx710_iosock] needs-llvm-components: aarch64
91//@ revisions: aarch64_unknown_nto_qnx800
92//@ [aarch64_unknown_nto_qnx800] compile-flags: --target aarch64-unknown-nto-qnx800
93//@ [aarch64_unknown_nto_qnx800] needs-llvm-components: aarch64
91//@ revisions: aarch64_unknown_qnx
92//@ [aarch64_unknown_qnx] compile-flags: --target aarch64-unknown-qnx
93//@ [aarch64_unknown_qnx] needs-llvm-components: aarch64
9494//@ revisions: aarch64_unknown_openbsd
9595//@ [aarch64_unknown_openbsd] compile-flags: --target aarch64-unknown-openbsd
9696//@ [aarch64_unknown_openbsd] needs-llvm-components: aarch64
......@@ -685,9 +685,9 @@
685685//@ revisions: x86_64_pc_nto_qnx710_iosock
686686//@ [x86_64_pc_nto_qnx710_iosock] compile-flags: --target x86_64-pc-nto-qnx710_iosock
687687//@ [x86_64_pc_nto_qnx710_iosock] needs-llvm-components: x86
688//@ revisions: x86_64_pc_nto_qnx800
689//@ [x86_64_pc_nto_qnx800] compile-flags: --target x86_64-pc-nto-qnx800
690//@ [x86_64_pc_nto_qnx800] needs-llvm-components: x86
688//@ revisions: x86_64_pc_qnx
689//@ [x86_64_pc_qnx] compile-flags: --target x86_64-pc-qnx
690//@ [x86_64_pc_qnx] needs-llvm-components: x86
691691//@ revisions: x86_64_pc_solaris
692692//@ [x86_64_pc_solaris] compile-flags: --target x86_64-pc-solaris
693693//@ [x86_64_pc_solaris] needs-llvm-components: x86
tests/rustdoc-html/doc-cfg/all-targets.rs+5-5
......@@ -3,9 +3,9 @@
33//@ has all_targets/fn.foo.html \
44// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
55// 'Available on target_env=fake_env or Catalyst or GNU or Managarm C Library \
6// or MSVC or musl or Neutrino 7.0 or Neutrino 7.1 or Neutrino 7.1 with io-sock \
7// or Neutrino 8.0 or Newlib or OpenHarmony or relibc or SGX or Simulator or \
8// uClibc or V5 or WASIp1 or WASIp2 or WASIp3 only.'
6// or MSVC or musl or Newlib or OpenHarmony or QNX SDP 7.0 or QNX SDP 7.1 or \
7// QNX SDP 7.1 with io-sock or relibc or SGX or Simulator or uClibc or V5 or WASIp1 \
8// or WASIp2 or WASIp3 only.'
99#[doc(cfg(any(
1010 target_env = "gnu",
1111 target_env = "macabi",
......@@ -16,7 +16,6 @@
1616 target_env = "nto70",
1717 target_env = "nto71",
1818 target_env = "nto71_iosock",
19 target_env = "nto80",
2019 target_env = "ohos",
2120 target_env = "relibc",
2221 target_env = "sgx",
......@@ -81,7 +80,7 @@ pub fn bar() {}
8180// and HelenOS and Hermit and Horizon and illumos and iOS and L4Re and Linux \
8281// and LynxOS-178 and macOS and Managarm and Motor OS and NetBSD and NuttX \
8382// and OpenBSD and Play Station 1 and Play Station Portable and Play Station Vita \
84// and QNX Neutrino and QuRT and Redox OS and RTEMS OS and Solaris and \
83// and QNX SDP 7.x and QNX SDP 8.0+ and QuRT and Redox OS and RTEMS OS and Solaris and \
8584// SOLID ASP3 and TEEOS and Trusty and tvOS and UEFI and VEXos and visionOS \
8685// and VxWorks and WASI and watchOS and Windows and Xous and zero knowledge \
8786// Virtual Machine only.'
......@@ -112,6 +111,7 @@ pub fn bar() {}
112111 target_os = "netbsd",
113112 target_os = "none",
114113 target_os = "nto",
114 target_os = "qnx",
115115 target_os = "nuttx",
116116 target_os = "openbsd",
117117 target_os = "psp",
tests/rustdoc-html/doc-cfg/sort.rs+2-4
......@@ -9,7 +9,7 @@
99// Tests that OS targets are sorted alphabetically.
1010//@ has 'foo/fn.foo.html'
1111//@ has - '//*[@class="stab portability"]' 'Available on Android or Apple or Cygwin \
12// or DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD or QNX Neutrino only.'
12// or DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD only.'
1313#[doc(cfg(any(
1414 target_os = "android",
1515 target_os = "linux",
......@@ -17,7 +17,6 @@
1717 target_os = "freebsd",
1818 target_os = "netbsd",
1919 target_os = "openbsd",
20 target_os = "nto",
2120 target_vendor = "apple",
2221 target_os = "cygwin"
2322)))]
......@@ -27,7 +26,7 @@ pub fn foo() {}
2726// Tests that targets are sorted alphabetically just like explicit `doc(cfg)`.
2827//@ has 'foo/fn.bar.html'
2928//@ has - '//*[@class="stab portability"]' 'Available on Android or Apple or Cygwin \
30// or DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD or QNX Neutrino only.'
29// or DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD only.'
3130#[cfg(any(
3231 target_os = "android",
3332 target_os = "linux",
......@@ -35,7 +34,6 @@ pub fn foo() {}
3534 target_os = "freebsd",
3635 target_os = "netbsd",
3736 target_os = "openbsd",
38 target_os = "nto",
3937 target_vendor = "apple",
4038 target_os = "cygwin"
4139))]
tests/ui/attributes/auxiliary/used_pre_main_constructor.rs+1
......@@ -18,6 +18,7 @@
1818 target_os = "linux",
1919 target_os = "netbsd",
2020 target_os = "nto",
21 target_os = "qnx",
2122 target_os = "openbsd",
2223 target_os = "fuchsia",
2324 target_os = "managarm",
tests/ui/check-cfg/cfg-crate-features.stderr+1-1
......@@ -24,7 +24,7 @@ warning: unexpected `cfg` condition value: `does_not_exist`
2424LL | #![cfg(not(target(os = "does_not_exist")))]
2525 | ^^^^^^^^^^^^^^^^^^^^^
2626 |
27 = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, and `solid_asp3` and 14 more
27 = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qnx`, `qurt`, `redox`, `rtems`, and `solaris` and 15 more
2828 = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
2929 = note: `#[warn(unexpected_cfgs)]` on by default
3030
tests/ui/check-cfg/well-known-values.stderr+3-3
......@@ -156,7 +156,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
156156LL | target_env = "_UNEXPECTED_VALUE",
157157 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158158 |
159 = note: expected values for `target_env` are: ``, `gnu`, `macabi`, `mlibc`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `nto71_iosock`, `nto80`, `ohos`, `p1`, `p2`, `p3`, `relibc`, `sgx`, `sim`, `uclibc`, and `v5`
159 = note: expected values for `target_env` are: ``, `gnu`, `macabi`, `mlibc`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `nto71_iosock`, `ohos`, `p1`, `p2`, `p3`, `relibc`, `sgx`, `sim`, `uclibc`, and `v5`
160160 = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
161161
162162warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
......@@ -210,7 +210,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
210210LL | target_os = "_UNEXPECTED_VALUE",
211211 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212212 |
213 = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
213 = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qnx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
214214 = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
215215
216216warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
......@@ -283,7 +283,7 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
283283 | |
284284 | help: there is a expected value with a similar name: `"linux"`
285285 |
286 = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
286 = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qnx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
287287 = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
288288
289289warning: 29 warnings emitted
tests/ui/intrinsics/intrinsic-alignment.rs+1
......@@ -16,6 +16,7 @@
1616 target_os = "solaris",
1717 target_os = "vxworks",
1818 target_os = "nto",
19 target_os = "qnx",
1920 target_vendor = "apple",
2021))]
2122mod m {
tests/ui/process/process-sigpipe.rs+2-2
......@@ -31,9 +31,9 @@ fn main() {
3131 thread::sleep_ms(5000);
3232 process::exit(1);
3333 });
34 // QNX Neutrino does not have `yes`. Therefore, use `while-echo` for `nto`
34 // QNX does not have `yes`. Therefore, use `while-echo` for `nto`
3535 // and `yes` for other platforms.
36 let command = if cfg!(target_os = "nto") {
36 let command = if cfg!(any(target_os = "nto", target_os = "qnx")) {
3737 "while echo y ; do : ; done | head"
3838 } else {
3939 "yes | head"
tests/ui/structs/rec-align-u64.rs+1
......@@ -36,6 +36,7 @@ struct Outer {
3636 target_os = "solaris",
3737 target_os = "vxworks",
3838 target_os = "nto",
39 target_os = "qnx",
3940 target_vendor = "apple",
4041))]
4142mod m {