10000 Rollup of 15 pull requests by Centril · Pull Request #64159 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 15 pull requests #64159

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

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
820aa5b
Stabilize pin_into_inner in 1.39.0
ghedo Aug 28, 2019
8648732
Add `Place::is_indirect`
ecstatic-morse Aug 29, 2019
0e597d4
Rev::rposition counts from the wrong end
sfanxiang Aug 30, 2019
96ac02b
Use new `Place::is_indirect` API where possible
ecstatic-morse Aug 29, 2019
5187a3e
Harden param_attrs test wrt. usage of proc macro attrs.
Centril Aug 31, 2019
7bb2d8b
Slightly clean up the error for recursive `async fn`
matthewjasper Aug 31, 2019
877faf3
Check impl trait substs when checking for recursive types
matthewjasper Aug 31, 2019
754a875
Add some more tests for underscore imports
matthewjasper Aug 31, 2019
b0bb301
Update xLTO compatibility table in rustc book.
michaelwoerister Sep 2, 2019
3ea932a
Refer to "`self` type" instead of "receiver type"
estebank Sep 3, 2019
c1e5e5c
On object safety violation, point at source when possible
estebank Sep 3, 2019
bb99fc3
review comment: update error code descr
estebank Sep 3, 2019
efe8594
account for DUMMY_SP and correct wording
estebank Sep 3, 2019
8c74eb7
Move path parsing earlier.
nnethercote Sep 3, 2019
23c76ff
Added warning around code with reference to uninit bytes
Sep 3, 2019
e85b181
unused_parens: fix for or-patterns + &(mut x)
Centril Sep 3, 2019
b03d3dc
Changed comment to better reflect std's exceptional situation
Sep 3, 2019
28b5184
review comments: error code text
estebank Sep 3, 2019
4a79633
review comments
estebank Sep 3, 2019
e16ce80
fix error code test
estebank Sep 3, 2019
b6f9523
Fix doc links in `std::cmp` module
tesuji Sep 4, 2019
8e06724
fix a few typos in comments
Sep 4, 2019
843fba3
Stabilize checked_duration_since for 1.39.0
vi Jul 21, 2019
5545582
Avoid feature name 'checked_duration_since' in a Tidy test
vi Sep 4, 2019
fe2c6b1
Opaque type locations in error message for clarity.
gilescope Sep 4, 2019
f062076
Rollup merge of #62860 - vi:stabilize_checked_duration_since, r=Mark-…
Centril Sep 5, 2019
9ac90fa
Rollup merge of #63549 - sfanxiang:rev-rposition, r=scottmcm
Centril Sep 5, 2019
a721221
Rollup merge of #63985 - ghedo:stabilize_pin_into_inner, r=alexcrichton
Centril Sep 5, 2019
77a033a
Rollup merge of #64005 - ecstatic-morse:is-indirect, r=oli-obk
Centril Sep 5, 2019
5a94d57
Rollup merge of #64031 - Centril:param-attrs-no-macros-test, r=nikoma…
Centril Sep 5, 2019
737efa6
Rollup merge of #64038 - matthewjasper:deny-mutual-impl-trait-recursi…
Centril Sep 5, 2019
f5af471
Rollup merge of #64043 - matthewjasper:underscore-import-tests, r=ale…
Centril Sep 5, 2019
a537aa1
Rollup merge of #64092 - michaelwoerister:update-xlto-table-rustc-boo…
Centril Sep 5, 2019
f8cdf38
Rollup merge of #64110 - estebank:receiver-type, r=Centril
Centril Sep 5, 2019
39d91e5
Rollup merge of #64120 - nnethercote:move-path-parsing-earlier, r=pet…
Centril Sep 5, 2019
b0f1a78
Rollup merge of #64123 - danielhenrymantilla:add_comment_about_uninit…
Centril Sep 5, 2019
74ffc43
Rollup merge of #64128 - Centril:unused-parens-pat, r=davidtwco
Centril Sep 5, 2019
ee90e61
Rollup merge of #64142 - lzutao:fix-doc-cmp, r=jonas-schievink
Centril Sep 5, 2019
cecca35
Rollup merge of #64148 - guanqun:typo-fix, r=zackmdavis
Centril Sep 5, 2019
00c3f67
Rollup merge of #64157 - gilescope:opaque-type-location, r=cramertj
Centril Sep 5, 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
Opaque type locations in error message for clarity.
  • Loading branch information
gilescope committed Sep 4, 2019
commit fe2c6b174830f8f1c79c4b34ba7f015cca41ee2c
17 changes: 15 additions & 2 deletions src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ use crate::ty::error::TypeError;
use crate::ty::{self, subst::{Subst, SubstsRef}, Region, Ty, TyCtxt, TypeFoldable};
use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use std::{cmp, fmt};
use std::borrow::Cow;
use syntax_pos::{Pos, Span};

mod note;
Expand Down Expand Up @@ -1140,8 +1141,20 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
&"type",
expected,
found,
&format!(" ({})", values.expected.sort_string(self.tcx)),
&format!(" ({})", values.found.sort_string(self.tcx)),
&format!(" ({})",
if let ty::Opaque(def_id, _) = values.expected.sty {
Cow::from(format!("opaque type at {}", self.tcx.sess
.source_map().mk_substr_filename(self.tcx.def_span(def_id))))
} else {
values.expected.sort_string(self.tcx)
}),
&format!(" ({})",
if let ty::Opaque(def_id, _) = values.found.sty {
Cow::from(format!("opaque type at {}", self.tcx.sess
.source_map().mk_substr_filename(self.tcx.def_span(def_id))))
} else {
values.found.sort_string(self.tcx)
}),
);
}
(_, false, _) => {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/suggestions/opaque-type-error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ LL | | thing_two()
LL | | }.await
| |_____- if and else have incompatible types
|
= note: expected type `impl std::future::Future` (opaque type)
found type `impl std::future::Future` (opaque type)
= note: expected type `impl std::future::Future` (opaque type at <$DIR/opaque-type-error.rs:8:19>)
found type `impl std::future::Future` (opaque type at <$DIR/opaque-type-error.rs:12:19>)
= note: distinct uses of `impl Trait` result in different opaque types
= help: if both `Future`s have the same `Output` type, consider `.await`ing on both of them

Expand Down
0