From e5f76ad22d868e801effa255c163be8dfee44e82 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 3 Mar 2019 09:00:03 -0700 Subject: [PATCH 1/6] Move to static.r-l.o stable release --- src/stage0.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stage0.txt b/src/stage0.txt index 9613728d16115..76d843e977f8f 100644 --- a/src/stage0.txt +++ b/src/stage0.txt @@ -12,7 +12,7 @@ # source tarball for a stable release you'll likely see `1.x.0` for rustc and # `0.x.0` for Cargo where they were released on `date`. -date: 2019-02-25 +date: 2019-02-28 rustc: 1.33.0 cargo: 0.34.0 @@ -34,4 +34,4 @@ cargo: 0.34.0 # looking at a beta source tarball and it's uncommented we'll shortly comment it # out. -dev: 1 +#dev: 1 From 4cdc139233a91998548c18dda365a06049f9f220 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 3 Mar 2019 09:58:11 -0700 Subject: [PATCH 2/6] Pull in stable release note changes --- RELEASES.md | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 841467b69c986..4cda02c5c2ebe 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4,10 +4,10 @@ Version 1.33.0 (2019-02-28) Language -------- - [You can now use the `cfg(target_vendor)` attribute.][57465] E.g. - `#[cfg(target_vendor="linux")] fn main() { println!("Hello Linux!"); }` + `#[cfg(target_vendor="apple")] fn main() { println!("Hello Apple!"); }` - [Integer patterns such as in a match expression can now be exhaustive.][56362] E.g. You can have match statement on a `u8` that covers `0..=255` and - you would no longer be required to have a `_ => unreachable!()` case. + you would no longer be required to have a `_ => unreachable!()` case. - [You can now have multiple patterns in `if let` and `while let` expressions.][57532] You can do this with the same syntax as a `match` expression. E.g. @@ -51,8 +51,7 @@ Language // Allowed as there is only one `Read` in the module. pub trait Read {} ``` -- [`extern` functions will now abort by default when panicking.][55982] - This was previously undefined behaviour. +- [You may now use `Rc`, `Arc`, and `Pin` as method receivers][56805]. Compiler -------- @@ -109,27 +108,30 @@ Compatibility Notes are now deprecated in the standard library, and their usage will now produce a warning. Please use the `str::{trim_start, trim_end, trim_start_matches, trim_end_matches}` methods instead. +- The `Error::cause` method has been deprecated in favor of `Error::source` which supports + downcasting. -[57615]: https://github.com/rust-lang/rust/pull/57615/ -[57465]: https://github.com/rust-lang/rust/pull/57465/ -[57532]: https://github.com/rust-lang/rust/pull/57532/ -[57535]: https://github.com/rust-lang/rust/pull/57535/ -[57566]: https://github.com/rust-lang/rust/pull/57566/ +[55982]: https://github.com/rust-lang/rust/pull/55982/ +[56303]: https://github.com/rust-lang/rust/pull/56303/ +[56351]: https://github.com/rust-lang/rust/pull/56351/ +[56362]: https://github.com/rust-lang/rust/pull/56362 +[56642]: https://github.com/rust-lang/rust/pull/56642/ +[56769]: https://github.com/rust-lang/rust/pull/56769/ +[56805]: https://github.com/rust-lang/rust/pull/56805 +[56947]: https://github.com/rust-lang/rust/pull/56947/ +[57049]: https://github.com/rust-lang/rust/pull/57049/ +[57067]: https://github.com/rust-lang/rust/pull/57067/ +[57105]: https://github.com/rust-lang/rust/pull/57105 [57130]: https://github.com/rust-lang/rust/pull/57130/ [57167]: https://github.com/rust-lang/rust/pull/57167/ [57175]: https://github.com/rust-lang/rust/pull/57175/ [57234]: https://github.com/rust-lang/rust/pull/57234/ [57332]: https://github.com/rust-lang/rust/pull/57332/ -[56947]: https://github.com/rust-lang/rust/pull/56947/ -[57049]: https://github.com/rust-lang/rust/pull/57049/ -[57067]: https://github.com/rust-lang/rust/pull/57067/ -[56769]: https://github.com/rust-lang/rust/pull/56769/ -[56642]: https://github.com/rust-lang/rust/pull/56642/ -[56303]: https://github.com/rust-lang/rust/pull/56303/ -[56351]: https://github.com/rust-lang/rust/pull/56351/ -[55982]: https://github.com/rust-lang/rust/pull/55982/ -[56362]: https://github.com/rust-lang/rust/pull/56362 -[57105]: https://github.com/rust-lang/rust/pull/57105 +[57465]: https://github.com/rust-lang/rust/pull/57465/ +[57532]: https://github.com/rust-lang/rust/pull/57532/ +[57535]: https://github.com/rust-lang/rust/pull/57535/ +[57566]: https://github.com/rust-lang/rust/pull/57566/ +[57615]: https://github.com/rust-lang/rust/pull/57615/ [cargo/6484]: https://github.com/rust-lang/cargo/pull/6484/ [`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.read_exact_at [`unix::FileExt::write_all_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_all_at @@ -170,7 +172,7 @@ Language - [You can now match against literals in macros with the `literal` specifier.][56072] This will match against a literal of any type. E.g. `1`, `'A'`, `"Hello World"` -- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g. +- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g. ```rust struct Point(i32, i32); @@ -460,7 +462,7 @@ Version 1.31.0 (2018-12-06) Language -------- -- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉 +- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉 - [New lifetime elision rules now allow for eliding lifetimes in functions and impl headers.][54778] E.g. `impl<'a> Reader for BufReader<'a> {}` can now be `impl Reader for BufReader<'_> {}`. Lifetimes are still required to be defined From 8d00637eef7ff2a9f63543fd0394f0bd37e4c442 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Tue, 5 Mar 2019 17:43:30 -0700 Subject: [PATCH 3/6] add release notes for PR #56243 Fixes #58907 --- RELEASES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 4cda02c5c2ebe..a49e072e9eaa7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -110,8 +110,11 @@ Compatibility Notes methods instead. - The `Error::cause` method has been deprecated in favor of `Error::source` which supports downcasting. +- [Libtest no longer creates a new thread for each test when + `--test-threads=1`. It also runs the tests in deterministic order][56243] [55982]: https://github.com/rust-lang/rust/pull/55982/ +[56243]: https://github.com/rust-lang/rust/pull/56243 [56303]: https://github.com/rust-lang/rust/pull/56303/ [56351]: https://github.com/rust-lang/rust/pull/56351/ [56362]: https://github.com/rust-lang/rust/pull/56362 From 0754f1e1a25daf786943bb89b7753fb44fb114a7 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 9 Mar 2019 16:15:40 +0300 Subject: [PATCH 4/6] resolve: Account for new importable entities --- src/librustc_resolve/build_reduced_graph.rs | 18 +++++-------- .../uniform-paths/auxiliary/cross-crate.rs | 5 ++++ .../ui/rust-2018/uniform-paths/cross-crate.rs | 11 ++++++++ .../uniform-paths/cross-crate.stderr | 26 +++++++++++++++++++ 4 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 src/test/ui/rust-2018/uniform-paths/auxiliary/cross-crate.rs create mode 100644 src/test/ui/rust-2018/uniform-paths/cross-crate.rs create mode 100644 src/test/ui/rust-2018/uniform-paths/cross-crate.stderr diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 29de5308a3cdb..21043a52fda22 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -639,10 +639,9 @@ impl<'a> Resolver<'a> { // but metadata cannot encode gensyms currently, so we create it here. // This is only a guess, two equivalent idents may incorrectly get different gensyms here. let ident = ident.gensym_if_underscore(); - let def_id = def.def_id(); let expansion = Mark::root(); // FIXME(jseyfried) intercrate hygiene match def { - Def::Mod(..) | Def::Enum(..) => { + Def::Mod(def_id) | Def::Enum(def_id) => { let module = self.new_module(parent, ModuleKind::Def(def, ident.name), def_id, @@ -650,13 +649,14 @@ impl<'a> Resolver<'a> { span); self.define(parent, ident, TypeNS, (module, vis, DUMMY_SP, expansion)); } - Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) => { + Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) | Def::Existential(..) | + Def::TraitAlias(..) | Def::PrimTy(..) | Def::ToolMod => { self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion)); } Def::Fn(..) | Def::Static(..) | Def::Const(..) | Def::VariantCtor(..) => { self.define(parent, ident, ValueNS, (def, vis, DUMMY_SP, expansion)); } - Def::StructCtor(..) => { + Def::StructCtor(def_id, ..) => { self.define(parent, ident, ValueNS, (def, vis, DUMMY_SP, expansion)); if let Some(struct_def_id) = @@ -665,7 +665,7 @@ impl<'a> Resolver<'a> { self.struct_constructors.insert(struct_def_id, (def, vis)); } } - Def::Trait(..) => { + Def::Trait(def_id) => { let module_kind = ModuleKind::Def(def, ident.name); let module = self.new_module(parent, module_kind, @@ -686,18 +686,14 @@ impl<'a> Resolver<'a> { } module.populated.set(true); } - Def::Existential(..) | - Def::TraitAlias(..) => { - self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion)); - } - Def::Struct(..) | Def::Union(..) => { + Def::Struct(def_id) | Def::Union(def_id) => { self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion)); // Record field names for error reporting. let field_names = self.cstore.struct_field_names_untracked(def_id); self.insert_field_names(def_id, field_names); } - Def::Macro(..) => { + Def::Macro(..) | Def::NonMacroAttr(..) => { self.define(parent, ident, MacroNS, (def, vis, DUMMY_SP, expansion)); } _ => bug!("unexpected definition: {:?}", def) diff --git a/src/test/ui/rust-2018/uniform-paths/auxiliary/cross-crate.rs b/src/test/ui/rust-2018/uniform-paths/auxiliary/cross-crate.rs new file mode 100644 index 0000000000000..4aa5d1870000d --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/auxiliary/cross-crate.rs @@ -0,0 +1,5 @@ +// edition:2018 + +pub use ignore as built_in_attr; +pub use u8 as built_in_type; +pub use rustfmt as tool_mod; diff --git a/src/test/ui/rust-2018/uniform-paths/cross-crate.rs b/src/test/ui/rust-2018/uniform-paths/cross-crate.rs new file mode 100644 index 0000000000000..27d6dbf4683e3 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/cross-crate.rs @@ -0,0 +1,11 @@ +// edition:2018 +// aux-build:cross-crate.rs + +extern crate cross_crate; +use cross_crate::*; + +#[built_in_attr] //~ ERROR cannot use a built-in attribute through an import +#[tool_mod::skip] //~ ERROR cannot use a tool module through an import +fn main() { + let _: built_in_type; // OK +} diff --git a/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr b/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr new file mode 100644 index 0000000000000..fdde75faf5f04 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr @@ -0,0 +1,26 @@ +error: cannot use a built-in attribute through an import + --> $DIR/cross-crate.rs:7:3 + | +LL | #[built_in_attr] + | ^^^^^^^^^^^^^ + | +note: the built-in attribute imported here + --> $DIR/cross-crate.rs:5:5 + | +LL | use cross_crate::*; + | ^^^^^^^^^^^^^^ + +error: cannot use a tool module through an import + --> $DIR/cross-crate.rs:8:3 + | +LL | #[tool_mod::skip] + | ^^^^^^^^ + | +note: the tool module imported here + --> $DIR/cross-crate.rs:5:5 + | +LL | use cross_crate::*; + | ^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + From 8a1e43349c60ecc6e0571f616bb61c895affa90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 14 Mar 2019 02:23:08 +0100 Subject: [PATCH 5/6] bootstrap: Default to a sensible llvm-suffix. I used version-channel-sha, hopefully that should work. I checked that bootstrap builds, but I cannot check anything else since the llvm build process is started from cargo, and thus calls clang, and thus I hit the same bug I hope to fix with this change. Hopefully fixes #59034. --- src/bootstrap/lib.rs | 6 ++++++ src/bootstrap/native.rs | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 84e2c5aab54a3..7e6fbdff124ba 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -241,6 +241,8 @@ pub struct Build { clippy_info: channel::GitInfo, miri_info: channel::GitInfo, rustfmt_info: channel::GitInfo, + in_tree_llvm_info: channel::GitInfo, + emscripten_llvm_info: channel::GitInfo, local_rebuild: bool, fail_fast: bool, doc_tests: DocTests, @@ -363,6 +365,8 @@ impl Build { let clippy_info = channel::GitInfo::new(&config, &src.join("src/tools/clippy")); let miri_info = channel::GitInfo::new(&config, &src.join("src/tools/miri")); let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt")); + let in_tree_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-project")); + let emscripten_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-emscripten")); let mut build = Build { initial_rustc: config.initial_rustc.clone(), @@ -386,6 +390,8 @@ impl Build { clippy_info, miri_info, rustfmt_info, + in_tree_llvm_info, + emscripten_llvm_info, cc: HashMap::new(), cxx: HashMap::new(), ar: HashMap::new(), diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 192b1cd1fbb75..c9a017823acaa 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -18,6 +18,7 @@ use build_helper::output; use cmake; use cc; +use crate::channel; use crate::util::{self, exe}; use build_helper::up_to_date; use crate::builder::{Builder, RunConfig, ShouldRun, Step}; @@ -231,7 +232,26 @@ impl Step for Llvm { } if let Some(ref suffix) = builder.config.llvm_version_suffix { - cfg.define("LLVM_VERSION_SUFFIX", suffix); + // Allow version-suffix="" to not define a version suffix at all. + if !suffix.is_empty() { + cfg.define("LLVM_VERSION_SUFFIX", suffix); + } + } else { + let mut default_suffix = format!( + "-rust-{}-{}", + channel::CFG_RELEASE_NUM, + builder.config.channel, + ); + let llvm_info = if self.emscripten { + &builder.emscripten_llvm_info + } else { + &builder.in_tree_llvm_info + }; + if let Some(sha) = llvm_info.sha_short() { + default_suffix.push_str("-"); + default_suffix.push_str(sha); + } + cfg.define("LLVM_VERSION_SUFFIX", default_suffix); } if let Some(ref linker) = builder.config.llvm_use_linker { From 12e476d0f1f21df68752313c6b4c03fd9a22ca58 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 19 Mar 2019 21:03:38 +0100 Subject: [PATCH 6/6] bless ui tests --- src/test/ui/rust-2018/uniform-paths/cross-crate.stderr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr b/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr index fdde75faf5f04..ccf66b54c529c 100644 --- a/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr +++ b/src/test/ui/rust-2018/uniform-paths/cross-crate.stderr @@ -1,7 +1,7 @@ error: cannot use a built-in attribute through an import --> $DIR/cross-crate.rs:7:3 | -LL | #[built_in_attr] +LL | #[built_in_attr] //~ ERROR cannot use a built-in attribute through an import | ^^^^^^^^^^^^^ | note: the built-in attribute imported here @@ -13,7 +13,7 @@ LL | use cross_crate::*; error: cannot use a tool module through an import --> $DIR/cross-crate.rs:8:3 | -LL | #[tool_mod::skip] +LL | #[tool_mod::skip] //~ ERROR cannot use a tool module through an import | ^^^^^^^^ | note: the tool module imported here