diff --git a/.gitmodules b/.gitmodules
index f64e21c5af0e4..3ff5af78097fa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -43,7 +43,7 @@
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
- branch = rustc/9.0-2019-07-12
+ branch = rustc/9.0-2019-09-19
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
url = https://github.com/rust-embedded/book.git
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index e27a6bf7da0ac..d9dff77a30e6b 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -18,7 +18,7 @@ use build_helper::{output, t};
use crate::{Compiler, Mode, LLVM_TOOLS};
use crate::channel;
-use crate::util::{is_dylib, exe};
+use crate::util::{is_dylib, exe, timeit};
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
use crate::compile;
use crate::tool::{self, Tool};
@@ -91,14 +91,15 @@ impl Step for Docs {
let name = pkgname(builder, "rust-docs");
- builder.info(&format!("Dist docs ({})", host));
if !builder.config.docs {
- builder.info("\tskipping - docs disabled");
return distdir(builder).join(format!("{}-{}.tar.gz", name, host));
}
builder.default_doc(None);
+ builder.info(&format!("Dist docs ({})", host));
+ let _time = timeit(builder);
+
let image = tmpdir(builder).join(format!("{}-{}-image", name, host));
let _ = fs::remove_dir_all(&image);
@@ -151,9 +152,7 @@ impl Step for RustcDocs {
let name = pkgname(builder, "rustc-docs");
- builder.info(&format!("Dist compiler docs ({})", host));
if !builder.config.compiler_docs {
- builder.info("\tskipping - compiler docs disabled");
return distdir(builder).join(format!("{}-{}.tar.gz", name, host));
}
@@ -179,6 +178,9 @@ impl Step for RustcDocs {
.arg("--component-name=rustc-docs")
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--bulk-dirs=share/doc/rust/html");
+
+ builder.info(&format!("Dist compiler docs ({})", host));
+ let _time = timeit(builder);
builder.run(&mut cmd);
builder.remove_dir(&image);
@@ -350,6 +352,7 @@ impl Step for Mingw {
}
builder.info(&format!("Dist mingw ({})", host));
+ let _time = timeit(builder);
let name = pkgname(builder, "rust-mingw");
let image = tmpdir(builder).join(format!("{}-{}-image", name, host));
let _ = fs::remove_dir_all(&image);
@@ -403,7 +406,6 @@ impl Step for Rustc {
let compiler = self.compiler;
let host = self.compiler.host;
- builder.info(&format!("Dist rustc stage{} ({})", compiler.stage, host));
let name = pkgname(builder, "rustc");
let image = tmpdir(builder).join(format!("{}-{}-image", name, host));
let _ = fs::remove_dir_all(&image);
@@ -460,6 +462,9 @@ impl Step for Rustc {
.arg(format!("--package-name={}-{}", name, host))
.arg("--component-name=rustc")
.arg("--legacy-manifest-dirs=rustlib,cargo");
+
+ builder.info(&format!("Dist rustc stage{} ({})", compiler.stage, host));
+ let _time = timeit(builder);
builder.run(&mut cmd);
builder.remove_dir(&image);
builder.remove_dir(&overlay);
@@ -662,8 +667,6 @@ impl Step for Std {
let target = self.target;
let name = pkgname(builder, "rust-std");
- builder.info(&format!("Dist std stage{} ({} -> {})",
- compiler.stage, &compiler.host, target));
// The only true set of target libraries came from the build triple, so
// let's reduce redundant work by only producing archives from that host.
@@ -714,6 +717,10 @@ impl Step for Std {
.arg(format!("--package-name={}-{}", name, target))
.arg(format!("--component-name=rust-std-{}", target))
.arg("--legacy-manifest-dirs=rustlib,cargo");
+
+ builder.info(&format!("Dist std stage{} ({} -> {})",
+ compiler.stage, &compiler.host, target));
+ let _time = timeit(builder);
builder.run(&mut cmd);
builder.remove_dir(&image);
distdir(builder).join(format!("{}-{}.tar.gz", name, target))
@@ -754,11 +761,9 @@ impl Step for Analysis {
let compiler = self.compiler;
let target = self.target;
assert!(builder.config.extended);
- builder.info("Dist analysis");
let name = pkgname(builder, "rust-analysis");
if &compiler.host != builder.config.build {
- builder.info("\tskipping, not a build host");
return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
}
@@ -786,6 +791,9 @@ impl Step for Analysis {
.arg(format!("--package-name={}-{}", name, target))
.arg(format!("--component-name=rust-analysis-{}", target))
.arg("--legacy-manifest-dirs=rustlib,cargo");
+
+ builder.info("Dist analysis");
+ let _time = timeit(builder);
builder.run(&mut cmd);
builder.remove_dir(&image);
distdir(builder).join(format!("{}-{}.tar.gz", name, target))
@@ -874,8 +882,6 @@ impl Step for Src {
/// Creates the `rust-src` installer component
fn run(self, builder: &Builder<'_>) -> PathBuf {
- builder.info("Dist src");
-
let name = pkgname(builder, "rust-src");
let image = tmpdir(builder).join(format!("{}-image", name));
let _ = fs::remove_dir_all(&image);
@@ -930,6 +936,9 @@ impl Step for Src {
.arg(format!("--package-name={}", name))
.arg("--component-name=rust-src")
.arg("--legacy-manifest-dirs=rustlib,cargo");
+
+ builder.info("Dist src");
+ let _time = timeit(builder);
builder.run(&mut cmd);
builder.remove_dir(&image);
@@ -957,8 +966,6 @@ impl Step for PlainSourceTarball {
/// Creates the plain source tarball
fn run(self, builder: &Builder<'_>) -> PathBuf {
- builder.info("Create plain source tarball");
-
// Make sure that the root folder of tarball has the correct name
let plain_name = format!("{}-src", pkgname(builder, "rustc"));
let plain_dst_src = tmpdir(builder).join(&plain_name);
@@ -1020,6 +1027,9 @@ impl Step for PlainSourceTarball {
.arg("--output").arg(&tarball)
.arg("--work-dir=.")
.current_dir(tmpdir(builder));
+
+ builder.info("Create plain source tarball");
+ let _time = timeit(builder);
builder.run(&mut cmd);
distdir(builder).join(&format!("{}.tar.gz", plain_name))
}
@@ -1073,7 +1083,6 @@ impl Step for Cargo {
let compiler = self.compiler;
let target = self.target;
- builder.info(&format!("Dist cargo stage{} ({})", compiler.stage, target));
let src = builder.src.join("src/tools/cargo");
let etc = src.join("src/etc");
let release_num = builder.release_num("cargo");
@@ -1126,6 +1135,9 @@ impl Step for Cargo {
.arg(format!("--package-name={}-{}", name, target))
.arg("--component-name=cargo")
.arg("--legacy-manifest-dirs=rustlib,cargo");
+
+ builder.info(&format!("Dist cargo stage{} ({})", compiler.stage, target));
+ let _time = timeit(builder);
builder.run(&mut cmd);
distdir(builder).join(format!("{}-{}.tar.gz", name, target))
}
@@ -1161,7 +1173,6 @@ impl Step for Rls {
let target = self.target;
assert!(builder.config.extended);
- builder.info(&format!("Dist RLS stage{} ({})", compiler.stage, target));
let src = builder.src.join("src/tools/rls");
let release_num = builder.release_num("rls");
let name = pkgname(builder, "rls");
@@ -1210,6 +1221,8 @@ impl Step for Rls {
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--component-name=rls-preview");
+ builder.info(&format!("Dist RLS stage{} ({})", compiler.stage, target));
+ let _time = timeit(builder);
builder.run(&mut cmd);
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
}
@@ -1245,7 +1258,6 @@ impl Step for Clippy {
let target = self.target;
assert!(builder.config.extended);
- builder.info(&format!("Dist clippy stage{} ({})", compiler.stage, target));
let src = builder.src.join("src/tools/clippy");
let release_num = builder.release_num("clippy");
let name = pkgname(builder, "clippy");
@@ -1299,6 +1311,8 @@ impl Step for Clippy {
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--component-name=clippy-preview");
+ builder.info(&format!("Dist clippy stage{} ({})", compiler.stage, target));
+ let _time = timeit(builder);
builder.run(&mut cmd);
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
}
@@ -1334,7 +1348,6 @@ impl Step for Miri {
let target = self.target;
assert!(builder.config.extended);
- builder.info(&format!("Dist miri stage{} ({})", compiler.stage, target));
let src = builder.src.join("src/tools/miri");
let release_num = builder.release_num("miri");
let name = pkgname(builder, "miri");
@@ -1389,6 +1402,8 @@ impl Step for Miri {
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--component-name=miri-preview");
+ builder.info(&format!("Dist miri stage{} ({})", compiler.stage, target));
+ let _time = timeit(builder);
builder.run(&mut cmd);
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
}
@@ -1423,7 +1438,6 @@ impl Step for Rustfmt {
let compiler = self.compiler;
let target = self.target;
- builder.info(&format!("Dist Rustfmt stage{} ({})", compiler.stage, target));
let src = builder.src.join("src/tools/rustfmt");
let release_num = builder.release_num("rustfmt");
let name = pkgname(builder, "rustfmt");
@@ -1476,6 +1490,8 @@ impl Step for Rustfmt {
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--component-name=rustfmt-preview");
+ builder.info(&format!("Dist Rustfmt stage{} ({})", compiler.stage, target));
+ let _time = timeit(builder);
builder.run(&mut cmd);
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
}
@@ -1576,6 +1592,7 @@ impl Step for Extended {
input_tarballs.push(tarball);
}
+ builder.info("building combined installer");
let mut cmd = rust_installer(builder);
cmd.arg("combine")
.arg("--product-name=Rust")
@@ -1587,7 +1604,9 @@ impl Step for Extended {
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--input-tarballs").arg(input_tarballs)
.arg("--non-installed-overlay").arg(&overlay);
+ let time = timeit(&builder);
builder.run(&mut cmd);
+ drop(time);
let mut license = String::new();
license += &builder.read(&builder.src.join("COPYRIGHT"));
@@ -1643,6 +1662,7 @@ impl Step for Extended {
};
if target.contains("apple-darwin") {
+ builder.info("building pkg installer");
let pkg = tmp.join("pkg");
let _ = fs::remove_dir_all(&pkg);
@@ -1692,6 +1712,7 @@ impl Step for Extended {
pkgname(builder, "rust"),
target)))
.arg("--package-path").arg(&pkg);
+ let _time = timeit(builder);
builder.run(&mut cmd);
}
@@ -1742,14 +1763,18 @@ impl Step for Extended {
builder.create(&exe.join("LICENSE.txt"), &license);
// Generate exe installer
+ builder.info("building `exe` installer with `iscc`");
let mut cmd = Command::new("iscc");
cmd.arg("rust.iss")
+ .arg("/Q")
.current_dir(&exe);
if target.contains("windows-gnu") {
cmd.arg("/dMINGW");
}
add_env(builder, &mut cmd, target);
+ let time = timeit(builder);
builder.run(&mut cmd);
+ drop(time);
builder.install(&exe.join(format!("{}-{}.exe", pkgname(builder, "rust"), target)),
&distdir(builder),
0o755);
@@ -1914,6 +1939,7 @@ impl Step for Extended {
builder.install(&etc.join("gfx/banner.bmp"), &exe, 0o644);
builder.install(&etc.join("gfx/dialogbg.bmp"), &exe, 0o644);
+ builder.info(&format!("building `msi` installer with {:?}", light));
let filename = format!("{}-{}.msi", pkgname(builder, "rust"), target);
let mut cmd = Command::new(&light);
cmd.arg("-nologo")
@@ -1946,6 +1972,7 @@ impl Step for Extended {
// ICE57 wrongly complains about the shortcuts
cmd.arg("-sice:ICE57");
+ let _time = timeit(builder);
builder.run(&mut cmd);
if !builder.config.dry_run {
@@ -2114,6 +2141,7 @@ impl Step for LlvmTools {
}
builder.info(&format!("Dist LlvmTools ({})", target));
+ let _time = timeit(builder);
let src = builder.src.join("src/llvm-project/llvm");
let name = pkgname(builder, "llvm-tools");
diff --git a/src/etc/installer/exe/rust.iss b/src/etc/installer/exe/rust.iss
index c22d60b6c5df1..70648beac38b0 100644
--- a/src/etc/installer/exe/rust.iss
+++ b/src/etc/installer/exe/rust.iss
@@ -25,9 +25,9 @@ SourceDir=.\
OutputBaseFilename={#CFG_PACKAGE_NAME}-{#CFG_BUILD}
DefaultDirName={sd}\Rust
-Compression=lzma2/ultra
-InternalCompressLevel=ultra
-SolidCompression=true
+Compression=lzma2/normal
+InternalCompressLevel=normal
+SolidCompression=no
ChangesEnvironment=true
ChangesAssociations=no
diff --git a/src/etc/installer/msi/rust.wxs b/src/etc/installer/msi/rust.wxs
index a471ccc6f5b48..a2e378f7b1db4 100644
--- a/src/etc/installer/msi/rust.wxs
+++ b/src/etc/installer/msi/rust.wxs
@@ -152,7 +152,7 @@
-
+
diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs
index c53f4e49971bf..27e4d1237c252 100644
--- a/src/librustc/traits/mod.rs
+++ b/src/librustc/traits/mod.rs
@@ -659,11 +659,11 @@ pub struct VtableTraitAliasData<'tcx, N> {
}
/// Creates predicate obligations from the generic bounds.
-pub fn predicates_for_generics<'tcx>(cause: ObligationCause<'tcx>,
- param_env: ty::ParamEnv<'tcx>,
- generic_bounds: &ty::InstantiatedPredicates<'tcx>)
- -> PredicateObligations<'tcx>
-{
+pub fn predicates_for_generics<'tcx>(
+ cause: ObligationCause<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
+ generic_bounds: &ty::InstantiatedPredicates<'tcx>,
+) -> PredicateObligations<'tcx> {
util::predicates_for_generics(cause, 0, param_env, generic_bounds)
}
diff --git a/src/librustc/traits/util.rs b/src/librustc/traits/util.rs
index 3d36790c94b8c..3e5520dd46557 100644
--- a/src/librustc/traits/util.rs
+++ b/src/librustc/traits/util.rs
@@ -513,20 +513,19 @@ pub fn impl_trait_ref_and_oblig<'a, 'tcx>(
}
/// See [`super::obligations_for_generics`].
-pub fn predicates_for_generics<'tcx>(cause: ObligationCause<'tcx>,
- recursion_depth: usize,
- param_env: ty::ParamEnv<'tcx>,
- generic_bounds: &ty::InstantiatedPredicates<'tcx>)
- -> Vec>
-{
- debug!("predicates_for_generics(generic_bounds={:?})",
- generic_bounds);
-
- generic_bounds.predicates.iter().map(|predicate| {
- Obligation { cause: cause.clone(),
- recursion_depth,
- param_env,
- predicate: predicate.clone() }
+pub fn predicates_for_generics<'tcx>(
+ cause: ObligationCause<'tcx>,
+ recursion_depth: usize,
+ param_env: ty::ParamEnv<'tcx>,
+ generic_bounds: &ty::InstantiatedPredicates<'tcx>,
+) -> Vec> {
+ debug!("predicates_for_generics(generic_bounds={:?})", generic_bounds);
+
+ generic_bounds.predicates.iter().map(|predicate| Obligation {
+ cause: cause.clone(),
+ recursion_depth,
+ param_env,
+ predicate: predicate.clone(),
}).collect()
}
diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs
index 5409cbc4129f0..125c48f5f31d7 100644
--- a/src/librustc/ty/error.rs
+++ b/src/librustc/ty/error.rs
@@ -275,10 +275,10 @@ impl<'tcx> TyCtxt<'tcx> {
`.await`ing on both of them");
}
}
- if let (ty::Infer(ty::IntVar(_)), ty::Float(_)) =
- (&values.found.sty, &values.expected.sty) // Issue #53280
- {
- if let Ok(snippet) = self.sess.source_map().span_to_snippet(sp) {
+ match (&values.expected.sty, &values.found.sty) {
+ (ty::Float(_), ty::Infer(ty::IntVar(_))) => if let Ok( // Issue #53280
+ snippet,
+ ) = self.sess.source_map().span_to_snippet(sp) {
if snippet.chars().all(|c| c.is_digit(10) || c == '-' || c == '_') {
db.span_suggestion(
sp,
@@ -287,8 +287,96 @@ impl<'tcx> TyCtxt<'tcx> {
Applicability::MachineApplicable
);
}
+ },
+ (ty::Param(_), ty::Param(_)) => {
+ db.note("a type parameter was expected, but a different one was found; \
+ you might be missing a type parameter or trait bound");
+ db.note("for more information, visit \
+ https://doc.rust-lang.org/book/ch10-02-traits.html\
+ #traits-as-parameters");
+ }
+ (ty::Projection(_), ty::Projection(_)) => {
+ db.note("an associated type was expected, but a different one was found");
+ }
+ (ty::Param(_), ty::Projection(_)) | (ty::Projection(_), ty::Param(_)) => {
+ db.note("you might be missing a type parameter or trait bound");
+ }
+ (ty::Param(_), _) | (_, ty::Param(_)) => {
+ db.help("type parameters must be constrained to match other types");
+ if self.sess.teach(&db.get_code().unwrap()) {
+ db.help("given a type parameter `T` and a method `foo`:
+```
+trait Trait { fn foo(&self) -> T; }
+```
+the only ways to implement method `foo` are:
+- constrain `T` with an explicit type:
+```
+impl Trait for X {
+ fn foo(&self) -> String { String::new() }
+}
+```
+- add a trait bound to `T` and call a method on that trait that returns `Self`:
+```
+impl Trait for X {
+ fn foo(&self) -> T { ::default() }
+}
+```
+- change `foo` to return an argument of type `T`:
+```
+impl Trait for X {
+ fn foo(&self, x: T) -> T { x }
+}
+```");
+ }
+ db.note("for more information, visit \
+ https://doc.rust-lang.org/book/ch10-02-traits.html\
+ #traits-as-parameters");
+ }
+ (ty::Projection(_), _) => {
+ db.note(&format!(
+ "consider constraining the associated type `{}` to `{}` or calling a \
+ method that returns `{}`",
+ values.expected,
+ values.found,
+ values.expected,
+ ));
+ if self.sess.teach(&db.get_code().unwrap()) {
+ db.help("given an associated type `T` and a method `foo`:
+```
+trait Trait {
+ type T;
+ fn foo(&self) -> Self::T;
+}
+```
+the only way of implementing method `foo` is to constrain `T` with an explicit associated type:
+```
+impl Trait for X {
+ type T = String;
+ fn foo(&self) -> Self::T { String::new() }
+}
+```");
+ }
+ db.note("for more information, visit \
+ https://doc.rust-lang.org/book/ch19-03-advanced-traits.html");
+ }
+ (_, ty::Projection(_)) => {
+ db.note(&format!(
+ "consider constraining the associated type `{}` to `{}`",
+ values.found,
+ values.expected,
+ ));
+ db.note("for more information, visit \
+ https://doc.rust-lang.org/book/ch19-03-advanced-traits.html");
}
+ _ => {}
}
+ debug!(
+ "note_and_explain_type_err expected={:?} ({:?}) found={:?} ({:?})",
+ values.expected,
+ values.expected.sty,
+ values.found,
+ values.found.sty,
+ );
},
CyclicTy(ty) => {
// Watch out for various cases of cyclic types and try to explain.
diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs
index 7cc1e634cf812..795721f3b3f28 100644
--- a/src/librustc_mir/transform/qualify_consts.rs
+++ b/src/librustc_mir/transform/qualify_consts.rs
@@ -1407,10 +1407,17 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> {
}
}
ty::FnPtr(_) => {
- if self.mode.requires_const_checking() {
+ let unleash_miri = self
+ .tcx
+ .sess
+ .opts
+ .debugging_opts
+ .unleash_the_miri_inside_of_you;
+ if self.mode.requires_const_checking() && !unleash_miri {
let mut err = self.tcx.sess.struct_span_err(
self.span,
- &format!("function pointers are not allowed in const fn"));
+ "function pointers are not allowed in const fn"
+ );
err.emit();
}
}
diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs
index df8bd3fa75e14..cd1689f21cc6e 100644
--- a/src/librustc_resolve/late/diagnostics.rs
+++ b/src/librustc_resolve/late/diagnostics.rs
@@ -445,6 +445,12 @@ impl<'a> LateResolutionVisitor<'a, '_> {
(Res::Def(DefKind::Ctor(_, CtorKind::Fictive), _), _) if ns == ValueNS => {
bad_struct_syntax_suggestion();
}
+ (Res::Def(DefKind::Ctor(_, CtorKind::Fn), _), _) if ns == ValueNS => {
+ err.span_label(
+ span,
+ format!("did you mean `{} ( /* fields */ )`?", path_str),
+ );
+ }
(Res::SelfTy(..), _) if ns == ValueNS => {
err.span_label(span, fallback_label);
err.note("can't use `Self` as a constructor, you must use the implemented struct");
diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs
index d93a4052cd393..d687a5084e231 100644
--- a/src/librustc_typeck/check/pat.rs
+++ b/src/librustc_typeck/check/pat.rs
@@ -676,18 +676,35 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
} else {
// Pattern has wrong number of fields.
- self.e0023(pat.span, res, &subpats, &variant.fields);
+ self.e0023(pat.span, res, &subpats, &variant.fields, expected);
on_error();
return tcx.types.err;
}
pat_ty
}
- fn e0023(&self, pat_span: Span, res: Res, subpats: &'tcx [P], fields: &[ty::FieldDef]) {
+ fn e0023(
+ &self,
+ pat_span: Span,
+ res: Res,
+ subpats: &'tcx [P],
+ fields: &[ty::FieldDef],
+ expected: Ty<'tcx>
+ ) {
let subpats_ending = pluralise!(subpats.len());
let fields_ending = pluralise!(fields.len());
+ let missing_parenthesis = match expected.sty {
+ ty::Adt(_, substs) if fields.len() == 1 => {
+ let field_ty = fields[0].ty(self.tcx, substs);
+ match field_ty.sty {
+ ty::Tuple(_) => field_ty.tuple_fields().count() == subpats.len(),
+ _ => false,
+ }
+ }
+ _ => false,
+ };
let res_span = self.tcx.def_span(res.def_id());
- struct_span_err!(
+ let mut err = struct_span_err!(
self.tcx.sess,
pat_span,
E0023,
@@ -697,15 +714,25 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
res.descr(),
fields.len(),
fields_ending,
- )
- .span_label(pat_span, format!(
+ );
+ err.span_label(pat_span, format!(
"expected {} field{}, found {}",
fields.len(),
fields_ending,
subpats.len(),
))
- .span_label(res_span, format!("{} defined here", res.descr()))
- .emit();
+ .span_label(res_span, format!("{} defined here", res.descr()));
+
+ if missing_parenthesis {
+ err.multipart_suggestion(
+ "missing parenthesis",
+ vec![(subpats[0].span.shrink_to_lo(), "(".to_string()),
+ (subpats[subpats.len()-1].span.shrink_to_hi(), ")".to_string())],
+ Applicability::MachineApplicable,
+ );
+ }
+
+ err.emit();
}
fn check_pat_tuple(
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index f1d0e0b68f735..60560ae96deb5 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -9,9 +9,6 @@ use crate::ThinVec;
use rustc_target::spec::abi::Abi;
use syntax_pos::{Pos, Span};
-// Left so that Cargo tests don't break, this can be removed once those no longer use it
-pub trait AstBuilder {}
-
impl<'a> ExtCtxt<'a> {
pub fn path(&self, span: Span, strs: Vec ) -> ast::Path {
self.path_all(span, false, strs, vec![], vec![])
diff --git a/src/llvm-project b/src/llvm-project
index 71fe7ec06b85f..8adf9bdccfefb 160000
--- a/src/llvm-project
+++ b/src/llvm-project
@@ -1 +1 @@
-Subproject commit 71fe7ec06b85f612fc0e4eb4134c7a7d0f23fac5
+Subproject commit 8adf9bdccfefb8d03f0e8db3b012fb41da1580a4
diff --git a/src/test/ui/associated-const/associated-const-generic-obligations.stderr b/src/test/ui/associated-const/associated-const-generic-obligations.stderr
index eeee26a75671f..ca6118cb3ba98 100644
--- a/src/test/ui/associated-const/associated-const-generic-obligations.stderr
+++ b/src/test/ui/associated-const/associated-const-generic-obligations.stderr
@@ -9,6 +9,8 @@ LL | const FROM: &'static str = "foo";
|
= note: expected type `::Out`
found type `&'static str`
+ = note: consider constraining the associated type `::Out` to `&'static str` or calling a method that returns `::Out`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr
index 0f8c5257d445f..c9d88b7af0753 100644
--- a/src/test/ui/associated-types/associated-types-eq-3.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-3.stderr
@@ -6,6 +6,8 @@ LL | let _: Bar = x.boo();
|
= note: expected type `Bar`
found type `::A`
+ = note: consider constraining the associated type `::A` to `Bar`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error[E0271]: type mismatch resolving `::A == Bar`
--> $DIR/associated-types-eq-3.rs:38:5
diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr
index 7d6c025d69d55..e037bd851ca21 100644
--- a/src/test/ui/associated-types/associated-types-issue-20346.stderr
+++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr
@@ -9,6 +9,8 @@ LL | is_iterator_of::