@@ -91,7 +91,7 @@ use rustc_middle::ty::fast_reject::SimplifiedTypeGen::{
9191 ArraySimplifiedType , BoolSimplifiedType , CharSimplifiedType , FloatSimplifiedType , IntSimplifiedType ,
9292 PtrSimplifiedType , SliceSimplifiedType , StrSimplifiedType , UintSimplifiedType ,
9393} ;
94- use rustc_middle:: ty:: { layout:: IntegerExt , BorrowKind , DefIdTree , Ty , TyCtxt , TypeAndMut , TypeFoldable , UpvarCapture } ;
94+ use rustc_middle:: ty:: { layout:: IntegerExt , BorrowKind , DefIdTree , Ty , TyCtxt , TypeAndMut , UpvarCapture } ;
9595use rustc_middle:: ty:: { FloatTy , IntTy , UintTy } ;
9696use rustc_semver:: RustcVersion ;
9797use rustc_session:: Session ;
@@ -1891,31 +1891,6 @@ pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool {
18911891 }
18921892}
18931893
1894- /// Check if it's even possible to satisfy the `where` clause for the item.
1895- ///
1896- /// `trivial_bounds` feature allows functions with unsatisfiable bounds, for example:
1897- ///
1898- /// ```ignore
1899- /// fn foo() where i32: Iterator {
1900- /// for _ in 2i32 {}
1901- /// }
1902- /// ```
1903- pub fn fn_has_unsatisfiable_preds ( cx : & LateContext < ' _ > , did : DefId ) -> bool {
1904- use rustc_trait_selection:: traits;
1905- let predicates = cx
1906- . tcx
1907- . predicates_of ( did)
1908- . predicates
1909- . iter ( )
1910- . filter_map ( |( p, _) | if p. is_global ( ) { Some ( * p) } else { None } ) ;
1911- traits:: impossible_predicates (
1912- cx. tcx ,
1913- traits:: elaborate_predicates ( cx. tcx , predicates)
1914- . map ( |o| o. predicate )
1915- . collect :: < Vec < _ > > ( ) ,
1916- )
1917- }
1918-
19191894/// Returns the `DefId` of the callee if the given expression is a function or method call.
19201895pub fn fn_def_id ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> Option < DefId > {
19211896 match & expr. kind {
0 commit comments