Skip to content

Commit 40ece36

Browse files
committed
---
yaml --- r: 146039 b: refs/heads/try2 c: 34a1e3d h: refs/heads/master i: 146037: 8a8951c 146035: 7032032 146031: b25f346 v: v3
1 parent 33c7a6b commit 40ece36

File tree

145 files changed

+399
-46182
lines changed

Some content is hidden

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

145 files changed

+399
-46182
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7a8324d3e84c53c7d480de1ed9b84e616f0e7c4d
8+
refs/heads/try2: 34a1e3dc9a1649b5552d3221c558e6791b709336
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ifneq ($(wildcard $(NON_BUILD_TARGET_TRIPLES)),)
8888
CFG_INFO := $(info cfg: non-build target triples $(NON_BUILD_TARGET_TRIPLES))
8989
endif
9090

91-
CFG_RUSTC_FLAGS := $(RUSTFLAGS) --cfg nofmt
91+
CFG_RUSTC_FLAGS := $(RUSTFLAGS)
9292
CFG_GCCISH_CFLAGS :=
9393
CFG_GCCISH_LINK_FLAGS :=
9494

branches/try2/configure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ do
684684
make_dir $t/rt/libuv/src/ares
685685
make_dir $t/rt/libuv/src/eio
686686
make_dir $t/rt/libuv/src/ev
687-
make_dir $t/rt/jemalloc
688687
for i in \
689688
isaac sync test \
690689
arch/i386 arch/x86_64 arch/arm arch/mips \

branches/try2/doc/rust.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ explain, here's a few use cases and what they would entail.
15891589
* A crate needs a global available "helper module" to itself, but it doesn't
15901590
want to expose the helper module as a public API. To accomplish this, the root
15911591
of the crate's hierarchy would have a private module which then internally has
1592-
a "public api". Because the entire crate is an ancestor of the root, then the
1592+
a "public api". Because the entire crate is a descendant of the root, then the
15931593
entire local crate can access this private module through the second case.
15941594

15951595
* When writing unit tests for a module, it's often a common idiom to have an
@@ -1602,7 +1602,10 @@ In the second case, it mentions that a private item "can be accessed" by the
16021602
current module and its descendants, but the exact meaning of accessing an item
16031603
depends on what the item is. Accessing a module, for example, would mean looking
16041604
inside of it (to import more items). On the other hand, accessing a function
1605-
would mean that it is invoked.
1605+
would mean that it is invoked. Additionally, path expressions and import
1606+
statements are considered to access an item in the sense that the
1607+
import/expression is only valid if the destination is in the current visibility
1608+
scope.
16061609

16071610
Here's an example of a program which exemplifies the three cases outlined above.
16081611

branches/try2/mk/rt.mk

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ $$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$
145145
$$(Q)$(AR_$(1)) rcs $$@ $$<
146146

147147
$$(RT_BUILD_DIR_$(1)_$(2))/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)_$(2)) $$(MKFILE_DEPS) \
148-
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)) $$(JEMALLOC_LIB_$(1))
148+
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1))
149149
@$$(call E, link: $$@)
150150
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
151-
$$(JEMALLOC_LIB_$(1)) $$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)) \
151+
$$(LIBUV_LIB_$(1)) \
152152
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)_$(2)),$$(CFG_RUNTIME_$(1)))
153153

154154
# These could go in rt.mk or rustllvm.mk, they're needed for both.
@@ -197,27 +197,22 @@ define DEF_THIRD_PARTY_TARGETS
197197
# $(1) is the target triple
198198

199199
RT_OUTPUT_DIR_$(1) := $(1)/rt
200-
JEMALLOC_TARGET_$(1) := jemalloc_pic
201200

