summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-05 20:56:09 +0000
committerbors <bors@rust-lang.org>2019-12-05 20:56:09 +0000
commitf6840f33e68f53a60ba45d4c9e75223ae3dd434f (patch)
tree33941326d3aff9a3d71e06f012e66989fadf82e2
parentAuto merge of #66828 - GuillaumeGomez:less-minification, r=kinnison (diff)
parentRollup merge of #67055 - lqd:const_qualif, r=oli-obk (diff)
downloadrust-f6840f33e68f53a60ba45d4c9e75223ae3dd434f.tar.gz
rust-f6840f33e68f53a60ba45d4c9e75223ae3dd434f.tar.bz2
rust-f6840f33e68f53a60ba45d4c9e75223ae3dd434f.tar.xz
Auto merge of #67060 - Centril:rollup-hwhdx4h, r=Centril
Rollup of 9 pull requests Successful merges: - #66710 (weak-into-raw: Clarify some details in Safety) - #66863 (Check break target availability when checking breaks with values) - #67002 (Fix documentation of pattern for str::matches()) - #67005 (capitalize Rust) - #67010 (Accurately portray raw identifiers in error messages) - #67011 (Include a span in more `expected...found` notes) - #67044 (E0023: handle expected != tuple pattern type) - #67045 (rustc_parser: cleanup imports) - #67055 (Make const-qualification look at more `const fn`s) Failed merges: r? @ghost
-rw-r--r--Cargo.lock1
-rw-r--r--src/liballoc/rc.rs24
-rw-r--r--src/liballoc/sync.rs24
-rw-r--r--src/libcore/lib.rs2
-rw-r--r--src/libcore/str/mod.rs4
-rw-r--r--src/libcore/sync/atomic.rs2
-rw-r--r--src/librustc/infer/error_reporting/mod.rs15
-rw-r--r--src/librustc/infer/error_reporting/note.rs20
-rw-r--r--src/librustc/ty/print/pretty.rs3
-rw-r--r--src/librustc_mir/transform/check_consts/mod.rs7
-rw-r--r--src/librustc_parse/Cargo.toml9
-rw-r--r--src/librustc_parse/config.rs2
-rw-r--r--src/librustc_parse/lexer/mod.rs11
-rw-r--r--src/librustc_parse/lexer/tokentrees.rs8
-rw-r--r--src/librustc_parse/lexer/unicode_chars.rs4
-rw-r--r--src/librustc_parse/lib.rs4
-rw-r--r--src/librustc_parse/parser/attr.rs2
-rw-r--r--src/librustc_parse/parser/diagnostics.rs25
-rw-r--r--src/librustc_parse/parser/expr.rs17
-rw-r--r--src/librustc_parse/parser/generics.rs2
-rw-r--r--src/librustc_parse/parser/item.rs7
-rw-r--r--src/librustc_parse/parser/mod.rs13
-rw-r--r--src/librustc_parse/parser/module.rs9
-rw-r--r--src/librustc_parse/parser/pat.rs4
-rw-r--r--src/librustc_parse/parser/path.rs4
-rw-r--r--src/librustc_parse/parser/stmt.rs6
-rw-r--r--src/librustc_parse/parser/ty.rs8
-rw-r--r--src/librustc_parse/validate_attr.rs2
-rw-r--r--src/librustc_typeck/check/demand.rs16
-rw-r--r--src/librustc_typeck/check/expr.rs18
-rw-r--r--src/librustc_typeck/check/pat.rs21
-rw-r--r--src/libsyntax_pos/symbol.rs6
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr20
-rw-r--r--src/test/ui/c-variadic/variadic-ffi-4.stderr10
-rw-r--r--src/test/ui/consts/unstable-const-fn-in-libcore.rs29
-rw-r--r--src/test/ui/consts/unstable-const-fn-in-libcore.stderr22
-rw-r--r--src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr20
-rw-r--r--src/test/ui/issues/issue-16683.stderr10
-rw-r--r--src/test/ui/issues/issue-17758.stderr10
-rw-r--r--src/test/ui/issues/issue-20831-debruijn.stderr16
-rw-r--r--src/test/ui/issues/issue-52213.stderr10
-rw-r--r--src/test/ui/issues/issue-55796.stderr20
-rw-r--r--src/test/ui/issues/issue-65634-raw-ident-suggestion.rs22
-rw-r--r--src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr22
-rw-r--r--src/test/ui/issues/issue-66702-break-outside-loop-val.rs7
-rw-r--r--src/test/ui/issues/issue-66702-break-outside-loop-val.stderr11
-rw-r--r--src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs21
-rw-r--r--src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr22
-rw-r--r--src/test/ui/nll/issue-55394.stderr10
-rw-r--r--src/test/ui/nll/normalization-bounds-error.stderr10
-rw-r--r--src/test/ui/nll/type-alias-free-regions.stderr40
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr10
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr10
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default-elision.stderr20
-rw-r--r--src/test/ui/parser/raw/raw-literal-keywords.rs4
-rw-r--r--src/test/ui/parser/raw/raw-literal-keywords.stderr4
-rw-r--r--src/test/ui/regions/region-object-lifetime-in-coercion.stderr20
-rw-r--r--src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr20
-rw-r--r--src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr10
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-2.stderr10
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-4.stderr10
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr10
-rw-r--r--src/test/ui/regions/regions-creating-enums4.stderr20
-rw-r--r--src/test/ui/regions/regions-escape-method.stderr10
-rw-r--r--src/test/ui/regions/regions-escape-via-trait-or-not.stderr10
-rw-r--r--src/test/ui/regions/regions-nested-fns.stderr15
-rw-r--r--src/test/ui/regions/regions-normalize-in-where-clause-list.stderr13
-rw-r--r--src/test/ui/regions/regions-ret-borrowed-1.stderr10
-rw-r--r--src/test/ui/regions/regions-ret-borrowed.stderr10
-rw-r--r--src/test/ui/regions/regions-trait-object-subtyping.stderr10
-rw-r--r--src/test/ui/reject-specialized-drops-8142.stderr10
-rw-r--r--src/test/ui/suggestions/raw-name-use-suggestion.rs2
-rw-r--r--src/test/ui/suggestions/raw-name-use-suggestion.stderr2
-rw-r--r--src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr10
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr10
75 files changed, 636 insertions, 256 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5e83513..26727c5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3806,7 +3806,6 @@ dependencies = [
3806 "rustc_errors", 3806 "rustc_errors",
3807 "rustc_feature", 3807 "rustc_feature",
3808 "rustc_lexer", 3808 "rustc_lexer",
3809 "rustc_target",
3810 "smallvec 1.0.0", 3809 "smallvec 1.0.0",
3811 "syntax", 3810 "syntax",
3812 "syntax_pos", 3811 "syntax_pos",
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 2254cde..1ff1c3c 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -1648,10 +1648,8 @@ impl<T> Weak<T> {
1648 1648
1649 /// Returns a raw pointer to the object `T` pointed to by this `Weak<T>`. 1649 /// Returns a raw pointer to the object `T` pointed to by this `Weak<T>`.
1650 /// 1650 ///
1651 /// It is up to the caller to ensure that the object is still alive when accessing it through 1651 /// The pointer is valid only if there are some strong references. The pointer may be dangling
1652 /// the pointer. 1652 /// or even [`null`] otherwise.
1653 ///
1654 /// The pointer may be [`null`] or be dangling in case the object has already been destroyed.
1655 /// 1653 ///
1656 /// # Examples 1654 /// # Examples
1657 /// 1655 ///
@@ -1731,14 +1729,18 @@ impl<T> Weak<T> {
1731 /// This can be used to safely get a strong reference (by calling [`upgrade`] 1729 /// This can be used to safely get a strong reference (by calling [`upgrade`]
1732 /// later) or to deallocate the weak count by dropping the `Weak<T>`. 1730 /// later) or to deallocate the weak count by dropping the `Weak<T>`.
1733 /// 1731 ///
1734 /// It takes ownership of one weak count. In case a [`null`] is passed, a dangling [`Weak`] is 1732 /// It takes ownership of one weak count (with the exception of pointers created by [`new`],
1735 /// returned. 1733 /// as these don't have any corresponding weak count).
1736 /// 1734 ///
1737 /// # Safety 1735 /// # Safety
1738 /// 1736 ///
1739 /// The pointer must represent one valid weak count. In other words, it must point to `T` which 1737 /// The pointer must have originated from the [`into_raw`] (or [`as_raw`], provided there was
1740 /// is or *was* managed by an [`Rc`] and the weak count of that [`Rc`] must not have reached 1738 /// a corresponding [`forget`] on the `Weak<T>`) and must still own its potential weak reference
1741 /// 0. It is allowed for the strong count to be 0. 1739 /// count.
1740 ///
1741 /// It is allowed for the strong count to be 0 at the time of calling this, but the weak count
1742 /// must be non-zero or the pointer must have originated from a dangling `Weak<T>` (one created
1743 /// by [`new`]).
1742 /// 1744 ///
1743 /// # Examples 1745 /// # Examples
1744 /// 1746 ///
@@ -1763,11 +1765,13 @@ impl<T> Weak<T> {
1763 /// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none()); 1765 /// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none());
1764 /// ``` 1766 /// ```
1765 /// 1767 ///
1766 /// [`null`]: ../../std/ptr/fn.null.html
1767 /// [`into_raw`]: struct.Weak.html#method.into_raw 1768 /// [`into_raw`]: struct.Weak.html#method.into_raw
1768 /// [`upgrade`]: struct.Weak.html#method.upgrade 1769 /// [`upgrade`]: struct.Weak.html#method.upgrade
1769 /// [`Rc`]: struct.Rc.html 1770 /// [`Rc`]: struct.Rc.html
1770 /// [`Weak`]: struct.Weak.html 1771 /// [`Weak`]: struct.Weak.html
1772 /// [`as_raw`]: struct.Weak.html#method.as_raw
1773 /// [`new`]: struct.Weak.html#method.new
1774 /// [`forget`]: ../../std/mem/fn.forget.html
1771 #[unstable(feature = "weak_into_raw", issue = "60728")] 1775 #[unstable(feature = "weak_into_raw", issue = "60728")]
1772 pub unsafe fn from_raw(ptr: *const T) -> Self { 1776 pub unsafe fn from_raw(ptr: *const T) -> Self {
1773 if ptr.is_null() { 1777 if ptr.is_null() {
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index 7bf2ff1..19b0086 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -1324,10 +1324,8 @@ impl<T> Weak<T> {
1324 1324
1325 /// Returns a raw pointer to the object `T` pointed to by this `Weak<T>`. 1325 /// Returns a raw pointer to the object `T` pointed to by this `Weak<T>`.
1326 /// 1326 ///
1327 /// It is up to the caller to ensure that the object is still alive when accessing it through 1327 /// The pointer is valid only if there are some strong references. The pointer may be dangling
1328 /// the pointer. 1328 /// or even [`null`] otherwise.
1329 ///
1330 /// The pointer may be [`null`] or be dangling in case the object has already been destroyed.
1331 /// 1329 ///
1332 /// # Examples 1330 /// # Examples
1333 /// 1331 ///
@@ -1408,14 +1406,18 @@ impl<T> Weak<T> {
1408 /// This can be used to safely get a strong reference (by calling [`upgrade`] 1406 /// This can be used to safely get a strong reference (by calling [`upgrade`]
1409 /// later) or to deallocate the weak count by dropping the `Weak<T>`. 1407 /// later) or to deallocate the weak count by dropping the `Weak<T>`.
1410 /// 1408 ///
1411 /// It takes ownership of one weak count. In case a [`null`] is passed, a dangling [`Weak`] is 1409 /// It takes ownership of one weak count (with the exception of pointers created by [`new`],
1412 /// returned. 1410 /// as these don't have any corresponding weak count).
1413 /// 1411 ///
1414 /// # Safety 1412 /// # Safety
1415 /// 1413 ///
1416 /// The pointer must represent one valid weak count. In other words, it must point to `T` which 1414 /// The pointer must have originated from the [`into_raw`] (or [`as_raw'], provided there was
1417 /// is or *was* managed by an [`Arc`] and the weak count of that [`Arc`] must not have reached 1415 /// a corresponding [`forget`] on the `Weak<T>`) and must still own its potential weak reference
1418 /// 0. It is allowed for the strong count to be 0. 1416 /// count.
1417 ///
1418 /// It is allowed for the strong count to be 0 at the time of calling this, but the weak count
1419 /// must be non-zero or the pointer must have originated from a dangling `Weak<T>` (one created
1420 /// by [`new`]).
1419 /// 1421 ///
1420 /// # Examples 1422 /// # Examples
1421 /// 1423 ///
@@ -1440,11 +1442,13 @@ impl<T> Weak<T> {
1440 /// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none()); 1442 /// assert!(unsafe { Weak::from_raw(raw_2) }.upgrade().is_none());
1441 /// ``` 1443 /// ```
1442 /// 1444 ///
1443 /// [`null`]: ../../std/ptr/fn.null.html 1445 /// [`as_raw`]: struct.Weak.html#method.as_raw
1446 /// [`new`]: struct.Weak.html#method.new
1444 /// [`into_raw`]: struct.Weak.html#method.into_raw 1447 /// [`into_raw`]: struct.Weak.html#method.into_raw
1445 /// [`upgrade`]: struct.Weak.html#method.upgrade 1448 /// [`upgrade`]: struct.Weak.html#method.upgrade
1446 /// [`Weak`]: struct.Weak.html 1449 /// [`Weak`]: struct.Weak.html
1447 /// [`Arc`]: struct.Arc.html 1450 /// [`Arc`]: struct.Arc.html
1451 /// [`forget`]: ../../std/mem/fn.forget.html
1448 #[unstable(feature = "weak_into_raw", issue = "60728")] 1452 #[unstable(feature = "weak_into_raw", issue = "60728")]
1449 pub unsafe fn from_raw(ptr: *const T) -> Self { 1453 pub unsafe fn from_raw(ptr: *const T) -> Self {
1450 if ptr.is_null() { 1454 if ptr.is_null() {
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index ec19392..188ea1a 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -74,6 +74,8 @@
74#![feature(const_fn)] 74#![feature(const_fn)]
75#![feature(const_fn_union)] 75#![feature(const_fn_union)]
76#![feature(const_generics)] 76#![feature(const_generics)]
77#![cfg_attr(not(bootstrap), feature(const_ptr_offset_from))]
78#![cfg_attr(not(bootstrap), feature(const_type_name))]
77#![feature(custom_inner_attributes)] 79#![feature(custom_inner_attributes)]
78#![feature(decl_macro)] 80#![feature(decl_macro)]
79#![feature(doc_cfg)] 81#![feature(doc_cfg)]
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 25b7eec..b2a420f 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -3371,8 +3371,8 @@ impl str {
3371 /// An iterator over the disjoint matches of a pattern within the given string 3371 /// An iterator over the disjoint matches of a pattern within the given string
3372 /// slice. 3372 /// slice.
3373 /// 3373 ///
3374 /// The pattern can be any type that implements the Pattern trait. Notable 3374 /// The pattern can be a `&str`, [`char`], or a closure that determines if
3375 /// examples are `&str`, [`char`], and closures that determines the split. 3375 /// a character matches.
3376 /// 3376 ///
3377 /// # Iterator behavior 3377 /// # Iterator behavior
3378 /// 3378 ///
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 251d49d..6e1aac0 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -27,7 +27,7 @@
27//! 27//!
28//! Atomic variables are safe to share between threads (they implement [`Sync`]) 28//! Atomic variables are safe to share between threads (they implement [`Sync`])
29//! but they do not themselves provide the mechanism for sharing and follow the 29//! but they do not themselves provide the mechanism for sharing and follow the
30//! [threading model](../../../std/thread/index.html#the-threading-model) of rust. 30//! [threading model](../../../std/thread/index.html#the-threading-model) of Rust.
31//! The most common way to share an atomic variable is to put it into an [`Arc`][arc] (an 31//! The most common way to share an atomic variable is to put it into an [`Arc`][arc] (an
32//! atomically-reference-counted shared pointer). 32//! atomically-reference-counted shared pointer).
33//! 33//!
diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs
index 5a940f2..58c1498 100644
--- a/src/librustc/infer/error_reporting/mod.rs
+++ b/src/librustc/infer/error_reporting/mod.rs
@@ -1809,12 +1809,17 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1809 sub_region, 1809 sub_region,
1810 "...", 1810 "...",
1811 ); 1811 );
1812 err.note(&format!( 1812 err.span_note(sup_trace.cause.span, &format!(
1813 "...so that the {}:\nexpected {}\n found {}", 1813 "...so that the {}",
1814 sup_trace.cause.as_requirement_str(), 1814 sup_trace.cause.as_requirement_str()
1815 sup_expected.content(),
1816 sup_found.content()
1817 )); 1815 ));
1816
1817 err.note_expected_found(
1818 &"",
1819 sup_expected,
1820 &"",
1821 sup_found
1822 );
1818 err.emit(); 1823 err.emit();
1819 return; 1824 return;
1820 } 1825 }
diff --git a/src/librustc/infer/error_reporting/note.rs b/src/librustc/infer/error_reporting/note.rs
index c1f840a..4b93373 100644
--- a/src/librustc/infer/error_reporting/note.rs
+++ b/src/librustc/infer/error_reporting/note.rs
@@ -13,12 +13,20 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13 match *origin { 13 match *origin {
14 infer::Subtype(ref trace) => { 14 infer::Subtype(ref trace) => {
15 if let Some((expected, found)) = self.values_str(&trace.values) { 15 if let Some((expected, found)) = self.values_str(&trace.values) {
16 let expected = expected.content(); 16 err.span_note(
17 let found = found.content(); 17 trace.cause.span,
18 err.note(&format!("...so that the {}:\nexpected {}\n found {}", 18 &format!(
19 trace.cause.as_requirement_str(), 19 "...so that the {}",
20 expected, 20 trace.cause.as_requirement_str()
21 found)); 21 )
22 );
23
24 err.note_expected_found(
25 &"",
26 expected,
27 &"",
28 found
29 );
22 } else { 30 } else {
23 // FIXME: this really should be handled at some earlier stage. Our 31 // FIXME: this really should be handled at some earlier stage. Our
24 // handling of region checking when type errors are present is 32 // handling of region checking when type errors are present is
diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc/ty/print/pretty.rs
index fff2f06..745f7d0 100644
--- a/src/librustc/ty/print/pretty.rs
+++ b/src/librustc/ty/print/pretty.rs
@@ -1282,6 +1282,9 @@ impl<F: fmt::Write> Printer<'tcx> for FmtPrinter<'_, 'tcx, F> {
1282 if !self.empty_path { 1282 if !self.empty_path {
1283 write!(self, "::")?; 1283 write!(self, "::")?;
1284 } 1284 }
1285 if ast::Ident::from_str(&name).is_raw_guess() {
1286 write!(self, "r#")?;
1287 }
1285 write!(self, "{}", name)?; 1288 write!(self, "{}", name)?;
1286 1289
1287 // FIXME(eddyb) this will print e.g. `{{closure}}#3`, but it 1290 // FIXME(eddyb) this will print e.g. `{{closure}}#3`, but it
diff --git a/src/librustc_mir/transform/check_consts/mod.rs b/src/librustc_mir/transform/check_consts/mod.rs
index 7095b3f..82ffafb 100644
--- a/src/librustc_mir/transform/check_consts/mod.rs
+++ b/src/librustc_mir/transform/check_consts/mod.rs
@@ -77,7 +77,12 @@ impl ConstKind {
77 let mode = match tcx.hir().body_owner_kind(hir_id) { 77 let mode = match tcx.hir().body_owner_kind(hir_id) {
78 HirKind::Closure => return None, 78 HirKind::Closure => return None,
79 79
80 HirKind::Fn if tcx.is_const_fn(def_id) => ConstKind::ConstFn, 80 // Note: this is deliberately checking for `is_const_fn_raw`, as the `is_const_fn`
81 // checks take into account the `rustc_const_unstable` attribute combined with enabled
82 // feature gates. Otherwise, const qualification would _not check_ whether this
83 // function body follows the `const fn` rules, as an unstable `const fn` would
84 // be considered "not const". More details are available in issue #67053.
85 HirKind::Fn if tcx.is_const_fn_raw(def_id) => ConstKind::ConstFn,
81 HirKind::Fn => return None, 86 HirKind::Fn => return None,
82 87
83 HirKind::Const => ConstKind::Const, 88 HirKind::Const => ConstKind::Const,
diff --git a/src/librustc_parse/Cargo.toml b/src/librustc_parse/Cargo.toml
index 95b3256..fb5cb74 100644
--- a/src/librustc_parse/Cargo.toml
+++ b/src/librustc_parse/Cargo.toml
@@ -12,12 +12,11 @@ doctest = false
12[dependencies] 12[dependencies]
13bitflags = "1.0" 13bitflags = "1.0"
14log = "0.4" 14log = "0.4"
15syntax_pos = { path = "../libsyntax_pos" }
16syntax = { path = "../libsyntax" }
17errors = { path = "../librustc_errors", package = "rustc_errors" }
18rustc_data_structures = { path = "../librustc_data_structures" } 15rustc_data_structures = { path = "../librustc_data_structures" }
19rustc_feature = { path = "../librustc_feature" } 16rustc_feature = { path = "../librustc_feature" }
20rustc_lexer = { path = "../librustc_lexer" } 17rustc_lexer = { path = "../librustc_lexer" }
21rustc_target = { path = "../librustc_target" } 18rustc_errors = { path = "../librustc_errors" }
22smallvec = { version = "1.0", features = ["union", "may_dangle"] }
23rustc_error_codes = { path = "../librustc_error_codes" } 19rustc_error_codes = { path = "../librustc_error_codes" }
20smallvec = { version = "1.0", features = ["union", "may_dangle"] }
21syntax_pos = { path = "../libsyntax_pos" }
22syntax = { path = "../libsyntax" }
diff --git a/src/librustc_parse/config.rs b/src/librustc_parse/config.rs
index 1bf6e9e..30e056e 100644
--- a/src/librustc_parse/config.rs
+++ b/src/librustc_parse/config.rs
@@ -10,6 +10,7 @@
10 10
11use crate::validate_attr; 11use crate::validate_attr;
12use rustc_feature::Features; 12use rustc_feature::Features;
13use rustc_errors::Applicability;
13use syntax::attr::HasAttrs; 14use syntax::attr::HasAttrs;
14use syntax::feature_gate::{feature_err, get_features}; 15use syntax::feature_gate::{feature_err, get_features};
15use syntax::attr; 16use syntax::attr;
@@ -21,7 +22,6 @@ use syntax::sess::ParseSess;
21use syntax::util::map_in_place::MapInPlace; 22use syntax::util::map_in_place::MapInPlace;
22use syntax_pos::symbol::sym; 23use syntax_pos::symbol::sym;
23 24
24use errors::Applicability;
25use smallvec::SmallVec; 25use smallvec::SmallVec;
26 26
27/// A folder that strips out items that do not belong in the current configuration. 27/// A folder that strips out items that do not belong in the current configuration.
diff --git a/src/librustc_parse/lexer/mod.rs b/src/librustc_parse/lexer/mod.rs
index 5de63cb..ddcfea1 100644
--- a/src/librustc_parse/lexer/mod.rs
+++ b/src/librustc_parse/lexer/mod.rs
@@ -1,16 +1,15 @@
1use rustc_data_structures::sync::Lrc;
2use rustc_errors::{FatalError, DiagnosticBuilder};
3use rustc_lexer::Base;
4use rustc_lexer::unescape;
1use syntax::token::{self, Token, TokenKind}; 5use syntax::token::{self, Token, TokenKind};
2use syntax::sess::ParseSess; 6use syntax::sess::ParseSess;
3use syntax::symbol::{sym, Symbol};
4use syntax::util::comments; 7use syntax::util::comments;
5 8use syntax_pos::symbol::{sym, Symbol};
6use errors::{FatalError, DiagnosticBuilder};
7use syntax_pos::{BytePos, Pos, Span}; 9use syntax_pos::{BytePos, Pos, Span};
8use rustc_lexer::Base;
9use rustc_lexer::unescape;
10 10
11use std::char; 11use std::char;
12use std::convert::TryInto; 12use std::convert::TryInto;
13use rustc_data_structures::sync::Lrc;
14use log::debug; 13use log::debug;
15 14
16mod tokentrees; 15mod tokentrees;
diff --git a/src/librustc_parse/lexer/tokentrees.rs b/src/librustc_parse/lexer/tokentrees.rs
index 1353591..5791c63 100644
--- a/src/librustc_parse/lexer/tokentrees.rs
+++ b/src/librustc_parse/lexer/tokentrees.rs
@@ -1,13 +1,11 @@
1use rustc_data_structures::fx::FxHashMap;
2use syntax_pos::Span;
3
4use super::{StringReader, UnmatchedBrace}; 1use super::{StringReader, UnmatchedBrace};
5 2
3use rustc_data_structures::fx::FxHashMap;
4use rustc_errors::PResult;
6use syntax::print::pprust::token_to_string; 5use syntax::print::pprust::token_to_string;
7use syntax::token::{self, Token}; 6use syntax::token::{self, Token};
8use syntax::tokenstream::{DelimSpan, IsJoint::{self, *}, TokenStream, TokenTree, TreeAndJoint}; 7use syntax::tokenstream::{DelimSpan, IsJoint::{self, *}, TokenStream, TokenTree, TreeAndJoint};
9 8use syntax_pos::Span;
10use errors::PResult;
11 9
12impl<'a> StringReader<'a> { 10impl<'a> StringReader<'a> {
13 crate fn into_token_trees(self) -> (PResult<'a, TokenStream>, Vec<UnmatchedBrace>) { 11 crate fn into_token_trees(self) -> (PResult<'a, TokenStream>, Vec<UnmatchedBrace>) {
diff --git a/src/librustc_parse/lexer/unicode_chars.rs b/src/librustc_parse/lexer/unicode_chars.rs
index 6eb995b6..edfebc7 100644
--- a/src/librustc_parse/lexer/unicode_chars.rs
+++ b/src/librustc_parse/lexer/unicode_chars.rs
@@ -2,9 +2,9 @@
2// http://www.unicode.org/Public/security/10.0.0/confusables.txt 2// http://www.unicode.org/Public/security/10.0.0/confusables.txt
3 3
4use super::StringReader; 4use super::StringReader;
5use errors::{Applicability, DiagnosticBuilder};
6use syntax_pos::{BytePos, Pos, Span, symbol::kw};
7use crate::token; 5use crate::token;
6use rustc_errors::{Applicability, DiagnosticBuilder};
7use syntax_pos::{BytePos, Pos, Span, symbol::kw};
8 8
9#[rustfmt::skip] // for line breaks 9#[rustfmt::skip] // for line breaks
10const UNICODE_ARRAY: &[(char, &str, char)] = &[ 10const UNICODE_ARRAY: &[(char, &str, char)] = &[
diff --git a/src/librustc_parse/lib.rs b/src/librustc_parse/lib.rs
index a22b383..a222f3f 100644
--- a/src/librustc_parse/lib.rs
+++ b/src/librustc_parse/lib.rs
@@ -8,7 +8,7 @@ use syntax::sess::ParseSess;
8use syntax::token::{self, Nonterminal}; 8use syntax::token::{self, Nonterminal};
9use syntax::tokenstream::{self, TokenStream, TokenTree}; 9use syntax::tokenstream::{self, TokenStream, TokenTree};
10 10
11use errors::{PResult, FatalError, Level, Diagnostic}; 11use rustc_errors::{PResult, FatalError, Level, Diagnostic};
12use rustc_data_structures::sync::Lrc; 12use rustc_data_structures::sync::Lrc;
13use syntax_pos::{Span, SourceFile, FileName}; 13use syntax_pos::{Span, SourceFile, FileName};
14 14
@@ -53,7 +53,7 @@ pub enum DirectoryOwnership {
53macro_rules! panictry_buffer { 53macro_rules! panictry_buffer {
54 ($handler:expr, $e:expr) => ({ 54 ($handler:expr, $e:expr) => ({
55 use std::result::Result::{Ok, Err}; 55 use std::result::Result::{Ok, Err};
56 use errors::FatalError; 56 use rustc_errors::FatalError;
57 match $e { 57 match $e {
58 Ok(e) => e, 58 Ok(e) => e,
59 Err(errs) => { 59 Err(errs) => {
diff --git a/src/librustc_parse/parser/attr.rs b/src/librustc_parse/parser/attr.rs
index c726140..b2ae934 100644
--- a/src/librustc_parse/parser/attr.rs
+++ b/src/librustc_parse/parser/attr.rs
@@ -1,10 +1,10 @@
1use super::{SeqSep, Parser, TokenType, PathStyle}; 1use super::{SeqSep, Parser, TokenType, PathStyle};
2use rustc_errors::PResult;
2use syntax::attr; 3use syntax::attr;
3use syntax::ast; 4use syntax::ast;
4use syntax::util::comments; 5use syntax::util::comments;
5use syntax::token::{self, Nonterminal}; 6use syntax::token::{self, Nonterminal};
6use syntax_pos::{Span, Symbol}; 7use syntax_pos::{Span, Symbol};
7use errors::PResult;
8 8
9use log::debug; 9use log::debug;
10 10
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs
index da8bf89..ba125ca 100644
--- a/src/librustc_parse/parser/diagnostics.rs
+++ b/src/librustc_parse/parser/diagnostics.rs
@@ -1,25 +1,22 @@
1use super::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, SeqSep, Parser}; 1use super::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, SeqSep, Parser};
2 2
3use syntax::ast::{ 3use rustc_data_structures::fx::FxHashSet;
4 self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item, ItemKind, 4use rustc_errors::{self, PResult, Applicability, DiagnosticBuilder, Handler, pluralize};
5 Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind, 5use rustc_error_codes::*;
6}; 6use syntax::ast::{self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item};
7use syntax::ast::{ItemKind, Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind};
7use syntax::token::{self, TokenKind, token_can_begin_expr}; 8use syntax::token::{self, TokenKind, token_can_begin_expr};
8use syntax::print::pprust; 9use syntax::print::pprust;
9use syntax::ptr::P; 10use syntax::ptr::P;
10use syntax::symbol::{kw, sym};
11use syntax::ThinVec; 11use syntax::ThinVec;
12use syntax::util::parser::AssocOp; 12use syntax::util::parser::AssocOp;
13use syntax::struct_span_err; 13use syntax::struct_span_err;
14 14use syntax_pos::symbol::{kw, sym};
15use errors::{PResult, Applicability, DiagnosticBuilder, pluralize};
16use rustc_data_structures::fx::FxHashSet;
17use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError}; 15use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError};
16
18use log::{debug, trace}; 17use log::{debug, trace};
19use std::mem; 18use std::mem;
20 19
21use rustc_error_codes::*;
22
23const TURBOFISH: &'static str = "use `::<...>` instead of `<...>` to specify type arguments"; 20const TURBOFISH: &'static str = "use `::<...>` instead of `<...>` to specify type arguments";
24 21
25/// Creates a placeholder argument. 22/// Creates a placeholder argument.
@@ -61,10 +58,10 @@ pub enum Error {
61} 58}
62 59
63impl Error { 60impl Error {
64 fn span_err<S: Into<MultiSpan>>( 61 fn span_err(
65 self, 62 self,
66 sp: S, 63 sp: impl Into<MultiSpan>,
67 handler: &errors::Handler, 64 handler: &Handler,
68 ) -> DiagnosticBuilder<'_> { 65 ) -> DiagnosticBuilder<'_> {
69 match self { 66 match self {
70 Error::FileNotFoundForModule { 67 Error::FileNotFoundForModule {
@@ -212,7 +209,7 @@ impl<'a> Parser<'a> {
212 self.sess.span_diagnostic.span_bug(sp, m) 209 self.sess.span_diagnostic.span_bug(sp, m)
213 } 210 }
214 211
215 pub(super) fn diagnostic(&self) -> &'a errors::Handler { 212 pub(super) fn diagnostic(&self) -> &'a Handler {
216 &self.sess.span_diagnostic 213 &self.sess.span_diagnostic
217 } 214 }
218 215
diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs
index 1112274..3cd4988 100644
--- a/src/librustc_parse/parser/expr.rs
+++ b/src/librustc_parse/parser/expr.rs
@@ -4,23 +4,20 @@ use super::pat::{GateOr, PARAM_EXPECTED};
4use super::diagnostics::Error; 4use super::diagnostics::Error;
5use crate::maybe_recover_from_interpolated_ty_qpath; 5use crate::maybe_recover_from_interpolated_ty_qpath;
6 6
7use syntax::ast::{ 7use rustc_data_structures::thin_vec::ThinVec;
8 self, DUMMY_NODE_ID, Attribute, AttrStyle, Ident, CaptureBy, BlockCheckMode, 8use rustc_errors::{PResult, Applicability};
9 Expr, ExprKind, RangeLimits, Label, Movability, IsAsync, Arm, Ty, TyKind, 9use syntax::ast::{self, DUMMY_NODE_ID, Attribute, AttrStyle, Ident, CaptureBy, BlockCheckMode};
10 FunctionRetTy, Param, FnDecl, BinOpKind, BinOp, UnOp, Mac, AnonConst, Field, Lit, 10use syntax::ast::{Expr, ExprKind, RangeLimits, Label, Movability, IsAsync, Arm, Ty, TyKind};
11}; 11use syntax::ast::{FunctionRetTy, Param, FnDecl, BinOpKind, BinOp, UnOp, Mac, AnonConst, Field, Lit};
12use syntax::token::{self, Token, TokenKind}; 12use syntax::token::{self, Token, TokenKind};
13use syntax::print::pprust; 13use syntax::print::pprust;
14use syntax::ptr::P; 14use syntax::ptr::P;
15use syntax::source_map::{self, Span};
16use syntax::util::classify; 15use syntax::util::classify;
17use syntax::util::literal::LitError; 16use syntax::util::literal::LitError;
18use syntax::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par}; 17use syntax::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par};
19use syntax_pos::symbol::{kw, sym}; 18use syntax_pos::source_map::{self, Span};
20use syntax_pos::Symbol; 19use syntax_pos::symbol::{kw, sym, Symbol};
21use errors::{PResult, Applicability};
22use std::mem; 20use std::mem;
23use rustc_data_structures::thin_vec::ThinVec;
24 21
25/// Possibly accepts an `token::Interpolated` expression (a pre-parsed expression 22/// Possibly accepts an `token::Interpolated` expression (a pre-parsed expression
26/// dropped into the token stream, which happens while parsing the result of 23/// dropped into the token stream, which happens while parsing the result of
diff --git a/src/librustc_parse/parser/generics.rs b/src/librustc_parse/parser/generics.rs
index ba5eafc..32819cc 100644
--- a/src/librustc_parse/parser/generics.rs
+++ b/src/librustc_parse/parser/generics.rs
@@ -1,11 +1,11 @@
1use super::Parser; 1use super::Parser;
2 2
3use rustc_errors::PResult;
3use syntax::ast::{self, WhereClause, GenericParam, GenericParamKind, GenericBounds, Attribute}; 4use syntax::ast::{self, WhereClause, GenericParam, GenericParamKind, GenericBounds, Attribute};
4use syntax::token; 5use syntax::token;
5use syntax::source_map::DUMMY_SP; 6use syntax::source_map::DUMMY_SP;
6use syntax_pos::symbol::{kw, sym}; 7use syntax_pos::symbol::{kw, sym};
7 8
8use errors::PResult;
9 9
10impl<'a> Parser<'a> { 10impl<'a> Parser<'a> {
11 /// Parses bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`. 11 /// Parses bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs
index 66a1352..ccf78e6 100644
--- a/src/librustc_parse/parser/item.rs
+++ b/src/librustc_parse/parser/item.rs
@@ -3,6 +3,8 @@ use super::diagnostics::{Error, dummy_arg, ConsumeClosingDelim};
3 3
4use crate::maybe_whole; 4use crate::maybe_whole;
5 5
6use rustc_errors::{PResult, Applicability, DiagnosticBuilder, StashKey};
7use rustc_error_codes::*;
6use syntax::ast::{self, DUMMY_NODE_ID, Ident, Attribute, AttrKind, AttrStyle, AnonConst, Item}; 8use syntax::ast::{self, DUMMY_NODE_ID, Ident, Attribute, AttrKind, AttrStyle, AnonConst, Item};
7use syntax::ast::{ItemKind, ImplItem, ImplItemKind, TraitItem, TraitItemKind, UseTree, UseTreeKind}; 9use syntax::ast::{ItemKind, ImplItem, ImplItemKind, TraitItem, TraitItemKind, UseTree, UseTreeKind};
8use syntax::ast::{PathSegment, IsAuto, Constness, IsAsync, Unsafety, Defaultness, Extern, StrLit}; 10use syntax::ast::{PathSegment, IsAuto, Constness, IsAsync, Unsafety, Defaultness, Extern, StrLit};
@@ -14,16 +16,13 @@ use syntax::ptr::P;
14use syntax::ThinVec; 16use syntax::ThinVec;
15use syntax::token; 17use syntax::token;
16use syntax::tokenstream::{DelimSpan, TokenTree, TokenStream}; 18use syntax::tokenstream::{DelimSpan, TokenTree, TokenStream};
17use syntax::source_map::{self, respan, Span};
18use syntax::struct_span_err; 19use syntax::struct_span_err;
19use syntax_pos::BytePos; 20use syntax_pos::BytePos;
21use syntax_pos::source_map::{self, respan, Span};
20use syntax_pos::symbol::{kw, sym, Symbol}; 22use syntax_pos::symbol::{kw, sym, Symbol};
21 23
22use rustc_error_codes::*;
23
24use log::debug; 24use log::debug;
25use std::mem; 25use std::mem;
26use errors::{PResult, Applicability, DiagnosticBuilder, StashKey};
27 26
28pub(super) type ItemInfo = (Ident, ItemKind, Option<Vec<Attribute>>); 27pub(super) type ItemInfo = (Ident, ItemKind, Option<Vec<Attribute>>);
29 28
diff --git a/src/librustc_parse/parser/mod.rs b/src/librustc_parse/parser/mod.rs
index 2868972..07e99cf 100644
--- a/src/librustc_parse/parser/mod.rs
+++ b/src/librustc_parse/parser/mod.rs
@@ -14,23 +14,20 @@ use diagnostics::Error;
14use crate::{Directory, DirectoryOwnership}; 14use crate::{Directory, DirectoryOwnership};
15use crate::lexer::UnmatchedBrace; 15use crate::lexer::UnmatchedBrace;
16 16
17use syntax::ast::{ 17use rustc_errors::{PResult, Applicability, DiagnosticBuilder, FatalError};
18 self, DUMMY_NODE_ID, AttrStyle, Attribute, CrateSugar, Extern, Ident, StrLit, 18use rustc_data_structures::thin_vec::ThinVec;
19 IsAsync, MacArgs, MacDelimiter, Mutability, Visibility, VisibilityKind, Unsafety, 19use syntax::ast::{self, DUMMY_NODE_ID, AttrStyle, Attribute, CrateSugar, Extern, Ident, StrLit};
20}; 20use syntax::ast::{IsAsync, MacArgs, MacDelimiter, Mutability, Visibility, VisibilityKind, Unsafety};
21
22use syntax::print::pprust; 21use syntax::print::pprust;
23use syntax::ptr::P; 22use syntax::ptr::P;
24use syntax::token::{self, Token, TokenKind, DelimToken}; 23use syntax::token::{self, Token, TokenKind, DelimToken};
25use syntax::tokenstream::{self, DelimSpan, TokenTree, TokenStream, TreeAndJoint}; 24use syntax::tokenstream::{self, DelimSpan, TokenTree, TokenStream, TreeAndJoint};
26use syntax::sess::ParseSess; 25use syntax::sess::ParseSess;
27use syntax::source_map::respan;
28use syntax::struct_span_err; 26use syntax::struct_span_err;
29use syntax::util::comments::{doc_comment_style, strip_doc_comment_decoration}; 27use syntax::util::comments::{doc_comment_style, strip_doc_comment_decoration};
28use syntax_pos::source_map::respan;
30use syntax_pos::symbol::{kw, sym, Symbol}; 29use syntax_pos::symbol::{kw, sym, Symbol};
31use syntax_pos::{Span, BytePos, DUMMY_SP, FileName}; 30use syntax_pos::{Span, BytePos, DUMMY_SP, FileName};
32use rustc_data_structures::thin_vec::ThinVec;
33use errors::{PResult, Applicability, DiagnosticBuilder, FatalError};
34use log::debug; 31use log::debug;
35 32
36use std::borrow::Cow; 33use std::borrow::Cow;
diff --git a/src/librustc_parse/parser/module.rs b/src/librustc_parse/parser/module.rs
index 59d7c2b..3777e17 100644
--- a/src/librustc_parse/parser/module.rs
+++ b/src/librustc_parse/parser/module.rs
@@ -4,13 +4,12 @@ use super::diagnostics::Error;
4 4
5use crate::{new_sub_parser_from_file, DirectoryOwnership}; 5use crate::{new_sub_parser_from_file, DirectoryOwnership};
6 6
7use rustc_errors::PResult;
7use syntax::attr; 8use syntax::attr;
8use syntax::ast::{self, Ident, Attribute, ItemKind, Mod, Crate}; 9use syntax::ast::{self, Ident, Attribute, ItemKind, Mod, Crate};
9use syntax::token::{self, TokenKind}; 10use syntax::token::{self, TokenKind};
10use syntax::source_map::{SourceMap, Span, DUMMY_SP, FileName}; 11use syntax_pos::source_map::{SourceMap, Span, DUMMY_SP, FileName};
11
12use syntax_pos::symbol::sym; 12use syntax_pos::symbol::sym;
13use errors::PResult;
14 13
15use std::path::{self, Path, PathBuf}; 14use std::path::{self, Path, PathBuf};
16 15
@@ -212,13 +211,13 @@ impl<'a> Parser<'a> {
212 // `./<id>.rs` and `./<id>/mod.rs`. 211 // `./<id>.rs` and `./<id>/mod.rs`.
213 let relative_prefix_string; 212 let relative_prefix_string;
214 let relative_prefix = if let Some(ident) = relative { 213 let relative_prefix = if let Some(ident) = relative {
215 relative_prefix_string = format!("{}{}", ident, path::MAIN_SEPARATOR); 214 relative_prefix_string = format!("{}{}", ident.name, path::MAIN_SEPARATOR);
216 &relative_prefix_string 215 &relative_prefix_string
217 } else { 216 } else {
218 "" 217 ""
219 }; 218 };
220 219
221 let mod_name = id.to_string(); 220 let mod_name = id.name.to_string();
222 let default_path_str = format!("{}{}.rs", relative_prefix, mod_name); 221 let default_path_str = format!("{}{}.rs", relative_prefix, mod_name);
223 let secondary_path_str = format!("{}{}{}mod.rs", 222 let secondary_path_str = format!("{}{}{}mod.rs",
224 relative_prefix, mod_name, path::MAIN_SEPARATOR); 223 relative_prefix, mod_name, path::MAIN_SEPARATOR);
diff --git a/src/librustc_parse/parser/pat.rs b/src/librustc_parse/parser/pat.rs
index 1127c4b..42ece96 100644
--- a/src/librustc_parse/parser/pat.rs
+++ b/src/librustc_parse/parser/pat.rs
@@ -1,5 +1,6 @@
1use super::{Parser, PathStyle}; 1use super::{Parser, PathStyle};
2use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole}; 2use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
3use rustc_errors::{PResult, Applicability, DiagnosticBuilder};
3use syntax::ast::{self, Attribute, Pat, PatKind, FieldPat, RangeEnd, RangeSyntax, Mac}; 4use syntax::ast::{self, Attribute, Pat, PatKind, FieldPat, RangeEnd, RangeSyntax, Mac};
4use syntax::ast::{BindingMode, Ident, Mutability, Path, QSelf, Expr, ExprKind}; 5use syntax::ast::{BindingMode, Ident, Mutability, Path, QSelf, Expr, ExprKind};
5use syntax::mut_visit::{noop_visit_pat, noop_visit_mac, MutVisitor}; 6use syntax::mut_visit::{noop_visit_pat, noop_visit_mac, MutVisitor};
@@ -7,9 +8,8 @@ use syntax::ptr::P;
7use syntax::print::pprust; 8use syntax::print::pprust;
8use syntax::ThinVec; 9use syntax::ThinVec;
9use syntax::token; 10use syntax::token;
10use syntax::source_map::{respan, Span, Spanned}; 11use syntax_pos::source_map::{respan, Span, Spanned};
11use syntax_pos::symbol::{kw, sym}; 12use syntax_pos::symbol::{kw, sym};
12use errors::{PResult, Applicability, DiagnosticBuilder};
13 13
14type Expected = Option<&'static str>; 14type Expected = Option<&'static str>;
15 15
diff --git a/src/librustc_parse/parser/path.rs b/src/librustc_parse/parser/path.rs
index 75bb67d..70c3458 100644
--- a/src/librustc_parse/parser/path.rs
+++ b/src/librustc_parse/parser/path.rs
@@ -1,16 +1,16 @@
1use super::{Parser, TokenType}; 1use super::{Parser, TokenType};
2use crate::maybe_whole; 2use crate::maybe_whole;
3use rustc_errors::{PResult, Applicability, pluralize};
3use syntax::ast::{self, QSelf, Path, PathSegment, Ident, ParenthesizedArgs, AngleBracketedArgs}; 4use syntax::ast::{self, QSelf, Path, PathSegment, Ident, ParenthesizedArgs, AngleBracketedArgs};
4use syntax::ast::{AnonConst, GenericArg, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode}; 5use syntax::ast::{AnonConst, GenericArg, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode};
5use syntax::ast::MacArgs; 6use syntax::ast::MacArgs;
6use syntax::ThinVec; 7use syntax::ThinVec;
7use syntax::token::{self, Token}; 8use syntax::token::{self, Token};
8use syntax::source_map::{Span, BytePos}; 9use syntax_pos::source_map::{Span, BytePos};
9use syntax_pos::symbol::{kw, sym}; 10use syntax_pos::symbol::{kw, sym};
10 11
11use std::mem; 12use std::mem;
12use log::debug; 13use log::debug;
13use errors::{PResult, Applicability, pluralize};
14 14
15/// Specifies how to parse a path. 15/// Specifies how to parse a path.
16#[derive(Copy, Clone, PartialEq)] 16#[derive(Copy, Clone, PartialEq)]
diff --git a/src/librustc_parse/parser/stmt.rs b/src/librustc_parse/parser/stmt.rs
index b952e88..943b6ec 100644
--- a/src/librustc_parse/parser/stmt.rs
+++ b/src/librustc_parse/parser/stmt.rs
@@ -6,6 +6,7 @@ use super::diagnostics::Error;
6use crate::maybe_whole; 6use crate::maybe_whole;
7use crate::DirectoryOwnership; 7use crate::DirectoryOwnership;
8 8
9use rustc_errors::{PResult, Applicability};
9use syntax::ThinVec; 10use syntax::ThinVec;
10use syntax::ptr::P; 11use syntax::ptr::P;
11use syntax::ast; 12use syntax::ast;
@@ -13,11 +14,10 @@ use syntax::ast::{DUMMY_NODE_ID, Stmt, StmtKind, Local, Block, BlockCheckMode, E
13use syntax::ast::{Attribute, AttrStyle, VisibilityKind, MacStmtStyle, Mac}; 14use syntax::ast::{Attribute, AttrStyle, VisibilityKind, MacStmtStyle, Mac};
14use syntax::util::classify; 15use syntax::util::classify;
15use syntax::token; 16use syntax::token;
16use syntax::source_map::{respan, Span}; 17use syntax_pos::source_map::{respan, Span};
17use syntax::symbol::{kw, sym}; 18use syntax_pos::symbol::{kw, sym};
18 19
19use std::mem; 20use std::mem;
20use errors::{PResult, Applicability};
21 21
22impl<'a> Parser<'a> { 22impl<'a> Parser<'a> {
23 /// Parses a statement. This stops just before trailing semicolons on everything but items. 23 /// Parses a statement. This stops just before trailing semicolons on everything but items.
diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs
index 3214279..84ffef6 100644
--- a/src/librustc_parse/parser/ty.rs
+++ b/src/librustc_parse/parser/ty.rs
@@ -3,19 +3,17 @@ use super::item::ParamCfg;
3 3
4use crate::{maybe_whole, maybe_recover_from_interpolated_ty_qpath}; 4use crate::{maybe_whole, maybe_recover_from_interpolated_ty_qpath};
5 5
6use rustc_errors::{PResult, Applicability, pluralize};
7use rustc_error_codes::*;
6use syntax::ptr::P; 8use syntax::ptr::P;
7use syntax::ast::{self, Ty, TyKind, MutTy, BareFnTy, FunctionRetTy, GenericParam, Lifetime, Ident}; 9use syntax::ast::{self, Ty, TyKind, MutTy, BareFnTy, FunctionRetTy, GenericParam, Lifetime, Ident};
8use syntax::ast::{TraitBoundModifier, TraitObjectSyntax, GenericBound, GenericBounds, PolyTraitRef}; 10use syntax::ast::{TraitBoundModifier, TraitObjectSyntax, GenericBound, GenericBounds, PolyTraitRef};
9use syntax::ast::{Mutability, AnonConst, Mac}; 11use syntax::ast::{Mutability, AnonConst, Mac};
10use syntax::token::{self, Token}; 12use syntax::token::{self, Token};
11use syntax::source_map::Span;
12use syntax::struct_span_fatal; 13use syntax::struct_span_fatal;
14use syntax_pos::source_map::Span;
13use syntax_pos::symbol::kw; 15use syntax_pos::symbol::kw;
14 16
15use errors::{PResult, Applicability, pluralize};
16
17use rustc_error_codes::*;
18
19/// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`, 17/// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`,
20/// `IDENT<<u8 as Trait>::AssocTy>`. 18/// `IDENT<<u8 as Trait>::AssocTy>`.
21/// 19///
diff --git a/src/librustc_parse/validate_attr.rs b/src/librustc_parse/validate_attr.rs
index 8601add..97e9cb8 100644
--- a/src/librustc_parse/validate_attr.rs
+++ b/src/librustc_parse/validate_attr.rs
@@ -1,6 +1,6 @@
1//! Meta-syntax validation logic of attributes for post-expansion. 1//! Meta-syntax validation logic of attributes for post-expansion.
2 2
3use errors::{PResult, Applicability}; 3use rustc_errors::{PResult, Applicability};
4use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP}; 4use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP};
5use syntax::ast::{self, Attribute, AttrKind, Ident, MacArgs, MetaItem, MetaItemKind}; 5use syntax::ast::{self, Attribute, AttrKind, Ident, MacArgs, MetaItem, MetaItemKind};
6use syntax::attr::mk_name_value_item_str; 6use syntax::attr::mk_name_value_item_str;
diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs
index 4331d44..32df6c4 100644
--- a/src/librustc_typeck/check/demand.rs
+++ b/src/librustc_typeck/check/demand.rs
@@ -65,13 +65,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
65 } 65 }
66 } 66 }
67 67
68 pub fn demand_eqtype_pat( 68 pub fn demand_eqtype_pat_diag(
69 &self, 69 &self,
70 cause_span: Span, 70 cause_span: Span,
71 expected: Ty<'tcx>, 71 expected: Ty<'tcx>,
72 actual: Ty<'tcx>, 72 actual: Ty<'tcx>,
73 match_expr_span: Option<Span>, 73 match_expr_span: Option<Span>,
74 ) { 74 ) -> Option<DiagnosticBuilder<'tcx>> {
75 let cause = if let Some(span) = match_expr_span { 75 let cause = if let Some(span) = match_expr_span {
76 self.cause( 76 self.cause(
77 cause_span, 77 cause_span,
@@ -80,9 +80,19 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
80 } else { 80 } else {
81 self.misc(cause_span) 81 self.misc(cause_span)
82 }; 82 };
83 self.demand_eqtype_with_origin(&cause, expected, actual).map(|mut err| err.emit()); 83 self.demand_eqtype_with_origin(&cause, expected, actual)
84 } 84 }
85 85
86 pub fn demand_eqtype_pat(
87 &self,
88 cause_span: Span,
89 expected: Ty<'tcx>,
90 actual: Ty<'tcx>,
91 match_expr_span: Option<Span>,
92 ) {
93 self.demand_eqtype_pat_diag(cause_span, expected, actual, match_expr_span)
94 .map(|mut err| err.emit());
95 }
86 96
87 pub fn demand_coerce(&self, 97 pub fn demand_coerce(&self,
88 expr: &hir::Expr, 98 expr: &hir::Expr,
diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs
index 4766360..5bfc60c 100644
--- a/src/librustc_typeck/check/expr.rs
+++ b/src/librustc_typeck/check/expr.rs
@@ -582,11 +582,21 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
582 // If this is a break with a value, we need to type-check 582 // If this is a break with a value, we need to type-check
583 // the expression. Get an expected type from the loop context. 583 // the expression. Get an expected type from the loop context.
584 let opt_coerce_to = { 584 let opt_coerce_to = {
585 // We should release `enclosing_breakables` before the `check_expr_with_hint`
586 // below, so can't move this block of code to the enclosing scope and share
587 // `ctxt` with the second `encloding_breakables` borrow below.
585 let mut enclosing_breakables = self.enclosing_breakables.borrow_mut(); 588 let mut enclosing_breakables = self.enclosing_breakables.borrow_mut();
586 enclosing_breakables.find_breakable(target_id) 589 match enclosing_breakables.opt_find_breakable(target_id) {
587 .coerce 590 Some(ctxt) =>
588 .as_ref() 591 ctxt.coerce.as_ref().map(|coerce| coerce.expected_ty()),
589 .map(|coerce| coerce.expected_ty()) 592 None => { // Avoid ICE when `break` is inside a closure (#65383).
593 self.tcx.sess.delay_span_bug(
594 expr.span,
595 "break was outside loop, but no error was emitted",
596 );
597 return tcx.types.err;
598 }
599 }
590 }; 600 };
591 601
592 // If the loop context is not a `loop { }`, then break with 602 // If the loop context is not a `loop { }`, then break with
diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs
index 9dd3bc6..71d1cd8 100644
--- a/src/librustc_typeck/check/pat.rs
+++ b/src/librustc_typeck/check/pat.rs
@@ -703,7 +703,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
703 let pat_ty = pat_ty.fn_sig(tcx).output(); 703 let pat_ty = pat_ty.fn_sig(tcx).output();
704 let pat_ty = pat_ty.no_bound_vars().expect("expected fn type"); 704 let pat_ty = pat_ty.no_bound_vars().expect("expected fn type");
705 705
706 self.demand_eqtype_pat(pat.span, expected, pat_ty, match_arm_pat_span); 706 // Type-check the tuple struct pattern against the expected type.
707 let diag = self.demand_eqtype_pat_diag(pat.span, expected, pat_ty, match_arm_pat_span);
708 let had_err = diag.is_some();
709 diag.map(|mut err| err.emit());
707 710
708 // Type-check subpatterns. 711 // Type-check subpatterns.
709 if subpats.len() == variant.fields.len() 712 if subpats.len() == variant.fields.len()
@@ -721,7 +724,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
721 } 724 }
722 } else { 725 } else {
723 // Pattern has wrong number of fields. 726 // Pattern has wrong number of fields.
724 self.e0023(pat.span, res, qpath, subpats, &variant.fields, expected); 727 self.e0023(pat.span, res, qpath, subpats, &variant.fields, expected, had_err);
725 on_error(); 728 on_error();
726 return tcx.types.err; 729 return tcx.types.err;
727 } 730 }
@@ -734,8 +737,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
734 res: Res, 737 res: Res,
735 qpath: &hir::QPath, 738 qpath: &hir::QPath,
736 subpats: &'tcx [P<Pat>], 739 subpats: &'tcx [P<Pat>],
737 fields: &[ty::FieldDef], 740 fields: &'tcx [ty::FieldDef],
738 expected: Ty<'tcx> 741 expected: Ty<'tcx>,
742 had_err: bool,
739 ) { 743 ) {
740 let subpats_ending = pluralize!(subpats.len()); 744 let subpats_ending = pluralize!(subpats.len());
741 let fields_ending = pluralize!(fields.len()); 745 let fields_ending = pluralize!(fields.len());
@@ -763,9 +767,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
763 // More generally, the expected type wants a tuple variant with one field of an 767 // More generally, the expected type wants a tuple variant with one field of an
764 // N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern 768 // N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern
765 // with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`. 769 // with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`.
766 let missing_parenthesis = match expected.kind { 770 let missing_parenthesis = match (&expected.kind, fields, had_err) {
767 ty::Adt(_, substs) if fields.len() == 1 => { 771 // #67037: only do this if we could sucessfully type-check the expected type against
768 let field_ty = fields[0].ty(self.tcx, substs); 772 // the tuple struct pattern. Otherwise the substs could get out of range on e.g.,
773 // `let P() = U;` where `P != U` with `struct P<T>(T);`.
774 (ty::Adt(_, substs), [field], false) => {
775 let field_ty = self.field_ty(pat_span, field, substs);
769 match field_ty.kind { 776 match field_ty.kind {
770 ty::Tuple(_) => field_ty.tuple_fields().count() == subpats.len(), 777 ty::Tuple(_) => field_ty.tuple_fields().count() == subpats.len(),
771 _ => false, 778 _ => false,
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index 2af6671..c68e03b 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -869,12 +869,18 @@ impl Hash for Ident {
869 869
870impl fmt::Debug for Ident { 870impl fmt::Debug for Ident {
871 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 871 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
872 if self.is_raw_guess() {
873 write!(f, "r#")?;
874 }
872 write!(f, "{}{:?}", self.name, self.span.ctxt()) 875 write!(f, "{}{:?}", self.name, self.span.ctxt())
873 } 876 }
874} 877}
875 878
876impl fmt::Display for Ident { 879impl fmt::Display for Ident {
877 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 880 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
881 if self.is_raw_guess() {
882 write!(f, "r#")?;
883 }
878 fmt::Display::fmt(&self.name, f) 884 fmt::Display::fmt(&self.name, f)
879 } 885 }
880} 886}
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
index 627609c..3e39c8a 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr
@@ -9,13 +9,21 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { 10LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
11 | ^^ 11 | ^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected Type<'_> 13 --> $DIR/project-fn-ret-invariant.rs:48:13
14 found Type<'a> 14 |
15LL | bar(foo, x)
16 | ^
17 = note: expected `Type<'_>`
18 found `Type<'a>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16 = note: ...so that the expression is assignable: 20note: ...so that the expression is assignable
17 expected Type<'static> 21 --> $DIR/project-fn-ret-invariant.rs:48:4
18 found Type<'_> 22 |
23LL | bar(foo, x)
24 | ^^^^^^^^^^^
25 = note: expected `Type<'static>`
26 found `Type<'_>`
19 27
20error: aborting due to previous error 28error: aborting due to previous error
21 29
diff --git a/src/test/ui/c-variadic/variadic-ffi-4.stderr b/src/test/ui/c-variadic/variadic-ffi-4.stderr
index c80ed5e..cd4cd8b 100644
--- a/src/test/ui/c-variadic/variadic-ffi-4.stderr
+++ b/src/test/ui/c-variadic/variadic-ffi-4.stderr
@@ -49,9 +49,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
49 | 49 |
50LL | let _ = ap.with_copy(|ap| { ap }); 50LL | let _ = ap.with_copy(|ap| { ap });
51 | ^^^^^^^^^^^ 51 | ^^^^^^^^^^^
52 = note: ...so that the expression is assignable: 52note: ...so that the expression is assignable
53 expected core::ffi::VaList<'_, '_> 53 --> $DIR/variadic-ffi-4.rs:16:33
54 found core::ffi::VaList<'_, '_> 54 |
55LL | let _ = ap.with_copy(|ap| { ap });
56 | ^^
57 = note: expected `core::ffi::VaList<'_, '_>`
58 found `core::ffi::VaList<'_, '_>`
55note: but, the lifetime must be valid for the method call at 16:13... 59note: but, the lifetime must be valid for the method call at 16:13...
56 --> $DIR/variadic-ffi-4.rs:16:13 60 --> $DIR/variadic-ffi-4.rs:16:13
57 | 61 |
diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.rs b/src/test/ui/consts/unstable-const-fn-in-libcore.rs
new file mode 100644
index 0000000..cad1516
--- /dev/null
+++ b/src/test/ui/consts/unstable-const-fn-in-libcore.rs
@@ -0,0 +1,29 @@
1// This is a non-regression test for const-qualification of unstable items in libcore
2// as explained in issue #67053.
3// const-qualification could miss some `const fn`s if they were unstable and the feature
4// gate was not enabled in libcore.
5
6#![stable(feature = "core", since = "1.6.0")]
7#![feature(const_if_match)]
8#![feature(rustc_const_unstable)]
9#![feature(staged_api)]
10
11enum Opt<T> {
12 Some(T),
13 None,
14}
15
16impl<T> Opt<T> {
17 #[rustc_const_unstable(feature = "foo")]
18 #[stable(feature = "rust1", since = "1.0.0")]
19 const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
20 //~^ ERROR destructors cannot be evaluated at compile-time
21 //~| ERROR destructors cannot be evaluated at compile-time
22 match self {
23 Opt::Some(t) => t,
24 Opt::None => f(), //~ ERROR E0015
25 }
26 }
27}
28
29fn main() {}
diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr
new file mode 100644
index 0000000..a8455ce
--- /dev/null
+++ b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr
@@ -0,0 +1,22 @@
1error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
2 --> $DIR/unstable-const-fn-in-libcore.rs:24:26
3 |
4LL | Opt::None => f(),
5 | ^^^
6
7error[E0493]: destructors cannot be evaluated at compile-time
8 --> $DIR/unstable-const-fn-in-libcore.rs:19:53
9 |
10LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
11 | ^ constant functions cannot evaluate destructors
12
13error[E0493]: destructors cannot be evaluated at compile-time
14 --> $DIR/unstable-const-fn-in-libcore.rs:19:47
15 |
16LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
17 | ^^^^ constant functions cannot evaluate destructors
18
19error: aborting due to 3 previous errors
20
21Some errors have detailed explanations: E0015, E0493.
22For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
index 5e80c67..3300293 100644
--- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
+++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
@@ -9,13 +9,21 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) { 10LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
11 | ^^ 11 | ^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected std::boxed::Box<dyn std::fmt::Debug> 13 --> $DIR/dyn-trait.rs:20:16
14 found std::boxed::Box<(dyn std::fmt::Debug + 'a)> 14 |
15LL | static_val(x);
16 | ^
17 = note: expected `std::boxed::Box<dyn std::fmt::Debug>`
18 found `std::boxed::Box<(dyn std::fmt::Debug + 'a)>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16 = note: ...so that the types are compatible: 20note: ...so that the types are compatible
17 expected StaticTrait 21 --> $DIR/dyn-trait.rs:20:5
18 found StaticTrait 22 |
23LL | static_val(x);
24 | ^^^^^^^^^^
25 = note: expected `StaticTrait`
26 found `StaticTrait`
19 27
20error: aborting due to previous error 28error: aborting due to previous error
21 29
diff --git a/src/test/ui/issues/issue-16683.stderr b/src/test/ui/issues/issue-16683.stderr
index b663e21..99700f2 100644
--- a/src/test/ui/issues/issue-16683.stderr
+++ b/src/test/ui/issues/issue-16683.stderr
@@ -21,9 +21,13 @@ note: but, the lifetime must be valid for the lifetime `'a` as defined on the tr
21 | 21 |
22LL | trait T<'a> { 22LL | trait T<'a> {
23 | ^^ 23 | ^^
24 = note: ...so that the types are compatible: 24note: ...so that the types are compatible
25 expected &'a Self 25 --> $DIR/issue-16683.rs:4:14
26 found &Self 26 |
27LL | self.a();
28 | ^
29 = note: expected `&'a Self`
30 found `&Self`
27 31
28error: aborting due to previous error 32error: aborting due to previous error
29 33
diff --git a/src/test/ui/issues/issue-17758.stderr b/src/test/ui/issues/issue-17758.stderr
index adcbb62..adfc3f508 100644
--- a/src/test/ui/issues/issue-17758.stderr
+++ b/src/test/ui/issues/issue-17758.stderr
@@ -22,9 +22,13 @@ note: but, the lifetime must be valid for the lifetime `'a` as defined on the tr
22 | 22 |
23LL | trait Foo<'a> { 23LL | trait Foo<'a> {
24 | ^^ 24 | ^^
25 = note: ...so that the types are compatible: 25note: ...so that the types are compatible
26 expected &'a Self 26 --> $DIR/issue-17758.rs:7:14
27 found &Self 27 |
28LL | self.foo();
29 | ^^^
30 = note: expected `&'a Self`
31 found `&Self`
28 32
29error: aborting due to previous error 33error: aborting due to previous error
30 34
diff --git a/src/test/ui/issues/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr
index 13c9c09..c7fd134 100644
--- a/src/test/ui/issues/issue-20831-debruijn.stderr
+++ b/src/test/ui/issues/issue-20831-debruijn.stderr
@@ -88,9 +88,19 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on
88 | 88 |
89LL | impl<'a> Publisher<'a> for MyStruct<'a> { 89LL | impl<'a> Publisher<'a> for MyStruct<'a> {
90 | ^^ 90 | ^^
91 = note: ...so that the types are compatible: 91note: ...so that the types are compatible
92 expected Publisher<'_> 92 --> $DIR/issue-20831-debruijn.rs:28:5
93 found Publisher<'_> 93 |
94LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
95LL | | // Not obvious, but there is an implicit lifetime here -------^
96LL | |
97LL | |
98... |
99LL | | self.sub = t;
100LL | | }
101 | |_____^
102 = note: expected `Publisher<'_>`
103 found `Publisher<'_>`
94 104
95error: aborting due to 3 previous errors 105error: aborting due to 3 previous errors
96 106
diff --git a/src/test/ui/issues/issue-52213.stderr b/src/test/ui/issues/issue-52213.stderr
index b79a5dd..a8960f7 100644
--- a/src/test/ui/issues/issue-52213.stderr
+++ b/src/test/ui/issues/issue-52213.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { 10LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected (&&(T,),) 13 --> $DIR/issue-52213.rs:2:11
14 found (&&'a (T,),) 14 |
15LL | match (&t,) {
16 | ^^^^^
17 = note: expected `(&&(T,),)`
18 found `(&&'a (T,),)`
15note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 1:27... 19note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 1:27...
16 --> $DIR/issue-52213.rs:1:27 20 --> $DIR/issue-52213.rs:1:27
17 | 21 |
diff --git a/src/test/ui/issues/issue-55796.stderr b/src/test/ui/issues/issue-55796.stderr
index 7b910f5..b8cafdc 100644
--- a/src/test/ui/issues/issue-55796.stderr
+++ b/src/test/ui/issues/issue-55796.stderr
@@ -15,9 +15,13 @@ note: ...so that the type `std::iter::Map<<Self as Graph<'a>>::EdgesIter, [closu
15LL | Box::new(self.out_edges(u).map(|e| e.target())) 15LL | Box::new(self.out_edges(u).map(|e| e.target()))
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 = note: but, the lifetime must be valid for the static lifetime... 17 = note: but, the lifetime must be valid for the static lifetime...
18 = note: ...so that the expression is assignable: 18note: ...so that the expression is assignable
19 expected std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)> 19 --> $DIR/issue-55796.rs:16:9
20 found std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>> 20 |
21LL | Box::new(self.out_edges(u).map(|e| e.target()))
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
24 found `std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>`
21 25
22error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements 26error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
23 --> $DIR/issue-55796.rs:21:9 27 --> $DIR/issue-55796.rs:21:9
@@ -36,9 +40,13 @@ note: ...so that the type `std::iter::Map<<Self as Graph<'a>>::EdgesIter, [closu
36LL | Box::new(self.in_edges(u).map(|e| e.target())) 40LL | Box::new(self.in_edges(u).map(|e| e.target()))
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 = note: but, the lifetime must be valid for the static lifetime... 42 = note: but, the lifetime must be valid for the static lifetime...
39 = note: ...so that the expression is assignable: 43note: ...so that the expression is assignable
40 expected std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)> 44 --> $DIR/issue-55796.rs:21:9
41 found std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>> 45 |
46LL | Box::new(self.in_edges(u).map(|e| e.target()))
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>`
49 found `std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>`
42 50
43error: aborting due to 2 previous errors 51error: aborting due to 2 previous errors
44 52
diff --git a/src/test/ui/issues/issue-65634-raw-ident-suggestion.rs b/src/test/ui/issues/issue-65634-raw-ident-suggestion.rs
new file mode 100644
index 0000000..b928510
--- /dev/null
+++ b/src/test/ui/issues/issue-65634-raw-ident-suggestion.rs
@@ -0,0 +1,22 @@
1#![allow(non_camel_case_types)]
2
3trait r#async {
4 fn r#struct(&self) {
5 println!("async");
6 }
7}
8
9trait r#await {
10 fn r#struct(&self) {
11 println!("await");
12 }
13}
14
15struct r#fn {}
16
17impl r#async for r#fn {}
18impl r#await for r#fn {}
19
20fn main() {
21 r#fn {}.r#struct(); //~ ERROR multiple applicable items in scope
22}
diff --git a/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr b/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr
new file mode 100644
index 0000000..c7bb653
--- /dev/null
+++ b/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr
@@ -0,0 +1,22 @@
1error[E0034]: multiple applicable items in scope
2 --> $DIR/issue-65634-raw-ident-suggestion.rs:21:13
3 |
4LL | r#fn {}.r#struct();
5 | ^^^^^^^^ multiple `r#struct` found
6 |
7note: candidate #1 is defined in an impl of the trait `async` for the type `r#fn`
8 --> $DIR/issue-65634-raw-ident-suggestion.rs:4:5
9 |
10LL | fn r#struct(&self) {
11 | ^^^^^^^^^^^^^^^^^^
12 = help: to disambiguate the method call, write `async::r#struct(r#fn {})` instead
13note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn`
14 --> $DIR/issue-65634-raw-ident-suggestion.rs:10:5
15 |
16LL | fn r#struct(&self) {
17 | ^^^^^^^^^^^^^^^^^^
18 = help: to disambiguate the method call, write `await::r#struct(r#fn {})` instead
19
20error: aborting due to previous error
21
22For more information about this error, try `rustc --explain E0034`.
diff --git a/src/test/ui/issues/issue-66702-break-outside-loop-val.rs b/src/test/ui/issues/issue-66702-break-outside-loop-val.rs
new file mode 100644
index 0000000..bd3c00d
--- /dev/null
+++ b/src/test/ui/issues/issue-66702-break-outside-loop-val.rs
@@ -0,0 +1,7 @@
1// Breaks with values inside closures used to ICE (#66863)
2
3fn main() {
4 'some_label: loop {
5 || break 'some_label (); //~ ERROR: `break` inside of a closure
6 }
7}
diff --git a/src/test/ui/issues/issue-66702-break-outside-loop-val.stderr b/src/test/ui/issues/issue-66702-break-outside-loop-val.stderr
new file mode 100644
index 0000000..83bde97
--- /dev/null
+++ b/src/test/ui/issues/issue-66702-break-outside-loop-val.stderr
@@ -0,0 +1,11 @@
1error[E0267]: `break` inside of a closure
2 --> $DIR/issue-66702-break-outside-loop-val.rs:5:12
3 |
4LL | || break 'some_label ();
5 | -- ^^^^^^^^^^^^^^^^^^^^ cannot `break` inside of a closure
6 | |
7 | enclosing closure
8
9error: aborting due to previous error
10
11For more information about this error, try `rustc --explain E0267`.
diff --git a/src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs b/src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs
new file mode 100644
index 0000000..44bd645
--- /dev/null
+++ b/src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs
@@ -0,0 +1,21 @@
1// Regression test for #67037.
2//
3// In type checking patterns, E0023 occurs when the tuple pattern and the expected
4// tuple pattern have different number of fields. For example, as below, `P()`,
5// the tuple struct pattern, has 0 fields, but requires 1 field.
6//
7// In emitting E0023, we try to see if this is a case of e.g., `Some(a, b, c)` but where
8// the scrutinee was of type `Some((a, b, c))`, and suggest that parenthesis be added.
9//
10// However, we did not account for the expected type being different than the tuple pattern type.
11// This caused an issue when the tuple pattern type (`P<T>`) was generic.
12// Specifically, we tried deriving the 0th field's type using the `substs` of the expected type.
13// When attempting to substitute `T`, there was no such substitution, so "out of range" occured.
14
15struct U {} // 0 type parameters offered
16struct P<T>(T); // 1 type parameter wanted
17
18fn main() {
19 let P() = U {}; //~ ERROR mismatched types
20 //~^ ERROR this pattern has 0 fields, but the corresponding tuple struct has 1 field
21}
diff --git a/src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr b/src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
new file mode 100644
index 0000000..521dd02
--- /dev/null
+++ b/src/test/ui/issues/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
@@ -0,0 +1,22 @@
1error[E0308]: mismatched types
2 --> $DIR/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs:19:9
3 |
4LL | let P() = U {};
5 | ^^^ expected struct `U`, found struct `P`
6 |
7 = note: expected struct `U`
8 found struct `P<_>`
9
10error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 1 field
11 --> $DIR/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs:19:9
12 |
13LL | struct P<T>(T); // 1 type parameter wanted
14 | --------------- tuple struct defined here
15...
16LL | let P() = U {};
17 | ^^^ expected 1 field, found 0
18
19error: aborting due to 2 previous errors
20
21Some errors have detailed explanations: E0023, E0308.
22For more information about an error, try `rustc --explain E0023`.
diff --git a/src/test/ui/nll/issue-55394.stderr b/src/test/ui/nll/issue-55394.stderr
index 714a63b..69a6ab0 100644
--- a/src/test/ui/nll/issue-55394.stderr
+++ b/src/test/ui/nll/issue-55394.stderr
@@ -21,9 +21,13 @@ note: but, the lifetime must be valid for the lifetime `'_` as defined on the im
21 | 21 |
22LL | impl Foo<'_> { 22LL | impl Foo<'_> {
23 | ^^ 23 | ^^
24 = note: ...so that the expression is assignable: 24note: ...so that the expression is assignable
25 expected Foo<'_> 25 --> $DIR/issue-55394.rs:9:9
26 found Foo<'_> 26 |
27LL | Foo { bar }
28 | ^^^^^^^^^^^
29 = note: expected `Foo<'_>`
30 found `Foo<'_>`
27 31
28error: aborting due to previous error 32error: aborting due to previous error
29 33
diff --git a/src/test/ui/nll/normalization-bounds-error.stderr b/src/test/ui/nll/normalization-bounds-error.stderr
index 3a152fb..58f2067 100644
--- a/src/test/ui/nll/normalization-bounds-error.stderr
+++ b/src/test/ui/nll/normalization-bounds-error.stderr
@@ -14,9 +14,13 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on
14 | 14 |
15LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} 15LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
16 | ^^ 16 | ^^
17 = note: ...so that the types are compatible: 17note: ...so that the types are compatible
18 expected Visitor<'d> 18 --> $DIR/normalization-bounds-error.rs:12:1
19 found Visitor<'_> 19 |
20LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 = note: expected `Visitor<'d>`
23 found `Visitor<'_>`
20 24
21error: aborting due to previous error 25error: aborting due to previous error
22 26
diff --git a/src/test/ui/nll/type-alias-free-regions.stderr b/src/test/ui/nll/type-alias-free-regions.stderr
index 6986389..5191dec 100644
--- a/src/test/ui/nll/type-alias-free-regions.stderr
+++ b/src/test/ui/nll/type-alias-free-regions.stderr
@@ -11,17 +11,25 @@ LL | / fn from_box(b: Box<B>) -> Self {
11LL | | C { f: b } 11LL | | C { f: b }
12LL | | } 12LL | | }
13 | |_____^ 13 | |_____^
14 = note: ...so that the expression is assignable: 14note: ...so that the expression is assignable
15 expected std::boxed::Box<std::boxed::Box<&isize>> 15 --> $DIR/type-alias-free-regions.rs:17:16
16 found std::boxed::Box<std::boxed::Box<&isize>> 16 |
17LL | C { f: b }
18 | ^
19 = note: expected `std::boxed::Box<std::boxed::Box<&isize>>`
20 found `std::boxed::Box<std::boxed::Box<&isize>>`
17note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6... 21note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6...
18 --> $DIR/type-alias-free-regions.rs:15:6 22 --> $DIR/type-alias-free-regions.rs:15:6
19 | 23 |
20LL | impl<'a> FromBox<'a> for C<'a> { 24LL | impl<'a> FromBox<'a> for C<'a> {
21 | ^^ 25 | ^^
22 = note: ...so that the expression is assignable: 26note: ...so that the expression is assignable
23 expected C<'a> 27 --> $DIR/type-alias-free-regions.rs:17:9
24 found C<'_> 28 |
29LL | C { f: b }
30 | ^^^^^^^^^^
31 = note: expected `C<'a>`
32 found `C<'_>`
25 33
26error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements 34error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
27 --> $DIR/type-alias-free-regions.rs:27:16 35 --> $DIR/type-alias-free-regions.rs:27:16
@@ -36,17 +44,25 @@ LL | / fn from_tuple(b: (B,)) -> Self {
36LL | | C { f: Box::new(b.0) } 44LL | | C { f: Box::new(b.0) }
37LL | | } 45LL | | }
38 | |_____^ 46 | |_____^
39 = note: ...so that the expression is assignable: 47note: ...so that the expression is assignable
40 expected std::boxed::Box<&isize> 48 --> $DIR/type-alias-free-regions.rs:27:25
41 found std::boxed::Box<&isize> 49 |
50LL | C { f: Box::new(b.0) }
51 | ^^^
52 = note: expected `std::boxed::Box<&isize>`
53 found `std::boxed::Box<&isize>`
42note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6... 54note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6...
43 --> $DIR/type-alias-free-regions.rs:25:6 55 --> $DIR/type-alias-free-regions.rs:25:6
44 | 56 |
45LL | impl<'a> FromTuple<'a> for C<'a> { 57LL | impl<'a> FromTuple<'a> for C<'a> {
46 | ^^ 58 | ^^
47 = note: ...so that the expression is assignable: 59note: ...so that the expression is assignable
48 expected C<'a> 60 --> $DIR/type-alias-free-regions.rs:27:9
49 found C<'_> 61 |
62LL | C { f: Box::new(b.0) }
63 | ^^^^^^^^^^^^^^^^^^^^^^
64 = note: expected `C<'a>`
65 found `C<'_>`
50 66
51error: aborting due to 2 previous errors 67error: aborting due to 2 previous errors
52 68
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
index 4ebd991..37be450 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn foo<'a>(_: &'a u32) -> &'static u32 { 10LL | fn foo<'a>(_: &'a u32) -> &'static u32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo<'_> 13 --> $DIR/constant-in-expr-inherent-1.rs:8:5
14 found Foo<'a> 14 |
15LL | <Foo<'a>>::C
16 | ^^^^^^^^^^^^
17 = note: expected `Foo<'_>`
18 found `Foo<'a>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that reference does not outlive borrowed content 20note: ...so that reference does not outlive borrowed content
17 --> $DIR/constant-in-expr-inherent-1.rs:8:5 21 --> $DIR/constant-in-expr-inherent-1.rs:8:5
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
index d61659e..4ee3284 100644
--- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
+++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { 10LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo<'_> 13 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
14 found Foo<'a> 14 |
15LL | T::C
16 | ^^^^
17 = note: expected `Foo<'_>`
18 found `Foo<'a>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that reference does not outlive borrowed content 20note: ...so that reference does not outlive borrowed content
17 --> $DIR/constant-in-expr-trait-item-3.rs:10:5 21 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
index d66322c..1952ee8 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
@@ -19,9 +19,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu
19 | 19 |
20LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { 20LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
21 | ^^ 21 | ^^
22 = note: ...so that the expression is assignable: 22note: ...so that the expression is assignable
23 expected &'b (dyn SomeTrait + 'b) 23 --> $DIR/object-lifetime-default-elision.rs:71:5
24 found &dyn SomeTrait 24 |
25LL | ss
26 | ^^
27 = note: expected `&'b (dyn SomeTrait + 'b)`
28 found `&dyn SomeTrait`
25 29
26error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements 30error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
27 --> $DIR/object-lifetime-default-elision.rs:71:5 31 --> $DIR/object-lifetime-default-elision.rs:71:5
@@ -44,9 +48,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu
44 | 48 |
45LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { 49LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
46 | ^^ 50 | ^^
47 = note: ...so that the expression is assignable: 51note: ...so that the expression is assignable
48 expected &'b (dyn SomeTrait + 'b) 52 --> $DIR/object-lifetime-default-elision.rs:71:5
49 found &dyn SomeTrait 53 |
54LL | ss
55 | ^^
56 = note: expected `&'b (dyn SomeTrait + 'b)`
57 found `&dyn SomeTrait`
50 58
51error: aborting due to 2 previous errors 59error: aborting due to 2 previous errors
52 60
diff --git a/src/test/ui/parser/raw/raw-literal-keywords.rs b/src/test/ui/parser/raw/raw-literal-keywords.rs
index bf9cbcd..a986980 100644
--- a/src/test/ui/parser/raw/raw-literal-keywords.rs
+++ b/src/test/ui/parser/raw/raw-literal-keywords.rs
@@ -11,11 +11,11 @@ fn test_union() {
11} 11}
12 12
13fn test_if_2() { 13fn test_if_2() {
14 let _ = r#if; //~ ERROR cannot find value `if` in this scope 14 let _ = r#if; //~ ERROR cannot find value `r#if` in this scope
15} 15}
16 16
17fn test_struct_2() { 17fn test_struct_2() {
18 let _ = r#struct; //~ ERROR cannot find value `struct` in this scope 18 let _ = r#struct; //~ ERROR cannot find value `r#struct` in this scope
19} 19}
20 20
21fn test_union_2() { 21fn test_union_2() {
diff --git a/src/test/ui/parser/raw/raw-literal-keywords.stderr b/src/test/ui/parser/raw/raw-literal-keywords.stderr
index fd8eda3..f7b6c89 100644
--- a/src/test/ui/parser/raw/raw-literal-keywords.stderr
+++ b/src/test/ui/parser/raw/raw-literal-keywords.stderr
@@ -16,13 +16,13 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found
16LL | r#union Test; 16LL | r#union Test;
17 | ^^^^ expected one of 8 possible tokens 17 | ^^^^ expected one of 8 possible tokens
18 18
19error[E0425]: cannot find value `if` in this scope 19error[E0425]: cannot find value `r#if` in this scope
20 --> $DIR/raw-literal-keywords.rs:14:13 20 --> $DIR/raw-literal-keywords.rs:14:13
21 | 21 |
22LL | let _ = r#if; 22LL | let _ = r#if;
23 | ^^^^ not found in this scope 23 | ^^^^ not found in this scope
24 24
25error[E0425]: cannot find value `struct` in this scope 25error[E0425]: cannot find value `r#struct` in this scope
26 --> $DIR/raw-literal-keywords.rs:18:13 26 --> $DIR/raw-literal-keywords.rs:18:13
27 | 27 |
28LL | let _ = r#struct; 28LL | let _ = r#struct;
diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
index 14934d6..e889651 100644
--- a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
+++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
@@ -34,17 +34,25 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
34 | 34 |
35LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> { 35LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
36 | ^^ 36 | ^^
37 = note: ...so that the expression is assignable: 37note: ...so that the expression is assignable
38 expected &[u8] 38 --> $DIR/region-object-lifetime-in-coercion.rs:26:14
39 found &'a [u8] 39 |
40LL | Box::new(v)
41 | ^
42 = note: expected `&[u8]`
43 found `&'a [u8]`
40note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9... 44note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9...
41 --> $DIR/region-object-lifetime-in-coercion.rs:25:9 45 --> $DIR/region-object-lifetime-in-coercion.rs:25:9
42 | 46 |
43LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> { 47LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
44 | ^^ 48 | ^^
45 = note: ...so that the expression is assignable: 49note: ...so that the expression is assignable
46 expected std::boxed::Box<(dyn Foo + 'b)> 50 --> $DIR/region-object-lifetime-in-coercion.rs:26:5
47 found std::boxed::Box<dyn Foo> 51 |
52LL | Box::new(v)
53 | ^^^^^^^^^^^
54 = note: expected `std::boxed::Box<(dyn Foo + 'b)>`
55 found `std::boxed::Box<dyn Foo>`
48 56
49error: aborting due to 4 previous errors 57error: aborting due to 4 previous errors
50 58
diff --git a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
index a636c9e..865e967 100644
--- a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
+++ b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp
9 | 9 |
10LL | impl<'a> Foo<'static> for &'a i32 { 10LL | impl<'a> Foo<'static> for &'a i32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo<'static> 13 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10
14 found Foo<'static> 14 |
15LL | impl<'a> Foo<'static> for &'a i32 {
16 | ^^^^^^^^^^^^
17 = note: expected `Foo<'static>`
18 found `Foo<'static>`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that the type `&i32` will meet its required lifetime bounds 20note: ...so that the type `&i32` will meet its required lifetime bounds
17 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10 21 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10
@@ -30,9 +34,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp
30 | 34 |
31LL | impl<'a,'b> Foo<'b> for &'a i64 { 35LL | impl<'a,'b> Foo<'b> for &'a i64 {
32 | ^^ 36 | ^^
33 = note: ...so that the types are compatible: 37note: ...so that the types are compatible
34 expected Foo<'b> 38 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:13
35 found Foo<'_> 39 |
40LL | impl<'a,'b> Foo<'b> for &'a i64 {
41 | ^^^^^^^
42 = note: expected `Foo<'b>`
43 found `Foo<'_>`
36note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 19:9... 44note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 19:9...
37 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9 45 --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9
38 | 46 |
diff --git a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
index 81256e3..6a34871 100644
--- a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
+++ b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp
9 | 9 |
10LL | impl<'a> Foo for &'a i32 { 10LL | impl<'a> Foo for &'a i32 {
11 | ^^ 11 | ^^
12 = note: ...so that the types are compatible: 12note: ...so that the types are compatible
13 expected Foo 13 --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10
14 found Foo 14 |
15LL | impl<'a> Foo for &'a i32 {
16 | ^^^
17 = note: expected `Foo`
18 found `Foo`
15 = note: but, the lifetime must be valid for the static lifetime... 19 = note: but, the lifetime must be valid for the static lifetime...
16note: ...so that the type `&i32` will meet its required lifetime bounds 20note: ...so that the type `&i32` will meet its required lifetime bounds
17 --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10 21 --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10
diff --git a/src/test/ui/regions/regions-close-object-into-object-2.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr
index 8e473da..28873ab 100644
--- a/src/test/ui/regions/regions-close-object-into-object-2.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr
@@ -15,9 +15,13 @@ note: ...so that the type `(dyn A<T> + 'a)` is not borrowed for too long
15LL | box B(&*v) as Box<dyn X> 15LL | box B(&*v) as Box<dyn X>
16 | ^^^ 16 | ^^^
17 = note: but, the lifetime must be valid for the static lifetime... 17 = note: but, the lifetime must be valid for the static lifetime...
18 = note: ...so that the expression is assignable: 18note: ...so that the expression is assignable
19 expected std::boxed::Box<(dyn X + 'static)> 19 --> $DIR/regions-close-object-into-object-2.rs:10:5
20 found std::boxed::Box<dyn X> 20 |
21LL | box B(&*v) as Box<dyn X>
22 | ^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn X + 'static)>`
24 found `std::boxed::Box<dyn X>`
21 25
22error: aborting due to previous error 26error: aborting due to previous error
23 27
diff --git a/src/test/ui/regions/regions-close-object-into-object-4.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr
index c80d13e..449a5b5 100644
--- a/src/test/ui/regions/regions-close-object-into-object-4.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr
@@ -15,9 +15,13 @@ note: ...so that the type `(dyn A<U> + 'a)` is not borrowed for too long
15LL | box B(&*v) as Box<dyn X> 15LL | box B(&*v) as Box<dyn X>
16 | ^^^ 16 | ^^^
17 = note: but, the lifetime must be valid for the static lifetime... 17 = note: but, the lifetime must be valid for the static lifetime...
18 = note: ...so that the expression is assignable: 18note: ...so that the expression is assignable
19 expected std::boxed::Box<(dyn X + 'static)> 19 --> $DIR/regions-close-object-into-object-4.rs:10:5
20 found std::boxed::Box<dyn X> 20 |
21LL | box B(&*v) as Box<dyn X>
22 | ^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: expected `std::boxed::Box<(dyn X + 'static)>`
24 found `std::boxed::Box<dyn X>`
21 25
22error: aborting due to previous error 26error: aborting due to previous error
23 27
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
index ef21316..b2a7afa 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
+++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
@@ -19,9 +19,13 @@ note: but, the lifetime must be valid for the lifetime `'c` as defined on the fu
19 | 19 |
20LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> { 20LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
21 | ^^ 21 | ^^
22 = note: ...so that the expression is assignable: 22note: ...so that the expression is assignable
23 expected std::boxed::Box<(dyn SomeTrait + 'c)> 23 --> $DIR/regions-close-over-type-parameter-multiple.rs:20:5
24 found std::boxed::Box<dyn SomeTrait> 24 |
25LL | box v as Box<dyn SomeTrait + 'a>
26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 = note: expected `std::boxed::Box<(dyn SomeTrait + 'c)>`
28 found `std::boxed::Box<dyn SomeTrait>`
25 29
26error: aborting due to previous error 30error: aborting due to previous error
27 31
diff --git a/src/test/ui/regions/regions-creating-enums4.stderr b/src/test/ui/regions/regions-creating-enums4.stderr
index 12b8978..58f74e4 100644
--- a/src/test/ui/regions/regions-creating-enums4.stderr
+++ b/src/test/ui/regions/regions-creating-enums4.stderr
@@ -9,17 +9,25 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun
9 | 9 |
10LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { 10LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
11 | ^^ 11 | ^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &Ast<'_> 13 --> $DIR/regions-creating-enums4.rs:7:14
14 found &Ast<'a> 14 |
15LL | Ast::Add(x, y)
16 | ^
17 = note: expected `&Ast<'_>`
18 found `&Ast<'a>`
15note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 6:19... 19note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 6:19...
16 --> $DIR/regions-creating-enums4.rs:6:19 20 --> $DIR/regions-creating-enums4.rs:6:19
17 | 21 |
18LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { 22LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
19 | ^^ 23 | ^^
20 = note: ...so that the expression is assignable: 24note: ...so that the expression is assignable
21 expected Ast<'b> 25 --> $DIR/regions-creating-enums4.rs:7:5
22 found Ast<'_> 26 |
27LL | Ast::Add(x, y)
28 | ^^^^^^^^^^^^^^
29 = note: expected `Ast<'b>`
30 found `Ast<'_>`
23 31
24error: aborting due to previous error 32error: aborting due to previous error
25 33
diff --git a/src/test/ui/regions/regions-escape-method.stderr b/src/test/ui/regions/regions-escape-method.stderr
index b93dd0d..ffc2a25 100644
--- a/src/test/ui/regions/regions-escape-method.stderr
+++ b/src/test/ui/regions/regions-escape-method.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | s.f(|p| p) 10LL | s.f(|p| p)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &i32 13 --> $DIR/regions-escape-method.rs:15:13
14 found &i32 14 |
15LL | s.f(|p| p)
16 | ^
17 = note: expected `&i32`
18 found `&i32`
15note: but, the lifetime must be valid for the method call at 15:5... 19note: but, the lifetime must be valid for the method call at 15:5...
16 --> $DIR/regions-escape-method.rs:15:5 20 --> $DIR/regions-escape-method.rs:15:5
17 | 21 |
diff --git a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr
index a6b165e..9082346 100644
--- a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr
+++ b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | with(|o| o) 10LL | with(|o| o)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &isize 13 --> $DIR/regions-escape-via-trait-or-not.rs:18:14
14 found &isize 14 |
15LL | with(|o| o)
16 | ^
17 = note: expected `&isize`
18 found `&isize`
15note: but, the lifetime must be valid for the expression at 18:5... 19note: but, the lifetime must be valid for the expression at 18:5...
16 --> $DIR/regions-escape-via-trait-or-not.rs:18:5 20 --> $DIR/regions-escape-via-trait-or-not.rs:18:5
17 | 21 |
diff --git a/src/test/ui/regions/regions-nested-fns.stderr b/src/test/ui/regions/regions-nested-fns.stderr
index f4eb5c8..8fce160 100644
--- a/src/test/ui/regions/regions-nested-fns.stderr
+++ b/src/test/ui/regions/regions-nested-fns.stderr
@@ -29,9 +29,18 @@ LL | | if false { return ay; }
29LL | | return z; 29LL | | return z;
30LL | | })); 30LL | | }));
31 | |_____^ 31 | |_____^
32 = note: ...so that the types are compatible: 32note: ...so that the types are compatible
33 expected &isize 33 --> $DIR/regions-nested-fns.rs:13:76
34 found &isize 34 |
35LL | ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
36 | ____________________________________________________________________________^
37LL | | if false { return x; }
38LL | | if false { return ay; }
39LL | | return z;
40LL | | }));
41 | |_____^
42 = note: expected `&isize`
43 found `&isize`
35 44
36error[E0312]: lifetime of reference outlives lifetime of borrowed content... 45error[E0312]: lifetime of reference outlives lifetime of borrowed content...
37 --> $DIR/regions-nested-fns.rs:14:27 46 --> $DIR/regions-nested-fns.rs:14:27
diff --git a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
index d29fd80..8a600d2 100644
--- a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
+++ b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
@@ -17,9 +17,16 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on
17 | 17 |
18LL | fn bar<'a, 'b>() 18LL | fn bar<'a, 'b>()
19 | ^^ 19 | ^^
20 = note: ...so that the types are compatible: 20note: ...so that the types are compatible
21 expected Project<'a, 'b> 21 --> $DIR/regions-normalize-in-where-clause-list.rs:22:1
22 found Project<'_, '_> 22 |
23LL | / fn bar<'a, 'b>()
24LL | | where <() as Project<'a, 'b>>::Item : Eq
25LL | | {
26LL | | }
27 | |_^
28 = note: expected `Project<'a, 'b>`
29 found `Project<'_, '_>`
23 30
24error: aborting due to previous error 31error: aborting due to previous error
25 32
diff --git a/src/test/ui/regions/regions-ret-borrowed-1.stderr b/src/test/ui/regions/regions-ret-borrowed-1.stderr
index 4907667..2895a0c 100644
--- a/src/test/ui/regions/regions-ret-borrowed-1.stderr
+++ b/src/test/ui/regions/regions-ret-borrowed-1.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | with(|o| o) 10LL | with(|o| o)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &isize 13 --> $DIR/regions-ret-borrowed-1.rs:10:14
14 found &isize 14 |
15LL | with(|o| o)
16 | ^
17 = note: expected `&isize`
18 found `&isize`
15note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14... 19note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14...
16 --> $DIR/regions-ret-borrowed-1.rs:9:14 20 --> $DIR/regions-ret-borrowed-1.rs:9:14
17 | 21 |
diff --git a/src/test/ui/regions/regions-ret-borrowed.stderr b/src/test/ui/regions/regions-ret-borrowed.stderr
index eb1ade2..b74f10f 100644
--- a/src/test/ui/regions/regions-ret-borrowed.stderr
+++ b/src/test/ui/regions/regions-ret-borrowed.stderr
@@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th
9 | 9 |
10LL | with(|o| o) 10LL | with(|o| o)
11 | ^^^^^ 11 | ^^^^^
12 = note: ...so that the expression is assignable: 12note: ...so that the expression is assignable
13 expected &isize 13 --> $DIR/regions-ret-borrowed.rs:13:14
14 found &isize 14 |
15LL | with(|o| o)
16 | ^
17 = note: expected `&isize`
18 found `&isize`
15note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14... 19note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14...
16 --> $DIR/regions-ret-borrowed.rs:12:14 20 --> $DIR/regions-ret-borrowed.rs:12:14
17 | 21 |
diff --git a/src/test/ui/regions/regions-trait-object-subtyping.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr
index ef69f25..58b79d2 100644
--- a/src/test/ui/regions/regions-trait-object-subtyping.stderr
+++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr
@@ -36,9 +36,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu
36 | 36 |
37LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { 37LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
38 | ^^ 38 | ^^
39 = note: ...so that the expression is assignable: 39note: ...so that the expression is assignable
40 expected &'b mut (dyn Dummy + 'b) 40 --> $DIR/regions-trait-object-subtyping.rs:15:5
41 found &mut (dyn Dummy + 'b) 41 |
42LL | x
43 | ^
44 = note: expected `&'b mut (dyn Dummy + 'b)`
45 found `&mut (dyn Dummy + 'b)`
42 46
43error[E0308]: mismatched types 47error[E0308]: mismatched types
44 --> $DIR/regions-trait-object-subtyping.rs:22:5 48 --> $DIR/regions-trait-object-subtyping.rs:22:5
diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr
index e55f023..527babb 100644
--- a/src/test/ui/reject-specialized-drops-8142.stderr
+++ b/src/test/ui/reject-specialized-drops-8142.stderr
@@ -105,9 +105,13 @@ note: ...but the lifetime must also be valid for the lifetime `'l2` as defined o
105 | 105 |
106LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } 106LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
107 | ^^^ 107 | ^^^
108 = note: ...so that the types are compatible: 108note: ...so that the types are compatible
109 expected W<'l1, 'l2> 109 --> $DIR/reject-specialized-drops-8142.rs:54:1
110 found W<'_, '_> 110 |
111LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 = note: expected `W<'l1, 'l2>`
114 found `W<'_, '_>`
111 115
112error: aborting due to 8 previous errors 116error: aborting due to 8 previous errors
113 117
diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.rs b/src/test/ui/suggestions/raw-name-use-suggestion.rs
index 6c01383..0a8073c 100644
--- a/src/test/ui/suggestions/raw-name-use-suggestion.rs
+++ b/src/test/ui/suggestions/raw-name-use-suggestion.rs
@@ -5,5 +5,5 @@ mod foo {
5 5
6fn main() { 6fn main() {
7 foo::let(); //~ ERROR expected identifier, found keyword `let` 7 foo::let(); //~ ERROR expected identifier, found keyword `let`
8 r#break(); //~ ERROR cannot find function `break` in this scope 8 r#break(); //~ ERROR cannot find function `r#break` in this scope
9} 9}
diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.stderr b/src/test/ui/suggestions/raw-name-use-suggestion.stderr
index 58eb87c..62b7631 100644
--- a/src/test/ui/suggestions/raw-name-use-suggestion.stderr
+++ b/src/test/ui/suggestions/raw-name-use-suggestion.stderr
@@ -20,7 +20,7 @@ help: you can escape reserved keywords to use them as identifiers
20LL | foo::r#let(); 20LL | foo::r#let();
21 | ^^^^^ 21 | ^^^^^
22 22
23error[E0425]: cannot find function `break` in this scope 23error[E0425]: cannot find function `r#break` in this scope
24 --> $DIR/raw-name-use-suggestion.rs:8:5 24 --> $DIR/raw-name-use-suggestion.rs:8:5
25 | 25 |
26LL | r#break(); 26LL | r#break();
diff --git a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr
index 88c9c47..9fdcd4d 100644
--- a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr
+++ b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr
@@ -14,9 +14,13 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on
14 | 14 |
15LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { 15LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {
16 | ^^ 16 | ^^
17 = note: ...so that the types are compatible: 17note: ...so that the types are compatible
18 expected T1<'a> 18 --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13
19 found T1<'_> 19 |
20LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> {
21 | ^^^^^^^^^^
22 = note: expected `T1<'a>`
23 found `T1<'_>`
20 24
21error: aborting due to previous error 25error: aborting due to previous error
22 26
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
index d0475bf..e6029e0d 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
@@ -18,9 +18,13 @@ note: ...so that reference does not outlive borrowed content
18LL | Box::new(items.iter()) 18LL | Box::new(items.iter())
19 | ^^^^^ 19 | ^^^^^
20 = note: but, the lifetime must be valid for the static lifetime... 20 = note: but, the lifetime must be valid for the static lifetime...
21 = note: ...so that the expression is assignable: 21note: ...so that the expression is assignable
22 expected std::boxed::Box<(dyn std::iter::Iterator<Item = &T> + 'static)> 22 --> $DIR/dyn-trait-underscore.rs:8:5
23 found std::boxed::Box<dyn std::iter::Iterator<Item = &T>> 23 |
24LL | Box::new(items.iter())
25 | ^^^^^^^^^^^^^^^^^^^^^^
26 = note: expected `std::boxed::Box<(dyn std::iter::Iterator<Item = &T> + 'static)>`
27 found `std::boxed::Box<dyn std::iter::Iterator<Item = &T>>`
24 28
25error: aborting due to previous error 29error: aborting due to previous error
26 30