Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 15 pull requests #33441

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f7e1421
Add `TAGS.rustc.emacs`/`TAGS.rustc.vi` make targets, (re-)including r…
pnkfelix Apr 28, 2016
27c01cb
Add process types documentation
GuillaumeGomez Apr 28, 2016
2d15690
Doc improvement on std::fmt module
GuillaumeGomez May 1, 2016
47d9f49
Remove rust flags from doc block
GuillaumeGomez May 1, 2016
e3f1312
dep_graph: avoid panicking in thread when channel closed
birkenfeld May 1, 2016
eba43fb
std::thread docs: spawn() returns not a Thread anymore
birkenfeld May 1, 2016
b75f81c
parser: do not try to continue with `unsafe` on foreign fns
birkenfeld May 2, 2016
a11ddb3
Replace copy-pasted variable name with relevant one
shepmaster May 4, 2016
2ca3120
errors in the doc
kindlychung May 4, 2016
16219de
Update iterator.rs
kindlychung May 4, 2016
3371b8a
Add detailed error explanation for E0504
cramertj May 3, 2016
d1c487e
Add an example to Wrapping's documentation.
fiveop May 5, 2016
a22ca28
[Doc] Default cpu is "generic" (and not "default")
phil-opp May 5, 2016
39eec80
mk: Fix building with --enable-ccache
alexcrichton May 1, 2016
2912bfb
doc: Update reference with better description of target_env
brson May 5, 2016
26eb2be
Fix some some duplicate words.
birkenfeld May 5, 2016
ced4a18
Rollup merge of #33129 - GuillaumeGomez:fmt_doc, r=steveklabnik
steveklabnik May 5, 2016
59abe40
Rollup merge of #33256 - pnkfelix:add-rustc-specific-tags-files, r=ni…
steveklabnik May 5, 2016
35ff573
Rollup merge of #33283 - GuillaumeGomez:process_doc, r=steveklabnik
steveklabnik May 5, 2016
181a678
Rollup merge of #33313 - birkenfeld:depgraph-panic, r=nikomatsakis
steveklabnik May 5, 2016
bad6402
Rollup merge of #33314 - alexcrichton:fix-enable-ccache, r=pnkfelix
steveklabnik May 5, 2016
ef66149
Rollup merge of #33326 - birkenfeld:issue-33321, r=GuillaumeGomez
steveklabnik May 5, 2016
bc743e7
Rollup merge of #33336 - birkenfeld:issue-27361, r=sfackler
steveklabnik May 5, 2016
31755bf
Rollup merge of #33386 - cramertj:E0504, r=steveklabnik
steveklabnik May 5, 2016
ed9244a
Rollup merge of #33402 - shepmaster:copied-variable-name, r=Manishearth
steveklabnik May 5, 2016
551b990
Rollup merge of #33409 - kindlychung:patch-2, r=steveklabnik
steveklabnik May 5, 2016
7e3c61f
Rollup merge of #33410 - GuillaumeGomez:explain, r=Manishearth
steveklabnik May 5, 2016
a6fbe0c
Rollup merge of #33428 - fiveop:wrapping_example, r=steveklabnik
steveklabnik May 5, 2016
10f2d07
Rollup merge of #33430 - phil-opp:patch-1, r=alexcrichton
steveklabnik May 5, 2016
e1ce889
Rollup merge of #33437 - brson:trips, r=Manishearth
steveklabnik May 5, 2016
cb9238a
Rollup merge of #33438 - birkenfeld:dup-words, r=steveklabnik
steveklabnik May 5, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions mk/ctags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@

.PHONY: TAGS.emacs TAGS.vi

CTAGS_LOCATIONS=$(wildcard ${CFG_SRC_DIR}src/lib*)
CTAGS_RUSTC_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
$(wildcard ${CFG_SRC_DIR}src/lib*)) ${CFG_SRC_DIR}src/libtest
CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/librust%,, \
$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
$(wildcard ${CFG_SRC_DIR}src/lib*))) ${CFG_SRC_DIR}src/libtest
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse ${CTAGS_LOCATIONS}
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse

TAGS.rustc.emacs:
ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}

TAGS.emacs:
ctags -e -f $@ ${CTAGS_OPTS}
ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}

TAGS.rustc.vi:
ctags -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}

TAGS.vi:
ctags -f $@ ${CTAGS_OPTS}
ctags -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
6 changes: 3 additions & 3 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ ifdef CFG_CCACHE_BASEDIR
export CCACHE_BASEDIR
endif

FIND_COMPILER = $(word 1,$(1:ccache=))
FIND_COMPILER = $(strip $(1:ccache=))

define CFG_MAKE_TOOLCHAIN
# Prepend the tools with their prefix if cross compiling
Expand All @@ -187,7 +187,7 @@ define CFG_MAKE_TOOLCHAIN
endif
endif

