[Tests] Test assert_eq_size against Self type

The new implementation as of commit e48415c should enable this pattern.
This commit is contained in:
Nikolai Vazquez
2017-08-13 02:38:17 -04:00
parent e48415c19c
commit a4b1fcddea
+16
View File
@@ -8,6 +8,22 @@ assert_eq_size!(byte; u8, u8, (u8,), [u8; 1]);
#[cfg(feature = "failure")]
assert_eq_size!(byte; u8, u8);
mod assoc_type {
trait Trait {
type AssocItem;
}
impl<T> Trait for T {
type AssocItem = Self;
}
struct Value;
impl Value {
assert_eq_size!(test; <Self as Trait>::AssocItem, Self);
}
}
// Placed in separate module so that DropCounter's fields are private
mod dc {
/// A type that acts somewhat of a reference counter.