diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 688ee6ba295fa..7175fed5410ba 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -415,7 +415,8 @@ impl Step for Clippy { const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun) -> ShouldRun { - run.path("src/tools/clippy") + let builder = run.builder; + run.path("src/tools/clippy").default_condition(builder.build.config.extended) } fn make_run(run: RunConfig) { diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index 841f9dc64142e..dbf1fb1367dda 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -114,7 +114,7 @@ impl RawVec { impl RawVec { /// Creates the biggest possible RawVec (on the system heap) /// without allocating. If T has positive size, then this makes a - /// RawVec with capacity 0. If T has 0 size, then it it makes a + /// RawVec with capacity 0. If T has 0 size, then it makes a /// RawVec with capacity `usize::MAX`. Useful for implementing /// delayed allocation. pub fn new() -> Self { diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs index 4cb6e8405f398..80c48c7b28efd 100644 --- a/src/libcore/ops/deref.rs +++ b/src/libcore/ops/deref.rs @@ -18,7 +18,7 @@ /// Implementing `Deref` for smart pointers makes accessing the data behind them /// convenient, which is why they implement `Deref`. On the other hand, the /// rules regarding `Deref` and [`DerefMut`] were designed specifically to -/// accomodate smart pointers. Because of this, **`Deref` should only be +/// accommodate smart pointers. Because of this, **`Deref` should only be /// implemented for smart pointers** to avoid confusion. /// /// For similar reasons, **this trait should never fail**. Failure during @@ -103,7 +103,7 @@ impl<'a, T: ?Sized> Deref for &'a mut T { /// Implementing `DerefMut` for smart pointers makes mutating the data behind /// them convenient, which is why they implement `DerefMut`. On the other hand, /// the rules regarding [`Deref`] and `DerefMut` were designed specifically to -/// accomodate smart pointers. Because of this, **`DerefMut` should only be +/// accommodate smart pointers. Because of this, **`DerefMut` should only be /// implemented for smart pointers** to avoid confusion. /// /// For similar reasons, **this trait should never fail**. Failure during diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 53b056d2b8b6f..cd3dd9ce1399e 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -927,6 +927,12 @@ impl AtomicPtr { } } +#[stable(feature = "atomic_from", since = "1.23.0")] +impl From<*mut T> for AtomicPtr { + #[inline] + fn from(p: *mut T) -> Self { Self::new(p) } +} + #[cfg(target_has_atomic = "ptr")] macro_rules! atomic_int { ($stable:meta, $const_unstable:meta, @@ -967,6 +973,12 @@ macro_rules! atomic_int { } } + #[stable(feature = "atomic_from", since = "1.23.0")] + impl From<$int_type> for $atomic_type { + #[inline] + fn from(v: $int_type) -> Self { Self::new(v) } + } + #[$stable_debug] impl fmt::Debug for $atomic_type { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index 5dd5f8953a00e..d239b79d4ba7a 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -3,6 +3,9 @@ authors = ["The Rust Project Developers"] name = "std" version = "0.0.0" build = "build.rs" +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-lang/rust.git" +description = "The Rust Standard Library" [lib] name = "std" diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs index 39e00270233b4..6e0cccff00193 100644 --- a/src/libstd/sys/windows/c.rs +++ b/src/libstd/sys/windows/c.rs @@ -1228,7 +1228,7 @@ compat_fn! { } } -#[cfg(target_env = "gnu")] +#[cfg(all(target_env = "gnu", feature = "backtrace"))] mod gnu { use super::*; @@ -1256,5 +1256,5 @@ mod gnu { } } -#[cfg(target_env = "gnu")] +#[cfg(all(target_env = "gnu", feature = "backtrace"))] pub use self::gnu::*; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5176379ee2f88..424f46840ad14 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3154,7 +3154,13 @@ impl<'a> Parser<'a> { // Parse: `for in ` let pat = self.parse_pat()?; - self.expect_keyword(keywords::In)?; + if !self.eat_keyword(keywords::In) { + let in_span = self.prev_span.between(self.span); + let mut err = self.sess.span_diagnostic + .struct_span_err(in_span, "missing `in` in `for` loop"); + err.span_suggestion_short(in_span, "try adding `in` here", " in ".into()); + err.emit(); + } let expr = self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None)?; let (iattrs, loop_block) = self.parse_inner_attrs_and_block()?; attrs.extend(iattrs); diff --git a/src/test/rustdoc/method-list.rs b/src/test/rustdoc/method-list.rs new file mode 100644 index 0000000000000..b7112885e888b --- /dev/null +++ b/src/test/rustdoc/method-list.rs @@ -0,0 +1,30 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-tidy-linelength + +#![crate_name = "foo"] + +// @has foo/struct.Foo.html +// @has - '//*[@class="sidebar-links"]/a' 'super_long_name' +// @has - '//*[@class="sidebar-links"]/a' 'Disp' +pub struct Foo(usize); + +impl Foo { + pub fn super_long_name() {} +} + +pub trait Disp { + fn disp_trait_method(); +} + +impl Disp for Foo { + fn disp_trait_method() {} +} diff --git a/src/test/ui/issue-40782.rs b/src/test/ui/issue-40782.rs new file mode 100644 index 0000000000000..56ee225105f89 --- /dev/null +++ b/src/test/ui/issue-40782.rs @@ -0,0 +1,15 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + for i 0..2 { + } +} + diff --git a/src/test/ui/issue-40782.stderr b/src/test/ui/issue-40782.stderr new file mode 100644 index 0000000000000..0d49eebbdbfc9 --- /dev/null +++ b/src/test/ui/issue-40782.stderr @@ -0,0 +1,8 @@ +error: missing `in` in `for` loop + --> $DIR/issue-40782.rs:12:10 + | +12 | for i 0..2 { + | ^ help: try adding `in` here + +error: aborting due to previous error + diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index f8628158aff46..42e52ceea6903 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2286,6 +2286,10 @@ actual:\n\ output_file.push(test_name); debug!("comparing the contests of: {:?}", output_file); debug!("with: {:?}", expected_content); + if !output_file.exists() { + panic!("Output file `{}` from test does not exist", + output_file.into_os_string().to_string_lossy()); + } self.check_mir_test_timestamp(test_name, &output_file); let mut dumped_file = fs::File::open(output_file.clone()).unwrap(); @@ -2334,13 +2338,22 @@ actual:\n\ // We expect each non-empty line to appear consecutively, non-consecutive lines // must be separated by at least one Elision + let mut start_block_line = None; while let Some(dumped_line) = dumped_lines.next() { match expected_lines.next() { - Some(&ExpectedLine::Text(expected_line)) => + Some(&ExpectedLine::Text(expected_line)) => { + let normalized_expected_line = normalize_mir_line(expected_line); + if normalized_expected_line.contains(":{") { + start_block_line = Some(expected_line); + } + if !compare(expected_line, dumped_line) { + error!("{:?}", start_block_line); error(expected_line, - format!("Mismatch in lines\nExpected Line: {:?}", dumped_line)); - }, + format!("Mismatch in lines\nCurrnt block: {}\nExpected Line: {:?}", + start_block_line.unwrap_or("None"), dumped_line)); + } + }, Some(&ExpectedLine::Elision) => { // skip any number of elisions in a row. while let Some(&&ExpectedLine::Elision) = expected_lines.peek() {