@@ -91,7 +91,7 @@ use rustc_middle::ty::fast_reject::SimplifiedTypeGen::{
91
91
ArraySimplifiedType , BoolSimplifiedType , CharSimplifiedType , FloatSimplifiedType , IntSimplifiedType ,
92
92
PtrSimplifiedType , SliceSimplifiedType , StrSimplifiedType , UintSimplifiedType ,
93
93
} ;
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 } ;
95
95
use rustc_middle:: ty:: { FloatTy , IntTy , UintTy } ;
96
96
use rustc_semver:: RustcVersion ;
97
97
use rustc_session:: Session ;
@@ -1891,31 +1891,6 @@ pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool {
1891
1891
}
1892
1892
}
1893
1893
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
-
1919
1894
/// Returns the `DefId` of the callee if the given expression is a function or method call.
1920
1895
pub fn fn_def_id ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> Option < DefId > {
1921
1896
match & expr. kind {
0 commit comments