Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
53d3c89
Dont bug! on user error
bjorn3 Feb 28, 2017
54a1c8b
Fix indentation in region infer docs
bjorn3 Feb 28, 2017
2a40918
Syntax highlighting in region infer docs
bjorn3 Feb 28, 2017
be49671
Improve a bit more
bjorn3 Feb 28, 2017
90e94d9
Syntax highlight and note about current rust in infer docs
bjorn3 Feb 28, 2017
234753a
Fix missing backtick typo
Nashenas88 Mar 8, 2017
3198904
Disallow subtyping between T and U in T: Unsize<U>.
eddyb Mar 7, 2017
79a7ee8
fix UB in repr(packed) tests
TimNN Mar 8, 2017
74bc7fd
Overhaul coercion to use the lazy InferOk obligations passing.
eddyb Mar 8, 2017
84d1f6a
Do not bother creating StorageLive for TyNever
nagisa Mar 8, 2017
cfb41ae
Use subtyping on the target of unsizing coercions.
eddyb Mar 9, 2017
b95b5db
update gdbr tests
TimNN Mar 9, 2017
7f19f1f
fix #40294 obligation cause.body_id is not always a NodeExpr
Mar 9, 2017
889337d
move related tests to type-check ui test directory
Mar 10, 2017
a5a3981
Add missing example for Display::fmt
GuillaumeGomez Mar 6, 2017
ea3c82c
Fix associated consts display
GuillaumeGomez Mar 10, 2017
e5d1b9c
save-analysis: cope with lack of method data after a type error
Mar 8, 2017
b959d13
Allow lints to check Bodys directly
oli-obk Mar 7, 2017
4d23ca4
rustc: Whitelist the FMA target feature
fsasm Mar 10, 2017
c60a58b
Attempt to debug sccache in more locations
alexcrichton Mar 11, 2017
45de0f9
Rollup merge of #40146 - bjorn3:few-infer-changes, r=pnkfelix
Mar 11, 2017
b933bdc
Rollup merge of #40299 - GuillaumeGomez:fmt-display-example, r=frewsxcv
Mar 11, 2017
b49036c
Rollup merge of #40315 - oli-obk:lint_body, r=eddyb
Mar 11, 2017
c886815
Rollup merge of #40319 - eddyb:it's-"unsize"-not-"unsound", r=nikomat…
Mar 11, 2017
8dc8f8f
Rollup merge of #40344 - nrc:save-container, r=eddyb
Mar 11, 2017
037e506
Rollup merge of #40345 - Nashenas88:patch-1, r=estebank
Mar 11, 2017
66436b5
Rollup merge of #40372 - nagisa:never-drop, r=eddyb
Mar 11, 2017
d75b9ad
Rollup merge of #40373 - TimNN:test-ub-packed, r=arielb1
Mar 11, 2017
25dcbca
Rollup merge of #40400 - TimNN:gdbr-updates, r=alexcrichton
Mar 11, 2017
d208b2d
Rollup merge of #40404 - cengizIO:master, r=nikomatsakis
Mar 11, 2017
7b0caa5
Rollup merge of #40419 - GuillaumeGomez:fix-const-rendering, r=frewsxcv
Mar 11, 2017
b1e03fe
Rollup merge of #40431 - fsasm:master, r=BurntSushi
Mar 11, 2017
6a5fd0f
Merge branch 'more-sccache-debug' of https://github.com/alexcrichton/…
alexcrichton Mar 12, 2017
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
6 changes: 3 additions & 3 deletions src/librustc/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
let new_trait = tcx.mk_dynamic(
ty::Binder(tcx.mk_existential_predicates(iter)), r_b);
let InferOk { obligations, .. } =
self.infcx.sub_types(false, &obligation.cause, new_trait, target)
self.infcx.eq_types(false, &obligation.cause, new_trait, target)
.map_err(|_| Unimplemented)?;
self.inferred_obligations.extend(obligations);

Expand Down Expand Up @@ -2520,7 +2520,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
// [T; n] -> [T].
(&ty::TyArray(a, _), &ty::TySlice(b)) => {
let InferOk { obligations, .. } =
self.infcx.sub_types(false, &obligation.cause, a, b)
self.infcx.eq_types(false, &obligation.cause, a, b)
.map_err(|_| Unimplemented)?;
self.inferred_obligations.extend(obligations);
}
Expand Down Expand Up @@ -2583,7 +2583,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
});
let new_struct = tcx.mk_adt(def, tcx.mk_substs(params));
let InferOk { obligations, .. } =
self.infcx.sub_types(false, &obligation.cause, new_struct, target)
self.infcx.eq_types(false, &obligation.cause, new_struct, target)
.map_err(|_| Unimplemented)?;
self.inferred_obligations.extend(obligations);

Expand Down
14 changes: 12 additions & 2 deletions src/librustc_typeck/check/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use astconv::AstConv;

use super::FnCtxt;

use rustc::infer::InferOk;
use rustc::traits;
use rustc::ty::{self, Ty, TraitRef};
use rustc::ty::{ToPredicate, TypeFoldable};
Expand Down Expand Up @@ -149,6 +150,14 @@ impl<'a, 'gcx, 'tcx> Autoderef<'a, 'gcx, 'tcx> {

pub fn finalize<'b, I>(self, pref: LvaluePreference, exprs: I)
where I: IntoIterator<Item = &'b hir::Expr>
{
let fcx = self.fcx;
fcx.register_infer_ok_obligations(self.finalize_as_infer_ok(pref, exprs));
}

pub fn finalize_as_infer_ok<'b, I>(self, pref: LvaluePreference, exprs: I)
-> InferOk<'tcx, ()>
where I: IntoIterator<Item = &'b hir::Expr>
{
let methods: Vec<_> = self.steps
.iter()
Expand Down Expand Up @@ -176,8 +185,9 @@ impl<'a, 'gcx, 'tcx> Autoderef<'a, 'gcx, 'tcx> {
}
}

for obligation in self.obligations {
self.fcx.register_predicate(obligation);
InferOk {
value: (),
obligations: self.obligations
}
}
}
Expand Down
Loading