Rollup merge of #129500 - fee1-dead-contrib:fxrel, r=compiler-errors

remove invalid `TyCompat` relation for effects

if the current impl uses `Maybe` (`impl const`), the parent impl must use `Maybe` (`impl const`) as well.

I'd like to rename `TyCompat` to `Sub` which is probably clearer. But it would conflict with my other PR.

r? ``@rust-lang/project-const-traits``
This commit is contained in:
Matthias Krüger 2024-08-24 22:14:14 +02:00 committed by GitHub
commit 3f5d6b2e40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View File

@ -1097,7 +1097,6 @@ impl<#[rustc_runtime] const RUNTIME: bool> Compat<RUNTIME> for Maybe {}
pub trait TyCompat<T: ?Sized> {}
impl<T: ?Sized> TyCompat<T> for T {}
impl<T: ?Sized> TyCompat<T> for Maybe {}
impl<T: ?Sized> TyCompat<Maybe> for T {}
#[lang = "EffectsIntersection"]

View File

@ -1,4 +1,4 @@
//@ check-pass
//~ ERROR the trait bound
//@ compile-flags: -Znext-solver
#![allow(incomplete_features)]
@ -17,6 +17,6 @@ fn a(&self) {}
}
impl const Bar for S {}
//FIXME ~^ ERROR the trait bound
// FIXME(effects) bad span
fn main() {}

View File

@ -0,0 +1,11 @@
error[E0277]: the trait bound `Maybe: TyCompat<<(Foo::{synthetic#0},) as std::marker::effects::Intersection>::Output>` is not satisfied
|
note: required by a bound in `Bar::{synthetic#0}`
--> $DIR/super-traits-fail.rs:11:1
|
LL | #[const_trait]
| ^^^^^^^^^^^^^^ required by this bound in `Bar::{synthetic#0}`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.