@@ -77,7 +77,7 @@ use middle::def;
7777use middle:: infer;
7878use middle:: region;
7979use middle:: subst;
80- use middle:: ty:: { self , Ty } ;
80+ use middle:: ty:: { self , Ty , HasTypeFlags } ;
8181use middle:: ty:: { Region , ReFree } ;
8282
8383use std:: cell:: { Cell , RefCell } ;
@@ -226,7 +226,7 @@ pub trait ErrorReporting<'tcx> {
226226
227227 fn values_str ( & self , values : & ValuePairs < ' tcx > ) -> Option < String > ;
228228
229- fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > > (
229+ fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > + HasTypeFlags > (
230230 & self ,
231231 exp_found : & ty:: expected_found < T > )
232232 -> Option < String > ;
@@ -504,18 +504,18 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
504504 }
505505 }
506506
507- fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > > (
507+ fn expected_found_str < T : fmt:: Display + Resolvable < ' tcx > + HasTypeFlags > (
508508 & self ,
509509 exp_found : & ty:: expected_found < T > )
510510 -> Option < String >
511511 {
512512 let expected = exp_found. expected . resolve ( self ) ;
513- if expected. contains_error ( ) {
513+ if expected. references_error ( ) {
514514 return None ;
515515 }
516516
517517 let found = exp_found. found . resolve ( self ) ;
518- if found. contains_error ( ) {
518+ if found. references_error ( ) {
519519 return None ;
520520 }
521521
@@ -1793,26 +1793,19 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
17931793
17941794pub trait Resolvable < ' tcx > {
17951795 fn resolve < ' a > ( & self , infcx : & InferCtxt < ' a , ' tcx > ) -> Self ;
1796- fn contains_error ( & self ) -> bool ;
17971796}
17981797
17991798impl < ' tcx > Resolvable < ' tcx > for Ty < ' tcx > {
18001799 fn resolve < ' a > ( & self , infcx : & InferCtxt < ' a , ' tcx > ) -> Ty < ' tcx > {
18011800 infcx. resolve_type_vars_if_possible ( self )
18021801 }
1803- fn contains_error ( & self ) -> bool {
1804- ty:: type_is_error ( * self )
1805- }
18061802}
18071803
18081804impl < ' tcx > Resolvable < ' tcx > for ty:: TraitRef < ' tcx > {
18091805 fn resolve < ' a > ( & self , infcx : & InferCtxt < ' a , ' tcx > )
18101806 -> ty:: TraitRef < ' tcx > {
18111807 infcx. resolve_type_vars_if_possible ( self )
18121808 }
1813- fn contains_error ( & self ) -> bool {
1814- ty:: trait_ref_contains_error ( self )
1815- }
18161809}
18171810
18181811impl < ' tcx > Resolvable < ' tcx > for ty:: PolyTraitRef < ' tcx > {
@@ -1822,10 +1815,6 @@ impl<'tcx> Resolvable<'tcx> for ty::PolyTraitRef<'tcx> {
18221815 {
18231816 infcx. resolve_type_vars_if_possible ( self )
18241817 }
1825-
1826- fn contains_error ( & self ) -> bool {
1827- ty:: trait_ref_contains_error ( & self . 0 )
1828- }
18291818}
18301819
18311820fn lifetimes_in_scope ( tcx : & ty:: ctxt ,
0 commit comments