Skip to content

Commit e96cfa9

Browse files
committed
Auto merge of #3652 - rust-lang:rustup-2024-06-07, r=RalfJung
Automatic Rustup
2 parents bbe8108 + eaf6f42 commit e96cfa9

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a330e49593ee890f9197727a3a558b6e6b37f843
1+
76e7a0849c07d73e4d9afde8036ee8c450127cc8

src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn try_resolve_did(tcx: TyCtxt<'_>, path: &[&str], namespace: Option<Namespace>)
126126
// the one in the sysroot and the one locally built by `cargo test`.)
127127
// FIXME: can we prefer the one from the sysroot?
128128
'crates: for krate in
129-
tcx.used_crates(()).iter().filter(|&&krate| tcx.crate_name(krate).as_str() == crate_name)
129+
tcx.crates(()).iter().filter(|&&krate| tcx.crate_name(krate).as_str() == crate_name)
130130
{
131131
let mut cur_item = DefId { krate: *krate, index: CRATE_DEF_INDEX };
132132
// Go over the modules.
@@ -1354,7 +1354,7 @@ pub fn get_local_crates(tcx: TyCtxt<'_>) -> Vec<CrateNum> {
13541354
.map(|crates| crates.split(',').map(|krate| krate.to_string()).collect::<Vec<_>>())
13551355
.unwrap_or_default();
13561356
let mut local_crates = Vec::new();
1357-
for &crate_num in tcx.crates_including_speculative(()) {
1357+
for &crate_num in tcx.crates(()) {
13581358
let name = tcx.crate_name(crate_num);
13591359
let name = name.as_str();
13601360
if local_crate_names.iter().any(|local_name| local_name == name) {

src/intrinsics/simd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
590590
.expect_const()
591591
.eval(*this.tcx, this.param_env(), this.tcx.span)
592592
.unwrap()
593+
.1
593594
.unwrap_branch();
594595
let index_len = index.len();
595596

tests/pass/function_calls/abi_compat.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,24 @@ fn main() {
8383
test_abi_compat(main as fn(), id::<i32> as fn(i32) -> i32);
8484
// - 1-ZST
8585
test_abi_compat((), [0u8; 0]);
86-
// - Guaranteed null-pointer-optimizations (RFC 3391).
86+
// - Guaranteed Option<X> null-pointer-optimizations (RFC 3391).
8787
test_abi_compat(&0u32 as *const u32, Some(&0u32));
8888
test_abi_compat(main as fn(), Some(main as fn()));
8989
test_abi_compat(0u32, Some(num::NonZero::new(1u32).unwrap()));
9090
test_abi_compat(&0u32 as *const u32, Some(Wrapper(&0u32)));
91-
test_abi_compat(0u32, Some(Wrapper(num::NonZero::new(1u32).unwrap())));
91+
test_abi_compat(0u32, Some(Wrapper(num::NonZeroU32::new(1u32).unwrap())));
92+
// - Guaranteed Result<X, ZST1> does the same as Option<X> (RFC 3391)
93+
test_abi_compat(&0u32 as *const u32, Result::<_, ()>::Ok(&0u32));
94+
test_abi_compat(main as fn(), Result::<_, ()>::Ok(main as fn()));
95+
test_abi_compat(0u32, Result::<_, ()>::Ok(num::NonZeroU32::new(1).unwrap()));
96+
test_abi_compat(&0u32 as *const u32, Result::<_, ()>::Ok(Wrapper(&0u32)));
97+
test_abi_compat(0u32, Result::<_, ()>::Ok(Wrapper(num::NonZeroU32::new(1).unwrap())));
98+
// - Guaranteed Result<ZST1, X> also does the same as Option<X> (RFC 3391)
99+
test_abi_compat(&0u32 as *const u32, Result::<(), _>::Err(&0u32));
100+
test_abi_compat(main as fn(), Result::<(), _>::Err(main as fn()));
101+
test_abi_compat(0u32, Result::<(), _>::Err(num::NonZeroU32::new(1).unwrap()));
102+
test_abi_compat(&0u32 as *const u32, Result::<(), _>::Err(Wrapper(&0u32)));
103+
test_abi_compat(0u32, Result::<(), _>::Err(Wrapper(num::NonZeroU32::new(1).unwrap())));
92104

93105
// These must work for *any* type, since we guarantee that `repr(transparent)` is ABI-compatible
94106
// with the wrapped field.

0 commit comments

Comments
 (0)