File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/librustc_trait_selection/traits/error_reporting Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1820,6 +1820,12 @@ impl<'v> Visitor<'v> for FindTypeParam {
18201820 }
18211821
18221822 fn visit_ty ( & mut self , ty : & hir:: Ty < ' _ > ) {
1823+ // We collect the spans of all uses of the "bare" type param, like in `field: T` or
1824+ // `field: (T, T)` where we could make `T: ?Sized` while skipping cases that are known to be
1825+ // valid like `field: &'a T` or `field: *mut T` and cases that *might* have further `Sized`
1826+ // obligations like `Box<T>` and `Vec<T>`, but we perform no extra analysis for those cases
1827+ // and suggest `T: ?Sized` regardless of their obligations. This is fine because the errors
1828+ // in that case should make what happened clear enough.
18231829 match ty. kind {
18241830 hir:: TyKind :: Ptr ( _) | hir:: TyKind :: Rptr ( ..) | hir:: TyKind :: TraitObject ( ..) => { }
18251831 hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , path) )
You can’t perform that action at this time.
0 commit comments