Skip to content

Commit 46bdb45

Browse files
committed
Merge pull request #1 from rust-lang/master
Update from original
2 parents f530aa0 + 7765993 commit 46bdb45

File tree

94 files changed

+624
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+624
-444
lines changed

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Cole Mickens <[email protected]>
121121
Colin Davidson <[email protected]>
122122
Colin Sherratt <[email protected]>
123123
Conrad Kleinespel <[email protected]>
124+
Corey Farwell <[email protected]>
124125
Corey Ford <[email protected]>
125126
Corey Richardson <[email protected]>
126127

configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,10 @@ CFG_PREFIX=${CFG_PREFIX%/}
893893
CFG_MANDIR=${CFG_MANDIR%/}
894894
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
895895
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
896-
CFG_SUPPORTED_TARGET="$(ls ${CFG_SRC_DIR}mk/cfg)"
896+
CFG_SUPPORTED_TARGET=""
897+
for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do
898+
CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)"
899+
done
897900

898901
# copy host-triples to target-triples so that hosts are a subset of targets
899902
V_TEMP=""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \
113113

114114
CFG_RLIB_GLOB=lib$(1)-*.rlib
115115

116-
include $(wildcard $(CFG_SRC_DIR)mk/cfg/*)
116+
include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk)
117117

118118
# The -Qunused-arguments sidesteps spurious warnings from clang
119119
define FILTER_FLAGS

src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ fn _arm_exec_compiled_test(config: &Config,
15661566

15671567
let mut exitcode: int = 0;
15681568
for c in exitcode_out.as_slice().chars() {
1569-
if !c.is_digit() { break; }
1569+
if !c.is_numeric() { break; }
15701570
exitcode = exitcode * 10 + match c {
15711571
'0' ... '9' => c as int - ('0' as int),
15721572
_ => 101,

src/etc/vim/compiler/cargo.vim

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
" Vim compiler file
22
" Compiler: Cargo Compiler
33
" Maintainer: Damien Radtke <[email protected]>
4-
" Latest Revision: 2014 Sep 18
4+
" Latest Revision: 2014 Sep 24
55

6-
if exists("current_compiler")
6+
if exists('current_compiler')
77
finish
88
endif
9+
runtime compiler/rustc.vim
910
let current_compiler = "cargo"
1011

11-
if exists(":CompilerSet") != 2
12+
if exists(':CompilerSet') != 2
1213
command -nargs=* CompilerSet setlocal <args>
1314
endif
1415

15-
CompilerSet errorformat&
16-
CompilerSet makeprg=cargo\ $*
16+
if exists('g:cargo_makeprg_params')
17+
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
18+
else
19+
CompilerSet makeprg=cargo\ $*
20+
endif
1721

1822
" Allow a configurable global Cargo.toml name. This makes it easy to
1923
" support variations like 'cargo.toml'.
20-
if !exists('g:cargo_toml_name')
21-
let g:cargo_toml_name = 'Cargo.toml'
22-
endif
24+
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
2325

24-
let s:toml_dir = fnamemodify(findfile(g:cargo_toml_name, '.;'), ':p:h').'/'
26+
function! s:is_absolute(path)
27+
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
28+
endfunction
2529

26-
if s:toml_dir != ''
30+
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
31+
if s:local_manifest != ''
32+
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
2733
augroup cargo
2834
au!
2935
au QuickfixCmdPost make call s:FixPaths()
@@ -33,15 +39,25 @@ if s:toml_dir != ''
3339
" to be relative to the current directory instead of Cargo.toml.
3440
function! s:FixPaths()
3541
let qflist = getqflist()
42+
let manifest = s:local_manifest
3643
for qf in qflist
37-
if !qf['valid']
44+
if !qf.valid
45+
let m = matchlist(qf.text, '(file://\(.*\))$')
46+
if !empty(m)
47+
let manifest = m[1].'/'
48+
" Manually strip another slash if needed; usually just an
49+
" issue on Windows.
50+
if manifest =~ '^/[A-Z]\+:/'
51+
let manifest = manifest[1:]
52+
endif
53+
endif
3854
continue
3955
endif
40-
let filename = bufname(qf['bufnr'])
41-
if stridx(filename, s:toml_dir) == -1
42-
let filename = s:toml_dir.filename
56+
let filename = bufname(qf.bufnr)
57+
if s:is_absolute(filename)
58+
continue
4359
endif
44-
let qf['filename'] = simplify(s:toml_dir.bufname(qf['bufnr']))
60+
let qf.filename = simplify(manifest.filename)
4561
call remove(qf, 'bufnr')
4662
endfor
4763
call setqflist(qflist, 'r')

src/etc/vim/doc/rust.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ g:ftplugin_rust_source_path~
8888
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
8989
<
9090

91+
*g:cargo_manifest_name*
92+
g:cargo_manifest_name~
93+
Set this option to the name of the manifest file for your projects. If
94+
not specified it defaults to 'Cargo.toml' : >
95+
let g:cargo_manifest_name = 'Cargo.toml'
96+
<
97+
9198
==============================================================================
9299
COMMANDS *rust-commands*
93100

src/libcollections/str.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ pub trait StrAllocating: Str {
630630
let me = self.as_slice();
631631
let mut out = String::with_capacity(me.len());
632632
for c in me.chars() {
633-
c.escape_default(|c| out.push(c));
633+
for c in c.escape_default() {
634+
out.push(c);
635+
}
634636
}
635637
out
636638
}
@@ -640,7 +642,9 @@ pub trait StrAllocating: Str {
640642
let me = self.as_slice();
641643
let mut out = String::with_capacity(me.len());
642644
for c in me.chars() {
643-
c.escape_unicode(|c| out.push(c));
645+
for c in c.escape_unicode() {
646+
out.push(c);
647+
}
644648
}
645649
out
646650
}
@@ -1189,7 +1193,7 @@ mod tests {
11891193
assert_eq!("11foo1bar11".trim_left_chars('1'), "foo1bar11");
11901194
let chars: &[char] = &['1', '2'];
11911195
assert_eq!("12foo1bar12".trim_left_chars(chars), "foo1bar12");
1192-
assert_eq!("123foo1bar123".trim_left_chars(|c: char| c.is_digit()), "foo1bar123");
1196+
assert_eq!("123foo1bar123".trim_left_chars(|c: char| c.is_numeric()), "foo1bar123");
11931197
}
11941198

11951199
#[test]
@@ -1204,7 +1208,7 @@ mod tests {
12041208
assert_eq!("11foo1bar11".trim_right_chars('1'), "11foo1bar");
12051209
let chars: &[char] = &['1', '2'];
12061210
assert_eq!("12foo1bar12".trim_right_chars(chars), "12foo1bar");
1207-
assert_eq!("123foo1bar123".trim_right_chars(|c: char| c.is_digit()), "123foo1bar");
1211+
assert_eq!("123foo1bar123".trim_right_chars(|c: char| c.is_numeric()), "123foo1bar");
12081212
}
12091213

12101214
#[test]
@@ -1219,7 +1223,7 @@ mod tests {
12191223
assert_eq!("11foo1bar11".trim_chars('1'), "foo1bar");
12201224
let chars: &[char] = &['1', '2'];
12211225
assert_eq!("12foo1bar12".trim_chars(chars), "foo1bar");
1222-
assert_eq!("123foo1bar123".trim_chars(|c: char| c.is_digit()), "foo1bar");
1226+
assert_eq!("123foo1bar123".trim_chars(|c: char| c.is_numeric()), "foo1bar");
12231227
}
12241228

12251229
#[test]

0 commit comments

Comments
 (0)