Skip to content

Commit 1302304

Browse files
committed
Address nits and fix tidy ... again
1 parent fb4134e commit 1302304

13 files changed

+28
-5
lines changed

src/librustc_typeck/check/mod.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -1876,9 +1876,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18761876
let _ = self.infcx().commit_if_ok(|_: &infer::CombinedSnapshot| {
18771877
for &(ref ty, ref default) in &has_user_default {
18781878
let default = default.clone();
1879-
let normalized_default = self.inh.normalize_associated_types_in(codemap::DUMMY_SP, 0, &default.ty);
1879+
1880+
let normalized_default = self.inh.normalize_associated_types_in(
1881+
default.origin_span,
1882+
0, &default.ty);
1883+
18801884
match infer::mk_eqty(self.infcx(), false,
1881-
infer::Misc(codemap::DUMMY_SP), // default.origin_span),
1885+
infer::Misc(default.origin_span),
18821886
ty, normalized_default) {
18831887
Ok(()) => {}
18841888
Err(_) => {
@@ -1887,7 +1891,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18871891
}
18881892
}
18891893

1890-
18911894
// If there are conflicts we rollback, otherwise commit
18921895
if conflicts.len() > 0 {
18931896
Err(())
@@ -1976,9 +1979,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
19761979
// reporting for more then one conflict.
19771980
for &(ref ty, ref default) in tys_with_defaults {
19781981
let default = default.clone();
1979-
let normalized_default = self.inh.normalize_associated_types_in(codemap::DUMMY_SP, 0, &default.ty);
1982+
1983+
let normalized_default = self.inh.normalize_associated_types_in(
1984+
default.origin_span, 0,
1985+
&default.ty);
1986+
19801987
match infer::mk_eqty(self.infcx(), false,
1981-
infer::Misc(codemap::DUMMY_SP), // default.origin_span),
1988+
infer::Misc(default.origin_span),
19821989
ty, normalized_default) {
19831990
Ok(()) => {}
19841991
Err(_) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(default_type_parameter_fallback)]
12+
#![feature(iter_arith)]
13+
14+
fn main() {
15+
print!("{}", (1..4).sum());
16+
}

0 commit comments

Comments
 (0)