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:
David Wood 2020-06-12 16:14:05 +01:00
parent 0cccaa0a27
commit a730d888ae
No known key found for this signature in database
GPG key ID: 2592E76C87381FD9
3 changed files with 26 additions and 14 deletions

View 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() {}