mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-01 12:37:37 +00:00

This greatly reduces the number of places that actually use the `rustc_layout_scalar_valid_range_*` attributes down to just 3: ``` library/core\src\ptr\non_null.rs 68:#[rustc_layout_scalar_valid_range_start(1)] library/core\src\num\niche_types.rs 19: #[rustc_layout_scalar_valid_range_start($low)] 20: #[rustc_layout_scalar_valid_range_end($high)] ``` Everything else -- PAL Nanoseconds, alloc's `Cap`, niched FDs, etc -- all just wrap those `niche_types` types.
28 lines
583 B
Rust
28 lines
583 B
Rust
//@ revisions: llvm-pre-19 llvm-19
|
|
//@ [llvm-19] min-llvm-version: 19
|
|
//@ [llvm-pre-19] max-llvm-major-version: 18
|
|
//@ compile-flags: -O
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#[no_mangle]
|
|
// CHECK-LABEL: @noop(
|
|
pub fn noop(v: &mut Vec<u8>) {
|
|
// CHECK-NOT: grow_one
|
|
// CHECK-NOT: call
|
|
// CHECK: tail call void @llvm.assume
|
|
// CHECK-NOT: grow_one
|
|
// CHECK-NOT: call
|
|
// CHECK: {{ret|[}]}}
|
|
if let Some(x) = v.pop() {
|
|
v.push(x)
|
|
}
|
|
}
|
|
|
|
#[no_mangle]
|
|
// CHECK-LABEL: @push_byte(
|
|
pub fn push_byte(v: &mut Vec<u8>) {
|
|
// CHECK: call {{.*}}grow_one
|
|
v.push(3);
|
|
}
|