Skip to content

Commit d049c7b

Browse files
committed
Auto merge of #59295 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports Rolled up: * [beta] Move to static.r-l.o stable release #58896 Cherry-picked: * Add release notes for PR #56243 #58959 * resolve: Account for new importable entities #59047 * bootstrap: Default to a sensible llvm-suffix. #59173 r? @ghost
2 parents 7473869 + 12e476d commit d049c7b

File tree

8 files changed

+104
-35
lines changed

8 files changed

+104
-35
lines changed

RELEASES.md

+26-21
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Version 1.33.0 (2019-02-28)
44
Language
55
--------
66
- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g.
7-
`#[cfg(target_vendor="linux")] fn main() { println!("Hello Linux!"); }`
7+
`#[cfg(target_vendor="apple")] fn main() { println!("Hello Apple!"); }`
88
- [Integer patterns such as in a match expression can now be exhaustive.][56362]
99
E.g. You can have match statement on a `u8` that covers `0..=255` and
10-
you would no longer be required to have a `_ => unreachable!()` case.
10+
you would no longer be required to have a `_ => unreachable!()` case.
1111
- [You can now have multiple patterns in `if let` and `while let`
1212
expressions.][57532] You can do this with the same syntax as a `match`
1313
expression. E.g.
@@ -51,8 +51,7 @@ Language
5151
// Allowed as there is only one `Read` in the module.
5252
pub trait Read {}
5353
```
54-
- [`extern` functions will now abort by default when panicking.][55982]
55-
This was previously undefined behaviour.
54+
- [You may now use `Rc`, `Arc`, and `Pin` as method receivers][56805].
5655

5756
Compiler
5857
--------
@@ -109,27 +108,33 @@ Compatibility Notes
109108
are now deprecated in the standard library, and their usage will now produce a warning.
110109
Please use the `str::{trim_start, trim_end, trim_start_matches, trim_end_matches}`
111110
methods instead.
111+
- The `Error::cause` method has been deprecated in favor of `Error::source` which supports
112+
downcasting.
113+
- [Libtest no longer creates a new thread for each test when
114+
`--test-threads=1`. It also runs the tests in deterministic order][56243]
112115

113-
[57615]: https://github.com/rust-lang/rust/pull/57615/
114-
[57465]: https://github.com/rust-lang/rust/pull/57465/
115-
[57532]: https://github.com/rust-lang/rust/pull/57532/
116-
[57535]: https://github.com/rust-lang/rust/pull/57535/
117-
[57566]: https://github.com/rust-lang/rust/pull/57566/
116+
[55982]: https://github.com/rust-lang/rust/pull/55982/
117+
[56243]: https://github.com/rust-lang/rust/pull/56243
118+
[56303]: https://github.com/rust-lang/rust/pull/56303/
119+
[56351]: https://github.com/rust-lang/rust/pull/56351/
120+
[56362]: https://github.com/rust-lang/rust/pull/56362
121+
[56642]: https://github.com/rust-lang/rust/pull/56642/
122+
[56769]: https://github.com/rust-lang/rust/pull/56769/
123+
[56805]: https://github.com/rust-lang/rust/pull/56805
124+
[56947]: https://github.com/rust-lang/rust/pull/56947/
125+
[57049]: https://github.com/rust-lang/rust/pull/57049/
126+
[57067]: https://github.com/rust-lang/rust/pull/57067/
127+
[57105]: https://github.com/rust-lang/rust/pull/57105
118128
[57130]: https://github.com/rust-lang/rust/pull/57130/
119129
[57167]: https://github.com/rust-lang/rust/pull/57167/
120130
[57175]: https://github.com/rust-lang/rust/pull/57175/
121131
[57234]: https://github.com/rust-lang/rust/pull/57234/
122132
[57332]: https://github.com/rust-lang/rust/pull/57332/
123-
[56947]: https://github.com/rust-lang/rust/pull/56947/
124-
[57049]: https://github.com/rust-lang/rust/pull/57049/
125-
[57067]: https://github.com/rust-lang/rust/pull/57067/
126-
[56769]: https://github.com/rust-lang/rust/pull/56769/
127-
[56642]: https://github.com/rust-lang/rust/pull/56642/
128-
[56303]: https://github.com/rust-lang/rust/pull/56303/
129-
[56351]: https://github.com/rust-lang/rust/pull/56351/
130-
[55982]: https://github.com/rust-lang/rust/pull/55982/
131-
[56362]: https://github.com/rust-lang/rust/pull/56362
132-
[57105]: https://github.com/rust-lang/rust/pull/57105
133+
[57465]: https://github.com/rust-lang/rust/pull/57465/
134+
[57532]: https://github.com/rust-lang/rust/pull/57532/
135+
[57535]: https://github.com/rust-lang/rust/pull/57535/
136+
[57566]: https://github.com/rust-lang/rust/pull/57566/
137+
[57615]: https://github.com/rust-lang/rust/pull/57615/
133138
[cargo/6484]: https://github.com/rust-lang/cargo/pull/6484/
134139
[`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.read_exact_at
135140
[`unix::FileExt::write_all_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_all_at
@@ -170,7 +175,7 @@ Language
170175
- [You can now match against literals in macros with the `literal`
171176
specifier.][56072] This will match against a literal of any type.
172177
E.g. `1`, `'A'`, `"Hello World"`
173-
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
178+
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
174179
```rust
175180
struct Point(i32, i32);
176181

@@ -460,7 +465,7 @@ Version 1.31.0 (2018-12-06)
460465

461466
Language
462467
--------
463-
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
468+
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
464469
- [New lifetime elision rules now allow for eliding lifetimes in functions and
465470
impl headers.][54778] E.g. `impl<'a> Reader for BufReader<'a> {}` can now be
466471
`impl Reader for BufReader<'_> {}`. Lifetimes are still required to be defined

src/bootstrap/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ pub struct Build {
241241
clippy_info: channel::GitInfo,
242242
miri_info: channel::GitInfo,
243243
rustfmt_info: channel::GitInfo,
244+
in_tree_llvm_info: channel::GitInfo,
245+
emscripten_llvm_info: channel::GitInfo,
244246
local_rebuild: bool,
245247
fail_fast: bool,
246248
doc_tests: DocTests,
@@ -363,6 +365,8 @@ impl Build {
363365
let clippy_info = channel::GitInfo::new(&config, &src.join("src/tools/clippy"));
364366
let miri_info = channel::GitInfo::new(&config, &src.join("src/tools/miri"));
365367
let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt"));
368+
let in_tree_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-project"));
369+
let emscripten_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-emscripten"));
366370

367371
let mut build = Build {
368372
initial_rustc: config.initial_rustc.clone(),
@@ -386,6 +390,8 @@ impl Build {
386390
clippy_info,
387391
miri_info,
388392
rustfmt_info,
393+
in_tree_llvm_info,
394+
emscripten_llvm_info,
389395
cc: HashMap::new(),
390396
cxx: HashMap::new(),
391397
ar: HashMap::new(),

src/bootstrap/native.rs

+21-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use build_helper::output;
1818
use cmake;
1919
use cc;
2020

21+
use crate::channel;
2122
use crate::util::{self, exe};
2223
use build_helper::up_to_date;
2324
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
@@ -231,7 +232,26 @@ impl Step for Llvm {
231232
}
232233

233234
if let Some(ref suffix) = builder.config.llvm_version_suffix {
234-
cfg.define("LLVM_VERSION_SUFFIX", suffix);
235+
// Allow version-suffix="" to not define a version suffix at all.
236+
if !suffix.is_empty() {
237+
cfg.define("LLVM_VERSION_SUFFIX", suffix);
238+
}
239+
} else {
240+
let mut default_suffix = format!(
241+
"-rust-{}-{}",
242+
channel::CFG_RELEASE_NUM,
243+
builder.config.channel,
244+
);
245+
let llvm_info = if self.emscripten {
246+
&builder.emscripten_llvm_info
247+
} else {
248+
&builder.in_tree_llvm_info
249+
};
250+
if let Some(sha) = llvm_info.sha_short() {
251+
default_suffix.push_str("-");
252+
default_suffix.push_str(sha);
253+
}
254+
cfg.define("LLVM_VERSION_SUFFIX", default_suffix);
235255
}
236256

237257
if let Some(ref linker) = builder.config.llvm_use_linker {

src/librustc_resolve/build_reduced_graph.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -639,24 +639,24 @@ impl<'a> Resolver<'a> {
639639
// but metadata cannot encode gensyms currently, so we create it here.
640640
// This is only a guess, two equivalent idents may incorrectly get different gensyms here.
641641
let ident = ident.gensym_if_underscore();
642-
let def_id = def.def_id();
643642
let expansion = Mark::root(); // FIXME(jseyfried) intercrate hygiene
644643
match def {
645-
Def::Mod(..) | Def::Enum(..) => {
644+
Def::Mod(def_id) | Def::Enum(def_id) => {
646645
let module = self.new_module(parent,
647646
ModuleKind::Def(def, ident.name),
648647
def_id,
649648
expansion,
650649
span);
651650
self.define(parent, ident, TypeNS, (module, vis, DUMMY_SP, expansion));
652651
}
653-
Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) => {
652+
Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) | Def::Existential(..) |
653+
Def::TraitAlias(..) | Def::PrimTy(..) | Def::ToolMod => {
654654
self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion));
655655
}
656656
Def::Fn(..) | Def::Static(..) | Def::Const(..) | Def::VariantCtor(..) => {
657657
self.define(parent, ident, ValueNS, (def, vis, DUMMY_SP, expansion));
658658
}
659-
Def::StructCtor(..) => {
659+
Def::StructCtor(def_id, ..) => {
660660
self.define(parent, ident, ValueNS, (def, vis, DUMMY_SP, expansion));
661661

662662
if let Some(struct_def_id) =
@@ -665,7 +665,7 @@ impl<'a> Resolver<'a> {
665665
self.struct_constructors.insert(struct_def_id, (def, vis));
666666
}
667667
}
668-
Def::Trait(..) => {
668+
Def::Trait(def_id) => {
669669
let module_kind = ModuleKind::Def(def, ident.name);
670670
let module = self.new_module(parent,
671671
module_kind,
@@ -686,18 +686,14 @@ impl<'a> Resolver<'a> {
686686
}
687687
module.populated.set(true);
688688
}
689-
Def::Existential(..) |
690-
Def::TraitAlias(..) => {
691-
self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion));
692-
}
693-
Def::Struct(..) | Def::Union(..) => {
689+
Def::Struct(def_id) | Def::Union(def_id) => {
694690
self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion));
695691

696692
// Record field names for error reporting.
697693
let field_names = self.cstore.struct_field_names_untracked(def_id);
698694
self.insert_field_names(def_id, field_names);
699695
}
700-
Def::Macro(..) => {
696+
Def::Macro(..) | Def::NonMacroAttr(..) => {
701697
self.define(parent, ident, MacroNS, (def, vis, DUMMY_SP, expansion));
702698
}
703699
_ => bug!("unexpected definition: {:?}", def)

src/stage0.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
1313
# `0.x.0` for Cargo where they were released on `date`.
1414

15-
date: 2019-02-25
15+
date: 2019-02-28
1616
rustc: 1.33.0
1717
cargo: 0.34.0
1818

@@ -34,4 +34,4 @@ cargo: 0.34.0
3434
# looking at a beta source tarball and it's uncommented we'll shortly comment it
3535
# out.
3636

37-
dev: 1
37+
#dev: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// edition:2018
2+
3+
pub use ignore as built_in_attr;
4+
pub use u8 as built_in_type;
5+
pub use rustfmt as tool_mod;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// edition:2018
2+
// aux-build:cross-crate.rs
3+
4+
extern crate cross_crate;
5+
use cross_crate::*;
6+
7+
#[built_in_attr] //~ ERROR cannot use a built-in attribute through an import
8+
#[tool_mod::skip] //~ ERROR cannot use a tool module through an import
9+
fn main() {
10+
let _: built_in_type; // OK
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error: cannot use a built-in attribute through an import
2+
--> $DIR/cross-crate.rs:7:3
3+
|
4+
LL | #[built_in_attr] //~ ERROR cannot use a built-in attribute through an import
5+
| ^^^^^^^^^^^^^
6+
|
7+
note: the built-in attribute imported here
8+
--> $DIR/cross-crate.rs:5:5
9+
|
10+
LL | use cross_crate::*;
11+
| ^^^^^^^^^^^^^^
12+
13+
error: cannot use a tool module through an import
14+
--> $DIR/cross-crate.rs:8:3
15+
|
16+
LL | #[tool_mod::skip] //~ ERROR cannot use a tool module through an import
17+
| ^^^^^^^^
18+
|
19+
note: the tool module imported here
20+
--> $DIR/cross-crate.rs:5:5
21+
|
22+
LL | use cross_crate::*;
23+
| ^^^^^^^^^^^^^^
24+
25+
error: aborting due to 2 previous errors
26+

0 commit comments

Comments
 (0)