Skip to content

Commit f5729cf

Browse files
committed
Auto merge of rust-lang#137573 - compiler-errors:rollup-noq9yhp, r=compiler-errors
Rollup of 11 pull requests Successful merges: - rust-lang#136522 (Remove `feature(dyn_compatible_for_dispatch)` from the compiler) - rust-lang#137289 (Consolidate and improve error messaging for `CoerceUnsized` and `DispatchFromDyn`) - rust-lang#137321 (Correct doc about `temp_dir()` behavior on Android) - rust-lang#137417 (rustc_target: Add more RISC-V atomic-related features) - rust-lang#137489 (remove `#[rustc_intrinsic_must_be_overridde]`) - rust-lang#137530 (DWARF mixed versions with LTO on MIPS) - rust-lang#137543 (std: Fix another new symlink test on Windows) - rust-lang#137548 (Pass correct `TypingEnv` to `InlineAsmCtxt`) - rust-lang#137550 (Don't immediately panic if dropck fails without returning errors) - rust-lang#137552 (Update books) - rust-lang#137556 (rename simd_shuffle_generic → simd_shuffle_const_generic) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7d8c6e7 + 6c1f959 commit f5729cf

File tree

135 files changed

+1436
-2906
lines changed

Some content is hidden

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

135 files changed

+1436
-2906
lines changed

compiler/rustc_borrowck/src/type_check/liveness/trace.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ use rustc_index::interval::IntervalSet;
44
use rustc_infer::infer::canonical::QueryRegionConstraints;
55
use rustc_infer::infer::outlives::for_liveness;
66
use rustc_middle::mir::{BasicBlock, Body, ConstraintCategory, HasLocalDecls, Local, Location};
7-
use rustc_middle::span_bug;
87
use rustc_middle::traits::query::DropckOutlivesResult;
98
use rustc_middle::ty::relate::Relate;
109
use rustc_middle::ty::{Ty, TyCtxt, TypeVisitable, TypeVisitableExt};
1110
use rustc_mir_dataflow::ResultsCursor;
1211
use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
1312
use rustc_mir_dataflow::move_paths::{HasMoveData, MoveData, MovePathIndex};
1413
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
15-
use rustc_span::{DUMMY_SP, Span};
14+
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
1615
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
1716
use rustc_trait_selection::traits::ObligationCtxt;
1817
use rustc_trait_selection::traits::query::dropck_outlives;
@@ -608,7 +607,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
608607
Ok(TypeOpOutput { output, constraints, .. }) => {
609608
DropData { dropck_result: output, region_constraint_data: constraints }
610609
}
611-
Err(_) => {
610+
Err(ErrorGuaranteed { .. }) => {
612611
// We don't run dropck on HIR, and dropck looks inside fields of
613612
// types, so there's no guarantee that it succeeds. We also
614613
// can't rely on the the `ErrorGuaranteed` from `fully_perform` here
@@ -631,10 +630,10 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
631630
}
632631
};
633632

633+
// Could have no errors if a type lowering error, say, caused the query
634+
// to fail.
634635
if !errors.is_empty() {
635636
typeck.infcx.err_ctxt().report_fulfillment_errors(errors);
636-
} else {
637-
span_bug!(span, "Rerunning drop data query produced no error.");
638637
}
639638
});
640639
DropData { dropck_result: Default::default(), region_constraint_data: None }

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_cranelift/src/intrinsics/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
116116
});
117117
}
118118

119-
// simd_shuffle_generic<T, U, const I: &[u32]>(x: T, y: T) -> U
120-
sym::simd_shuffle_generic => {
119+
// simd_shuffle_const_generic<T, U, const I: &[u32]>(x: T, y: T) -> U
120+
sym::simd_shuffle_const_generic => {
121121
let [x, y] = args else {
122122
bug!("wrong number of args for intrinsic {intrinsic}");
123123
};

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_codegen_llvm/src/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
13291329
));
13301330
}
13311331

1332-
if name == sym::simd_shuffle_generic {
1332+
if name == sym::simd_shuffle_const_generic {
13331333
let idx = fn_args[2].expect_const().to_value().valtree.unwrap_branch();
13341334
let n = idx.len() as u64;
13351335

compiler/rustc_codegen_llvm/src/llvm_util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
281281
("riscv32" | "riscv64", "zaamo") if get_version().0 < 19 => None,
282282
("riscv32" | "riscv64", "zabha") if get_version().0 < 19 => None,
283283
("riscv32" | "riscv64", "zalrsc") if get_version().0 < 19 => None,
284+
("riscv32" | "riscv64", "zama16b") if get_version().0 < 19 => None,
285+
("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None,
284286
// Enable the evex512 target feature if an avx512 target feature is enabled.
285287
("x86", s) if s.starts_with("avx512") => {
286288
Some(LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512")))

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
```

0 commit comments

Comments
 (0)