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 9 pull requests #45755

Merged
merged 29 commits into from
Nov 4, 2017
Merged
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
0cd03bf
issue #45357 don't build clippy stage 1
ratmice Oct 26, 2017
5c21637
impl From<T> for AtomicT
strake Oct 29, 2017
80a3191
feature = "atomic_from"
strake Oct 29, 2017
6a62ea6
Add a nicer error message for missing in for loop, fixes #40782.
LaurentMazare Oct 30, 2017
be21779
since = "1.23.0"
strake Oct 31, 2017
6d060bd
Fix spans and error messages.
LaurentMazare Oct 31, 2017
ea103ef
add license data to libstd
cardoe Oct 31, 2017
4519192
add repository info to libstd
cardoe Oct 31, 2017
86c09f3
add description to libstd
cardoe Oct 31, 2017
531b7f2
Add some missing spaces.
LaurentMazare Oct 31, 2017
0d72853
Formatting tweak.
LaurentMazare Oct 31, 2017
175cfbf
Remove the parser snapshot hack.
LaurentMazare Nov 1, 2017
d336f02
Preserve original formatting.
LaurentMazare Nov 1, 2017
bf95f9f
Fix typo.
Ljzn Nov 1, 2017
ed20f3b
Remove the redundant span_label.
LaurentMazare Nov 1, 2017
0f49129
Fix typo
Ljzn Nov 2, 2017
d6dfec1
improve compiletest output for errors from mir-opt tests
mikhail-m1 Nov 2, 2017
ce3f071
Fix std compile error for windows-gnu targets without `backtrace` fea…
rkarp Nov 3, 2017
765153e
Add tests for methods listing in rust docs
GuillaumeGomez Nov 3, 2017
aa9d0aa
issue #45357 set clippy build condition to extended.
ratmice Oct 29, 2017
9ca6ee0
Rollup merge of #45548 - ratmice:master, r=oli-obk
kennytm Nov 4, 2017
ae512c4
Rollup merge of #45610 - strake:atomic_from, r=nagisa
kennytm Nov 4, 2017
ea57265
Rollup merge of #45639 - LaurentMazare:master, r=petrochenkov
kennytm Nov 4, 2017
1815265
Rollup merge of #45669 - cardoe:metadata, r=kennytm
kennytm Nov 4, 2017
2c29392
Rollup merge of #45681 - Ljzn:patch-1, r=kennytm
kennytm Nov 4, 2017
ff00a5f
Rollup merge of #45718 - Ljzn:patch-2, r=BurntSushi
kennytm Nov 4, 2017
7a766a4
Rollup merge of #45722 - mikhail-m1:improve-mir-opt-error-output, r=a…
kennytm Nov 4, 2017
606e269
Rollup merge of #45739 - rkarp:master, r=petrochenkov
kennytm Nov 4, 2017
e3b25a5
Rollup merge of #45746 - GuillaumeGomez:methods-doc-test, r=steveklabnik
kennytm Nov 4, 2017
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
3 changes: 2 additions & 1 deletion src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<T, A: Alloc> RawVec<T, A> {
impl<T> RawVec<T, Heap> {
/// 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 {
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,12 @@ impl<T> AtomicPtr<T> {
}
}

#[stable(feature = "atomic_from", since = "1.23.0")]
impl<T> From<*mut T> for AtomicPtr<T> {
#[inline]
fn from(p: *mut T) -> Self { Self::new(p) }
}

#[cfg(target_has_atomic = "ptr")]
macro_rules! atomic_int {
($stable:meta, $const_unstable:meta,
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ compat_fn! {
}
}

#[cfg(target_env = "gnu")]
#[cfg(all(target_env = "gnu", feature = "backtrace"))]
mod gnu {
use super::*;

Expand Down Expand Up @@ -1256,5 +1256,5 @@ mod gnu {
}
}

#[cfg(target_env = "gnu")]
#[cfg(all(target_env = "gnu", feature = "backtrace"))]
pub use self::gnu::*;
8 changes: 7 additions & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3154,7 +3154,13 @@ impl<'a> Parser<'a> {
// Parse: `for <src_pat> in <src_expr> <src_loop_block>`

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);
Expand Down
30 changes: 30 additions & 0 deletions src/test/rustdoc/method-list.rs
Original file line number Diff line number Diff line change
@@ -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 <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.

// 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() {}
}
15 changes: 15 additions & 0 deletions src/test/ui/issue-40782.rs
Original file line number Diff line number Diff line change
@@ -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 <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.

fn main() {
for i 0..2 {
}
}

8 changes: 8 additions & 0 deletions src/test/ui/issue-40782.stderr
Original file line number Diff line number Diff line change
@@ -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

19 changes: 16 additions & 3 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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() {
Expand Down