Skip to content

Commit 1ce08f9

Browse files
committed
Auto merge of rust-lang#68351 - Centril:rollup-0gzuh0p, r=Centril
Rollup of 5 pull requests Successful merges: - rust-lang#67712 (Stabilize `#![feature(slice_patterns)]` in 1.42.0) - rust-lang#68224 (Prevent urls in headings) - rust-lang#68340 (clean up e0200 explanation) - rust-lang#68341 (Fix syscalls tables in docs of std::time.) - rust-lang#68342 (improve type_name_of_val docs) Failed merges: r? @ghost
2 parents 779f85b + e8819b6 commit 1ce08f9

File tree

147 files changed

+432
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+432
-678
lines changed

src/doc/unstable-book/src/language-features/slice-patterns.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/libcore/any.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,15 @@ pub const fn type_name<T: ?Sized>() -> &'static str {
476476
///
477477
/// This is intended for diagnostic use. The exact contents and format of the
478478
/// string are not specified, other than being a best-effort description of the
479-
/// type. For example, `type_name_of::<Option<String>>(None)` could return
479+
/// type. For example, `type_name_of_val::<Option<String>>(None)` could return
480480
/// `"Option<String>"` or `"std::option::Option<std::string::String>"`, but not
481481
/// `"foobar"`. In addition, the output may change between versions of the
482482
/// compiler.
483483
///
484+
/// This function does not resolve trait objects,
485+
/// meaning that `type_name_of_val(&7u32 as &dyn Debug)`
486+
/// may return `"dyn Debug"`, but not `"u32"`.
487+
///
484488
/// The type name should not be considered a unique identifier of a type;
485489
/// multiple types may share the same type name.
486490
///

src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
#![feature(associated_type_bounds)]
134134
#![feature(const_type_id)]
135135
#![feature(const_caller_location)]
136-
#![feature(slice_patterns)]
136+
#![cfg_attr(bootstrap, feature(slice_patterns))]
137137

138138
#[prelude_import]
139139
#[allow(unused)]

src/libcore/tests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#![feature(range_is_empty)]
2020
#![feature(raw)]
2121
#![feature(saturating_neg)]
22-
#![feature(slice_patterns)]
22+
#![cfg_attr(bootstrap, feature(slice_patterns))]
2323
#![feature(sort_internals)]
2424
#![feature(slice_partition_at_index)]
2525
#![feature(specialization)]

src/librustc/benches/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(slice_patterns)]
1+
#![cfg_attr(bootstrap, feature(slice_patterns))]
22
#![feature(test)]
33

44
extern crate test;

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#![feature(optin_builtin_traits)]
4343
#![feature(option_expect_none)]
4444
#![feature(range_is_empty)]
45-
#![feature(slice_patterns)]
45+
#![cfg_attr(bootstrap, feature(slice_patterns))]
4646
#![feature(specialization)]
4747
#![feature(unboxed_closures)]
4848
#![feature(thread_local)]

src/librustc_ast_passes/feature_gate.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -470,29 +470,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
470470
visit::walk_expr(self, e)
471471
}
472472

473-
fn visit_arm(&mut self, arm: &'a ast::Arm) {
474-
visit::walk_arm(self, arm)
475-
}
476-
477473
fn visit_pat(&mut self, pattern: &'a ast::Pat) {
478474
match &pattern.kind {
479-
PatKind::Slice(pats) => {
480-
for pat in &*pats {
481-
let span = pat.span;
482-
let inner_pat = match &pat.kind {
483-
PatKind::Ident(.., Some(pat)) => pat,
484-
_ => pat,
485-
};
486-
if inner_pat.is_rest() {
487-
gate_feature_post!(
488-
&self,
489-
slice_patterns,
490-
span,
491-
"subslice patterns are unstable"
492-
);
493-
}
494-
}
495-
}
496475
PatKind::Box(..) => {
497476
gate_feature_post!(
498477
&self,

src/librustc_ast_passes/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! parsed by `rustc_parse` and then lowered, after the passes in this crate,
33
//! by `rustc_ast_lowering`.
44
5-
#![feature(slice_patterns)]
5+
#![cfg_attr(bootstrap, feature(slice_patterns))]
66

77
pub mod ast_validation;
88
pub mod feature_gate;

src/librustc_codegen_ssa/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(box_syntax)]
55
#![feature(core_intrinsics)]
66
#![feature(libc)]
7-
#![feature(slice_patterns)]
7+
#![cfg_attr(bootstrap, feature(slice_patterns))]
88
#![feature(stmt_expr_attributes)]
99
#![feature(try_blocks)]
1010
#![feature(in_band_lifetimes)]
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
An unsafe trait was implemented without an unsafe implementation.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0200
6+
struct Foo;
7+
8+
unsafe trait Bar { }
9+
10+
impl Bar for Foo { } // error!
11+
```
12+
113
Unsafe traits must have unsafe implementations. This error occurs when an
214
implementation for an unsafe trait isn't marked as unsafe. This may be resolved
315
by marking the unsafe implementation as unsafe.
416

5-
```compile_fail,E0200
17+
```
618
struct Foo;
719
820
unsafe trait Bar { }
921
10-
// this won't compile because Bar is unsafe and impl isn't unsafe
11-
impl Bar for Foo { }
12-
// this will compile
13-
unsafe impl Bar for Foo { }
22+
unsafe impl Bar for Foo { } // ok!
1423
```

0 commit comments

Comments
 (0)