Skip to content

Commit 84fe210

Browse files
committed
auto merge of #20610 : alexcrichton/rust/rollup, r=alexcrichton
2 parents c7dd3c4 + 4b359e3 commit 84fe210

File tree

719 files changed

+7289
-5446
lines changed

Some content is hidden

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

719 files changed

+7289
-5446
lines changed

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

mk/main.mk

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=0.13.0
16+
CFG_RELEASE_NUM=1.0.0
1717

1818
# An optional number to put after the label, e.g. '2' -> '-beta2'
1919
CFG_BETA_CYCLE=
@@ -29,14 +29,14 @@ endif
2929
ifeq ($(CFG_RELEASE_CHANNEL),beta)
3030
# The beta channel is temporarily called 'alpha'
3131
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
32-
# When building beta/nightly distributables just reuse the same "beta"
33-
# name so when we upload we'll always override the previous
34-
# nighly. This doesn't actually impact the version reported by rustc -
35-
# it's just for file naming.
36-
CFG_PACKAGE_VERS=alpha
32+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
3733
endif
3834
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
3935
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
36+
# When building nightly distributables just reuse the same "nightly" name
37+
# so when we upload we'll always override the previous nighly. This
38+
# doesn't actually impact the version reported by rustc - it's just
39+
# for file naming.
4040
CFG_PACKAGE_VERS=nightly
4141
endif
4242
ifeq ($(CFG_RELEASE_CHANNEL),dev)

src/compiletest/compiletest.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515

1616
extern crate test;
1717
extern crate getopts;
18-
#[phase(plugin, link)] extern crate log;
18+
19+
#[cfg(stage0)]
20+
#[phase(plugin, link)]
21+
extern crate log;
22+
23+
#[cfg(not(stage0))]
24+
#[macro_use]
25+
extern crate log;
1926

2027
extern crate regex;
2128

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

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)