#![warn(clippy::non_send_fields_in_send_ty)] #![feature(extern_types)] use std::rc::Rc; // Basic tests should not be affected pub struct NoGeneric { rc_is_not_send: Rc, } unsafe impl Send for NoGeneric {} pub struct MultiField { field1: T, field2: T, field3: T, } unsafe impl Send for MultiField {} pub enum MyOption { MySome(T), MyNone, } unsafe impl Send for MyOption {} // All fields are disallowed when raw pointer heuristic is off extern "C" { type NonSend; } pub struct HeuristicTest { field1: Vec<*const NonSend>, field2: [*const NonSend; 3], field3: (*const NonSend, *const NonSend, *const NonSend), field4: (*const NonSend, Rc), field5: Vec>, } unsafe impl Send for HeuristicTest {} fn main() {}