• Home
  • Raw
  • Download

Lines Matching refs:ty

29     for ty in cx.types {  in do_typecheck()
30 match ty { in do_typecheck()
33 Type::RustVec(ty) => check_type_rust_vec(cx, ty), in do_typecheck()
38 Type::Ref(ty) => check_type_ref(cx, ty), in do_typecheck()
39 Type::Ptr(ty) => check_type_ptr(cx, ty), in do_typecheck()
41 Type::Fn(ty) => check_type_fn(cx, ty), in do_typecheck()
42 Type::SliceRef(ty) => check_type_slice_ref(cx, ty), in do_typecheck()
97 fn check_type_rust_vec(cx: &mut Check, ty: &Ty1) { in check_type_rust_vec()
98 match &ty.inner { in check_type_rust_vec()
105 cx.error(ty, "Rust Vec containing C++ type is not supported yet"); in check_type_rust_vec()
121 cx.error(ty, "unsupported element type of Vec"); in check_type_rust_vec()
206 fn check_type_ref(cx: &mut Check, ty: &Ref) { in check_type_ref()
207 if ty.mutable && !ty.pinned { in check_type_ref()
208 if let Some(requires_pin) = match &ty.inner { in check_type_ref()
216 ty, in check_type_ref()
225 match ty.inner { in check_type_ref()
228 cx.error(ty, "C++ does not allow references to references"); in check_type_ref()
234 cx.error(ty, "unsupported reference type"); in check_type_ref()
237 fn check_type_ptr(cx: &mut Check, ty: &Ptr) { in check_type_ptr()
238 match ty.inner { in check_type_ptr()
241 cx.error(ty, "C++ does not allow pointer to reference as a type"); in check_type_ptr()
247 cx.error(ty, "unsupported pointer type"); in check_type_ptr()
250 fn check_type_slice_ref(cx: &mut Check, ty: &SliceRef) { in check_type_slice_ref()
251 let supported = !is_unsized(cx, &ty.inner) in check_type_slice_ref()
252 || match &ty.inner { in check_type_slice_ref()
258 let mutable = if ty.mutable { "mut " } else { "" }; in check_type_slice_ref()
260 if let Type::Ident(ident) = &ty.inner { in check_type_slice_ref()
265 cx.error(ty, msg); in check_type_slice_ref()
269 fn check_type_array(cx: &mut Check, ty: &Array) { in check_type_array()
270 let supported = !is_unsized(cx, &ty.inner); in check_type_array()
273 cx.error(ty, "unsupported array element type"); in check_type_array()
277 fn check_type_fn(cx: &mut Check, ty: &Signature) { in check_type_fn()
278 if ty.throws { in check_type_fn()
279 cx.error(ty, "function pointer returning Result is not supported yet"); in check_type_fn()
282 for arg in &ty.args { in check_type_fn()
283 if let Type::Ptr(_) = arg.ty { in check_type_fn()
284 if ty.unsafety.is_none() { in check_type_fn()
318 if let Type::Fn(_) = field.ty { in check_api_struct()
323 } else if is_unsized(cx, &field.ty) { in check_api_struct()
324 let desc = describe(cx, &field.ty); in check_api_struct()
406 if receiver.ty.rust == "Self" { in check_api_fn()
416 } else if cx.types.enums.contains_key(&receiver.ty.rust) { in check_api_fn()
421 } else if !cx.types.structs.contains_key(&receiver.ty.rust) in check_api_fn()
422 && !cx.types.cxx.contains(&receiver.ty.rust) in check_api_fn()
423 && !cx.types.rust.contains(&receiver.ty.rust) in check_api_fn()
426 } else if receiver.mutable && !receiver.pinned && is_opaque_cxx(cx, &receiver.ty.rust) { in check_api_fn()
431 receiver.ty.rust, in check_api_fn()
438 if let Type::Fn(_) = arg.ty { in check_api_fn()
445 } else if let Type::Ptr(_) = arg.ty { in check_api_fn()
452 } else if is_unsized(cx, &arg.ty) { in check_api_fn()
453 let desc = describe(cx, &arg.ty); in check_api_fn()
459 if let Some(ty) = &efn.ret { in check_api_fn()
460 if let Type::Fn(_) = ty { in check_api_fn()
461 cx.error(ty, "returning a function pointer is not implemented yet"); in check_api_fn()
462 } else if is_unsized(cx, ty) { in check_api_fn()
463 let desc = describe(cx, ty); in check_api_fn()
465 cx.error(ty, msg); in check_api_fn()
482 let ty = &imp.ty; in check_api_impl() localVariable
485 let span = quote!(#negative #ty); in check_api_impl()
490 match ty { in check_api_impl()
491 Type::RustBox(ty) in check_api_impl()
492 | Type::RustVec(ty) in check_api_impl()
493 | Type::UniquePtr(ty) in check_api_impl()
494 | Type::SharedPtr(ty) in check_api_impl()
495 | Type::WeakPtr(ty) in check_api_impl()
496 | Type::CxxVector(ty) => { in check_api_impl()
497 if let Type::Ident(inner) = &ty.inner { in check_api_impl()
516 Some(Type::Ref(ty)) if ty.mutable => {} in check_mut_return_restriction()
525 let resolve = match cx.types.try_resolve(&receiver.ty) { in check_mut_return_restriction()
540 fn visit_type(&mut self, ty: &'t Type) { in check_mut_return_restriction()
541 self.found |= match ty { in check_mut_return_restriction()
542 Type::Ref(ty) => ty.mutable, in check_mut_return_restriction()
552 visit::visit_type(self, ty); in check_mut_return_restriction()
559 visitor.visit_type(&arg.ty); in check_mut_return_restriction()
586 fn is_unsized(cx: &mut Check, ty: &Type) -> bool { in is_unsized()
587 match ty { in is_unsized()
606 fn is_opaque_cxx(cx: &mut Check, ty: &Ident) -> bool { in is_opaque_cxx()
607 cx.types.cxx.contains(ty) in is_opaque_cxx()
608 && !cx.types.structs.contains_key(ty) in is_opaque_cxx()
609 && !cx.types.enums.contains_key(ty) in is_opaque_cxx()
610 && !(cx.types.aliases.contains_key(ty) && cx.types.required_trivial.contains_key(ty)) in is_opaque_cxx()
635 let ty = &receiver.ty; in span_for_receiver_error() localVariable
636 quote!(#ampersand #lifetime #mutability #ty) in span_for_receiver_error()
647 fn describe(cx: &mut Check, ty: &Type) -> String { in describe()
648 match ty { in describe()