mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Obligation must apply modulo regions
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user