202201
ifeq ($$(CFG_WINDOWSY_$(1)), 1)
203202
LIBUV_OSTYPE_$(1) := win
204-
JEMALLOC_TARGET_$(1) := jemalloc
205203
else ifeq ($(OSTYPE_$(1)), apple-darwin)
206204
LIBUV_OSTYPE_$(1) := mac
207205
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
208206
LIBUV_OSTYPE_$(1) := freebsd
209207
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
210208
LIBUV_OSTYPE_$(1) := android
211-
JEMALLOC_ARGS_$(1) := --disable-tls
212209
LIBUV_ARGS_$(1) := PLATFORM=android host=android OS=linux
213210
else
214211
LIBUV_OSTYPE_$(1) := linux
215212
endif
216213

217214
LIBUV_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv)
218215
LIBUV_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv/$$(LIBUV_NAME_$(1))
219-
JEMALLOC_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),$$(JEMALLOC_TARGET_$(1)))
220-
JEMALLOC_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/jemalloc/lib/$$(JEMALLOC_NAME_$(1))
221216

222217
LIBUV_MAKEFILE_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv/Makefile
223218

@@ -253,16 +248,6 @@ $$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1))
253248
V=$$(VERBOSE)
254249
endif
255250

256-
$$(JEMALLOC_LIB_$(1)):
257-
cd $$(RT_OUTPUT_DIR_$(1))/jemalloc; $(S)src/rt/jemalloc/configure \
258-
$$(JEMALLOC_ARGS_$(1)) \
259-
--disable-experimental --build=$(CFG_BUILD_TRIPLE) --host=$(1) \
260-
EXTRA_CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
261-
CC="$$(CC_$(1))" \
262-
CXX="$$(CXX_$(1))" \
263-
AR="$$(AR_$(1))"
264-
$$(Q)$$(MAKE) -C $$(RT_OUTPUT_DIR_$(1))/jemalloc build_lib_static
265-
266251
endef
267252

268253
# Instantiate template for all stages/targets

branches/try2/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ tidy:
265265
| grep '^$(S)src/libuv' -v \
266266
| grep '^$(S)src/gyp' -v \
267267
| grep '^$(S)src/etc' -v \
268-
| grep '^$(S)src/rt/jemalloc' -v \
269268
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
270269

271270
endif

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
55
" Maintainer: Chris Morgan <[email protected]>
6-
" Last Change: 2013 Sep 4
6+
" Last Change: 2013 Oct 19
77

88
if version < 600
99
syntax clear
@@ -61,6 +61,7 @@ syn keyword rustEnumVariant Ok Err
6161
" Functions {{{3
6262
"syn keyword rustFunction print println
6363
"syn keyword rustFunction range
64+
"syn keyword rustFunction from_str
6465

6566
" Types and traits {{{3
6667
syn keyword rustTrait ToCStr
@@ -79,22 +80,23 @@ syn keyword rustTrait Orderable Signed Unsigned Round
7980
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
8081
syn keyword rustTrait Integer Fractional Real RealExt
8182
syn keyword rustTrait Bitwise BitCount Bounded
82-
syn keyword rustTrait Primitive Int Float ToStrRadix
83+
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
8384
syn keyword rustTrait GenericPath
8485
syn keyword rustTrait Path
8586
syn keyword rustTrait PosixPath
8687
syn keyword rustTrait WindowsPath
8788
syn keyword rustTrait RawPtr
8889
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
90+
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
8991
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9092
syn keyword rustTrait FromStr
9193
syn keyword rustTrait IterBytes
9294
syn keyword rustTrait ToStr ToStrConsume
9395
syn keyword rustTrait CopyableTuple ImmutableTuple
94-
syn keyword rustTrait CloneableTuple1 ImmutableTuple1
95-
syn keyword rustTrait CloneableTuple2 CloneableTuple3 CloneableTuple4 CloneableTuple5
96-
syn keyword rustTrait CloneableTuple6 CloneableTuple7 CloneableTuple8 CloneableTuple9
97-
syn keyword rustTrait CloneableTuple10 CloneableTuple11 CloneableTuple12
96+
syn keyword rustTrait Tuple1 ImmutableTuple1
97+
syn keyword rustTrait Tuple2 Tuple3 Tuple4 Tuple5
98+
syn keyword rustTrait Tuple6 Tuple7 Tuple8 Tuple9
99+
syn keyword rustTrait Tuple10 Tuple11 Tuple12
98100
syn keyword rustTrait ImmutableTuple2 ImmutableTuple3 ImmutableTuple4 ImmutableTuple5
99101
syn keyword rustTrait ImmutableTuple6 ImmutableTuple7 ImmutableTuple8 ImmutableTuple9
100102
syn keyword rustTrait ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
@@ -145,7 +147,7 @@ syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
145147

