authorbors <bors@rust-lang.org> 2025-08-13 10:39:15 UTC
committerbors <bors@rust-lang.org> 2025-08-13 10:39:15 UTC
log350d0ef0ec0493e6d21cfb265cb8211a0e74d766
treea11233b3d2103840a2124b636ca98dd34771f5eb
parent1c9952f4dd6e0947ee91f07130c03813a088a894
parentbc8a52161950a59cc1d8f118d1fb10ab5890e84e

Auto merge of #144722 - ywxt:parallel-reproducibile, r=SparrowLii

Fix parallel rustc not being reproducible due to unstable sorts of items Currently, A tuple `(DefId, SymbolName)` is used to determine the order of items in the final binary. However `DefId` is expected as non-deterministic, which leads to some not reproducible issues under parallel compilation. (See https://github.com/rust-lang/rust/issues/140425#issuecomment-3111802148) Theoretically, we don't need the sorting because the order of these items is already deterministic. However, codegen tests reply on the same order of items between in binary and source. So here we added a new option `codegen-source-order` to indicate whether sorting based on the order in source. For codegen tests, items are sorted according to the order in the source code, whereas in the normal path, no sorting is performed. Specially, for codegen tests, in preparation for parallel compilation potentially being enabled by default in the future, we use `Span` replacing `DefId` to make the order deterministic. This PR is purposed to fix rust-lang/rust#140425, but seemly works on rust-lang/rust#140413 too. This behavior hasn't added into any test until we have a test suit for the parallel frontend. (See https://github.com/rust-lang/rust/pull/143953) Related discussion: [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Async.20closures.20not.20reproducible.28.23140425.29) https://github.com/rust-lang/rust/pull/144576 Update rust-lang/rust#113349 r? `@oli-obk` cc `@lqd` `@cramertj` `@matthiaskrgr` `@Zoxc` `@SparrowLii` `@bjorn3` `@cjgillot` `@joshtriplett`

11 files changed, 134 insertions(+), 88 deletions(-)

compiler/rustc_interface/src/tests.rs+1
......@@ -689,6 +689,7 @@ fn test_unstable_options_tracking_hash() {
689689 // Make sure that changing an [UNTRACKED] option leaves the hash unchanged.
690690 // tidy-alphabetical-start
691691 untracked!(assert_incr_state, Some(String::from("loaded")));
692 untracked!(codegen_source_order, true);
692693 untracked!(deduplicate_diagnostics, false);
693694 untracked!(dump_dep_graph, true);
694695 untracked!(dump_mir, Some(String::from("abc")));
compiler/rustc_middle/src/mir/mono.rs+36-31
......@@ -12,7 +12,6 @@ use rustc_hashes::Hash128;
1212use rustc_hir::ItemId;
1313use rustc_hir::attrs::InlineAttr;
1414use rustc_hir::def_id::{CrateNum, DefId, DefIdSet, LOCAL_CRATE};
15use rustc_index::Idx;
1615use rustc_macros::{HashStable, TyDecodable, TyEncodable};
1716use rustc_query_system::ich::StableHashingContext;
1817use rustc_session::config::OptLevel;
......@@ -526,44 +525,50 @@ impl<'tcx> CodegenUnit<'tcx> {
526525 tcx: TyCtxt<'tcx>,
527526 ) -> Vec<(MonoItem<'tcx>, MonoItemData)> {
528527 // The codegen tests rely on items being process in the same order as
529 // they appear in the file, so for local items, we sort by node_id first
528 // they appear in the file, so for local items, we sort by span first
530529 #[derive(PartialEq, Eq, PartialOrd, Ord)]
531 struct ItemSortKey<'tcx>(Option<usize>, SymbolName<'tcx>);
532
530 struct ItemSortKey<'tcx>(Option<Span>, SymbolName<'tcx>);
531
532 // We only want to take HirIds of user-defines instances into account.
533 // The others don't matter for the codegen tests and can even make item
534 // order unstable.
535 fn local_item_id<'tcx>(item: MonoItem<'tcx>) -> Option<DefId> {
536 match item {
537 MonoItem::Fn(ref instance) => match instance.def {
538 InstanceKind::Item(def) => def.as_local().map(|_| def),
539 InstanceKind::VTableShim(..)
540 | InstanceKind::ReifyShim(..)
541 | InstanceKind::Intrinsic(..)
542 | InstanceKind::FnPtrShim(..)
543 | InstanceKind::Virtual(..)
544 | InstanceKind::ClosureOnceShim { .. }
545 | InstanceKind::ConstructCoroutineInClosureShim { .. }
546 | InstanceKind::DropGlue(..)
547 | InstanceKind::CloneShim(..)
548 | InstanceKind::ThreadLocalShim(..)
549 | InstanceKind::FnPtrAddrShim(..)
550 | InstanceKind::AsyncDropGlue(..)
551 | InstanceKind::FutureDropPollShim(..)
552 | InstanceKind::AsyncDropGlueCtorShim(..) => None,
553 },
554 MonoItem::Static(def_id) => def_id.as_local().map(|_| def_id),
555 MonoItem::GlobalAsm(item_id) => Some(item_id.owner_id.def_id.to_def_id()),
556 }
557 }
533558 fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx>, item: MonoItem<'tcx>) -> ItemSortKey<'tcx> {
534559 ItemSortKey(
535 match item {
536 MonoItem::Fn(ref instance) => {
537 match instance.def {
538 // We only want to take HirIds of user-defined
539 // instances into account. The others don't matter for
540 // the codegen tests and can even make item order
541 // unstable.
542 InstanceKind::Item(def) => def.as_local().map(Idx::index),
543 InstanceKind::VTableShim(..)
544 | InstanceKind::ReifyShim(..)
545 | InstanceKind::Intrinsic(..)
546 | InstanceKind::FnPtrShim(..)
547 | InstanceKind::Virtual(..)
548 | InstanceKind::ClosureOnceShim { .. }
549 | InstanceKind::ConstructCoroutineInClosureShim { .. }
550 | InstanceKind::DropGlue(..)
551 | InstanceKind::CloneShim(..)
552 | InstanceKind::ThreadLocalShim(..)
553 | InstanceKind::FnPtrAddrShim(..)
554 | InstanceKind::AsyncDropGlue(..)
555 | InstanceKind::FutureDropPollShim(..)
556 | InstanceKind::AsyncDropGlueCtorShim(..) => None,
557 }
558 }
559 MonoItem::Static(def_id) => def_id.as_local().map(Idx::index),
560 MonoItem::GlobalAsm(item_id) => Some(item_id.owner_id.def_id.index()),
561 },
560 local_item_id(item)
561 .map(|def_id| tcx.def_span(def_id).find_ancestor_not_from_macro())
562 .flatten(),
562563 item.symbol_name(tcx),
563564 )
564565 }
565566
566567 let mut items: Vec<_> = self.items().iter().map(|(&i, &data)| (i, data)).collect();
568 if !tcx.sess.opts.unstable_opts.codegen_source_order {
569 // It's already deterministic, so we can just use it.
570 return items;
571 }
567572 items.sort_by_cached_key(|&(i, _)| item_sort_key(tcx, i));
568573 items
569574 }
compiler/rustc_session/src/options.rs+2
......@@ -2165,6 +2165,8 @@ options! {
21652165 "hash algorithm of source files used to check freshness in cargo (`blake3` or `sha256`)"),
21662166 codegen_backend: Option<String> = (None, parse_opt_string, [TRACKED],
21672167 "the backend to use"),
2168 codegen_source_order: bool = (false, parse_bool, [UNTRACKED],
2169 "emit mono items in the order of spans in source files (default: no)"),
21682170 contract_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
21692171 "emit runtime checks for contract pre- and post-conditions (default: no)"),
21702172 coverage_options: CoverageOptions = (CoverageOptions::default(), parse_coverage_options, [TRACKED],
src/doc/unstable-book/src/compiler-flags/codegen-source-order.md created+12
......@@ -0,0 +1,12 @@
1# `codegen-source-order`
2
3---
4
5This feature allows you to have a predictive and
6deterministic order for items after codegen, which
7is the same as in source code.
8
9For every `CodegenUnit`, local `MonoItem`s would
10be sorted by `(Span, SymbolName)`, which
11makes codegen tests rely on the order of items in
12source files work.
src/tools/compiletest/src/runtest.rs+4
......@@ -1695,6 +1695,10 @@ impl<'test> TestCx<'test> {
16951695 }
16961696 TestMode::Assembly | TestMode::Codegen => {
16971697 rustc.arg("-Cdebug-assertions=no");
1698 // For assembly and codegen tests, we want to use the same order
1699 // of the items of a codegen unit as the source order, so that
1700 // we can compare the output with the source code through filecheck.
1701 rustc.arg("-Zcodegen-source-order");
16981702 }
16991703 TestMode::Crashes => {
17001704 set_mir_dump_dir(&mut rustc);
src/tools/run-make-support/src/external_deps/rustc.rs+6
......@@ -405,6 +405,12 @@ impl Rustc {
405405 };
406406 self
407407 }
408
409 /// Make that the generated LLVM IR is in source order.
410 pub fn codegen_source_order(&mut self) -> &mut Self {
411 self.cmd.arg("-Zcodegen-source-order");
412 self
413 }
408414}
409415
410416/// Query the sysroot path corresponding `rustc --print=sysroot`.
tests/run-make/pgo-branch-weights/rmake.rs+9-2
......@@ -17,15 +17,21 @@ use run_make_support::{llvm_filecheck, llvm_profdata, rfs, run_with_args, rustc}
1717fn main() {
1818 let path_prof_data_dir = Path::new("prof_data_dir");
1919 let path_merged_profdata = path_prof_data_dir.join("merged.profdata");
20 rustc().input("opaque.rs").run();
20 rustc().input("opaque.rs").codegen_source_order().run();
2121 rfs::create_dir_all(&path_prof_data_dir);
2222 rustc()
2323 .input("interesting.rs")
2424 .profile_generate(&path_prof_data_dir)
2525 .opt()
2626 .codegen_units(1)
27 .codegen_source_order()
28 .run();
29 rustc()
30 .input("main.rs")
31 .profile_generate(&path_prof_data_dir)
32 .opt()
33 .codegen_source_order()
2734 .run();
28 rustc().input("main.rs").profile_generate(&path_prof_data_dir).opt().run();
2935 run_with_args("main", &["aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc"]);
3036 llvm_profdata().merge().output(&path_merged_profdata).input(path_prof_data_dir).run();
3137 rustc()
......@@ -34,6 +40,7 @@ fn main() {
3440 .opt()
3541 .codegen_units(1)
3642 .emit("llvm-ir")
43 .codegen_source_order()
3744 .run();
3845 llvm_filecheck()
3946 .patterns("filecheck-patterns.txt")
tests/run-make/pgo-indirect-call-promotion/rmake.rs+10-3
......@@ -14,11 +14,17 @@ use run_make_support::{llvm_filecheck, llvm_profdata, rfs, run, rustc};
1414
1515fn main() {
1616 // We don't compile `opaque` with either optimizations or instrumentation.
17 rustc().input("opaque.rs").run();
17 rustc().input("opaque.rs").codegen_source_order().run();
1818 // Compile the test program with instrumentation
1919 rfs::create_dir("prof_data_dir");
20 rustc().input("interesting.rs").profile_generate("prof_data_dir").opt().codegen_units(1).run();
21 rustc().input("main.rs").profile_generate("prof_data_dir").opt().run();
20 rustc()
21 .input("interesting.rs")
22 .profile_generate("prof_data_dir")
23 .opt()
24 .codegen_units(1)
25 .codegen_source_order()
26 .run();
27 rustc().input("main.rs").profile_generate("prof_data_dir").opt().codegen_source_order().run();
2228 // The argument below generates to the expected branch weights
2329 run("main");
2430 llvm_profdata().merge().output("prof_data_dir/merged.profdata").input("prof_data_dir").run();
......@@ -28,6 +34,7 @@ fn main() {
2834 .opt()
2935 .codegen_units(1)
3036 .emit("llvm-ir")
37 .codegen_source_order()
3138 .run();
3239 llvm_filecheck()
3340 .patterns("filecheck-patterns.txt")
tests/run-make/pgo-use/rmake.rs+2
......@@ -22,6 +22,7 @@ fn main() {
2222 .opt_level("2")
2323 .codegen_units(1)
2424 .arg("-Cllvm-args=-disable-preinline")
25 .codegen_source_order()
2526 .profile_generate(cwd())
2627 .input("main.rs")
2728 .run();
......@@ -40,6 +41,7 @@ fn main() {
4041 .arg("-Cllvm-args=-disable-preinline")
4142 .profile_use("merged.profdata")
4243 .emit("llvm-ir")
44 .codegen_source_order()
4345 .input("main.rs")
4446 .run();
4547 // Check that the generate IR contains some things that we expect.
tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr+8-8
......@@ -1,8 +1,8 @@
1error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo`
2 --> $DIR/bad-intrinsic-monomorphization.rs:16:5
1error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
2 --> $DIR/bad-intrinsic-monomorphization.rs:26:5
33 |
4LL | intrinsics::cttz(v)
5 | ^^^^^^^^^^^^^^^^^^^
4LL | intrinsics::simd::simd_add(a, b)
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
77error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic float type, found `Foo`
88 --> $DIR/bad-intrinsic-monomorphization.rs:21:5
......@@ -10,11 +10,11 @@ error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic
1010LL | intrinsics::fadd_fast(a, b)
1111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
13error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
14 --> $DIR/bad-intrinsic-monomorphization.rs:26:5
13error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo`
14 --> $DIR/bad-intrinsic-monomorphization.rs:16:5
1515 |
16LL | intrinsics::simd::simd_add(a, b)
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16LL | intrinsics::cttz(v)
17 | ^^^^^^^^^^^^^^^^^^^
1818
1919error: aborting due to 3 previous errors
2020
tests/ui/intrinsics/non-integer-atomic.stderr+44-44
......@@ -1,59 +1,53 @@
1error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `bool`
2 --> $DIR/non-integer-atomic.rs:15:5
1error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `&dyn Fn()`
2 --> $DIR/non-integer-atomic.rs:55:5
33 |
44LL | intrinsics::atomic_load::<_, { SeqCst }>(p);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
7error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `bool`
8 --> $DIR/non-integer-atomic.rs:20:5
7error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `Foo`
8 --> $DIR/non-integer-atomic.rs:35:5
9 |
10LL | intrinsics::atomic_load::<_, { SeqCst }>(p);
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `&dyn Fn()`
14 --> $DIR/non-integer-atomic.rs:60:5
915 |
1016LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v);
1117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1218
13error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `bool`
14 --> $DIR/non-integer-atomic.rs:25:5
19error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
20 --> $DIR/non-integer-atomic.rs:85:5
1521 |
1622LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v);
1723 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1824
19error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `bool`
20 --> $DIR/non-integer-atomic.rs:30:5
25error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `&dyn Fn()`
26 --> $DIR/non-integer-atomic.rs:70:5
2127 |
2228LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v);
2329 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2430
25error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `Foo`
26 --> $DIR/non-integer-atomic.rs:35:5
27 |
28LL | intrinsics::atomic_load::<_, { SeqCst }>(p);
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
3131error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `Foo`
3232 --> $DIR/non-integer-atomic.rs:40:5
3333 |
3434LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v);
3535 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636
37error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `Foo`
38 --> $DIR/non-integer-atomic.rs:45:5
39 |
40LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v);
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `Foo`
44 --> $DIR/non-integer-atomic.rs:50:5
37error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
38 --> $DIR/non-integer-atomic.rs:90:5
4539 |
4640LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v);
4741 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4842
49error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `&dyn Fn()`
50 --> $DIR/non-integer-atomic.rs:55:5
43error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
44 --> $DIR/non-integer-atomic.rs:80:5
5145 |
52LL | intrinsics::atomic_load::<_, { SeqCst }>(p);
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v);
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5448
55error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `&dyn Fn()`
56 --> $DIR/non-integer-atomic.rs:60:5
49error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `bool`
50 --> $DIR/non-integer-atomic.rs:20:5
5751 |
5852LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v);
5953 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -64,36 +58,42 @@ error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basi
6458LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v);
6559 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6660
67error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `&dyn Fn()`
68 --> $DIR/non-integer-atomic.rs:70:5
69 |
70LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v);
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
7361error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
7462 --> $DIR/non-integer-atomic.rs:75:5
7563 |
7664LL | intrinsics::atomic_load::<_, { SeqCst }>(p);
7765 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7866
79error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
80 --> $DIR/non-integer-atomic.rs:80:5
67error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `bool`
68 --> $DIR/non-integer-atomic.rs:15:5
8169 |
82LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v);
83 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70LL | intrinsics::atomic_load::<_, { SeqCst }>(p);
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8472
85error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
86 --> $DIR/non-integer-atomic.rs:85:5
73error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `bool`
74 --> $DIR/non-integer-atomic.rs:30:5
8775 |
88LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v);
89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v);
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9078
91error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]`
92 --> $DIR/non-integer-atomic.rs:90:5
79error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `Foo`
80 --> $DIR/non-integer-atomic.rs:50:5
9381 |
9482LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v);
9583 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9684
85error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `Foo`
86 --> $DIR/non-integer-atomic.rs:45:5
87 |
88LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v);
89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90
91error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `bool`
92 --> $DIR/non-integer-atomic.rs:25:5
93 |
94LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v);
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
9797error: aborting due to 16 previous errors
9898
9999For more information about this error, try `rustc --explain E0511`.