Skip to content

Commit 6496a9d

Browse files
jroeschJared Roesch
authored andcommitted
---
yaml --- r: 228765 b: refs/heads/try c: ee43920 h: refs/heads/master i: 228763: 311c95c v: v3
1 parent f3cf7d4 commit 6496a9d

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: e85787102fa6a7b27e1df845c07084f6a7d77fe3
4+
refs/heads/try: ee4392041073795f479365f34d40777eff69c378
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/middle/infer/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct InferCtxt<'a, 'tcx: 'a> {
7373
// We instantiate UnificationTable with bounds<Ty> because the
7474
// types that might instantiate a general type variable have an
7575
// order, represented by its upper and lower bounds.
76-
pub type_variables: RefCell<type_variable::TypeVariableTable<'tcx>>,
76+
type_variables: RefCell<type_variable::TypeVariableTable<'tcx>>,
7777

7878
// Map from integral variable to the kind of integer it represents
7979
int_unification_table: RefCell<UnificationTable<ty::IntVid>>,
@@ -1366,19 +1366,19 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13661366
}
13671367

13681368
pub fn report_conflicting_default_types(&self,
1369-
span: Span,
1370-
expected: type_variable::Default<'tcx>,
1371-
actual: type_variable::Default<'tcx>) {
1369+
span: Span,
1370+
expected: type_variable::Default<'tcx>,
1371+
actual: type_variable::Default<'tcx>) {
13721372
let trace = TypeTrace {
13731373
origin: Misc(span),
1374-
values: Types(ty::expected_found {
1374+
values: Types(ty::ExpectedFound {
13751375
expected: expected.ty,
13761376
found: actual.ty
13771377
})
13781378
};
13791379

13801380
self.report_and_explain_type_error(trace,
1381-
&ty::type_err::terr_ty_param_default_mismatch(ty::expected_found {
1381+
&TypeError::TyParamDefaultMismatch(ty::ExpectedFound {
13821382
expected: expected,
13831383
found: actual
13841384
}));

branches/try/src/librustc/middle/ty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ pub struct ExpectedFound<T> {
20392039
}
20402040

20412041
// Data structures used in type unification
2042-
#[derive(Clone, Copy, Debug)]
2042+
#[derive(Clone, Debug)]
20432043
pub enum TypeError<'tcx> {
20442044
Mismatch,
20452045
UnsafetyMismatch(ExpectedFound<ast::Unsafety>),
@@ -2069,7 +2069,7 @@ pub enum TypeError<'tcx> {
20692069
ConvergenceMismatch(ExpectedFound<bool>),
20702070
ProjectionNameMismatched(ExpectedFound<ast::Name>),
20712071
ProjectionBoundsLength(ExpectedFound<usize>),
2072-
TyParamDefaultMismatch(ExpectedFound<Ty<'tcx>>)
2072+
TyParamDefaultMismatch(ExpectedFound<type_variable::Default<'tcx>>)
20732073
}
20742074

20752075
/// Bounds suitable for an existentially quantified type parameter
@@ -5083,7 +5083,7 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
50835083
values.expected,
50845084
values.found)
50855085
},
5086-
terr_ty_param_default_mismatch(ref values) => {
5086+
TyParamDefaultMismatch(ref values) => {
50875087
write!(f, "conflicting type parameter defaults {} and {}",
50885088
values.expected.ty,
50895089
values.found.ty)
@@ -5445,7 +5445,7 @@ impl<'tcx> ctxt<'tcx> {
54455445
using it as a trait object"));
54465446
}
54475447
},
5448-
terr_ty_param_default_mismatch(values) => {
5448+
TyParamDefaultMismatch(values) => {
54495449
let expected = values.expected;
54505450
let found = values.found;
54515451
self.sess.span_note(sp,

branches/try/src/librustc_typeck/check/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17851785
// it had been solved by previously applying a default.
17861786

17871787
// We take a snapshot for use in error reporting.
1788-
let snapshot = self.infcx().type_variables.borrow_mut().snapshot();
1788+
let snapshot = self.infcx().start_snapshot();
17891789

17901790
for ty in &unbound_tyvars {
17911791
if self.infcx().type_var_diverges(ty) {
@@ -1815,10 +1815,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18151815
}
18161816
}
18171817

1818-
// There were some errors to report
1818+
// There are some errors to report
18191819
if conflicts.len() > 0 {
1820-
self.infcx().type_variables.borrow_mut().rollback_to(snapshot);
1820+
self.infcx().rollback_to(snapshot);
18211821

1822+
// Loop through each conflicting default compute the conflict
1823+
// and then report the error.
18221824
for (conflict, default) in conflicts {
18231825
let conflicting_default =
18241826
self.find_conflicting_default(
@@ -1836,7 +1838,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18361838
default)
18371839
}
18381840
} else {
1839-
self.infcx().type_variables.borrow_mut().commit(snapshot)
1841+
self.infcx().commit_from(snapshot)
18401842
}
18411843
}
18421844

0 commit comments

Comments
 (0)