de-mode-ify infer and some parts of typeck
also, fix bug in the various lint passes that fn() was considered not suitable for the default mode
This commit is contained in:
@@ -17,6 +17,7 @@ export capacity;
|
||||
export len;
|
||||
export from_fn;
|
||||
export from_elem;
|
||||
export from_slice;
|
||||
export build, build_sized;
|
||||
export to_mut;
|
||||
export from_mut;
|
||||
@@ -211,6 +212,11 @@ pure fn from_elem<T: copy>(n_elts: uint, t: T) -> ~[T] {
|
||||
return v;
|
||||
}
|
||||
|
||||
/// Creates a new unique vector with the same contents as the slice
|
||||
pure fn from_slice<T: copy>(t: &[T]) -> ~[T] {
|
||||
from_fn(t.len(), |i| t[i])
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a vector by calling a provided function with an argument
|
||||
* function that pushes an element to the back of a vector.
|
||||
|
||||
Reference in New Issue
Block a user