-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This does only error once we actually use foo
.
pub trait Unsatisfied {}
#[repr(transparent)]
pub struct Foo<T: Unsatisfied>(T);
extern "C" {
pub fn foo() -> Foo<u32>;
}
The following errors when we declare foo
pub trait Unsatisfied {}
#[repr(transparent)]
pub struct Foo<T: Unsatisfied>(T);
trait A {
fn test() -> Foo<u32>;
//~^ the trait bound `u32: Unsatisfied` is not satisfied
}
Extern statics are also checked:
pub trait Unsatisfied {}
#[repr(transparent)]
pub struct Foo<T: Unsatisfied>(T);
extern "C" {
static FOO: Foo<u32>;
//~^ the trait bound `u32: Unsatisfied` is not satisfied
}
I expected that we also check the well formedness of function declarations in extern blocks
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.