Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #137545

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
65a5d8b
Update string.rs
robertbastian Feb 9, 2025
097d642
configure.py: don't instruct user to run nonexistent program
nabijaczleweli Feb 23, 2025
5a58a92
remove uses of rustc_intrinsic_must_be_overridden from standard library
RalfJung Feb 23, 2025
6eea027
remove support for rustc_intrinsic_must_be_overridden from the compiler
RalfJung Feb 23, 2025
68543ab
remove some unnecessary rustc_const_unstable
RalfJung Feb 24, 2025
78c1c2e
Create the `OptimizedDist` tool with a macro
Kobzol Feb 21, 2025
0257b1d
Allow specifying that tools build a library, not a binary
Kobzol Feb 21, 2025
2ab6e60
Implement `RunMakeSupport` tool using the `bootstrap_tool!` macro
Kobzol Feb 21, 2025
106a3e7
Implement `RunMake` test suite using the `test!` macro
Kobzol Feb 21, 2025
79331b2
Compile run-make recipes using the stage0 compiler
Kobzol Feb 24, 2025
562880c
Update string.rs
robertbastian Feb 24, 2025
91d0494
Update comment in compiletest
Kobzol Feb 24, 2025
6b2f5cf
Update browser-ui-test version to `0.20.3`
GuillaumeGomez Feb 24, 2025
264f2c6
DWARF mixed versions with LTO on MIPS
LukasWoodtli Feb 24, 2025
b189cb9
Update stdarch
nikic Feb 24, 2025
592028a
Add rustdoc-gui regression test for #137082
GuillaumeGomez Feb 24, 2025
9c65672
std: Fix another new symlink test on Windows
petrochenkov Feb 24, 2025
76cf9e6
Rollup merge of #136775 - robertbastian:patch-2, r=Amanieu
GuillaumeGomez Feb 24, 2025
944194a
Rollup merge of #137373 - Kobzol:tool-stage0-improve, r=jieyouxu
GuillaumeGomez Feb 24, 2025
dacdf7b
Rollup merge of #137489 - RalfJung:no-more-rustc_intrinsic_must_be_ov…
GuillaumeGomez Feb 24, 2025
d190058
Rollup merge of #137493 - nabijaczleweli:python3, r=Kobzol
GuillaumeGomez Feb 24, 2025
04662dd
Rollup merge of #137516 - RalfJung:rustc_const_unstable-cleanup, r=Am…
GuillaumeGomez Feb 24, 2025
7e51258
Rollup merge of #137527 - nikic:update-stdarch, r=Amanieu
GuillaumeGomez Feb 24, 2025
ae42325
Rollup merge of #137530 - LukasWoodtli:gardena/lw/mips_dwarf, r=jieyouxu
GuillaumeGomez Feb 24, 2025
82ee023
Rollup merge of #137539 - GuillaumeGomez:copy-content-tests, r=notriddle
GuillaumeGomez Feb 24, 2025
892c26a
Rollup merge of #137543 - petrochenkov:wintest, r=ChrisDenton
GuillaumeGomez Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 13 additions & 52 deletions compiler/rustc_codegen_cranelift/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,70 +620,31 @@ pub union MaybeUninit<T> {

pub mod intrinsics {
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn size_of<T>() -> usize {
loop {}
}
pub fn size_of<T>() -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize {
loop {}
}
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn min_align_of<T>() -> usize {
loop {}
}
pub fn min_align_of<T>() -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize {
loop {}
}
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize) {
loop {}
}
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize);
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn transmute<T, U>(_e: T) -> U {
loop {}
}
pub unsafe fn transmute<T, U>(_e: T) -> U;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32 {
loop {}
}
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn needs_drop<T: ?::Sized>() -> bool {
loop {}
}
pub fn needs_drop<T: ?::Sized>() -> bool;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn bitreverse<T>(_x: T) -> T {
loop {}
}
pub fn bitreverse<T>(_x: T) -> T;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn bswap<T>(_x: T) -> T {
loop {}
}
pub fn bswap<T>(_x: T) -> T;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize) {
loop {}
}
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize);
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn unreachable() -> ! {
loop {}
}
pub unsafe fn unreachable() -> !;
}

pub mod libc {
Expand Down
65 changes: 13 additions & 52 deletions compiler/rustc_codegen_gcc/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,70 +591,31 @@ pub union MaybeUninit<T> {

pub mod intrinsics {
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn size_of<T>() -> usize {
loop {}
}
pub fn size_of<T>() -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize {
loop {}
}
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn min_align_of<T>() -> usize {
loop {}
}
pub fn min_align_of<T>() -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize {
loop {}
}
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize) {
loop {}
}
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize);
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn transmute<T, U>(_e: T) -> U {
loop {}
}
pub unsafe fn transmute<T, U>(_e: T) -> U;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32 {
loop {}
}
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn needs_drop<T: ?::Sized>() -> bool {
loop {}
}
pub fn needs_drop<T: ?::Sized>() -> bool;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn bitreverse<T>(_x: T) -> T {
loop {}
}
pub fn bitreverse<T>(_x: T) -> T;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn bswap<T>(_x: T) -> T {
loop {}
}
pub fn bswap<T>(_x: T) -> T;
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize) {
loop {}
}
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize);
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub unsafe fn unreachable() -> ! {
loop {}
}
pub unsafe fn unreachable() -> !;
}

