Skip to content

Commit bbba6d6

Browse files
committed
---
yaml --- r: 212877 b: refs/heads/master c: bddb685 h: refs/heads/master i: 212875: c190dc7 v: v3
1 parent ef8a800 commit bbba6d6

File tree

202 files changed

+665
-583
lines changed

Some content is hidden

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

202 files changed

+665
-583
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: cc44423566726260e316d879a0a1dd9d3fb92e07
2+
refs/heads/master: bddb685e7322c8ffb9578ae9e5a3a161071b257b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ fi
521521
DEFAULT_BUILD="${CFG_CPUTYPE}-${CFG_OSTYPE}"
522522

523523
CFG_SRC_DIR="$(abs_path $(dirname $0))/"
524-
CFG_SRC_DIR_RELATIVE="$(dirname $0)/"
525524
CFG_BUILD_DIR="$(pwd)/"
526525
CFG_SELF="$0"
527526
CFG_CONFIGURE_ARGS="$@"
@@ -1559,7 +1558,6 @@ done
15591558
step_msg "writing configuration"
15601559

15611560
putvar CFG_SRC_DIR
1562-
putvar CFG_SRC_DIR_RELATIVE
15631561
putvar CFG_BUILD_DIR
15641562
putvar CFG_OSTYPE
15651563
putvar CFG_CPUTYPE

trunk/mk/cfg/x86_64-unknown-linux-musl.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ CC_x86_64-unknown-linux-musl=$(CFG_MUSL_ROOT)/bin/musl-gcc
33
CXX_x86_64-unknown-linux-musl=notaprogram
44
CPP_x86_64-unknown-linux-musl=$(CFG_MUSL_ROOT)/bin/musl-gcc -E
55
AR_x86_64-unknown-linux-musl=$(AR)
6-
CFG_INSTALL_ONLY_RLIB_x86_64-unknown-linux-musl = 1
76
CFG_LIB_NAME_x86_64-unknown-linux-musl=lib$(1).so
87
CFG_STATIC_LIB_NAME_x86_64-unknown-linux-musl=lib$(1).a
98
CFG_LIB_GLOB_x86_64-unknown-linux-musl=lib$(1)-*.so

trunk/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ DOC_CRATES := std alloc collections core libc rustc_unicode
134134
#
135135
# $(1) is the crate to generate variables for
136136
define RUST_CRATE
137-
CRATEFILE_$(1) := $$(SREL)src/lib$(1)/lib.rs
137+
CRATEFILE_$(1) := $$(S)src/lib$(1)/lib.rs
138138
RSINPUTS_$(1) := $$(call rwildcard,$(S)src/lib$(1)/,*.rs)
139139
RUST_DEPS_$(1) := $$(filter-out native:%,$$(DEPS_$(1)))
140140
NATIVE_DEPS_$(1) := $$(patsubst native:%,%,$$(filter native:%,$$(DEPS_$(1))))

trunk/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ $(foreach host,$(CFG_HOST), \
322322
# exported
323323

324324
export CFG_SRC_DIR
325-
export CFG_SRC_DIR_RELATIVE
326325
export CFG_BUILD_DIR
327326
ifdef CFG_VER_DATE
328327
export CFG_VER_DATE

trunk/mk/prepare.mk

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,30 @@ DEFAULT_PREPARE_MAN_CMD = install -m644
2929

3030
# Create a directory
3131
# $(1) is the directory
32-
#
33-
# XXX: These defines are called to generate make steps.
34-
# Adding blank lines means two steps from different defines will not end up on
35-
# the same line.
3632
define PREPARE_DIR
37-
38-
@$(call E, prepare: $(1))
33+
@$(Q)$(call E, prepare: $(1))
3934
$(Q)$(PREPARE_DIR_CMD) $(1)
40-
4135
endef
4236

4337
# Copy an executable
4438
# $(1) is the filename/libname-glob
4539
#
46-
# See above for an explanation on the surrounding blank lines
40+
# Gee, what's up with that $(nop)? See comment below.
4741
define PREPARE_BIN
48-
42+
$(nop)
4943
@$(call E, prepare: $(PREPARE_DEST_BIN_DIR)/$(1))
5044
$(Q)$(PREPARE_BIN_CMD) $(PREPARE_SOURCE_BIN_DIR)/$(1) $(PREPARE_DEST_BIN_DIR)/$(1)
51-
5245
endef
5346

5447
# Copy a dylib or rlib
5548
# $(1) is the filename/libname-glob
5649
#
57-
# See above for an explanation on the surrounding blank lines
50+
# XXX: Don't remove the $(nop) command below!
51+
# Yeah, that's right, it's voodoo. Something in the way this macro is being expanded
52+
# causes it to parse incorrectly. Throwing in that empty command seems to fix the
53+
# problem. I'm sorry, just don't remove the $(nop), alright?
5854
define PREPARE_LIB
59-
55+
$(nop)
6056
@$(call E, prepare: $(PREPARE_WORKING_DEST_LIB_DIR)/$(1))
6157
$(Q)LIB_NAME="$(notdir $(lastword $(wildcard $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1))))"; \
6258
MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1)))), \
@@ -68,18 +64,13 @@ define PREPARE_LIB
6864
echo $$MATCHES ; \
6965
fi
7066
$(Q)$(PREPARE_LIB_CMD) `ls -drt1 $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1)` $(PREPARE_WORKING_DEST_LIB_DIR)/
71-
7267
endef
7368

