Skip to content

Commit 1d0131c

Browse files
author
Jakub Bukaj
committed
---
yaml --- r: 162521 b: refs/heads/try c: 1e5de8c h: refs/heads/master i: 162519: 7c1fe76 v: v3
1 parent 0c27dd3 commit 1d0131c

File tree

140 files changed

+1243
-856
lines changed

Some content is hidden

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

140 files changed

+1243
-856
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 5a08e679c792cbb5110c18d80a5090ad31bb103a
5+
refs/heads/try: 1e5de8cf3cde5f8cc7376c637d072b765c6403fe
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/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

branches/try/configure

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,11 +711,6 @@ then
711711
fi
712712
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
713713
putvar CFG_LOCAL_RUST_ROOT
714-
else
715-
if [ ! -z "$CFG_LOCAL_RUST_ROOT" ]
716-
then
717-
warn "Use of --local-rust-root without --enable-local-rust"
718-
fi
719714
fi
720715

721716
# Force freebsd to build with clang; gcc doesn't like us there
@@ -893,7 +888,10 @@ CFG_PREFIX=${CFG_PREFIX%/}
893888
CFG_MANDIR=${CFG_MANDIR%/}
894889
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
895890
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
896-
CFG_SUPPORTED_TARGET="$(ls ${CFG_SRC_DIR}mk/cfg)"
891+
CFG_SUPPORTED_TARGET=""
892+
for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do
893+
CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)"
894+
done
897895

898896
# copy host-triples to target-triples so that hosts are a subset of targets
899897
V_TEMP=""

branches/try/mk/main.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ endif
190190
# Target-and-rule "utility variables"
191191
######################################################################
192192

193-
define DEF_X
193+
define DEF_FOR_TARGET
194194
X_$(1) := $(CFG_EXE_SUFFIX_$(1))
195+
ifndef CFG_LLVM_TARGET_$(1)
196+
CFG_LLVM_TARGET_$(1) := $(1)
197+
endif
195198
endef
196199
$(foreach target,$(CFG_TARGET), \
197-
$(eval $(call DEF_X,$(target))))
200+
$(eval $(call DEF_FOR_TARGET,$(target))))
198201

199202
# "Source" files we generate in builddir along the way.
200203
GENERATED :=

branches/try/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

branches/try/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
7575
@mkdir -p $$(@D)
7676
@$$(call E, compile: $$@)
7777
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
78-
-filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
78+
-filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$<
7979

8080
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
8181
@mkdir -p $$(@D)

branches/try/mk/stage0.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ifdef CFG_ENABLE_LOCAL_RUST
2222
else
2323
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
2424
endif
25-
$(Q)touch $@
25+
$(Q)if [ -e "$@" ]; then touch "$@"; else echo "ERROR: snapshot $@ not found"; exit 1; fi
2626

2727
# For other targets, let the host build the target:
2828

branches/try/mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
116116
$$(foreach dep,$$(TOOL_DEPS_$(4)), \
117117
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
118118
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
119-
| $$(TBIN$(1)_T_$(4)_H_$(3))/
119+
| $$(TBIN$(1)_T_$(2)_H_$(3))/
120120
@$$(call E, rustc: $$@)
121121
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
122122

branches/try/src/compiletest/runtest.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ fn compile_test_(config: &Config, props: &TestProps,
11611161
let args = make_compile_args(config,
11621162
props,
11631163
link_args,
1164-
|a, b| ThisFile(make_exe_name(a, b)), testfile);
1164+
|a, b| TargetLocation::ThisFile(make_exe_name(a, b)), testfile);
11651165
compose_and_run_compiler(config, props, testfile, args, None)
11661166
}
11671167

