Skip to content

Commit 256e497

Browse files
committed
Auto merge of #42245 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests - Successful merges: #42169, #42215, #42216, #42224, #42230, #42236, #42241 - Failed merges:
2 parents c732446 + 252a286 commit 256e497

File tree

20 files changed

+168
-40
lines changed

20 files changed

+168
-40
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `step_trait`
22

3-
The tracking issue for this feature is: [#27741]
3+
The tracking issue for this feature is: [#42168]
44

5-
[#27741]: https://github.com/rust-lang/rust/issues/27741
5+
[#42168]: https://github.com/rust-lang/rust/issues/42168
66

77
------------------------

src/libcollections/slice.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,12 @@ impl<T> [T] {
393393
}
394394

395395
/// Returns a reference to an element or subslice, without doing bounds
396-
/// checking. So use it very carefully!
396+
/// checking.
397+
///
398+
/// This is generally not recommended, use with caution! For a safe
399+
/// alternative see [`get`].
400+
///
401+
/// [`get`]: #method.get
397402
///
398403
/// # Examples
399404
///
@@ -413,7 +418,12 @@ impl<T> [T] {
413418
}
414419

415420
/// Returns a mutable reference to an element or subslice, without doing
416-
/// bounds checking. So use it very carefully!
421+
/// bounds checking.
422+
///
423+
/// This is generally not recommended, use with caution! For a safe
424+
/// alternative see [`get_mut`].
425+
///
426+
/// [`get_mut`]: #method.get_mut
417427
///
418428
/// # Examples
419429
///

src/libcollections/str.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,12 @@ impl str {
435435
/// Creates a string slice from another string slice, bypassing safety
436436
/// checks.
437437
///
438+
/// This is generally not recommended, use with caution! For a safe
439+
/// alternative see [`str`] and [`Index`].
440+
///
441+
/// [`str`]: primitive.str.html
442+
/// [`Index`]: ops/trait.Index.html
443+
///
438444
/// This new slice goes from `begin` to `end`, including `begin` but
439445
/// excluding `end`.
440446
///
@@ -477,6 +483,11 @@ impl str {
477483

478484
/// Creates a string slice from another string slice, bypassing safety
479485
/// checks.
486+
/// This is generally not recommended, use with caution! For a safe
487+
/// alternative see [`str`] and [`IndexMut`].
488+
///
489+
/// [`str`]: primitive.str.html
490+
/// [`IndexMut`]: ops/trait.IndexMut.html
480491
///
481492
/// This new slice goes from `begin` to `end`, including `begin` but
482493
/// excluding `end`.
@@ -1018,7 +1029,7 @@ impl str {
10181029
///
10191030
/// ```
10201031
/// let x = "(///)".to_string();
1021-
/// let d: Vec<_> = x.split('/').collect();;
1032+
/// let d: Vec<_> = x.split('/').collect();
10221033
///
10231034
/// assert_eq!(d, &["(", "", "", ")"]);
10241035
/// ```

src/libcore/iter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ pub use self::iterator::Iterator;
309309

310310
#[unstable(feature = "step_trait",
311311
reason = "likely to be replaced by finer-grained traits",
312-
issue = "27741")]
312+
issue = "42168")]
313313
pub use self::range::Step;
314314
#[unstable(feature = "step_by", reason = "recent addition",
315315
issue = "27741")]

src/libcore/iter/range.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::{FusedIterator, TrustedLen};
2020
/// two `Step` objects.
2121
#[unstable(feature = "step_trait",
2222
reason = "likely to be replaced by finer-grained traits",
23-
issue = "27741")]
23+
issue = "42168")]
2424
pub trait Step: PartialOrd + Sized {
2525
/// Steps `self` if possible.
2626
fn step(&self, by: &Self) -> Option<Self>;
@@ -55,7 +55,7 @@ macro_rules! step_impl_unsigned {
5555
($($t:ty)*) => ($(
5656
#[unstable(feature = "step_trait",
5757
reason = "likely to be replaced by finer-grained traits",
58-
issue = "27741")]
58+
issue = "42168")]
5959
impl Step for $t {
6060
#[inline]
6161
fn step(&self, by: &$t) -> Option<$t> {
@@ -115,7 +115,7 @@ macro_rules! step_impl_signed {
115115
($($t:ty)*) => ($(
116116
#[unstable(feature = "step_trait",
117117
reason = "likely to be replaced by finer-grained traits",
118-
issue = "27741")]
118+
issue = "42168")]
119119
impl Step for $t {
120120
#[inline]
121121
fn step(&self, by: &$t) -> Option<$t> {
@@ -187,7 +187,7 @@ macro_rules! step_impl_no_between {
187187
($($t:ty)*) => ($(
188188
#[unstable(feature = "step_trait",
189189
reason = "likely to be replaced by finer-grained traits",
190-
issue = "27741")]
190+
issue = "42168")]
191191
impl Step for $t {
192192
#[inline]
193193
fn step(&self, by: &$t) -> Option<$t> {

src/librustc_llvm/Cargo.lock

-22
This file was deleted.

src/librustc_passes/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckCrateVisitor<'a, 'tcx> {
141141
let outer_penv = self.tcx.infer_ctxt(body_id, Reveal::UserFacing).enter(|infcx| {
142142
let param_env = infcx.param_env.clone();
143143
let outer_penv = mem::replace(&mut self.param_env, param_env);
144-
let region_maps = &self.tcx.region_maps(item_def_id);;
144+
let region_maps = &self.tcx.region_maps(item_def_id);
145145
euv::ExprUseVisitor::new(self, region_maps, &infcx).consume_body(body);
146146
outer_penv
147147
});

src/librustc_trans/mir/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
901901
let llty = type_of::type_of(bcx.ccx, val.ty);
902902
let cast_ptr = bcx.pointercast(dst.llval, llty.ptr_to());
903903
let in_type = val.ty;
904-
let out_type = dst.ty.to_ty(bcx.tcx());;
904+
let out_type = dst.ty.to_ty(bcx.tcx());
905905
let llalign = cmp::min(bcx.ccx.align_of(in_type), bcx.ccx.align_of(out_type));
906906
self.store_operand(bcx, cast_ptr, Some(llalign), val);
907907
}

src/librustc_typeck/astconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
963963
pub fn prohibit_projection(&self, span: Span) {
964964
let mut err = struct_span_err!(self.tcx().sess, span, E0229,
965965
"associated type bindings are not allowed here");
966-
err.span_label(span, "associate type not allowed here").emit();
966+
err.span_label(span, "associated type not allowed here").emit();
967967
}
968968

969969
// Check a type Path and convert it to a Ty.

src/libstd/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
15451545
/// determined to not exist) are outlined by `fs::create_dir`.
15461546
///
15471547
/// Notable exception is made for situations where any of the directories
1548-
/// specified in the `path` could not be created as it was created concurrently.
1548+
/// specified in the `path` could not be created as it was being created concurrently.
15491549
/// Such cases are considered success. In other words: calling `create_dir_all`
15501550
/// concurrently from multiple threads or processes is guaranteed to not fail
15511551
/// due to race itself.

src/test/compile-fail/E0229.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Foo for isize {
2222

2323
fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
2424
//~^ ERROR associated type bindings are not allowed here [E0229]
25-
//~| NOTE associate type not allowed here
25+
//~| NOTE associated type not allowed here
2626

2727
fn main() {
2828
}

src/test/compile-fail/issue-23543.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub trait D {
1616
fn f<T>(self)
1717
where T<Bogus = Foo>: A;
1818
//~^ ERROR associated type bindings are not allowed here [E0229]
19-
//~| NOTE associate type not allowed here
19+
//~| NOTE associated type not allowed here
2020
}
2121

2222
fn main() {}

src/test/compile-fail/issue-23544.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub trait D {
1414
fn f<T>(self)
1515
where T<Bogus = Self::AlsoBogus>: A;
1616
//~^ ERROR associated type bindings are not allowed here [E0229]
17-
//~| NOTE associate type not allowed here
17+
//~| NOTE associated type not allowed here
1818
}
1919

2020
fn main() {}

src/test/compile-fail/issue-36379.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
#![feature(conservative_impl_trait, rustc_attrs)]
12+
13+
fn _test() -> impl Default { }
14+
15+
#[rustc_error]
16+
fn main() { } //~ ERROR compilation successful

src/test/compile-fail/issue-37550.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
#![feature(const_fn)]
12+
13+
const fn x() {
14+
let t = true; //~ ERROR blocks in constant functions are limited to items and tail expressions
15+
let x = || t; //~ ERROR blocks in constant functions are limited to items and tail expressions
16+
}
17+
18+
fn main() {}

src/test/compile-fail/issue-37665.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
// compile-flags: -Z unstable-options --unpretty=mir
12+
13+
use std::path::MAIN_SEPARATOR;
14+
15+
fn main() {
16+
let mut foo : String = "hello".to_string();
17+
foo.push(MAIN_SEPARATOR);
18+
println!("{}", foo);
19+
let x: () = 0; //~ ERROR: mismatched types
20+
}

src/test/compile-fail/issue-38160.rs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
#![feature(associated_consts, rustc_attrs)]
12+
#![allow(warnings)]
13+
14+
trait MyTrait {
15+
const MY_CONST: &'static str;
16+
}
17+
18+
macro_rules! my_macro {
19+
() => {
20+
struct MyStruct;
21+
22+
impl MyTrait for MyStruct {
23+
const MY_CONST: &'static str = stringify!(abc);
24+
}
25+
}
26+
}
27+
28+
my_macro!();
29+
30+
#[rustc_error]
31+
fn main() {} //~ ERROR compilation successful

src/test/compile-fail/issue-38954.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
#![feature(rustc_attrs)]
12+
13+
fn _test(ref _p: str) {}
14+
15+
#[rustc_error]
16+
fn main() { } //~ ERROR compilation successful

src/test/compile-fail/issue-39362.rs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
enum Foo {
12+
Bar { bar: Bar, id: usize }
13+
}
14+
15+
enum Bar {
16+
A, B, C, D, E, F
17+
}
18+
19+
fn test(f: Foo) {
20+
match f {
21+
//~^ ERROR non-exhaustive patterns
22+
//~| patterns
23+
Foo::Bar { bar: Bar::A, .. } => (),
24+
Foo::Bar { bar: Bar::B, .. } => (),
25+
}
26+
}
27+
28+
fn main() {}

src/test/run-pass/issue-16671.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
fn foo<F: FnOnce()>(_f: F) { }
1414

1515
fn main() {
16-
let mut var = Vec::new();;
16+
let mut var = Vec::new();
1717
foo(move|| {
1818
var.push(1);
1919
});

0 commit comments

Comments
 (0)