Skip to content

Commit 49cae55

Browse files
committed
Auto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.44 release This includes a release notes update as usual and a backport of #72767. r? @ghost
2 parents 02c25b3 + 68a0acd commit 49cae55

File tree

16 files changed

+293
-42
lines changed

16 files changed

+293
-42
lines changed

RELEASES.md

+162
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,165 @@
1+
Version 1.44.0 (2020-06-04)
2+
==========================
3+
4+
Language
5+
--------
6+
- [You can now use `async/.await` with `#[no_std]` enabled.][69033]
7+
- [Added the `unused_braces` lint.][70081]
8+
9+
**Syntax-only changes**
10+
11+
- [Expansion-driven outline module parsing][69838]
12+
```rust
13+
#[cfg(FALSE)]
14+
mod foo {
15+
mod bar {
16+
mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
17+
}
18+
}
19+
```
20+
21+
These are still rejected semantically, so you will likely receive an error but
22+
these changes can be seen and parsed by macros and conditional compilation.
23+
24+
Compiler
25+
--------
26+
- [Rustc now respects the `-C codegen-units` flag in incremental mode.][70156]
27+
Additionally when in incremental mode rustc defaults to 256 codegen units.
28+
- [Refactored `catch_unwind`, to have zero-cost unless unwinding is enabled and
29+
a panic is thrown.][67502]
30+
- [Added tier 3\* support for the `aarch64-unknown-none` and
31+
`aarch64-unknown-none-softfloat` targets.][68334]
32+
- [Added tier 3 support for `arm64-apple-tvos` and
33+
`x86_64-apple-tvos` targets.][68191]
34+
35+
36+
Libraries
37+
---------
38+
- [Special cased `vec![]` to map directly to `Vec::new()`.][70632] This allows
39+
`vec![]` to be able to be used in `const` contexts.
40+
- [`convert::Infallible` now implements `Hash`.][70281]
41+
- [`OsString` now implements `DerefMut` and `IndexMut` returning
42+
a `&mut OsStr`.][70048]
43+
- [Unicode 13 is now supported.][69929]
44+
- [`String` now implements `From<&mut str>`.][69661]
45+
- [`IoSlice` now implements `Copy`.][69403]
46+
- [`Vec<T>` now implements `From<[T; N]>`.][68692] Where `N` is less than 32.
47+
- [`proc_macro::LexError` now implements `fmt::Display` and `Error`.][68899]
48+
- [`from_le_bytes`, `to_le_bytes`, `from_be_bytes`, `to_be_bytes`,
49+
`from_ne_bytes`, and `to_ne_bytes` methods are now `const` for all
50+
integer types.][69373]
51+
52+
Stabilized APIs
53+
---------------
54+
- [`PathBuf::with_capacity`]
55+
- [`PathBuf::capacity`]
56+
- [`PathBuf::clear`]
57+
- [`PathBuf::reserve`]
58+
- [`PathBuf::reserve_exact`]
59+
- [`PathBuf::shrink_to_fit`]
60+
- [`f32::to_int_unchecked`]
61+
- [`f64::to_int_unchecked`]
62+
- [`Layout::align_to`]
63+
- [`Layout::pad_to_align`]
64+
- [`Layout::array`]
65+
- [`Layout::extend`]
66+
67+
Cargo
68+
-----
69+
- [Added the `cargo tree` command which will print a tree graph of
70+
your dependencies.][cargo/8062] E.g.
71+
```
72+
mdbook v0.3.2 (/Users/src/rust/mdbook)
73+
├── ammonia v3.0.0
74+
│ ├── html5ever v0.24.0
75+
│ │ ├── log v0.4.8
76+
│ │ │ └── cfg-if v0.1.9
77+
│ │ ├── mac v0.1.1
78+
│ │ └── markup5ever v0.9.0
79+
│ │ ├── log v0.4.8 (*)
80+
│ │ ├── phf v0.7.24
81+
│ │ │ └── phf_shared v0.7.24
82+
│ │ │ ├── siphasher v0.2.3
83+
│ │ │ └── unicase v1.4.2
84+
│ │ │ [build-dependencies]
85+
│ │ │ └── version_check v0.1.5
86+
...
87+
```
88+
You can also display dependencies on multiple versions of the same crate with
89+
`cargo tree -d` (short for `cargo tree --duplicates`).
90+
91+
Misc
92+
----
93+
- [Rustdoc now allows you to specify `--crate-version` to have rustdoc include
94+
the version in the sidebar.][69494]
95+
96+
Compatibility Notes
97+
-------------------
98+
- [Rustc now correctly generates static libraries on Windows GNU targets with
99+
the `.a` extension, rather than the previous `.lib`.][70937]
100+
- [Removed the `-C no_integrated_as` flag from rustc.][70345]
101+
- [The `file_name` property in JSON output of macro errors now points the actual
102+
source file rather than the previous format of `<NAME macros>`.][70969]
103+
**Note:** this may not point a file that actually exists on the user's system.
104+
- [The minimum required external LLVM version has been bumped to LLVM 8.][71147]
105+
- [`mem::{zeroed, uninitialised}` will now panic when used with types that do
106+
not allow zero initialization such as `NonZeroU8`.][66059] This was
107+
previously a warning.
108+
- [In 1.45.0 (the next release) converting a `f64` to `u32` using the `as`
109+
operator has been defined as a saturating operation.][71269] This was previously
110+
undefined behaviour, you can use the `{f64, f32}::to_int_unchecked` methods to
111+
continue using the current behaviour which may desirable in rare performance
112+
sensitive situations.
113+
114+
Internal Only
115+
-------------
116+
These changes provide no direct user facing benefits, but represent significant
117+
improvements to the internals and overall performance of rustc and
118+
related tools.
119+
120+
- [dep_graph Avoid allocating a set on when the number reads are small.][69778]
121+
- [Replace big JS dict with JSON parsing.][71250]
122+
123+
[69373]: https://github.com/rust-lang/rust/pull/69373/
124+
[66059]: https://github.com/rust-lang/rust/pull/66059/
125+
[68191]: https://github.com/rust-lang/rust/pull/68191/
126+
[68899]: https://github.com/rust-lang/rust/pull/68899/
127+
[71147]: https://github.com/rust-lang/rust/pull/71147/
128+
[71250]: https://github.com/rust-lang/rust/pull/71250/
129+
[70937]: https://github.com/rust-lang/rust/pull/70937/
130+
[70969]: https://github.com/rust-lang/rust/pull/70969/
131+
[70632]: https://github.com/rust-lang/rust/pull/70632/
132+
[70281]: https://github.com/rust-lang/rust/pull/70281/
133+
[70345]: https://github.com/rust-lang/rust/pull/70345/
134+
[70048]: https://github.com/rust-lang/rust/pull/70048/
135+
[70081]: https://github.com/rust-lang/rust/pull/70081/
136+
[70156]: https://github.com/rust-lang/rust/pull/70156/
137+
[71269]: https://github.com/rust-lang/rust/pull/71269/
138+
[69838]: https://github.com/rust-lang/rust/pull/69838/
139+
[69929]: https://github.com/rust-lang/rust/pull/69929/
140+
[69661]: https://github.com/rust-lang/rust/pull/69661/
141+
[69778]: https://github.com/rust-lang/rust/pull/69778/
142+
[69494]: https://github.com/rust-lang/rust/pull/69494/
143+
[69403]: https://github.com/rust-lang/rust/pull/69403/
144+
[69033]: https://github.com/rust-lang/rust/pull/69033/
145+
[68692]: https://github.com/rust-lang/rust/pull/68692/
146+
[68334]: https://github.com/rust-lang/rust/pull/68334/
147+
[67502]: https://github.com/rust-lang/rust/pull/67502/
148+
[cargo/8062]: https://github.com/rust-lang/cargo/pull/8062/
149+
[`PathBuf::with_capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.with_capacity
150+
[`PathBuf::capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.capacity
151+
[`PathBuf::clear`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.clear
152+
[`PathBuf::reserve`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve
153+
[`PathBuf::reserve_exact`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve_exact
154+
[`PathBuf::shrink_to_fit`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.shrink_to_fit
155+
[`f32::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked
156+
[`f64::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked
157+
[`Layout::align_to`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.align_to
158+
[`Layout::pad_to_align`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.pad_to_align
159+
[`Layout::array`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.array
160+
[`Layout::extend`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.extend
161+
162+
1163
Version 1.43.1 (2020-05-07)
2164
===========================
3165

src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fi
5151
#
5252
# FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
5353
# either automatically or manually.
54-
export RUST_RELEASE_CHANNEL=beta
54+
export RUST_RELEASE_CHANNEL=stable
5555

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

src/librustc_expand/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ impl<'a> ExtCtxt<'a> {
10861086
if !path.is_absolute() {
10871087
let callsite = span.source_callsite();
10881088
let mut result = match self.source_map().span_to_unmapped_path(callsite) {
1089-
FileName::Real(path) => path,
1089+
FileName::Real(name) => name.into_local_path(),
10901090
FileName::DocTest(path, _) => path,
10911091
other => {
10921092
return Err(self.struct_span_err(

src/librustc_expand/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
340340
let mut module = ModuleData {
341341
mod_path: vec![Ident::from_str(&self.cx.ecfg.crate_name)],
342342
directory: match self.cx.source_map().span_to_unmapped_path(krate.span) {
343-
FileName::Real(path) => path,
343+
FileName::Real(name) => name.into_local_path(),
344344
other => PathBuf::from(other.to_string()),
345345
},
346346
};

src/librustc_expand/module.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ crate fn parse_external_mod(
7171
// Extract the directory path for submodules of `module`.
7272
let path = sess.source_map().span_to_unmapped_path(module.inner);
7373
let mut path = match path {
74-
FileName::Real(path) => path,
74+
FileName::Real(name) => name.into_local_path(),
7575
other => PathBuf::from(other.to_string()),
7676
};
7777
path.pop();
@@ -189,7 +189,8 @@ fn error_cannot_declare_mod_here<'a, T>(
189189
let mut err =
190190
sess.span_diagnostic.struct_span_err(span, "cannot declare a new module at this location");
191191
if !span.is_dummy() {
192-
if let FileName::Real(src_path) = sess.source_map().span_to_filename(span) {
192+
if let FileName::Real(src_name) = sess.source_map().span_to_filename(span) {
193+
let src_path = src_name.into_local_path();
193194
if let Some(stem) = src_path.file_stem() {
194195
let mut dest_path = src_path.clone();
195196
dest_path.set_file_name(stem);

src/librustc_expand/proc_macro_server.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ impl server::SourceFile for Rustc<'_> {
596596
}
597597
fn path(&mut self, file: &Self::SourceFile) -> String {
598598
match file.name {
599-
FileName::Real(ref path) => path
599+
FileName::Real(ref name) => name
600+
.local_path()
600601
.to_str()
601602
.expect("non-UTF8 file path in `proc_macro::SourceFile::path`")
602603
.to_string(),

src/librustc_interface/passes.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use rustc_session::output::{filename_for_input, filename_for_metadata};
3535
use rustc_session::search_paths::PathKind;
3636
use rustc_session::Session;
3737
use rustc_span::symbol::Symbol;
38-
use rustc_span::FileName;
38+
use rustc_span::{FileName, RealFileName};
3939
use rustc_trait_selection::traits;
4040
use rustc_typeck as typeck;
4141

@@ -570,13 +570,16 @@ fn write_out_deps(
570570
for cnum in resolver.cstore().crates_untracked() {
571571
let source = resolver.cstore().crate_source_untracked(cnum);
572572
if let Some((path, _)) = source.dylib {
573-
files.push(escape_dep_filename(&FileName::Real(path)));
573+
let file_name = FileName::Real(RealFileName::Named(path));
574+
files.push(escape_dep_filename(&file_name));
574575
}
575576
if let Some((path, _)) = source.rlib {
576-
files.push(escape_dep_filename(&FileName::Real(path)));
577+
let file_name = FileName::Real(RealFileName::Named(path));
578+
files.push(escape_dep_filename(&file_name));
577579
}
578580
if let Some((path, _)) = source.rmeta {
579-
files.push(escape_dep_filename(&FileName::Real(path)));
581+
let file_name = FileName::Real(RealFileName::Named(path));
582+
files.push(escape_dep_filename(&file_name));
580583
}
581584
}
582585
});

src/librustc_metadata/rmeta/decoder.rs

+16-9
Original file line numberDiff line numberDiff line change
@@ -1485,15 +1485,22 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14851485

14861486
if let Some(virtual_dir) = virtual_rust_source_base_dir {
14871487
if let Some(real_dir) = &sess.real_rust_source_base_dir {
1488-
if let rustc_span::FileName::Real(path) = name {
1489-
if let Ok(rest) = path.strip_prefix(virtual_dir) {
1490-
let new_path = real_dir.join(rest);
1491-
debug!(
1492-
"try_to_translate_virtual_to_real: `{}` -> `{}`",
1493-
path.display(),
1494-
new_path.display(),
1495-
);
1496-
*path = new_path;
1488+
if let rustc_span::FileName::Real(old_name) = name {
1489+
if let rustc_span::RealFileName::Named(one_path) = old_name {
1490+
if let Ok(rest) = one_path.strip_prefix(virtual_dir) {
1491+
let virtual_name = one_path.clone();
1492+
let new_path = real_dir.join(rest);
1493+
debug!(
1494+
"try_to_translate_virtual_to_real: `{}` -> `{}`",
1495+
virtual_name.display(),
1496+
new_path.display(),
1497+
);
1498+
let new_name = rustc_span::RealFileName::Devirtualized {
1499+
local_path: new_path,
1500+
virtual_name,
1501+
};
1502+
*old_name = new_name;
1503+
}
14971504
}
14981505
}
14991506
}

src/librustc_metadata/rmeta/encoder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ impl<'tcx> EncodeContext<'tcx> {
398398
// any relative paths are potentially relative to a
399399
// wrong directory.
400400
FileName::Real(ref name) => {
401+
let name = name.stable_name();
401402
let mut adapted = (**source_file).clone();
402403
adapted.name = Path::new(&working_dir).join(name).into();
403404
adapted.name_hash = {

src/librustc_save_analysis/span_utils.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ impl<'a> SpanUtils<'a> {
1616

1717
pub fn make_filename_string(&self, file: &SourceFile) -> String {
1818
match &file.name {
19-
FileName::Real(path) if !file.name_was_remapped => {
19+
FileName::Real(name) if !file.name_was_remapped => {
20+
let path = name.local_path();
2021
if path.is_absolute() {
2122
self.sess
2223
.source_map()
2324
.path_mapping()
24-
.map_prefix(path.clone())
25+
.map_prefix(path.into())
2526
.0
2627
.display()
2728
.to_string()

0 commit comments

Comments
 (0)