summaryrefslogtreecommitdiffstats
path: root/library/core/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /library/core/src/lib.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/core/src/lib.rs')
-rw-r--r--library/core/src/lib.rs31
1 files changed, 21 insertions, 10 deletions
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index a2729b374..8b15e8269 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -20,11 +20,19 @@
// FIXME: Fill me in with more detail when the interface settles
//! This library is built on the assumption of a few existing symbols:
//!
-//! * `memcpy`, `memcmp`, `memset`, `strlen` - These are core memory routines which are
-//! often generated by LLVM. Additionally, this library can make explicit
-//! calls to these functions. Their signatures are the same as found in C.
-//! These functions are often provided by the system libc, but can also be
-//! provided by the [compiler-builtins crate](https://crates.io/crates/compiler_builtins).
+//! * `memcpy`, `memmove`, `memset`, `memcmp`, `bcmp`, `strlen` - These are core memory routines
+//! which are generated by Rust codegen backends. Additionally, this library can make explicit
+//! calls to `strlen`. Their signatures are the same as found in C, but there are extra
+//! assumptions about their semantics: For `memcpy`, `memmove`, `memset`, `memcmp`, and `bcmp`, if
+//! the `n` parameter is 0, the function is assumed to not be UB. Furthermore, for `memcpy`, if
+//! source and target pointer are equal, the function is assumed to not be UB.
+//! (Note that these are [standard assumptions](https://reviews.llvm.org/D86993) among compilers.)
+//! These functions are often provided by the system libc, but can also be provided by the
+//! [compiler-builtins crate](https://crates.io/crates/compiler_builtins).
+//! Note that the library does not guarantee that it will always make these assumptions, so Rust
+//! user code directly calling the C functions should follow the C specification! The advice for
+//! Rust user code is to call the functions provided by this library instead (such as
+//! `ptr::copy`).
//!
//! * `rust_begin_panic` - This function takes four arguments, a
//! `fmt::Arguments`, a `&'static str`, and two `u32`'s. These four arguments
@@ -96,12 +104,14 @@
#![allow(explicit_outlives_requirements)]
#![allow(incomplete_features)]
#![warn(multiple_supertrait_upcastable)]
-#![cfg_attr(not(bootstrap), allow(internal_features))]
+#![allow(internal_features)]
// Do not check link redundancy on bootstraping phase
-#![cfg_attr(not(bootstrap), allow(rustdoc::redundant_explicit_links))]
+#![allow(rustdoc::redundant_explicit_links)]
//
// Library features:
// tidy-alphabetical-start
+#![cfg_attr(bootstrap, feature(no_coverage))] // rust-lang/rust#84605
+#![cfg_attr(not(bootstrap), feature(coverage_attribute))] // rust-lang/rust#84605
#![feature(char_indices_offset)]
#![feature(const_align_of_val)]
#![feature(const_align_of_val_raw)]
@@ -152,12 +162,10 @@
#![feature(const_slice_from_raw_parts_mut)]
#![feature(const_slice_from_ref)]
#![feature(const_slice_index)]
-#![feature(const_slice_is_ascii)]
#![feature(const_slice_ptr_len)]
#![feature(const_slice_split_at_mut)]
#![feature(const_str_from_utf8_unchecked_mut)]
#![feature(const_swap)]
-#![feature(const_transmute_copy)]
#![feature(const_try)]
#![feature(const_type_id)]
#![feature(const_type_name)]
@@ -170,6 +178,7 @@
#![feature(ip)]
#![feature(ip_bits)]
#![feature(is_ascii_octdigit)]
+#![feature(isqrt)]
#![feature(maybe_uninit_uninit_array)]
#![feature(ptr_alignment_type)]
#![feature(ptr_metadata)]
@@ -228,7 +237,6 @@
#![feature(negative_impls)]
#![feature(never_type)]
#![feature(no_core)]
-#![feature(no_coverage)] // rust-lang/rust#84605
#![feature(platform_intrinsics)]
#![feature(prelude_import)]
#![feature(repr_simd)]
@@ -282,6 +290,9 @@ pub mod assert_matches {
pub use crate::macros::{assert_matches, debug_assert_matches};
}
+#[unstable(feature = "cfg_match", issue = "115585")]
+pub use crate::macros::cfg_match;
+
#[macro_use]
mod internal_macros;