]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #31635 - semarie:grep-e, r=alexcrichton
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 13 Feb 2016 23:36:36 +0000 (05:06 +0530)
The BSD grep for "basic regex" don't support \| as alternate operator (at least under OpenBSD).

Use multiple -e arguments for expressing alternative. I have checked it under Linux (Debian).

123 files changed:
mk/cfg/i586-unknown-linux-gnu.mk [new file with mode: 0644]
src/bootstrap/build/clean.rs [new file with mode: 0644]
src/bootstrap/build/flags.rs
src/bootstrap/build/job.rs
src/bootstrap/build/mod.rs
src/bootstrap/mk/Makefile.in
src/doc/book/concurrency.md
src/doc/book/documentation.md
src/doc/book/ownership.md
src/doc/book/using-rust-without-the-standard-library.md
src/libcollections/vec.rs
src/libcore/num/mod.rs
src/librustc/lint/context.rs
src/librustc/lint/mod.rs
src/librustc/middle/infer/mod.rs
src/librustc/middle/traits/fulfill.rs
src/librustc_back/target/i586_unknown_linux_gnu.rs [new file with mode: 0644]
src/librustc_back/target/i686_pc_windows_msvc.rs
src/librustc_back/target/mod.rs
src/librustc_mir/build/scope.rs
src/librustc_passes/consts.rs
src/librustc_trans/trans/collector.rs
src/librustc_trans/trans/common.rs
src/librustc_typeck/check/closure.rs
src/librustc_typeck/check/compare_method.rs
src/librustc_typeck/check/dropck.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/coherence/mod.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/render.rs
src/libstd/ascii.rs
src/libstd/macros.rs
src/libstd/prelude/mod.rs
src/libstd/sys/common/poison.rs
src/libstd/sys/windows/os.rs
src/libsyntax/codemap.rs
src/test/run-pass/atomic-print.rs
src/test/run-pass/box-of-array-of-drop-1.rs
src/test/run-pass/box-of-array-of-drop-2.rs
src/test/run-pass/cci_capture_clause.rs
src/test/run-pass/child-outlives-parent.rs
src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs
src/test/run-pass/clone-with-exterior.rs
src/test/run-pass/comm.rs
src/test/run-pass/core-run-destroy.rs
src/test/run-pass/drop-flag-skip-sanity-check.rs
src/test/run-pass/extern-call-deep2.rs
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/fds-are-cloexec.rs
src/test/run-pass/foreign-call-no-runtime.rs
src/test/run-pass/init-large-type.rs
src/test/run-pass/int-abs-overflow.rs
src/test/run-pass/intrinsic-move-val-cleanups.rs
src/test/run-pass/issue-13494.rs
src/test/run-pass/issue-16560.rs
src/test/run-pass/issue-16671.rs
src/test/run-pass/issue-21291.rs
src/test/run-pass/issue-22864-2.rs
src/test/run-pass/issue-25089.rs
src/test/run-pass/issue-26655.rs
src/test/run-pass/issue-29488.rs
src/test/run-pass/issue-30018-panic.rs
src/test/run-pass/issue-4446.rs
src/test/run-pass/issue-4448.rs
src/test/run-pass/issue-8460.rs
src/test/run-pass/issue-8827.rs
src/test/run-pass/issue-9396.rs
src/test/run-pass/ivec-tag.rs
src/test/run-pass/logging-only-prints-once.rs
src/test/run-pass/macro-with-braces-in-expr-position.rs
src/test/run-pass/moves-based-on-type-capture-clause.rs
src/test/run-pass/nested-vec-3.rs
src/test/run-pass/no-landing-pads.rs
src/test/run-pass/panic-handler-flail-wildly.rs
src/test/run-pass/panic-handler-set-twice.rs
src/test/run-pass/panic-in-dtor-drops-fields.rs
src/test/run-pass/panic-recover-propagate.rs
src/test/run-pass/process-sigpipe.rs
src/test/run-pass/rust-log-filter.rs
src/test/run-pass/send-resource.rs
src/test/run-pass/sendfn-spawn-with-fn-arg.rs
src/test/run-pass/sepcomp-unwind.rs
src/test/run-pass/slice-panic-1.rs
src/test/run-pass/slice-panic-2.rs
src/test/run-pass/spawn-fn.rs
src/test/run-pass/spawn-types.rs
src/test/run-pass/spawn.rs
src/test/run-pass/spawn2.rs
src/test/run-pass/spawning-with-debug.rs
src/test/run-pass/task-comm-0.rs
src/test/run-pass/task-comm-1.rs
src/test/run-pass/task-comm-10.rs
src/test/run-pass/task-comm-11.rs
src/test/run-pass/task-comm-12.rs
src/test/run-pass/task-comm-13.rs
src/test/run-pass/task-comm-14.rs
src/test/run-pass/task-comm-15.rs
src/test/run-pass/task-comm-17.rs
src/test/run-pass/task-comm-3.rs
src/test/run-pass/task-comm-7.rs
src/test/run-pass/task-comm-9.rs
src/test/run-pass/task-life-0.rs
src/test/run-pass/task-spawn-move-and-copy.rs
src/test/run-pass/task-stderr.rs
src/test/run-pass/tcp-stress.rs
src/test/run-pass/terminate-in-initializer.rs
src/test/run-pass/threads.rs
src/test/run-pass/tls-dtors-are-run-in-a-static-binary.rs
src/test/run-pass/tls-init-on-init.rs
src/test/run-pass/trait-bounds-in-arc.rs
src/test/run-pass/unique-send-2.rs
src/test/run-pass/unit-like-struct-drop-run.rs
src/test/run-pass/unwind-resource.rs
src/test/run-pass/unwind-unique.rs
src/test/run-pass/vector-sort-panic-safe.rs
src/test/run-pass/weak-lang-item.rs
src/test/run-pass/yield.rs
src/test/run-pass/yield1.rs
src/test/rustdoc/assoc-consts.rs
src/test/rustdoc/issue-21092.rs
src/test/rustdoc/issue-25001.rs
src/test/rustdoc/issue-30366.rs [new file with mode: 0644]

