Lines Matching refs:ty

45     for ty in cx.types {
46 match ty {
49 Type::RustVec(ty) => check_type_rust_vec(cx, ty),
54 Type::Ref(ty) => check_type_ref(cx, ty),
55 Type::Ptr(ty) => check_type_ptr(cx, ty),
57 Type::Fn(ty) => check_type_fn(cx, ty),
58 Type::SliceRef(ty) => check_type_slice_ref(cx, ty),
113 fn check_type_rust_vec(cx: &mut Check, ty: &Ty1) {
114 match &ty.inner {
121 cx.error(ty, "Rust Vec containing C++ type is not supported yet");
136 cx.error(ty, "unsupported element type of Vec");
221 fn check_type_ref(cx: &mut Check, ty: &Ref) {
222 if ty.mutable && !ty.pinned {
223 if let Some(requires_pin) = match &ty.inner {
231 ty,
240 match ty.inner {
243 cx.error(ty, "C++ does not allow references to references");
249 cx.error(ty, "unsupported reference type");
252 fn check_type_ptr(cx: &mut Check, ty: &Ptr) {
253 match ty.inner {
256 cx.error(ty, "C++ does not allow pointer to reference as a type");
262 cx.error(ty, "unsupported pointer type");
265 fn check_type_slice_ref(cx: &mut Check, ty: &SliceRef) {
266 let supported = !is_unsized(cx, &ty.inner)
267 || match &ty.inner {
275 let mutable = if ty.mutable { "mut " } else { "" };
277 if let Type::Ident(ident) = &ty.inner {
282 cx.error(ty, msg);
286 fn check_type_array(cx: &mut Check, ty: &Array) {
287 let supported = !is_unsized(cx, &ty.inner);
290 cx.error(ty, "unsupported array element type");
294 fn check_type_fn(cx: &mut Check, ty: &Signature) {
295 if ty.throws {
296 cx.error(ty, "function pointer returning Result is not supported yet");
299 for arg in &ty.args {
300 if let Type::Ptr(_) = arg.ty {
301 if ty.unsafety.is_none() {
336 if let Type::Fn(_) = field.ty {
341 } else if is_unsized(cx, &field.ty) {
342 let desc = describe(cx, &field.ty);
428 if receiver.ty.rust == "Self" {
438 } else if cx.types.enums.contains_key(&receiver.ty.rust) {
443 } else if !cx.types.structs.contains_key(&receiver.ty.rust)
444 && !cx.types.cxx.contains(&receiver.ty.rust)
445 && !cx.types.rust.contains(&receiver.ty.rust)
448 } else if receiver.mutable && !receiver.pinned && is_opaque_cxx(cx, &receiver.ty.rust) {
453 receiver.ty.rust,
460 if let Type::Fn(_) = arg.ty {
467 } else if let Type::Ptr(_) = arg.ty {
474 } else if is_unsized(cx, &arg.ty) {
475 let desc = describe(cx, &arg.ty);
481 if let Some(ty) = &efn.ret {
482 if let Type::Fn(_) = ty {
483 cx.error(ty, "returning a function pointer is not implemented yet");
484 } else if is_unsized(cx, ty) {
485 let desc = describe(cx, ty);
487 cx.error(ty, msg);
506 let ty = &imp.ty;
511 let span = quote!(#negative #ty);
516 match ty {
517 Type::RustBox(ty)
518 | Type::RustVec(ty)
519 | Type::UniquePtr(ty)
520 | Type::SharedPtr(ty)
521 | Type::WeakPtr(ty)
522 | Type::CxxVector(ty) => {
523 if let Type::Ident(inner) = &ty.inner {
542 Some(Type::Ref(ty)) if ty.mutable => {}
551 let resolve = match cx.types.try_resolve(&receiver.ty) {
566 fn visit_type(&mut self, ty: &'t Type) {
567 self.found |= match ty {
568 Type::Ref(ty) => ty.mutable,
578 visit::visit_type(self, ty);
585 visitor.visit_type(&arg.ty);
637 fn is_unsized(cx: &mut Check, ty: &Type) -> bool {
638 match ty {
657 fn is_opaque_cxx(cx: &mut Check, ty: &Ident) -> bool {
658 cx.types.cxx.contains(ty)
659 && !cx.types.structs.contains_key(ty)
660 && !cx.types.enums.contains_key(ty)
661 && !(cx.types.aliases.contains_key(ty) && cx.types.required_trivial.contains_key(ty))
686 let ty = &receiver.ty;
687 quote!(#ampersand #lifetime #mutability #ty)
698 fn describe(cx: &mut Check, ty: &Type) -> String {
699 match ty {