Skip to main content

get_size2/impls/core_impls/
references.rs

1use crate::GetSize;
2
3// A reference only borrows its data, which belongs to whoever owns it, so all of these report a
4// heap size of zero. The `?Sized` bound covers unsized targets as well, e.g. `&[T]`, `&str` and
5// `&dyn Trait`.
6
7impl<T: ?Sized> GetSize for &T {}
8impl<T: ?Sized> GetSize for &mut T {}
9impl<T: ?Sized> GetSize for *const T {}
10impl<T: ?Sized> GetSize for *mut T {}