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 11 pull requests #137573

Merged
merged 27 commits into from
Feb 25, 2025
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0d4d752
Correct doc about `temp_dir()` behavior on Android
aviraxp Feb 20, 2025
a343dcb
rustc_target: Add more RISC-V atomic-related features
taiki-e Feb 22, 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
264f2c6
DWARF mixed versions with LTO on MIPS
LukasWoodtli Feb 24, 2025
9c65672
std: Fix another new symlink test on Windows
petrochenkov Feb 24, 2025
04c0058
Properly support thin ptrs that are only thin due to their param-env …
compiler-errors Feb 24, 2025
b2dee42
Better error message for unsized pointers
compiler-errors Feb 24, 2025
a4a9fb4
Don't immediately panic if dropck fails without returning errors
matthewjasper Feb 24, 2025
0fcb080
Update books
rustbot Feb 24, 2025
0362775
rename simd_shuffle_generic → simd_shuffle_const_generic
RalfJung Feb 24, 2025
f3d31f7
Remove dyn_compatible_for_dispatch
compiler-errors Feb 4, 2025
b6899ab
More eagerly bail in DispatchFromDyn validation
compiler-errors Feb 19, 2025
96d966b
Consolidate and rework CoercePointee and DispatchFromDyn errors
compiler-errors Feb 19, 2025
5c5ed92
Simplify trait error message for CoercePointee validation
compiler-errors Feb 19, 2025
b46acc0
Deduplicate CoerceUnsized and DispatchFromDyn impl errors
compiler-errors Feb 19, 2025
748af6b
Rollup merge of #136522 - compiler-errors:dyn_compatible_for_dispatch…
compiler-errors Feb 25, 2025
0bb00e2
Rollup merge of #137289 - compiler-errors:coerce-unsized-errors, r=ol…
compiler-errors Feb 25, 2025
1cd083d
Rollup merge of #137321 - aviraxp:patch-1, r=cuviper
compiler-errors Feb 25, 2025
828a3a4
Rollup merge of #137417 - taiki-e:riscv-atomic, r=Amanieu
compiler-errors Feb 25, 2025
8f729e9
Rollup merge of #137489 - RalfJung:no-more-rustc_intrinsic_must_be_ov…
compiler-errors Feb 25, 2025
296faa8
Rollup merge of #137530 - LukasWoodtli:gardena/lw/mips_dwarf, r=jieyouxu
compiler-errors Feb 25, 2025
74e5366
Rollup merge of #137543 - petrochenkov:wintest, r=ChrisDenton
compiler-errors Feb 25, 2025
87f3908
Rollup merge of #137548 - compiler-errors:asm-ty, r=oli-obk
compiler-errors Feb 25, 2025
6e6dced
Rollup merge of #137550 - matthewjasper:panic-later-for-missing-dropc…
compiler-errors Feb 25, 2025
c11a523
Rollup merge of #137552 - rustbot:docs-update, r=ehuss
compiler-errors Feb 25, 2025
6c1f959
Rollup merge of #137556 - RalfJung:simd_shuffle_const_generic, r=oli-obk
compiler-errors Feb 25, 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
9 changes: 4 additions & 5 deletions compiler/rustc_borrowck/src/type_check/liveness/trace.rs
Original file line number Diff line number Diff line change
@@ -4,15 +4,14 @@ use rustc_index::interval::IntervalSet;
use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_infer::infer::outlives::for_liveness;
use rustc_middle::mir::{BasicBlock, Body, ConstraintCategory, HasLocalDecls, Local, Location};
use rustc_middle::span_bug;
use rustc_middle::traits::query::DropckOutlivesResult;
use rustc_middle::ty::relate::Relate;
use rustc_middle::ty::{Ty, TyCtxt, TypeVisitable, TypeVisitableExt};
use rustc_mir_dataflow::ResultsCursor;
use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
use rustc_mir_dataflow::move_paths::{HasMoveData, MoveData, MovePathIndex};
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
use rustc_span::{DUMMY_SP, Span};
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
use rustc_trait_selection::traits::ObligationCtxt;
use rustc_trait_selection::traits::query::dropck_outlives;
@@ -608,7 +607,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
Ok(TypeOpOutput { output, constraints, .. }) => {
DropData { dropck_result: output, region_constraint_data: constraints }
}
Err(_) => {
Err(ErrorGuaranteed { .. }) => {
// We don't run dropck on HIR, and dropck looks inside fields of
// types, so there's no guarantee that it succeeds. We also
// can't rely on the the `ErrorGuaranteed` from `fully_perform` here
@@ -631,10 +630,10 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
}
};

// Could have no errors if a type lowering error, say, caused the query
// to fail.
if !errors.is_empty() {
typeck.infcx.err_ctxt().report_fulfillment_errors(errors);
} else {
span_bug!(span, "Rerunning drop data query produced no error.");
}
});
DropData { dropck_result: Default::default(), region_constraint_data: None }
65 changes: 13 additions & 52 deletions compiler/rustc_codegen_cranelift/example/mini_core.rs
Original file line number Diff line number Diff line change
@@ -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 {
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
@@ -116,8 +116,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
});
}

// simd_shuffle_generic<T, U, const I: &[u32]>(x: T, y: T) -> U
sym::simd_shuffle_generic => {
// simd_shuffle_const_generic<T, U, const I: &[u32]>(x: T, y: T) -> U
sym::simd_shuffle_const_generic => {
let [x, y] = args else {
bug!("wrong number of args for intrinsic {intrinsic}");
};
65 changes: 13 additions & 52 deletions compiler/rustc_codegen_gcc/example/mini_core.rs
Original file line number Diff line number Diff line change
@@ -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 {
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/abort1.rs
Original file line number Diff line number Diff line change
@@ -36,10 +36,7 @@ mod intrinsics {

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

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

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

/*
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/assign.rs
Original file line number Diff line number Diff line change
@@ -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"]
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
@@ -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"]
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/operations.rs
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_gcc/tests/run/static.rs
Original file line number Diff line number Diff line change
@@ -49,10 +49,7 @@ mod intrinsics {

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

mod libc {
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -1329,7 +1329,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
));
}

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

2 changes: 2 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
@@ -281,6 +281,8 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
("riscv32" | "riscv64", "zaamo") if get_version().0 < 19 => None,
("riscv32" | "riscv64", "zabha") if get_version().0 < 19 => None,
("riscv32" | "riscv64", "zalrsc") if get_version().0 < 19 => None,
("riscv32" | "riscv64", "zama16b") if get_version().0 < 19 => None,
("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None,
// Enable the evex512 target feature if an avx512 target feature is enabled.
("x86", s) if s.starts_with("avx512") => {
Some(LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512")))
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
@@ -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
@@ -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!
```
Loading
Loading