Lines Matching refs:CanDerive
9 use crate::ir::derive::CanDerive;
70 can_derive: HashMap<ItemId, CanDerive>,
110 can_derive: CanDerive, in insert() argument
120 if let CanDerive::Yes = can_derive { in insert()
140 fn constrain_type(&mut self, item: &Item, ty: &Type) -> CanDerive { in constrain_type() argument
146 CanDerive::Yes => trace!( in constrain_type()
150 CanDerive::Manually => trace!( in constrain_type()
154 CanDerive::No => trace!( in constrain_type()
167 return CanDerive::No; in constrain_type()
180 return CanDerive::No; in constrain_type()
184 ty.layout(self.ctx).map_or(CanDerive::Yes, |l| { in constrain_type()
189 CanDerive::Yes => { in constrain_type()
239 if inner_type != CanDerive::Yes { in constrain_type()
246 return CanDerive::No; in constrain_type()
255 return CanDerive::No; in constrain_type()
260 return CanDerive::Yes; in constrain_type()
267 return CanDerive::Manually; in constrain_type()
273 return CanDerive::Yes; in constrain_type()
278 if inner_type != CanDerive::Yes { in constrain_type()
285 return CanDerive::No; in constrain_type()
304 return CanDerive::No; in constrain_type()
319 return CanDerive::No; in constrain_type()
332 return CanDerive::No; in constrain_type()
341 return CanDerive::No; in constrain_type()
345 ty.layout(self.ctx).map_or(CanDerive::Yes, |l| { in constrain_type()
350 CanDerive::Yes => { in constrain_type()
374 return CanDerive::No; in constrain_type()
388 return CanDerive::No; in constrain_type()
418 ) -> CanDerive { in constrain_join() argument
437 … CanDerive::Yes => trace!(" member {:?} can derive {}", sub_id, self.derive_trait), in constrain_join()
438 …CanDerive::Manually => trace!(" member {:?} cannot derive {}, but it may be implemented", sub_i… in constrain_join()
439 … CanDerive::No => trace!(" member {:?} cannot derive {}", sub_id, self.derive_trait), in constrain_join()
442 *candidate.get_or_insert(CanDerive::Yes) |= can_derive; in constrain_join()
543 fn can_derive_fnptr(&self, f: &FunctionSig) -> CanDerive { in can_derive_fnptr() argument
547 CanDerive::Yes in can_derive_fnptr()
551 CanDerive::Manually in can_derive_fnptr()
555 CanDerive::No in can_derive_fnptr()
560 fn can_derive_vector(&self) -> CanDerive { in can_derive_vector() argument
567 CanDerive::No in can_derive_vector()
571 CanDerive::Yes in can_derive_vector()
576 fn can_derive_pointer(&self) -> CanDerive { in can_derive_pointer() argument
580 CanDerive::No in can_derive_pointer()
584 CanDerive::Yes in can_derive_pointer()
589 fn can_derive_simple(&self, kind: &TypeKind) -> CanDerive { in can_derive_simple() argument
601 CanDerive::No in can_derive_simple()
612 CanDerive::No in can_derive_simple()
617 CanDerive::Yes in can_derive_simple()
639 type Output = HashMap<ItemId, CanDerive>;
679 if let Some(CanDerive::No) = self.can_derive.get(&id).cloned() { in constrain()
688 if let CanDerive::Yes = can_derive { in constrain()
699 can_derive = CanDerive::Manually; in constrain()
723 impl<'ctx> From<CannotDerive<'ctx>> for HashMap<ItemId, CanDerive> {
728 .all(|v| *v != CanDerive::Yes)); in from()
739 can_derive: HashMap<ItemId, CanDerive>, in as_cannot_derive_set() argument
743 .filter_map(|(k, v)| if v != CanDerive::Yes { Some(k) } else { None }) in as_cannot_derive_set()