-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #99091 - compiler-errors:private-types-should-stay-pr…
…ivate, r=lcnr Do not mention private types from other crates as impl candidates Fixes #99080
- Loading branch information
Showing
5 changed files
with
69 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pub trait Meow { | ||
fn meow(&self) {} | ||
} | ||
|
||
pub struct GlobalMeow; | ||
|
||
impl Meow for GlobalMeow {} | ||
|
||
pub(crate) struct PrivateMeow; | ||
|
||
impl Meow for PrivateMeow {} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// aux-build:meow.rs | ||
|
||
extern crate meow; | ||
|
||
use meow::Meow; | ||
|
||
fn needs_meow<T: Meow>(t: T) {} | ||
|
||
fn main() { | ||
needs_meow(1usize); | ||
//~^ ERROR the trait bound `usize: Meow` is not satisfied | ||
} | ||
|
||
struct LocalMeow; | ||
|
||
impl Meow for LocalMeow {} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0277]: the trait bound `usize: Meow` is not satisfied | ||
--> $DIR/issue-99080.rs:10:16 | ||
| | ||
LL | needs_meow(1usize); | ||
| ---------- ^^^^^^ the trait `Meow` is not implemented for `usize` | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
= help: the following other types implement trait `Meow`: | ||
GlobalMeow | ||
LocalMeow | ||
note: required by a bound in `needs_meow` | ||
--> $DIR/issue-99080.rs:7:18 | ||
| | ||
LL | fn needs_meow<T: Meow>(t: T) {} | ||
| ^^^^ required by this bound in `needs_meow` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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