Skip to content

Commit 771f3a0

Browse files
committed
Auto merge of rust-lang#137545 - GuillaumeGomez:rollup-ss95p06, r=GuillaumeGomez
Rollup of 9 pull requests Successful merges: - rust-lang#136775 (Update `String::from_raw_parts` safety requirements) - rust-lang#137373 (Compile run-make-support and run-make tests with the bootstrap compiler) - rust-lang#137489 (remove `#[rustc_intrinsic_must_be_overridde]`) - rust-lang#137493 (configure.py: don't instruct user to run nonexistent program) - rust-lang#137516 (remove some unnecessary rustc_const_unstable) - rust-lang#137527 (Update stdarch) - rust-lang#137530 (DWARF mixed versions with LTO on MIPS) - rust-lang#137539 ( Add rustdoc-gui regression test for rust-lang#137082 ) - rust-lang#137543 (std: Fix another new symlink test on Windows) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 617aad8 + 892c26a commit 771f3a0

File tree

50 files changed

+555
-1906
lines changed

Some content is hidden

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

50 files changed

+555
-1906
lines changed

compiler/rustc_codegen_cranelift/example/mini_core.rs

+13-52
Original file line numberDiff line numberDiff line change
@@ -620,70 +620,31 @@ pub union MaybeUninit<T> {
620620

621621
pub mod intrinsics {
622622
#[rustc_intrinsic]
623-
#[rustc_intrinsic_must_be_overridden]
624-
pub fn abort() -> ! {
625-
loop {}
626-
}
623+
pub fn abort() -> !;
627624
#[rustc_intrinsic]
628-
#[rustc_intrinsic_must_be_overridden]
629-
pub fn size_of<T>() -> usize {
630-
loop {}
631-
}
625+
pub fn size_of<T>() -> usize;
632626
#[rustc_intrinsic]
633-
#[rustc_intrinsic_must_be_overridden]
634-
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize {
635-
loop {}
636-
}
627+
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize;
637628
#[rustc_intrinsic]
638-
#[rustc_intrinsic_must_be_overridden]
639-
pub fn min_align_of<T>() -> usize {
640-
loop {}
641-
}
629+
pub fn min_align_of<T>() -> usize;
642630
#[rustc_intrinsic]
643-
#[rustc_intrinsic_must_be_overridden]
644-
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize {
645-
loop {}
646-
}
631+
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize;
647632
#[rustc_intrinsic]
648-
#[rustc_intrinsic_must_be_overridden]
649-
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize) {
650-
loop {}
651-
}
633+
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize);
652634
#[rustc_intrinsic]
653-
#[rustc_intrinsic_must_be_overridden]
654-
pub unsafe fn transmute<T, U>(_e: T) -> U {
655-
loop {}
656-
}
635+
pub unsafe fn transmute<T, U>(_e: T) -> U;
657636
#[rustc_intrinsic]
658-
#[rustc_intrinsic_must_be_overridden]
659-
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32 {
660-
loop {}
661-
}
637+
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
662638
#[rustc_intrinsic]
663-
#[rustc_intrinsic_must_be_overridden]
664-
pub fn needs_drop<T: ?::Sized>() -> bool {
665-
loop {}
666-
}
639+
pub fn needs_drop<T: ?::Sized>() -> bool;
667640
#[rustc_intrinsic]
668-
#[rustc_intrinsic_must_be_overridden]
669-
pub fn bitreverse<T>(_x: T) -> T {
670-
loop {}
671-
}
641+
pub fn bitreverse<T>(_x: T) -> T;
672642
#[rustc_intrinsic]
673-
#[rustc_intrinsic_must_be_overridden]
674-
pub fn bswap<T>(_x: T) -> T {
675-
loop {}
676-
}
643+
pub fn bswap<T>(_x: T) -> T;
677644
#[rustc_intrinsic]
678-
#[rustc_intrinsic_must_be_overridden]
679-
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize) {
680-
loop {}
681-
}
645+
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize);
682646
#[rustc_intrinsic]
683-
#[rustc_intrinsic_must_be_overridden]
684-
pub unsafe fn unreachable() -> ! {
685-
loop {}
686-
}
647+
pub unsafe fn unreachable() -> !;
687648
}
688649

