File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/tools/rust-analyzer/crates/hir-ty/src 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
349349 ControlFlow :: Continue ( ( ) )
350350 } else {
351351 let generic_params = db. generic_params ( item. into ( ) ) ;
352- if generic_params. len_type_or_consts ( ) > 0 {
352+ if ! generic_params. is_empty ( ) {
353353 cb ( ObjectSafetyViolation :: GAT ( it) )
354354 } else {
355355 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 {
378378 [ ( "Error" , vec ! [ ] ) ] ,
379379 ) ;
380380}
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