ty: simplify transparent_newtype_field
This commit removes the normalization from `transparent_newtype_field` - turns out it wasn't necessary and that makes it a bunch simpler - particularly when handling projections. Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
parent
0cccaa0a27
commit
a730d888ae
3 changed files with 26 additions and 14 deletions
24
src/test/ui/lint/lint-ctypes-73249-4.rs
Normal file
24
src/test/ui/lint/lint-ctypes-73249-4.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// check-pass
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
trait Foo {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl Foo for () {
|
||||
type Assoc = PhantomData<()>;
|
||||
}
|
||||
|
||||
#[repr(transparent)]
|
||||
struct Wow<T> where T: Foo<Assoc = PhantomData<T>> {
|
||||
x: <T as Foo>::Assoc,
|
||||
v: u32,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
fn test(v: Wow<()>);
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue