Fix slice restriction to exclude slice of CxxString

This commit is contained in:
David Tolnay 2021-01-02 23:07:18 -08:00
parent 4d7e4aa3a8
commit 10852ed506
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

@ -236,7 +236,7 @@ fn check_type_ref(cx: &mut Check, ty: &Ref) {
fn check_type_slice_ref(cx: &mut Check, ty: &SliceRef) {
let supported = match &ty.inner {
Type::Str(_) | Type::SliceRef(_) => false,
Type::Ident(ident) => !is_opaque_cxx(cx, &ident.rust),
Type::Ident(ident) => !is_unsized(cx, &ty.inner) || cx.types.rust.contains(&ident.rust),
element => !is_unsized(cx, element),
};