Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub(crate) fn target() -> Target {
linker: Some("rust-lld".into()),
llvm_abiname: LlvmAbi::Ilp32d,
max_atomic_width: Some(32),
mcount: "_mcount".into(),
relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
..Default::default()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
linker: Some("rust-lld".into()),
llvm_abiname: LlvmAbi::Ilp32s,
max_atomic_width: Some(32),
mcount: "_mcount".into(),
relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
..Default::default()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
features: "+f,+d,+lsx,+relax".into(),
llvm_abiname: LlvmAbi::Lp64d,
max_atomic_width: Some(64),
mcount: "_mcount".into(),
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::LEAK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
features: "+f,+d,+lsx,+relax".into(),
llvm_abiname: LlvmAbi::Lp64d,
max_atomic_width: Some(64),
mcount: "_mcount".into(),
crt_static_default: false,
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
features: "+f,+d,+lsx,+relax".into(),
llvm_abiname: LlvmAbi::Lp64d,
max_atomic_width: Some(64),
mcount: "_mcount".into(),
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::LEAK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub(crate) fn target() -> Target {
linker: Some("rust-lld".into()),
llvm_abiname: LlvmAbi::Lp64d,
max_atomic_width: Some(64),
mcount: "_mcount".into(),
relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
code_model: Some(CodeModel::Medium),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
linker: Some("rust-lld".into()),
llvm_abiname: LlvmAbi::Lp64s,
max_atomic_width: Some(64),
mcount: "_mcount".into(),
relocation_model: RelocModel::Static,
panic_strategy: PanicStrategy::Abort,
code_model: Some(CodeModel::Medium),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
"overflow assigning `{a}` to `{b}`",
)
}
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(term)) => {
let term = with_short_path(self.tcx, term);
struct_span_code_err!(
self.dcx(),
span,
E0275,
"overflow evaluating whether `{term}` is well-formed",
)
}
_ => {
let pred_str = with_short_path(self.tcx, predicate);
struct_span_code_err!(
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/associated-types/issue-64855-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// also inadvertently a test for the (non-)co-inductiveness of WF predicates.

pub struct Bar<'a>(&'a Self) where Self: ;
//~^ ERROR overflow evaluating the requirement `Bar<'a> well-formed`
//~^ ERROR overflow evaluating whether `Bar<'a>` is well-formed

fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/associated-types/issue-64855-2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `Bar<'a> well-formed`
error[E0275]: overflow evaluating whether `Bar<'a>` is well-formed
--> $DIR/issue-64855-2.rs:5:36
|
LL | pub struct Bar<'a>(&'a Self) where Self: ;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/associated-types/issue-64855.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pub trait Foo {

pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
//~^ ERROR the trait bound `Bar<T>: Foo` is not satisfied
//~| ERROR overflow evaluating the requirement `Bar<T> well-formed`
//~| ERROR overflow evaluating whether `Bar<T>` is well-formed

fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/associated-types/issue-64855.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ help: this trait has no implementations, consider adding one
LL | pub trait Foo {
| ^^^^^^^^^^^^^

error[E0275]: overflow evaluating the requirement `Bar<T> well-formed`
error[E0275]: overflow evaluating whether `Bar<T>` is well-formed
--> $DIR/issue-64855.rs:9:46
|
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ struct U;
struct S<const N: U>()
where
S<{ U }>:;
//~^ ERROR: overflow evaluating the requirement `S<{ U }> well-formed`
//~^ ERROR: overflow evaluating whether `S<{ U }>` is well-formed

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `S<{ U }> well-formed`
error[E0275]: overflow evaluating whether `S<{ U }>` is well-formed
--> $DIR/adt_wf_hang.rs:11:5
|
LL | S<{ U }>:;
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/const-generics/mgca/const-ctor-overflow-eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use std::marker::ConstParamTy;
struct U;

#[derive(ConstParamTy, PartialEq, Eq)]
//~^ ERROR overflow evaluating the requirement `S<U> well-formed`
//~| ERROR overflow evaluating the requirement `S<U> well-formed`
//~^ ERROR overflow evaluating whether `S<U>` is well-formed
//~| ERROR overflow evaluating whether `S<U>` is well-formed

struct S<const N: U>()
where
S<{ U }>:;
//~^ ERROR overflow evaluating the requirement `S<U> well-formed`
//~| ERROR overflow evaluating the requirement `S<U> well-formed`
//~| ERROR overflow evaluating the requirement `S<U> well-formed`
//~^ ERROR overflow evaluating whether `S<U>` is well-formed
//~| ERROR overflow evaluating whether `S<U>` is well-formed
//~| ERROR overflow evaluating whether `S<U>` is well-formed

fn main() {}
10 changes: 5 additions & 5 deletions tests/ui/const-generics/mgca/const-ctor-overflow-eval.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `S<U> well-formed`
error[E0275]: overflow evaluating whether `S<U>` is well-formed
--> $DIR/const-ctor-overflow-eval.rs:14:5
|
LL | S<{ U }>:;
Expand All @@ -13,7 +13,7 @@ LL | where
LL | S<{ U }>:;
| ^^^^^^^^ required by this bound in `S`

error[E0275]: overflow evaluating the requirement `S<U> well-formed`
error[E0275]: overflow evaluating whether `S<U>` is well-formed
--> $DIR/const-ctor-overflow-eval.rs:14:5
|
LL | S<{ U }>:;
Expand All @@ -29,7 +29,7 @@ LL | S<{ U }>:;
| ^^^^^^^^ required by this bound in `S`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0275]: overflow evaluating the requirement `S<U> well-formed`
error[E0275]: overflow evaluating whether `S<U>` is well-formed
--> $DIR/const-ctor-overflow-eval.rs:14:5
|
LL | S<{ U }>:;
Expand All @@ -45,7 +45,7 @@ LL | S<{ U }>:;
| ^^^^^^^^ required by this bound in `S`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0275]: overflow evaluating the requirement `S<U> well-formed`
error[E0275]: overflow evaluating whether `S<U>` is well-formed
--> $DIR/const-ctor-overflow-eval.rs:8:24
|
LL | #[derive(ConstParamTy, PartialEq, Eq)]
Expand All @@ -60,7 +60,7 @@ LL | where
LL | S<{ U }>:;
| ^^^^^^^^ required by this bound in `S`