7469
# Copy a man page
7570
# $(1) - source dir
76-
#
77-
# See above for an explanation on the surrounding blank lines
7871
define PREPARE_MAN
79-
8072
@$(call E, prepare: $(PREPARE_DEST_MAN_DIR)/$(1))
8173
$(Q)$(PREPARE_MAN_CMD) $(PREPARE_SOURCE_MAN_DIR)/$(1) $(PREPARE_DEST_MAN_DIR)/$(1)
82-
8374
endef
8475

8576
PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS))

trunk/mk/reconfig.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ Makefile config.mk: config.stamp
3434

3535
config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
3636
@$(call E, cfg: reconfiguring)
37-
$(SREL)configure $(CFG_CONFIGURE_ARGS)
37+
$(S)configure $(CFG_CONFIGURE_ARGS)

trunk/mk/util.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ print-%:
2020
@echo $*=$($*)
2121

2222
S := $(CFG_SRC_DIR)
23-
SREL := $(CFG_SRC_DIR_RELATIVE)

trunk/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ pub struct Config {
124124
// Flags to pass to the compiler when building for the target
125125
pub target_rustcflags: Option<String>,
126126

127+
// Run tests using the JIT
128+
pub jit: bool,
129+
127130
// Target system to be tested
128131
pub target: String,
129132

trunk/src/compiletest/compiletest.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7979
optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS"),
8080
optflag("", "verbose", "run tests verbosely, showing all output"),
8181
optopt("", "logfile", "file to log test execution to", "FILE"),
82+
optflag("", "jit", "run tests under the JIT"),
8283
optopt("", "target", "the target to build for", "TARGET"),
8384
optopt("", "host", "the host to build for", "HOST"),
8485
optopt("", "gdb-version", "the version of GDB used", "VERSION STRING"),
@@ -145,6 +146,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
145146
runtool: matches.opt_str("runtool"),
146147
host_rustcflags: matches.opt_str("host-rustcflags"),
147148
target_rustcflags: matches.opt_str("target-rustcflags"),
149+
jit: matches.opt_present("jit"),
148150
target: opt_str2(matches.opt_str("target")),
149151
host: opt_str2(matches.opt_str("host")),
150152
gdb_version: extract_gdb_version(matches.opt_str("gdb-version")),
@@ -184,6 +186,7 @@ pub fn log_config(config: &Config) {
184186
opt_str(&config.host_rustcflags)));
185187
logv(c, format!("target-rustcflags: {}",
186188
opt_str(&config.target_rustcflags)));
189+
logv(c, format!("jit: {}", config.jit));
187190
logv(c, format!("target: {}", config.target));
188191
logv(c, format!("host: {}", config.host));
189192
logv(c, format!("android-cross-path: {:?}",

trunk/src/compiletest/runtest.rs

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,17 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
9898
}
9999

100100
fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
101-
let proc_res = compile_test(config, props, testfile);
101+
let proc_res = if !config.jit {
102+
let proc_res = compile_test(config, props, testfile);
102103

103-
if !proc_res.status.success() {
104-
fatal_proc_rec("compilation failed!", &proc_res);
105-
}
104+
if !proc_res.status.success() {
105+
fatal_proc_rec("compilation failed!", &proc_res);
106+
}
106107

107-
let proc_res = exec_compiled_test(config, props, testfile);
108+
exec_compiled_test(config, props, testfile)
109+
} else {
110+
jit_test(config, props, testfile)
111+
};
108112

109113
// The value our Makefile configures valgrind to return on failure
110114
const VALGRIND_ERR: i32 = 100;
@@ -129,16 +133,24 @@ fn check_correct_failure_status(proc_res: &ProcRes) {
129133
}
130134

131135
fn run_rpass_test(config: &Config, props: &TestProps, testfile: &Path) {
132-
let proc_res = compile_test(config, props, testfile);
136+
if !config.jit {
137+
let mut proc_res = compile_test(config, props, testfile);
133138

134-
if !proc_res.status.success() {
135-
fatal_proc_rec("compilation failed!", &proc_res);
136-
}
139+
if !proc_res.status.success() {
140+
fatal_proc_rec("compilation failed!", &proc_res);
141+
}
137142

138-
let proc_res = exec_compiled_test(config, props, testfile);
143+
proc_res = exec_compiled_test(config, props, testfile);
139144

140-
if !proc_res.status.success() {
141-
fatal_proc_rec("test run failed!", &proc_res);
145+
if !proc_res.status.success() {
146+
fatal_proc_rec("test run failed!", &proc_res);
147+
}
148+
} else {
149+
let proc_res = jit_test(config, props, testfile);
150+
151+
if !proc_res.status.success() {
152+
fatal_proc_rec("jit failed!", &proc_res);
153+
}
142154
}
143155
}
144156

@@ -1129,6 +1141,10 @@ fn compile_test(config: &Config, props: &TestProps,
11291141
compile_test_(config, props, testfile, &[])
11301142
}
11311143

1144+
fn jit_test(config: &Config, props: &TestProps, testfile: &Path) -> ProcRes {
1145+
compile_test_(config, props, testfile, &["--jit".to_string()])
1146+
}
1147+
11321148
fn compile_test_(config: &Config, props: &TestProps,
11331149
testfile: &Path, extra_args: &[String]) -> ProcRes {
11341150
let aux_dir = aux_output_dir_name(config, testfile);

trunk/src/doc/trpl/associated-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trait Graph {
4343
Now, our clients can be abstract over a given `Graph`:
4444

4545
```rust,ignore
46-
fn distance<G: Graph>(graph: &G, start: &G::N, end: &G::N) -> u32 { ... }
46+
fn distance<G: Graph>(graph: &G, start: &G::N, end: &G::N) -> usize { ... }
4747
```
4848

4949
No need to deal with the `E`dge type here!

trunk/src/doc/trpl/iterators.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ has no side effect on the original iterator. Let's try it out with our infinite
285285
iterator from before:
286286

287287
```rust
288-
for i in (1..).take(5) {
288+
# #![feature(step_by)]
289+
for i in (1..).step_by(5).take(5) {
289290
println!("{}", i);
290291
}
291292
```
@@ -294,10 +295,10 @@ This will print
294295

295296
```text
296297
1
297-
2
298-
3
299-
4
300-
5
298+
6
299+
11
300+
16
301+
21
301302
```
302303

303304
`filter()` is an adapter that takes a closure as an argument. This closure

trunk/src/doc/trpl/lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
305305
fn get_str() -> &str; // ILLEGAL, no inputs
306306
307307
fn frob(s: &str, t: &str) -> &str; // ILLEGAL, two inputs
308-
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is ambiguous
308+
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is unclear
309309
310310
fn get_mut(&mut self) -> &mut T; // elided
311311
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded

trunk/src/libcore/fmt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub trait Write {
7272
///
7373
/// # Errors
7474
///
75-
/// This function will return an instance of `Error` on error.
75+
/// This function will return an instance of `FormatError` on error.
7676
#[stable(feature = "rust1", since = "1.0.0")]
7777
fn write_str(&mut self, s: &str) -> Result;
7878

@@ -85,7 +85,7 @@ pub trait Write {
8585
///
8686
/// # Errors
8787
///
88-
/// This function will return an instance of `Error` on error.
88+
/// This function will return an instance of `FormatError` on error.
8989
#[stable(feature = "fmt_write_char", since = "1.1.0")]
9090
fn write_char(&mut self, c: char) -> Result {
9191
let mut utf_8 = [0u8; 4];

trunk/src/librustc/metadata/tyencode.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ pub fn enc_ty<'a, 'tcx>(w: &mut Encoder, cx: &ctxt<'a, 'tcx>, t: Ty<'tcx>) {
113113
ty::TyArray(t, sz) => {
114114
mywrite!(w, "V");
115115
enc_ty(w, cx, t);
116-
mywrite!(w, "/{}|", sz);
117-
}
118-
ty::TySlice(t) => {
119-
mywrite!(w, "V");
120-
enc_ty(w, cx, t);
121-
mywrite!(w, "/|");
116+
mywrite!(w, "/");
117+
match sz {
118+
Some(n) => mywrite!(w, "{}|", n),
119+
None => mywrite!(w, "|"),
120+
}
122121
}
123122
ty::TyStr => {
124123
mywrite!(w, "v");

trunk/src/librustc/middle/check_const.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
423423
self.visit_expr(&**element);
424424
// The count is checked elsewhere (typeck).
425425
let count = match node_ty.sty {
426-
ty::TyArray(_, n) => n,
426+
ty::TyArray(_, Some(n)) => n,
427427
_ => unreachable!()
428428
};
429429
// [element; 0] is always zero-sized.
@@ -851,14 +851,10 @@ impl<'a, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'tcx> {
851851
}
852852
let mutbl = bk.to_mutbl_lossy();
853853
if mutbl == ast::MutMutable && self.mode == Mode::StaticMut {
854-
// Mutable slices are the only `&mut` allowed in
855-
// globals, but only in `static mut`, nowhere else.
856-
// FIXME: This exception is really weird... there isn't
857-
// any fundamental reason to restrict this based on
858-
// type of the expression. `&mut [1]` has exactly the
859-
// same representation as &mut 1.
854+
// Mutable slices are the only `&mut` allowed in globals,
855+
// but only in `static mut`, nowhere else.
860856
match cmt.ty.sty {
861-
ty::TyArray(_, _) | ty::TySlice(_) => break,
857+
ty::TyArray(_, _) => break,
862858
_ => {}
863859
}
864860
}

trunk/src/librustc/middle/check_match.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,14 +537,14 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
537537

538538
ty::TyRef(_, ty::mt { ty, mutbl }) => {
539539
match ty.sty {
540-
ty::TyArray(_, n) => match ctor {
540+
ty::TyArray(_, Some(n)) => match ctor {
541541
&Single => {
542542
assert_eq!(pats_len, n);
543543
ast::PatVec(pats.collect(), None, vec!())
544544
},
545545
_ => unreachable!()
546546
},
547-
ty::TySlice(_) => match ctor {
547+
ty::TyArray(_, None) => match ctor {
548548
&Slice(n) => {
549549
assert_eq!(pats_len, n);
550550
ast::PatVec(pats.collect(), None, vec!())
@@ -560,7 +560,7 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
560560
}
561561
}
562562

563-
ty::TyArray(_, len) => {
563+
ty::TyArray(_, Some(len)) => {
564564
assert_eq!(pats_len, len);
565565
ast::PatVec(pats.collect(), None, vec![])
566566
}
@@ -601,7 +601,7 @@ fn all_constructors(cx: &MatchCheckCtxt, left_ty: Ty,
601601
[true, false].iter().map(|b| ConstantValue(const_bool(*b))).collect(),
602602

603603
ty::TyRef(_, ty::mt { ty, .. }) => match ty.sty {
604-
ty::TySlice(_) =>
604+
ty::TyArray(_, None) =>
605605
range_inclusive(0, max_slice_length).map(|length| Slice(length)).collect(),
606606
_ => vec!(Single)
607607
},
@@ -779,7 +779,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
779779
vec!(ConstantRange(eval_const_expr(cx.tcx, &**lo), eval_const_expr(cx.tcx, &**hi))),
780780
ast::PatVec(ref before, ref slice, ref after) =>
781781
match left_ty.sty {
782-
ty::TyArray(_, _) => vec!(Single),
782+
ty::TyArray(_, Some(_)) => vec!(Single),
783783
_ => if slice.is_some() {
784784
range_inclusive(before.len() + after.len(), max_slice_length)
785785
.map(|length| Slice(length))
@@ -807,7 +807,7 @@ pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usi
807807
ty::TyTuple(ref fs) => fs.len(),
808808
ty::TyBox(_) => 1,
809809
ty::TyRef(_, ty::mt { ty, .. }) => match ty.sty {
810-
ty::TySlice(_) => match *ctor {
810+
ty::TyArray(_, None) => match *ctor {
811811
Slice(length) => length,
812812
ConstantValue(_) => 0,
813813
_ => unreachable!()
@@ -822,7 +822,7 @@ pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usi
822822
}
823823
}
824824
ty::TyStruct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(),
825-
ty::TyArray(_, n) => n,
825+
ty::TyArray(_, Some(n)) => n,
826826
_ => 0
827827
}
828828
}

trunk/src/librustc/middle/fast_reject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn simplify_type(tcx: &ty::ctxt,
5555
ty::TyFloat(float_type) => Some(FloatSimplifiedType(float_type)),
5656
ty::TyEnum(def_id, _) => Some(EnumSimplifiedType(def_id)),
5757
ty::TyStr => Some(StrSimplifiedType),
58-
ty::TyArray(..) | ty::TySlice(_) => Some(VecSimplifiedType),
58+
ty::TyArray(..) => Some(VecSimplifiedType),
5959
ty::TyRawPtr(_) => Some(PtrSimplifiedType),
6060
ty::TyTrait(ref trait_info) => {
6161
Some(TraitSimplifiedType(trait_info.principal_def_id()))

0 commit comments

Comments
 (0)