Skip to content

Commit 9acc333

Browse files
committed
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:
2 parents a454152 + e3b25a5 commit 9acc333

File tree

11 files changed

+98
-10
lines changed

11 files changed

+98
-10
lines changed

src/bootstrap/tool.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ impl Step for Clippy {
415415
const ONLY_HOSTS: bool = true;
416416

417417
fn should_run(run: ShouldRun) -> ShouldRun {
418-
run.path("src/tools/clippy")
418+
let builder = run.builder;
419+
run.path("src/tools/clippy").default_condition(builder.build.config.extended)
419420
}
420421

421422
fn make_run(run: RunConfig) {

src/liballoc/raw_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<T, A: Alloc> RawVec<T, A> {
114114
impl<T> RawVec<T, Heap> {
115115
/// Creates the biggest possible RawVec (on the system heap)
116116
/// without allocating. If T has positive size, then this makes a
117-
/// RawVec with capacity 0. If T has 0 size, then it it makes a
117+
/// RawVec with capacity 0. If T has 0 size, then it makes a
118118
/// RawVec with capacity `usize::MAX`. Useful for implementing
119119
/// delayed allocation.
120120
pub fn new() -> Self {

src/libcore/ops/deref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/// Implementing `Deref` for smart pointers makes accessing the data behind them
1919
/// convenient, which is why they implement `Deref`. On the other hand, the
2020
/// rules regarding `Deref` and [`DerefMut`] were designed specifically to
21-
/// accomodate smart pointers. Because of this, **`Deref` should only be
21+
/// accommodate smart pointers. Because of this, **`Deref` should only be
2222
/// implemented for smart pointers** to avoid confusion.
2323
///
2424
/// For similar reasons, **this trait should never fail**. Failure during
@@ -103,7 +103,7 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
103103
/// Implementing `DerefMut` for smart pointers makes mutating the data behind
104104
/// them convenient, which is why they implement `DerefMut`. On the other hand,
105105
/// the rules regarding [`Deref`] and `DerefMut` were designed specifically to
106-
/// accomodate smart pointers. Because of this, **`DerefMut` should only be
106+
/// accommodate smart pointers. Because of this, **`DerefMut` should only be
107107
/// implemented for smart pointers** to avoid confusion.
108108
///
109109
/// For similar reasons, **this trait should never fail**. Failure during

src/libcore/sync/atomic.rs

+12
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,12 @@ impl<T> AtomicPtr<T> {
927927
}
928928
}
929929

930+
#[stable(feature = "atomic_from", since = "1.23.0")]
931+
impl<T> From<*mut T> for AtomicPtr<T> {
932+
#[inline]
933+
fn from(p: *mut T) -> Self { Self::new(p) }
934+
}
935+
930936
#[cfg(target_has_atomic = "ptr")]
931937
macro_rules! atomic_int {
932938
($stable:meta, $const_unstable:meta,
@@ -967,6 +973,12 @@ macro_rules! atomic_int {
967973
}
968974
}
969975

976+
#[stable(feature = "atomic_from", since = "1.23.0")]
977+
impl From<$int_type> for $atomic_type {
978+
#[inline]
979+
fn from(v: $int_type) -> Self { Self::new(v) }
980+
}
981+
970982
#[$stable_debug]
971983
impl fmt::Debug for $atomic_type {
972984
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libstd/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ authors = ["The Rust Project Developers"]
33
name = "std"
44
version = "0.0.0"
55
build = "build.rs"
6+
license = "MIT/Apache-2.0"
7+
repository = "https://github.com/rust-lang/rust.git"
8+
description = "The Rust Standard Library"
69

710
[lib]
811
name = "std"

src/libstd/sys/windows/c.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ compat_fn! {
12281228
}
12291229
}
12301230

1231-
#[cfg(target_env = "gnu")]
1231+
#[cfg(all(target_env = "gnu", feature = "backtrace"))]
12321232
mod gnu {
12331233
use super::*;
12341234

@@ -1256,5 +1256,5 @@ mod gnu {
12561256
}
12571257
}
12581258

1259-
#[cfg(target_env = "gnu")]
1259+
#[cfg(all(target_env = "gnu", feature = "backtrace"))]
12601260
pub use self::gnu::*;

src/libsyntax/parse/parser.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,13 @@ impl<'a> Parser<'a> {
31543154
// Parse: `for <src_pat> in <src_expr> <src_loop_block>`
31553155

31563156
let pat = self.parse_pat()?;
3157-
self.expect_keyword(keywords::In)?;
3157+
if !self.eat_keyword(keywords::In) {
3158+
let in_span = self.prev_span.between(self.span);
3159+
let mut err = self.sess.span_diagnostic
3160+
.struct_span_err(in_span, "missing `in` in `for` loop");
3161+
err.span_suggestion_short(in_span, "try adding `in` here", " in ".into());
3162+
err.emit();
3163+
}
31583164
let expr = self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None)?;
31593165
let (iattrs, loop_block) = self.parse_inner_attrs_and_block()?;
31603166
attrs.extend(iattrs);

src/test/rustdoc/method-list.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-tidy-linelength
12+
13+
#![crate_name = "foo"]
14+
15+
// @has foo/struct.Foo.html
16+
// @has - '//*[@class="sidebar-links"]/a' 'super_long_name'
17+
// @has - '//*[@class="sidebar-links"]/a' 'Disp'
18+
pub struct Foo(usize);
19+
20+
impl Foo {
21+
pub fn super_long_name() {}
22+
}
23+
24+
pub trait Disp {
25+
fn disp_trait_method();
26+
}
27+
28+
impl Disp for Foo {
29+
fn disp_trait_method() {}
30+
}

src/test/ui/issue-40782.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
for i 0..2 {
13+
}
14+
}
15+

src/test/ui/issue-40782.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: missing `in` in `for` loop
2+
--> $DIR/issue-40782.rs:12:10
3+
|
4+
12 | for i 0..2 {
5+
| ^ help: try adding `in` here
6+
7+
error: aborting due to previous error
8+

src/tools/compiletest/src/runtest.rs

+16-3
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,10 @@ actual:\n\
22862286
output_file.push(test_name);
22872287
debug!("comparing the contests of: {:?}", output_file);
22882288
debug!("with: {:?}", expected_content);
2289+
if !output_file.exists() {
2290+
panic!("Output file `{}` from test does not exist",
2291+
output_file.into_os_string().to_string_lossy());
2292+
}
22892293
self.check_mir_test_timestamp(test_name, &output_file);
22902294

22912295
let mut dumped_file = fs::File::open(output_file.clone()).unwrap();
@@ -2334,13 +2338,22 @@ actual:\n\
23342338

23352339
// We expect each non-empty line to appear consecutively, non-consecutive lines
23362340
// must be separated by at least one Elision
2341+
let mut start_block_line = None;
23372342
while let Some(dumped_line) = dumped_lines.next() {
23382343
match expected_lines.next() {
2339-
Some(&ExpectedLine::Text(expected_line)) =>
2344+
Some(&ExpectedLine::Text(expected_line)) => {
2345+
let normalized_expected_line = normalize_mir_line(expected_line);
2346+
if normalized_expected_line.contains(":{") {
2347+
start_block_line = Some(expected_line);
2348+
}
2349+
23402350
if !compare(expected_line, dumped_line) {
2351+
error!("{:?}", start_block_line);
23412352
error(expected_line,
2342-
format!("Mismatch in lines\nExpected Line: {:?}", dumped_line));
2343-
},
2353+
format!("Mismatch in lines\nCurrnt block: {}\nExpected Line: {:?}",
2354+
start_block_line.unwrap_or("None"), dumped_line));
2355+
}
2356+
},
23442357
Some(&ExpectedLine::Elision) => {
23452358
// skip any number of elisions in a row.
23462359
while let Some(&&ExpectedLine::Elision) = expected_lines.peek() {

0 commit comments

Comments
 (0)