Skip to content

Commit 874638e

Browse files
committed
---
yaml --- r: 146325 b: refs/heads/try2 c: c888fc6 h: refs/heads/master i: 146323: 3a35eb7 v: v3
1 parent 8b1069b commit 874638e

Some content is hidden

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

80 files changed

+1418
-7559
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: b9504f993116f6d7ff1a12abe6c36f7afcc2abed
8+
refs/heads/try2: c888fc6db2698268df57341cb1449d00695b86e7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/stage0.mk

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,13 @@ $$(HLIB0_H_$(1))/$(CFG_EXTRALIB_$(1)): \
9898
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(EXTRALIB_GLOB_$(1)) $$@
9999
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(4)),$$(notdir $$@))
100100

101-
$$(HLIB0_H_$(1))/$(CFG_LIBRUSTUV_$(1)):
102-
touch $$@
103-
# NOTE: this should get uncommented after a snapshot and the rule above this can
104-
# get deleted, right now we're not expecting a librustuv in a snapshot.
105-
# $$(HLIB0_H_$(1))/$(CFG_LIBRUSTUV_$(1)): \
106-
# $$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_LIBRUSTUV_$(1)) \
107-
# | $(HLIB0_H_$(1))/
108-
# @$$(call E, cp: $$@)
109-
# $$(call CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(4)),$$(notdir $$@))
110-
# $$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(LIBRUSTUV_GLOB_$(1)) $$@
111-
# $$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(4)),$$(notdir $$@))
101+
$$(HLIB0_H_$(1))/$(CFG_LIBRUSTUV_$(1)): \
102+
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_LIBRUSTUV_$(1)) \
103+
| $(HLIB0_H_$(1))/
104+
@$$(call E, cp: $$@)
105+
$$(call CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(4)),$$(notdir $$@))
106+
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(LIBRUSTUV_GLOB_$(1)) $$@
107+
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(4)),$$(notdir $$@))
112108

113109
$$(HLIB0_H_$(1))/$(CFG_LIBRUSTC_$(1)): \
114110
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_LIBRUSTC_$(1)) \

branches/try2/mk/tests.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ $(foreach host,$(CFG_HOST), \
465465
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
466466
))))))
467467

468+
# FIXME (#10104): Raise the stack size to work around rustpkg bypassing
469+
# the code in rustc that would take care of it.
470+
define DEF_RUSTPKG_STACK_FIX
471+
$$(call TEST_OK_FILE,$(1),$(2),$(3),rustpkg): export RUST_MIN_STACK=8000000
472+
endef
473+
474+
$(foreach host,$(CFG_HOST_TRIPLES), \
475+
$(foreach target,$(CFG_TARGET_TRIPLES), \
476+
$(foreach stage,$(STAGES), \
477+
$(eval $(call DEF_RUSTPKG_STACK_FIX,$(stage),$(target),$(host))))))
478+
468479

469480
######################################################################
470481
# Rules for the compiletest tests (rpass, rfail, etc.)

branches/try2/src/compiletest/runtest.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
281281
};
282282
let config = &mut config;
283283
let cmds = props.debugger_cmds.connect("\n");
284-
let check_lines = props.check_lines.clone();
284+
let check_lines = &props.check_lines;
285285

286286
// compile test file (it shoud have 'compile-flags:-g' in the header)
287287
let mut ProcRes = compile_test(config, props, testfile);
@@ -315,11 +315,34 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
315315

