Skip to content

Commit 7ac11ca

Browse files
authored
Auto merge of #35747 - jonathandturner:rollup, r=jonathandturner
Rollup of 23 pull requests - Successful merges: #34370, #35415, #35595, #35610, #35613, #35614, #35621, #35660, #35663, #35670, #35671, #35672, #35681, #35686, #35690, #35695, #35707, #35708, #35713, #35722, #35725, #35726, #35731 - Failed merges: #35395
2 parents 76fa587 + c216617 commit 7ac11ca

Some content is hidden

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

66 files changed

+511
-376
lines changed

mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.12.0
16+
CFG_RELEASE_NUM=1.13.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release

src/doc/book/associated-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ trait Graph {
6767
Simple enough. Associated types use the `type` keyword, and go inside the body
6868
of the trait, with the functions.
6969

70-
These `type` declarations can have all the same thing as functions do. For example,
70+
These type declarations work the same way as those for functions. For example,
7171
if we wanted our `N` type to implement `Display`, so we can print the nodes out,
7272
we could do this:
7373

src/doc/book/closures.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ the result:
262262

263263
```rust
264264
fn call_with_one<F>(some_closure: F) -> i32
265-
where F : Fn(i32) -> i32 {
265+
where F: Fn(i32) -> i32 {
266266

267267
some_closure(1)
268268
}
@@ -279,7 +279,7 @@ Let’s examine the signature of `call_with_one` in more depth:
279279

280280
```rust
281281
fn call_with_one<F>(some_closure: F) -> i32
282-
# where F : Fn(i32) -> i32 {
282+
# where F: Fn(i32) -> i32 {
283283
# some_closure(1) }
284284
```
285285

@@ -288,7 +288,7 @@ isn’t interesting. The next part is:
288288

289289
```rust
290290
# fn call_with_one<F>(some_closure: F) -> i32
291-
where F : Fn(i32) -> i32 {
291+
where F: Fn(i32) -> i32 {
292292
# some_closure(1) }
293293
```
294294

src/doc/book/lang-items.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ fn main(argc: isize, argv: *const *const u8) -> isize {
5757
0
5858
}
5959
60-
#[lang = "eh_personality"] extern fn eh_personality() {}
61-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
60+
#[lang = "eh_personality"] extern fn rust_eh_personality() {}
61+
#[lang = "panic_fmt"] extern fn rust_begin_panic() -> ! { loop {} }
6262
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
6363
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
6464
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -73,8 +73,8 @@ Other features provided by lang items include:
7373
`==`, `<`, dereferencing (`*`) and `+` (etc.) operators are all
7474
marked with lang items; those specific four are `eq`, `ord`,
7575
`deref`, and `add` respectively.
76-
- stack unwinding and general failure; the `eh_personality`, `fail`
77-
and `fail_bounds_checks` lang items.
76+
- stack unwinding and general failure; the `eh_personality`,
77+
`eh_unwind_resume`, `fail` and `fail_bounds_checks` lang items.
7878
- the traits in `std::marker` used to indicate types of
7979
various kinds; lang items `send`, `sync` and `copy`.
8080
- the marker types and variance indicators found in

src/doc/book/no-stdlib.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
5555
// provided by libstd.
5656
#[lang = "eh_personality"]
5757
#[no_mangle]
58-
pub extern fn eh_personality() {
58+
pub extern fn rust_eh_personality() {
59+
}
60+
61+
// This function may be needed based on the compilation target.
62+
#[lang = "eh_unwind_resume"]
63+
#[no_mangle]
64+
pub extern fn rust_eh_unwind_resume() {
5965
}
6066
6167
#[lang = "panic_fmt"]
@@ -87,12 +93,18 @@ pub extern fn main(_argc: i32, _argv: *const *const u8) -> i32 {
8793
0
8894
}
8995
90-
// These functions and traits are used by the compiler, but not
96+
// These functions are used by the compiler, but not
9197
// for a bare-bones hello world. These are normally
9298
// provided by libstd.
9399
#[lang = "eh_personality"]
94100
#[no_mangle]
95-
pub extern fn eh_personality() {
101+
pub extern fn rust_eh_personality() {
102+
}
103+
104+
// This function may be needed based on the compilation target.
105+
#[lang = "eh_unwind_resume"]
106+
#[no_mangle]
107+
pub extern fn rust_eh_unwind_resume() {
96108
}
97109
98110
#[lang = "panic_fmt"]
@@ -104,23 +116,28 @@ pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
104116
}
105117
```
106118

107-
## More about the langauge items
119+
## More about the language items
108120

109121
The compiler currently makes a few assumptions about symbols which are
110122
available in the executable to call. Normally these functions are provided by
111123
the standard library, but without it you must define your own. These symbols
112124
are called "language items", and they each have an internal name, and then a
113125
signature that an implementation must conform to.
114126

115-
The first of these two functions, `eh_personality`, is used by the failure
127+
The first of these functions, `rust_eh_personality`, is used by the failure
116128
mechanisms of the compiler. This is often mapped to GCC's personality function
117129
(see the [libstd implementation][unwind] for more information), but crates
118130
which do not trigger a panic can be assured that this function is never
119-
called. Both the language item and the symbol name are `eh_personality`.
120-
131+
called. The language item's name is `eh_personality`.
132+
121133
[unwind]: https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/gcc.rs
122134

123-
The second function, `panic_fmt`, is also used by the failure mechanisms of the
135+
The second function, `rust_begin_panic`, is also used by the failure mechanisms of the
124136
compiler. When a panic happens, this controls the message that's displayed on
125137
the screen. While the language item's name is `panic_fmt`, the symbol name is
126138
`rust_begin_panic`.
139+
140+
A third function, `rust_eh_unwind_resume`, is also needed if the `custom_unwind_resume`
141+
flag is set in the options of the compilation target. It allows customizing the
142+
process of resuming unwind at the end of the landing pads. The language item's name
143+
is `eh_unwind_resume`.

src/doc/grammar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ token : simple_token | ident | literal | symbol | whitespace token ;
172172
Each of these keywords has special meaning in its grammar, and all of them are
173173
excluded from the `ident` rule.
174174

175+
Not all of these keywords are used by the language. Some of them were used
176+
before Rust 1.0, and were left reserved once their implementations were
177+
removed. Some of them were reserved before 1.0 to make space for possible
178+
future features.
179+
175180
### Literals
176181

177182
```antlr

src/libcollections/vec.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,15 @@ pub struct IntoIter<T> {
17151715
end: *const T,
17161716
}
17171717

1718+
#[stable(feature = "vec_intoiter_debug", since = "")]
1719+
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
1720+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1721+
f.debug_tuple("IntoIter")
1722+
.field(&self.as_slice())
1723+
.finish()
1724+
}
1725+
}
1726+
17181727
impl<T> IntoIter<T> {
17191728
/// Returns the remaining items of this iterator as a slice.
17201729
///

src/libcollectionstest/vec.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,14 @@ fn test_into_iter_as_mut_slice() {
501501
assert_eq!(into_iter.as_slice(), &['y', 'c']);
502502
}
503503

504+
#[test]
505+
fn test_into_iter_debug() {
506+
let vec = vec!['a', 'b', 'c'];
507+
let into_iter = vec.into_iter();
508+
let debug = format!("{:?}", into_iter);
509+
assert_eq!(debug, "IntoIter(['a', 'b', 'c'])");
510+
}
511+
504512
#[test]
505513
fn test_into_iter_count() {
506514
assert_eq!(vec![1, 2, 3].into_iter().count(), 3);

src/libcore/iter/range.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -295,20 +295,8 @@ impl<A: Step> ops::Range<A> {
295295
///
296296
/// ```
297297
/// #![feature(step_by)]
298-
///
299-
/// for i in (0..10).step_by(2) {
300-
/// println!("{}", i);
301-
/// }
302-
/// ```
303-
///
304-
/// This prints:
305-
///
306-
/// ```text
307-
/// 0
308-
/// 2
309-
/// 4
310-
/// 6
311-
/// 8
298+
/// let result: Vec<_> = (0..10).step_by(2).collect();
299+
/// assert_eq!(result, vec![0, 2, 4, 6, 8]);
312300
/// ```
313301
#[unstable(feature = "step_by", reason = "recent addition",
314302
issue = "27741")]
@@ -650,4 +638,3 @@ impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> where
650638
n
651639
}
652640
}
653-

src/libcore/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
//! line. It is up to consumers of this core library to define this panic
4343
//! function; it is only required to never return. This requires a `lang`
4444
//! attribute named `panic_fmt`.
45+
//!
46+
//! * `rust_eh_personality` - is used by the failure mechanisms of the
47+
//! compiler. This is often mapped to GCC's personality function, but crates
48+
//! which do not trigger a panic can be assured that this function is never
49+
//! called. The `lang` attribute is called `eh_personality`.
4550
4651
// Since libcore defines many fundamental lang items, all tests live in a
4752
// separate crate, libcoretest, to avoid bizarre issues.

0 commit comments

Comments
 (0)