From 4002171315bb294d9c518dd1f053072ced66e282 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 21 Mar 2021 12:10:34 -0400 Subject: Download a more recent LLVM version if `src/version` is modified When bumping the bootstrap version, the name of the generated LLVM shared object file is changed, even though it's the same contents as before. If bootstrap tries to use an older version, it will get linking errors: ``` Building rustdoc for stage1 (x86_64-unknown-linux-gnu) Compiling rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc) error: linking with `cc` failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" ... lots of args ... = note: /usr/bin/ld: cannot find -lLLVM-12-rust-1.53.0-nightly clang: error: linker command failed with exit code 1 (use -v to see invocation) error: could not compile `rustdoc-tool` ``` --- src/bootstrap/bootstrap.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3e7d1d54f12..075756b73ba 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -463,6 +463,8 @@ class RustBuild(object): "--", "{}/src/llvm-project".format(top_level), "{}/src/bootstrap/download-ci-llvm-stamp".format(top_level), + # the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` + "{}/src/version".format(top_level) ]).decode(sys.getdefaultencoding()).strip() llvm_assertions = self.get_toml('assertions', 'llvm') == 'true' llvm_root = self.llvm_root() -- cgit 1.4.1-3-g733a5 From bfae41d7b01f016fab65ed4be9ecdb5c31a97f09 Mon Sep 17 00:00:00 2001 From: Camelid Date: Sat, 20 Mar 2021 20:00:25 -0700 Subject: Fix ICE with `use clippy::a::b;` --- compiler/rustc_resolve/src/imports.rs | 4 ++-- src/test/ui/imports/tool-mod-child.rs | 7 +++++++ src/test/ui/imports/tool-mod-child.stderr | 28 ++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/test/ui/imports/tool-mod-child.rs create mode 100644 src/test/ui/imports/tool-mod-child.stderr (limited to 'src') diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 61f4c00a4ca..26858915f45 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -955,14 +955,14 @@ impl<'a, 'b> ImportResolver<'a, 'b> { } return None; } - PathResult::NonModule(path_res) if path_res.base_res() == Res::Err => { + PathResult::NonModule(_) => { if no_ambiguity { assert!(import.imported_module.get().is_none()); } // The error was already reported earlier. return None; } - PathResult::Indeterminate | PathResult::NonModule(..) => unreachable!(), + PathResult::Indeterminate => unreachable!(), }; let (ident, target, source_bindings, target_bindings, type_ns_only) = match import.kind { diff --git a/src/test/ui/imports/tool-mod-child.rs b/src/test/ui/imports/tool-mod-child.rs new file mode 100644 index 00000000000..4581dc2e2ad --- /dev/null +++ b/src/test/ui/imports/tool-mod-child.rs @@ -0,0 +1,7 @@ +use clippy::a; //~ ERROR unresolved import `clippy` +use clippy::a::b; //~ ERROR failed to resolve: maybe a missing crate `clippy`? + +use rustdoc::a; //~ ERROR unresolved import `rustdoc` +use rustdoc::a::b; //~ ERROR failed to resolve: maybe a missing crate `rustdoc`? + +fn main() {} diff --git a/src/test/ui/imports/tool-mod-child.stderr b/src/test/ui/imports/tool-mod-child.stderr new file mode 100644 index 00000000000..efab4f6a74f --- /dev/null +++ b/src/test/ui/imports/tool-mod-child.stderr @@ -0,0 +1,28 @@ +error[E0433]: failed to resolve: maybe a missing crate `clippy`? + --> $DIR/tool-mod-child.rs:2:5 + | +LL | use clippy::a::b; + | ^^^^^^ maybe a missing crate `clippy`? + +error[E0432]: unresolved import `clippy` + --> $DIR/tool-mod-child.rs:1:5 + | +LL | use clippy::a; + | ^^^^^^ maybe a missing crate `clippy`? + +error[E0433]: failed to resolve: maybe a missing crate `rustdoc`? + --> $DIR/tool-mod-child.rs:5:5 + | +LL | use rustdoc::a::b; + | ^^^^^^^ maybe a missing crate `rustdoc`? + +error[E0432]: unresolved import `rustdoc` + --> $DIR/tool-mod-child.rs:4:5 + | +LL | use rustdoc::a; + | ^^^^^^^ maybe a missing crate `rustdoc`? + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0432, E0433. +For more information about an error, try `rustc --explain E0432`. -- cgit 1.4.1-3-g733a5