diff --git a/mk/cfg/i586-unknown-linux-gnu.mk b/mk/cfg/i586-unknown-linux-gnu.mk
new file mode 100644 (file)
index 0000000..0609f36
--- /dev/null
@@ -0,0 +1,23 @@
+# i586-unknown-linux-gnu configuration
+CC_i586-unknown-linux-gnu=$(CC)
+CXX_i586-unknown-linux-gnu=$(CXX)
+CPP_i586-unknown-linux-gnu=$(CPP)
+AR_i586-unknown-linux-gnu=$(AR)
+CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
+CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
+CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
+CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
+CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS)
+CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
+CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
+CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread  -lrt -g -m32
+CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
+CFG_LLC_FLAGS_i586-unknown-linux-gnu :=
+CFG_INSTALL_NAME_i586-unknown-linux-gnu =
+CFG_EXE_SUFFIX_i586-unknown-linux-gnu =
+CFG_WINDOWSY_i586-unknown-linux-gnu :=
+CFG_UNIXY_i586-unknown-linux-gnu := 1
+CFG_LDPATH_i586-unknown-linux-gnu :=
+CFG_RUN_i586-unknown-linux-gnu=$(2)
+CFG_RUN_TARG_i586-unknown-linux-gnu=$(call CFG_RUN_i586-unknown-linux-gnu,,$(2))
+CFG_GNU_TRIPLE_i586-unknown-linux-gnu := i586-unknown-linux-gnu
diff --git a/src/bootstrap/build/clean.rs b/src/bootstrap/build/clean.rs
new file mode 100644 (file)
index 0000000..8f78fed
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::fs;
+use std::path::Path;
+
+use build::Build;
+
+pub fn clean(build: &Build) {
+    for host in build.config.host.iter() {
+
+        let out = build.out.join(host);
+
+        rm_rf(build, &out.join("compiler-rt"));
+
+        for stage in 0..4 {
+            rm_rf(build, &out.join(format!("stage{}", stage)));
+            rm_rf(build, &out.join(format!("stage{}-std", stage)));
+            rm_rf(build, &out.join(format!("stage{}-rustc", stage)));
+        }
+    }
+}
+
+fn rm_rf(build: &Build, path: &Path) {
+    if path.exists() {
+        build.verbose(&format!("removing `{}`", path.display()));
+        t!(fs::remove_dir_all(path));
+    }
+}
index cd538bb0a905ad5598c7060854d5711f85366fa5..d91dfe0903d1144e58e7ddcad322691f20ba88ee 100644 (file)
@@ -26,6 +26,7 @@ pub struct Flags {
     pub src: Option<PathBuf>,
     pub jobs: Option<u32>,
     pub args: Vec<String>,
+    pub clean: bool,
 }
 
 pub struct Filter {
@@ -44,6 +45,7 @@ pub fn parse(args: &[String]) -> Flags {
         opts.optopt("", "stage", "stage to build", "N");
         opts.optopt("", "src", "path to repo root", "DIR");
         opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
+        opts.optflag("", "clean", "clean output directory");
         opts.optflag("h", "help", "print this help message");
 
         let usage = |n| -> ! {
@@ -75,6 +77,7 @@ pub fn parse(args: &[String]) -> Flags {
 
         Flags {
             verbose: m.opt_present("v"),
+            clean: m.opt_present("clean"),
             stage: m.opt_str("stage").map(|j| j.parse().unwrap()),
             build: m.opt_str("build").unwrap(),
             host: Filter { values: m.opt_strs("host") },
index 49e027ffda596112ceaf635f7ebbfe5fd8ac762b..a4e53bc45fcfbf979836b89b8ea1bba17b834122 100644 (file)
@@ -64,9 +64,20 @@ pub unsafe fn setup() {
                                     mem::size_of_val(&info) as DWORD);
     assert!(r != 0, "{}", io::Error::last_os_error());
 
-    // Assign our process to this job object
+    // Assign our process to this job object. Note that if this fails, one very
+    // likely reason is that we are ourselves already in a job object! This can
+    // happen on the build bots that we've got for Windows, or if just anyone
+    // else is instrumenting the build. In this case we just bail out
+    // immediately and assume that they take care of it.
+    //
+    // Also note that nested jobs (why this might fail) are supported in recent
+    // versions of Windows, but the version of Windows that our bots are running
+    // at least don't support nested job objects.
     let r = AssignProcessToJobObject(job, GetCurrentProcess());
-    assert!(r != 0, "{}", io::Error::last_os_error());
+    if r == 0 {
+        CloseHandle(job);
+        return
+    }
 
     // If we've got a parent process (e.g. the python script that called us)
     // then move ownership of this job object up to them. That way if the python
index 6f962aae923348040e1222da35a6902d38c9c530..92043ee3f253df496afc3ae1d248a5e9a3fc50bb 100644 (file)
@@ -30,6 +30,7 @@ macro_rules! t {
 
 mod cc;
 mod channel;
+mod clean;
 mod compile;
 mod config;
 mod flags;
@@ -122,6 +123,10 @@ fn setup_job() {
         #[cfg(not(windows))] fn setup_job() {}
         setup_job();
 
+        if self.flags.clean {
+            return clean::clean(self);
+        }
+
         cc::find(self);
         sanity::check(self);
         channel::collect(self);
index 1157346d774ab3882f9d65f12d604c8e36833125..bd29fd8612d4e5741ff23fe3a9cbc01cc8e5dd8e 100644 (file)
@@ -21,3 +21,6 @@ BOOTSTRAP := $(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap.py $(BOOTSTRAP_
 
 all:
        $(Q)$(BOOTSTRAP)
+
+clean:
+       $(Q)$(BOOTSTRAP) --clean
index 44569a04b98243e0f3b3ce2bb87bcf63f30f63a9..752c097210243e8d0d7d24349f21960842947959 100644 (file)
@@ -286,6 +286,8 @@ use std::sync::mpsc;
 fn main() {
     let data = Arc::new(Mutex::new(0));
 
+    // `tx` is the "transmitter" or "sender"
+    // `rx` is the "receiver"
     let (tx, rx) = mpsc::channel();
 
     for _ in 0..10 {
index ede3100194e5bd308e9f2a47c2373bd3519ced57..8d1e58ac17397559b8a534c25c164b31dbf8f34f 100644 (file)
@@ -319,7 +319,7 @@ our source code:
 ```text
     First, we set `x` to five:
 
-    ```text
+    ```rust
     let x = 5;
     # let y = 6;
     # println!("{}", x + y);
@@ -327,7 +327,7 @@ our source code:
 
     Next, we set `y` to six:
 
-    ```text
+    ```rust
     # let x = 5;
     let y = 6;
     # println!("{}", x + y);
@@ -335,7 +335,7 @@ our source code:
 
     Finally, we print the sum of `x` and `y`:
 
-    ```text
+    ```rust
     # let x = 5;
     # let y = 6;
     println!("{}", x + y);
index a62d31d362b14f217c367efbfe76779167dd1ded..175960f67b6930700d740a721f5775d81ff97a1d 100644 (file)
@@ -51,10 +51,11 @@ fn foo() {
 }
 ```
 
-When `v` comes into scope, a new [vector] is created, and it allocates space on
-[the heap][heap] for each of its elements. When `v` goes out of scope at the
-end of `foo()`, Rust will clean up everything related to the vector, even the
-heap-allocated memory. This happens deterministically, at the end of the scope.
+When `v` comes into scope, a new [vector] is created on [the stack][stack],
+and it allocates space on [the heap][heap] for its elements. When `v` goes out
+of scope at the end of `foo()`, Rust will clean up everything related to the
+vector, even the heap-allocated memory. This happens deterministically, at the
+end of the scope.
 
 We'll cover [vectors] in detail later in this chapter; we only use them
 here as an example of a type that allocates space on the heap at runtime. They
@@ -67,6 +68,7 @@ Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will ha
 [arrays]: primitive-types.html#arrays
 [vectors]: vectors.html
 [heap]: the-stack-and-the-heap.html
+[stack]: the-stack-and-the-heap.html#the-stack
 [bindings]: variable-bindings.html
 [generics]: generics.html
 
index 59182e1a4efcee7fefd0a9bc0d7068052cc7ef94..2c7a097fe8045c4fc2f813b4d04e3caadd6b9329 100644 (file)
@@ -11,7 +11,7 @@ don’t want to use the standard library via an attribute: `#![no_std]`.
 > For details on binaries without the standard library, see [the nightly
 > chapter on `#![no_std]`](no-stdlib.html)
 
-To use `#![no_std]`, add it to your crate root:
+To use `#![no_std]`, add it to your crate root:
 
 ```rust
 #![no_std]
index 805d9a9807a33172c7ed3b8c9cccb978598d70c1..1bc9e6588adb39835cab4df74320d1669194417a 100644 (file)
@@ -528,7 +528,7 @@ pub fn swap_remove(&mut self, index: usize) -> T {
     }
 
     /// Inserts an element at position `index` within the vector, shifting all
-    /// elements after position `i` one position to the right.
+    /// elements after it to the right.
     ///
     /// # Panics
     ///
@@ -570,7 +570,7 @@ pub fn insert(&mut self, index: usize, element: T) {
     }
 
     /// Removes and returns the element at position `index` within the vector,
-    /// shifting all elements after position `index` one position to the left.
+    /// shifting all elements after it to the left.
     ///
     /// # Panics
     ///
index 9a9dfaa26797a3977c39708940c4cefcce3a8dc9..d094f05374b78e5ea02d55aa4c944fbbbf4d7be9 100644 (file)
@@ -741,6 +741,13 @@ pub fn wrapping_neg(self) -> Self {
         /// where `mask` removes any high-order bits of `rhs` that
         /// would cause the shift to exceed the bitwidth of the type.
         ///
+        /// Note that this is *not* the same as a rotate-left; the
+        /// RHS of a wrapping shift-left is restricted to the range
+        /// of the type, rather than the bits shifted out of the LHS
+        /// being returned to the other end. The primitive integer
+        /// types all implement a `rotate_left` function, which may
+        /// be what you want instead.
+        ///
         /// # Examples
         ///
         /// Basic usage:
@@ -759,6 +766,13 @@ pub fn wrapping_shl(self, rhs: u32) -> Self {
         /// where `mask` removes any high-order bits of `rhs` that
         /// would cause the shift to exceed the bitwidth of the type.
         ///
+        /// Note that this is *not* the same as a rotate-right; the
+        /// RHS of a wrapping shift-right is restricted to the range
+        /// of the type, rather than the bits shifted out of the LHS
+        /// being returned to the other end. The primitive integer
+        /// types all implement a `rotate_right` function, which may
+        /// be what you want instead.
+        ///
         /// # Examples
         ///
         /// Basic usage:
index 5af184385d909f3c0949178b65672595ff583b47..ea74e74a863cf21cfba900c23a50f4e5318db15c 100644 (file)
@@ -758,6 +758,7 @@ fn visit_item(&mut self, it: &hir::Item) {
             run_lints!(cx, check_item, late_passes, it);
             cx.visit_ids(|v| v.visit_item(it));
             hir_visit::walk_item(cx, it);
+            run_lints!(cx, check_item_post, late_passes, it);
         })
     }
 
@@ -846,6 +847,7 @@ fn visit_local(&mut self, l: &hir::Local) {
     fn visit_block(&mut self, b: &hir::Block) {
         run_lints!(self, check_block, late_passes, b);
         hir_visit::walk_block(self, b);
+        run_lints!(self, check_block_post, late_passes, b);
     }
 
     fn visit_arm(&mut self, a: &hir::Arm) {
@@ -918,6 +920,7 @@ fn visit_item(&mut self, it: &ast::Item) {
             run_lints!(cx, check_item, early_passes, it);
             cx.visit_ids(|v| v.visit_item(it));
             ast_visit::walk_item(cx, it);
+            run_lints!(cx, check_item_post, early_passes, it);
         })
     }
 
@@ -1001,6 +1004,7 @@ fn visit_local(&mut self, l: &ast::Local) {
     fn visit_block(&mut self, b: &ast::Block) {
         run_lints!(self, check_block, early_passes, b);
         ast_visit::walk_block(self, b);
+        run_lints!(self, check_block_post, early_passes, b);
     }
 
     fn visit_arm(&mut self, a: &ast::Arm) {
@@ -1253,6 +1257,8 @@ pub fn check_crate(tcx: &ty::ctxt, access_levels: &AccessLevels) {
         run_lints!(cx, check_crate, late_passes, krate);
 
         hir_visit::walk_crate(cx, krate);
+
+        run_lints!(cx, check_crate_post, late_passes, krate);
     });
 
     // If we missed any lints added to the session, then there's a bug somewhere
@@ -1284,6 +1290,8 @@ pub fn check_ast_crate(sess: &Session, krate: &ast::Crate) {
         run_lints!(cx, check_crate, early_passes, krate);
 
         ast_visit::walk_crate(cx, krate);
+
+        run_lints!(cx, check_crate_post, early_passes, krate);
     });
 
     // Put the lint store back in the session.
index 6061525ef398cc09da3749f08068d88c4113e3c6..5e2e8c4c6d5f8877cf02e1f5df72efbb64f2c564 100644 (file)
@@ -132,11 +132,14 @@ pub trait LintPass {
 pub trait LateLintPass: LintPass {
     fn check_name(&mut self, _: &LateContext, _: Span, _: ast::Name) { }
     fn check_crate(&mut self, _: &LateContext, _: &hir::Crate) { }
+    fn check_crate_post(&mut self, _: &LateContext, _: &hir::Crate) { }
     fn check_mod(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { }
     fn check_foreign_item(&mut self, _: &LateContext, _: &hir::ForeignItem) { }
     fn check_item(&mut self, _: &LateContext, _: &hir::Item) { }
+    fn check_item_post(&mut self, _: &LateContext, _: &hir::Item) { }
     fn check_local(&mut self, _: &LateContext, _: &hir::Local) { }
     fn check_block(&mut self, _: &LateContext, _: &hir::Block) { }
+    fn check_block_post(&mut self, _: &LateContext, _: &hir::Block) { }
     fn check_stmt(&mut self, _: &LateContext, _: &hir::Stmt) { }
     fn check_arm(&mut self, _: &LateContext, _: &hir::Arm) { }
     fn check_pat(&mut self, _: &LateContext, _: &hir::Pat) { }
@@ -174,11 +177,14 @@ fn exit_lint_attrs(&mut self, _: &LateContext, _: &[ast::Attribute]) { }
 pub trait EarlyLintPass: LintPass {
     fn check_ident(&mut self, _: &EarlyContext, _: Span, _: ast::Ident) { }
     fn check_crate(&mut self, _: &EarlyContext, _: &ast::Crate) { }
+    fn check_crate_post(&mut self, _: &EarlyContext, _: &ast::Crate) { }
     fn check_mod(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
     fn check_foreign_item(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
     fn check_item(&mut self, _: &EarlyContext, _: &ast::Item) { }
+    fn check_item_post(&mut self, _: &EarlyContext, _: &ast::Item) { }
     fn check_local(&mut self, _: &EarlyContext, _: &ast::Local) { }
     fn check_block(&mut self, _: &EarlyContext, _: &ast::Block) { }
+    fn check_block_post(&mut self, _: &EarlyContext, _: &ast::Block) { }
     fn check_stmt(&mut self, _: &EarlyContext, _: &ast::Stmt) { }
     fn check_arm(&mut self, _: &EarlyContext, _: &ast::Arm) { }
     fn check_pat(&mut self, _: &EarlyContext, _: &ast::Pat) { }
index 15e368812f25d99a9ec729c68beafeeacd88eeea..26ea5454693e1bd741051ca2c8d7edf46ce0881c 100644 (file)
@@ -88,8 +88,6 @@ pub struct InferCtxt<'a, 'tcx: 'a> {
 
     pub parameter_environment: ty::ParameterEnvironment<'a, 'tcx>,
 
-    pub fulfillment_cx: RefCell<traits::FulfillmentContext<'tcx>>,
-
     // the set of predicates on which errors have been reported, to
     // avoid reporting the same error twice.
     pub reported_trait_errors: RefCell<FnvHashSet<traits::TraitErrorKey<'tcx>>>,
@@ -366,7 +364,6 @@ pub fn new_infer_ctxt<'a, 'tcx>(tcx: &'a ty::ctxt<'tcx>,
         float_unification_table: RefCell::new(UnificationTable::new()),
         region_vars: RegionVarBindings::new(tcx),
         parameter_environment: param_env.unwrap_or(tcx.empty_parameter_environment()),
-        fulfillment_cx: RefCell::new(traits::FulfillmentContext::new()),
         reported_trait_errors: RefCell::new(FnvHashSet()),
         normalize: false,
         err_count_on_creation: tcx.sess.err_count()
@@ -525,7 +522,7 @@ pub fn normalize_associated_type<'tcx,T>(tcx: &ty::ctxt<'tcx>, value: &T) -> T
            result,
            obligations);
 
-    let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
+    let mut fulfill_cx = traits::FulfillmentContext::new();
 
     for obligation in obligations {
         fulfill_cx.register_predicate_obligation(&infcx, obligation);
index bb411e76e929bbe935377b9bf08d9c33b9279579..c89aa4c18333cde85362b2050c9bb86f40a59c54 100644 (file)
@@ -133,7 +133,7 @@ pub fn normalize_projection_type<'a>(&mut self,
                                          cause: ObligationCause<'tcx>)
                                          -> Ty<'tcx>
     {
-        debug!("normalize_associated_type(projection_ty={:?})",
+        debug!("normalize_projection_type(projection_ty={:?})",
                projection_ty);
 
         assert!(!projection_ty.has_escaping_regions());
@@ -147,7 +147,7 @@ pub fn normalize_projection_type<'a>(&mut self,
             self.register_predicate_obligation(infcx, obligation);
         }
 
-        debug!("normalize_associated_type: result={:?}", normalized.value);
+        debug!("normalize_projection_type: result={:?}", normalized.value);
 
         normalized.value
     }
@@ -185,11 +185,11 @@ pub fn register_predicate_obligation<'a>(&mut self,
         assert!(!obligation.has_escaping_regions());
 
         if self.is_duplicate_or_add(infcx.tcx, &obligation.predicate) {
-            debug!("register_predicate({:?}) -- already seen, skip", obligation);
+            debug!("register_predicate_obligation({:?}) -- already seen, skip", obligation);
             return;
         }
 
-        debug!("register_predicate({:?})", obligation);
+        debug!("register_predicate_obligation({:?})", obligation);
         let obligation = PendingPredicateObligation {
             obligation: obligation,
             stalled_on: vec![]
@@ -274,7 +274,7 @@ fn select<'a>(&mut self,
         let mut errors = Vec::new();
 
         loop {
-            debug!("select_where_possible: starting another iteration");
+            debug!("select: starting another iteration");
 
             // Process pending obligations.
             let outcome = {
@@ -287,7 +287,7 @@ fn select<'a>(&mut self,
                                                                      region_obligations))
             };
 
-            debug!("select_where_possible: outcome={:?}", outcome);
+            debug!("select: outcome={:?}", outcome);
 
             // these are obligations that were proven to be true.
             for pending_obligation in outcome.completed {
diff --git a/src/librustc_back/target/i586_unknown_linux_gnu.rs b/src/librustc_back/target/i586_unknown_linux_gnu.rs
new file mode 100644 (file)
index 0000000..42d5674
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use target::Target;
+
+pub fn target() -> Target {
+    let mut base = super::linux_base::opts();
+    base.cpu = "pentium".to_string();
+    base.pre_link_args.push("-m32".to_string());
+
+    Target {
+        llvm_target: "i586-unknown-linux-gnu".to_string(),
+        target_endian: "little".to_string(),
+        target_pointer_width: "32".to_string(),
+        arch: "x86".to_string(),
+        target_os: "linux".to_string(),
+        target_env: "gnu".to_string(),
+        target_vendor: "unknown".to_string(),
+        options: base,
+    }
+}
index 96b2d37ab2088135a374386130487e12905b1533..7fe6590618941acfaa55182e7bfb484d64404be6 100644 (file)
@@ -14,6 +14,15 @@ pub fn target() -> Target {
     let mut base = super::windows_msvc_base::opts();
     base.cpu = "pentium4".to_string();
 
+    // Mark all dynamic libraries and executables as compatible with the larger 4GiB address
+    // space available to x86 Windows binaries on x86_64.
+    base.pre_link_args.push("/LARGEADDRESSAWARE".to_string());
+
+    // Ensure the linker will only produce an image if it can also produce a table of
+    // the image's safe exception handlers.
+    // https://msdn.microsoft.com/en-us/library/9a89h429.aspx
+    base.pre_link_args.push("/SAFESEH".to_string());
+
     Target {
         llvm_target: "i686-pc-windows-msvc".to_string(),
         target_endian: "little".to_string(),
index 95b7c2e3f0748a304ffecd2423f567d70aa7303b..a868178b14fb9d8aabcc8b2dc737926ef5a95133 100644 (file)
@@ -89,6 +89,7 @@ fn load_specific(target: &str) -> Option<Target> {
 supported_targets! {
     ("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
     ("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
+    ("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
     ("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
     ("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
     ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),
index 3d7c61cd2c1b42835a026085a18b0d3dce366fec..167317f426b7160b853cf955bc41847b16ca9d30 100644 (file)
@@ -622,8 +622,8 @@ fn build_free<'tcx>(tcx: &ty::ctxt<'tcx>,
                     unit_temp: Lvalue<'tcx>,
                     data: &FreeData<'tcx>,
                     target: BasicBlock) -> Terminator<'tcx> {
-    let free_func = tcx.lang_items.box_free_fn()
-                       .expect("box_free language item is missing");
+    let free_func = tcx.lang_items.require(lang_items::BoxFreeFnLangItem)
+                       .unwrap_or_else(|e| tcx.sess.fatal(&e));
     let substs = tcx.mk_substs(Substs::new(
         VecPerParamSpace::new(vec![], vec![], vec![data.item_ty]),
         VecPerParamSpace::new(vec![], vec![], vec![])
index 50dd33ca993cf42454b737ad7e1294faedf51603..c3699735ae8670cbe50ff230c4ec872e37252312 100644 (file)
@@ -249,9 +249,9 @@ fn check_static_type(&self, e: &hir::Expr) {
         let ty = self.tcx.node_id_to_type(e.id);
         let infcx = infer::new_infer_ctxt(self.tcx, &self.tcx.tables, None);
         let cause = traits::ObligationCause::new(e.span, e.id, traits::SharedStatic);
-        let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
-        fulfill_cx.register_builtin_bound(&infcx, ty, ty::BoundSync, cause);
-        match fulfill_cx.select_all_or_error(&infcx) {
+        let mut fulfillment_cx = traits::FulfillmentContext::new();
+        fulfillment_cx.register_builtin_bound(&infcx, ty, ty::BoundSync, cause);
+        match fulfillment_cx.select_all_or_error(&infcx) {
             Ok(()) => { },
             Err(ref errors) => {
                 traits::report_fulfillment_errors(&infcx, errors);
index 21cb082f0660cd8c179f3c2e64596d106521c842..b5b0f0a82d4ec6d0c3d79d7a602d740c1c9b9d33 100644 (file)
@@ -501,7 +501,7 @@ fn visit_rvalue(&mut self, rvalue: &mir::Rvalue<'tcx>) {
                         .tcx()
                         .lang_items
                         .require(ExchangeMallocFnLangItem)
-                        .expect("Could not find ExchangeMallocFnLangItem");
+                        .unwrap_or_else(|e| self.ccx.sess().fatal(&e));
 
                 assert!(can_have_local_instance(self.ccx, exchange_malloc_fn_def_id));
                 let exchange_malloc_fn_trans_item =
@@ -645,7 +645,7 @@ fn find_drop_glue_neighbors<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
         let exchange_free_fn_def_id = ccx.tcx()
                                          .lang_items
                                          .require(ExchangeFreeFnLangItem)
-                                         .expect("Could not find ExchangeFreeFnLangItem");
+                                         .unwrap_or_else(|e| ccx.sess().fatal(&e));
 
         assert!(can_have_local_instance(ccx, exchange_free_fn_def_id));
         let exchange_free_fn_trans_item =
index 1269c266c7c10ade2bcab46130bbd5924d83ff1e..eb54527b3733d3078e12049437c32f97e0fd58ac 100644 (file)
@@ -1159,7 +1159,7 @@ pub fn fulfill_obligation<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     // Currently, we use a fulfillment context to completely resolve
     // all nested obligations. This is because they can inform the
     // inference of the impl's type parameters.
-    let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
+    let mut fulfill_cx = traits::FulfillmentContext::new();
     let vtable = selection.map(|predicate| {
         fulfill_cx.register_predicate_obligation(&infcx, predicate);
     });
@@ -1188,7 +1188,7 @@ pub fn normalize_and_test_predicates<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     let tcx = ccx.tcx();
     let infcx = infer::normalizing_infer_ctxt(tcx, &tcx.tables);
     let mut selcx = traits::SelectionContext::new(&infcx);
-    let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
+    let mut fulfill_cx = traits::FulfillmentContext::new();
     let cause = traits::ObligationCause::dummy();
     let traits::Normalized { value: predicates, obligations } =
         traits::normalize(&mut selcx, cause.clone(), &predicates);
index d3e66bde4f4c38ce66aa968b367111b39e215fa8..a4fb2e381459e7ced59e5708f377ae534bf91c17 100644 (file)
@@ -134,7 +134,7 @@ fn deduce_expectations_from_obligations<'a,'tcx>(
     expected_vid: ty::TyVid)
     -> (Option<ty::FnSig<'tcx>>, Option<ty::ClosureKind>)
 {
-    let fulfillment_cx = fcx.inh.infcx.fulfillment_cx.borrow();
+    let fulfillment_cx = fcx.inh.fulfillment_cx.borrow();
     // Here `expected_ty` is known to be a type inference variable.
 
     let expected_sig =
index d5f242201892512ce71f85fe74d496b279a8834d..d674fa145dc9ace491fcbff26b438947e6736f27 100644 (file)
@@ -43,7 +43,7 @@ pub fn compare_impl_method<'tcx>(tcx: &ty::ctxt<'tcx>,
            impl_trait_ref);
 
     let mut infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None);
-    let mut fulfillment_cx = infcx.fulfillment_cx.borrow_mut();
+    let mut fulfillment_cx = traits::FulfillmentContext::new();
 
     let trait_to_impl_substs = &impl_trait_ref.substs;
 
@@ -417,7 +417,7 @@ pub fn compare_const_impl<'tcx>(tcx: &ty::ctxt<'tcx>,
            impl_trait_ref);
 
     let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None);
-    let mut fulfillment_cx = infcx.fulfillment_cx.borrow_mut();
+    let mut fulfillment_cx = traits::FulfillmentContext::new();
 
     // The below is for the most part highly similar to the procedure
     // for methods above. It is simpler in many respects, especially
index deda0b818ee06d4e90f7af1386de524addf182d4..9d39653375739531f56660c839397f1319d83fa6 100644 (file)
@@ -84,6 +84,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
 
     let impl_param_env = ty::ParameterEnvironment::for_item(tcx, self_type_node_id);
     let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, Some(impl_param_env));
+    let mut fulfillment_cx = traits::FulfillmentContext::new();
 
     let named_type = tcx.lookup_item_type(self_type_did).ty;
     let named_type = named_type.subst(tcx, &infcx.parameter_environment.free_substs);
@@ -105,7 +106,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
         return Err(());
     }
 
-    if let Err(ref errors) = infcx.fulfillment_cx.borrow_mut().select_all_or_error(&infcx) {
+    if let Err(ref errors) = fulfillment_cx.select_all_or_error(&infcx) {
         // this could be reached when we get lazy normalization
         traits::report_fulfillment_errors(&infcx, errors);
         return Err(());
index e485bdd66fc9f265ca8f27fb9511eedbb480380d..6a7bc9b61116d8a18b91f0ecb3654ce344c798ce 100644 (file)
@@ -161,6 +161,8 @@ pub struct Inherited<'a, 'tcx: 'a> {
     infcx: infer::InferCtxt<'a, 'tcx>,
     locals: RefCell<NodeMap<Ty<'tcx>>>,
 
+    fulfillment_cx: RefCell<traits::FulfillmentContext<'tcx>>,
+
     tables: &'a RefCell<ty::Tables<'tcx>>,
 
     // When we process a call like `c()` where `c` is a closure type,
@@ -306,6 +308,7 @@ fn new(tcx: &'a ty::ctxt<'tcx>,
 
         Inherited {
             infcx: infer::new_infer_ctxt(tcx, tables, Some(param_env)),
+            fulfillment_cx: RefCell::new(traits::FulfillmentContext::new()),
             locals: RefCell::new(NodeMap()),
             tables: tables,
             deferred_call_resolutions: RefCell::new(DefIdMap()),
@@ -320,9 +323,8 @@ fn normalize_associated_types_in<T>(&self,
                                         -> T
         where T : TypeFoldable<'tcx>
     {
-        let mut fulfillment_cx = self.infcx.fulfillment_cx.borrow_mut();
         assoc::normalize_associated_types_in(&self.infcx,
-                                             &mut fulfillment_cx,
+                                             &mut self.fulfillment_cx.borrow_mut(),
                                              span,
                                              body_id,
                                              value)
@@ -1370,7 +1372,6 @@ fn normalize_associated_type(&self,
                                                  self.body_id,
                                                  traits::ObligationCauseCode::MiscObligation);
         self.inh
-            .infcx
             .fulfillment_cx
             .borrow_mut()
             .normalize_projection_type(self.infcx(),
@@ -1505,7 +1506,7 @@ pub fn register_builtin_bound(&self,
                                   builtin_bound: ty::BuiltinBound,
                                   cause: traits::ObligationCause<'tcx>)
     {
-        self.inh.infcx.fulfillment_cx.borrow_mut()
+        self.inh.fulfillment_cx.borrow_mut()
             .register_builtin_bound(self.infcx(), ty, builtin_bound, cause);
     }
 
@@ -1514,7 +1515,7 @@ pub fn register_predicate(&self,
     {
         debug!("register_predicate({:?})",
                obligation);
-        self.inh.infcx.fulfillment_cx
+        self.inh.fulfillment_cx
             .borrow_mut()
             .register_predicate_obligation(self.infcx(), obligation);
     }
@@ -1646,7 +1647,7 @@ pub fn register_region_obligation(&self,
                                       region: ty::Region,
                                       cause: traits::ObligationCause<'tcx>)
     {
-        let mut fulfillment_cx = self.inh.infcx.fulfillment_cx.borrow_mut();
+        let mut fulfillment_cx = self.inh.fulfillment_cx.borrow_mut();
         fulfillment_cx.register_region_obligation(ty, region, cause);
     }
 
@@ -2003,7 +2004,7 @@ fn select_all_obligations_or_error(&self) {
 
         self.select_all_obligations_and_apply_defaults();
 
-        let mut fulfillment_cx = self.inh.infcx.fulfillment_cx.borrow_mut();
+        let mut fulfillment_cx = self.inh.fulfillment_cx.borrow_mut();
         match fulfillment_cx.select_all_or_error(self.infcx()) {
             Ok(()) => { }
             Err(errors) => { report_fulfillment_errors(self.infcx(), &errors); }
@@ -2013,7 +2014,7 @@ fn select_all_obligations_or_error(&self) {
     /// Select as many obligations as we can at present.
     fn select_obligations_where_possible(&self) {
         match
-            self.inh.infcx.fulfillment_cx
+            self.inh.fulfillment_cx
             .borrow_mut()
             .select_where_possible(self.infcx())
         {
index 1ee0542f633372c405d6e6f1b5b94c70bd868e13..2335b76626b170bd46d0a635c31d4c1256751118 100644 (file)
@@ -353,7 +353,6 @@ fn visit_region_obligations(&mut self, node_id: ast::NodeId)
         let region_obligations =
             self.fcx
                 .inh
-                .infcx
                 .fulfillment_cx
                 .borrow()
                 .region_obligations(node_id)
@@ -369,7 +368,7 @@ fn visit_region_obligations(&mut self, node_id: ast::NodeId)
 
         // Processing the region obligations should not cause the list to grow further:
         assert_eq!(region_obligations.len(),
-                   self.fcx.inh.infcx.fulfillment_cx.borrow().region_obligations(node_id).len());
+                   self.fcx.inh.fulfillment_cx.borrow().region_obligations(node_id).len());
     }
 
     fn code_to_origin(&self,
index 7e63fd47d61e15c61bd8163320ecad34dedceaab..2dfbaab2844754f9a81841835ee4448d10f766a9 100644 (file)
@@ -473,7 +473,7 @@ fn check_implementations_of_coerce_unsized(&self) {
                 }
             };
 
-            let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
+            let mut fulfill_cx = traits::FulfillmentContext::new();
 
             // Register an obligation for `A: Trait<B>`.
             let cause = traits::ObligationCause::misc(span, impl_node_id);
index ca05806d8f95a181f7d242fb74e10e517c4a14d8..d6e4b7e4a51d60881dda6d0d81124ef8228677cf 100644 (file)
@@ -1281,10 +1281,8 @@ impl Clean<Item> for hir::ImplItem {
     fn clean(&self, cx: &DocContext) -> Item {
         let inner = match self.node {
             hir::ImplItemKind::Const(ref ty, ref expr) => {
-                ConstantItem(Constant{
-                    type_: ty.clean(cx),
-                    expr: expr.span.to_src(cx),
-                })
+                AssociatedConstItem(ty.clean(cx),
+                                    Some(expr.span.to_src(cx)))
             }
             hir::ImplItemKind::Method(ref sig, _) => {
                 MethodItem(sig.clean(cx))
index 12a17afcc7c502a281ca4245e69d649bf4f87bb0..e432da3dcaf4e2b904fd79f374e0b0215466f719 100644 (file)
@@ -1653,8 +1653,8 @@ fn shorter<'a>(s: Option<&'a str>) -> String {
 
 #[inline]
 fn plain_summary_line(s: Option<&str>) -> String {
-    let line = shorter(s).replace("\n", " ");
-    markdown::plain_summary_line(&line[..])
+    let md = markdown::plain_summary_line(s.unwrap_or(""));
+    shorter(Some(&md)).replace("\n", " ")
 }
 
 fn document(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item) -> fmt::Result {
@@ -1781,6 +1781,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering
                 } else {
                     String::new()
                 };
+                let doc_value = myitem.doc_value().unwrap_or("");
                 try!(write!(w, "
                     <tr class='{stab} module-item'>
                         <td><a class='{class}' href='{href}'
@@ -1792,7 +1793,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering
                 ",
                 name = *myitem.name.as_ref().unwrap(),
                 stab_docs = stab_docs,
-                docs = Markdown(&shorter(myitem.doc_value())),
+                docs = shorter(Some(&Markdown(doc_value).to_string())),
                 class = shortty(myitem),
                 stab = myitem.stability_class(),
                 href = item_path(myitem),
@@ -2550,25 +2551,25 @@ fn doctraititem(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item,
                 }
             }
             clean::TypedefItem(ref tydef, _) => {
-                let id = derive_id(format!("assoc_type.{}", name));
+                let id = derive_id(format!("associatedtype.{}", name));
                 try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
                 try!(write!(w, "type {} = {}", name, tydef.type_));
                 try!(write!(w, "</code></h4>\n"));
             }
             clean::AssociatedConstItem(ref ty, ref default) => {
-                let id = derive_id(format!("assoc_const.{}", name));
+                let id = derive_id(format!("associatedconstant.{}", name));
                 try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
                 try!(assoc_const(w, item, ty, default.as_ref()));
                 try!(write!(w, "</code></h4>\n"));
             }
             clean::ConstantItem(ref c) => {
-                let id = derive_id(format!("assoc_const.{}", name));
+                let id = derive_id(format!("associatedconstant.{}", name));
                 try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
                 try!(assoc_const(w, item, &c.type_, Some(&c.expr)));
                 try!(write!(w, "</code></h4>\n"));
             }
             clean::AssociatedTypeItem(ref bounds, ref default) => {
-                let id = derive_id(format!("assoc_type.{}", name));
+                let id = derive_id(format!("associatedtype.{}", name));
                 try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
                 try!(assoc_type(w, item, bounds, default));
                 try!(write!(w, "</code></h4>\n"));
index 38f79079b29f3a00420c59ff1007d0c27bd8b4ec..8cabdc41a0583324bb700ff8f79a88d78a78c5d9 100644 (file)
@@ -45,7 +45,7 @@ pub trait AsciiExt {
     #[stable(feature = "rust1", since = "1.0.0")]
     type Owned;
 
-    /// Checks if within the ASCII range.
+    /// Checks if the value is within the ASCII range.
     ///
     /// # Examples
     ///
@@ -55,8 +55,8 @@ pub trait AsciiExt {
     /// let ascii = 'a';
     /// let utf8 = '❤';
     ///
-    /// assert_eq!(true, ascii.is_ascii());
-    /// assert_eq!(false, utf8.is_ascii())
+    /// assert!(ascii.is_ascii());
+    /// assert!(!utf8.is_ascii());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     fn is_ascii(&self) -> bool;
@@ -114,9 +114,9 @@ pub trait AsciiExt {
     /// let ascii3 = 'A';
     /// let ascii4 = 'z';
     ///
-    /// assert_eq!(true, ascii1.eq_ignore_ascii_case(&ascii2));
-    /// assert_eq!(true, ascii1.eq_ignore_ascii_case(&ascii3));
-    /// assert_eq!(false, ascii1.eq_ignore_ascii_case(&ascii4));
+    /// assert!(ascii1.eq_ignore_ascii_case(&ascii2));
+    /// assert!(ascii1.eq_ignore_ascii_case(&ascii3));
+    /// assert!(!ascii1.eq_ignore_ascii_case(&ascii4));
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     fn eq_ignore_ascii_case(&self, other: &Self) -> bool;
index b7afd12d8e527bcc0c440c3015c059273cf093be..d241cd032ed4c07872f56a632077a59fabd93d4a 100644 (file)
@@ -269,9 +269,10 @@ macro_rules! option_env { ($name:expr) => ({ /* compiler built-in */ }) }
     /// This macro takes any number of comma-separated identifiers, and
     /// concatenates them all into one, yielding an expression which is a new
     /// identifier. Note that hygiene makes it such that this macro cannot
-    /// capture local variables, and macros are only allowed in item,
-    /// statement or expression position, meaning this macro may be difficult to
-    /// use in some situations.
+    /// capture local variables. Also, as a general rule, macros are only
+    /// allowed in item, statement or expression position. That means while
+    /// you may use this macro for referring to existing variables, functions or
+    /// modules etc, you cannot define a new one with it.
     ///
     /// # Examples
     ///
@@ -283,6 +284,8 @@ macro_rules! option_env { ($name:expr) => ({ /* compiler built-in */ }) }
     ///
     /// let f = concat_idents!(foo, bar);
     /// println!("{}", f());
+    ///
+    /// // fn concat_idents!(new, fun, name) { } // not usable in this way!
     /// # }
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
index a0db471deceb3e8619d82e306228802d1e2da31d..ebd299efa78db9ca89206ec41af9885f921b861a 100644 (file)
@@ -55,7 +55,7 @@
 //! * [`std::marker`]::{[`Copy`], [`Send`], [`Sized`], [`Sync`]}. The marker
 //!   traits indicate fundamental properties of types.
 //! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}. Various
-//!   operations for both destuctors and overloading `()`.
+//!   operations for both destructors and overloading `()`.
 //! * [`std::mem`]::[`drop`], a convenience function for explicitly dropping a
 //!   value.
 //! * [`std::boxed`]::[`Box`], a way to allocate values on the heap.
index 2cfa04c843b6b55fc800a220d17966776f6c6825..d858c0027558ced777dcfddd0fbe84e9ff5a7801 100644 (file)
@@ -111,7 +111,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + Reflect> Error for PoisonError<T> {
+impl<T: Reflect> Error for PoisonError<T> {
     fn description(&self) -> &str {
         "poisoned lock: another task failed inside"
     }
@@ -158,14 +158,17 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + Reflect> fmt::Display for TryLockError<T> {
+impl<T> fmt::Display for TryLockError<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.description().fmt(f)
+        match *self {
+            TryLockError::Poisoned(..) => "poisoned lock: another task failed inside",
+            TryLockError::WouldBlock => "try_lock failed because the operation would block"
+        }.fmt(f)
     }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + Reflect> Error for TryLockError<T> {
+impl<T: Reflect> Error for TryLockError<T> {
     fn description(&self) -> &str {
         match *self {
             TryLockError::Poisoned(ref p) => p.description(),
index 48c9b70dce436dcbcd6a7250b7dd372cc5ad7a1e..688475a756574919f390a321032746ec4dbd47b1 100644 (file)
@@ -338,9 +338,9 @@ pub fn home_dir() -> Option<PathBuf> {
         let _handle = Handle::new(token);
         super::fill_utf16_buf(|buf, mut sz| {
             match c::GetUserProfileDirectoryW(token, buf, &mut sz) {
-                0 if c::GetLastError() != 0 => 0,
+                0 if c::GetLastError() != c::ERROR_INSUFFICIENT_BUFFER => 0,
                 0 => sz,
-                n => n as c::DWORD,
+                _ => sz - 1, // sz includes the null terminator
             }
         }, super::os2path).ok()
     })
index 74302e2f6a0fdb7b0f32cfaa9fe5bd0ebadfccdb..c7f8a56135d298c8a1372c6054cd10661f9d1618 100644 (file)
@@ -341,7 +341,7 @@ pub fn push_trim(&mut self, mut sp: Span) {
         for idx in 0.. {
             if let Some(sp_trim) = sp.trim_start(prev) {
                 // Implies `sp.hi > prev.hi`
-                let cur = match self.spans.as_slice().get(idx) {
+                let cur = match self.spans.get(idx) {
                     Some(s) => *s,
                     None => {
                         sp = sp_trim;
index aa1ef2025a015a8894e4508fba5a509b073aa01d..ebc9f801931195c392e7c0273d1e72ad4e07f1aa 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::{env, fmt, process, sync, thread};
 
 struct SlowFmt(u32);
index e889d74c7ccc4e85be6317f0087bc3bf66e34c69..a63a232e1b5be8e09ee2cbf1434554662d2f89d8 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we cleanup a fixed size Box<[D; k]> properly when D has a
 // destructor.
 
+// ignore-emscripten no threads support
+
 #![feature(const_fn)]
 
 use std::thread;
index f108ef4f5d22de94deefff812dc0ceca310bb88c..ca17942917281329f9fa745760e845f3749a3f3a 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we cleanup dynamic sized Box<[D]> properly when D has a
 // destructor.
 
+// ignore-emscripten no threads support
+
 #![feature(const_fn)]
 
 use std::thread;
index 80b75af6e441e915cf36f77aefcd62c4f2af8e32..5019455c2a7f0a51ae63edc9975d07eaa1ad05ac 100644 (file)
@@ -14,6 +14,7 @@
 // that use capture clauses.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten no threads support
 
 extern crate cci_capture_clause;
 
index 7da1416602f6daec46d6961d456da65febc39cc8..e45f7c2bba66860ad255c82ebb8e591bb38c97b9 100644 (file)
@@ -11,6 +11,7 @@
 // Reported as issue #126, child leaks the string.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten no threads support
 
 #![feature(std_misc)]
 
index 344ea63c7c74da6d474372fc8320b667e1a4e659..25d3eb3bbe28c4d80d632fc93805efc6484eefd8 100644 (file)
@@ -24,6 +24,7 @@
 // It's unclear how likely such a bug is to recur, but it seems like a
 // scenario worth testing.
 
+// ignore-emscripten no threads support
 
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index 5a7b1c83dfda3acca3a9e410b34cac239b9efe09..384fb92954de2fcca1ba8db6f22d9f3f3b085b1e 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![allow(unknown_features)]
 #![feature(box_syntax, std_misc)]
index 72f623ccfde7aaa30a0e207a8c5834acaec7ff7e..d7cb8bc991ada836f3497cd5d6984578cdae311b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index d6b6d673ca5433f223b03430debd5f5cf885a2e9..ffcc1891c579e22357bb0fd210dff143caa6cd67 100644 (file)
@@ -10,6 +10,7 @@
 
 // ignore-pretty
 // compile-flags:--test
+// ignore-emscripten
 
 // NB: These tests kill child processes. Valgrind sees these children as leaking
 // memory, which makes for some *confusing* logs. That's why these are here
index 4a6c8ce70dcee16d2dc711b8d836c055904369d3..07a10c8d45443892151490ea3b7e50d315ac427b 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-flags: -Z force-dropflag-checks=off
+// ignore-emscripten no threads support
 
 // Quick-and-dirty test to ensure -Z force-dropflag-checks=off works as
 // expected. Note that the inlined drop-flag is slated for removal
index 252086ad014da6d65a485fc9d54e11a6e1632d39..1a0191b70530a5af0661aa79b6726dbd56a91245 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(libc)]
 
 extern crate libc;
index 9a39b1773e533e58f48bd3839755e04d92e79c8a..1beb6d3519aeeb4c5bb9b46ddfe4487804eae949 100644 (file)
@@ -12,6 +12,8 @@
 // make sure the stack pointers are maintained properly in both
 // directions
 
+// ignore-emscripten no threads support
+
 #![feature(libc, std_misc)]
 
 extern crate libc;
index 3c7d2861c877e317d4e2918e9381311b4f7e9e8e..c2916ccd75b8e4a58e8d926714b02b35b608c60f 100644 (file)
@@ -10,6 +10,7 @@
 
 // ignore-windows
 // ignore-android
+// ignore-emscripten
 
 #![feature(libc)]
 
index f4792c212165de330540a7ee4f657189a53b787c..ca118899798b864a82200d54db37d493a7e52996 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // ignore-aarch64
+// ignore-emscripten no threads support
+
 #![feature(libc)]
 
 extern crate libc;
index dafa8ee10339ee706c810153987fe7787bbc35a3..2ff024a693aae4f4f0d609045a0200b78d86a21d 100644 (file)
@@ -13,6 +13,7 @@
 // optimisation.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten no threads support
 
 #![feature(intrinsics, std_misc)]
 
index 3f50a7d6c02983da66145b3ab26c230c44013ce0..e17e3a16d6834ab1afabac378094e08679499eaa 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-flags: -Z force-overflow-checks=on
+// ignore-emscripten no threads support
 
 use std::thread;
 
index 9fd4f2133b70d36287f9b7cd02010fbb2ad0beca..8f22579423fd5a68e190fc44b2916b3dedff3677 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // This test is checking that the move_val_init intrinsic is
 // respecting cleanups for both of its argument expressions.
 //
index e94368925abee2b261c0d6d0ac9cc104e59cb54b..316190b54eb08e989755e627b282368133f4e920 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // This test may not always fail, but it can be flaky if the race it used to
 // expose is still present.
 
index a9f7d86f95ee6148d22417004dabdd06de850a36..596f0d20155df88801e1dcaaf850abc6f1df95dc 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![feature(unboxed_closures)]
 
index 1ebe3a7f068acc7184c3e334e70876dc919dcaf8..2be04551cb92f82244a8fe1c16f2d730d6e65ab7 100644 (file)
@@ -11,6 +11,8 @@
 // DON'T REENABLE THIS UNLESS YOU'VE ACTUALLY FIXED THE UNDERLYING ISSUE
 // ignore-android seems to block forever
 
+// ignore-emscripten no threads support
+
 #![forbid(warnings)]
 
 // Pretty printing tests complain about `use std::predule::*`
index ec095d4895ff40e20ffe89596ab5ced6a55b79f1..6b45a4d0a520723e2a01e41f24c2aad3b47df580 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // Regression test for unwrapping the result of `join`, issue #21291
 
 use std::thread;
index da78578329b73200768026101e407015b27c1f40..f9360af011bc9cbf2ff6256b8b73e642aab29bb7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 pub fn main() {
     let f = || || 0;
     std::thread::spawn(f());
index b619d1dd4488c015e165cf1340a71b400cc76a88..e707023530be89d0a0492665f9ad3d7f22ba1f81 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 struct Foo(i32);
index bdd3a80d74cf4a4da7409d6f7fb5e15df398956e..402460e7253d31b8c5b5f057792bbce232d67c58 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(const_fn)]
 
 // Check that the destructors of simple enums are run on unwinding
index eee0f663df24cff775714da4f0e4160d0492da2d..17a6e9bd6b2e7afefbc051446490ac1bfbb490ef 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 struct Foo;
index da4d5f19d4a2e9b585f825c93d539602e531fd6f..e39ffb87425dc91c957736e991323720348c371b 100644 (file)
@@ -13,6 +13,8 @@
 // spawned thread to isolate the expected error result from the
 // SIGTRAP injected by the drop-flag consistency checking.
 
+// ignore-emscripten no threads support
+
 struct Foo;
 
 impl Drop for Foo {
index 9292a9c608eb9fbd028b0008548a07780f09f0e2..5eec800d5884608b294e66f8f75b940137704169 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::sync::mpsc::channel;
 use std::thread;
 
index eb411ff4417784643f1395073e17f0716d312efc..6f0356b5bfbc8c0193042c3c7dfeada826189267 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 use std::sync::mpsc::channel;
 use std::thread;
index 4ebc43163ede894d451b8a85d612a218ff334271..8ec9f8aff8ec72da5143d30a96941768db3ed82c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(zero_one)]
 
 use std::num::Zero;
index 280311af6fbd12ea94121129cc608f6f9a8f12f2..6e01131cfcaa41562f0789af8f3161bd08bdc679 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index ed67630bcac44540024f6834e9065d65799855a2..5af2006f08146c42cb5d49214c82df56af68922b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::sync::mpsc::{TryRecvError, channel};
 use std::thread;
 
index 3f0daf2610ce970704f31a2fa685b3a23b8fda7d..e7498f7c1741dbff45d0720d948e3351151edb30 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten no threads support
 
 #![feature(std_misc)]
 
index 1b1cdcb1102a2d3015e772388af3e32799254e92..11ab43fd08763d16a738d6fc27b91e5d6ed3bbf0 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-windows
+// ignore-emscripten no threads support
 // exec-env:RUST_LOG=debug
 
 use std::cell::Cell;
index 326d1cafe6c782fe47ba3a2bf62af3516dd01c2f..c3fad3a19f92792d459af15ba54cc7122a2c7872 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 macro_rules! expr { ($e: expr) => { $e } }
index c7ef9776367bd10d410d56e80f68dd398b428557..d3c028070fd143cfd97a1ee515c44df5ef42df62 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index 89ac626158392f73f33da2da2c93039add3d0f0b..458b6c16e62a776a8234c77013accf9a13a34c0f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // Test that using the `vec!` macro nested within itself works when
 // the contents implement Drop and we hit a panic in the middle of
 // construction.
index d90e7ef5e473d8ee1139d39d6209a47ff29775c9..8445bccf134934985471d9605197e32b03fb6f44 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // compile-flags: -Z no-landing-pads
-
+// ignore-emscripten no threads support
 
 use std::thread;
 
index 783a44beaf36a0b256a3d4b8a130fe8c300db549..39ea987f71ba4b0f93914b94ca60036c50f4277e 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 #![feature(panic_handler, std_panic)]
 
+// ignore-emscripten no threads support
+
 use std::panic;
 use std::thread;
 
index edf65e8e2aa699f373116e7d20bf5ef095df782e..ed9a02c1d3eccdde8c9a0b64333fa0c32ea15aeb 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 #![feature(panic_handler, const_fn, std_panic)]
 
+// ignore-emscripten no threads support
+
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::panic;
 use std::thread;
index f84a823d3db22e290310aa24b1d27857e603ceb5..c5f92fbd55aadc851bbbdd3bef0c628dcc7d5b43 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 use std::thread;
 
index c0b2f25d99c07aa9c20e48a368a9299739e9ae91..d420ef99863c29c750485180fc1c9103a699a9fa 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_panic, recover, panic_propagate, panic_handler, const_fn)]
 
 use std::sync::atomic::{AtomicUsize, Ordering};
index 5bff4fa080a34d2aa4f2220807342ea06b6edf91..ebc7f134610457835220282f58a96881d523d729 100644 (file)
@@ -18,6 +18,8 @@
 // (instead of running forever), and that it does not print an error
 // message about a broken pipe.
 
+// ignore-emscripten no threads support
+
 use std::process;
 use std::thread;
 
index 59179206104f8421cf8229d053dcccac638dcd29..306d24e317754208d55c9cd4ee49dedd8c898b9b 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // exec-env:RUST_LOG=rust_log_filter/foo
-
+// ignore-emscripten no threads support
 
 #![allow(unknown_features)]
 #![feature(box_syntax, std_misc, rustc_private)]
index 66878d98c840cf5088112c79cb33c96aabb0f041..7dd1c3c597876b2b1cce90441ccbe5e9884e1c50 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten no threads support
 
 #![feature(std_misc)]
 
index 63ffa552405bea33680bcc7195ce5f5367217ff8..fb5877b8a48987af81eadb78e6925ae37f231705 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 766e2b6b7228f0f37b946bd39008a5b2f1cb3616..96e9c1ed2ccf9ead559a295f7eacd18fa9ac4aba 100644 (file)
@@ -10,6 +10,7 @@
 
 // ignore-bitrig
 // compile-flags: -C codegen-units=3
+// ignore-emscripten no threads support
 
 // Test unwinding through multiple compilation units.
 
index ed949fe082877ae50c9d388d5ccff252227c85f0..afec06adc864fd271208810bcbe3cfcaad936537 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
 
index 4103c9495e102ca063b894a5713ec531968c0ed8..2932b585b8805b34e8bfe74b74921ed3bb30485d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
 
index 4a35ed609e0801c793997c53785cc46d39e63549..751d833ff9c8baec05c86ecc5c2e468e45f94e11 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 fn x(s: String, n: isize) {
index ae4fabd34d6299536a9ac6a854959b0fb40e8883..cab190d025f8b648ede2c35737e991f9f8058aa0 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 /*
   Make sure we can spawn tasks that take different types of
index 00be41a27d2c2727fa9e0c3880d3ebb2e5cc5740..c9a030cf053c735d599f3caa21cd8c201975e956 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 pub fn main() {
index 93dc3faaa205dfb47e72ef6fe27f10a75e7b7d94..2a5fab8a209273268ea55314858055aa8787819e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 pub fn main() {
index 858b7a83c6274f475f484666c2f6e36bed5be558..c09ddf5296661300b7b545add98a4dd947e00d14 100644 (file)
@@ -10,6 +10,7 @@
 
 // ignore-windows
 // exec-env:RUST_LOG=debug
+// ignore-emscripten no threads support
 
 // regression test for issue #10405, make sure we don't call println! too soon.
 
index 1409caf9c702db352b046f27e46c8419571c9941..0ac232e2e12b3fab3ae14a53ff13b1f9e58c2b5d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index b3327d82c3ebe8b05707b35cef118278f52479b4..9a43780f08f0100f66e87263a3f1d054b51816af 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index ced240502ed8b9fff17d2ab0d6f7a8d3a8d59f19..13b40f17292fbbe45f815ef0681a9d4789aa4cc0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index 7af8f5d3b35759b109760146dadec7000bf09828..be846795962da9b3904c5fe5db1987163e0f7522 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten no threads support
 
 #![feature(std_misc)]
 
index a3dfa361cecd6268cda9c0cbf5760bd4f7383acc..fdf02e65d8eb3910fc7ec5149cfa96ec21f573e8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index 156ddd9c77fc339d817b749a9e13b5bef09d9c31..46c5d3a7ce32baaefb9719fcbc4b3af85059128a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::sync::mpsc::{channel, Sender};
index 90f68deb303e847d34ca6f9bb4afe8ad7528c155..e75a6cf0c87097f19e8f296c856110f117f650dc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::sync::mpsc::{channel, Sender};
index 2994b9c53849093260a53399ac49d83cc3909461..f2ff48ebd95a93ff12258e00884275fc50d9b7e6 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
 #![feature(std_misc)]
index 8f6f971ce35c817dd4a06a2a3a2ca4a9592da68a..fe00f1aba363bcabf1cbe6a1696a083c091c9388 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
 #![feature(std_misc)]
index 890107998ccb75f44b53aff4332bf59a3ed8468f..0e8542bababdda6190fbe4d495cbd88cae4f0801 100644 (file)
@@ -10,6 +10,7 @@
 
 #![feature(std_misc)]
 
+// ignore-emscripten no threads support
 // no-pretty-expanded FIXME #15189
 
 use std::thread;
index e37160f979c268849d3756587f6703012fd00c60..7b2b9fde9ee4aebe45afb509b727b094b65ab67a 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![feature(std_misc)]
 #![allow(dead_assignment)]
index d8eec4169e3531c0f749a827b39ffc64256ec97a..75fd1826b585320aee31a1ac8b38126df4d915a4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index ba8819fd0b0fee8e236977c8ac70b97672a3c15d..312a9f499250112a1ed39284a60bdf13cc321194 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
 #![feature(std_misc)]
index 6a84ec47c93a1a0a22f0db4b299428c3d5a040e2..9b9081019e482cc86734816e25fee4c20e5a47b2 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![allow(unknown_features)]
 #![feature(box_syntax, std_misc)]
index 4a1bb5a5916f0dfaea28f83fafb7f8a55742f3ad..1f64f40c5255baead14e2e11b8488ffe4f305466 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(box_syntax, set_stdio)]
 
 use std::io::prelude::*;
index dca65f03f690af16f126e1c746e80e64d39f26a9..52c920b6f5e03a34a6361b350aeedaffaf42e498 100644 (file)
@@ -12,6 +12,7 @@
 // ignore-bitrig system ulimit (Too many open files)
 // ignore-netbsd system ulimit (Too many open files)
 // ignore-openbsd system ulimit (Too many open files)
+// ignore-emscripten no threads or sockets support
 
 use std::io::prelude::*;
 use std::net::{TcpListener, TcpStream};
index 83eb351df530f1536c6559b22476752c5dbe3c1f..2875f73fc6cfa5e3825ac2e0d9f4568244f29919 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 // Issue #787
 // Don't try to clean up uninitialized locals
index 184338c3294ff9290502609af17cd762263705d3..8c5b84b2c82c3e58c873a24c5ce8f2af5a98263c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(std_misc)]
 
 use std::thread;
index da30100f67ff9a421ea981e066b59942c23c920b..82e586196e3791be5d1ce1677db24aaca2ee1103 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // no-prefer-dynamic
+// ignore-emscripten no threads support
 
 static mut HIT: bool = false;
 
index 195b814492af1e68052c0b321a484b455ec98fe1..b44c535d3a487f4755b4454cefeb8c0d9e4d5f7c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![feature(thread_local_state)]
 
 use std::thread::{self, LocalKeyState};
index 9aa2badd80b94e4cda7245179293c4fb80df8c91..24dc73d4a43d175906a0d8505dc967df094ec2eb 100644 (file)
@@ -11,6 +11,7 @@
 // Tests that a heterogeneous list of existential types can be put inside an Arc
 // and shared between threads as long as all types fulfill Send.
 
+// ignore-emscripten no threads support
 // ignore-pretty
 
 #![allow(unknown_features)]
index c32483f629e03dd4d6130e8602a38834a550ad99..2e864797db056203312aa962d59eaa9c70563953 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index e31d4c811fc63cb821c7a193bfc9bb2c8949c026..eaee3505a67ca79e7086b3ee5cd437a59710dc15 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 // Make sure the destructor is run for unit-like structs.
 
 
index 449e500edbe846345be09cb01ef50404d9f6aef9..85ee21e09025592244d37820aa4b0968e054132b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::sync::mpsc::{channel, Sender};
 use std::thread;
 
index 07bfc8062f9d4c2778c5c82e2bc6299bfb00d012..320a11f64d8ac50a36091ae8ab28ed486f2941be 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index 42b05aeea2910a73de32b8872c3a9c0cd2b0120b..a4202217840e64a45bd0251e7ffc92210d9c3f21 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
 
 #![feature(rand, num_bits_bytes)]
 #![feature(const_fn)]
index 5a567758bf45f673b0e8dba0e8e7cb8a730ea58c..d9f4ec289203503eb1bab6458cef320dcaf4412b 100644 (file)
@@ -10,6 +10,7 @@
 
 // aux-build:weak-lang-items.rs
 
+// ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
 extern crate weak_lang_items as other;
index 45a747509589d85572d18cd8ec40ddd09d502efd..db884638622d190ba23d5e81f70148c1449fa623 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 pub fn main() {
index 69d8431082c2f42995c1479b2dbee192e4d1da29..cab68794e1cc4d6a9ef04b731f8435532250ec2b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread;
 
 pub fn main() {
index 20d4c744414c6a3e5178e34375c5ef328af4d813..8d3f9b59bb2eebe0e25cf48f66bb659b267675e5 100644 (file)
@@ -20,7 +20,7 @@ pub trait Foo {
 pub struct Bar;
 
 impl Bar {
-    // @has assoc_consts/struct.Bar.html '//*[@id="assoc_const.BAR"]' \
+    // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
     //      'const BAR: usize = 3'
     pub const BAR: usize = 3;
 }
index 745c6e2c6648da6822f4e6f6960e1b49e787cf69..ff48c70fc58dc6e0f463b75fdb4967d08c6dcf6a 100644 (file)
@@ -14,5 +14,5 @@
 extern crate issue_21092;
 
 // @has issue_21092/struct.Bar.html
-// @has - '//*[@id="assoc_type.Bar"]' 'type Bar = i32'
+// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32'
 pub use issue_21092::{Foo, Bar};
index e4d97828d50a08c860ef7474b1c2577f3974b8e8..2343b610ce448c30414892a8f13f4b19b9654162 100644 (file)
@@ -31,21 +31,21 @@ pub fn pass() -> isize { 42 }
 }
 
 impl<T> Bar for Foo<T> {
-    // @has - '//*[@id="assoc_type.Item"]//code' 'type Item = T'
+    // @has - '//*[@id="associatedtype.Item"]//code' 'type Item = T'
     type Item=T;
 
     // @has - '//*[@id="method.quux"]//code' 'fn quux(self)'
     fn quux(self) {}
 }
 impl<'a, T> Bar for &'a Foo<T> {
-    // @has - '//*[@id="assoc_type.Item-1"]//code' "type Item = &'a T"
+    // @has - '//*[@id="associatedtype.Item-1"]//code' "type Item = &'a T"
     type Item=&'a T;
 
     // @has - '//*[@id="method.quux-1"]//code' 'fn quux(self)'
     fn quux(self) {}
 }
 impl<'a, T> Bar for &'a mut Foo<T> {
-    // @has - '//*[@id="assoc_type.Item-2"]//code' "type Item = &'a mut T"
+    // @has - '//*[@id="associatedtype.Item-2"]//code' "type Item = &'a mut T"
     type Item=&'a mut T;
 
     // @has - '//*[@id="method.quux-2"]//code' 'fn quux(self)'
diff --git a/src/test/rustdoc/issue-30366.rs b/src/test/rustdoc/issue-30366.rs
new file mode 100644 (file)
index 0000000..e622257
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// @has issue_30366/index.html '//a/@href' 'http://www.rust-lang.org/'
+
+/// Describe it. [Link somewhere][1].
+///
+/// [1]: http://www.rust-lang.org/
+pub fn here_is_a_fn() { }