CFG_COMPILE_C_$(1) = '$$(CC_$(1))' \
CFG_COMPILE_C_$(1) = '$$(call FIND_COMPILER,$$(CC_$(1)))' \
$$(CFLAGS) \
$$(CFG_GCCISH_CFLAGS) \
$$(CFG_GCCISH_CFLAGS_$(1)) \
Expand All @@ -198,7 +198,7 @@ define CFG_MAKE_TOOLCHAIN
$$(CFG_GCCISH_LINK_FLAGS_$(1)) \
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
$$(call CFG_INSTALL_NAME_$(1),$$(4))
CFG_COMPILE_CXX_$(1) = '$$(CXX_$(1))' \
CFG_COMPILE_CXX_$(1) = '$$(call FIND_COMPILER,$$(CXX_$(1)))' \
$$(CXXFLAGS) \
$$(CFG_GCCISH_CFLAGS) \
$$(CFG_GCCISH_CXXFLAGS) \
Expand Down
4 changes: 2 additions & 2 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
--lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
--cc '$$(CC_$(2))' \
--cxx '$$(CXX_$(2))' \
--cc '$$(call FIND_COMPILER,$$(CC_$(2)))' \
--cxx '$$(call FIND_COMPILER,$$(CXX_$(2)))' \
--cflags "$$(CFG_GCCISH_CFLAGS_$(2))" \
--llvm-components "$$(LLVM_ALL_COMPONENTS_$(2))" \
--llvm-cxxflags "$$(LLVM_CXXFLAGS_$(2))" \
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/build/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub unsafe fn setup() {

// Indicate that when all handles to the job object are gone that all
// process in the object should be killed. Note that this includes our
// entire process tree by default because we've added ourselves and and our
// entire process tree by default because we've added ourselves and our
// children will reside in the job by default.
let mut info = mem::zeroed::<JOBOBJECT_EXTENDED_LIMIT_INFORMATION>();
info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
Expand Down
44 changes: 26 additions & 18 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2063,33 +2063,41 @@ arbitrarily complex configurations through nesting.

The following configurations must be defined by the implementation:

* `debug_assertions` - Enabled by default when compiling without optimizations.
This can be used to enable extra debugging code in development but not in
production. For example, it controls the behavior of the standard library's
`debug_assert!` macro.
* `target_arch = "..."` - Target CPU architecture, such as `"x86"`, `"x86_64"`
`"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or `"aarch64"`.
* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
`"big"`.
* `target_env = ".."` - An option provided by the compiler by default
describing the runtime environment of the target platform. Some examples of
this are `musl` for builds targeting the MUSL libc implementation, `msvc` for
Windows builds targeting MSVC, and `gnu` frequently the rest of the time. This
option may also be blank on some platforms.
* `target_arch = "..."` - Target CPU architecture, such as `"x86"`,
`"x86_64"` `"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or
`"aarch64"`. This value is closely related to the first element of
the platform target triple, though it is not identical.
* `target_os = "..."` - Operating system of the target, examples
include `"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`,
`"freebsd"`, `"dragonfly"`, `"bitrig"` , `"openbsd"` or
`"netbsd"`. This value is closely related to the second and third
element of the platform target triple, though it is not identical.
* `target_family = "..."` - Operating system family of the target, e. g.
`"unix"` or `"windows"`. The value of this configuration option is defined
as a configuration itself, like `unix` or `windows`.
* `target_os = "..."` - Operating system of the target, examples include
`"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
`"bitrig"` , `"openbsd"` or `"netbsd"`.
* `unix` - See `target_family`.
* `windows` - See `target_family`.
* `target_env = ".."` - Further disambiguates the target platform with
information about the ABI/libc. Presently this value is either
`"gnu"`, `"msvc"`, `"musl"`, or the empty string. For historical
reasons this value has only been defined as non-empty when needed
for disambiguation. Thus on many GNU platforms this value will be
empty. This value is closely related to the fourth element of the
platform target triple, though it is not identical. For example,
embedded ABIs such as `gnueabihf` will simply define `target_env` as
`"gnu"`.
* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
`"big"`.
* `target_pointer_width = "..."` - Target pointer width in bits. This is set
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
64-bit pointers.
* `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
simply `"unknown"`.
* `test` - Enabled when compiling the test harness (using the `--test` flag).
* `unix` - See `target_family`.
* `windows` - See `target_family`.
* `debug_assertions` - Enabled by default when compiling without optimizations.
This can be used to enable extra debugging code in development but not in
production. For example, it controls the behavior of the standard library's
`debug_assert!` macro.

You can also set another attribute based on a `cfg` variable with `cfg_attr`:

Expand Down
12 changes: 12 additions & 0 deletions src/libcollections/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,24 @@ use string;
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::fmt;
///
/// let s = fmt::format(format_args!("Hello, {}!", "world"));
/// assert_eq!(s, "Hello, world!".to_string());
/// ```
///
/// Please note that using `[format!]` might be preferrable.
/// Example:
///
/// ```
/// let s = format!("Hello, {}!", "world");
/// assert_eq!(s, "Hello, world!".to_string());
/// ```
///
/// [format!]: ../std/macro.format!.html
#[stable(feature = "rust1", since = "1.0.0")]
pub fn format(args: Arguments) -> string::String {
let mut output = string::String::new();
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ impl<T> [T] {
///
/// ```rust
/// let v = &[1, 2, 3, 4, 5];
/// for win in v.chunks(2) {
/// println!("{:?}", win);
/// for chunk in v.chunks(2) {
/// println!("{:?}", chunk);
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
26 changes: 26 additions & 0 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,32 @@ pub trait UpperExp {
///
/// * output - the buffer to write output to
/// * args - the precompiled arguments generated by `format_args!`
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::fmt;
///
/// let mut output = String::new();
/// fmt::write(&mut output, format_args!("Hello {}!", "world"))
/// .expect("Error occurred while trying to write in String");
/// assert_eq!(output, "Hello world!");
/// ```
///
/// Please note that using [write!][write_macro] might be preferrable. Example:
///
/// ```
/// use std::fmt::Write;
///
/// let mut output = String::new();
/// write!(&mut output, "Hello {}!", "world")
/// .expect("Error occurred while trying to write in String");
/// assert_eq!(output, "Hello world!");
/// ```
///
/// [write_macro]: ../std/macro.write!.html
#[stable(feature = "rust1", since = "1.0.0")]
pub fn write(output: &mut Write, args: Arguments) -> Result {
let mut formatter = Formatter {
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub trait Iterator {
/// Like most indexing operations, the count starts from zero, so `nth(0)`
/// returns the first value, `nth(1)` the second, and so on.
///
/// `nth()` will return `None` if `n` is larger than the length of the
/// `nth()` will return `None` if `n` is greater than or equal to the length of the
/// iterator.
///
/// # Examples
Expand All @@ -237,7 +237,7 @@ pub trait Iterator {
/// assert_eq!(iter.nth(1), None);
/// ```
///
/// Returning `None` if there are less than `n` elements:
/// Returning `None` if there are less than `n + 1` elements:
///
/// ```
/// let a = [1, 2, 3];
Expand Down
11 changes: 11 additions & 0 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ use slice::SliceExt;
/// `wrapping_add`, or through the `Wrapping<T>` type, which says that
/// all standard arithmetic operations on the underlying value are
/// intended to have wrapping semantics.
///
/// # Examples
///
/// ```
/// use std::num::Wrapping;
///
/// let zero = Wrapping(0u32);
/// let one = Wrapping(1u32);
///
/// assert_eq!(std::u32::MAX, (zero - one).0);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)]
pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
Expand Down
5 changes: 4 additions & 1 deletion src/librustc/dep_graph/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ pub fn main(swap_in: Receiver<Vec<DepMessage>>,
DepMessage::Query => query_out.send(edges.query()).unwrap(),
}
}
swap_out.send(messages).unwrap();
if let Err(_) = swap_out.send(messages) {
// the receiver must have been dropped already
break;
}
}
}
2 changes: 1 addition & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ pub mod nightly_options {
early_error(ErrorOutputType::default(), &msg);
}
OptionStability::UnstableButNotReally => {
let msg = format!("the option `{}` is is unstable and should \
let msg = format!("the option `{}` is unstable and should \
only be used on the nightly compiler, but \
it is currently accepted for backwards \
compatibility; this will soon change, \
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use std::rc::Rc;
pub enum ProjectionMode {
/// FIXME (#32205)
/// At coherence-checking time, we're still constructing the
/// specialization graph, and thus we only project project
/// specialization graph, and thus we only project
/// non-`default` associated types that are defined directly in
/// the applicable impl. (This behavior should be improved over
/// time, to allow for successful projections modulo cycles
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/trait_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<'tcx> TraitDef<'tcx> {
/// Records a trait-to-implementation mapping for a non-local impl.
///
/// The `parent_impl` is the immediately-less-specialized impl, or the
/// trait's def ID if the impl is is not a specialization -- information that
/// trait's def ID if the impl is not a specialization -- information that
/// should be pulled from the metadata.
pub fn record_remote_impl(&self,
tcx: &TyCtxt<'tcx>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl<'a,'tcx> WfPredicates<'a,'tcx> {
/// into `self.out`.
fn compute_projection(&mut self, data: ty::ProjectionTy<'tcx>) {
// A projection is well-formed if (a) the trait ref itself is
// WF WF and (b) the trait-ref holds. (It may also be
// WF and (b) the trait-ref holds. (It may also be
// normalizable and be WF that way.)

self.compute_trait_ref(&data.trait_ref);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub struct TargetOptions {
pub post_link_args: Vec<String>,

/// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
/// to "default".
/// to "generic".
pub cpu: String,
/// Default target features to pass to LLVM. These features will *always* be
/// passed, and cannot be disabled even via `-C`. Corresponds to `llc
Expand Down
Loading