Skip to content

Commit

Permalink
Unrolled build for rust-lang#135333
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#135333 - vayunbiyani:test-environment, r=RalfJung

Partial progress on rust-lang#132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase

Part of rust-lang#132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro

- Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro.
- Skipped `.md` files and test files to avoid unnecessary changes.
  • Loading branch information
rust-timer authored Jan 20, 2025
2 parents 9f4d9dc + c79fc90 commit dde7f13
Show file tree
Hide file tree
Showing 29 changed files with 61 additions and 85 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Codegen of intrinsics. This includes `extern "rust-intrinsic"`,
//! functions marked with the `#[rustc_intrinsic]` attribute
//! and LLVM intrinsics that have symbol names starting with `llvm.`.
macro_rules! intrinsic_args {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/copy_overlapping.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
}
#[rustc_intrinsic]
unsafe fn copy_nonoverlapping<T>(_src: *const T, _dst: *mut T, _count: usize);

fn main() {
let mut data = [0u8; 16];
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/copy_unaligned.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
}
#[rustc_intrinsic]
unsafe fn copy_nonoverlapping<T>(_src: *const T, _dst: *mut T, _count: usize);

fn main() {
let mut data = [0u16; 8];
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

mod rusti {
extern "rust-intrinsic" {
pub fn ctlz_nonzero<T>(x: T) -> u32;
}
#[rustc_intrinsic]
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
}

pub fn main() {
Expand Down
6 changes: 3 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/cttz_nonzero.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

#![feature(intrinsics)]

mod rusti {
extern "rust-intrinsic" {
pub fn cttz_nonzero<T>(x: T) -> u32;
}
#[rustc_intrinsic]
pub unsafe fn cttz_nonzero<T>(_x: T) -> u32;
}

pub fn main() {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;


fn main() {
unsafe {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;


fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
5 changes: 2 additions & 3 deletions src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(intrinsics)]

// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
}
#[rustc_intrinsic]
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;

fn main() {
unsafe {
Expand Down
7 changes: 3 additions & 4 deletions src/tools/miri/tests/pass/intrinsics/portable-simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ use std::ptr;
use std::simd::StdFloat;
use std::simd::prelude::*;

extern "rust-intrinsic" {
#[rustc_nounwind]
pub fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
}
#[rustc_intrinsic]
#[rustc_nounwind]
pub unsafe fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(_x: T, _y: T) -> U;

fn simd_ops_f32() {
let a = f32x4::splat(10.0);
Expand Down

0 comments on commit dde7f13

Please sign in to comment.