• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // bindgen-flags: --with-derive-hash --with-derive-partialord --with-derive-ord --with-derive-partialeq --with-derive-eq --allowlist-type 'Allowlisted.*' --blocklist-type Blocklisted --raw-line "#[repr(C)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct Blocklisted<T> {t: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>> }"
2 //
3 template <class T>
4 struct Blocklisted {
5     T t;
6 };
7 
8 /// This would derive(Hash, Eq, PartialEq) if it didn't contain a blocklisted type,
9 /// causing us to conservatively avoid deriving hash/Eq/PartialEq for it.
10 struct AllowlistedOne {
11     Blocklisted<int> a;
12 };
13 
14 /// This can't derive(Hash/Eq) even if it didn't contain a blocklisted type.
15 struct AllowlistedTwo {
16     Blocklisted<float> b;
17 };
18