-
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 #98159 - PrestonFrom:issue_95665, r=petrochenkov
Include ForeignItem when visiting types for WF check Addresses Issue 95665 by including `hir::Node::ForeignItem` as a valid type to visit in `diagnostic_hir_wf_check`. Fixes #95665
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
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,18 @@ | ||
// Regression test for the ICE described in #95665. | ||
// Ensure that the expected error is output (and thus that there is no ICE) | ||
|
||
pub trait Trait: {} | ||
|
||
pub struct Struct<T: Trait> { | ||
member: T, | ||
} | ||
|
||
// uncomment and bug goes away | ||
// impl Trait for u8 {} | ||
|
||
extern "C" { | ||
static VAR: Struct<u8>; | ||
//~^ 14:17: 14:27: the trait bound `u8: Trait` is not satisfied [E0277] | ||
} | ||
|
||
fn main() {} |
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,15 @@ | ||
error[E0277]: the trait bound `u8: Trait` is not satisfied | ||
--> $DIR/issue-95665.rs:14:17 | ||
| | ||
LL | static VAR: Struct<u8>; | ||
| ^^^^^^^^^^ the trait `Trait` is not implemented for `u8` | ||
| | ||
note: required by a bound in `Struct` | ||
--> $DIR/issue-95665.rs:6:22 | ||
| | ||
LL | pub struct Struct<T: Trait> { | ||
| ^^^^^ required by this bound in `Struct` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |