Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #65177

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a5d9310
remove 'as_str' when it's already a str type.
Sep 24, 2019
bb3c030
add test files
Sep 24, 2019
4cb86c9
comment fixes
Sep 25, 2019
5abc5e9
add FIXME and use 'span_label'
Oct 1, 2019
51482d0
fix unit tests
Oct 1, 2019
11c2d43
typo fix in the code
Oct 2, 2019
55ecb79
Note when a mutable trait object is needed
estebank Oct 4, 2019
f5e372a
Tweak wording
estebank Oct 4, 2019
4414068
Correctly estimate required space for string
AnthonyMikh Oct 5, 2019
35a3b58
Obligation must apply modulo regions
estebank Oct 5, 2019
169b040
review comments
estebank Oct 5, 2019
0b0aeac
Suggest dereferencing boolean reference when used in 'if' or 'while'
XiangQingW Oct 6, 2019
8a164ac
Suggest dereferencing boolean reference when used in 'if' or 'while'
XiangQingW Oct 6, 2019
bbb69d1
Suggest dereferencing boolean reference when used in 'if' or 'while'
XiangQingW Oct 6, 2019
c5e0d6e
Add long error explanation for E0566
GuillaumeGomez Oct 6, 2019
57cb881
Update ui tests
GuillaumeGomez Oct 6, 2019
8baf7bf
Update reference
tmandry Oct 6, 2019
6efcb02
review comments
estebank Oct 7, 2019
c100831
Rollup merge of #64739 - guanqun:remove-as-str, r=estebank
Centril Oct 7, 2019
fa961fa
Rollup merge of #65077 - estebank:mut-trait-expected, r=nikomatsakis
Centril Oct 7, 2019
a3d0c90
Rollup merge of #65120 - AnthonyMikh:fix_65119, r=estebank
Centril Oct 7, 2019
934f3c2
Rollup merge of #65150 - XiangQingW:master, r=estebank
Centril Oct 7, 2019
00315c3
Rollup merge of #65164 - GuillaumeGomez:long-err-explanation-E0566, r…
Centril Oct 7, 2019
ca3f01a
Rollup merge of #65173 - tmandry:reffy-ref, r=tmandry
Centril Oct 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Obligation must apply modulo regions
estebank committed Oct 5, 2019
commit 35a3b58a0836af059971c13b76f32c6b6c3926cb
4 changes: 3 additions & 1 deletion src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
@@ -1149,7 +1149,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
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 &&
2 changes: 1 addition & 1 deletion src/librustc/traits/query/evaluate_obligation.rs
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
// 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 {
2 changes: 0 additions & 2 deletions src/test/ui/parser/lex-bad-char-literals-6.stderr
Original file line number Diff line number Diff line change
@@ -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