File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Original file line number Diff line number Diff line change @@ -242,17 +242,10 @@ fn is_ty_or_ty_ctxt(cx: &LateContext<'_>, path: &Path<'_>) -> Option<String> {
242
242
}
243
243
// Only lint on `&Ty` and `&TyCtxt` if it is used outside of a trait.
244
244
Res :: SelfTyAlias { alias_to : did, is_trait_impl : false , .. } => {
245
- if let ty:: Adt ( adt, args) = cx. tcx . type_of ( did) . instantiate_identity ( ) . kind ( ) {
246
- if let Some ( name @ ( sym:: Ty | sym:: TyCtxt ) ) = cx. tcx . get_diagnostic_name ( adt. did ( ) )
247
- {
248
- // NOTE: This path is currently unreachable as `Ty<'tcx>` is
249
- // defined as a type alias meaning that `impl<'tcx> Ty<'tcx>`
250
- // is not actually allowed.
251
- //
252
- // I(@lcnr) still kept this branch in so we don't miss this
253
- // if we ever change it in the future.
254
- return Some ( format ! ( "{}<{}>" , name, args[ 0 ] ) ) ;
255
- }
245
+ if let ty:: Adt ( adt, args) = cx. tcx . type_of ( did) . instantiate_identity ( ) . kind ( )
246
+ && let Some ( name @ ( sym:: Ty | sym:: TyCtxt ) ) = cx. tcx . get_diagnostic_name ( adt. did ( ) )
247
+ {
248
+ return Some ( format ! ( "{}<{}>" , name, args[ 0 ] ) ) ;
256
249
}
257
250
}
258
251
_ => ( ) ,
You can’t perform that action at this time.
0 commit comments