Skip to content

Commit efacc1b

Browse files
committed
---
yaml --- r: 162534 b: refs/heads/try c: 46bdb45 h: refs/heads/master v: v3
1 parent 499b111 commit efacc1b

File tree

59 files changed

+504
-816
lines changed

Some content is hidden

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

59 files changed

+504
-816
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: 072015ee3d0495578c6072c6af38544e1af3710b
5+
refs/heads/try: 46bdb455c3087149364d87748cc6c683c4ed130e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,11 @@ 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
714719
fi
715720

716721
# Force freebsd to build with clang; gcc doesn't like us there

branches/try/mk/main.mk

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

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

202199
# "Source" files we generate in builddir along the way.
203200
GENERATED :=

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=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$<
78+
-filetype=obj -mtriple=$(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)if [ -e "$@" ]; then touch "$@"; else echo "ERROR: snapshot $@ not found"; exit 1; fi
25+
$(Q)touch $@
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_$(2)_H_$(3))/
119+
| $$(TBIN$(1)_T_$(4)_H_$(3))/
120120
@$$(call E, rustc: $$@)
121121
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
122122

branches/try/src/compiletest/errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::ascii::AsciiExt;
1211
use std::io::{BufferedReader, File};
1312
use regex::Regex;
1413

@@ -32,7 +31,7 @@ pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
3231
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
3332
re.captures(line).and_then(|caps| {
3433
let adjusts = caps.name("adjusts").len();
35-
let kind = caps.name("kind").to_ascii_lower();
34+
let kind = caps.name("kind").to_ascii().to_lowercase().into_string();
3635
let msg = caps.name("msg").trim().to_string();
3736

3837
debug!("line={} kind={} msg={}", line_num, kind, msg);

branches/try/src/compiletest/runtest.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
10+
#[cfg(not(stage0))]
1111
use self::TargetLocation::*;
1212

1313
use common::Config;
@@ -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| TargetLocation::ThisFile(make_exe_name(a, b)), testfile);
1164+
|a, b| 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-
TargetLocation::ThisDirectory(f.dir_path())
1222+
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-
TargetLocation::ThisFile(path) => {
1299+
ThisFile(path) => {
13001300
args.push("-o".to_string());
13011301
path
13021302
}
1303-
TargetLocation::ThisDirectory(path) => {
1303+
ThisDirectory(path) => {
13041304
args.push("--out-dir".to_string());
13051305
path
13061306
}
@@ -1672,8 +1672,7 @@ 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| TargetLocation::ThisDirectory(
1676-
output_base_name(a, b).dir_path()),
1675+
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16771676
testfile);
16781677
compose_and_run_compiler(config, props, testfile, args, None)
16791678
}

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 Cargo uses that filename as the crate
3148-
root by convention.
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.
31493149

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

branches/try/src/doc/reference.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,12 +1334,7 @@ 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:
1338-
1339-
```
1340-
type Point = (u8, u8);
1341-
let p: Point = (41, 68);
1342-
```
1337+
`y` component.
13431338

13441339
### Structures
13451340

branches/try/src/driver/driver.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![no_start]
12+
1113
#[cfg(rustdoc)]
1214
extern crate "rustdoc" as this;
1315

branches/try/src/etc/lldb_rust_formatters.py

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ 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+
4648
length = val.GetChildAtIndex(1).GetValueAsUnsigned()
4749

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

5557
start_address = data_ptr_val.GetValueAsUnsigned()
5658

57-
def render_element(i):
59+
for i in range(length):
5860
address = start_address + i * element_type_size
59-
element_val = val.CreateValueFromAddress( val.GetName() + ("[%s]" % i), address, element_type)
60-
return print_val(element_val, internal_dict)
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 += ", "
6166

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

6470
def print_struct_val_starting_from(field_start_index, val, internal_dict):
6571
'''
@@ -71,33 +77,39 @@ def print_struct_val_starting_from(field_start_index, val, internal_dict):
7177
t = val.GetType()
7278
has_field_names = type_has_field_names(t)
7379
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
7485

7586
if has_field_names:
76-
template = "%(type_name)s {\n%(body)s\n}"
77-
separator = ", \n"
87+
output += " { \n"
7888
else:
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 = ""
89+
output += "("
8590

8691
num_children = val.num_children
8792

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

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

97-
body = separator.join([render_child(idx) for idx in range(field_start_index, num_children)])
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 += ")"
98111

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

102114

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

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

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

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -66,64 +66,69 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
6666
" This section is just straight transformation of the contents of the prelude,
6767
" to make it easy to update.
6868

69-
" Reexported core operators {{{3
69+
" Core operators {{{3
7070
syn keyword rustTrait Copy Send Sized Sync
7171
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
7272
syn keyword rustTrait BitAnd BitOr BitXor
7373
syn keyword rustTrait Drop Deref DerefMut
74-
syn keyword rustTrait Shl Shr
75-
syn keyword rustTrait Index IndexMut
76-
syn keyword rustTrait Slice SliceMut
77-
syn keyword rustTrait Fn FnMut FnOnce
74+
syn keyword rustTrait Shl Shr Index IndexMut
75+
syn keyword rustEnum Option
76+
syn keyword rustEnumVariant Some None
77+
syn keyword rustEnum Result
78+
syn keyword rustEnumVariant Ok Err
7879

79-
" Reexported functions {{{3
80-
"syn keyword rustFunction range repeat
81-
"syn keyword rustFunction drop
80+
" Functions {{{3
8281
"syn keyword rustFunction from_str
82+
"syn keyword rustFunction range
83+
"syn keyword rustFunction drop
8384

84-
" Reexported types and traits {{{3
85+
" Types and traits {{{3
8586
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
8687
syn keyword rustTrait IntoBytes
8788
syn keyword rustTrait ToCStr
8889
syn keyword rustTrait Char UnicodeChar
8990
syn keyword rustTrait Clone
90-
syn keyword rustTrait PartialEq PartialOrd Eq Ord
91-
syn keyword rustEnum Ordering Equiv
91+
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
92+
syn keyword rustEnum Ordering
9293
syn keyword rustEnumVariant Less Equal Greater
93-
syn keyword rustTrait FromIterator Extend ExactSize
94+
syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq
95+
syn keyword rustTrait Set MutableSet
96+
syn keyword rustTrait FromIterator IntoIterator Extend ExactSize
9497
syn keyword rustTrait Iterator DoubleEndedIterator
9598
syn keyword rustTrait RandomAccessIterator CloneableIterator
9699
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
97-
syn keyword rustTrait ToPrimitive FromPrimitive
100+
syn keyword rustTrait NumCast Int SignedInt UnsignedInt Float
101+
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
98102
syn keyword rustTrait Box
99-
syn keyword rustEnum Option
100-
syn keyword rustEnumVariant Some None
101103
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
102-
syn keyword rustTrait RawPtr RawMutPtr
103-
syn keyword rustEnum Result
104-
syn keyword rustEnumVariant Ok Err
105-
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
106-
syn keyword rustTrait Str StrVector StrPrelude
107-
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrPrelude
104+
syn keyword rustTrait RawPtr
105+
syn keyword rustTrait Buffer Writer Reader Seek
106+
syn keyword rustTrait Str StrVector StrSlice
107+
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
108+
syn keyword rustTrait ToString IntoString
108109
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
109110
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
110111
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
111-
syn keyword rustTrait SlicePrelude AsSlice CloneSlicePrelude
112-
syn keyword rustTrait VectorVector PartialEqSlicePrelude OrdSlicePrelude
113-
syn keyword rustTrait CloneSliceAllocPrelude OrdSliceAllocPrelude SliceAllocPrelude
114-
syn keyword rustTrait IntoString String ToString
112+
syn keyword rustTrait CloneableVector ImmutableCloneableVector
113+
syn keyword rustTrait MutableCloneableSlice MutableOrdSlice
114+
syn keyword rustTrait ImmutableSlice MutableSlice
115+
syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice
116+
syn keyword rustTrait Slice VectorVector
117+
syn keyword rustTrait MutableSliceAllocating
118+
syn keyword rustTrait String
115119
syn keyword rustTrait Vec
116120

117-
" Reexported runtime types {{{3
118121
"syn keyword rustFunction sync_channel channel
119122
syn keyword rustTrait SyncSender Sender Receiver
120123
"syn keyword rustFunction spawn
121124

122-
" Other syntax {{{2
125+
"syn keyword rustConstant GC
123126

124127
syn keyword rustSelf self
125128
syn keyword rustBoolean true false
126129

130+
" Other syntax {{{2
131+
127132
" If foo::bar changes to foo.bar, change this ("::" to "\.").
128133
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
129134
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3

0 commit comments

Comments
 (0)