Make default method handling not choke on self region params. Closes #7341.
This commit is contained in:
parent
050d0e6b29
commit
a9e51f5f70
@ -233,7 +233,12 @@ pub fn trans_fn_ref_with_vtables(
|
||||
// Polytype of the function item (may have type params)
|
||||
let fn_tpt = ty::lookup_item_type(tcx, def_id);
|
||||
|
||||
let substs = ty::substs { self_r: None, self_ty: None,
|
||||
// For simplicity, we want to use the Subst trait when composing
|
||||
// substitutions for default methods. The subst trait does
|
||||
// substitutions with regions, though, so we put a dummy self
|
||||
// region parameter in to keep it from failing. This is a hack.
|
||||
let substs = ty::substs { self_r: Some(ty::re_empty),
|
||||
self_ty: None,
|
||||
tps: /*bad*/ type_params.to_owned() };
|
||||
|
||||
|
||||
|
@ -2346,6 +2346,7 @@ impl<T> FromIter<T> for ~[T]{
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {
|
||||
pub fn from_iterator(iterator: &mut T) -> ~[A] {
|
||||
let mut xs = ~[];
|
||||
@ -2356,7 +2357,8 @@ impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: #7341 - ICE
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {
|
||||
pub fn from_iterator(iterator: &mut T) -> ~[A] {
|
||||
let (lower, _) = iterator.size_hint();
|
||||
@ -2367,7 +2369,7 @@ impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {
|
||||
xs
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
Loading…
Reference in New Issue
Block a user