689650
pub mod libc {

compiler/rustc_codegen_gcc/example/mini_core.rs

+13-52
Original file line numberDiff line numberDiff line change
@@ -591,70 +591,31 @@ pub union MaybeUninit<T> {
591591

592592
pub mod intrinsics {
593593
#[rustc_intrinsic]
594-
#[rustc_intrinsic_must_be_overridden]
595-
pub fn abort() -> ! {
596-
loop {}
597-
}
594+
pub fn abort() -> !;
598595
#[rustc_intrinsic]
599-
#[rustc_intrinsic_must_be_overridden]
600-
pub fn size_of<T>() -> usize {
601-
loop {}
602-
}
596+
pub fn size_of<T>() -> usize;
603597
#[rustc_intrinsic]
604-
#[rustc_intrinsic_must_be_overridden]
605-
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize {
606-
loop {}
607-
}
598+
pub unsafe fn size_of_val<T: ?::Sized>(_val: *const T) -> usize;
608599
#[rustc_intrinsic]
609-
#[rustc_intrinsic_must_be_overridden]
610-
pub fn min_align_of<T>() -> usize {
611-
loop {}
612-
}
600+
pub fn min_align_of<T>() -> usize;
613601
#[rustc_intrinsic]
614-
#[rustc_intrinsic_must_be_overridden]
615-
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize {
616-
loop {}
617-
}
602+
pub unsafe fn min_align_of_val<T: ?::Sized>(_val: *const T) -> usize;
618603
#[rustc_intrinsic]
619-
#[rustc_intrinsic_must_be_overridden]
620-
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize) {
621-
loop {}
622-
}
604+
pub unsafe fn copy<T>(_src: *const T, _dst: *mut T, _count: usize);
623605
#[rustc_intrinsic]
624-
#[rustc_intrinsic_must_be_overridden]
625-
pub unsafe fn transmute<T, U>(_e: T) -> U {
626-
loop {}
627-
}
606+
pub unsafe fn transmute<T, U>(_e: T) -> U;
628607
#[rustc_intrinsic]
629-
#[rustc_intrinsic_must_be_overridden]
630-
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32 {
631-
loop {}
632-
}
608+
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
633609
#[rustc_intrinsic]
634-
#[rustc_intrinsic_must_be_overridden]
635-
pub fn needs_drop<T: ?::Sized>() -> bool {
636-
loop {}
637-
}
610+
pub fn needs_drop<T: ?::Sized>() -> bool;
638611
#[rustc_intrinsic]
639-
#[rustc_intrinsic_must_be_overridden]
640-
pub fn bitreverse<T>(_x: T) -> T {
641-
loop {}
642-
}
612+
pub fn bitreverse<T>(_x: T) -> T;
643613
#[rustc_intrinsic]
644-
#[rustc_intrinsic_must_be_overridden]
645-
pub fn bswap<T>(_x: T) -> T {
646-
loop {}
647-
}
614+
pub fn bswap<T>(_x: T) -> T;
648615
#[rustc_intrinsic]
649-
#[rustc_intrinsic_must_be_overridden]
650-
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize) {
651-
loop {}
652-
}
616+
pub unsafe fn write_bytes<T>(_dst: *mut T, _val: u8, _count: usize);
653617
#[rustc_intrinsic]
654-
#[rustc_intrinsic_must_be_overridden]
655-
pub unsafe fn unreachable() -> ! {
656-
loop {}
657-
}
618+
pub unsafe fn unreachable() -> !;
658619
}
659620