316316
let num_check_lines = check_lines.len();
317317
if num_check_lines > 0 {
318+
// Allow check lines to leave parts unspecified (e.g., uninitialized
319+
// bits in the wrong case of an enum) with the notation "[...]".
320+
let check_fragments: ~[~[&str]] = check_lines.map(|s| s.split_str_iter("[...]").collect());
318321
// check if each line in props.check_lines appears in the
319322
// output (in order)
320323
let mut i = 0u;
321324
for line in ProcRes.stdout.line_iter() {
322-
if check_lines[i].trim() == line.trim() {
325+
let mut rest = line.trim();
326+
let mut first = true;
327+
let mut failed = false;
328+
for &frag in check_fragments[i].iter() {
329+
let found = if first {
330+
if rest.starts_with(frag) { Some(0) } else { None }
331+
} else {
332+
rest.find_str(frag)
333+
};
334+
match found {
335+
None => {
336+
failed = true;
337+
break;
338+
}
339+
Some(i) => {
340+
rest = rest.slice_from(i + frag.len());
341+
}
342+
}
343+
first = false;
344+
}
345+
if !failed && rest.len() == 0 {
323346
i += 1u;
324347
}
325348
if i == num_check_lines {

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim indent file
22
" Language: Rust
33
" Author: Chris Morgan <[email protected]>
4-
" Last Change: 2013 Jul 10
4+
" Last Change: 2013 Oct 29
55

66
" Only load this indent file when no other was loaded.
77
if exists("b:did_indent")
@@ -104,8 +104,23 @@ function GetRustIndent(lnum)
104104
let prevline = s:get_line_trimmed(prevnonblank(a:lnum - 1))
105105
if prevline[len(prevline) - 1] == ","
106106
\ && s:get_line_trimmed(a:lnum) !~ "^\\s*[\\[\\]{}]"
107+
\ && prevline !~ "^\\s*fn\\s"
107108
" Oh ho! The previous line ended in a comma! I bet cindent will try to
108-
" take this too far... For now, let's use the previous line's indent
109+
" take this too far... For now, let's normally use the previous line's
110+
" indent.
111+
112+
" One case where this doesn't work out is where *this* line contains
113+
" square or curly brackets; then we normally *do* want to be indenting
114+
" further.
115+
"
116+
" Another case where we don't want to is one like a function
117+
" definition with arguments spread over multiple lines:
118+
"
119+
" fn foo(baz: Baz,
120+
" baz: Baz) // <-- cindent gets this right by itself
121+
"
122+
" There are probably other cases where we don't want to do this as
123+
" well. Add them as needed.
109124
return GetRustIndent(a:lnum - 1)
110125
endif
111126

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

Lines changed: 20 additions & 22 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 Oct 19
6+
" Last Change: 2013 Oct 29
77

88
if version < 600
99
syntax clear
@@ -64,47 +64,45 @@ syn keyword rustEnumVariant Ok Err
6464
"syn keyword rustFunction from_str
6565

6666
" Types and traits {{{3
67+
syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
68+
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
69+
syn keyword rustTrait Bool
6770
syn keyword rustTrait ToCStr
71+
syn keyword rustTrait Char
6872
syn keyword rustTrait Clone DeepClone
6973
syn keyword rustTrait Eq ApproxEq Ord TotalEq TotalOrd Ordering Equiv
7074
syn keyword rustEnumVariant Less Equal Greater
71-
syn keyword rustTrait Char
7275
syn keyword rustTrait Container Mutable Map MutableMap Set MutableSet
76+
syn keyword rustTrait Default
7377
syn keyword rustTrait Hash
74-
syn keyword rustTrait Times
78+
syn keyword rustTrait FromStr
7579
syn keyword rustTrait FromIterator Extendable
7680
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator ClonableIterator
7781
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
78-
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
79-
syn keyword rustTrait Orderable Signed Unsigned Round
82+
syn keyword rustTrait Times
83+
8084
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
81-
syn keyword rustTrait Integer Fractional Real RealExt
8285
syn keyword rustTrait Bitwise BitCount Bounded
86+
syn keyword rustTrait Integer Fractional Real RealExt
87+
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
88+
syn keyword rustTrait Orderable Signed Unsigned Round
8389
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
84-
syn keyword rustTrait GenericPath
85-
syn keyword rustTrait Path
86-
syn keyword rustTrait PosixPath
87-
syn keyword rustTrait WindowsPath
90+
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
8891
syn keyword rustTrait RawPtr
89-
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
9092
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9193
syn keyword rustTrait Str StrVector StrSlice OwnedStr
92-
syn keyword rustTrait FromStr
9394
syn keyword rustTrait IterBytes
9495
syn keyword rustTrait ToStr ToStrConsume
9596
syn keyword rustTrait CopyableTuple ImmutableTuple
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
100-
syn keyword rustTrait ImmutableTuple2 ImmutableTuple3 ImmutableTuple4 ImmutableTuple5
101-
syn keyword rustTrait ImmutableTuple6 ImmutableTuple7 ImmutableTuple8 ImmutableTuple9
102-
syn keyword rustTrait ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
103-
syn keyword rustTrait Vector VectorVector CopyableVector ImmutableVector
97+
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
98+
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
99+
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
100+
syn keyword rustTrait ImmutableTuple1 ImmutableTuple2 ImmutableTuple3 ImmutableTuple4
101+
syn keyword rustTrait ImmutableTuple5 ImmutableTuple6 ImmutableTuple7 ImmutableTuple8
102+
syn keyword rustTrait ImmutableTuple9 ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
104103
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCopyableVector
105104
syn keyword rustTrait OwnedVector OwnedCopyableVector OwnedEqVector MutableVector
106-
syn keyword rustTrait Reader ReaderUtil Writer WriterUtil
107-
syn keyword rustTrait Default
105+
syn keyword rustTrait Vector VectorVector CopyableVector ImmutableVector
108106

109107
"syn keyword rustFunction stream
110108
syn keyword rustTrait Port Chan GenericChan GenericSmartChan GenericPort Peekable

branches/try2/src/libextra/enum_set.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ mod test {
140140
use enum_set::*;
141141

142142
#[deriving(Eq)]
143+
#[repr(uint)]
143144
enum Foo {
144145
A, B, C
145146
}

branches/try2/src/libextra/extra.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ pub mod extra {
118118
pub use std::clone;
119119
pub use std::condition;
120120
pub use std::cmp;
121+
// NOTE: Remove import after next snapshot
122+
#[cfg(stage0)]
121123
pub use std::sys;
122124
pub use std::unstable;
123125
pub use std::str;

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ pub static Vector: TypeKind = 13;
147147
pub static Metadata: TypeKind = 14;
148148
pub static X86_MMX: TypeKind = 15;
149149

150+
#[repr(C)]
150151
pub enum AtomicBinOp {
151152
Xchg = 0,
152153
Add = 1,
@@ -161,6 +162,7 @@ pub enum AtomicBinOp {
161162
UMin = 10,
162163
}
163164

165+
#[repr(C)]
164166
pub enum AtomicOrdering {
165167
NotAtomic = 0,
166168
Unordered = 1,
@@ -173,6 +175,7 @@ pub enum AtomicOrdering {
173175
}
174176

175177
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
178+
#[repr(C)]
176179
pub enum FileType {
177180
AssemblyFile = 0,
178181
ObjectFile = 1
@@ -194,20 +197,23 @@ pub enum AsmDialect {
194197
}
195198

196199
#[deriving(Eq)]
200+
#[repr(C)]
197201
pub enum CodeGenOptLevel {
198202
CodeGenLevelNone = 0,
199203
CodeGenLevelLess = 1,
200204
CodeGenLevelDefault = 2,
201205
CodeGenLevelAggressive = 3,
202206
}
203207

208+
#[repr(C)]
204209
pub enum RelocMode {
205210
RelocDefault = 0,
206211
RelocStatic = 1,
207212
RelocPIC = 2,
208213
RelocDynamicNoPic = 3,
209214
}
210215

216+
#[repr(C)]
211217
pub enum CodeGenModel {
212218
CodeModelDefault = 0,
213219
CodeModelJITDefault = 1,

branches/try2/src/librustc/metadata/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pub static tag_items_data_item_reexport_name: uint = 0x4f;
112112

113113
// used to encode crate_ctxt side tables
114114
#[deriving(Eq)]
115+
#[repr(uint)]
115116
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
116117
tag_ast = 0x50,
117118

@@ -143,7 +144,7 @@ impl astencode_tag {
143144
pub fn from_uint(value : uint) -> Option<astencode_tag> {
144145
let is_a_tag = first_astencode_tag <= value && value <= last_astencode_tag;
145146
if !is_a_tag { None } else {
146-
Some(unsafe { cast::transmute(value as int) })
147+
Some(unsafe { cast::transmute(value) })
147148
}
148149
}
149150
}

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
989989
encode_family(ebml_w, 't');
990990
encode_bounds_and_type(ebml_w, ecx, &lookup_item_type(tcx, def_id));
991991
encode_name(ecx, ebml_w, item.ident);
992+
encode_attributes(ebml_w, item.attrs);
992993
for v in (*enum_definition).variants.iter() {
993994
encode_variant_id(ebml_w, local_def(v.node.id));
994995
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
//! Context itself, span_lint should be used instead of add_lint.
3535
3636
use driver::session;
37+
use middle::trans::adt; // for `adt::is_ffi_safe`
3738
use middle::ty;
3839
use middle::pat_util;
3940
use metadata::csearch;
@@ -627,6 +628,14 @@ fn check_item_ctypes(cx: &Context, it: &ast::item) {
627628
"found rust type `uint` in foreign module, while \
628629
libc::c_uint or libc::c_ulong should be used");
629630
}
631+
ast::DefTy(def_id) => {
632+
if !adt::is_ffi_safe(cx.tcx, def_id) {
633+
cx.span_lint(ctypes, ty.span,
634+
"found enum type without foreign-function-safe \
635+
representation annotation in foreign module");
636+
// NOTE this message could be more helpful
637+
}
638+
}
630639
_ => ()
631640
}
632641
}

0 commit comments

Comments
 (0)