Skip to content

Commit 3f5d6b2

Browse files
authored
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``
2 parents 2c43388 + 378902e commit 3f5d6b2

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

library/core/src/marker.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,6 @@ pub mod effects {
10971097
pub trait TyCompat<T: ?Sized> {}
10981098

10991099
impl<T: ?Sized> TyCompat<T> for T {}
1100-
impl<T: ?Sized> TyCompat<T> for Maybe {}
11011100
impl<T: ?Sized> TyCompat<Maybe> for T {}
11021101

11031102
#[lang = "EffectsIntersection"]

tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ check-pass
1+
//~ ERROR the trait bound
22
//@ compile-flags: -Znext-solver
33

44
#![allow(incomplete_features)]
@@ -17,6 +17,6 @@ impl Foo for S {
1717
}
1818

1919
impl const Bar for S {}
20-
//FIXME ~^ ERROR the trait bound
20+
// FIXME(effects) bad span
2121

2222
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0277]: the trait bound `Maybe: TyCompat<<(Foo::{synthetic#0},) as std::marker::effects::Intersection>::Output>` is not satisfied
2+
|
3+
note: required by a bound in `Bar::{synthetic#0}`
4+
--> $DIR/super-traits-fail.rs:11:1
5+
|
6+
LL | #[const_trait]
7+
| ^^^^^^^^^^^^^^ required by this bound in `Bar::{synthetic#0}`
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)