File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ impl ItemId {
7575 }
7676 }
7777
78+ #[ inline]
79+ crate fn is_local_impl ( self ) -> bool {
80+ match self {
81+ ItemId :: Blanket { impl_id, .. } => impl_id. is_local ( ) ,
82+ ItemId :: Auto { .. } | ItemId :: DefId ( _) | ItemId :: Primitive ( _, _) => false ,
83+ }
84+ }
85+
7886 #[ inline]
7987 #[ track_caller]
8088 crate fn expect_def_id ( self ) -> DefId {
Original file line number Diff line number Diff line change @@ -172,7 +172,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
172172 /// implementations filled out before they're inserted.
173173 fn item ( & mut self , item : clean:: Item ) -> Result < ( ) , Error > {
174174 // Flatten items that recursively store other items
175- item. kind . inner_items ( ) . for_each ( |i| self . item ( i. clone ( ) ) . unwrap ( ) ) ;
175+ // We skip local blanket implementations, as we'll have already seen the actual generic
176+ // impl, and the generated ones don't need documenting.
177+ if !item. def_id . is_local_impl ( ) {
178+ item. kind . inner_items ( ) . for_each ( |i| self . item ( i. clone ( ) ) . unwrap ( ) ) ;
179+ }
176180
177181 let id = item. def_id ;
178182 if let Some ( mut new_item) = self . convert_item ( item) {
Original file line number Diff line number Diff line change 1+ // Test for the ICE in rust/83718
2+ // A blanket impl plus a local type together shouldn't result in mismatched ID issues
3+
4+ // @has method_abi.json "$.index[*][?(@.name=='Load')]"
5+ pub trait Load {
6+ fn load ( ) { }
7+ }
8+
9+ impl < P > Load for P {
10+ fn load ( ) { }
11+ }
12+
13+ // @has - "$.index[*][?(@.name=='Wrapper')]"
14+ pub struct Wrapper { }
You can’t perform that action at this time.
0 commit comments