Skip to content

Commit e619caf

Browse files
committed
Auto merge of #79091 - pietroalbini:stable-next, r=pietroalbini
Rust 1.48.0 stable release This PR bumps the 1.48 beta branch to the 1.48 stable branch, and applies these last minute backports: * #77939 - Ensure that the source code display is working with DOS backline * #77508 - Fix capitalization in blog post name * #78559 - Add LLVM upgrades from 7 to 10 to RELEASES.md * #78364 - Update RELEASES.md for 1.48.0 r? `@ghost` cc `@rust-lang/release`
2 parents 8236dc0 + e82b677 commit e619caf

File tree

5 files changed

+178
-14
lines changed

5 files changed

+178
-14
lines changed

RELEASES.md

+150-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,143 @@
1+
Version 1.48.0 (2020-11-19)
2+
==========================
3+
4+
Language
5+
--------
6+
7+
- [The `unsafe` keyword is now syntactically permitted on modules.][75857] This
8+
is still rejected *semantically*, but can now be parsed by procedural macros.
9+
10+
Compiler
11+
--------
12+
- [Stabilised the `-C link-self-contained=<yes|no>` compiler flag.][76158] This tells
13+
`rustc` whether to link its own C runtime and libraries or to rely on a external
14+
linker to find them. (Supported only on `windows-gnu`, `linux-musl`, and `wasi` platforms.)
15+
- [You can now use `-C target-feature=+crt-static` on `linux-gnu` targets.][77386]
16+
Note: If you're using cargo you must explicitly pass the `--target` flag.
17+
- [Added tier 2\* support for `aarch64-unknown-linux-musl`.][76420]
18+
19+
\* Refer to Rust's [platform support page][forge-platform-support] for more
20+
information on Rust's tiered platform support.
21+
22+
Libraries
23+
---------
24+
- [`io::Write` is now implemented for `&ChildStdin` `&Sink`, `&Stdout`,
25+
and `&Stderr`.][76275]
26+
- [All arrays of any length now implement `TryFrom<Vec<T>>`.][76310]
27+
- [The `matches!` macro now supports having a trailing comma.][74880]
28+
- [`Vec<A>` now implements `PartialEq<[B]>` where `A: PartialEq<B>`.][74194]
29+
- [The `RefCell::{replace, replace_with, clone}` methods now all use `#[track_caller]`.][77055]
30+
31+
Stabilized APIs
32+
---------------
33+
- [`slice::as_ptr_range`]
34+
- [`slice::as_mut_ptr_range`]
35+
- [`VecDeque::make_contiguous`]
36+
- [`future::pending`]
37+
- [`future::ready`]
38+
39+
The following previously stable methods are now `const fn`'s:
40+
41+
- [`Option::is_some`]
42+
- [`Option::is_none`]
43+
- [`Option::as_ref`]
44+
- [`Result::is_ok`]
45+
- [`Result::is_err`]
46+
- [`Result::as_ref`]
47+
- [`Ordering::reverse`]
48+
- [`Ordering::then`]
49+
50+
Cargo
51+
-----
52+
53+
Rustdoc
54+
-------
55+
- [You can now link to items in `rustdoc` using the intra-doc link
56+
syntax.][74430] E.g. ``/// Uses [`std::future`]`` will automatically generate
57+
a link to `std::future`'s documentation. See ["Linking to items by
58+
name"][intradoc-links] for more information.
59+
- [You can now specify `#[doc(alias = "<alias>")]` on items to add search aliases
60+
when searching through `rustdoc`'s UI.][75740]
61+
62+
Compatibility Notes
63+
-------------------
64+
- [Promotion of references to `'static` lifetime inside `const fn` now follows the
65+
same rules as inside a `fn` body.][75502] In particular, `&foo()` will not be
66+
promoted to `'static` lifetime any more inside `const fn`s.
67+
- [Associated type bindings on trait objects are now verified to meet the bounds
68+
declared on the trait when checking that they implement the trait.][27675]
69+
- [When trait bounds on associated types or opaque types are ambiguous, the
70+
compiler no longer makes an arbitrary choice on which bound to use.][54121]
71+
- [Fixed recursive nonterminals not being expanded in macros during
72+
pretty-print/reparse check.][77153] This may cause errors if your macro wasn't
73+
correctly handling recursive nonterminal tokens.
74+
- [`&mut` references to non zero-sized types are no longer promoted.][75585]
75+
- [`rustc` will now warn if you use attributes like `#[link_name]` or `#[cold]`
76+
in places where they have no effect.][73461]
77+
- [Updated `_mm256_extract_epi8` and `_mm256_extract_epi16` signatures in
78+
`arch::{x86, x86_64}` to return `i32` to match the vendor signatures.][73166]
79+
- [`mem::uninitialized` will now panic if any inner types inside a struct or enum
80+
disallow zero-initialization.][71274]
81+
- [`#[target_feature]` will now error if used in a place where it has no effect.][78143]
82+
- [Foreign exceptions are now caught by `catch_unwind` and will cause an abort.][70212]
83+
Note: This behaviour is not guaranteed and is still considered undefined behaviour,
84+
see the [`catch_unwind`] documentation for further information.
85+
86+
87+
88+
Internal Only
89+
-------------
90+
These changes provide no direct user facing benefits, but represent significant
91+
improvements to the internals and overall performance of rustc and
92+
related tools.
93+
94+
- [Building `rustc` from source now uses `ninja` by default over `make`.][74922]
95+
You can continue building with `make` by setting `ninja=false` in
96+
your `config.toml`.
97+
- [cg_llvm: `fewer_names` in `uncached_llvm_type`][76030]
98+
- [Made `ensure_sufficient_stack()` non-generic][76680]
99+
100+
[78143]: https://github.com/rust-lang/rust/issues/78143
101+
[76680]: https://github.com/rust-lang/rust/pull/76680/
102+
[76030]: https://github.com/rust-lang/rust/pull/76030/
103+
[70212]: https://github.com/rust-lang/rust/pull/70212/
104+
[27675]: https://github.com/rust-lang/rust/issues/27675/
105+
[54121]: https://github.com/rust-lang/rust/issues/54121/
106+
[71274]: https://github.com/rust-lang/rust/pull/71274/
107+
[77386]: https://github.com/rust-lang/rust/pull/77386/
108+
[77153]: https://github.com/rust-lang/rust/pull/77153/
109+
[77055]: https://github.com/rust-lang/rust/pull/77055/
110+
[76275]: https://github.com/rust-lang/rust/pull/76275/
111+
[76310]: https://github.com/rust-lang/rust/pull/76310/
112+
[76420]: https://github.com/rust-lang/rust/pull/76420/
113+
[76158]: https://github.com/rust-lang/rust/pull/76158/
114+
[75857]: https://github.com/rust-lang/rust/pull/75857/
115+
[75585]: https://github.com/rust-lang/rust/pull/75585/
116+
[75740]: https://github.com/rust-lang/rust/pull/75740/
117+
[75502]: https://github.com/rust-lang/rust/pull/75502/
118+
[74880]: https://github.com/rust-lang/rust/pull/74880/
119+
[74922]: https://github.com/rust-lang/rust/pull/74922/
120+
[74430]: https://github.com/rust-lang/rust/pull/74430/
121+
[74194]: https://github.com/rust-lang/rust/pull/74194/
122+
[73461]: https://github.com/rust-lang/rust/pull/73461/
123+
[73166]: https://github.com/rust-lang/rust/pull/73166/
124+
[intradoc-links]: https://doc.rust-lang.org/rustdoc/linking-to-items-by-name.html
125+
[`catch_unwind`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html
126+
[`Option::is_some`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some
127+
[`Option::is_none`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_none
128+
[`Option::as_ref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref
129+
[`Result::is_ok`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_ok
130+
[`Result::is_err`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_err
131+
[`Result::as_ref`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.as_ref
132+
[`Ordering::reverse`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.reverse
133+
[`Ordering::then`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then
134+
[`slice::as_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_ptr_range
135+
[`slice::as_mut_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_mut_ptr_range
136+
[`VecDeque::make_contiguous`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.make_contiguous
137+
[`future::pending`]: https://doc.rust-lang.org/std/future/fn.pending.html
138+
[`future::ready`]: https://doc.rust-lang.org/std/future/fn.ready.html
139+
140+
1141
Version 1.47.0 (2020-10-08)
2142
==========================
3143

@@ -90,7 +230,8 @@ Compatibility Notes
90230

91231
Internal Only
92232
--------
93-
- [Improved default settings for bootstrapping in `x.py`.][73964] You can read details about this change in the ["Changes To `x.py` Defaults"](https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html) post on the Inside Rust blog.
233+
234+
- [Improved default settings for bootstrapping in `x.py`.][73964] You can read details about this change in the ["Changes to `x.py` defaults"](https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html) post on the Inside Rust blog.
94235

95236
[1.47.0-cfg]: https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
96237
[75048]: https://github.com/rust-lang/rust/pull/75048/
@@ -297,6 +438,7 @@ Compiler
297438
- [Added the `tiny` value to the `code-model` codegen flag.][72397]
298439
- [Added tier 3 support\* for the `mipsel-sony-psp` target.][72062]
299440
- [Added tier 3 support for the `thumbv7a-uwp-windows-msvc` target.][72133]
441+
- [Upgraded to LLVM 10.][67759]
300442

301443
\* Refer to Rust's [platform support page][forge-platform-support] for more
302444
information on Rust's tiered platform support.
@@ -396,6 +538,7 @@ Internals Only
396538
[72062]: https://github.com/rust-lang/rust/pull/72062/
397539
[72094]: https://github.com/rust-lang/rust/pull/72094/
398540
[72133]: https://github.com/rust-lang/rust/pull/72133/
541+
[67759]: https://github.com/rust-lang/rust/pull/67759/
399542
[71900]: https://github.com/rust-lang/rust/pull/71900/
400543
[71928]: https://github.com/rust-lang/rust/pull/71928/
401544
[71662]: https://github.com/rust-lang/rust/pull/71662/
@@ -1270,6 +1413,7 @@ Compiler
12701413
`armv7-unknown-linux-musleabi` targets.][63107]
12711414
- [Added tier 3 support for the `hexagon-unknown-linux-musl` target.][62814]
12721415
- [Added tier 3 support for the `riscv32i-unknown-none-elf` target.][62784]
1416+
- [Upgraded to LLVM 9.][62592]
12731417

12741418
\* Refer to Rust's [platform support page][forge-platform-support] for more
12751419
information on Rust's tiered platform support.
@@ -1336,6 +1480,7 @@ Compatibility Notes
13361480
[62735]: https://github.com/rust-lang/rust/pull/62735/
13371481
[62766]: https://github.com/rust-lang/rust/pull/62766/
13381482
[62784]: https://github.com/rust-lang/rust/pull/62784/
1483+
[62592]: https://github.com/rust-lang/rust/pull/62592/
13391484
[62785]: https://github.com/rust-lang/rust/issues/62785/
13401485
[62814]: https://github.com/rust-lang/rust/pull/62814/
13411486
[62896]: https://github.com/rust-lang/rust/issues/62896/
@@ -2431,6 +2576,7 @@ Compiler
24312576
--------
24322577
- [Added the `riscv32imc-unknown-none-elf` target.][53822]
24332578
- [Added the `aarch64-unknown-netbsd` target][53165]
2579+
- [Upgraded to LLVM 8.][53611]
24342580

24352581
Libraries
24362582
---------
@@ -2479,6 +2625,7 @@ Misc
24792625
[53033]: https://github.com/rust-lang/rust/pull/53033/
24802626
[53044]: https://github.com/rust-lang/rust/pull/53044/
24812627
[53165]: https://github.com/rust-lang/rust/pull/53165/
2628+
[53611]: https://github.com/rust-lang/rust/pull/53611/
24822629
[53213]: https://github.com/rust-lang/rust/pull/53213/
24832630
[53236]: https://github.com/rust-lang/rust/pull/53236/
24842631
[53272]: https://github.com/rust-lang/rust/pull/53272/
@@ -2537,6 +2684,7 @@ Compiler
25372684
- [Bumped minimum LLVM version to 5.0.][51899]
25382685
- [Added `powerpc64le-unknown-linux-musl` target.][51619]
25392686
- [Added `aarch64-unknown-hermit` and `x86_64-unknown-hermit` targets.][52861]
2687+
- [Upgraded to LLVM 7.][51966]
25402688

25412689
Libraries
25422690
---------
@@ -2588,6 +2736,7 @@ Compatibility Notes
25882736

25892737
[53893]: https://github.com/rust-lang/rust/pull/53893/
25902738
[52861]: https://github.com/rust-lang/rust/pull/52861/
2739+
[51966]: https://github.com/rust-lang/rust/pull/51966/
25912740
[52656]: https://github.com/rust-lang/rust/pull/52656/
25922741
[52239]: https://github.com/rust-lang/rust/pull/52239/
25932742
[52330]: https://github.com/rust-lang/rust/pull/52330/

src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fi
6363
#
6464
# FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
6565
# either automatically or manually.
66-
export RUST_RELEASE_CHANNEL=beta
66+
export RUST_RELEASE_CHANNEL=stable
6767

6868
# Always set the release channel for bootstrap; this is normally not important (i.e., only dist
6969
# builds would seem to matter) but in practice bootstrap wants to know whether we're targeting

src/librustdoc/html/highlight.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ fn write_header(out: &mut String, class: Option<&str>) {
4646
}
4747

4848
fn write_code(out: &mut String, src: &str) {
49-
Classifier::new(src).highlight(&mut |highlight| {
49+
// This replace allows to fix how the code source with DOS backline characters is displayed.
50+
let src = src.replace("\r\n", "\n");
51+
Classifier::new(&src).highlight(&mut |highlight| {
5052
match highlight {
5153
Highlight::Token { text, class } => string(out, Escape(text), class),
5254
Highlight::EnterSpan { class } => enter_span(out, class),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">foo</span>() {
2+
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;foo&quot;</span>);
3+
}
+21-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
use super::write_code;
22
use expect_test::expect_file;
33

4-
#[test]
5-
fn test_html_highlighting() {
6-
let src = include_str!("fixtures/sample.rs");
7-
let html = {
8-
let mut out = String::new();
9-
write_code(&mut out, src);
10-
format!("{}<pre><code>{}</code></pre>\n", STYLE, out)
11-
};
12-
expect_file!["fixtures/sample.html"].assert_eq(&html);
13-
}
14-
154
const STYLE: &str = r#"
165
<style>
176
.kw { color: #8959A8; }
@@ -23,3 +12,24 @@ const STYLE: &str = r#"
2312
.question-mark { color: #ff9011; }
2413
</style>
2514
"#;
15+
16+
#[test]
17+
fn test_html_highlighting() {
18+
let src = include_str!("fixtures/sample.rs");
19+
let html = {
20+
let mut out = String::new();
21+
write_code(&mut out, src);
22+
format!("{}<pre><code>{}</code></pre>\n", STYLE, out)
23+
};
24+
expect_file!["fixtures/sample.html"].assert_eq(&html);
25+
}
26+
27+
#[test]
28+
fn test_dos_backline() {
29+
let src = "pub fn foo() {\r\n\
30+
println!(\"foo\");\r\n\
31+
}\r\n";
32+
let mut html = String::new();
33+
write_code(&mut html, src);
34+
expect_file!["fixtures/dos_line.html"].assert_eq(&html);
35+
}

0 commit comments

Comments
 (0)