pub mod libc {
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/abort1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ mod intrinsics {

#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
}

/*
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/abort2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ mod intrinsics {

#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
}

/*
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ mod libc {
mod intrinsics {
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
}

#[lang = "panic"]
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/mut_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ mod libc {
mod intrinsics {
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
}

#[lang = "panic"]
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ mod libc {
mod intrinsics {
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
}

#[lang = "panic"]
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ mod intrinsics {

#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub fn abort() -> ! {
loop {}
}
pub fn abort() -> !;
}

mod libc {
Expand Down
14 changes: 3 additions & 11 deletions compiler/rustc_error_codes/src/error_codes/E0094.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ Erroneous code example:
#![allow(internal_features)]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
fn size_of<T, U>() -> usize // error: intrinsic has wrong number
// of type parameters
{
loop {}
}
fn size_of<T, U>() -> usize; // error: intrinsic has wrong number
// of type parameters
```

Please check that you provided the right number of type parameters
Expand All @@ -24,9 +20,5 @@ Example:
#![allow(internal_features)]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
fn size_of<T>() -> usize // ok!
{
loop {}
}
fn size_of<T>() -> usize; // ok!
```
4 changes: 0 additions & 4 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
rustc_intrinsic, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes, intrinsics,
"the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items",
),
gated!(
rustc_intrinsic_must_be_overridden, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes, intrinsics,
"the `#[rustc_intrinsic_must_be_overridden]` attribute is used to declare intrinsics without real bodies",
),
rustc_attr!(
rustc_no_mir_inline, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes,
"#[rustc_no_mir_inline] prevents the MIR inliner from inlining a function while not affecting codegen"
Expand Down
13 changes: 6 additions & 7 deletions compiler/rustc_middle/src/ty/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1755,13 +1755,12 @@ pub fn intrinsic_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::Intrinsi
&& (matches!(tcx.fn_sig(def_id).skip_binder().abi(), ExternAbi::RustIntrinsic)
|| tcx.has_attr(def_id, sym::rustc_intrinsic))
{
let must_be_overridden = tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden)
|| match tcx.hir_node_by_def_id(def_id) {
hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { has_body, .. }, .. }) => {
!has_body
}
_ => true,
};
let must_be_overridden = match tcx.hir_node_by_def_id(def_id) {
hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { has_body, .. }, .. }) => {
!has_body
}
_ => true,
};
Some(ty::IntrinsicDef {
name: tcx.item_name(def_id.into()),
must_be_overridden,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,6 @@ symbols! {
rustc_insignificant_dtor,
rustc_intrinsic,
rustc_intrinsic_const_stable_indirect,
rustc_intrinsic_must_be_overridden,
rustc_layout,
rustc_layout_scalar_valid_range_end,
rustc_layout_scalar_valid_range_start,
Expand Down
5 changes: 1 addition & 4 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,8 @@ pub struct Box<
///
/// This is the surface syntax for `box <expr>` expressions.
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
#[unstable(feature = "liballoc_internals", issue = "none")]
pub fn box_new<T>(_x: T) -> Box<T> {
unreachable!()
}
pub fn box_new<T>(_x: T) -> Box<T>;

impl<T> Box<T> {
/// Allocates memory on the heap and then places `x` into it.
Expand Down
7 changes: 2 additions & 5 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,8 @@ impl String {
/// This is highly unsafe, due to the number of invariants that aren't
/// checked:
///
/// * The memory at `buf` needs to have been previously allocated by the
/// same allocator the standard library uses, with a required alignment of exactly 1.
/// * `length` needs to be less than or equal to `capacity`.
/// * `capacity` needs to be the correct value.
/// * The first `length` bytes at `buf` need to be valid UTF-8.
/// * all safety requirements for [`Vec::<u8>::from_raw_parts`].
/// * all safety requirements for [`String::from_utf8_unchecked`].
///
/// Violating these may cause problems like corrupting the allocator's
/// internal data structures. For example, it is normally **not** safe to
Expand Down
2 changes: 2 additions & 0 deletions library/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ check-cfg = [
'cfg(bootstrap)',
'cfg(no_fp_fmt_parse)',
'cfg(stdarch_intel_sde)',
# #[cfg(bootstrap)]
'cfg(target_feature, values("vector-enhancements-1"))',
# core use #[path] imports to portable-simd `core_simd` crate
# and to stdarch `core_arch` crate which messes-up with Cargo list
# of declared features, we therefor expect any feature cfg
Expand Down
15 changes: 3 additions & 12 deletions library/core/src/ffi/va_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,25 +305,16 @@ impl<'f> Drop for VaListImpl<'f> {
/// Destroy the arglist `ap` after initialization with `va_start` or
/// `va_copy`.
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
#[rustc_nounwind]
unsafe fn va_end(_ap: &mut VaListImpl<'_>) {
unreachable!()
}
unsafe fn va_end(_ap: &mut VaListImpl<'_>);

/// Copies the current location of arglist `src` to the arglist `dst`.
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
#[rustc_nounwind]
unsafe fn va_copy<'f>(_dest: *mut VaListImpl<'f>, _src: &VaListImpl<'f>) {
unreachable!()
}
unsafe fn va_copy<'f>(_dest: *mut VaListImpl<'f>, _src: &VaListImpl<'f>);

/// Loads an argument of type `T` from the `va_list` `ap` and increment the
/// argument `ap` points to.
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
#[rustc_nounwind]
unsafe fn va_arg<T: sealed_trait::VaArgSafe>(_ap: &mut VaListImpl<'_>) -> T {
unreachable!()
}
unsafe fn va_arg<T: sealed_trait::VaArgSafe>(_ap: &mut VaListImpl<'_>) -> T;
Loading
Loading