Skip to content

Commit 35a3b58

Browse files
committed
Obligation must apply modulo regions
1 parent f5e372a commit 35a3b58

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc/traits/error_reporting.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11491149
new_trait_ref.to_predicate(),
11501150
);
11511151

1152-
if self.predicate_may_hold(&new_obligation) {
1152+
if self.evaluate_obligation_no_overflow(
1153+
&new_obligation,
1154+
).must_apply_modulo_regions() {
11531155
let sp = self.tcx.sess.source_map()
11541156
.span_take_while(span, |c| c.is_whitespace() || *c == '&');
11551157
if points_at_arg &&

src/librustc/traits/query/evaluate_obligation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
5656
// Helper function that canonicalizes and runs the query. If an
5757
// overflow results, we re-run it in the local context so we can
5858
// report a nice error.
59-
fn evaluate_obligation_no_overflow(
59+
crate fn evaluate_obligation_no_overflow(
6060
&self,
6161
obligation: &PredicateObligation<'tcx>,
6262
) -> EvaluationResult {

src/test/ui/parser/lex-bad-char-literals-6.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ LL | if x == y {}
3535
| ^^ no implementation for `&str == char`
3636
|
3737
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
38-
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`, but not for `&str`
3938

4039
error[E0308]: mismatched types
4140
--> $DIR/lex-bad-char-literals-6.rs:15:20
@@ -53,7 +52,6 @@ LL | if x == z {}
5352
| ^^ no implementation for `&str == char`
5453
|
5554
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
56-
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`, but not for `&str`
5755

5856
error: aborting due to 6 previous errors
5957

0 commit comments

Comments
 (0)