@@ -1219,7 +1219,7 @@ fn compose_and_run_compiler(
12191219
crate_type,
12201220
|a,b| {
12211221
let f = make_lib_name(a, b, testfile);
1222-
ThisDirectory(f.dir_path())
1222+
TargetLocation::ThisDirectory(f.dir_path())
12231223
},
12241224
&abs_ab);
12251225
let auxres = compose_and_run(config,
@@ -1296,11 +1296,11 @@ fn make_compile_args(config: &Config,
12961296
args.push("prefer-dynamic".to_string());
12971297
}
12981298
let path = match xform_file {
1299-
ThisFile(path) => {
1299+
TargetLocation::ThisFile(path) => {
13001300
args.push("-o".to_string());
13011301
path
13021302
}
1303-
ThisDirectory(path) => {
1303+
TargetLocation::ThisDirectory(path) => {
13041304
args.push("--out-dir".to_string());
13051305
path
13061306
}
@@ -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,
@@ -1672,7 +1672,8 @@ fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16721672
let args = make_compile_args(config,
16731673
props,
16741674
link_args,
1675-
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
1675+
|a, b| TargetLocation::ThisDirectory(
1676+
output_base_name(a, b).dir_path()),
16761677
testfile);
16771678
compose_and_run_compiler(config, props, testfile, args, None)
16781679
}

branches/try/src/doc/guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3144,8 +3144,8 @@ pub fn add_three_times_four(x: int) -> int {
31443144
}
31453145
```
31463146

3147-
We're calling this file `lib.rs` because it has the same name as our project,
3148-
and so it's named this, by convention.
3147+
We're calling this file `lib.rs`, because Cargo uses that filename as the crate
3148+
root by convention.
31493149

31503150
We'll then need to use this crate in our `src/main.rs`:
31513151

branches/try/src/doc/reference.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,12 @@ specific type; the type-specified aspects of a value include:
13341334
For example, the type `(u8, u8)` defines the set of immutable values that are
13351335
composite pairs, each containing two unsigned 8-bit integers accessed by
13361336
pattern-matching and laid out in memory with the `x` component preceding the
1337-
`y` component.
1337+
`y` component:
1338+
1339+
```
1340+
type Point = (u8, u8);
1341+
let p: Point = (41, 68);
1342+
```
13381343

13391344
### Structures
13401345

branches/try/src/etc/lldb_rust_formatters.py

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ def print_struct_val(val, internal_dict):
4343
return print_struct_val_starting_from(0, val, internal_dict)
4444

4545
def print_vec_slice_val(val, internal_dict):
46-
output = "&["
47-
4846
length = val.GetChildAtIndex(1).GetValueAsUnsigned()
4947

5048
data_ptr_val = val.GetChildAtIndex(0)
@@ -56,16 +54,12 @@ def print_vec_slice_val(val, internal_dict):
5654

5755
start_address = data_ptr_val.GetValueAsUnsigned()
5856

59-
for i in range(length):
57+
def render_element(i):
6058
address = start_address + i * element_type_size
61-
element_val = val.CreateValueFromAddress( val.GetName() + ("[%s]" % i), address, element_type )
62-
output += print_val(element_val, internal_dict)
63-
64-
if i != length - 1:
65-
output += ", "
59+
element_val = val.CreateValueFromAddress( val.GetName() + ("[%s]" % i), address, element_type)
60+
return print_val(element_val, internal_dict)
6661

67-
output += "]"
68-
return output
62+
return "&[%s]" % (', '.join([render_element(i) for i in range(length)]))
6963

7064
def print_struct_val_starting_from(field_start_index, val, internal_dict):
7165
'''
@@ -77,39 +71,33 @@ def print_struct_val_starting_from(field_start_index, val, internal_dict):
7771
t = val.GetType()
7872
has_field_names = type_has_field_names(t)
7973
type_name = extract_type_name(t.GetName())
80-
output = ""
81-
82-
if not type_name.startswith("("):
83-
# this is a tuple, so don't print the type name
84-
output += type_name
8574

8675
if has_field_names:
87-
output += " { \n"
76+
template = "%(type_name)s {\n%(body)s\n}"
77+
separator = ", \n"
8878
else:
89-
output += "("
79+
template = "%(type_name)s(%(body)s)"
80+
separator = ", "
81+
82+
if type_name.startswith("("):
83+
# this is a tuple, so don't print the type name
84+
type_name = ""
9085

9186
num_children = val.num_children
9287

93-
for child_index in range(field_start_index, num_children):
88+
def render_child(child_index):
89+
this = ""
9490
if has_field_names:
9591
field_name = t.GetFieldAtIndex(child_index).GetName()
96-
output += field_name + ": "
92+
this += field_name + ": "
9793

9894
field_val = val.GetChildAtIndex(child_index)
99-
output += print_val(field_val, internal_dict)
95+
return this + print_val(field_val, internal_dict)
10096

101-
if child_index != num_children - 1:
102-
output += ", "
103-
104-
if has_field_names:
105-
output += "\n"
106-
107-
if has_field_names:
108-
output += "}"
109-
else:
110-
output += ")"
97+
body = separator.join([render_child(idx) for idx in range(field_start_index, num_children)])
11198

112-
return output
99+
return template % {"type_name": type_name,
100+
"body": body}
113101

114102

115103
def print_enum_val(val, internal_dict):
@@ -243,3 +231,5 @@ def is_vec_slice(val):
243231

244232
type_name = extract_type_name(ty.GetName()).replace("&'static", "&").replace(" ", "")
245233
return type_name.startswith("&[") and type_name.endswith("]")
234+
235+
# vi: sw=2:ts=2

branches/try/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')

branches/try/src/etc/vim/doc/rust.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ g:rust_conceal_pub~
5353
let g:rust_conceal_pub = 1
5454
<
5555

56+
*g:rust_recommended_style*
57+
g:rust_recommended_style~
58+
Set this option to enable vim indentation and textwidth settings to
59+
conform to style conventions of the rust standard library (i.e. use 4
60+
spaces for indents and sets 'textwidth' to 99). This option is enabled
61+
by default. To disable it: >
62+
let g:rust_recommended_style = 0
63+
<
64+
5665
*g:rust_fold*
5766
g:rust_fold~
5867
Set this option to turn on |folding|: >
@@ -79,6 +88,13 @@ g:ftplugin_rust_source_path~
7988
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
8089
<
8190

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+
8298
==============================================================================
8399
COMMANDS *rust-commands*
84100

branches/try/src/etc/vim/ftplugin/rust.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ silent! setlocal formatoptions+=j
3535
" otherwise it's better than nothing.
3636
setlocal smartindent nocindent
3737

38-
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
39-
40-
setlocal textwidth=99
38+
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
39+
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
40+
setlocal textwidth=99
41+
endif
4142

4243
" This includeexpr isn't perfect, but it's a good start
4344
setlocal includeexpr=substitute(v:fname,'::','/','g')

0 commit comments

Comments
 (0)