Skip to content

Commit 79fad09

Browse files
committed
---
yaml --- r: 11945 b: refs/heads/master c: 154a3fd h: refs/heads/master i: 11943: f06e4c7 v: v3
1 parent af63309 commit 79fad09

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3445454e792bc4b770a99e227fc18b5c90f8ed8a
2+
refs/heads/master: 154a3fdf4427ad3de7dc7a5a1a1fe7ee737dc99c
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ fn is_utf8(v: [const u8]) -> bool {
11621162

11631163
#[doc = "Determines if a vector of `u16` contains valid UTF-16"]
11641164
fn is_utf16(v: [const u16]) -> bool {
1165-
let len = v.len();
1165+
let len = vec::len(v);
11661166
let mut i = 0u;
11671167
while (i < len) {
11681168
let u = v[i];
@@ -1205,7 +1205,7 @@ fn to_utf16(s: str) -> [u16] {
12051205
}
12061206

12071207
fn utf16_chars(v: [const u16], f: fn(char)) {
1208-
let len = v.len();
1208+
let len = vec::len(v);
12091209
let mut i = 0u;
12101210
while (i < len && v[i] != 0u16) {
12111211
let mut u = v[i];
@@ -1231,7 +1231,7 @@ fn utf16_chars(v: [const u16], f: fn(char)) {
12311231

12321232
fn from_utf16(v: [const u16]) -> str {
12331233
let mut buf = "";
1234-
reserve(buf, v.len());
1234+
reserve(buf, vec::len(v));
12351235
utf16_chars(v) {|ch| push_char(buf, ch); }
12361236
ret buf;
12371237
}

trunk/src/rustc/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ fn lookup_method_inner(fcx: @fn_ctxt, expr: @ast::expr,
19091909

19101910
let ty = universally_quantify_regions(tcx, ty);
19111911

1912-
alt unify::unify(fcx, ty, self_ty) {
1912+
alt unify::unify(fcx, self_ty, ty) {
19131913
result::ok(_) {
19141914
if option::is_some(result) {
19151915
// FIXME[impl] score specificity to resolve ambiguity?
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
impl extensions<T> for [const T] {
2+
fn foo() -> uint { vec::len(self) }
3+
}
4+
5+
fn main() {
6+
let v = [const 0];
7+
assert v.foo() == 1u;
8+
let v = [0];
9+
assert v.foo() == 1u;
10+
let v = [mut 0];
11+
assert v.foo() == 1u;
12+
}

0 commit comments

Comments
 (0)