File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ where
349
349
ControlFlow :: Continue ( ( ) )
350
350
} else {
351
351
let generic_params = db. generic_params ( item. into ( ) ) ;
352
- if generic_params. len_type_or_consts ( ) > 0 {
352
+ if ! generic_params. is_empty ( ) {
353
353
cb ( ObjectSafetyViolation :: GAT ( it) )
354
354
} else {
355
355
ControlFlow :: Continue ( ( ) )
Original file line number Diff line number Diff line change @@ -378,3 +378,16 @@ pub trait Error: core::fmt::Debug + core::fmt::Display {
378
378
[ ( "Error" , vec ! [ ] ) ] ,
379
379
) ;
380
380
}
381
+
382
+ #[ test]
383
+ fn lifetime_gat_is_object_unsafe ( ) {
384
+ check_object_safety (
385
+ r#"
386
+ //- minicore: dispatch_from_dyn
387
+ trait Foo {
388
+ type Bar<'a>;
389
+ }
390
+ "# ,
391
+ [ ( "Foo" , vec ! [ ObjectSafetyViolationKind :: GAT ] ) ] ,
392
+ ) ;
393
+ }
You can’t perform that action at this time.
0 commit comments