Skip to content

Commit 3735522

Browse files
authored
Merge branch 'model-checking:main' into complete-transmute
2 parents 53aa3dc + 177d0fd commit 3735522

File tree

300 files changed

+8098
-8706
lines changed

Some content is hidden

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

300 files changed

+8098
-8706
lines changed

.github/workflows/flux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
FIXPOINT_VERSION: "556104ba5508891c357b0bdf819ce706e93d9349"
12-
FLUX_VERSION: "f6bdf90c54ad6eed51b25c125f251cac01cfe170"
12+
FLUX_VERSION: "ebafb8d0ca32d8c0fcd2a0cfef6b1b4bd4dc4a6f"
1313

1414
jobs:
1515
check-flux-on-core:

library/Cargo.lock

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/alloc/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ safety = { path = "../contracts/safety" }
2222
[features]
2323
compiler-builtins-mem = ['compiler_builtins/mem']
2424
compiler-builtins-c = ["compiler_builtins/c"]
25-
compiler-builtins-no-asm = ["compiler_builtins/no-asm"]
2625
compiler-builtins-no-f16-f128 = ["compiler_builtins/no-f16-f128"]
27-
compiler-builtins-mangled-names = ["compiler_builtins/mangled-names"]
2826
# Make panics and failed asserts immediately abort without formatting any message
2927
panic_immediate_abort = ["core/panic_immediate_abort"]
3028
# Choose algorithms that are optimized for binary size instead of runtime performance

library/alloc/src/boxed/thin.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use core::error::Error;
66
use core::fmt::{self, Debug, Display, Formatter};
77
#[cfg(not(no_global_oom_handling))]
8-
use core::intrinsics::const_allocate;
8+
use core::intrinsics::{const_allocate, const_make_global};
99
use core::marker::PhantomData;
1010
#[cfg(not(no_global_oom_handling))]
1111
use core::marker::Unsize;
@@ -340,9 +340,10 @@ impl<H> WithHeader<H> {
340340
alloc.add(metadata_offset).cast();
341341
// SAFETY: `*metadata_ptr` is within the allocation.
342342
metadata_ptr.write(ptr::metadata::<Dyn>(ptr::dangling::<T>() as *const Dyn));
343-
343+
// SAFETY: valid heap allocation
344+
const_make_global(alloc);
344345
// SAFETY: we have just written the metadata.
345-
&*(metadata_ptr)
346+
&*metadata_ptr
346347
}
347348
};
348349

library/alloc/src/collections/vec_deque/drain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<T, A: Allocator> Drop for Drain<'_, T, A> {
192192
// this branch is never taken.
193193
// We use `#[cold]` instead of `#[inline(never)]`, because inlining this
194194
// function into the general case (`.drain(n..m)`) is fine.
195-
// See `tests/codegen/vecdeque-drain.rs` for a test.
195+
// See `tests/codegen-llvm/vecdeque-drain.rs` for a test.
196196
#[cold]
197197
fn join_head_and_tail_wrapping<T, A: Allocator>(
198198
source_deque: &mut VecDeque<T, A>,

library/alloc/src/fmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@
348348
//! format := '{' [ argument ] [ ':' format_spec ] [ ws ] * '}'
349349
//! argument := integer | identifier
350350
//!
351-
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision]type
351+
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision][type]
352352
//! fill := character
353353
//! align := '<' | '^' | '>'
354354
//! sign := '+' | '-'
355355
//! width := count
356356
//! precision := count | '*'
357-
//! type := '' | '?' | 'x?' | 'X?' | identifier
357+
//! type := '?' | 'x?' | 'X?' | identifier
358358
//! count := parameter | integer
359359
//! parameter := argument '$'
360360
//! ```

library/alloc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
#![cfg_attr(kani, feature(kani))]
9696
#![feature(alloc_layout_extra)]
9797
#![feature(allocator_api)]
98-
#![feature(array_chunks)]
9998
#![feature(array_into_iter_constructors)]
10099
#![feature(array_windows)]
101100
#![feature(ascii_char)]
@@ -156,6 +155,7 @@
156155
#![feature(try_trait_v2)]
157156
#![feature(try_with_capacity)]
158157
#![feature(tuple_trait)]
158+
#![feature(ub_checks)]
159159
#![feature(unicode_internals)]
160160
#![feature(unsize)]
161161
#![feature(unwrap_infallible)]

library/alloc/src/raw_vec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ impl<A: Allocator> RawVecInner<A> {
761761
}
762762

