@@ -1069,13 +1069,13 @@ fn render_assoc_items(
10691069 return ;
10701070 }
10711071 if !traits. is_empty ( ) {
1072- let deref_impl = traits
1073- . iter ( )
1074- . find ( |t| t . inner_impl ( ) . trait_ . def_id_full ( cache ) == cache . deref_trait_did ) ;
1072+ let deref_impl = traits. iter ( ) . find ( |t| {
1073+ t . inner_impl ( ) . trait_ . def_id_full ( cache ) == cx . tcx ( ) . lang_items ( ) . deref_trait ( )
1074+ } ) ;
10751075 if let Some ( impl_) = deref_impl {
1076- let has_deref_mut = traits
1077- . iter ( )
1078- . any ( |t| t . inner_impl ( ) . trait_ . def_id_full ( cache ) == cache . deref_mut_trait_did ) ;
1076+ let has_deref_mut = traits. iter ( ) . any ( |t| {
1077+ t . inner_impl ( ) . trait_ . def_id_full ( cache ) == cx . tcx ( ) . lang_items ( ) . deref_mut_trait ( )
1078+ } ) ;
10791079 render_deref_methods ( w, cx, impl_, containing_item, has_deref_mut) ;
10801080 }
10811081 let ( synthetic, concrete) : ( Vec < & & Impl > , Vec < & & Impl > ) =
@@ -1165,7 +1165,7 @@ fn render_deref_methods(
11651165 }
11661166}
11671167
1168- fn should_render_item ( item : & clean:: Item , deref_mut_ : bool , cache : & Cache ) -> bool {
1168+ fn should_render_item ( item : & clean:: Item , deref_mut_ : bool , cx : & Context < ' _ > ) -> bool {
11691169 let self_type_opt = match * item. kind {
11701170 clean:: MethodItem ( ref method, _) => method. decl . self_type ( ) ,
11711171 clean:: TyMethodItem ( ref method) => method. decl . self_type ( ) ,
@@ -1179,7 +1179,7 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool, cache: &Cache) -> bo
11791179 ( mutability == Mutability :: Mut , false , false )
11801180 }
11811181 SelfTy :: SelfExplicit ( clean:: ResolvedPath { did, .. } ) => {
1182- ( false , Some ( did) == cache . owned_box_did , false )
1182+ ( false , Some ( did) == cx . tcx ( ) . lang_items ( ) . owned_box ( ) , false )
11831183 }
11841184 SelfTy :: SelfValue => ( false , false , true ) ,
11851185 _ => ( false , false , false ) ,
@@ -1302,7 +1302,7 @@ fn render_impl(
13021302 && match render_mode {
13031303 RenderMode :: Normal => true ,
13041304 RenderMode :: ForDeref { mut_ : deref_mut_ } => {
1305- should_render_item ( & item, deref_mut_, cx. cache ( ) )
1305+ should_render_item ( & item, deref_mut_, cx)
13061306 }
13071307 } ;
13081308
@@ -1800,13 +1800,13 @@ fn get_methods(
18001800 for_deref : bool ,
18011801 used_links : & mut FxHashSet < String > ,
18021802 deref_mut : bool ,
1803- cache : & Cache ,
1803+ cx : & Context < ' _ > ,
18041804) -> Vec < String > {
18051805 i. items
18061806 . iter ( )
18071807 . filter_map ( |item| match item. name {
18081808 Some ( ref name) if !name. is_empty ( ) && item. is_method ( ) => {
1809- if !for_deref || should_render_item ( item, deref_mut, cache ) {
1809+ if !for_deref || should_render_item ( item, deref_mut, cx ) {
18101810 Some ( format ! (
18111811 "<a href=\" #{}\" >{}</a>" ,
18121812 get_next_url( used_links, format!( "method.{}" , name) ) ,
@@ -1868,7 +1868,7 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
18681868 let mut ret = v
18691869 . iter ( )
18701870 . filter ( |i| i. inner_impl ( ) . trait_ . is_none ( ) )
1871- . flat_map ( move |i| get_methods ( i. inner_impl ( ) , false , used_links_bor, false , cache ) )
1871+ . flat_map ( move |i| get_methods ( i. inner_impl ( ) , false , used_links_bor, false , cx ) )
18721872 . collect :: < Vec < _ > > ( ) ;
18731873 if !ret. is_empty ( ) {
18741874 // We want links' order to be reproducible so we don't use unstable sort.
@@ -1886,11 +1886,9 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
18861886 }
18871887
18881888 if v. iter ( ) . any ( |i| i. inner_impl ( ) . trait_ . is_some ( ) ) {
1889- if let Some ( impl_) = v
1890- . iter ( )
1891- . filter ( |i| i. inner_impl ( ) . trait_ . is_some ( ) )
1892- . find ( |i| i. inner_impl ( ) . trait_ . def_id_full ( cache) == cache. deref_trait_did )
1893- {
1889+ if let Some ( impl_) = v. iter ( ) . filter ( |i| i. inner_impl ( ) . trait_ . is_some ( ) ) . find ( |i| {
1890+ i. inner_impl ( ) . trait_ . def_id_full ( cache) == cx. tcx ( ) . lang_items ( ) . deref_trait ( )
1891+ } ) {
18941892 sidebar_deref_methods ( cx, out, impl_, v) ;
18951893 }
18961894
@@ -1988,10 +1986,9 @@ fn sidebar_deref_methods(cx: &Context<'_>, out: &mut Buffer, impl_: &Impl, v: &V
19881986 }
19891987 }
19901988 }
1991- let deref_mut = v
1992- . iter ( )
1993- . filter ( |i| i. inner_impl ( ) . trait_ . is_some ( ) )
1994- . any ( |i| i. inner_impl ( ) . trait_ . def_id_full ( c) == c. deref_mut_trait_did ) ;
1989+ let deref_mut = v. iter ( ) . filter ( |i| i. inner_impl ( ) . trait_ . is_some ( ) ) . any ( |i| {
1990+ i. inner_impl ( ) . trait_ . def_id_full ( c) == cx. tcx ( ) . lang_items ( ) . deref_mut_trait ( )
1991+ } ) ;
19951992 let inner_impl = target
19961993 . def_id_full ( c)
19971994 . or_else ( || {
@@ -2004,7 +2001,7 @@ fn sidebar_deref_methods(cx: &Context<'_>, out: &mut Buffer, impl_: &Impl, v: &V
20042001 let mut ret = impls
20052002 . iter ( )
20062003 . filter ( |i| i. inner_impl ( ) . trait_ . is_none ( ) )
2007- . flat_map ( |i| get_methods ( i. inner_impl ( ) , true , & mut used_links, deref_mut, c ) )
2004+ . flat_map ( |i| get_methods ( i. inner_impl ( ) , true , & mut used_links, deref_mut, cx ) )
20082005 . collect :: < Vec < _ > > ( ) ;
20092006 if !ret. is_empty ( ) {
20102007 write ! (
0 commit comments