Skip to content

Commit bb2a08c

Browse files
committed
---
yaml --- r: 36361 b: refs/heads/master c: cc0697e h: refs/heads/master i: 36359: 47e645c
1 parent 0589407 commit bb2a08c

File tree

823 files changed

+14506
-16239
lines changed

Some content is hidden

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

823 files changed

+14506
-16239
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 8cebb1f64498508e1fc940d885ad05d7a2fb4089
2+
refs/heads/master: cc0697ec9efd776a819984fe2022ca2be70bd690

trunk/CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,14 @@ example, if it's 2014, and you change a Rust file that was created in
4747
// Copyright 2010-2014 The Rust Project Developers.
4848
```
4949

50+
# Coordination and communication
51+
52+
Get feedback from other developers on
53+
[discuss.rust-lang.org][discuss], and
54+
[#rust-internals][pound-rust-internals].
55+
56+
[pound-rust-internals]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
57+
[discuss]: http://discuss.rust-lang.org
58+
5059
For more details, please refer to
5160
[Note-development-policy](https://github.com/rust-lang/rust/wiki/Note-development-policy).

trunk/man/rustc.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Specify the name of the crate being built
3434
\fB\-\-emit\fR [asm|llvm-bc|llvm-ir|obj|link|dep-info]
3535
Configure the output that rustc will produce
3636
.TP
37-
\fB\-\-print\fR [crate-name|output-file-names|sysroot]
37+
\fB\-\-print\fR [crate-name|file-names|sysroot]
3838
Comma separated list of compiler information to print on stdout
3939
.TP
4040
\fB\-g\fR

trunk/mk/crates.mk

+6-10
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
################################################################################
5151

5252
TARGET_CRATES := libc std flate arena term \
53-
serialize getopts collections test time rand \
53+
serialize getopts collections test rand \
5454
log regex graphviz core rbml alloc \
5555
unicode
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5757
rustc_trans rustc_back rustc_llvm
58-
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
58+
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
5959
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
6060
TOOLS := compiletest rustdoc rustc
6161

@@ -75,11 +75,11 @@ DEPS_rustc_typeck := rustc syntax
7575
DEPS_rustc_borrowck := rustc log graphviz syntax
7676
DEPS_rustc_resolve := rustc log syntax
7777
DEPS_rustc := syntax flate arena serialize getopts rbml \
78-
time log graphviz rustc_llvm rustc_back
78+
log graphviz rustc_llvm rustc_back
7979
DEPS_rustc_llvm := native:rustllvm libc std
8080
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8181
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
82-
test time
82+
test
8383
DEPS_flate := std native:miniz
8484
DEPS_arena := std
8585
DEPS_graphviz := std
@@ -90,12 +90,10 @@ DEPS_term := std log
9090
DEPS_getopts := std
9191
DEPS_collections := core alloc unicode
9292
DEPS_num := std
93-
DEPS_test := std getopts serialize rbml term time regex native:rust_test_helpers
94-
DEPS_time := std serialize
93+
DEPS_test := std getopts serialize rbml term regex native:rust_test_helpers
9594
DEPS_rand := core
9695
DEPS_log := std regex
9796
DEPS_regex := std
98-
DEPS_regex_macros = rustc syntax std regex
9997
DEPS_fmt_macros = std
10098

10199
TOOL_DEPS_compiletest := test getopts
@@ -124,10 +122,8 @@ DOC_CRATES := $(filter-out rustc, \
124122
$(filter-out rustc_driver, \
125123
$(filter-out log, \
126124
$(filter-out regex, \
127-
$(filter-out regex_macros, \
128125
$(filter-out getopts, \
129-
$(filter-out time, \
130-
$(filter-out syntax, $(CRATES)))))))))))))
126+
$(filter-out syntax, $(CRATES)))))))))))
131127
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
132128
rustc_typeck rustc_driver syntax
133129

trunk/mk/docs.mk

+8-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
4949
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
5050

5151
PANDOC_BASE_OPTS := --standalone --toc --number-sections
52-
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
53-
--from=markdown --include-before-body=doc/footer.tex --to=latex
52+
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --from=markdown --to=latex \
53+
--include-before-body=doc/version.tex \
54+
--include-before-body=doc/footer.tex \
55+
--include-in-header=doc/uptack.tex
5456
PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub
5557

5658
# The rustdoc executable...
@@ -155,6 +157,9 @@ doc/footer.tex: $(D)/footer.inc | doc/
155157
@$(call E, pandoc: $@)
156158
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
157159

160+
doc/uptack.tex: $(D)/uptack.tex | doc/
161+
$(Q)cp $< $@
162+
158163
# HTML (rustdoc)
159164
DOC_TARGETS += doc/not_found.html
160165
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
@@ -180,7 +185,7 @@ doc/$(1).epub: $$(D)/$(1).md | doc/
180185

181186
# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf)
182187
DOC_TARGETS += doc/$(1).tex
183-
doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.tex | doc/
188+
doc/$(1).tex: $$(D)/$(1).md doc/uptack.tex doc/footer.tex doc/version.tex | doc/
184189
@$$(call E, pandoc: $$@)
185190
$$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) $$< --output=$$@
186191

trunk/mk/grammar.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(BG)RustLexer.class: $(BG) $(SG)RustLexer.g4
3737
check-build-lexer-verifier: $(BG)verify
3838

3939
ifeq ($(NO_REBUILD),)
40-
VERIFY_DEPS := rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.regex_macros $(LD)stamp.rustc
40+
VERIFY_DEPS := rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.rustc
4141
else
4242
VERIFY_DEPS :=
4343
endif

trunk/mk/install.mk

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ endif
2828
# Remove tmp files because it's a decent amount of disk space
2929
$(Q)rm -R tmp/dist
3030

31-
ifeq ($(CFG_DISABLE_DOCS),)
32-
prepare_install: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz dist/$(DOC_PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
33-
else
34-
prepare_install: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
35-
endif
31+
prepare_install: dist-tar-bins | tmp/empty_dir
3632

3733
uninstall:
3834
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
@@ -48,7 +44,7 @@ endif
4844
# Remove tmp files because it's a decent amount of disk space
4945
$(Q)rm -R tmp/dist
5046

51-
prepare_uninstall: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
47+
prepare_uninstall: dist-tar-bins | tmp/empty_dir
5248

5349
.PHONY: install prepare_install uninstall prepare_uninstall
5450

trunk/mk/tests.mk

-28
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,6 @@ TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
373373
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
374374
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
375375

376-
# The regex crate depends on the regex_macros crate during testing, but it
377-
# notably depend on the *host* regex_macros crate, not the target version.
378-
# Additionally, this is not a dependency in stage1, only in stage2.
379-
ifeq ($(4),regex)
380-
ifneq ($(1),1)
381-
TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
382-
endif
383-
endif
384-
385376
else
386377
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
387378
endif
@@ -843,27 +834,8 @@ else
843834
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
844835
endif
845836

846-
# (Issues #13732, #13983, #14000) The doc for the regex crate includes
847-
# uses of the `regex!` macro from the regex_macros crate. There is
848-
# normally a dependence injected that makes the target's regex depend
849-
# upon the host's regex_macros (see #13845), but that dependency
850-
# injection is currently skipped for stage1 as a special case.
851-
#
852-
# Therefore, as a further special case, this conditional skips
853-
# attempting to run the doc tests for the regex crate atop stage1,
854-
# (since there is no regex_macros crate for the stage1 rustc to load).
855-
#
856-
# (Another approach for solving this would be to inject the desired
857-
# dependence for stage1 as well, by setting things up to generate a
858-
# regex_macros crate that was compatible with the stage1 rustc and
859-
# thus re-enable our ability to run this test.)
860-
ifeq (stage$(1)-crate-$(4),stage1-crate-regex)
861-
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec:
862-
@$$(call E, skipping doc-crate-$(4) as it uses macros and cannot run at stage$(1))
863-
else
864837
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
865838
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
866-
endif
867839

868840
ifeq ($(2),$$(CFG_BUILD))
869841
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))

trunk/src/compiletest/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt;
1313
use std::str::FromStr;
1414
use regex::Regex;
1515

16-
#[deriving(Clone, PartialEq)]
16+
#[derive(Clone, PartialEq)]
1717
pub enum Mode {
1818
CompileFail,
1919
RunFail,
@@ -59,7 +59,7 @@ impl fmt::Show for Mode {
5959
}
6060
}
6161

62-
#[deriving(Clone)]
62+
#[derive(Clone)]
6363
pub struct Config {
6464
// The library paths required for running the compiler
6565
pub compile_lib_path: String,

trunk/src/compiletest/compiletest.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern crate regex;
2222
use std::os;
2323
use std::io;
2424
use std::io::fs;
25-
use std::str::{FromStr, from_str};
25+
use std::str::FromStr;
2626
use std::thunk::Thunk;
2727
use getopts::{optopt, optflag, reqopt};
2828
use common::Config;
@@ -339,8 +339,9 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
339339
return valid;
340340
}
341341

342-
pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
343-
-> test::TestDescAndFn {
342+
pub fn make_test<F>(config: &Config, testfile: &Path, f: F) -> test::TestDescAndFn where
343+
F: FnOnce() -> test::TestFn,
344+
{
344345
test::TestDescAndFn {
345346
desc: test::TestDesc {
346347
name: make_test_name(config, testfile),

trunk/src/compiletest/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct ExpectedError {
3030
pub static EXPECTED_PATTERN : &'static str =
3131
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
3232

33-
#[deriving(PartialEq, Show)]
33+
#[derive(PartialEq, Show)]
3434
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
3535

3636
// Load any test directives embedded in the file

trunk/src/compiletest/header.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
220220
!val
221221
}
222222

223-
fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
223+
fn iter_header<F>(testfile: &Path, mut it: F) -> bool where
224+
F: FnMut(&str) -> bool,
225+
{
224226
use std::io::{BufferedReader, File};
225227

226228
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());

trunk/src/compiletest/runtest.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1233,12 +1233,14 @@ enum TargetLocation {
12331233
ThisDirectory(Path),
12341234
}
12351235

1236-
fn make_compile_args(config: &Config,
1237-
props: &TestProps,
1238-
extras: Vec<String> ,
1239-
xform: |&Config, &Path| -> TargetLocation,
1240-
testfile: &Path)
1241-
-> ProcArgs {
1236+
fn make_compile_args<F>(config: &Config,
1237+
props: &TestProps,
1238+
extras: Vec<String> ,
1239+
xform: F,
1240+
testfile: &Path)
1241+
-> ProcArgs where
1242+
F: FnOnce(&Config, &Path) -> TargetLocation,
1243+
{
12421244
let xform_file = xform(config, testfile);
12431245
let target = if props.force_host {
12441246
config.host.as_slice()

trunk/src/doc/complement-lang-faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Some examples that demonstrate different aspects of the language:
1717
* [sprocketnes], an NES emulator with no GC, using modern Rust conventions
1818
* The language's general-purpose [hash] function, SipHash-2-4. Bit twiddling, OO, macros
1919
* The standard library's [HashMap], a sendable hash map in an OO style
20-
* The extra library's [json] module. Enums and pattern matching
20+
* The standard library's [json] module. Enums and pattern matching
2121

2222
[sprocketnes]: https://github.com/pcwalton/sprocketnes
2323
[hash]: https://github.com/rust-lang/rust/blob/master/src/libstd/hash/mod.rs

trunk/src/doc/guide-ffi.md

+27-23
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ them.
451451
~~~no_run
452452
extern crate libc;
453453
454-
use std::c_str::ToCStr;
454+
use std::ffi::CString;
455455
use std::ptr;
456456
457457
#[link(name = "readline")]
@@ -460,11 +460,10 @@ extern {
460460
}
461461
462462
fn main() {
463-
"[my-awesome-shell] $".with_c_str(|buf| {
464-
unsafe { rl_prompt = buf; }
465-
// get a line, process it
466-
unsafe { rl_prompt = ptr::null(); }
467-
});
463+
let prompt = CString::from_slice(b"[my-awesome-shell] $");
464+
unsafe { rl_prompt = prompt.as_ptr(); }
465+
// get a line, process it
466+
unsafe { rl_prompt = ptr::null(); }
468467
}
469468
~~~
470469
@@ -509,23 +508,28 @@ to define a block for all windows systems, not just x86 ones.
509508
510509
# Interoperability with foreign code
511510
512-
Rust guarantees that the layout of a `struct` is compatible with the platform's representation in C
513-
only if the `#[repr(C)]` attribute is applied to it. `#[repr(C, packed)]` can be used to lay out
514-
struct members without padding. `#[repr(C)]` can also be applied to an enum.
515-
516-
Rust's owned boxes (`Box<T>`) use non-nullable pointers as handles which point to the contained
517-
object. However, they should not be manually created because they are managed by internal
518-
allocators. References can safely be assumed to be non-nullable pointers directly to the type.
519-
However, breaking the borrow checking or mutability rules is not guaranteed to be safe, so prefer
520-
using raw pointers (`*`) if that's needed because the compiler can't make as many assumptions about
521-
them.
522-
523-
Vectors and strings share the same basic memory layout, and utilities are available in the `vec` and
524-
`str` modules for working with C APIs. However, strings are not terminated with `\0`. If you need a
525-
NUL-terminated string for interoperability with C, you should use the `c_str::to_c_str` function.
526-
527-
The standard library includes type aliases and function definitions for the C standard library in
528-
the `libc` module, and Rust links against `libc` and `libm` by default.
511+
Rust guarantees that the layout of a `struct` is compatible with the platform's
512+
representation in C only if the `#[repr(C)]` attribute is applied to it.
513+
`#[repr(C, packed)]` can be used to lay out struct members without padding.
514+
`#[repr(C)]` can also be applied to an enum.
515+
516+
Rust's owned boxes (`Box<T>`) use non-nullable pointers as handles which point
517+
to the contained object. However, they should not be manually created because
518+
they are managed by internal allocators. References can safely be assumed to be
519+
non-nullable pointers directly to the type. However, breaking the borrow
520+
checking or mutability rules is not guaranteed to be safe, so prefer using raw
521+
pointers (`*`) if that's needed because the compiler can't make as many
522+
assumptions about them.
523+
524+
Vectors and strings share the same basic memory layout, and utilities are
525+
available in the `vec` and `str` modules for working with C APIs. However,
526+
strings are not terminated with `\0`. If you need a NUL-terminated string for
527+
interoperability with C, you should use the `CString` type in the `std::ffi`
528+
module.
529+
530+
The standard library includes type aliases and function definitions for the C
531+
standard library in the `libc` module, and Rust links against `libc` and `libm`
532+
by default.
529533
530534
# The "nullable pointer optimization"
531535

0 commit comments

Comments
 (0)