660621
pub mod libc {

compiler/rustc_codegen_gcc/tests/run/abort1.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ mod intrinsics {
3636

3737
#[rustc_nounwind]
3838
#[rustc_intrinsic]
39-
#[rustc_intrinsic_must_be_overridden]
40-
pub fn abort() -> ! {
41-
loop {}
42-
}
39+
pub fn abort() -> !;
4340
}
4441

4542
/*

compiler/rustc_codegen_gcc/tests/run/abort2.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ mod intrinsics {
3636

3737
#[rustc_nounwind]
3838
#[rustc_intrinsic]
39-
#[rustc_intrinsic_must_be_overridden]
40-
pub fn abort() -> ! {
41-
loop {}
42-
}
39+
pub fn abort() -> !;
4340
}
4441

4542
/*

compiler/rustc_codegen_gcc/tests/run/assign.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ mod libc {
5959
mod intrinsics {
6060
#[rustc_nounwind]
6161
#[rustc_intrinsic]
62-
#[rustc_intrinsic_must_be_overridden]
63-
pub fn abort() -> ! {
64-
loop {}
65-
}
62+
pub fn abort() -> !;
6663
}
6764

6865
#[lang = "panic"]

compiler/rustc_codegen_gcc/tests/run/mut_ref.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ mod libc {
6161
mod intrinsics {
6262
#[rustc_nounwind]
6363
#[rustc_intrinsic]
64-
#[rustc_intrinsic_must_be_overridden]
65-
pub fn abort() -> ! {
66-
loop {}
67-
}
64+
pub fn abort() -> !;
6865
}
6966

7067
#[lang = "panic"]

compiler/rustc_codegen_gcc/tests/run/operations.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ mod libc {
6767
mod intrinsics {
6868
#[rustc_nounwind]
6969
#[rustc_intrinsic]
70-
#[rustc_intrinsic_must_be_overridden]
71-
pub fn abort() -> ! {
72-
loop {}
73-
}
70+
pub fn abort() -> !;
7471
}
7572

7673
#[lang = "panic"]

compiler/rustc_codegen_gcc/tests/run/static.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ mod intrinsics {
4949

5050
#[rustc_nounwind]
5151
#[rustc_intrinsic]
52-
#[rustc_intrinsic_must_be_overridden]
53-
pub fn abort() -> ! {
54-
loop {}
55-
}
52+
pub fn abort() -> !;
5653
}
5754

5855
mod libc {

compiler/rustc_error_codes/src/error_codes/E0094.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ Erroneous code example:
77
#![allow(internal_features)]
88
99
#[rustc_intrinsic]
10-
#[rustc_intrinsic_must_be_overridden]
11-
fn size_of<T, U>() -> usize // error: intrinsic has wrong number
12-
// of type parameters
13-
{
14-
loop {}
15-
}
10+
fn size_of<T, U>() -> usize; // error: intrinsic has wrong number
11+
// of type parameters
1612
```
1713

1814
Please check that you provided the right number of type parameters
@@ -24,9 +20,5 @@ Example:
2420
#![allow(internal_features)]
2521
2622
#[rustc_intrinsic]
27-
#[rustc_intrinsic_must_be_overridden]
28-
fn size_of<T>() -> usize // ok!
29-
{
30-
loop {}
31-
}
23+
fn size_of<T>() -> usize; // ok!
3224
```

compiler/rustc_feature/src/builtin_attrs.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
10051005
rustc_intrinsic, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes, intrinsics,
10061006
"the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items",
10071007
),
1008-
gated!(
1009-
rustc_intrinsic_must_be_overridden, Normal, template!(Word), ErrorFollowing, EncodeCrossCrate::Yes, intrinsics,
1010-
"the `#[rustc_intrinsic_must_be_overridden]` attribute is used to declare intrinsics without real bodies",
1011-
),
10121008
rustc_attr!(
10131009
rustc_no_mir_inline, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes,
10141010
"#[rustc_no_mir_inline] prevents the MIR inliner from inlining a function while not affecting codegen"

compiler/rustc_middle/src/ty/util.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1755,13 +1755,12 @@ pub fn intrinsic_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::Intrinsi
17551755
&& (matches!(tcx.fn_sig(def_id).skip_binder().abi(), ExternAbi::RustIntrinsic)
17561756
|| tcx.has_attr(def_id, sym::rustc_intrinsic))
17571757
{
1758-
let must_be_overridden = tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden)
1759-
|| match tcx.hir_node_by_def_id(def_id) {
1760-
hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { has_body, .. }, .. }) => {
1761-
!has_body
1762-
}
1763-
_ => true,
1764-
};
1758+
let must_be_overridden = match tcx.hir_node_by_def_id(def_id) {
1759+
hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { has_body, .. }, .. }) => {
1760+
!has_body
1761+
}
1762+
_ => true,
1763+
};
17651764
Some(ty::IntrinsicDef {
17661765
name: tcx.item_name(def_id.into()),
17671766
must_be_overridden,

compiler/rustc_span/src/symbol.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,6 @@ symbols! {
17641764
rustc_insignificant_dtor,
17651765
rustc_intrinsic,
17661766
rustc_intrinsic_const_stable_indirect,
1767-
rustc_intrinsic_must_be_overridden,
17681767
rustc_layout,
17691768
rustc_layout_scalar_valid_range_end,
17701769
rustc_layout_scalar_valid_range_start,

library/alloc/src/boxed.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,8 @@ pub struct Box<
238238
///
239239
/// This is the surface syntax for `box <expr>` expressions.
240240
#[rustc_intrinsic]
241-
#[rustc_intrinsic_must_be_overridden]
242241
#[unstable(feature = "liballoc_internals", issue = "none")]
243-
pub fn box_new<T>(_x: T) -> Box<T> {
244-
unreachable!()
245-
}
242+
pub fn box_new<T>(_x: T) -> Box<T>;
246243

247244
impl<T> Box<T> {
248245
/// Allocates memory on the heap and then places `x` into it.

library/alloc/src/string.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -966,11 +966,8 @@ impl String {
966966
/// This is highly unsafe, due to the number of invariants that aren't
967967
/// checked:
968968
///
969-
/// * The memory at `buf` needs to have been previously allocated by the
970-
/// same allocator the standard library uses, with a required alignment of exactly 1.
971-
/// * `length` needs to be less than or equal to `capacity`.
972-
/// * `capacity` needs to be the correct value.
973-
/// * The first `length` bytes at `buf` need to be valid UTF-8.
969+
/// * all safety requirements for [`Vec::<u8>::from_raw_parts`].
970+
/// * all safety requirements for [`String::from_utf8_unchecked`].
974971
///
975972
/// Violating these may cause problems like corrupting the allocator's
976973
/// internal data structures. For example, it is normally **not** safe to

library/core/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ check-cfg = [
3232
'cfg(bootstrap)',
3333
'cfg(no_fp_fmt_parse)',
3434
'cfg(stdarch_intel_sde)',
35+
# #[cfg(bootstrap)]
36+
'cfg(target_feature, values("vector-enhancements-1"))',
3537
# core use #[path] imports to portable-simd `core_simd` crate
3638
# and to stdarch `core_arch` crate which messes-up with Cargo list
3739
# of declared features, we therefor expect any feature cfg

library/core/src/ffi/va_list.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -305,25 +305,16 @@ impl<'f> Drop for VaListImpl<'f> {
305305
/// Destroy the arglist `ap` after initialization with `va_start` or
306306
/// `va_copy`.
307307
#[rustc_intrinsic]
308-
#[rustc_intrinsic_must_be_overridden]
309308
#[rustc_nounwind]
310-
unsafe fn va_end(_ap: &mut VaListImpl<'_>) {
311-
unreachable!()
312-
}
309+
unsafe fn va_end(_ap: &mut VaListImpl<'_>);
313310

314311
/// Copies the current location of arglist `src` to the arglist `dst`.
315312
#[rustc_intrinsic]
316-
#[rustc_intrinsic_must_be_overridden]
317313
#[rustc_nounwind]
318-
unsafe fn va_copy<'f>(_dest: *mut VaListImpl<'f>, _src: &VaListImpl<'f>) {
319-
unreachable!()
320-
}
314+
unsafe fn va_copy<'f>(_dest: *mut VaListImpl<'f>, _src: &VaListImpl<'f>);
321315

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

0 commit comments

Comments
 (0)