763763
// not marked inline(never) since we want optimizers to be able to observe the specifics of this
764-
// function, see tests/codegen/vec-reserve-extend.rs.
764+
// function, see tests/codegen-llvm/vec-reserve-extend.rs.
765765
#[cold]
766766
fn finish_grow<A>(
767767
new_layout: Layout,

library/alloc/src/slice.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ use core::cmp::Ordering::{self, Less};
1616
use core::mem::MaybeUninit;
1717
#[cfg(not(no_global_oom_handling))]
1818
use core::ptr;
19-
#[unstable(feature = "array_chunks", issue = "74985")]
20-
pub use core::slice::ArrayChunks;
21-
#[unstable(feature = "array_chunks", issue = "74985")]
22-
pub use core::slice::ArrayChunksMut;
2319
#[unstable(feature = "array_windows", issue = "75027")]
2420
pub use core::slice::ArrayWindows;
2521
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]

library/alloc/src/string.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -787,12 +787,12 @@ impl String {
787787
#[cfg(not(no_global_oom_handling))]
788788
#[unstable(feature = "str_from_utf16_endian", issue = "116258")]
789789
pub fn from_utf16le(v: &[u8]) -> Result<String, FromUtf16Error> {
790-
if v.len() % 2 != 0 {
790+
let (chunks, []) = v.as_chunks::<2>() else {
791791
return Err(FromUtf16Error(()));
792-
}
792+
};
793793
match (cfg!(target_endian = "little"), unsafe { v.align_to::<u16>() }) {
794794
(true, ([], v, [])) => Self::from_utf16(v),
795-
_ => char::decode_utf16(v.array_chunks::<2>().copied().map(u16::from_le_bytes))
795+
_ => char::decode_utf16(chunks.iter().copied().map(u16::from_le_bytes))
796796
.collect::<Result<_, _>>()
797797
.map_err(|_| FromUtf16Error(())),
798798
}
@@ -830,11 +830,11 @@ impl String {
830830
(true, ([], v, [])) => Self::from_utf16_lossy(v),
831831
(true, ([], v, [_remainder])) => Self::from_utf16_lossy(v) + "\u{FFFD}",
832832
_ => {
833-
let mut iter = v.array_chunks::<2>();
834-
let string = char::decode_utf16(iter.by_ref().copied().map(u16::from_le_bytes))
833+
let (chunks, remainder) = v.as_chunks::<2>();
834+
let string = char::decode_utf16(chunks.iter().copied().map(u16::from_le_bytes))
835835
.map(|r| r.unwrap_or(char::REPLACEMENT_CHARACTER))
836836
.collect();
837-
if iter.remainder().is_empty() { string } else { string + "\u{FFFD}" }
837+
if remainder.is_empty() { string } else { string + "\u{FFFD}" }
838838
}
839839
}
840840
}
@@ -862,12 +862,12 @@ impl String {
862862
#[cfg(not(no_global_oom_handling))]
863863
#[unstable(feature = "str_from_utf16_endian", issue = "116258")]
864864
pub fn from_utf16be(v: &[u8]) -> Result<String, FromUtf16Error> {
865-
if v.len() % 2 != 0 {
865+
let (chunks, []) = v.as_chunks::<2>() else {
866866
return Err(FromUtf16Error(()));
867-
}
867+
};
868868
match (cfg!(target_endian = "big"), unsafe { v.align_to::<u16>() }) {
869869
(true, ([], v, [])) => Self::from_utf16(v),
870-
_ => char::decode_utf16(v.array_chunks::<2>().copied().map(u16::from_be_bytes))
870+
_ => char::decode_utf16(chunks.iter().copied().map(u16::from_be_bytes))
871871
.collect::<Result<_, _>>()
872872
.map_err(|_| FromUtf16Error(())),
873873
}
@@ -905,11 +905,11 @@ impl String {
905905
(true, ([], v, [])) => Self::from_utf16_lossy(v),
906906
(true, ([], v, [_remainder])) => Self::from_utf16_lossy(v) + "\u{FFFD}",
907907
_ => {
908-
let mut iter = v.array_chunks::<2>();
909-
let string = char::decode_utf16(iter.by_ref().copied().map(u16::from_be_bytes))
908+
let (chunks, remainder) = v.as_chunks::<2>();
909+
let string = char::decode_utf16(chunks.iter().copied().map(u16::from_be_bytes))
910910
.map(|r| r.unwrap_or(char::REPLACEMENT_CHARACTER))
911911
.collect();
912-
if iter.remainder().is_empty() { string } else { string + "\u{FFFD}" }
912+
if remainder.is_empty() { string } else { string + "\u{FFFD}" }
913913
}
914914
}
915915
}
@@ -2611,7 +2611,7 @@ impl_eq! { Cow<'a, str>, &'b str }
26112611
impl_eq! { Cow<'a, str>, String }
26122612

26132613
#[stable(feature = "rust1", since = "1.0.0")]
2614-
#[rustc_const_unstable(feature = "const_default", issue = "67792")]
2614+
#[rustc_const_unstable(feature = "const_default", issue = "143894")]
26152615
impl const Default for String {
26162616
/// Creates an empty `String`.
26172617
#[inline]

0 commit comments

Comments
 (0)