forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#116945 - estebank:sealed-trait-impls, r=pet…
…rochenkov When encountering sealed traits, point types that implement it ``` error[E0277]: the trait bound `S: d::Hidden` is not satisfied --> $DIR/sealed-trait-local.rs:53:20 | LL | impl c::Sealed for S {} | ^ the trait `d::Hidden` is not implemented for `S` | note: required by a bound in `c::Sealed` --> $DIR/sealed-trait-local.rs:17:23 | LL | pub trait Sealed: self::d::Hidden { | ^^^^^^^^^^^^^^^ required by this bound in `Sealed` = note: `Sealed` is a "sealed trait", because to implement it you also need to implement `c::d::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it = help: the following types implement the trait: - c::X - c::Y ``` The last `help` is new.
- Loading branch information
Showing
3 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,50 @@ | ||
error[E0277]: the trait bound `S: Hidden` is not satisfied | ||
--> $DIR/sealed-trait-local.rs:17:20 | ||
error[E0277]: the trait bound `S: b::Hidden` is not satisfied | ||
--> $DIR/sealed-trait-local.rs:52:20 | ||
| | ||
LL | impl a::Sealed for S {} | ||
| ^ the trait `Hidden` is not implemented for `S` | ||
| ^ the trait `b::Hidden` is not implemented for `S` | ||
| | ||
note: required by a bound in `Sealed` | ||
note: required by a bound in `a::Sealed` | ||
--> $DIR/sealed-trait-local.rs:3:23 | ||
| | ||
LL | pub trait Sealed: self::b::Hidden { | ||
| ^^^^^^^^^^^^^^^ required by this bound in `Sealed` | ||
= note: `Sealed` is a "sealed trait", because to implement it you also need to implement `a::b::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it | ||
= help: the following type implements the trait: | ||
a::X | ||
|
||
error: aborting due to previous error | ||
error[E0277]: the trait bound `S: d::Hidden` is not satisfied | ||
--> $DIR/sealed-trait-local.rs:53:20 | ||
| | ||
LL | impl c::Sealed for S {} | ||
| ^ the trait `d::Hidden` is not implemented for `S` | ||
| | ||
note: required by a bound in `c::Sealed` | ||
--> $DIR/sealed-trait-local.rs:17:23 | ||
| | ||
LL | pub trait Sealed: self::d::Hidden { | ||
| ^^^^^^^^^^^^^^^ required by this bound in `Sealed` | ||
= note: `Sealed` is a "sealed trait", because to implement it you also need to implement `c::d::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it | ||
= help: the following types implement the trait: | ||
c::X | ||
c::Y | ||
|
||
error[E0277]: the trait bound `S: f::Hidden` is not satisfied | ||
--> $DIR/sealed-trait-local.rs:54:20 | ||
| | ||
LL | impl e::Sealed for S {} | ||
| ^ the trait `f::Hidden` is not implemented for `S` | ||
| | ||
note: required by a bound in `e::Sealed` | ||
--> $DIR/sealed-trait-local.rs:35:23 | ||
| | ||
LL | pub trait Sealed: self::f::Hidden { | ||
| ^^^^^^^^^^^^^^^ required by this bound in `Sealed` | ||
= note: `Sealed` is a "sealed trait", because to implement it you also need to implement `e::f::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it | ||
= help: the following types implement the trait: | ||
e::X | ||
e::Y | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |