Skip to content

Commit 38a55a8

Browse files
committed
---
yaml --- r: 148970 b: refs/heads/try2 c: cebe5e8 h: refs/heads/master v: v3
1 parent f6c0fdb commit 38a55a8

File tree

641 files changed

+5520
-6961
lines changed

Some content is hidden

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

641 files changed

+5520
-6961
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: 7d7a060f8d95ee43406560e69a12631e52c617a7
8+
refs/heads/try2: cebe5e8e6baecd448f810f5960daab10fa2d089c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/man/rustc.1

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@ This program is a compiler for the Rust language, available at
1212
.SH OPTIONS
1313

1414
.TP
15-
\fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR
16-
Configure the flavor of rust crate that is generated (default `bin`)
15+
\fB\-\-bin\fR
16+
Compile an executable crate (default)
17+
.TP
18+
\fB\-c\fR
19+
Compile and assemble, but do not link
1720
.TP
1821
\fB\-\-cfg\fR SPEC
1922
Configure the compilation environment
2023
.TP
21-
\fB\-\-emit=[asm,ir,bc,obj,link]\fR
22-
Configure the output that rustc will produce
24+
\fB\-\-emit\-llvm\fR
25+
Produce an LLVM bitcode file
2326
.TP
2427
\fB\-h\fR, \fB\-\-help\fR
2528
Display this message
2629
.TP
2730
\fB\-L\fR PATH
2831
Add a directory to the library search path
2932
.TP
33+
\fB\-\-lib\fR
34+
Compile a library crate
35+
.TP
3036
\fB\-\-linker\fR LINKER
3137
Program to use for linking instead of the default
3238
.TP
@@ -43,7 +49,7 @@ Run all passes except translation; no output
4349
Equivalent to \fI\-\-opt\-level=2\fR
4450
.TP
4551
\fB\-o\fR FILENAME
46-
Write output to <filename>. Ignored if more than one --emit is specified.
52+
Write output to <filename>
4753
.TP
4854
\fB\-\-opt\-level\fR LEVEL
4955
Optimize with possible levels 0-3
@@ -54,8 +60,7 @@ the default passes for the optimization level. A value of 'list'
5460
will list the available passes.
5561
.TP
5662
\fB\-\-out\-dir\fR DIR
57-
Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
58-
(default the current directory)
63+
Write output to compiler-chosen filename in <dir>
5964
.TP
6065
\fB\-\-parse\-only\fR
6166
Parse only; do not compile, assemble, or link
@@ -66,6 +71,9 @@ Pretty-print the input instead of compiling; valid types are: normal
6671
expanded, with type annotations), or identified (fully parenthesized,
6772
AST nodes and blocks with IDs)
6873
.TP
74+
\fB\-S\fR
75+
Compile only; do not assemble or link
76+
.TP
6977
\fB\-\-save\-temps\fR
7078
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
7179
.TP
@@ -112,7 +120,7 @@ To build an executable from a source file with a main function:
112120
$ rustc -o hello hello.rs
113121

114122
To build a library from a source file:
115-
$ rustc --crate-type=lib hello-lib.rs
123+
$ rustc --lib hello-lib.rs
116124

117125
To build either with a crate (.rs) file:
118126
$ rustc hello.rs

branches/try2/mk/crates.mk

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,27 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections
52+
TARGET_CRATES := std extra green rustuv native flate arena glob term semver uuid
5453
HOST_CRATES := syntax rustc rustdoc
5554
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5655
TOOLS := compiletest rustdoc rustc
5756

5857
DEPS_std := native:rustrt
59-
DEPS_extra := std term sync serialize getopts collections
58+
DEPS_extra := std term
6059
DEPS_green := std
6160
DEPS_rustuv := std native:uv native:uv_support
6261
DEPS_native := std
63-
DEPS_syntax := std extra term serialize collections
64-
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
65-
collections
66-
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections
62+
DEPS_syntax := std extra term
63+
DEPS_rustc := syntax native:rustllvm flate arena
64+
DEPS_rustdoc := rustc native:sundown
6765
DEPS_flate := std native:miniz
68-
DEPS_arena := std collections
66+
DEPS_arena := std extra
6967
DEPS_glob := std
70-
DEPS_serialize := std
7168
DEPS_term := std
7269
DEPS_semver := std
73-
DEPS_uuid := std serialize
74-
DEPS_sync := std
75-
DEPS_getopts := std
76-
DEPS_collections := std serialize
70+
DEPS_uuid := std extra
7771

78-
TOOL_DEPS_compiletest := extra green rustuv getopts
72+
TOOL_DEPS_compiletest := extra green rustuv
7973
TOOL_DEPS_rustdoc := rustdoc green rustuv
8074
TOOL_DEPS_rustc := rustc green rustuv
8175
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
@@ -106,7 +100,7 @@ $(foreach crate,$(CRATES),$(eval $(call RUST_CRATE,$(crate))))
106100
#
107101
# $(1) is the crate to generate variables for
108102
define RUST_TOOL
109-
TOOL_INPUTS_$(1) := $$(wildcard $$(addprefix $$(dir $$(TOOL_SOURCE_$(1))), \
103+
TOOL_INPUTS_$(1) := $$(wildcard $$(addprefix $(S)$$(dir $$(TOOL_SOURCE_$(1))), \
110104
*.rs */*.rs */*/*.rs */*/*/*.rs))
111105
endef
112106

branches/try2/mk/docs.mk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ doc/guide-tasks.html: $(D)/guide-tasks.md $(HTML_DEPS)
205205
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
206206
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
207207

208+
DOCS += doc/guide-conditions.html
209+
doc/guide-conditions.html: $(D)/guide-conditions.md $(HTML_DEPS)
210+
@$(call E, pandoc: $@)
211+
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
212+
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
213+
208214
DOCS += doc/guide-pointers.html
209215
doc/guide-pointers.html: $(D)/guide-pointers.md $(HTML_DEPS)
210216
@$(call E, pandoc: $@)
@@ -275,7 +281,8 @@ endif
275281

276282
# The rustdoc executable, rpath included in case --disable-rpath was provided to
277283
# ./configure
278-
RUSTDOC = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
284+
RUSTDOC = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
285+
$(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
279286

280287
# The library documenting macro
281288
#
@@ -290,9 +297,7 @@ doc/$(1)/index.html: \
290297
$$(foreach dep,$$(RUST_DEPS_$(1)), \
291298
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep))
292299
@$$(call E, rustdoc: $$@)
293-
$$(Q)$$(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $$(RUSTDOC) \
294-
--cfg stage2 $$<
295-
300+
$$(Q)$$(RUSTDOC) --cfg stage2 $$<
296301
endef
297302

298303
$(foreach crate,$(CRATES),$(eval $(call libdoc,$(crate))))

branches/try2/mk/tests.mk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2121

2222
# Markdown files under doc/ that should have their code extracted and run
2323
DOC_TEST_NAMES = tutorial guide-ffi guide-macros guide-lifetimes \
24-
guide-tasks guide-container guide-pointers \
24+
guide-tasks guide-conditions guide-container guide-pointers \
2525
complement-cheatsheet guide-runtime \
2626
rust
2727

@@ -183,8 +183,8 @@ check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
183183
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
184184

185185
check-lite: cleantestlibs cleantmptestlogs \
186-
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
187-
check-stage2-rpass \
186+
check-stage2-std check-stage2-extra check-stage2-rpass \
187+
check-stage2-rustuv check-stage2-native check-stage2-green \
188188
check-stage2-rfail check-stage2-cfail check-stage2-rmake
189189
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
190190

@@ -242,6 +242,7 @@ ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
242242
tidy:
243243
@$(call E, check: formatting)
244244
$(Q)find $(S)src -name '*.r[sc]' \
245+
| grep '^$(S)src/test' -v \
245246
| grep '^$(S)src/libuv' -v \
246247
| grep '^$(S)src/llvm' -v \
247248
| grep '^$(S)src/gyp' -v \
@@ -834,7 +835,7 @@ $$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
834835
tmp/$$(FT).rc \
835836
$$(SREQ2_T_$(2)_H_$(3))
836837
@$$(call E, compile_and_link: $$@)
837-
$$(STAGE2_T_$(2)_H_$(3)) --crate-type=dylib --out-dir $$(@D) $$< \
838+
$$(STAGE2_T_$(2)_H_$(3)) --lib -o $$@ $$< \
838839
-L "$$(RT_OUTPUT_DIR_$(2))"
839840

840841
$(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)): \
@@ -860,8 +861,7 @@ $(foreach host,$(CFG_HOST), \
860861
$(eval $(foreach target,$(CFG_TARGET), \
861862
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
862863

863-
check-fast: tidy check-fast-H-$(CFG_BUILD) \
864-
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate))
864+
check-fast: tidy check-fast-H-$(CFG_BUILD) check-stage2-std check-stage2-extra
865865
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
866866

867867
define DEF_CHECK_FAST_FOR_H

branches/try2/src/compiletest/compiletest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
#[deny(warnings)];
1515

1616
extern mod extra;
17-
extern mod getopts;
1817

1918
use std::os;
2019
use std::io;
2120
use std::io::fs;
2221

23-
use getopts::{optopt, optflag, reqopt};
22+
use extra::getopts;
23+
use extra::getopts::groups::{optopt, optflag, reqopt};
2424
use extra::test;
2525

2626
use common::config;
@@ -49,7 +49,7 @@ pub fn main() {
4949

5050
pub fn parse_config(args: ~[~str]) -> config {
5151

52-
let groups : ~[getopts::OptGroup] =
52+
let groups : ~[getopts::groups::OptGroup] =
5353
~[reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
5454
reqopt("", "run-lib-path", "path to target shared libraries", "PATH"),
5555
reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH"),
@@ -85,20 +85,20 @@ pub fn parse_config(args: ~[~str]) -> config {
8585
let args_ = args.tail();
8686
if args[1] == ~"-h" || args[1] == ~"--help" {
8787
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
88-
println!("{}", getopts::usage(message, groups));
88+
println!("{}", getopts::groups::usage(message, groups));
8989
println!("");
9090
fail!()
9191
}
9292

9393
let matches =
94-
&match getopts::getopts(args_, groups) {
94+
&match getopts::groups::getopts(args_, groups) {
9595
Ok(m) => m,
9696
Err(f) => fail!("{}", f.to_err_msg())
9797
};
9898

9999
if matches.opt_present("h") || matches.opt_present("help") {
100100
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
101-
println!("{}", getopts::usage(message, groups));
101+
println!("{}", getopts::groups::usage(message, groups));
102102
println!("");
103103
fail!()
104104
}

branches/try2/src/compiletest/runtest.rs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ actual:\n\
245245
};
246246
// FIXME (#9639): This needs to handle non-utf8 paths
247247
let mut args = ~[~"-",
248-
~"--no-trans", ~"--crate-type=lib",
248+
~"--no-trans", ~"--lib",
249249
~"--target=" + target,
250250
~"-L", config.build_base.as_str().unwrap().to_owned(),
251251
~"-L",
@@ -659,7 +659,7 @@ fn compile_test_(config: &config, props: &TestProps,
659659
// FIXME (#9639): This needs to handle non-utf8 paths
660660
let link_args = ~[~"-L", aux_dir.as_str().unwrap().to_owned()];
661661
let args = make_compile_args(config, props, link_args + extra_args,
662-
|a, b| ThisFile(make_exe_name(a, b)), testfile);
662+
make_exe_name, testfile);
663663
compose_and_run_compiler(config, props, testfile, args, None)
664664
}
665665

@@ -702,12 +702,8 @@ fn compose_and_run_compiler(
702702
let abs_ab = config.aux_base.join(rel_ab.as_slice());
703703
let aux_props = load_props(&abs_ab);
704704
let aux_args =
705-
make_compile_args(config, &aux_props, ~[~"--crate-type=dylib"]
706-
+ extra_link_args,
707-
|a,b| {
708-
let f = make_lib_name(a, b, testfile);
709-
ThisDirectory(f.dir_path())
710-
}, &abs_ab);
705+
make_compile_args(config, &aux_props, ~[~"--dylib"] + extra_link_args,
706+
|a,b| make_lib_name(a, b, testfile), &abs_ab);
711707
let auxres = compose_and_run(config, &abs_ab, aux_args, ~[],
712708
config.compile_lib_path, None);
713709
if !auxres.status.success() {
@@ -745,15 +741,10 @@ fn compose_and_run(config: &config, testfile: &Path,
745741
prog, args, procenv, input);
746742
}
747743

748-
enum TargetLocation {
749-
ThisFile(Path),
750-
ThisDirectory(Path),
751-
}
752-
753744
fn make_compile_args(config: &config,
754745
props: &TestProps,
755746
extras: ~[~str],
756-
xform: |&config, &Path| -> TargetLocation,
747+
xform: |&config, &Path| -> Path,
757748
testfile: &Path)
758749
-> ProcArgs {
759750
let xform_file = xform(config, testfile);
@@ -764,14 +755,10 @@ fn make_compile_args(config: &config,
764755
};
765756
// FIXME (#9639): This needs to handle non-utf8 paths
766757
let mut args = ~[testfile.as_str().unwrap().to_owned(),
758+
~"-o", xform_file.as_str().unwrap().to_owned(),
767759
~"-L", config.build_base.as_str().unwrap().to_owned(),
768760
~"--target=" + target]
769761
+ extras;
770-
let path = match xform_file {
771-
ThisFile(path) => { args.push(~"-o"); path }
772-
ThisDirectory(path) => { args.push(~"--out-dir"); path }
773-
};
774-
args.push(path.as_str().unwrap().to_owned());
775762
args.push_all_move(split_maybe_args(&config.rustcflags));
776763
args.push_all_move(split_maybe_args(&props.compile_flags));
777764
return ProcArgs {prog: config.rustc_path.as_str().unwrap().to_owned(), args: args};
@@ -1056,10 +1043,10 @@ fn compile_test_and_save_bitcode(config: &config, props: &TestProps,
10561043
let aux_dir = aux_output_dir_name(config, testfile);
10571044
// FIXME (#9639): This needs to handle non-utf8 paths
10581045
let link_args = ~[~"-L", aux_dir.as_str().unwrap().to_owned()];
1059-
let llvm_args = ~[~"--emit=obj", ~"--crate-type=lib", ~"--save-temps"];
1046+
let llvm_args = ~[~"-c", ~"--lib", ~"--save-temps"];
10601047
let args = make_compile_args(config, props,
10611048
link_args + llvm_args,
1062-
|a, b| ThisFile(make_o_name(a, b)), testfile);
1049+
make_o_name, testfile);
10631050
compose_and_run_compiler(config, props, testfile, args, None)
10641051
}
10651052

0 commit comments

Comments
 (0)