File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ fn check_type_ident(cx: &mut Check, ident: &Ident) {
76
76
fn check_type_box ( cx : & mut Check , ptr : & Ty1 ) {
77
77
if let Type :: Ident ( ident) = & ptr. inner {
78
78
if cx. types . cxx . contains ( & ident. rust )
79
+ && !cx. types . aliases . contains_key ( & ident. rust )
79
80
&& !cx. types . structs . contains_key ( & ident. rust )
80
81
&& !cx. types . enums . contains_key ( & ident. rust )
81
82
{
@@ -329,6 +330,7 @@ fn check_api_type(cx: &mut Check, ety: &ExternType) {
329
330
TrivialReason :: StructField ( strct) => format ! ( "a field of `{}`" , strct. name. rust) ,
330
331
TrivialReason :: FunctionArgument ( efn) => format ! ( "an argument of `{}`" , efn. name. rust) ,
331
332
TrivialReason :: FunctionReturn ( efn) => format ! ( "a return value of `{}`" , efn. name. rust) ,
333
+ TrivialReason :: BoxTarget => format ! ( "Box<{}>" , ety. name. rust) ,
332
334
TrivialReason :: VecElement => format ! ( "a vector element in Vec<{}>" , ety. name. rust) ,
333
335
} ;
334
336
let msg = format ! (
Original file line number Diff line number Diff line change @@ -202,9 +202,16 @@ impl<'a> Types<'a> {
202
202
}
203
203
}
204
204
for ty in & all {
205
- if let Type :: RustVec ( ty) = ty {
206
- let reason = TrivialReason :: VecElement ;
207
- insist_alias_types_are_trivial ( & ty. inner , reason) ;
205
+ match ty {
206
+ Type :: RustBox ( ty) => {
207
+ let reason = TrivialReason :: BoxTarget ;
208
+ insist_alias_types_are_trivial ( & ty. inner , reason) ;
209
+ }
210
+ Type :: RustVec ( ty) => {
211
+ let reason = TrivialReason :: VecElement ;
212
+ insist_alias_types_are_trivial ( & ty. inner , reason) ;
213
+ }
214
+ _ => { }
208
215
}
209
216
}
210
217
@@ -303,6 +310,7 @@ pub enum TrivialReason<'a> {
303
310
StructField ( & ' a Struct ) ,
304
311
FunctionArgument ( & ' a ExternFn ) ,
305
312
FunctionReturn ( & ' a ExternFn ) ,
313
+ BoxTarget ,
306
314
VecElement ,
307
315
}
308
316
You can’t perform that action at this time.
0 commit comments