Auto merge of #144488 - tgross35:rollup-vn0fpot, r=tgross35

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#144089 (Rehome 35 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#144171 (pattern_analysis: add option to get a full set of witnesses)
 - rust-lang/rust#144201 (Mention type that could be `Clone` but isn't in more cases)
 - rust-lang/rust#144316 (bootstrap: Move musl-root fallback out of sanity check)
 - rust-lang/rust#144339 (Enable dwarf-mixed-versions-lto.rs test on RISC-V (riscv64))
 - rust-lang/rust#144341 (Enable const-vector.rs test on RISC-V (riscv64))
 - rust-lang/rust#144352 (RustWrapper: Suppress getNextNonDebugInfoInstruction)
 - rust-lang/rust#144356 (Add `ignore-backends` annotations in failing GCC backend ui tests)
 - rust-lang/rust#144364 (Update `dlmalloc` dependency of libstd)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-07-26 07:10:59 +00:00
commit 051d0e8a95
171 changed files with 788 additions and 125 deletions

View file

@ -1290,6 +1290,58 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
span,
format!("if `{ty}` implemented `Clone`, you could clone the value"),
);
} else if let ty::Adt(_, _) = ty.kind()
&& let Some(clone_trait) = self.infcx.tcx.lang_items().clone_trait()
{
// For cases like `Option<NonClone>`, where `Option<T>: Clone` if `T: Clone`, we point
// at the types that should be `Clone`.
let ocx = ObligationCtxt::new_with_diagnostics(self.infcx);
let cause = ObligationCause::misc(expr.span, self.mir_def_id());
ocx.register_bound(cause, self.infcx.param_env, ty, clone_trait);
let errors = ocx.select_all_or_error();
if errors.iter().all(|error| {
match error.obligation.predicate.as_clause().and_then(|c| c.as_trait_clause()) {
Some(clause) => match clause.self_ty().skip_binder().kind() {
ty::Adt(def, _) => def.did().is_local() && clause.def_id() == clone_trait,
_ => false,
},
None => false,
}
}) {
let mut type_spans = vec![];
let mut types = FxIndexSet::default();
for clause in errors
.iter()
.filter_map(|e| e.obligation.predicate.as_clause())
.filter_map(|c| c.as_trait_clause())
{
let ty::Adt(def, _) = clause.self_ty().skip_binder().kind() else { continue };
type_spans.push(self.infcx.tcx.def_span(def.did()));
types.insert(
self.infcx
.tcx
.short_string(clause.self_ty().skip_binder(), &mut err.long_ty_path()),
);
}
let mut span: MultiSpan = type_spans.clone().into();
for sp in type_spans {
span.push_span_label(sp, "consider implementing `Clone` for this type");
}
span.push_span_label(expr.span, "you could clone this value");
let types: Vec<_> = types.into_iter().collect();
let msg = match &types[..] {
[only] => format!("`{only}`"),
[head @ .., last] => format!(
"{} and `{last}`",
head.iter().map(|t| format!("`{t}`")).collect::<Vec<_>>().join(", ")
),
[] => unreachable!(),
};
err.span_note(
span,
format!("if {msg} implemented `Clone`, you could clone the value"),
);
}
}
}

View file

@ -1610,7 +1610,7 @@ extern "C" void LLVMRustPositionBefore(LLVMBuilderRef B, LLVMValueRef Instr) {
extern "C" void LLVMRustPositionAfter(LLVMBuilderRef B, LLVMValueRef Instr) {
if (auto I = dyn_cast<Instruction>(unwrap<Value>(Instr))) {
auto J = I->getNextNonDebugInstruction();
auto J = I->getNextNode();
unwrap(B)->SetInsertPoint(J);
}
}

View file

@ -950,9 +950,7 @@ impl<Cx: PatCx> Constructor<Cx> {
}
}
Never => write!(f, "!")?,
Wildcard | Missing | NonExhaustive | Hidden | PrivateUninhabited => {
write!(f, "_ : {:?}", ty)?
}
Wildcard | Missing | NonExhaustive | Hidden | PrivateUninhabited => write!(f, "_")?,
}
Ok(())
}

View file

