Auto merge of #45755 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests - Successful merges: #45548, #45610, #45639, #45669, #45681, #45718, #45722, #45739, #45746 - Failed merges:
This commit is contained in:
commit
9acc3331e1
11 changed files with 98 additions and 10 deletions
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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::*;
|
||||
|
|
|
@ -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);
|
||||
|
|
30
src/test/rustdoc/method-list.rs
Normal file
30
src/test/rustdoc/method-list.rs
Normal file
|
@ -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
src/test/ui/issue-40782.rs
Normal file
15
src/test/ui/issue-40782.rs
Normal file
|
@ -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
src/test/ui/issue-40782.stderr
Normal file
8
src/test/ui/issue-40782.stderr
Normal file
|
@ -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
|
||||
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue