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 14 pull requests #33440

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 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
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
fcebf52
typeck: if a private field exists, also check for a public method
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
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
1d18acc
Rollup merge of #33256 - pnkfelix:add-rustc-specific-tags-files, r=ni…
steveklabnik May 5, 2016
5df157b
Rollup merge of #33283 - GuillaumeGomez:process_doc, r=steveklabnik
steveklabnik May 5, 2016
10c34fa
Rollup merge of #33313 - birkenfeld:depgraph-panic, r=nikomatsakis
steveklabnik May 5, 2016
e44162f
Rollup merge of #33314 - alexcrichton:fix-enable-ccache, r=pnkfelix
steveklabnik May 5, 2016
a26f6ba
Rollup merge of #33326 - birkenfeld:issue-33321, r=GuillaumeGomez
steveklabnik May 5, 2016
04097c6
Rollup merge of #33336 - birkenfeld:issue-27361, r=sfackler
steveklabnik May 5, 2016
e94a722
Rollup merge of #33342 - birkenfeld:issue-26472, r=arielb1
steveklabnik May 5, 2016
da36566
Rollup merge of #33402 - shepmaster:copied-variable-name, r=Manishearth
steveklabnik May 5, 2016
9b68372
Rollup merge of #33409 - kindlychung:patch-2, r=steveklabnik
steveklabnik May 5, 2016
7860cc5
Rollup merge of #33410 - GuillaumeGomez:explain, r=Manishearth
steveklabnik May 5, 2016
8842100
Rollup merge of #33428 - fiveop:wrapping_example, r=steveklabnik
steveklabnik May 5, 2016
47b6999
Rollup merge of #33430 - phil-opp:patch-1, r=alexcrichton
steveklabnik May 5, 2016
0af9250
Rollup merge of #33437 - brson:trips, r=Manishearth
steveklabnik May 5, 2016
3ac65ea
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
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
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
8 changes: 7 additions & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,13 @@ fn handle_explain(code: &str,
match descriptions.find_description(&normalised) {
Some(ref description) => {
// Slice off the leading newline and print.
print!("{}", &description[1..]);
print!("{}", &(&description[1..]).split("\n").map(|x| {
format!("{}\n", if x.starts_with("```") {
"```"
} else {
x
})
}).collect::<String>());
}
None => {
early_error(output, &format!("no extended information for {}", code));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ fn generate_filter_fn<'a, 'tcx>(fcx: &FunctionContext<'a, 'tcx>,
// %ret = call i32 @the_real_filter_function(%ehptrs, %arg)
// ret i32 %ret
//
// The recoverfp intrinsic is used to recover the frame frame pointer of the
// The recoverfp intrinsic is used to recover the frame pointer of the
// `rust_try_fn` function, which is then in turn passed to the
// `localrecover` intrinsic (pairing with the `localescape` intrinsic
// mentioned above). Putting all this together means that we now have a
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_typeck/check/method/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ pub fn exists<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
span: Span,
method_name: ast::Name,
self_ty: ty::Ty<'tcx>,
call_expr_id: ast::NodeId)
call_expr_id: ast::NodeId,
allow_private: bool)
-> bool
{
let mode = probe::Mode::MethodCall;
Expand All @@ -93,7 +94,7 @@ pub fn exists<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
Err(NoMatch(..)) => false,
Err(Ambiguity(..)) => true,
Err(ClosureAmbiguity(..)) => true,
Err(PrivateMatch(..)) => true,
Err(PrivateMatch(..)) => allow_private,
}
}

Expand Down
13 changes: 10 additions & 3 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2943,12 +2943,19 @@ fn check_expr_with_expectation_and_lvalue_pref<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,

if let Some((did, field_ty)) = private_candidate {
let struct_path = fcx.tcx().item_path_str(did);
let msg = format!("field `{}` of struct `{}` is private", field.node, struct_path);
fcx.tcx().sess.span_err(expr.span, &msg);
fcx.write_ty(expr.id, field_ty);
let msg = format!("field `{}` of struct `{}` is private", field.node, struct_path);
let mut err = fcx.tcx().sess.struct_span_err(expr.span, &msg);
// Also check if an accessible method exists, which is often what is meant.
if method::exists(fcx, field.span, field.node, expr_t, expr.id, false) {
err.fileline_note(field.span, &format!("a method called `{}` also exists, \
maybe a `()` to call it is missing?",
field.node));
}
err.emit();
} else if field.node == keywords::Invalid.name() {
fcx.write_error(expr.id);
} else if method::exists(fcx, field.span, field.node, expr_t, expr.id) {
} else if method::exists(fcx, field.span, field.node, expr_t, expr.id, true) {
fcx.type_error_struct(field.span,
|actual| {
format!("attempted to take value of method `{}` on type \
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl Ipv6Addr {
}

/// Returns true if this is an address reserved for documentation
/// This is defined to be 2001:db8::/32 in RFC RFC 3849
/// This is defined to be 2001:db8::/32 in RFC 3849.
pub fn is_documentation(&self) -> bool {
(self.segments()[0] == 0x2001) && (self.segments()[1] == 0xdb8)
}
Expand Down
Loading