| author | bors <bors@rust-lang.org> 2025-08-13 10:39:15 UTC |
| committer | bors <bors@rust-lang.org> 2025-08-13 10:39:15 UTC |
| log | 350d0ef0ec0493e6d21cfb265cb8211a0e74d766 |
| tree | a11233b3d2103840a2124b636ca98dd34771f5eb |
| parent | 1c9952f4dd6e0947ee91f07130c03813a088a894 |
| parent | bc8a52161950a59cc1d8f118d1fb10ab5890e84e |
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() { |
| 689 | 689 | // Make sure that changing an [UNTRACKED] option leaves the hash unchanged. |
| 690 | 690 | // tidy-alphabetical-start |
| 691 | 691 | untracked!(assert_incr_state, Some(String::from("loaded"))); |
| 692 | untracked!(codegen_source_order, true); | |
| 692 | 693 | untracked!(deduplicate_diagnostics, false); |
| 693 | 694 | untracked!(dump_dep_graph, true); |
| 694 | 695 | untracked!(dump_mir, Some(String::from("abc"))); |
compiler/rustc_middle/src/mir/mono.rs+36-31| ... | ... | @@ -12,7 +12,6 @@ use rustc_hashes::Hash128; |
| 12 | 12 | use rustc_hir::ItemId; |
| 13 | 13 | use rustc_hir::attrs::InlineAttr; |
| 14 | 14 | use rustc_hir::def_id::{CrateNum, DefId, DefIdSet, LOCAL_CRATE}; |
| 15 | use rustc_index::Idx; | |
| 16 | 15 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 17 | 16 | use rustc_query_system::ich::StableHashingContext; |
| 18 | 17 | use rustc_session::config::OptLevel; |
| ... | ... | @@ -526,44 +525,50 @@ impl<'tcx> CodegenUnit<'tcx> { |
| 526 | 525 | tcx: TyCtxt<'tcx>, |
| 527 | 526 | ) -> Vec<(MonoItem<'tcx>, MonoItemData)> { |
| 528 | 527 | // 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 | |
| 530 | 529 | #[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 | } | |
| 533 | 558 | fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx>, item: MonoItem<'tcx>) -> ItemSortKey<'tcx> { |
| 534 | 559 | 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(), | |
| 562 | 563 | item.symbol_name(tcx), |
| 563 | 564 | ) |
| 564 | 565 | } |
| 565 | 566 | |
| 566 | 567 | 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 | } | |
| 567 | 572 | items.sort_by_cached_key(|&(i, _)| item_sort_key(tcx, i)); |
| 568 | 573 | items |
| 569 | 574 | } |
compiler/rustc_session/src/options.rs+2| ... | ... | @@ -2165,6 +2165,8 @@ options! { |
| 2165 | 2165 | "hash algorithm of source files used to check freshness in cargo (`blake3` or `sha256`)"), |
| 2166 | 2166 | codegen_backend: Option<String> = (None, parse_opt_string, [TRACKED], |
| 2167 | 2167 | "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)"), | |
| 2168 | 2170 | contract_checks: Option<bool> = (None, parse_opt_bool, [TRACKED], |
| 2169 | 2171 | "emit runtime checks for contract pre- and post-conditions (default: no)"), |
| 2170 | 2172 | 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 | ||
| 5 | This feature allows you to have a predictive and | |
| 6 | deterministic order for items after codegen, which | |
| 7 | is the same as in source code. | |
| 8 | ||
| 9 | For every `CodegenUnit`, local `MonoItem`s would | |
| 10 | be sorted by `(Span, SymbolName)`, which | |
| 11 | makes codegen tests rely on the order of items in | |
| 12 | source files work. |
src/tools/compiletest/src/runtest.rs+4| ... | ... | @@ -1695,6 +1695,10 @@ impl<'test> TestCx<'test> { |
| 1695 | 1695 | } |
| 1696 | 1696 | TestMode::Assembly | TestMode::Codegen => { |
| 1697 | 1697 | 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"); | |
| 1698 | 1702 | } |
| 1699 | 1703 | TestMode::Crashes => { |
| 1700 | 1704 | set_mir_dump_dir(&mut rustc); |
src/tools/run-make-support/src/external_deps/rustc.rs+6| ... | ... | @@ -405,6 +405,12 @@ impl Rustc { |
| 405 | 405 | }; |
| 406 | 406 | self |
| 407 | 407 | } |
| 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 | } | |
| 408 | 414 | } |
| 409 | 415 | |
| 410 | 416 | /// 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} |
| 17 | 17 | fn main() { |
| 18 | 18 | let path_prof_data_dir = Path::new("prof_data_dir"); |
| 19 | 19 | 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(); | |
| 21 | 21 | rfs::create_dir_all(&path_prof_data_dir); |
| 22 | 22 | rustc() |
| 23 | 23 | .input("interesting.rs") |
| 24 | 24 | .profile_generate(&path_prof_data_dir) |
| 25 | 25 | .opt() |
| 26 | 26 | .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() | |
| 27 | 34 | .run(); |
| 28 | rustc().input("main.rs").profile_generate(&path_prof_data_dir).opt().run(); | |
| 29 | 35 | run_with_args("main", &["aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc"]); |
| 30 | 36 | llvm_profdata().merge().output(&path_merged_profdata).input(path_prof_data_dir).run(); |
| 31 | 37 | rustc() |
| ... | ... | @@ -34,6 +40,7 @@ fn main() { |
| 34 | 40 | .opt() |
| 35 | 41 | .codegen_units(1) |
| 36 | 42 | .emit("llvm-ir") |
| 43 | .codegen_source_order() | |
| 37 | 44 | .run(); |
| 38 | 45 | llvm_filecheck() |
| 39 | 46 | .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}; |
| 14 | 14 | |
| 15 | 15 | fn main() { |
| 16 | 16 | // 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(); | |
| 18 | 18 | // Compile the test program with instrumentation |
| 19 | 19 | 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(); | |
| 22 | 28 | // The argument below generates to the expected branch weights |
| 23 | 29 | run("main"); |
| 24 | 30 | llvm_profdata().merge().output("prof_data_dir/merged.profdata").input("prof_data_dir").run(); |
| ... | ... | @@ -28,6 +34,7 @@ fn main() { |
| 28 | 34 | .opt() |
| 29 | 35 | .codegen_units(1) |
| 30 | 36 | .emit("llvm-ir") |
| 37 | .codegen_source_order() | |
| 31 | 38 | .run(); |
| 32 | 39 | llvm_filecheck() |
| 33 | 40 | .patterns("filecheck-patterns.txt") |
tests/run-make/pgo-use/rmake.rs+2| ... | ... | @@ -22,6 +22,7 @@ fn main() { |
| 22 | 22 | .opt_level("2") |
| 23 | 23 | .codegen_units(1) |
| 24 | 24 | .arg("-Cllvm-args=-disable-preinline") |
| 25 | .codegen_source_order() | |
| 25 | 26 | .profile_generate(cwd()) |
| 26 | 27 | .input("main.rs") |
| 27 | 28 | .run(); |
| ... | ... | @@ -40,6 +41,7 @@ fn main() { |
| 40 | 41 | .arg("-Cllvm-args=-disable-preinline") |
| 41 | 42 | .profile_use("merged.profdata") |
| 42 | 43 | .emit("llvm-ir") |
| 44 | .codegen_source_order() | |
| 43 | 45 | .input("main.rs") |
| 44 | 46 | .run(); |
| 45 | 47 | // Check that the generate IR contains some things that we expect. |
tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr+8-8| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo` | |
| 2 | --> $DIR/bad-intrinsic-monomorphization.rs:16:5 | |
| 1 | error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo` | |
| 2 | --> $DIR/bad-intrinsic-monomorphization.rs:26:5 | |
| 3 | 3 | | |
| 4 | LL | intrinsics::cttz(v) | |
| 5 | | ^^^^^^^^^^^^^^^^^^^ | |
| 4 | LL | intrinsics::simd::simd_add(a, b) | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic float type, found `Foo` |
| 8 | 8 | --> $DIR/bad-intrinsic-monomorphization.rs:21:5 |
| ... | ... | @@ -10,11 +10,11 @@ error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic |
| 10 | 10 | LL | intrinsics::fadd_fast(a, b) |
| 11 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | 12 | |
| 13 | error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo` | |
| 14 | --> $DIR/bad-intrinsic-monomorphization.rs:26:5 | |
| 13 | error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo` | |
| 14 | --> $DIR/bad-intrinsic-monomorphization.rs:16:5 | |
| 15 | 15 | | |
| 16 | LL | intrinsics::simd::simd_add(a, b) | |
| 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 16 | LL | intrinsics::cttz(v) | |
| 17 | | ^^^^^^^^^^^^^^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: aborting due to 3 previous errors |
| 20 | 20 |
tests/ui/intrinsics/non-integer-atomic.stderr+44-44| ... | ... | @@ -1,59 +1,53 @@ |
| 1 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `bool` | |
| 2 | --> $DIR/non-integer-atomic.rs:15:5 | |
| 1 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `&dyn Fn()` | |
| 2 | --> $DIR/non-integer-atomic.rs:55:5 | |
| 3 | 3 | | |
| 4 | 4 | LL | intrinsics::atomic_load::<_, { SeqCst }>(p); |
| 5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | 6 | |
| 7 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `bool` | |
| 8 | --> $DIR/non-integer-atomic.rs:20:5 | |
| 7 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `Foo` | |
| 8 | --> $DIR/non-integer-atomic.rs:35:5 | |
| 9 | | | |
| 10 | LL | intrinsics::atomic_load::<_, { SeqCst }>(p); | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `&dyn Fn()` | |
| 14 | --> $DIR/non-integer-atomic.rs:60:5 | |
| 9 | 15 | | |
| 10 | 16 | LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v); |
| 11 | 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | 18 | |
| 13 | error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `bool` | |
| 14 | --> $DIR/non-integer-atomic.rs:25:5 | |
| 19 | error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]` | |
| 20 | --> $DIR/non-integer-atomic.rs:85:5 | |
| 15 | 21 | | |
| 16 | 22 | LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v); |
| 17 | 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | 24 | |
| 19 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `bool` | |
| 20 | --> $DIR/non-integer-atomic.rs:30:5 | |
| 25 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `&dyn Fn()` | |
| 26 | --> $DIR/non-integer-atomic.rs:70:5 | |
| 21 | 27 | | |
| 22 | 28 | LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v); |
| 23 | 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 24 | 30 | |
| 25 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `Foo` | |
| 26 | --> $DIR/non-integer-atomic.rs:35:5 | |
| 27 | | | |
| 28 | LL | intrinsics::atomic_load::<_, { SeqCst }>(p); | |
| 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 30 | ||
| 31 | 31 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `Foo` |
| 32 | 32 | --> $DIR/non-integer-atomic.rs:40:5 |
| 33 | 33 | | |
| 34 | 34 | LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v); |
| 35 | 35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 36 | 36 | |
| 37 | error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `Foo` | |
| 38 | --> $DIR/non-integer-atomic.rs:45:5 | |
| 39 | | | |
| 40 | LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v); | |
| 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 42 | ||
| 43 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `Foo` | |
| 44 | --> $DIR/non-integer-atomic.rs:50:5 | |
| 37 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]` | |
| 38 | --> $DIR/non-integer-atomic.rs:90:5 | |
| 45 | 39 | | |
| 46 | 40 | LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v); |
| 47 | 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 48 | 42 | |
| 49 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `&dyn Fn()` | |
| 50 | --> $DIR/non-integer-atomic.rs:55:5 | |
| 43 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `[u8; 100]` | |
| 44 | --> $DIR/non-integer-atomic.rs:80:5 | |
| 51 | 45 | | |
| 52 | LL | intrinsics::atomic_load::<_, { SeqCst }>(p); | |
| 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 46 | LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v); | |
| 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 54 | 48 | |
| 55 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `&dyn Fn()` | |
| 56 | --> $DIR/non-integer-atomic.rs:60:5 | |
| 49 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `bool` | |
| 50 | --> $DIR/non-integer-atomic.rs:20:5 | |
| 57 | 51 | | |
| 58 | 52 | LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v); |
| 59 | 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -64,36 +58,42 @@ error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basi |
| 64 | 58 | LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v); |
| 65 | 59 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 66 | 60 | |
| 67 | error[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 | | | |
| 70 | LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v); | |
| 71 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 72 | ||
| 73 | 61 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `[u8; 100]` |
| 74 | 62 | --> $DIR/non-integer-atomic.rs:75:5 |
| 75 | 63 | | |
| 76 | 64 | LL | intrinsics::atomic_load::<_, { SeqCst }>(p); |
| 77 | 65 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 78 | 66 | |
| 79 | error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer or pointer type, found `[u8; 100]` | |
| 80 | --> $DIR/non-integer-atomic.rs:80:5 | |
| 67 | error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer or pointer type, found `bool` | |
| 68 | --> $DIR/non-integer-atomic.rs:15:5 | |
| 81 | 69 | | |
| 82 | LL | intrinsics::atomic_store::<_, { SeqCst }>(p, v); | |
| 83 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 70 | LL | intrinsics::atomic_load::<_, { SeqCst }>(p); | |
| 71 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 84 | 72 | |
| 85 | error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]` | |
| 86 | --> $DIR/non-integer-atomic.rs:85:5 | |
| 73 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `bool` | |
| 74 | --> $DIR/non-integer-atomic.rs:30:5 | |
| 87 | 75 | | |
| 88 | LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v); | |
| 89 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 76 | LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v); | |
| 77 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 90 | 78 | |
| 91 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `[u8; 100]` | |
| 92 | --> $DIR/non-integer-atomic.rs:90:5 | |
| 79 | error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer or pointer type, found `Foo` | |
| 80 | --> $DIR/non-integer-atomic.rs:50:5 | |
| 93 | 81 | | |
| 94 | 82 | LL | intrinsics::atomic_cxchg::<_, { SeqCst }, { SeqCst }>(p, v, v); |
| 95 | 83 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 96 | 84 | |
| 85 | error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `Foo` | |
| 86 | --> $DIR/non-integer-atomic.rs:45:5 | |
| 87 | | | |
| 88 | LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v); | |
| 89 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 90 | ||
| 91 | error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer or pointer type, found `bool` | |
| 92 | --> $DIR/non-integer-atomic.rs:25:5 | |
| 93 | | | |
| 94 | LL | intrinsics::atomic_xchg::<_, { SeqCst }>(p, v); | |
| 95 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 96 | ||
| 97 | 97 | error: aborting due to 16 previous errors |
| 98 | 98 | |
| 99 | 99 | For more information about this error, try `rustc --explain E0511`. |