File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -3411,19 +3411,6 @@ impl<'tcx> TyCtxt<'tcx> {
3411
3411
crate :: dep_graph:: make_metadata ( self )
3412
3412
}
3413
3413
3414
- /// Given an `impl_id`, return the trait it implements.
3415
- /// Return `None` if this is an inherent impl.
3416
- pub fn impl_trait_ref (
3417
- self ,
3418
- def_id : impl IntoQueryParam < DefId > ,
3419
- ) -> Option < ty:: EarlyBinder < ' tcx , ty:: TraitRef < ' tcx > > > {
3420
- Some ( self . impl_trait_header ( def_id) ?. trait_ref )
3421
- }
3422
-
3423
- pub fn impl_polarity ( self , def_id : impl IntoQueryParam < DefId > ) -> ty:: ImplPolarity {
3424
- self . impl_trait_header ( def_id) . map_or ( ty:: ImplPolarity :: Positive , |h| h. polarity )
3425
- }
3426
-
3427
3414
pub fn needs_coroutine_by_move_body_def_id ( self , def_id : DefId ) -> bool {
3428
3415
if let Some ( hir:: CoroutineKind :: Desugared ( _, hir:: CoroutineSource :: Closure ) ) =
3429
3416
self . coroutine_kind ( def_id)
Original file line number Diff line number Diff line change @@ -2005,6 +2005,19 @@ impl<'tcx> TyCtxt<'tcx> {
2005
2005
self . assoc_parent ( def_id) . filter ( |id| matches ! ( self . def_kind( id) , DefKind :: Impl { .. } ) )
2006
2006
}
2007
2007
2008
+ pub fn impl_polarity ( self , def_id : impl IntoQueryParam < DefId > ) -> ty:: ImplPolarity {
2009
+ self . impl_trait_header ( def_id) . map_or ( ty:: ImplPolarity :: Positive , |h| h. polarity )
2010
+ }
2011
+
2012
+ /// Given an `impl_id`, return the trait it implements.
2013
+ /// Return `None` if this is an inherent impl.
2014
+ pub fn impl_trait_ref (
2015
+ self ,
2016
+ def_id : impl IntoQueryParam < DefId > ,
2017
+ ) -> Option < ty:: EarlyBinder < ' tcx , ty:: TraitRef < ' tcx > > > {
2018
+ Some ( self . impl_trait_header ( def_id) ?. trait_ref )
2019
+ }
2020
+
2008
2021
pub fn is_exportable ( self , def_id : DefId ) -> bool {
2009
2022
self . exportable_items ( def_id. krate ) . contains ( & def_id)
2010
2023
}
You can’t perform that action at this time.
0 commit comments