error[E0275]: overflow evaluating the requirement `S<U> well-formed`
error[E0275]: overflow evaluating whether `S<U>` is well-formed
--> $DIR/const-ctor-overflow-eval.rs:8:35
|
LL | #[derive(ConstParamTy, PartialEq, Eq)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/higher-ranked/trait-bounds/issue-95230.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
pub struct Bar
where
for<'a> &'a mut Self:;
//~^ ERROR overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
//~^ ERROR: overflow evaluating whether `&'a mut Bar` is well-formed

fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/higher-ranked/trait-bounds/issue-95230.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
error[E0275]: overflow evaluating whether `&'a mut Bar` is well-formed
--> $DIR/issue-95230.rs:7:13
|
LL | for<'a> &'a mut Self:;
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/traits/next-solver/alias-bound-unsound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl Foo for () {
fn main() {
let x = String::from("hello, world");
let _ = identity(<() as Foo>::copy_me(&x));
//~^ ERROR overflow evaluating the requirement `<() as Foo>::Item well-formed`
//~| ERROR overflow evaluating the requirement `&<() as Foo>::Item well-formed`
//~^ ERROR overflow evaluating whether `<() as Foo>::Item` is well-formed
//~| ERROR overflow evaluating whether `&<() as Foo>::Item` is well-formed
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == String`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/traits/next-solver/alias-bound-unsound.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ LL | let _ = identity(<() as Foo>::copy_me(&x));
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0275]: overflow evaluating the requirement `&<() as Foo>::Item well-formed`
error[E0275]: overflow evaluating whether `&<() as Foo>::Item` is well-formed
--> $DIR/alias-bound-unsound.rs:28:43
|
LL | let _ = identity(<() as Foo>::copy_me(&x));
| ^^

error[E0275]: overflow evaluating the requirement `<() as Foo>::Item well-formed`
error[E0275]: overflow evaluating whether `<() as Foo>::Item` is well-formed
--> $DIR/alias-bound-unsound.rs:28:22
|
LL | let _ = identity(<() as Foo>::copy_me(&x));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ LL | let s: String = transmute::<_, String>(vec![65_u8, 66, 67]);
|
= note: the return type of a function must have a statically known size

error[E0275]: overflow evaluating the requirement `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof well-formed`
error[E0275]: overflow evaluating whether `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof` is well-formed
--> $DIR/item-bound-via-impl-where-clause.rs:31:21
|
LL | let s: String = transmute::<_, String>(vec![65_u8, 66, 67]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main() {
//[next]~| ERROR overflow evaluating the requirement `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof == _`
//[next]~| ERROR overflow evaluating the requirement `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof == String`
//[next]~| ERROR overflow evaluating the requirement `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof: Sized`
//[next]~| ERROR overflow evaluating the requirement `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof well-formed`
//[next]~| ERROR overflow evaluating whether `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof` is well-formed
//[next]~| ERROR overflow evaluating the requirement `<<Vec<u8> as Trait<String>>::Proof as Trait<String>>::Proof == _`
println!("{}", s); // ABC
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
LL | Self::Assoc: A<T>,
| ^^^^

error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc well-formed`
error[E0275]: overflow evaluating whether `<() as A<T>>::Assoc` is well-formed
--> $DIR/normalize-param-env-2.rs:24:22
|
LL | Self::Assoc: A<T>,
Expand Down
31 changes: 31 additions & 0 deletions tests/ui/transmutability/transmute-from-const-args-ice-150457.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//! Ensure `TransmuteFrom` with `min_generic_const_args` doesn't ICE
//! during well-formedness checking.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/150457>.

//@ check-pass

#![feature(transmutability)]
#![feature(min_generic_const_args)]

use std::mem::{Assume, TransmuteFrom};

struct W<'a>(&'a ());

fn test<'a>()
where
W<'a>: TransmuteFrom<
(),
{
Assume {
alignment: const { true },
lifetimes: const { true },
safety: const { true },
validity: true,
}
},
>,
{
}

fn main() {}
Loading