146148
syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
147149
syn match rustFormat display "%%" contained
148-
syn match rustSpecial display contained /\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
150+
syn match rustSpecial display contained /\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
149151
syn match rustStringContinuation display contained /\\\n\s*/
150152
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial,rustStringContinuation
151153
syn region rustString start='r\z(#*\)"' end='"\z1'
@@ -174,13 +176,13 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
174176
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
175177

176178
" For the benefit of delimitMate
177-
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
179+
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
178180
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
179181
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
180182

181183
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
182184
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
183-
syn match rustCharacter /'\([^'\\]\|\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
185+
syn match rustCharacter /'\([^'\\]\|\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
184186

185187
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
186188
syn region rustComment start="//" end="$" contains=rustTodo keepend

branches/try2/src/libextra/workcache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Logger {
219219
}
220220

221221
pub fn info(&self, i: &str) {
222-
io::println(~"workcache: " + i);
222+
info2!("workcache: {}", i);
223223
}
224224
}
225225

branches/try2/src/librustc/back/link.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,16 @@ pub fn link_binary(sess: Session,
959959
}
960960
}
961961

962+
fn is_writeable(p: &Path) -> bool {
963+
use std::libc::consts::os::posix88::S_IWUSR;
964+
965+
!os::path_exists(p) ||
966+
(match p.get_mode() {
967+
None => false,
968+
Some(m) => m & S_IWUSR as uint == S_IWUSR as uint
969+
})
970+
}
971+
962972
pub fn link_args(sess: Session,
963973
obj_filename: &Path,
964974
out_filename: &Path,
@@ -982,6 +992,21 @@ pub fn link_args(sess: Session,
982992
out_filename.clone()
983993
};
984994

995+
// Make sure the output and obj_filename are both writeable.
996+
// Mac, FreeBSD, and Windows system linkers check this already --
997+
// however, the Linux linker will happily overwrite a read-only file.
998+
// We should be consistent.
999+
let obj_is_writeable = is_writeable(obj_filename);
1000+
let out_is_writeable = is_writeable(&output);
1001+
if !out_is_writeable {
1002+
sess.fatal(format!("Output file {} is not writeable -- check its permissions.",
1003+
output.display()));
1004+
}
1005+
else if !obj_is_writeable {
1006+
sess.fatal(format!("Object file {} is not writeable -- check its permissions.",
1007+
obj_filename.display()));
1008+
}
1009+
9851010
// The default library location, we need this to find the runtime.
9861011
// The location of crates will be determined as needed.
9871012
// FIXME (#9639): This needs to handle non-utf8 paths

branches/try2/src/librustc/middle/const_eval.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ pub enum const_val {
297297
const_int(i64),
298298
const_uint(u64),
299299
const_str(@str),
300+
const_binary(@[u8]),
300301
const_bool(bool)
301302
}
302303

@@ -476,6 +477,7 @@ pub fn eval_const_expr_partial<T: ty::ExprTyProvider>(tcx: &T, e: &Expr)
476477
pub fn lit_to_const(lit: &lit) -> const_val {
477478
match lit.node {
478479
lit_str(s, _) => const_str(s),
480+
lit_binary(data) => const_binary(data),
479481
lit_char(n) => const_uint(n as u64),
480482
lit_int(n, _) => const_int(n),
481483
lit_uint(n, _) => const_uint(n),

0 commit comments

Comments
 (0)