ty: projections in transparent_newtype_field
This commit modifies `transparent_newtype_field` so that it handles projections with generic parameters, where `normalize_erasing_regions` would ICE. Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
parent
a39c7787ba
commit
d5b07373ce
3 changed files with 50 additions and 4 deletions
21
src/test/ui/lint/lint-ctypes-73249-1.rs
Normal file
21
src/test/ui/lint/lint-ctypes-73249-1.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// check-pass
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Foo {
|
||||
type Assoc: 'static;
|
||||
}
|
||||
|
||||
impl Foo for () {
|
||||
type Assoc = u32;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn lint_me(x: Bar<()>);
|
||||
}
|
||||
|
||||
#[repr(transparent)]
|
||||
pub struct Bar<T: Foo> {
|
||||
value: &'static <T as Foo>::Assoc,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
21
src/test/ui/lint/lint-ctypes-73249.rs
Normal file
21
src/test/ui/lint/lint-ctypes-73249.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// check-pass
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Foo {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl Foo for () {
|
||||
type Assoc = u32;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn lint_me(x: Bar<()>);
|
||||
}
|
||||
|
||||
#[repr(transparent)]
|
||||
pub struct Bar<T: Foo> {
|
||||
value: <T as Foo>::Assoc,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue