@@ -77,7 +77,7 @@ use middle::def;
77
77
use middle:: infer;
78
78
use middle:: region;
79
79
use middle:: subst;
80
- use middle:: ty:: { self , Ty } ;
80
+ use middle:: ty:: { self , Ty , HasTypeFlags } ;
81
81
use middle:: ty:: { Region , ReFree } ;
82
82
83
83
use std:: cell:: { Cell , RefCell } ;
@@ -226,7 +226,7 @@ pub trait ErrorReporting<'tcx> {
226
226
227
227
fn values_str ( & self , values : & ValuePairs < ' tcx > ) -> Option < String > ;
228
228
229
- fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > > (
229
+ fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > + HasTypeFlags > (
230
230
& self ,
231
231
exp_found : & ty:: expected_found < T > )
232
232
-> Option < String > ;
@@ -504,18 +504,18 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
504
504
}
505
505
}
506
506
507
- fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > > (
507
+ fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > + HasTypeFlags > (
508
508
& self ,
509
509
exp_found : & ty:: expected_found < T > )
510
510
-> Option < String >
511
511
{
512
512
let expected = exp_found. expected . resolve ( self ) ;
513
- if expected. contains_error ( ) {
513
+ if expected. references_error ( ) {
514
514
return None ;
515
515
}
516
516
517
517
let found = exp_found. found . resolve ( self ) ;
518
- if found. contains_error ( ) {
518
+ if found. references_error ( ) {
519
519
return None ;
520
520
}
521
521
@@ -1793,26 +1793,19 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
1793
1793
1794
1794
pub trait Resolvable < ' tcx > {
1795
1795
fn resolve < ' a > ( & self , infcx : & InferCtxt < ' a , ' tcx > ) -> Self ;
1796
- fn contains_error ( & self ) -> bool ;
1797
1796
}
1798
1797
1799
1798
impl < ' tcx > Resolvable < ' tcx > for Ty < ' tcx > {
1800
1799
fn resolve < ' a > ( & self , infcx : & InferCtxt < ' a , ' tcx > ) -> Ty < ' tcx > {
1801
1800
infcx. resolve_type_vars_if_possible ( self )
1802
1801
}
1803
- fn contains_error ( & self ) -> bool {
1804
- ty:: type_is_error ( * self )
1805
- }
1806
1802
}
1807
1803
1808
1804
impl < ' tcx > Resolvable < ' tcx > for ty:: TraitRef < ' tcx > {
1809
1805
fn resolve < ' a > ( & self , infcx : & InferCtxt < ' a , ' tcx > )
1810
1806
-> ty:: TraitRef < ' tcx > {
1811
1807
infcx. resolve_type_vars_if_possible ( self )
1812
1808
}
1813
- fn contains_error ( & self ) -> bool {
1814
- ty:: trait_ref_contains_error ( self )
1815
- }
1816
1809
}
1817
1810
1818
1811
impl < ' tcx > Resolvable < ' tcx > for ty:: PolyTraitRef < ' tcx > {
@@ -1822,10 +1815,6 @@ impl<'tcx> Resolvable<'tcx> for ty::PolyTraitRef<'tcx> {
1822
1815
{
1823
1816
infcx. resolve_type_vars_if_possible ( self )
1824
1817
}
1825
-
1826
- fn contains_error ( & self ) -> bool {
1827
- ty:: trait_ref_contains_error ( & self . 0 )
1828
- }
1829
1818
}
1830
1819
1831
1820
fn lifetimes_in_scope ( tcx : & ty:: ctxt ,
0 commit comments