@ -57,6 +57,13 @@ pub trait PatCx: Sized + fmt::Debug {
fn is_exhaustive_patterns_feature_on(&self) -> bool;
/// Whether to ensure the non-exhaustiveness witnesses we report for a complete set. This is
/// `false` by default to avoid some exponential blowup cases such as
/// <https://github.com/rust-lang/rust/issues/118437>.
fn exhaustive_witnesses(&self) -> bool {
false
}
/// The number of fields for this constructor.
fn ctor_arity(&self, ctor: &Constructor<Self>, ty: &Self::Ty) -> usize;

View file

@ -994,7 +994,8 @@ impl<Cx: PatCx> PlaceInfo<Cx> {
if !missing_ctors.is_empty() && !report_individual_missing_ctors {
// Report `_` as missing.
missing_ctors = vec![Constructor::Wildcard];
} else if missing_ctors.iter().any(|c| c.is_non_exhaustive()) {
} else if missing_ctors.iter().any(|c| c.is_non_exhaustive()) && !cx.exhaustive_witnesses()
{
// We need to report a `_` anyway, so listing other constructors would be redundant.
// `NonExhaustive` is displayed as `_` just like `Wildcard`, but it will be picked
// up by diagnostics to add a note about why `_` is required here.
@ -1747,7 +1748,9 @@ fn compute_exhaustiveness_and_usefulness<'a, 'p, Cx: PatCx>(
// `ctor` is *irrelevant* if there's another constructor in `split_ctors` that matches
// strictly fewer rows. In that case we can sometimes skip it. See the top of the file for
// details.
let ctor_is_relevant = matches!(ctor, Constructor::Missing) || missing_ctors.is_empty();
let ctor_is_relevant = matches!(ctor, Constructor::Missing)
|| missing_ctors.is_empty()
|| mcx.tycx.exhaustive_witnesses();
let mut spec_matrix = matrix.specialize_constructor(pcx, &ctor, ctor_is_relevant)?;
let mut witnesses = ensure_sufficient_stack(|| {
compute_exhaustiveness_and_usefulness(mcx, &mut spec_matrix)

View file

@ -1,3 +1,4 @@
#![allow(dead_code, unreachable_pub)]
use rustc_pattern_analysis::constructor::{
Constructor, ConstructorSet, IntRange, MaybeInfiniteInt, RangeEnd, VariantVisibility,
};
@ -22,8 +23,10 @@ fn init_tracing() {
.try_init();
}
pub(super) const UNIT: Ty = Ty::Tuple(&[]);
pub(super) const NEVER: Ty = Ty::Enum(&[]);
/// A simple set of types.
#[allow(dead_code)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub(super) enum Ty {
/// Booleans
@ -38,6 +41,8 @@ pub(super) enum Ty {
BigStruct { arity: usize, ty: &'static Ty },
/// A enum with `arity` variants of type `ty`.
BigEnum { arity: usize, ty: &'static Ty },
/// Like `Enum` but non-exhaustive.
NonExhaustiveEnum(&'static [Ty]),
}
/// The important logic.
@ -47,7 +52,7 @@ impl Ty {
match (ctor, *self) {
(Struct, Ty::Tuple(tys)) => tys.iter().copied().collect(),
(Struct, Ty::BigStruct { arity, ty }) => (0..arity).map(|_| *ty).collect(),
(Variant(i), Ty::Enum(tys)) => vec![tys[*i]],
(Variant(i), Ty::Enum(tys) | Ty::NonExhaustiveEnum(tys)) => vec![tys[*i]],
(Variant(_), Ty::BigEnum { ty, .. }) => vec![*ty],
(Bool(..) | IntRange(..) | NonExhaustive | Missing | Wildcard, _) => vec![],
_ => panic!("Unexpected ctor {ctor:?} for type {self:?}"),
@ -61,6 +66,7 @@ impl Ty {
Ty::Enum(tys) => tys.iter().all(|ty| ty.is_empty()),
Ty::BigStruct { arity, ty } => arity != 0 && ty.is_empty(),
Ty::BigEnum { arity, ty } => arity == 0 || ty.is_empty(),
Ty::NonExhaustiveEnum(..) => false,
}
}
@ -90,6 +96,19 @@ impl Ty {
.collect(),
non_exhaustive: false,
},
Ty::NonExhaustiveEnum(tys) => ConstructorSet::Variants {
variants: tys
.iter()
.map(|ty| {
if ty.is_empty() {
VariantVisibility::Empty
} else {
VariantVisibility::Visible
}
})
.collect(),
non_exhaustive: true,
},
Ty::BigEnum { arity: 0, .. } => ConstructorSet::NoConstructors,
Ty::BigEnum { arity, ty } => {
let vis = if ty.is_empty() {
@ -113,7 +132,9 @@ impl Ty {
match (*self, ctor) {
(Ty::Tuple(..), _) => Ok(()),
(Ty::BigStruct { .. }, _) => write!(f, "BigStruct"),
(Ty::Enum(..), Constructor::Variant(i)) => write!(f, "Enum::Variant{i}"),
(Ty::Enum(..) | Ty::NonExhaustiveEnum(..), Constructor::Variant(i)) => {
write!(f, "Enum::Variant{i}")
}
(Ty::BigEnum { .. }, Constructor::Variant(i)) => write!(f, "BigEnum::Variant{i}"),
_ => write!(f, "{:?}::{:?}", self, ctor),
}
@ -126,10 +147,11 @@ pub(super) fn compute_match_usefulness<'p>(
ty: Ty,
scrut_validity: PlaceValidity,
complexity_limit: usize,
exhaustive_witnesses: bool,
) -> Result<UsefulnessReport<'p, Cx>, ()> {
init_tracing();
rustc_pattern_analysis::usefulness::compute_match_usefulness(
&Cx,
&Cx { exhaustive_witnesses },
arms,
ty,
scrut_validity,
@ -138,7 +160,9 @@ pub(super) fn compute_match_usefulness<'p>(
}
#[derive(Debug)]
pub(super) struct Cx;
pub(super) struct Cx {
exhaustive_witnesses: bool,
}
/// The context for pattern analysis. Forwards anything interesting to `Ty` methods.
impl PatCx for Cx {
@ -153,6 +177,10 @@ impl PatCx for Cx {
false
}
fn exhaustive_witnesses(&self) -> bool {
self.exhaustive_witnesses
}
fn ctor_arity(&self, ctor: &Constructor<Self>, ty: &Self::Ty) -> usize {
ty.sub_tys(ctor).len()
}
@ -219,16 +247,18 @@ macro_rules! pats {
// Entrypoint
// Parse `type; ..`
($ty:expr; $($rest:tt)*) => {{
#[allow(unused_imports)]
#[allow(unused)]
use rustc_pattern_analysis::{
constructor::{Constructor, IntRange, MaybeInfiniteInt, RangeEnd},
pat::DeconstructedPat,
pat::{DeconstructedPat, IndexedPat},
};
let ty = $ty;
// The heart of the macro is designed to push `IndexedPat`s into a `Vec`, so we work around
// that.
#[allow(unused)]
let sub_tys = ::std::iter::repeat(&ty);
let mut vec = Vec::new();
#[allow(unused)]
let mut vec: Vec<IndexedPat<_>> = Vec::new();
pats!(@ctor(vec:vec, sub_tys:sub_tys, idx:0) $($rest)*);
vec.into_iter().map(|ipat| ipat.pat).collect::<Vec<_>>()
}};
@ -263,6 +293,8 @@ macro_rules! pats {
let ctor = Constructor::Wildcard;
pats!(@pat($($args)*, ctor:ctor) $($rest)*)
}};
// Nothing
(@ctor($($args:tt)*)) => {};
// Integers and int ranges
(@ctor($($args:tt)*) $($start:literal)?..$end:literal $($rest:tt)*) => {{

View file

@ -16,7 +16,7 @@ fn check(patterns: &[DeconstructedPat<Cx>], complexity_limit: usize) -> Result<(
let ty = *patterns[0].ty();
let arms: Vec<_> =
patterns.iter().map(|pat| MatchArm { pat, has_guard: false, arm_data: () }).collect();
compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, complexity_limit)
compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, complexity_limit, false)
.map(|_report| ())
}

View file

@ -11,16 +11,30 @@ use rustc_pattern_analysis::usefulness::PlaceValidity;
mod common;
/// Analyze a match made of these patterns.
fn check(patterns: Vec<DeconstructedPat<Cx>>) -> Vec<WitnessPat<Cx>> {
let ty = *patterns[0].ty();
fn run(
ty: Ty,
patterns: Vec<DeconstructedPat<Cx>>,
exhaustive_witnesses: bool,
) -> Vec<WitnessPat<Cx>> {
let arms: Vec<_> =
patterns.iter().map(|pat| MatchArm { pat, has_guard: false, arm_data: () }).collect();
let report =
compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, usize::MAX)
.unwrap();
let report = compute_match_usefulness(
arms.as_slice(),
ty,
PlaceValidity::ValidOnly,
usize::MAX,
exhaustive_witnesses,
)
.unwrap();
report.non_exhaustiveness_witnesses
}
/// Analyze a match made of these patterns. Panics if there are no patterns
fn check(patterns: Vec<DeconstructedPat<Cx>>) -> Vec<WitnessPat<Cx>> {
let ty = *patterns[0].ty();
run(ty, patterns, true)
}
#[track_caller]
fn assert_exhaustive(patterns: Vec<DeconstructedPat<Cx>>) {
let witnesses = check(patterns);
@ -35,6 +49,26 @@ fn assert_non_exhaustive(patterns: Vec<DeconstructedPat<Cx>>) {
assert!(!witnesses.is_empty())
}
use WhichWitnesses::*;
enum WhichWitnesses {
AllOfThem,
OnlySome,
}
#[track_caller]
/// We take the type as input to support empty matches.
fn assert_witnesses(
which: WhichWitnesses,
ty: Ty,
patterns: Vec<DeconstructedPat<Cx>>,
expected: Vec<&str>,
) {
let exhaustive_wit = matches!(which, AllOfThem);
let witnesses = run(ty, patterns, exhaustive_wit);
let witnesses: Vec<_> = witnesses.iter().map(|w| format!("{w:?}")).collect();
assert_eq!(witnesses, expected)
}
#[test]
fn test_int_ranges() {
let ty = Ty::U8;
@ -59,6 +93,8 @@ fn test_int_ranges() {
#[test]
fn test_nested() {
// enum E { A(bool), B(bool) }
// ty = (E, E)
let ty = Ty::BigStruct { arity: 2, ty: &Ty::BigEnum { arity: 2, ty: &Ty::Bool } };
assert_non_exhaustive(pats!(ty;
Struct(Variant.0, _),
@ -78,10 +114,74 @@ fn test_nested() {
));
}
#[test]
fn test_witnesses() {
// TY = Option<bool>
const TY: Ty = Ty::Enum(&[Ty::Bool, UNIT]);
// ty = (Option<bool>, Option<bool>)
let ty = Ty::Tuple(&[TY, TY]);
assert_witnesses(AllOfThem, ty, vec![], vec!["(_, _)"]);
assert_witnesses(
OnlySome,
ty,
pats!(ty;
(Variant.0(false), Variant.0(false)),
),
vec!["(Enum::Variant1(_), _)"],
);
assert_witnesses(
AllOfThem,
ty,
pats!(ty;
(Variant.0(false), Variant.0(false)),
),
vec![
"(Enum::Variant0(false), Enum::Variant0(true))",
"(Enum::Variant0(false), Enum::Variant1(_))",
"(Enum::Variant0(true), _)",
"(Enum::Variant1(_), _)",
],
);
assert_witnesses(
OnlySome,
ty,
pats!(ty;
(_, Variant.0(false)),
),
vec!["(_, Enum::Variant1(_))"],
);
assert_witnesses(
AllOfThem,
ty,
pats!(ty;
(_, Variant.0(false)),
),
vec!["(_, Enum::Variant0(true))", "(_, Enum::Variant1(_))"],
);
let ty = Ty::NonExhaustiveEnum(&[UNIT, UNIT, UNIT]);
assert_witnesses(
OnlySome,
ty,
pats!(ty;
Variant.0,
),
vec!["_"],
);
assert_witnesses(
AllOfThem,
ty,
pats!(ty;
Variant.0,
),
vec!["Enum::Variant1(_)", "Enum::Variant2(_)", "_"],
);
}
#[test]
fn test_empty() {
// `TY = Result<bool, !>`
const TY: Ty = Ty::Enum(&[Ty::Bool, Ty::Enum(&[])]);
const TY: Ty = Ty::Enum(&[Ty::Bool, NEVER]);
assert_exhaustive(pats!(TY;
Variant.0,
));

View file

@ -16,7 +16,7 @@ fn check(patterns: Vec<DeconstructedPat<Cx>>) -> Vec<Vec<usize>> {
let arms: Vec<_> =
patterns.iter().map(|pat| MatchArm { pat, has_guard: false, arm_data: () }).collect();
let report =
compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, usize::MAX)
compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, usize::MAX, false)
.unwrap();
report.arm_intersections.into_iter().map(|bitset| bitset.iter().collect()).collect()
}

View file

@ -78,9 +78,9 @@ dependencies = [
[[package]]
name = "dlmalloc"
version = "0.2.9"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d01597dde41c0b9da50d5f8c219023d63d8f27f39a27095070fd191fddc83891"
checksum = "fa3a2dbee57b69fbb5dbe852fa9c0925697fb0c7fbcb1593e90e5ffaedf13d51"
dependencies = [
"cfg-if",
"libc",

View file

@ -63,7 +63,7 @@ rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
rand_xorshift = "0.4.0"
[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'] }
dlmalloc = { version = "0.2.10", features = ['rustc-dep-of-std'] }
[target.x86_64-fortanix-unknown-sgx.dependencies]
fortanix-sgx-abi = { version = "0.5.0", features = [

View file

@ -338,12 +338,6 @@ than building it.
// Make sure musl-root is valid.
if target.contains("musl") && !target.contains("unikraft") {
// If this is a native target (host is also musl) and no musl-root is given,
// fall back to the system toolchain in /usr before giving up
if build.musl_root(*target).is_none() && build.config.is_host_target(*target) {
let target = build.config.target_config.entry(*target).or_default();
target.musl_root = Some("/usr".into());
}
match build.musl_libdir(*target) {
Some(libdir) => {
if fs::metadata(libdir.join("libc.a")).is_err() {

View file

@ -1329,23 +1329,33 @@ impl Build {
}
}
/// Returns the "musl root" for this `target`, if defined
/// Returns the "musl root" for this `target`, if defined.
///
/// If this is a native target (host is also musl) and no musl-root is given,
/// it falls back to the system toolchain in /usr.
fn musl_root(&self, target: TargetSelection) -> Option<&Path> {
self.config
let configured_root = self
.config
.target_config
.get(&target)
.and_then(|t| t.musl_root.as_ref())
.or(self.config.musl_root.as_ref())
.map(|p| &**p)
.map(|p| &**p);
if self.config.is_host_target(target) && configured_root.is_none() {
Some(Path::new("/usr"))
} else {
configured_root
}
}
/// Returns the "musl libdir" for this `target`.
fn musl_libdir(&self, target: TargetSelection) -> Option<PathBuf> {
let t = self.config.target_config.get(&target)?;
if let libdir @ Some(_) = &t.musl_libdir {
return libdir.clone();
}
self.musl_root(target).map(|root| root.join("lib"))
self.config
.target_config
.get(&target)
.and_then(|t| t.musl_libdir.clone())
.or_else(|| self.musl_root(target).map(|root| root.join("lib")))
}
/// Returns the `lib` directory for the WASI target specified, if

View file

@ -285,6 +285,11 @@ fn parse_cfg_name_directive<'a>(
if name == "gdb-version" {
outcome = MatchOutcome::External;
}
// Don't error out for ignore-backends,as it is handled elsewhere.
if name == "backends" {
outcome = MatchOutcome::External;
}
}
ParsedNameDirective {

View file

@ -1,6 +1,7 @@
// This test ensures that if LTO occurs between crates with different DWARF versions, we
// will choose the highest DWARF version for the final binary. This matches Clang's behavior.
// Note: `.2byte` directive is used on MIPS.
// Note: `.half` directive is used on RISC-V.
//@ only-linux
//@ aux-build:dwarf-mixed-versions-lto-aux.rs
@ -15,6 +16,6 @@ fn main() {
}
// CHECK: .section .debug_info
// CHECK-NOT: {{\.(short|hword|2byte)}} 2
// CHECK-NOT: {{\.(short|hword|2byte)}} 4
// CHECK: {{\.(short|hword|2byte)}} 5
// CHECK-NOT: {{\.(short|hword|2byte|half)}} 2
// CHECK-NOT: {{\.(short|hword|2byte|half)}} 4
// CHECK: {{\.(short|hword|2byte|half)}} 5

View file

@ -15,6 +15,7 @@
#![feature(arm_target_feature)]
#![feature(mips_target_feature)]
#![allow(non_camel_case_types)]
#![feature(riscv_target_feature)]
#[path = "../auxiliary/minisimd.rs"]
mod minisimd;
@ -42,6 +43,7 @@ extern "unadjusted" {
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
#[cfg_attr(target_arch = "riscv64", target_feature(enable = "v"))]
pub fn do_call() {
unsafe {
// CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64>

View file

@ -2,6 +2,7 @@
//@ ignore-android no libc
//@ ignore-emscripten no libc
//@ ignore-sgx no libc
//@ ignore-backends: gcc
//@ only-linux
//@ compile-flags:-C panic=abort
//@ aux-build:helper.rs

View file

@ -2,6 +2,7 @@
//@ ignore-android no libc
//@ ignore-emscripten no libc
//@ ignore-sgx no libc
//@ ignore-backends: gcc
//@ only-linux
//@ compile-flags:-C panic=abort
//@ aux-build:helper.rs

View file

@ -1,6 +1,7 @@
//@ run-pass
//@ needs-asm-support
//@ needs-unwind
//@ ignore-backends: gcc
#![feature(asm_unwind)]

View file

@ -2,6 +2,7 @@
//@ run-pass
//@ needs-asm-support
//@ needs-unwind
//@ ignore-backends: gcc
#![feature(asm_unwind)]

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ build-pass
//@ compile-flags: -Copt-level=s -Clto=fat
//@ no-prefer-dynamic

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ edition: 2021
//@ known-bug: #108309

View file

@ -1,11 +1,11 @@
error[E0053]: method `foo` has an incompatible type for trait
--> $DIR/dont-project-to-specializable-projection.rs:13:5
--> $DIR/dont-project-to-specializable-projection.rs:14:5
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found future
|
note: type in trait
--> $DIR/dont-project-to-specializable-projection.rs:9:5
--> $DIR/dont-project-to-specializable-projection.rs:10:5
|
LL | async fn foo(_: T) -> &'static str;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL | async fn foo(_: T) -> &'static str;
found signature `fn(_) -> impl Future<Output = &'static str>`
error: async associated function in trait cannot be specialized
--> $DIR/dont-project-to-specializable-projection.rs:13:5
--> $DIR/dont-project-to-specializable-projection.rs:14:5
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -21,7 +21,7 @@ LL | default async fn foo(_: T) -> &'static str {
= note: specialization behaves in inconsistent and surprising ways with async functions in traits, and for now is disallowed
error[E0599]: no method named `poll` found for struct `Pin<&mut impl Future<Output = ()>>` in the current scope
--> $DIR/dont-project-to-specializable-projection.rs:48:28
--> $DIR/dont-project-to-specializable-projection.rs:49:28
|
LL | match fut.as_mut().poll(ctx) {
| ^^^^ method not found in `Pin<&mut impl Future<Output = ()>>`

View file

@ -8,6 +8,7 @@
//@ ignore-fuchsia Backtraces not symbolized
//@ ignore-musl musl doesn't support dynamic libraries (at least when the original test was written).
//@ needs-unwind
//@ ignore-backends: gcc
//@ compile-flags: -g -Copt-level=0 -Cstrip=none -Cforce-frame-pointers=yes
//@ ignore-emscripten Requires custom symbolization code
//@ aux-crate: dylib_dep_helper=dylib-dep-helper.rs

View file

@ -8,6 +8,15 @@ LL | drop(t);
| - value moved here
LL | t.b = Some(u);
| ^^^ value assigned here after move
|
note: if `Test2` implemented `Clone`, you could clone the value
--> $DIR/borrowck-partial-reinit-1.rs:3:1
|
LL | struct Test2 {
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | drop(t);
| - you could clone this value
error[E0382]: assign of moved value: `t`
--> $DIR/borrowck-partial-reinit-1.rs:33:5
@ -19,6 +28,15 @@ LL | drop(t);
| - value moved here
LL | t.0 = Some(u);
| ^^^ value assigned here after move
|
note: if `Test3` implemented `Clone`, you could clone the value
--> $DIR/borrowck-partial-reinit-1.rs:7:1
|
LL | struct Test3(Option<Test>);
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | drop(t);
| - you could clone this value
error: aborting due to 2 previous errors

View file

@ -7,6 +7,15 @@ LL | let mut u = Test { a: 2, b: Some(Box::new(t))};
| - value moved here
LL | t.b = Some(Box::new(u));
| ^^^ value assigned here after move
|
note: if `Test` implemented `Clone`, you could clone the value
--> $DIR/borrowck-partial-reinit-2.rs:1:1
|
LL | struct Test {
| ^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let mut u = Test { a: 2, b: Some(Box::new(t))};
| - you could clone this value
error: aborting due to 1 previous error

View file

@ -7,6 +7,15 @@ LL | let a = u.a;
| --- value moved here
LL | let a = u.a;
| ^^^ value used here after move
|
note: if `U` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move-assign.rs:7:1
|
LL | union U {
| ^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.a;
| --- you could clone this value
error: aborting due to 1 previous error

View file

@ -7,6 +7,15 @@ LL | let a = u.n1;
| ---- value moved here
LL | let a = u.n1;
| ^^^^ value used here after move
|
note: if `Unn` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move.rs:7:1
|
LL | union Unn {
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.n1;
| ---- you could clone this value
error[E0382]: use of moved value: `u`
--> $DIR/borrowck-union-move.rs:31:21
@ -17,6 +26,15 @@ LL | let a = u.n1;
| ---- value moved here
LL | let a = u;
| ^ value used here after move
|
note: if `Unn` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move.rs:7:1
|
LL | union Unn {
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.n1;
| ---- you could clone this value
error[E0382]: use of moved value: `u`
--> $DIR/borrowck-union-move.rs:36:21
@ -27,6 +45,15 @@ LL | let a = u.n1;
| ---- value moved here
LL | let a = u.n2;
| ^^^^ value used here after move
|
note: if `Unn` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move.rs:7:1
|
LL | union Unn {
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.n1;
| ---- you could clone this value
error[E0382]: use of moved value: `u`
--> $DIR/borrowck-union-move.rs:63:21
@ -37,6 +64,15 @@ LL | let a = u.n;
| --- value moved here
LL | let a = u.n;
| ^^^ value used here after move
|
note: if `Ucn` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move.rs:15:1
|
LL | union Ucn {
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.n;
| --- you could clone this value
error[E0382]: use of moved value: `u`
--> $DIR/borrowck-union-move.rs:68:21
@ -47,6 +83,15 @@ LL | let a = u.n;
| --- value moved here
LL | let a = u.c;
| ^^^ value used here after move
|
note: if `Ucn` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move.rs:15:1
|
LL | union Ucn {
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.n;
| --- you could clone this value
error[E0382]: use of moved value: `u`
--> $DIR/borrowck-union-move.rs:83:21
@ -57,6 +102,15 @@ LL | let a = u.n;
| --- value moved here
LL | let a = u;
| ^ value used here after move
|
note: if `Ucn` implemented `Clone`, you could clone the value
--> $DIR/borrowck-union-move.rs:15:1
|
LL | union Ucn {
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let a = u.n;
| --- you could clone this value
error: aborting due to 6 previous errors

View file

@ -17,6 +17,15 @@ LL | drop(u);
| - value moved here
LL | u.0 = S(1);
| ^^^^^^^^^^ value partially assigned here after move
|
note: if `Tpair` implemented `Clone`, you could clone the value
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:6:1
|
LL | struct Tpair(S, i32);
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | drop(u);
| - you could clone this value
error[E0382]: assign to part of moved value: `v`
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:31:9
@ -27,6 +36,15 @@ LL | drop(v);
| - value moved here
LL | v.x = S(1);
| ^^^^^^^^^^ value partially assigned here after move
|
note: if `Spair` implemented `Clone`, you could clone the value
--> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:7:1
|
LL | struct Spair { x: S, y: i32 }
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | drop(v);
| - you could clone this value
error: aborting due to 3 previous errors

View file

@ -50,6 +50,15 @@ LL | drop(u);
| - value moved here
LL | u.0 = S(1);
| ^^^^^^^^^^ value partially assigned here after move
|
note: if `Tpair` implemented `Clone`, you could clone the value
--> $DIR/issue-54499-field-mutation-of-moved-out.rs:6:1
|
LL | struct Tpair(S, i32);
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | drop(u);
| - you could clone this value
error[E0594]: cannot assign to `u.1`, as `u` is not declared as mutable
--> $DIR/issue-54499-field-mutation-of-moved-out.rs:27:9
@ -82,6 +91,15 @@ LL | drop(v);
| - value moved here
LL | v.x = S(1);
| ^^^^^^^^^^ value partially assigned here after move
|
note: if `Spair` implemented `Clone`, you could clone the value
--> $DIR/issue-54499-field-mutation-of-moved-out.rs:7:1
|
LL | struct Spair { x: S, y: i32 }
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | drop(v);
| - you could clone this value
error[E0594]: cannot assign to `v.y`, as `v` is not declared as mutable
--> $DIR/issue-54499-field-mutation-of-moved-out.rs:38:9

View file

@ -4,6 +4,14 @@ error[E0507]: cannot move out of `*array` which is behind a shared reference
LL | *array
| ^^^^^^ move occurs because `*array` has type `Vec<Value>`, which does not implement the `Copy` trait
|
note: if `Value` implemented `Clone`, you could clone the value
--> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:4:1
|
LL | struct Value;
| ^^^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | *array
| ------ you could clone this value
help: consider removing the dereference here
|
LL - *array

View file

@ -7,3 +7,5 @@ pub fn main() {
let stdout = &mut io::stdout() as &mut dyn io::Write;
stdout.write(b"Hello!");
}
// https://github.com/rust-lang/rust/issues/4333

View file

@ -1,6 +1,7 @@
//@ build-pass
//@ compile-flags: -C panic=abort
//@ no-prefer-dynamic
//@ ignore-backends: gcc
#[cfg(panic = "unwind")]
pub fn bad() -> i32 { }

View file

@ -26,6 +26,15 @@ LL | E::Number(_) if let E::String(s) = *value => { }
...
LL | let x = value;
| ^^^^^ value used here after move
|
note: if `E` implemented `Clone`, you could clone the value
--> $DIR/if-let-guards-errors.rs:32:1
|
LL | E::Number(_) if let E::String(s) = *value => { }
| ------ you could clone this value
...
LL | enum E {
| ^^^^^^ consider implementing `Clone` for this type
error: aborting due to 2 previous errors

View file

@ -26,6 +26,15 @@ LL | E::Number(_) if let E::String(s) = *value => { }
...
LL | let x = value;
| ^^^^^ value used here after move
|
note: if `E` implemented `Clone`, you could clone the value
--> $DIR/if-let-guards-errors.rs:32:1
|
LL | E::Number(_) if let E::String(s) = *value => { }
| ------ you could clone this value
...
LL | enum E {
| ^^^^^^ consider implementing `Clone` for this type
error: aborting due to 2 previous errors

View file

@ -1,4 +1,6 @@
//@ run-pass
//@ ignore-backends: gcc
#![allow(dead_code)]
// check that we don't have linear stack usage with multiple calls to `push`

View file

@ -18,3 +18,5 @@ fn main() {
size_of_unsized = mem::size_of_val::<Ack<_>>(&y);
assert_eq!(size_of_sized, size_of_unsized);
}
// https://github.com/rust-lang/rust/issues/36278

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601

View file

@ -1,6 +1,7 @@
//@ known-bug: #107975
//@ compile-flags: -Copt-level=2
//@ run-pass
//@ ignore-backends: gcc
// Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601

View file

@ -12,3 +12,5 @@ fn m<M: Mat>() {
}
fn main() {
}
// https://github.com/rust-lang/rust/issues/39211

View file

@ -1,5 +1,5 @@
error: constant expression depends on a generic parameter
--> $DIR/issue-39211.rs:9:17
--> $DIR/generic-parameter-in-const-expression-39211.rs:9:17
|
LL | let a = [3; M::Row::DIM];
| ^^^^^^^^^^^
@ -7,7 +7,7 @@ LL | let a = [3; M::Row::DIM];
= note: this may fail depending on what value the parameter takes
error: constant expression depends on a generic parameter
--> $DIR/issue-39211.rs:9:13
--> $DIR/generic-parameter-in-const-expression-39211.rs:9:13
|
LL | let a = [3; M::Row::DIM];
| ^^^^^^^^^^^^^^^^

View file

@ -1,3 +1,5 @@
//@ ignore-backends: gcc
const _OK: () = match i32::from_str_radix("-1234", 10) {
Ok(x) => assert!(x == -1234),
Err(_) => panic!(),

View file

@ -1,5 +1,5 @@
error[E0080]: evaluation panicked: from_ascii_radix: radix must lie in the range `[2, 36]`
--> $DIR/parse_ints.rs:5:24
--> $DIR/parse_ints.rs:7:24
|
LL | const _TOO_LOW: () = { u64::from_str_radix("12345ABCD", 1); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_TOO_LOW` failed inside this call
@ -11,7 +11,7 @@ note: inside `core::num::<impl u64>::from_ascii_radix`
= note: this error originates in the macro `from_str_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation panicked: from_ascii_radix: radix must lie in the range `[2, 36]`
--> $DIR/parse_ints.rs:6:25
--> $DIR/parse_ints.rs:8:25
|
LL | const _TOO_HIGH: () = { u64::from_str_radix("12345ABCD", 37); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_TOO_HIGH` failed inside this call

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ compile-flags: -Znext-solver
#![feature(const_type_id, const_trait_impl, const_cmp)]

View file

@ -1,5 +1,5 @@
error[E0015]: cannot call non-const operator in constants
--> $DIR/const_cmp_type_id.rs:10:18
--> $DIR/const_cmp_type_id.rs:11:18
|
LL | let _a = TypeId::of::<u8>() < TypeId::of::<u16>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ check-pass
//
// This test is complement to the test in issue-73976-polymorphic.rs.

View file

@ -1,3 +1,5 @@
//@ ignore-backends: gcc
#![feature(const_trait_impl)]
struct Foo<'a> {

View file

@ -1,17 +1,17 @@
error[E0277]: the trait bound `Vec<usize>: [const] Index<_>` is not satisfied
--> $DIR/issue-94675.rs:9:9
--> $DIR/issue-94675.rs:11:9
|
LL | self.bar[0] = baz.len();
| ^^^^^^^^^^^
error[E0277]: the trait bound `Vec<usize>: [const] IndexMut<usize>` is not satisfied
--> $DIR/issue-94675.rs:9:9
--> $DIR/issue-94675.rs:11:9
|
LL | self.bar[0] = baz.len();
| ^^^^^^^^^^^
error[E0277]: the trait bound `Vec<usize>: [const] Index<usize>` is not satisfied
--> $DIR/issue-94675.rs:9:9
--> $DIR/issue-94675.rs:11:9
|
LL | self.bar[0] = baz.len();
| ^^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ error-pattern unable to turn pointer into raw bytes
//@ normalize-stderr: "alloc[0-9]+\+0x[a-z0-9]+" -> "ALLOC"

View file

@ -1,5 +1,5 @@
error[E0080]: unable to turn pointer into integer
--> $DIR/issue-miri-1910.rs:7:5
--> $DIR/issue-miri-1910.rs:8:5
|
LL | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `C` failed here

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ compile-flags: -Z ui-testing=no
use std::{

View file

@ -1,11 +1,11 @@
error[E0080]: unable to copy parts of a pointer from memory at ALLOC0
--> $DIR/missing_span_in_backtrace.rs:14:9
--> $DIR/missing_span_in_backtrace.rs:15:9
|
14 | / ptr::swap_nonoverlapping(
15 | | &mut ptr1 as *mut _ as *mut MaybeUninit<u8>,
16 | | &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
17 | | mem::size_of::<&i32>(),
18 | | );
15 | / ptr::swap_nonoverlapping(
16 | | &mut ptr1 as *mut _ as *mut MaybeUninit<u8>,
17 | | &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
18 | | mem::size_of::<&i32>(),
19 | | );
| |_________^ evaluation of `X` failed inside this call
|
= help: this code performed an operation that depends on the underlying bytes representing a pointer

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ run-pass
#![feature(try_trait_v2)]

View file

@ -2,6 +2,7 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]

View file

@ -1,6 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ run-pass
//@ needs-unwind

View file

@ -6,6 +6,7 @@
//@ aux-build:unwind-aux.rs
//@ compile-flags: -Cpanic=abort
//@ needs-unwind
//@ ignore-backends: gcc
extern crate unwind_aux;
pub fn main() {

View file

@ -0,0 +1,15 @@
//@ run-pass
//@ aux-build:exporting-impl-from-root-causes-ice-2472-b.rs
extern crate exporting_impl_from_root_causes_ice_2472_b as lib;
use lib::{S, T};
pub fn main() {
let s = S(());
s.foo();
s.bar();
}
// https://github.com/rust-lang/rust/issues/2472

View file

@ -1,6 +1,7 @@
//@ check-pass
//@ edition:2018
//@ aux-crate:fn_header_aux=fn-header-aux.rs
//@ ignore-backends: gcc
#![feature(c_variadic)]
#![feature(fn_delegation)]

View file

@ -3,3 +3,5 @@
//~^ ERROR can't compare `Comparable`
fn main() {}
// https://github.com/rust-lang/rust/issues/34229

View file

@ -1,5 +1,5 @@
error[E0277]: can't compare `Comparable` with `Comparable`
--> $DIR/issue-34229.rs:2:46
--> $DIR/invalid-derive-comparison-34229.rs:2:46
|
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
| ---------- ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`

View file

@ -28,3 +28,5 @@ pub fn main() {
Wrapper::new("Bob".to_string()).say_hi();
}
}
// https://github.com/rust-lang/rust/issues/9446

View file

@ -6,6 +6,7 @@
//@ run-pass
//@ needs-unwind
//@ edition:2018
//@ ignore-backends: gcc
#![allow(unused)]

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
#![feature(if_let_guard)]

View file

@ -8,3 +8,5 @@ enum Expr { //~ ERROR E0072
}
fn main() { }
// https://github.com/rust-lang/rust/issues/32326

View file

@ -1,5 +1,5 @@
error[E0072]: recursive type `Expr` has infinite size
--> $DIR/issue-32326.rs:5:1
--> $DIR/recursive-enum-memory-32326.rs:5:1
|
LL | enum Expr {
| ^^^^^^^^^

View file

@ -5,12 +5,14 @@
// expression that autoderefs through an overloaded generic deref
// impl.
//@ aux-build:issue-18514.rs
//@ aux-build:generic-impl-method-match-autoderef-18514.rs
extern crate issue_18514 as ice;
extern crate generic_impl_method_match_autoderef_18514 as ice;
use ice::{Tr, St};
fn main() {
let st: St<()> = St(vec![]);
st.tr();
}
// https://github.com/rust-lang/rust/issues/18514

View file

@ -4,6 +4,7 @@
//@ revisions: default strict
//@ [strict]compile-flags: -Zstrict-init-checks
//@ needs-subprocess
//@ ignore-backends: gcc
#![allow(deprecated, invalid_value)]
#![feature(never_type)]

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
// Check that values are not leaked when a dtor panics (#14875)

View file

@ -1,13 +0,0 @@
//@ run-pass
//@ aux-build:issue-2472-b.rs
extern crate issue_2472_b;
use issue_2472_b::{S, T};
pub fn main() {
let s = S(());
s.foo();
s.bar();
}

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
use std::panic;

View file

@ -1,9 +0,0 @@
//@ aux-build:issue-49544.rs
//@ check-pass
extern crate issue_49544;
use issue_49544::foo;
fn main() {
let _ = foo();
}

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
//@ compile-flags: -C debug_assertions=yes
use std::panic;

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
//@ compile-flags: -C overflow-checks
use std::panic;

View file

@ -0,0 +1,11 @@
//@ aux-build:iterator-adapter-undeclared-type-49544.rs
//@ check-pass
extern crate iterator_adapter_undeclared_type_49544 as lib;
use lib::foo;
fn main() {
let _ = foo();
}
// https://github.com/rust-lang/rust/issues/49544

View file

@ -2,6 +2,7 @@
//@ compile-flags: -Clto=thin
//@ no-prefer-dynamic
//@ ignore-backends: gcc
fn main() {
println!("hello!");

View file

@ -1,3 +1,4 @@
//@ ignore-backends: gcc
//@ compile-flags: -C lto=thin
//@ aux-build:lto-rustc-loads-linker-plugin.rs
//@ run-pass

View file

@ -4,6 +4,7 @@
//@ aux-build:thin-lto-inlines-aux.rs
//@ no-prefer-dynamic
//@ ignore-emscripten can't inspect instructions on emscripten
//@ ignore-backends: gcc
// We want to assert here that ThinLTO will inline across codegen units. There's
// not really a great way to do that in general so we sort of hack around it by

View file

@ -17,3 +17,5 @@ fn g() {
}
fn main() {}
// https://github.com/rust-lang/rust/issues/34418

View file

@ -20,3 +20,5 @@ impl !Send for TestType<i32> {}
//~^ ERROR `!Send` impls cannot be specialized
fn main() {}
// https://github.com/rust-lang/rust/issues/106755

View file

@ -1,5 +1,5 @@
error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
--> $DIR/issue-106755.rs:13:1
--> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:13:1
|
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
| ------------------------------------------------------ positive implementation here
@ -8,7 +8,7 @@ LL | impl<T: MyTrait> !Send for TestType<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>`
--> $DIR/issue-106755.rs:17:1
--> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:17:1
|
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
| ------------------------------------------------------ first implementation here
@ -17,26 +17,26 @@ LL | unsafe impl<T: 'static> Send for TestType<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
error[E0367]: `!Send` impl requires `T: MyTrait` but the struct it is implemented for does not
--> $DIR/issue-106755.rs:13:9
--> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:13:9
|
LL | impl<T: MyTrait> !Send for TestType<T> {}
| ^^^^^^^
|
note: the implementor must specify the same requirement
--> $DIR/issue-106755.rs:9:1
--> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:9:1
|
LL | struct TestType<T>(::std::marker::PhantomData<T>);
| ^^^^^^^^^^^^^^^^^^
error[E0366]: `!Send` impls cannot be specialized
--> $DIR/issue-106755.rs:19:1
--> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:19:1
|
LL | impl !Send for TestType<i32> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `i32` is not a generic parameter
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/issue-106755.rs:9:1
--> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:9:1
|
LL | struct TestType<T>(::std::marker::PhantomData<T>);
| ^^^^^^^^^^^^^^^^^^

View file

@ -17,3 +17,5 @@ pub fn crash() -> bool {
}
fn main() {}
// https://github.com/rust-lang/rust/issues/46964

View file

@ -24,3 +24,5 @@ fn main() {
let pin = Pin(&mut unit);
pin.poll();
}
// https://github.com/rust-lang/rust/issues/53843

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
use std::cell::RefCell;
use std::panic;

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
//@ edition: 2024
// See `mir_drop_order.rs` for more information

View file

@ -1,5 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
//@ revisions: edition2021 edition2024
//@ [edition2021] edition: 2021
//@ [edition2024] edition: 2024

Some files were not shown because too many files have changed in this diff Show more