Skip to content

Commit

Permalink
auto merge of #20610 : alexcrichton/rust/rollup, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Jan 6, 2015
2 parents c7dd3c4 + 4b359e3 commit 340ac04
Show file tree
Hide file tree
Showing 719 changed files with 7,289 additions and 5,446 deletions.
11 changes: 8 additions & 3 deletions mk/docs.mk
Expand Up @@ -49,8 +49,10 @@ RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css

PANDOC_BASE_OPTS := --standalone --toc --number-sections
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
--from=markdown --include-before-body=doc/footer.tex --to=latex
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --from=markdown --to=latex \
--include-before-body=doc/version.tex \
--include-before-body=doc/footer.tex \
--include-in-header=doc/uptack.tex
PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub

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

doc/uptack.tex: $(D)/uptack.tex | doc/
$(Q)cp $< $@

# HTML (rustdoc)
DOC_TARGETS += doc/not_found.html
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
Expand All @@ -180,7 +185,7 @@ doc/$(1).epub: $$(D)/$(1).md | doc/

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

Expand Down
12 changes: 6 additions & 6 deletions mk/main.mk
Expand Up @@ -13,7 +13,7 @@
######################################################################

# The version number
CFG_RELEASE_NUM=0.13.0
CFG_RELEASE_NUM=1.0.0

# An optional number to put after the label, e.g. '2' -> '-beta2'
CFG_BETA_CYCLE=
Expand All @@ -29,14 +29,14 @@ endif
ifeq ($(CFG_RELEASE_CHANNEL),beta)
# The beta channel is temporarily called 'alpha'
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
# When building beta/nightly distributables just reuse the same "beta"
# name so when we upload we'll always override the previous
# nighly. This doesn't actually impact the version reported by rustc -
# it's just for file naming.
CFG_PACKAGE_VERS=alpha
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
endif
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
# When building nightly distributables just reuse the same "nightly" name
# so when we upload we'll always override the previous nighly. This
# doesn't actually impact the version reported by rustc - it's just
# for file naming.
CFG_PACKAGE_VERS=nightly
endif
ifeq ($(CFG_RELEASE_CHANNEL),dev)
Expand Down
9 changes: 8 additions & 1 deletion src/compiletest/compiletest.rs
Expand Up @@ -15,7 +15,14 @@

extern crate test;
extern crate getopts;
#[phase(plugin, link)] extern crate log;

#[cfg(stage0)]
#[phase(plugin, link)]
extern crate log;

#[cfg(not(stage0))]
#[macro_use]
extern crate log;

extern crate regex;

Expand Down
2 changes: 1 addition & 1 deletion src/doc/complement-lang-faq.md
Expand Up @@ -17,7 +17,7 @@ Some examples that demonstrate different aspects of the language:
* [sprocketnes], an NES emulator with no GC, using modern Rust conventions
* The language's general-purpose [hash] function, SipHash-2-4. Bit twiddling, OO, macros
* The standard library's [HashMap], a sendable hash map in an OO style
* The extra library's [json] module. Enums and pattern matching
* The standard library's [json] module. Enums and pattern matching

[sprocketnes]: https://github.com/pcwalton/sprocketnes
[hash]: https://github.com/rust-lang/rust/blob/master/src/libstd/hash/mod.rs
Expand Down
50 changes: 27 additions & 23 deletions src/doc/guide-ffi.md
Expand Up @@ -451,7 +451,7 @@ them.
~~~no_run
extern crate libc;
use std::c_str::ToCStr;
use std::ffi::CString;
use std::ptr;
#[link(name = "readline")]
Expand All @@ -460,11 +460,10 @@ extern {
}
fn main() {
"[my-awesome-shell] $".with_c_str(|buf| {
unsafe { rl_prompt = buf; }
// get a line, process it
unsafe { rl_prompt = ptr::null(); }
});
let prompt = CString::from_slice(b"[my-awesome-shell] $");
unsafe { rl_prompt = prompt.as_ptr(); }
// get a line, process it
unsafe { rl_prompt = ptr::null(); }
}
~~~
Expand Down Expand Up @@ -509,23 +508,28 @@ to define a block for all windows systems, not just x86 ones.
# Interoperability with foreign code
Rust guarantees that the layout of a `struct` is compatible with the platform's representation in C
only if the `#[repr(C)]` attribute is applied to it. `#[repr(C, packed)]` can be used to lay out
struct members without padding. `#[repr(C)]` can also be applied to an enum.
Rust's owned boxes (`Box<T>`) use non-nullable pointers as handles which point to the contained
object. However, they should not be manually created because they are managed by internal
allocators. References can safely be assumed to be non-nullable pointers directly to the type.
However, breaking the borrow checking or mutability rules is not guaranteed to be safe, so prefer
using raw pointers (`*`) if that's needed because the compiler can't make as many assumptions about
them.
Vectors and strings share the same basic memory layout, and utilities are available in the `vec` and
`str` modules for working with C APIs. However, strings are not terminated with `\0`. If you need a
NUL-terminated string for interoperability with C, you should use the `c_str::to_c_str` function.
The standard library includes type aliases and function definitions for the C standard library in
the `libc` module, and Rust links against `libc` and `libm` by default.
Rust guarantees that the layout of a `struct` is compatible with the platform's
representation in C only if the `#[repr(C)]` attribute is applied to it.
`#[repr(C, packed)]` can be used to lay out struct members without padding.
`#[repr(C)]` can also be applied to an enum.
Rust's owned boxes (`Box<T>`) use non-nullable pointers as handles which point
to the contained object. However, they should not be manually created because
they are managed by internal allocators. References can safely be assumed to be
non-nullable pointers directly to the type. However, breaking the borrow
checking or mutability rules is not guaranteed to be safe, so prefer using raw
pointers (`*`) if that's needed because the compiler can't make as many
assumptions about them.
Vectors and strings share the same basic memory layout, and utilities are
available in the `vec` and `str` modules for working with C APIs. However,
strings are not terminated with `\0`. If you need a NUL-terminated string for
interoperability with C, you should use the `CString` type in the `std::ffi`
module.
The standard library includes type aliases and function definitions for the C
standard library in the `libc` module, and Rust links against `libc` and `libm`
by default.
# The "nullable pointer optimization"
Expand Down

0 comments on commit 340ac04

Please sign in to comment.