Obligation must apply modulo regions

This commit is contained in:
Esteban Küber
2019-10-05 10:41:24 -07:00
parent acd6540a74
commit 722bb515e2
3 changed files with 4 additions and 4 deletions
+3 -1
View File
@@ -1149,7 +1149,9 @@ fn suggest_change_mut(
new_trait_ref.to_predicate(),
);
if self.predicate_may_hold(&new_obligation) {
if self.evaluate_obligation_no_overflow(
&new_obligation,
).must_apply_modulo_regions() {
let sp = self.tcx.sess.source_map()
.span_take_while(span, |c| c.is_whitespace() || *c == '&');
if points_at_arg &&
@@ -56,7 +56,7 @@ pub fn evaluate_obligation(
// Helper function that canonicalizes and runs the query. If an
// overflow results, we re-run it in the local context so we can
// report a nice error.
fn evaluate_obligation_no_overflow(
crate fn evaluate_obligation_no_overflow(
&self,
obligation: &PredicateObligation<'tcx>,
) -> EvaluationResult {
@@ -35,7 +35,6 @@ LL | if x == y {}
| ^^ no implementation for `&str == char`
|
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`, but not for `&str`
error[E0308]: mismatched types
--> $DIR/lex-bad-char-literals-6.rs:15:20
@@ -53,7 +52,6 @@ LL | if x == z {}
| ^^ no implementation for `&str == char`
|
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`, but not for `&str`
error: aborting due to 6 previous errors