diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index a27b8470e957..c3768d5b2d69 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -934,28 +934,105 @@ impl<'hir> Map<'hir> { } /// Gets the span of the definition of the specified HIR node. - /// This is used by `tcx.get_span` + /// This is used by `tcx.def_span`. pub fn span(self, hir_id: HirId) -> Span { self.opt_span(hir_id) .unwrap_or_else(|| bug!("hir::map::Map::span: id not in map: {:?}", hir_id)) } pub fn opt_span(self, hir_id: HirId) -> Option { + fn until_within(outer: Span, end: Span) -> Span { + if let Some(end) = end.find_ancestor_inside(outer) { + outer.with_hi(end.hi()) + } else { + outer + } + } + + fn named_span(item_span: Span, ident: Ident, generics: Option<&Generics<'_>>) -> Span { + if ident.name != kw::Empty { + let mut span = until_within(item_span, ident.span); + if let Some(g) = generics + && !g.span.is_dummy() + && let Some(g_span) = g.span.find_ancestor_inside(item_span) + { + span = span.to(g_span); + } + span + } else { + item_span + } + } + let span = match self.find(hir_id)? { - Node::Param(param) => param.span, + // Function-like. + Node::Item(Item { kind: ItemKind::Fn(sig, ..), .. }) + | Node::TraitItem(TraitItem { kind: TraitItemKind::Fn(sig, ..), .. }) + | Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(sig, ..), .. }) => sig.span, + // Constants and Statics. + Node::Item(Item { + kind: + ItemKind::Const(ty, ..) + | ItemKind::Static(ty, ..) + | ItemKind::Impl(Impl { self_ty: ty, .. }), + span: outer_span, + .. + }) + | Node::TraitItem(TraitItem { + kind: TraitItemKind::Const(ty, ..), + span: outer_span, + .. + }) + | Node::ImplItem(ImplItem { + kind: ImplItemKind::Const(ty, ..), + span: outer_span, + .. + }) + | Node::ForeignItem(ForeignItem { + kind: ForeignItemKind::Static(ty, ..), + span: outer_span, + .. + }) => until_within(*outer_span, ty.span), + // With generics and bounds. + Node::Item(Item { + kind: ItemKind::Trait(_, _, generics, bounds, _), + span: outer_span, + .. + }) + | Node::TraitItem(TraitItem { + kind: TraitItemKind::Type(bounds, _), + generics, + span: outer_span, + .. + }) => { + let end = if let Some(b) = bounds.last() { b.span() } else { generics.span }; + until_within(*outer_span, end) + } + // Other cases. Node::Item(item) => match &item.kind { - ItemKind::Fn(sig, _, _) => sig.span, - _ => item.span, + ItemKind::Use(path, _) => path.span, + _ => named_span(item.span, item.ident, item.kind.generics()), }, - Node::ForeignItem(foreign_item) => foreign_item.span, - Node::TraitItem(trait_item) => match &trait_item.kind { - TraitItemKind::Fn(sig, _) => sig.span, - _ => trait_item.span, - }, - Node::ImplItem(impl_item) => match &impl_item.kind { - ImplItemKind::Fn(sig, _) => sig.span, - _ => impl_item.span, + Node::ImplItem(item) => named_span(item.span, item.ident, Some(item.generics)), + Node::ForeignItem(item) => match item.kind { + ForeignItemKind::Fn(decl, _, _) => until_within(item.span, decl.output.span()), + _ => named_span(item.span, item.ident, None), }, + Node::Ctor(..) => return self.opt_span(self.get_parent_node(hir_id)), + _ => self.span_with_body(hir_id), + }; + Some(span) + } + + /// Like `hir.span()`, but includes the body of items + /// (instead of just the item header) + pub fn span_with_body(self, hir_id: HirId) -> Span { + match self.get(hir_id) { + Node::Param(param) => param.span, + Node::Item(item) => item.span, + Node::ForeignItem(foreign_item) => foreign_item.span, + Node::TraitItem(trait_item) => trait_item.span, + Node::ImplItem(impl_item) => impl_item.span, Node::Variant(variant) => variant.span, Node::Field(field) => field.span, Node::AnonConst(constant) => self.body(constant.body).value.span, @@ -973,29 +1050,12 @@ impl<'hir> Map<'hir> { Node::Pat(pat) => pat.span, Node::Arm(arm) => arm.span, Node::Block(block) => block.span, - Node::Ctor(..) => match self.find(self.get_parent_node(hir_id))? { - Node::Item(item) => item.span, - Node::Variant(variant) => variant.span, - _ => unreachable!(), - }, + Node::Ctor(..) => self.span_with_body(self.get_parent_node(hir_id)), Node::Lifetime(lifetime) => lifetime.span, Node::GenericParam(param) => param.span, Node::Infer(i) => i.span, Node::Local(local) => local.span, Node::Crate(item) => item.spans.inner_span, - }; - Some(span) - } - - /// Like `hir.span()`, but includes the body of function items - /// (instead of just the function header) - pub fn span_with_body(self, hir_id: HirId) -> Span { - match self.find(hir_id) { - Some(Node::TraitItem(item)) => item.span, - Some(Node::ImplItem(impl_item)) => impl_item.span, - Some(Node::Item(item)) => item.span, - Some(_) => self.span(hir_id), - _ => bug!("hir::map::Map::span_with_body: id not in map: {:?}", hir_id), } } diff --git a/src/test/incremental/issue-61323.rs b/src/test/incremental/issue-61323.rs index 448ce367b8c6..97cbfe408f26 100644 --- a/src/test/incremental/issue-61323.rs +++ b/src/test/incremental/issue-61323.rs @@ -10,6 +10,6 @@ struct C(Box); #[cfg(cfail)] struct C(A); -//[cfail]~^ ERROR 12:1: 12:13: recursive type `C` has infinite size [E0072] +//[cfail]~^ ERROR 12:1: 12:9: recursive type `C` has infinite size [E0072] fn main() {} diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff index 816c598059dd..268d8f464646 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff +++ b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff @@ -40,11 +40,11 @@ - StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44 - StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44 StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44 - return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45 + return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:28 } bb2 (cleanup): { - resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45 + resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:28 } - } - diff --git a/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir b/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir index 4d24387afc76..2e63c2c25fac 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir +++ b/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir @@ -12,6 +12,6 @@ static BOP: &i32 = { _1 = &_2; // scope 0 at $DIR/const-promotion-extern-static.rs:16:20: 16:23 _0 = &(*_1); // scope 0 at $DIR/const-promotion-extern-static.rs:16:20: 16:23 StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:16:22: 16:23 - return; // scope 0 at $DIR/const-promotion-extern-static.rs:16:1: 16:24 + return; // scope 0 at $DIR/const-promotion-extern-static.rs:16:1: 16:17 } } diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff index 096b427bb758..322a1b206f94 100644 --- a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff +++ b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff @@ -42,11 +42,11 @@ - StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55 - StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55 StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55 - return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56 + return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:28 } bb2 (cleanup): { - resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56 + resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:28 } } - diff --git a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir index db9caf843145..701e291f46ec 100644 --- a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir +++ b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir @@ -1,6 +1,6 @@ -// MIR for `::{constant#0}` after SimplifyCfg-promote-consts +// MIR for `::{constant#0}` after SimplifyCfg-promote-consts -::{constant#0}: usize = { +::{constant#0}: usize = { let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 diff --git a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir index db9caf843145..701e291f46ec 100644 --- a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir +++ b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir @@ -1,6 +1,6 @@ -// MIR for `::{constant#0}` after SimplifyCfg-promote-consts +// MIR for `::{constant#0}` after SimplifyCfg-promote-consts -::{constant#0}: usize = { +::{constant#0}: usize = { let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 diff --git a/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir index f9ed3932d333..980f07d5f109 100644 --- a/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir @@ -1,6 +1,6 @@ -// MIR for `::foo` after SimplifyCfg-elaborate-drops +// MIR for `::foo` after SimplifyCfg-elaborate-drops -fn ::foo(_1: &Test, _2: &mut i32) -> &mut i32 { +fn ::foo(_1: &Test, _2: &mut i32) -> &mut i32 { debug self => _1; // in scope 0 at $DIR/retag.rs:13:16: 13:21 debug x => _2; // in scope 0 at $DIR/retag.rs:13:23: 13:24 let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:13:42: 13:53 diff --git a/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir index 87a8603a931d..9c252d63fc72 100644 --- a/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir @@ -1,6 +1,6 @@ -// MIR for `::foo_shr` after SimplifyCfg-elaborate-drops +// MIR for `::foo_shr` after SimplifyCfg-elaborate-drops -fn ::foo_shr(_1: &Test, _2: &i32) -> &i32 { +fn ::foo_shr(_1: &Test, _2: &i32) -> &i32 { debug self => _1; // in scope 0 at $DIR/retag.rs:16:20: 16:25 debug x => _2; // in scope 0 at $DIR/retag.rs:16:27: 16:28 let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:16:42: 16:49 diff --git a/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir b/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir index e0875ab0069e..2c4738aa8661 100644 --- a/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir +++ b/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir @@ -198,6 +198,6 @@ static XXX: &Foo = { _0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2 StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2 StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2 - return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3 + return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 5:25 } } diff --git a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir index a046a89bc8cf..c41fe61d48bf 100644 --- a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir +++ b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir @@ -1,10 +1,10 @@ -// MIR for `::ASSOCIATED_CONSTANT` 0 mir_map +// MIR for `::ASSOCIATED_CONSTANT` 0 mir_map -const ::ASSOCIATED_CONSTANT: i32 = { +const ::ASSOCIATED_CONSTANT: i32 = { let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35 bb0: { _0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39 - return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40 + return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:35 } } diff --git a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir index a046a89bc8cf..c41fe61d48bf 100644 --- a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir +++ b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir @@ -1,10 +1,10 @@ -// MIR for `::ASSOCIATED_CONSTANT` 0 mir_map +// MIR for `::ASSOCIATED_CONSTANT` 0 mir_map -const ::ASSOCIATED_CONSTANT: i32 = { +const ::ASSOCIATED_CONSTANT: i32 = { let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35 bb0: { _0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39 - return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40 + return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:35 } } diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr index 371579785428..9e51ecd2ba01 100644 --- a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr +++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr @@ -1,9 +1,8 @@ error: missing code example in this documentation --> $DIR/lint-missing-doc-code-example.rs:19:1 | -LL | / pub mod module1 { -LL | | } - | |_^ +LL | pub mod module1 { + | ^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-missing-doc-code-example.rs:2:9 diff --git a/src/test/rustdoc/check-source-code-urls-to-def.rs b/src/test/rustdoc/check-source-code-urls-to-def.rs index 12c5df2871cf..ec44e1bc65c9 100644 --- a/src/test/rustdoc/check-source-code-urls-to-def.rs +++ b/src/test/rustdoc/check-source-code-urls-to-def.rs @@ -14,10 +14,10 @@ extern crate source_code; #[path = "auxiliary/source-code-bar.rs"] pub mod bar; -// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5-7"]' 4 +// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5"]' 4 use bar::Bar; -// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13-17"]' 'self' -// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' +// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13"]' 'self' +// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait' use bar::sub::{self, Trait}; pub struct Foo; @@ -42,8 +42,8 @@ pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::Sour y.hello(); } -// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait' -// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' +// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait' +// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait' pub fn foo2(t: &T, v: &V, b: bool) {} pub trait AnotherTrait {} diff --git a/src/test/rustdoc/inline_cross/macros.rs b/src/test/rustdoc/inline_cross/macros.rs index 13b4c3c7f61a..5daa0d4baad6 100644 --- a/src/test/rustdoc/inline_cross/macros.rs +++ b/src/test/rustdoc/inline_cross/macros.rs @@ -15,5 +15,5 @@ extern crate macros; // @has - '//*[@class="docblock"]' 'docs for my_macro' // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' // @has - '//*[@class="stab unstable"]' 'macro_test' -// @has - '//a/@href' '../src/macros/macros.rs.html#8-10' +// @has - '//a/@href' '../src/macros/macros.rs.html#8' pub use macros::my_macro; diff --git a/src/test/ui/array-slice-vec/array_const_index-0.stderr b/src/test/ui/array-slice-vec/array_const_index-0.stderr index b44251efdea4..4832398713db 100644 --- a/src/test/ui/array-slice-vec/array_const_index-0.stderr +++ b/src/test/ui/array-slice-vec/array_const_index-0.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/array_const_index-0.rs:2:16 | LL | const B: i32 = (&A)[1]; - | ---------------^^^^^^^- - | | - | index out of bounds: the length is 0 but the index is 1 + | ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ error: any use of this value will cause an error --> $DIR/array_const_index-0.rs:2:16 | LL | const B: i32 = (&A)[1]; - | ---------------^^^^^^^- - | | - | index out of bounds: the length is 0 but the index is 1 + | ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/array-slice-vec/array_const_index-1.stderr b/src/test/ui/array-slice-vec/array_const_index-1.stderr index 8beebafb04c3..361f518c052f 100644 --- a/src/test/ui/array-slice-vec/array_const_index-1.stderr +++ b/src/test/ui/array-slice-vec/array_const_index-1.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/array_const_index-1.rs:2:16 | LL | const B: i32 = A[1]; - | ---------------^^^^- - | | - | index out of bounds: the length is 0 but the index is 1 + | ------------ ^^^^ index out of bounds: the length is 0 but the index is 1 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ error: any use of this value will cause an error --> $DIR/array_const_index-1.rs:2:16 | LL | const B: i32 = A[1]; - | ---------------^^^^- - | | - | index out of bounds: the length is 0 but the index is 1 + | ------------ ^^^^ index out of bounds: the length is 0 but the index is 1 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/associated-consts/assoc-const-ty-mismatch.stderr b/src/test/ui/associated-consts/assoc-const-ty-mismatch.stderr index 703245145ce4..58a8aceca2f2 100644 --- a/src/test/ui/associated-consts/assoc-const-ty-mismatch.stderr +++ b/src/test/ui/associated-consts/assoc-const-ty-mismatch.stderr @@ -8,7 +8,7 @@ note: associated constant defined here does not match type --> $DIR/assoc-const-ty-mismatch.rs:5:3 | LL | const N: usize; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: mismatch in bind of associated type, got const --> $DIR/assoc-const-ty-mismatch.rs:25:18 @@ -20,7 +20,7 @@ note: associated type defined here does not match const --> $DIR/assoc-const-ty-mismatch.rs:9:3 | LL | type T; - | ^^^^^^^ + | ^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr b/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr index 60cf9a533cd7..5435f22321c9 100644 --- a/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr +++ b/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr @@ -8,12 +8,12 @@ note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32` --> $DIR/associated-const-ambiguity-report.rs:10:5 | LL | const ID: i32 = 1; - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ note: candidate #2 is defined in an impl of the trait `Bar` for the type `i32` --> $DIR/associated-const-ambiguity-report.rs:14:5 | LL | const ID: i32 = 3; - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ help: disambiguate the associated constant for candidate #1 | LL | const X: i32 = ::ID; diff --git a/src/test/ui/associated-consts/associated-const-private-impl.stderr b/src/test/ui/associated-consts/associated-const-private-impl.stderr index aa356c596f8a..a3fa3002e1ef 100644 --- a/src/test/ui/associated-consts/associated-const-private-impl.stderr +++ b/src/test/ui/associated-consts/associated-const-private-impl.stderr @@ -2,7 +2,7 @@ error[E0624]: associated constant `ID` is private --> $DIR/associated-const-private-impl.rs:13:30 | LL | const ID: i32 = 1; - | ------------------ private associated constant defined here + | ------------- private associated constant defined here ... LL | assert_eq!(1, bar1::Foo::ID); | ^^ private associated constant diff --git a/src/test/ui/associated-consts/defaults-cyclic-fail.stderr b/src/test/ui/associated-consts/defaults-cyclic-fail.stderr index c4cd9c2a49fd..582473905cfd 100644 --- a/src/test/ui/associated-consts/defaults-cyclic-fail.stderr +++ b/src/test/ui/associated-consts/defaults-cyclic-fail.stderr @@ -2,13 +2,13 @@ error[E0391]: cycle detected when const-evaluating + checking `Tr::A` --> $DIR/defaults-cyclic-fail.rs:5:5 | LL | const A: u8 = Self::B; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `Tr::B`... --> $DIR/defaults-cyclic-fail.rs:8:5 | LL | const B: u8 = Self::A; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ = note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle note: cycle used when const-evaluating + checking `main::promoted[1]` --> $DIR/defaults-cyclic-fail.rs:16:16 diff --git a/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr b/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr index f04ea0b74770..66ee6031c715 100644 --- a/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr +++ b/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/defaults-not-assumed-fail.rs:8:19 | LL | const B: u8 = Self::A + 1; - | --------------^^^^^^^^^^^- - | | - | attempt to compute `u8::MAX + 1_u8`, which would overflow + | ----------- ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -34,9 +32,7 @@ error: any use of this value will cause an error --> $DIR/defaults-not-assumed-fail.rs:8:19 | LL | const B: u8 = Self::A + 1; - | --------------^^^^^^^^^^^- - | | - | attempt to compute `u8::MAX + 1_u8`, which would overflow + | ----------- ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr index b4dc730d8631..51a50cfdaf98 100644 --- a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr +++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr @@ -1,4 +1,4 @@ -error[E0391]: cycle detected when elaborating drops for `::BAR` +error[E0391]: cycle detected when elaborating drops for `::BAR` --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:22 | LL | const BAR: u32 = IMPL_REF_BAR; @@ -8,23 +8,23 @@ note: ...which requires const-evaluating + checking `IMPL_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1 | LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ note: ...which requires const-evaluating + checking `IMPL_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1 | LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `::BAR`... + | ^^^^^^^^^^^^^^^^^^^^^^^ +note: ...which requires const-evaluating + checking `::BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5 | LL | const BAR: u32 = IMPL_REF_BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires caching mir of `::BAR` for CTFE... + | ^^^^^^^^^^^^^^ +note: ...which requires caching mir of `::BAR` for CTFE... --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5 | LL | const BAR: u32 = IMPL_REF_BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which again requires elaborating drops for `::BAR`, completing the cycle + | ^^^^^^^^^^^^^^ + = note: ...which again requires elaborating drops for `::BAR`, completing the cycle = note: cycle used when running analysis passes on this crate error: aborting due to previous error diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr index 97ede6ad388f..b9d1808feb36 100644 --- a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr +++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr @@ -8,22 +8,22 @@ note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1 | LL | const DEFAULT_REF_BAR: u32 = ::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1 | LL | const DEFAULT_REF_BAR: u32 = ::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...which requires const-evaluating + checking `FooDefault::BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5 | LL | const BAR: u32 = DEFAULT_REF_BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ note: ...which requires caching mir of `FooDefault::BAR` for CTFE... --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5 | LL | const BAR: u32 = DEFAULT_REF_BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ = note: ...which again requires elaborating drops for `FooDefault::BAR`, completing the cycle = note: cycle used when running analysis passes on this crate diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr index bd97c31229ec..271e69206cd7 100644 --- a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr +++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr @@ -1,4 +1,4 @@ -error[E0391]: cycle detected when elaborating drops for `::BAR` +error[E0391]: cycle detected when elaborating drops for `::BAR` --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22 | LL | const BAR: u32 = TRAIT_REF_BAR; @@ -8,23 +8,23 @@ note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1 | LL | const TRAIT_REF_BAR: u32 = ::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1 | LL | const TRAIT_REF_BAR: u32 = ::BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `::BAR`... + | ^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...which requires const-evaluating + checking `::BAR`... --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5 | LL | const BAR: u32 = TRAIT_REF_BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires caching mir of `::BAR` for CTFE... + | ^^^^^^^^^^^^^^ +note: ...which requires caching mir of `::BAR` for CTFE... --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5 | LL | const BAR: u32 = TRAIT_REF_BAR; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which again requires elaborating drops for `::BAR`, completing the cycle + | ^^^^^^^^^^^^^^ + = note: ...which again requires elaborating drops for `::BAR`, completing the cycle = note: cycle used when running analysis passes on this crate error: aborting due to previous error diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr index ad21b38d07eb..f4efd131248c 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr @@ -2,7 +2,7 @@ error[E0201]: duplicate definitions with name `bar`: --> $DIR/associated-item-duplicate-names-2.rs:5:5 | LL | const bar: bool = true; - | ----------------------- previous definition of `bar` here + | --------------- previous definition of `bar` here LL | fn bar() {} | ^^^^^^^^ duplicate definition diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr index 57495863c989..03782f663480 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr @@ -2,9 +2,9 @@ error[E0201]: duplicate definitions with name `Bar`: --> $DIR/associated-item-duplicate-names-3.rs:14:5 | LL | type Bar = i16; - | --------------- previous definition of `Bar` here + | -------- previous definition of `Bar` here LL | type Bar = u16; - | ^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^ duplicate definition error: aborting due to previous error diff --git a/src/test/ui/associated-item/associated-item-duplicate-names.stderr b/src/test/ui/associated-item/associated-item-duplicate-names.stderr index f4af9e029395..c9119c102711 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names.stderr @@ -2,17 +2,17 @@ error[E0201]: duplicate definitions with name `Ty`: --> $DIR/associated-item-duplicate-names.rs:11:5 | LL | type Ty = (); - | ------------- previous definition of `Ty` here + | ------- previous definition of `Ty` here LL | type Ty = usize; - | ^^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^ duplicate definition error[E0201]: duplicate definitions with name `BAR`: --> $DIR/associated-item-duplicate-names.rs:13:5 | LL | const BAR: u32 = 7; - | ------------------- previous definition of `BAR` here + | -------------- previous definition of `BAR` here LL | const BAR: u32 = 8; - | ^^^^^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^ duplicate definition error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr b/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr index 19fc2f652c6b..236552baf928 100644 --- a/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr +++ b/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr @@ -2,10 +2,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:16:24 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn a(_: C::Color) { | ^^^^^^^^ ambiguous associated type `Color` @@ -23,10 +23,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:20:12 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn b(_: C::Color) where C : Vehicle+Box { | ^^^^^^^^ ambiguous associated type `Color` @@ -44,10 +44,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:24:12 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn c(_: C::Color) where C : Vehicle, C : Box { | ^^^^^^^^ ambiguous associated type `Color` @@ -65,10 +65,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `X` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn e(&self, _: X::Color) where X : Box; | ^^^^^^^^ ambiguous associated type `Color` @@ -86,10 +86,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `X` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn f(&self, _: X::Color) where X : Box { } | ^^^^^^^^ ambiguous associated type `Color` @@ -107,10 +107,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `X` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn d(&self, _: X::Color) where X : Box { } | ^^^^^^^^ ambiguous associated type `Color` diff --git a/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr b/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr index 66a4899c77fe..e765f9323984 100644 --- a/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr +++ b/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr @@ -10,10 +10,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-from-multiple-supertraits.rs:19:32 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn dent(c: C, color: C::Color) { | ^^^^^^^^ ambiguous associated type `Color` @@ -31,10 +31,10 @@ error[E0222]: ambiguous associated type `Color` in bounds of `BoxCar` --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:37 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn dent_object(c: dyn BoxCar) { | ^^^^^^^^^^^ ambiguous associated type `Color` @@ -49,10 +49,10 @@ error[E0191]: the value of the associated types `Color` (from trait `Box`), `Col --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:30 | LL | type Color; - | ----------- `Vehicle::Color` defined here + | ---------- `Vehicle::Color` defined here ... LL | type Color; - | ----------- `Box::Color` defined here + | ---------- `Box::Color` defined here ... LL | fn dent_object(c: dyn BoxCar) { | ^^^^^^^^^^^^^^^^^^^ associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified @@ -63,10 +63,10 @@ error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-from-multiple-supertraits.rs:28:29 | LL | type Color; - | ----------- ambiguous `Color` from `Vehicle` + | ---------- ambiguous `Color` from `Vehicle` ... LL | type Color; - | ----------- ambiguous `Color` from `Box` + | ---------- ambiguous `Color` from `Box` ... LL | fn paint(c: C, d: C::Color) { | ^^^^^^^^ ambiguous associated type `Color` @@ -84,10 +84,10 @@ error[E0191]: the value of the associated types `Color` (from trait `Box`), `Col --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32 | LL | type Color; - | ----------- `Vehicle::Color` defined here + | ---------- `Vehicle::Color` defined here ... LL | type Color; - | ----------- `Box::Color` defined here + | ---------- `Box::Color` defined here ... LL | fn dent_object_2(c: dyn BoxCar) where ::Color = COLOR { | ^^^^^^ associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified diff --git a/src/test/ui/associated-types/associated-types-coherence-failure.stderr b/src/test/ui/associated-types/associated-types-coherence-failure.stderr index 211613b37149..40c02dca32f0 100644 --- a/src/test/ui/associated-types/associated-types-coherence-failure.stderr +++ b/src/test/ui/associated-types/associated-types-coherence-failure.stderr @@ -2,19 +2,19 @@ error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `Co --> $DIR/associated-types-coherence-failure.rs:21:1 | LL | impl<'a, B: ?Sized> IntoCow<'a, B> for ::Owned where B: ToOwned { - | ----------------------------------------------------------------------------- first implementation here + | ------------------------------------------------------------ first implementation here ... LL | impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>` error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_` --> $DIR/associated-types-coherence-failure.rs:28:1 | LL | impl<'a, B: ?Sized> IntoCow<'a, B> for ::Owned where B: ToOwned { - | ----------------------------------------------------------------------------- first implementation here + | ------------------------------------------------------------ first implementation here ... LL | impl<'a, B: ?Sized> IntoCow<'a, B> for &'a B where B: ToOwned { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-types-incomplete-object.stderr b/src/test/ui/associated-types/associated-types-incomplete-object.stderr index 24732271c420..32866c714680 100644 --- a/src/test/ui/associated-types/associated-types-incomplete-object.stderr +++ b/src/test/ui/associated-types/associated-types-incomplete-object.stderr @@ -2,7 +2,7 @@ error[E0191]: the value of the associated type `B` (from trait `Foo`) must be sp --> $DIR/associated-types-incomplete-object.rs:23:30 | LL | type B; - | ------- `B` defined here + | ------ `B` defined here ... LL | let b = &42isize as &dyn Foo; | ^^^^^^^^^^^^ help: specify the associated type: `Foo` @@ -11,7 +11,7 @@ error[E0191]: the value of the associated type `A` (from trait `Foo`) must be sp --> $DIR/associated-types-incomplete-object.rs:26:30 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here ... LL | let c = &42isize as &dyn Foo; | ^^^^^^^^^^^ help: specify the associated type: `Foo` @@ -20,9 +20,9 @@ error[E0191]: the value of the associated types `A` (from trait `Foo`), `B` (fro --> $DIR/associated-types-incomplete-object.rs:29:30 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here LL | type B; - | ------- `B` defined here + | ------ `B` defined here ... LL | let d = &42isize as &dyn Foo; | ^^^ help: specify the associated types: `Foo` diff --git a/src/test/ui/associated-types/associated-types-issue-17359.stderr b/src/test/ui/associated-types/associated-types-issue-17359.stderr index 575a072c558b..9e40d8095862 100644 --- a/src/test/ui/associated-types/associated-types-issue-17359.stderr +++ b/src/test/ui/associated-types/associated-types-issue-17359.stderr @@ -2,7 +2,7 @@ error[E0046]: not all trait items implemented, missing: `Type` --> $DIR/associated-types-issue-17359.rs:8:1 | LL | type Type; - | ---------- `Type` from trait + | --------- `Type` from trait ... LL | impl Trait for isize {} | ^^^^^^^^^^^^^^^^^^^^ missing `Type` in implementation diff --git a/src/test/ui/associated-types/associated-types-path-1.stderr b/src/test/ui/associated-types/associated-types-path-1.stderr index 6512d60b2c29..a67f77e37c70 100644 --- a/src/test/ui/associated-types/associated-types-path-1.stderr +++ b/src/test/ui/associated-types/associated-types-path-1.stderr @@ -8,10 +8,10 @@ error[E0221]: ambiguous associated type `A` in bounds of `T` --> $DIR/associated-types-path-1.rs:11:34 | LL | type A; - | ------- ambiguous `A` from `Foo` + | ------ ambiguous `A` from `Foo` ... LL | type A; - | ------- ambiguous `A` from `Bar` + | ------ ambiguous `A` from `Bar` ... LL | pub fn f2(a: T, x: T::A) {} | ^^^^ ambiguous associated type `A` diff --git a/src/test/ui/associated-types/defaults-mixed.stderr b/src/test/ui/associated-types/defaults-mixed.stderr index 69ddd5f2326d..0f4a6968c70d 100644 --- a/src/test/ui/associated-types/defaults-mixed.stderr +++ b/src/test/ui/associated-types/defaults-mixed.stderr @@ -2,7 +2,7 @@ error[E0046]: not all trait items implemented, missing: `Bar` --> $DIR/defaults-mixed.rs:11:1 | LL | type Bar; - | --------- `Bar` from trait + | -------- `Bar` from trait ... LL | impl Trait for () {} | ^^^^^^^^^^^^^^^^^ missing `Bar` in implementation @@ -11,7 +11,7 @@ error[E0046]: not all trait items implemented, missing: `Bar` --> $DIR/defaults-mixed.rs:14:1 | LL | type Bar; - | --------- `Bar` from trait + | -------- `Bar` from trait ... LL | impl Trait for bool { | ^^^^^^^^^^^^^^^^^^^ missing `Bar` in implementation diff --git a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr index 1d3b7097da66..e007f5a163b4 100644 --- a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr +++ b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr @@ -1,13 +1,8 @@ error[E0275]: overflow evaluating the requirement `for<'b> u32: X<'b>` --> $DIR/hr-associated-type-bound-2.rs:11:1 | -LL | / impl X<'_> for u32 -LL | | where -LL | | for<'b> >::U: Clone, -LL | | { -LL | | type U = str; -LL | | } - | |_^ +LL | impl X<'_> for u32 + | ^^^^^^^^^^^^^^^^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`) note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32` diff --git a/src/test/ui/associated-types/impl-wf-cycle-1.stderr b/src/test/ui/associated-types/impl-wf-cycle-1.stderr index 6f60128b8efe..939c9bbdb6b8 100644 --- a/src/test/ui/associated-types/impl-wf-cycle-1.stderr +++ b/src/test/ui/associated-types/impl-wf-cycle-1.stderr @@ -1,14 +1,8 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _` --> $DIR/impl-wf-cycle-1.rs:15:1 | -LL | / impl Grault for (T,) -LL | | -LL | | where -LL | | Self::A: Baz, -... | -LL | | type B = bool; -LL | | } - | |_^ +LL | impl Grault for (T,) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required because of the requirements on the impl of `Grault` for `(T,)` --> $DIR/impl-wf-cycle-1.rs:15:17 diff --git a/src/test/ui/associated-types/impl-wf-cycle-2.stderr b/src/test/ui/associated-types/impl-wf-cycle-2.stderr index ba14ffefae53..d02ed2cacdf8 100644 --- a/src/test/ui/associated-types/impl-wf-cycle-2.stderr +++ b/src/test/ui/associated-types/impl-wf-cycle-2.stderr @@ -1,14 +1,8 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _` --> $DIR/impl-wf-cycle-2.rs:7:1 | -LL | / impl Grault for (T,) -LL | | -LL | | where -LL | | Self::A: Copy, -LL | | { -LL | | type A = (); -LL | | } - | |_^ +LL | impl Grault for (T,) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required because of the requirements on the impl of `Grault` for `(T,)` --> $DIR/impl-wf-cycle-2.rs:7:17 diff --git a/src/test/ui/associated-types/issue-22560.stderr b/src/test/ui/associated-types/issue-22560.stderr index 71655d54baa2..700923c1b3f5 100644 --- a/src/test/ui/associated-types/issue-22560.stderr +++ b/src/test/ui/associated-types/issue-22560.stderr @@ -1,26 +1,22 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-22560.rs:9:23 | -LL | / trait Sub { -LL | | type Output; -LL | | } - | |_- type parameter `Rhs` must be specified for this -LL | -LL | type Test = dyn Add + Sub; - | ^^^ help: set the type parameter to the desired type: `Sub` +LL | trait Sub { + | ------------------- type parameter `Rhs` must be specified for this +... +LL | type Test = dyn Add + Sub; + | ^^^ help: set the type parameter to the desired type: `Sub` | = note: because of the default `Self` reference, type parameters must be specified on object types error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-22560.rs:9:17 | -LL | / trait Add { -LL | | type Output; -LL | | } - | |_- type parameter `Rhs` must be specified for this +LL | trait Add { + | ------------------- type parameter `Rhs` must be specified for this ... -LL | type Test = dyn Add + Sub; - | ^^^ help: set the type parameter to the desired type: `Add` +LL | type Test = dyn Add + Sub; + | ^^^ help: set the type parameter to the desired type: `Add` | = note: because of the default `Self` reference, type parameters must be specified on object types @@ -39,10 +35,10 @@ error[E0191]: the value of the associated types `Output` (from trait `Add`), `Ou --> $DIR/issue-22560.rs:9:17 | LL | type Output; - | ------------ `Output` defined here + | ----------- `Output` defined here ... LL | type Output; - | ------------ `Output` defined here + | ----------- `Output` defined here ... LL | type Test = dyn Add + Sub; | ^^^ ^^^ associated type `Output` must be specified diff --git a/src/test/ui/associated-types/issue-23595-1.stderr b/src/test/ui/associated-types/issue-23595-1.stderr index bb455684ee3e..4307477a56af 100644 --- a/src/test/ui/associated-types/issue-23595-1.stderr +++ b/src/test/ui/associated-types/issue-23595-1.stderr @@ -2,14 +2,11 @@ error[E0191]: the value of the associated types `ChildKey` (from trait `Hierarch --> $DIR/issue-23595-1.rs:8:58 | LL | type Value; - | ----------- `Value` defined here + | ---------- `Value` defined here LL | type ChildKey; - | -------------- `ChildKey` defined here + | ------------- `ChildKey` defined here LL | type Children = dyn Index; - | -----------------------------------------------------^^^^^^^^^-- - | | | - | | help: specify the associated types: `Hierarchy` - | `Children` defined here + | ------------- `Children` defined here ^^^^^^^^^ help: specify the associated types: `Hierarchy` error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-59324.stderr b/src/test/ui/associated-types/issue-59324.stderr index 5cd781d9a0cc..a84b599b52b6 100644 --- a/src/test/ui/associated-types/issue-59324.stderr +++ b/src/test/ui/associated-types/issue-59324.stderr @@ -5,10 +5,7 @@ LL | / pub trait ThriftService: LL | | LL | | LL | | Service::OnlyFoo> -... | -LL | | -LL | | } - | |_^ the trait `Foo` is not implemented for `Bug` + | |______________________________________________^ the trait `Foo` is not implemented for `Bug` | help: consider further restricting this bound | diff --git a/src/test/ui/associated-types/issue-85103.stderr b/src/test/ui/associated-types/issue-85103.stderr index 142f3c411ec5..bddd1dce8e64 100644 --- a/src/test/ui/associated-types/issue-85103.stderr +++ b/src/test/ui/associated-types/issue-85103.stderr @@ -2,7 +2,7 @@ error: layout error: NormalizationFailure(<[E] as std::borrow::ToOwned>::Owned, --> $DIR/issue-85103.rs:6:1 | LL | type Edges<'a, E> = Cow<'a, [E]>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/missing-associated-types.stderr b/src/test/ui/associated-types/missing-associated-types.stderr index 8c52736b02c4..f617df984ae3 100644 --- a/src/test/ui/associated-types/missing-associated-types.stderr +++ b/src/test/ui/associated-types/missing-associated-types.stderr @@ -13,7 +13,7 @@ error[E0191]: the value of the associated types `A` (from trait `Y`), `Output` ( --> $DIR/missing-associated-types.rs:12:21 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here ... LL | type Foo = dyn Add + Sub + X + Y; | ^^^^^^^^ ^^^^^^^^ ^^^^^^ ^^^^^^ associated type `A` must be specified @@ -42,9 +42,9 @@ error[E0191]: the value of the associated types `A` (from trait `Z`), `B` (from --> $DIR/missing-associated-types.rs:15:21 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here LL | type B; - | ------- `B` defined here + | ------ `B` defined here ... LL | type Bar = dyn Add + Sub + X + Z; | ^^^^^^^^ ^^^^^^^^ ^^^^^^ ^^^^^^ associated types `A`, `B`, `Output` must be specified @@ -78,7 +78,7 @@ error[E0191]: the value of the associated types `A` (from trait `Y`), `Output` ( --> $DIR/missing-associated-types.rs:18:21 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here ... LL | type Baz = dyn Add + Sub + Y; | ^^^^^^^^ ^^^^^^^^ ^^^^^^ associated type `A` must be specified diff --git a/src/test/ui/auto-traits/suspicious-impls-lint.stderr b/src/test/ui/auto-traits/suspicious-impls-lint.stderr index 03460b28dcd5..97b2d7221fdb 100644 --- a/src/test/ui/auto-traits/suspicious-impls-lint.stderr +++ b/src/test/ui/auto-traits/suspicious-impls-lint.stderr @@ -2,7 +2,7 @@ error: cross-crate traits with a default impl, like `Send`, should not be specia --> $DIR/suspicious-impls-lint.rs:9:1 | LL | unsafe impl Send for MayImplementSendErr<&T> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/suspicious-impls-lint.rs:1:9 @@ -16,13 +16,13 @@ note: try using the same sequence of generic parameters as the struct definition --> $DIR/suspicious-impls-lint.rs:8:1 | LL | struct MayImplementSendErr(T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: cross-crate traits with a default impl, like `Send`, should not be specialized --> $DIR/suspicious-impls-lint.rs:21:1 | LL | unsafe impl Send for ContainsVec {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this will change its meaning in a future release! = note: for more information, see issue #93367 @@ -31,13 +31,13 @@ note: try using the same sequence of generic parameters as the struct definition --> $DIR/suspicious-impls-lint.rs:20:1 | LL | struct ContainsVec(Vec); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error: cross-crate traits with a default impl, like `Send`, should not be specialized --> $DIR/suspicious-impls-lint.rs:32:1 | LL | unsafe impl Send for TwoParamsSame {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this will change its meaning in a future release! = note: for more information, see issue #93367 @@ -46,13 +46,13 @@ note: try using the same sequence of generic parameters as the struct definition --> $DIR/suspicious-impls-lint.rs:31:1 | LL | struct TwoParamsSame(T, U); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: cross-crate traits with a default impl, like `Send`, should not be specialized --> $DIR/suspicious-impls-lint.rs:40:1 | LL | unsafe impl Send for WithPhantomDataSend<*const T, i8> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this will change its meaning in a future release! = note: for more information, see issue #93367 @@ -61,13 +61,13 @@ note: try using the same sequence of generic parameters as the struct definition --> $DIR/suspicious-impls-lint.rs:39:1 | LL | pub struct WithPhantomDataSend(PhantomData, U); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: cross-crate traits with a default impl, like `Sync`, should not be specialized --> $DIR/suspicious-impls-lint.rs:46:1 | LL | unsafe impl Sync for WithLifetime<'static, Vec> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this will change its meaning in a future release! = note: for more information, see issue #93367 @@ -76,7 +76,7 @@ note: try using the same sequence of generic parameters as the struct definition --> $DIR/suspicious-impls-lint.rs:44:1 | LL | pub struct WithLifetime<'a, T>(&'a (), T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/binop/issue-28837.stderr b/src/test/ui/binop/issue-28837.stderr index 1875ea06a06d..b9c7e1bea706 100644 --- a/src/test/ui/binop/issue-28837.stderr +++ b/src/test/ui/binop/issue-28837.stderr @@ -10,18 +10,12 @@ note: an implementation of `Add<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Add<_>` + | ^^^^^^^^ must implement `Add<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Add { -LL | | /// The resulting type after applying the `+` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn add(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Add { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot subtract `A` from `A` --> $DIR/issue-28837.rs:8:7 @@ -35,18 +29,12 @@ note: an implementation of `Sub<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Sub<_>` + | ^^^^^^^^ must implement `Sub<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Sub { -LL | | /// The resulting type after applying the `-` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn sub(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Sub { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot multiply `A` by `A` --> $DIR/issue-28837.rs:10:7 @@ -60,18 +48,12 @@ note: an implementation of `Mul<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Mul<_>` + | ^^^^^^^^ must implement `Mul<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Mul { -LL | | /// The resulting type after applying the `*` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn mul(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Mul { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot divide `A` by `A` --> $DIR/issue-28837.rs:12:7 @@ -85,18 +67,12 @@ note: an implementation of `Div<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Div<_>` + | ^^^^^^^^ must implement `Div<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Div { -LL | | /// The resulting type after applying the `/` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn div(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Div { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot mod `A` by `A` --> $DIR/issue-28837.rs:14:7 @@ -110,18 +86,12 @@ note: an implementation of `Rem<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Rem<_>` + | ^^^^^^^^ must implement `Rem<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Rem { -LL | | /// The resulting type after applying the `%` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn rem(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Rem { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A & A` --> $DIR/issue-28837.rs:16:7 @@ -135,18 +105,12 @@ note: an implementation of `BitAnd<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `BitAnd<_>` + | ^^^^^^^^ must implement `BitAnd<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait BitAnd { -LL | | /// The resulting type after applying the `&` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn bitand(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait BitAnd { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A | A` --> $DIR/issue-28837.rs:18:7 @@ -160,18 +124,12 @@ note: an implementation of `BitOr<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `BitOr<_>` + | ^^^^^^^^ must implement `BitOr<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait BitOr { -LL | | /// The resulting type after applying the `|` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn bitor(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait BitOr { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A << A` --> $DIR/issue-28837.rs:20:7 @@ -185,18 +143,12 @@ note: an implementation of `Shl<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Shl<_>` + | ^^^^^^^^ must implement `Shl<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait Shl { -LL | | /// The resulting type after applying the `<<` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn shl(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Shl { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A >> A` --> $DIR/issue-28837.rs:22:7 @@ -210,18 +162,12 @@ note: an implementation of `Shr<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `Shr<_>` + | ^^^^^^^^ must implement `Shr<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait Shr { -LL | | /// The resulting type after applying the `>>` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn shr(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Shr { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: binary operation `==` cannot be applied to type `A` --> $DIR/issue-28837.rs:24:7 @@ -235,7 +181,7 @@ note: an implementation of `PartialEq<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^ must implement `PartialEq<_>` help: consider annotating `A` with `#[derive(PartialEq)]` | LL | #[derive(PartialEq)] @@ -253,7 +199,7 @@ note: an implementation of `PartialEq<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^ must implement `PartialEq<_>` help: consider annotating `A` with `#[derive(PartialEq)]` | LL | #[derive(PartialEq)] @@ -271,7 +217,7 @@ note: an implementation of `PartialOrd<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `PartialOrd<_>` + | ^^^^^^^^ must implement `PartialOrd<_>` help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]` | LL | #[derive(PartialEq, PartialOrd)] @@ -289,7 +235,7 @@ note: an implementation of `PartialOrd<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `PartialOrd<_>` + | ^^^^^^^^ must implement `PartialOrd<_>` help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]` | LL | #[derive(PartialEq, PartialOrd)] @@ -307,7 +253,7 @@ note: an implementation of `PartialOrd<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `PartialOrd<_>` + | ^^^^^^^^ must implement `PartialOrd<_>` help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]` | LL | #[derive(PartialEq, PartialOrd)] @@ -325,7 +271,7 @@ note: an implementation of `PartialOrd<_>` might be missing for `A` --> $DIR/issue-28837.rs:1:1 | LL | struct A; - | ^^^^^^^^^ must implement `PartialOrd<_>` + | ^^^^^^^^ must implement `PartialOrd<_>` help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]` | LL | #[derive(PartialEq, PartialOrd)] diff --git a/src/test/ui/binop/issue-3820.stderr b/src/test/ui/binop/issue-3820.stderr index d5c24e1bb6cd..f21f89069112 100644 --- a/src/test/ui/binop/issue-3820.stderr +++ b/src/test/ui/binop/issue-3820.stderr @@ -14,14 +14,8 @@ LL | struct Thing { note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Mul { -LL | | /// The resulting type after applying the `*` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn mul(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Mul { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/blind/blind-item-block-middle.stderr b/src/test/ui/blind/blind-item-block-middle.stderr index dd83f6edf62a..eb64fea94339 100644 --- a/src/test/ui/blind/blind-item-block-middle.stderr +++ b/src/test/ui/blind/blind-item-block-middle.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/blind-item-block-middle.rs:6:9 | LL | mod foo { pub struct bar; } - | --------------- unit struct defined here + | -------------- unit struct defined here ... LL | let bar = 5; | ^^^ - this expression has type `{integer}` diff --git a/src/test/ui/borrowck/issue-81365-1.stderr b/src/test/ui/borrowck/issue-81365-1.stderr index ef88d7f14a39..d79394834dca 100644 --- a/src/test/ui/borrowck/issue-81365-1.stderr +++ b/src/test/ui/borrowck/issue-81365-1.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-1.rs:12:5 | LL | type Target = DerefTarget; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-2.stderr b/src/test/ui/borrowck/issue-81365-2.stderr index e71edb509649..764eaaa7cc7b 100644 --- a/src/test/ui/borrowck/issue-81365-2.stderr +++ b/src/test/ui/borrowck/issue-81365-2.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-2.rs:12:5 | LL | type Target = DerefTarget; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-3.stderr b/src/test/ui/borrowck/issue-81365-3.stderr index 70bb6bb93a94..9447174fd21e 100644 --- a/src/test/ui/borrowck/issue-81365-3.stderr +++ b/src/test/ui/borrowck/issue-81365-3.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-3.rs:23:5 | LL | type Target = Container; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-4.stderr b/src/test/ui/borrowck/issue-81365-4.stderr index e714bb86d1cd..0ab3fa92706b 100644 --- a/src/test/ui/borrowck/issue-81365-4.stderr +++ b/src/test/ui/borrowck/issue-81365-4.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-4.rs:24:5 | LL | type Target = Container; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-5.stderr b/src/test/ui/borrowck/issue-81365-5.stderr index 8201894c6db4..20ff229ffe7d 100644 --- a/src/test/ui/borrowck/issue-81365-5.stderr +++ b/src/test/ui/borrowck/issue-81365-5.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-5.rs:19:5 | LL | type Target = DerefTarget; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-6.stderr b/src/test/ui/borrowck/issue-81365-6.stderr index 85ed6acca3d4..575aed73b466 100644 --- a/src/test/ui/borrowck/issue-81365-6.stderr +++ b/src/test/ui/borrowck/issue-81365-6.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-6.rs:9:5 | LL | type Target = [()]; - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-7.stderr b/src/test/ui/borrowck/issue-81365-7.stderr index 506732ec0c5b..52d2d9e75a95 100644 --- a/src/test/ui/borrowck/issue-81365-7.stderr +++ b/src/test/ui/borrowck/issue-81365-7.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-7.rs:12:5 | LL | type Target = DerefTarget; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81365-8.stderr b/src/test/ui/borrowck/issue-81365-8.stderr index 716b6e9b51fd..fd83e10a295d 100644 --- a/src/test/ui/borrowck/issue-81365-8.stderr +++ b/src/test/ui/borrowck/issue-81365-8.stderr @@ -13,7 +13,7 @@ note: deref defined here --> $DIR/issue-81365-8.rs:12:5 | LL | type Target = DerefTarget; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-81899.stderr b/src/test/ui/borrowck/issue-81899.stderr index e7345ff3f9a6..29288be49341 100644 --- a/src/test/ui/borrowck/issue-81899.stderr +++ b/src/test/ui/borrowck/issue-81899.stderr @@ -16,9 +16,7 @@ error: any use of this value will cause an error --> $DIR/issue-81899.rs:4:23 | LL | const _CONST: &[u8] = &f(&[], |_| {}); - | ----------------------^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -32,9 +30,7 @@ error: any use of this value will cause an error --> $DIR/issue-81899.rs:4:23 | LL | const _CONST: &[u8] = &f(&[], |_| {}); - | ----------------------^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/borrowck/issue-88434-minimal-example.stderr b/src/test/ui/borrowck/issue-88434-minimal-example.stderr index 47d83c653558..daded200bd92 100644 --- a/src/test/ui/borrowck/issue-88434-minimal-example.stderr +++ b/src/test/ui/borrowck/issue-88434-minimal-example.stderr @@ -16,9 +16,7 @@ error: any use of this value will cause an error --> $DIR/issue-88434-minimal-example.rs:3:21 | LL | const _CONST: &() = &f(&|_| {}); - | --------------------^^^^^^^^^^^- - | | - | referenced constant has errors + | ----------------- ^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -32,9 +30,7 @@ error: any use of this value will cause an error --> $DIR/issue-88434-minimal-example.rs:3:21 | LL | const _CONST: &() = &f(&|_| {}); - | --------------------^^^^^^^^^^^- - | | - | referenced constant has errors + | ----------------- ^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr index b08a7cfc7fe1..ce6a37ee418f 100644 --- a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr +++ b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr @@ -16,9 +16,7 @@ error: any use of this value will cause an error --> $DIR/issue-88434-removal-index-should-be-less.rs:3:23 | LL | const _CONST: &[u8] = &f(&[], |_| {}); - | ----------------------^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -32,9 +30,7 @@ error: any use of this value will cause an error --> $DIR/issue-88434-removal-index-should-be-less.rs:3:23 | LL | const _CONST: &[u8] = &f(&[], |_| {}); - | ----------------------^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr index 32d36274ff6e..e0678bc718fa 100644 --- a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr +++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr @@ -25,7 +25,7 @@ note: `E1` defined here --> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1 | LL | pub enum E1 {} - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ = note: the matched value is of type `E1`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -44,7 +44,7 @@ note: `E2` defined here --> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1 | LL | pub enum E2 { A, B } - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ = note: the matched value is of type `E2`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/coherence/coherence-overlap-downstream.stderr b/src/test/ui/coherence/coherence-overlap-downstream.stderr index 9ab099489d9e..7f373e595a35 100644 --- a/src/test/ui/coherence/coherence-overlap-downstream.stderr +++ b/src/test/ui/coherence/coherence-overlap-downstream.stderr @@ -10,7 +10,7 @@ error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32` --> $DIR/coherence-overlap-downstream.rs:14:1 | LL | impl Foo for T where T: Bar {} - | --------------------------------------- first implementation here + | ----------------------- first implementation here LL | impl Foo for i32 {} | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` | diff --git a/src/test/ui/coherence/coherence-overlap-upstream.stderr b/src/test/ui/coherence/coherence-overlap-upstream.stderr index 8272c8875860..f6145c1883a0 100644 --- a/src/test/ui/coherence/coherence-overlap-upstream.stderr +++ b/src/test/ui/coherence/coherence-overlap-upstream.stderr @@ -2,7 +2,7 @@ error[E0119]: conflicting implementations of trait `Foo` for type `i16` --> $DIR/coherence-overlap-upstream.rs:13:1 | LL | impl Foo for T where T: Remote {} - | --------------------------------- first implementation here + | ----------------- first implementation here LL | impl Foo for i16 {} | ^^^^^^^^^^^^^^^^ conflicting implementation for `i16` | diff --git a/src/test/ui/coherence/coherence-wasm-bindgen.stderr b/src/test/ui/coherence/coherence-wasm-bindgen.stderr index 432646e5321e..aa74e2315392 100644 --- a/src/test/ui/coherence/coherence-wasm-bindgen.stderr +++ b/src/test/ui/coherence/coherence-wasm-bindgen.stderr @@ -1,22 +1,11 @@ error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _` --> $DIR/coherence-wasm-bindgen.rs:28:1 | -LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) -LL | | where -LL | | A: FromWasmAbi, -LL | | R: ReturnWasmAbi, -LL | | { -LL | | } - | |_- first implementation here +LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) + | ------------------------------------------------------------ first implementation here ... -LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b) -LL | | where -LL | | A: RefFromWasmAbi, -LL | | R: ReturnWasmAbi, -... | -LL | | -LL | | } - | |_^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _` +LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _` | note: the lint level is defined here --> $DIR/coherence-wasm-bindgen.rs:10:9 diff --git a/src/test/ui/conflicting-repr-hints.stderr b/src/test/ui/conflicting-repr-hints.stderr index 0f32fc0481bc..0c7c50d67300 100644 --- a/src/test/ui/conflicting-repr-hints.stderr +++ b/src/test/ui/conflicting-repr-hints.stderr @@ -21,72 +21,61 @@ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:29:1 | LL | struct F(i32); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:33:1 | LL | struct G(i32); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:37:1 | LL | struct H(i32); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0634]: type has conflicting packed representation hints --> $DIR/conflicting-repr-hints.rs:40:1 | LL | struct I(i32); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0634]: type has conflicting packed representation hints --> $DIR/conflicting-repr-hints.rs:44:1 | LL | struct J(i32); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:50:1 | -LL | / union X { -LL | | -LL | | i: i32, -LL | | } - | |_^ +LL | union X { + | ^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:57:1 | -LL | / union Y { -LL | | -LL | | i: i32, -LL | | } - | |_^ +LL | union Y { + | ^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:64:1 | -LL | / union Z { -LL | | -LL | | i: i32, -LL | | } - | |_^ +LL | union Z { + | ^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:70:1 | LL | pub struct S(u16); - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0587]: type has conflicting packed and align representation hints --> $DIR/conflicting-repr-hints.rs:73:1 | -LL | / pub union U { -LL | | u: u16 -LL | | } - | |_^ +LL | pub union U { + | ^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr index c6b0ce931450..2d9de8805bb5 100644 --- a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr @@ -2,7 +2,7 @@ error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface --> $DIR/eval-privacy.rs:16:5 | LL | type AssocTy = Const<{ my_const_fn(U) }>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^ can't leak private type ... LL | const fn my_const_fn(val: u8) -> u8 { | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/issues/issue-83765.stderr index 98931a3936f5..28ddddf1be62 100644 --- a/src/test/ui/const-generics/issues/issue-83765.stderr +++ b/src/test/ui/const-generics/issues/issue-83765.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when resolving instance ` $DIR/issue-83765.rs:5:5 | LL | const DIM: usize; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | note: ...which requires checking if `TensorDimension` fulfills its obligations... --> $DIR/issue-83765.rs:4:1 diff --git a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr index d29e020339b7..ce281797e566 100644 --- a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr +++ b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr @@ -44,7 +44,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:26:1 | LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered uninitialized bytes + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -55,7 +55,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:28:1 | LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -66,7 +66,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:30:1 | LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -76,13 +76,8 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:33:1 | -LL | / pub static S7: &[u16] = unsafe { -LL | | -LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1); -LL | | -LL | | from_raw_parts(ptr, 4) -LL | | }; - | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) +LL | pub static S7: &[u16] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -163,12 +158,8 @@ LL | from_ptr_range(ptr..ptr.add(2)) error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:53:1 | -LL | / pub static R4: &[u8] = unsafe { -LL | | -LL | | let ptr = (&D1) as *const MaybeUninit<&u32> as *const u8; -LL | | from_ptr_range(ptr..ptr.add(1)) -LL | | }; - | |__^ constructing invalid value at .[0]: encountered uninitialized bytes +LL | pub static R4: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -178,12 +169,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:58:1 | -LL | / pub static R5: &[u8] = unsafe { -LL | | -LL | | let ptr = &D3 as *const &u32; -LL | | from_ptr_range(ptr.cast()..ptr.add(1).cast()) -LL | | }; - | |__^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes +LL | pub static R5: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -193,12 +180,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:63:1 | -LL | / pub static R6: &[bool] = unsafe { -LL | | -LL | | let ptr = &D0 as *const u32 as *const bool; -LL | | from_ptr_range(ptr..ptr.add(4)) -LL | | }; - | |__^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean +LL | pub static R6: &[bool] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -208,12 +191,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:68:1 | -LL | / pub static R7: &[u16] = unsafe { -LL | | -LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1); -LL | | from_ptr_range(ptr..ptr.add(4)) -LL | | }; - | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) +LL | pub static R7: &[u16] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr index f22a708e3391..6c484f7c95bf 100644 --- a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr +++ b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr @@ -44,7 +44,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:26:1 | LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered uninitialized bytes + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -55,7 +55,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:28:1 | LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -66,7 +66,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:30:1 | LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -76,13 +76,8 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:33:1 | -LL | / pub static S7: &[u16] = unsafe { -LL | | -LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1); -LL | | -LL | | from_raw_parts(ptr, 4) -LL | | }; - | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) +LL | pub static S7: &[u16] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -163,12 +158,8 @@ LL | from_ptr_range(ptr..ptr.add(2)) error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:53:1 | -LL | / pub static R4: &[u8] = unsafe { -LL | | -LL | | let ptr = (&D1) as *const MaybeUninit<&u32> as *const u8; -LL | | from_ptr_range(ptr..ptr.add(1)) -LL | | }; - | |__^ constructing invalid value at .[0]: encountered uninitialized bytes +LL | pub static R4: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -178,12 +169,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:58:1 | -LL | / pub static R5: &[u8] = unsafe { -LL | | -LL | | let ptr = &D3 as *const &u32; -LL | | from_ptr_range(ptr.cast()..ptr.add(1).cast()) -LL | | }; - | |__^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes +LL | pub static R5: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered a pointer, but expected plain (non-pointer) bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -193,12 +180,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:63:1 | -LL | / pub static R6: &[bool] = unsafe { -LL | | -LL | | let ptr = &D0 as *const u32 as *const bool; -LL | | from_ptr_range(ptr..ptr.add(4)) -LL | | }; - | |__^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean +LL | pub static R6: &[bool] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x11, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -208,12 +191,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/forbidden_slices.rs:68:1 | -LL | / pub static R7: &[u16] = unsafe { -LL | | -LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1); -LL | | from_ptr_range(ptr..ptr.add(4)) -LL | | }; - | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) +LL | pub static R7: &[u16] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/assert-type-intrinsics.stderr b/src/test/ui/consts/assert-type-intrinsics.stderr index 89f8f2ffc55c..f3b9170d428a 100644 --- a/src/test/ui/consts/assert-type-intrinsics.stderr +++ b/src/test/ui/consts/assert-type-intrinsics.stderr @@ -1,11 +1,10 @@ error: any use of this value will cause an error --> $DIR/assert-type-intrinsics.rs:14:9 | -LL | / const _BAD1: () = unsafe { -LL | | MaybeUninit::::uninit().assume_init(); - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` -LL | | }; - | |______- +LL | const _BAD1: () = unsafe { + | --------------- +LL | MaybeUninit::::uninit().assume_init(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -14,11 +13,10 @@ LL | | }; error: any use of this value will cause an error --> $DIR/assert-type-intrinsics.rs:17:9 | -LL | / const _BAD2: () = unsafe { -LL | | intrinsics::assert_uninit_valid::(); - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid -LL | | }; - | |______- +LL | const _BAD2: () = unsafe { + | --------------- +LL | intrinsics::assert_uninit_valid::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -26,11 +24,10 @@ LL | | }; error: any use of this value will cause an error --> $DIR/assert-type-intrinsics.rs:20:9 | -LL | / const _BAD3: () = unsafe { -LL | | intrinsics::assert_zero_valid::<&'static i32>(); - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid -LL | | }; - | |______- +LL | const _BAD3: () = unsafe { + | --------------- +LL | intrinsics::assert_zero_valid::<&'static i32>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -41,11 +38,10 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/assert-type-intrinsics.rs:14:9 | -LL | / const _BAD1: () = unsafe { -LL | | MaybeUninit::::uninit().assume_init(); - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` -LL | | }; - | |______- +LL | const _BAD1: () = unsafe { + | --------------- +LL | MaybeUninit::::uninit().assume_init(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -55,11 +51,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/assert-type-intrinsics.rs:17:9 | -LL | / const _BAD2: () = unsafe { -LL | | intrinsics::assert_uninit_valid::(); - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid -LL | | }; - | |______- +LL | const _BAD2: () = unsafe { + | --------------- +LL | intrinsics::assert_uninit_valid::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -69,11 +64,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/assert-type-intrinsics.rs:20:9 | -LL | / const _BAD3: () = unsafe { -LL | | intrinsics::assert_zero_valid::<&'static i32>(); - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid -LL | | }; - | |______- +LL | const _BAD3: () = unsafe { + | --------------- +LL | intrinsics::assert_zero_valid::<&'static i32>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/assoc_const_generic_impl.stderr b/src/test/ui/consts/assoc_const_generic_impl.stderr index cccf62a8ff6d..17cbaef1f06d 100644 --- a/src/test/ui/consts/assoc_const_generic_impl.stderr +++ b/src/test/ui/consts/assoc_const_generic_impl.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/assoc_const_generic_impl.rs:11:34 | LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::()]; - | -----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 4 + | ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4 | note: the lint level is defined here --> $DIR/assoc_const_generic_impl.rs:3:9 @@ -27,9 +25,7 @@ warning: any use of this value will cause an error --> $DIR/assoc_const_generic_impl.rs:11:34 | LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::()]; - | -----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 4 + | ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4 | note: the lint level is defined here --> $DIR/assoc_const_generic_impl.rs:3:9 diff --git a/src/test/ui/consts/const-as-fn.stderr b/src/test/ui/consts/const-as-fn.stderr index b8dd4134b284..6c51ed89393a 100644 --- a/src/test/ui/consts/const-as-fn.stderr +++ b/src/test/ui/consts/const-as-fn.stderr @@ -2,7 +2,7 @@ error[E0618]: expected function, found `usize` --> $DIR/const-as-fn.rs:4:5 | LL | const FOO: usize = 0; - | --------------------- `FOO` defined here + | ---------------- `FOO` defined here ... LL | FOO(); | ^^^-- diff --git a/src/test/ui/consts/const-err-early.stderr b/src/test/ui/consts/const-err-early.stderr index 385e770eb4f0..1b94aa080dda 100644 --- a/src/test/ui/consts/const-err-early.stderr +++ b/src/test/ui/consts/const-err-early.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:3:19 | LL | pub const A: i8 = -i8::MIN; - | ------------------^^^^^^^^- - | | - | attempt to negate `i8::MIN`, which would overflow + | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 @@ -18,9 +16,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:5:19 | LL | pub const B: u8 = 200u8 + 200u8; - | ------------------^^^^^^^^^^^^^- - | | - | attempt to compute `200_u8 + 200_u8`, which would overflow + | --------------- ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -29,9 +25,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:7:19 | LL | pub const C: u8 = 200u8 * 4; - | ------------------^^^^^^^^^- - | | - | attempt to compute `200_u8 * 4_u8`, which would overflow + | --------------- ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -40,9 +34,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:9:19 | LL | pub const D: u8 = 42u8 - (42u8 + 1); - | ------------------^^^^^^^^^^^^^^^^^- - | | - | attempt to compute `42_u8 - 43_u8`, which would overflow + | --------------- ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -51,9 +43,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:11:19 | LL | pub const E: u8 = [5u8][1]; - | ------------------^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 1 + | --------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -65,9 +55,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:3:19 | LL | pub const A: i8 = -i8::MIN; - | ------------------^^^^^^^^- - | | - | attempt to negate `i8::MIN`, which would overflow + | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 @@ -82,9 +70,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:5:19 | LL | pub const B: u8 = 200u8 + 200u8; - | ------------------^^^^^^^^^^^^^- - | | - | attempt to compute `200_u8 + 200_u8`, which would overflow + | --------------- ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 @@ -99,9 +85,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:7:19 | LL | pub const C: u8 = 200u8 * 4; - | ------------------^^^^^^^^^- - | | - | attempt to compute `200_u8 * 4_u8`, which would overflow + | --------------- ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 @@ -116,9 +100,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:9:19 | LL | pub const D: u8 = 42u8 - (42u8 + 1); - | ------------------^^^^^^^^^^^^^^^^^- - | | - | attempt to compute `42_u8 - 43_u8`, which would overflow + | --------------- ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 @@ -133,9 +115,7 @@ error: any use of this value will cause an error --> $DIR/const-err-early.rs:11:19 | LL | pub const E: u8 = [5u8][1]; - | ------------------^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 1 + | --------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 diff --git a/src/test/ui/consts/const-err-multi.stderr b/src/test/ui/consts/const-err-multi.stderr index a195459ff088..f179843654e9 100644 --- a/src/test/ui/consts/const-err-multi.stderr +++ b/src/test/ui/consts/const-err-multi.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:3:19 | LL | pub const A: i8 = -i8::MIN; - | ------------------^^^^^^^^- - | | - | attempt to negate `i8::MIN`, which would overflow + | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-err-multi.rs:1:9 @@ -18,9 +16,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:6:19 | LL | pub const B: i8 = A; - | ------------------^- - | | - | referenced constant has errors + | --------------- ^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -29,9 +25,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:9:19 | LL | pub const C: u8 = A as u8; - | ------------------^------- - | | - | referenced constant has errors + | --------------- ^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -40,9 +34,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:12:24 | LL | pub const D: i8 = 50 - A; - | -----------------------^- - | | - | referenced constant has errors + | --------------- ^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -54,9 +46,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:3:19 | LL | pub const A: i8 = -i8::MIN; - | ------------------^^^^^^^^- - | | - | attempt to negate `i8::MIN`, which would overflow + | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-err-multi.rs:1:9 @@ -71,9 +61,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:6:19 | LL | pub const B: i8 = A; - | ------------------^- - | | - | referenced constant has errors + | --------------- ^ referenced constant has errors | note: the lint level is defined here --> $DIR/const-err-multi.rs:1:9 @@ -88,9 +76,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:9:19 | LL | pub const C: u8 = A as u8; - | ------------------^------- - | | - | referenced constant has errors + | --------------- ^ referenced constant has errors | note: the lint level is defined here --> $DIR/const-err-multi.rs:1:9 @@ -105,9 +91,7 @@ error: any use of this value will cause an error --> $DIR/const-err-multi.rs:12:24 | LL | pub const D: i8 = 50 - A; - | -----------------------^- - | | - | referenced constant has errors + | --------------- ^ referenced constant has errors | note: the lint level is defined here --> $DIR/const-err-multi.rs:1:9 diff --git a/src/test/ui/consts/const-err.stderr b/src/test/ui/consts/const-err.stderr index 3b03e702dc4a..e3b0d29c8532 100644 --- a/src/test/ui/consts/const-err.stderr +++ b/src/test/ui/consts/const-err.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/const-err.rs:11:17 | LL | const FOO: u8 = [5u8][1]; - | ----------------^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 1 + | ------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | note: the lint level is defined here --> $DIR/const-err.rs:5:9 @@ -34,9 +32,7 @@ warning: any use of this value will cause an error --> $DIR/const-err.rs:11:17 | LL | const FOO: u8 = [5u8][1]; - | ----------------^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 1 + | ------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | note: the lint level is defined here --> $DIR/const-err.rs:5:9 diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr index f88bf4454260..2312e2a45db5 100644 --- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr +++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/conditional_array_execution.rs:7:19 | LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; - | ------------------^^^^^--------------------------- - | | - | attempt to compute `5_u32 - 6_u32`, which would overflow + | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow | note: the lint level is defined here --> $DIR/conditional_array_execution.rs:3:9 @@ -38,9 +36,7 @@ warning: any use of this value will cause an error --> $DIR/conditional_array_execution.rs:7:19 | LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; - | ------------------^^^^^--------------------------- - | | - | attempt to compute `5_u32 - 6_u32`, which would overflow + | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow | note: the lint level is defined here --> $DIR/conditional_array_execution.rs:3:9 diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr index 1c74b978827c..cf50c19caa7d 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr @@ -17,9 +17,7 @@ warning: any use of this value will cause an error --> $DIR/const-eval-overflow-2.rs:11:25 | LL | const NEG_NEG_128: i8 = -NEG_128; - | ------------------------^^^^^^^^- - | | - | attempt to negate `i8::MIN`, which would overflow + | --------------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow-2.rs:4:36 diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr index 948ead521ea3..dab9a76c7d42 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr @@ -1,12 +1,11 @@ error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:14:6 | -LL | / const VALS_I8: (i8,) = -LL | | ( -LL | | i8::MIN - 1, - | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I8: (i8,) = + | -------------------- +LL | ( +LL | i8::MIN - 1, + | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -19,12 +18,11 @@ LL | #![deny(const_err)] error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:21:6 | -LL | / const VALS_I16: (i16,) = -LL | | ( -LL | | i16::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I16: (i16,) = + | ---------------------- +LL | ( +LL | i16::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -32,12 +30,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:28:6 | -LL | / const VALS_I32: (i32,) = -LL | | ( -LL | | i32::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I32: (i32,) = + | ---------------------- +LL | ( +LL | i32::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -45,12 +42,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:35:6 | -LL | / const VALS_I64: (i64,) = -LL | | ( -LL | | i64::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I64: (i64,) = + | ---------------------- +LL | ( +LL | i64::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -58,12 +54,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:42:6 | -LL | / const VALS_U8: (u8,) = -LL | | ( -LL | | u8::MIN - 1, - | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U8: (u8,) = + | -------------------- +LL | ( +LL | u8::MIN - 1, + | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -71,11 +66,10 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:48:6 | -LL | / const VALS_U16: (u16,) = ( -LL | | u16::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U16: (u16,) = ( + | ---------------------- +LL | u16::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -83,11 +77,10 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:54:6 | -LL | / const VALS_U32: (u32,) = ( -LL | | u32::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U32: (u32,) = ( + | ---------------------- +LL | u32::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -95,12 +88,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:61:6 | -LL | / const VALS_U64: (u64,) = -LL | | ( -LL | | u64::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U64: (u64,) = + | ---------------------- +LL | ( +LL | u64::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -111,12 +103,11 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:14:6 | -LL | / const VALS_I8: (i8,) = -LL | | ( -LL | | i8::MIN - 1, - | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I8: (i8,) = + | -------------------- +LL | ( +LL | i8::MIN - 1, + | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -130,12 +121,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:21:6 | -LL | / const VALS_I16: (i16,) = -LL | | ( -LL | | i16::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I16: (i16,) = + | ---------------------- +LL | ( +LL | i16::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -149,12 +139,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:28:6 | -LL | / const VALS_I32: (i32,) = -LL | | ( -LL | | i32::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I32: (i32,) = + | ---------------------- +LL | ( +LL | i32::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -168,12 +157,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:35:6 | -LL | / const VALS_I64: (i64,) = -LL | | ( -LL | | i64::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I64: (i64,) = + | ---------------------- +LL | ( +LL | i64::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -187,12 +175,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:42:6 | -LL | / const VALS_U8: (u8,) = -LL | | ( -LL | | u8::MIN - 1, - | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U8: (u8,) = + | -------------------- +LL | ( +LL | u8::MIN - 1, + | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -206,11 +193,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:48:6 | -LL | / const VALS_U16: (u16,) = ( -LL | | u16::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U16: (u16,) = ( + | ---------------------- +LL | u16::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -224,11 +210,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:54:6 | -LL | / const VALS_U32: (u32,) = ( -LL | | u32::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U32: (u32,) = ( + | ---------------------- +LL | u32::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 @@ -242,12 +227,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2.rs:61:6 | -LL | / const VALS_U64: (u64,) = -LL | | ( -LL | | u64::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U64: (u64,) = + | ---------------------- +LL | ( +LL | u64::MIN - 1, + | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2.rs:8:9 diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr index 5db6a49a98b0..5fe9917437e0 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr @@ -1,12 +1,11 @@ error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:14:6 | -LL | / const VALS_I8: (i8,) = -LL | | ( -LL | | i8::MAX + 1, - | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I8: (i8,) = + | -------------------- +LL | ( +LL | i8::MAX + 1, + | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -19,12 +18,11 @@ LL | #![deny(const_err)] error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:21:6 | -LL | / const VALS_I16: (i16,) = -LL | | ( -LL | | i16::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I16: (i16,) = + | ---------------------- +LL | ( +LL | i16::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -32,12 +30,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:28:6 | -LL | / const VALS_I32: (i32,) = -LL | | ( -LL | | i32::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I32: (i32,) = + | ---------------------- +LL | ( +LL | i32::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -45,12 +42,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:35:6 | -LL | / const VALS_I64: (i64,) = -LL | | ( -LL | | i64::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I64: (i64,) = + | ---------------------- +LL | ( +LL | i64::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -58,12 +54,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:42:6 | -LL | / const VALS_U8: (u8,) = -LL | | ( -LL | | u8::MAX + 1, - | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U8: (u8,) = + | -------------------- +LL | ( +LL | u8::MAX + 1, + | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -71,11 +66,10 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:48:6 | -LL | / const VALS_U16: (u16,) = ( -LL | | u16::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U16: (u16,) = ( + | ---------------------- +LL | u16::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -83,11 +77,10 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:54:6 | -LL | / const VALS_U32: (u32,) = ( -LL | | u32::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U32: (u32,) = ( + | ---------------------- +LL | u32::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -95,12 +88,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:61:6 | -LL | / const VALS_U64: (u64,) = -LL | | ( -LL | | u64::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U64: (u64,) = + | ---------------------- +LL | ( +LL | u64::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -111,12 +103,11 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:14:6 | -LL | / const VALS_I8: (i8,) = -LL | | ( -LL | | i8::MAX + 1, - | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I8: (i8,) = + | -------------------- +LL | ( +LL | i8::MAX + 1, + | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -130,12 +121,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:21:6 | -LL | / const VALS_I16: (i16,) = -LL | | ( -LL | | i16::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I16: (i16,) = + | ---------------------- +LL | ( +LL | i16::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -149,12 +139,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:28:6 | -LL | / const VALS_I32: (i32,) = -LL | | ( -LL | | i32::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I32: (i32,) = + | ---------------------- +LL | ( +LL | i32::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -168,12 +157,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:35:6 | -LL | / const VALS_I64: (i64,) = -LL | | ( -LL | | i64::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I64: (i64,) = + | ---------------------- +LL | ( +LL | i64::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -187,12 +175,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:42:6 | -LL | / const VALS_U8: (u8,) = -LL | | ( -LL | | u8::MAX + 1, - | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U8: (u8,) = + | -------------------- +LL | ( +LL | u8::MAX + 1, + | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -206,11 +193,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:48:6 | -LL | / const VALS_U16: (u16,) = ( -LL | | u16::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U16: (u16,) = ( + | ---------------------- +LL | u16::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -224,11 +210,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:54:6 | -LL | / const VALS_U32: (u32,) = ( -LL | | u32::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U32: (u32,) = ( + | ---------------------- +LL | u32::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 @@ -242,12 +227,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2b.rs:61:6 | -LL | / const VALS_U64: (u64,) = -LL | | ( -LL | | u64::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U64: (u64,) = + | ---------------------- +LL | ( +LL | u64::MAX + 1, + | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2b.rs:8:9 diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr index ec3f3c110596..d5f3a0fb1c3f 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr @@ -1,12 +1,11 @@ error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:14:6 | -LL | / const VALS_I8: (i8,) = -LL | | ( -LL | | i8::MIN * 2, - | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I8: (i8,) = + | -------------------- +LL | ( +LL | i8::MIN * 2, + | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -19,12 +18,11 @@ LL | #![deny(const_err)] error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:21:6 | -LL | / const VALS_I16: (i16,) = -LL | | ( -LL | | i16::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I16: (i16,) = + | ---------------------- +LL | ( +LL | i16::MIN * 2, + | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -32,12 +30,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:28:6 | -LL | / const VALS_I32: (i32,) = -LL | | ( -LL | | i32::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I32: (i32,) = + | ---------------------- +LL | ( +LL | i32::MIN * 2, + | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -45,12 +42,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:35:6 | -LL | / const VALS_I64: (i64,) = -LL | | ( -LL | | i64::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I64: (i64,) = + | ---------------------- +LL | ( +LL | i64::MIN * 2, + | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -58,12 +54,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:42:6 | -LL | / const VALS_U8: (u8,) = -LL | | ( -LL | | u8::MAX * 2, - | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U8: (u8,) = + | -------------------- +LL | ( +LL | u8::MAX * 2, + | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -71,11 +66,10 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:48:6 | -LL | / const VALS_U16: (u16,) = ( -LL | | u16::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U16: (u16,) = ( + | ---------------------- +LL | u16::MAX * 2, + | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -83,11 +77,10 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:54:6 | -LL | / const VALS_U32: (u32,) = ( -LL | | u32::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U32: (u32,) = ( + | ---------------------- +LL | u32::MAX * 2, + | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -95,12 +88,11 @@ LL | | ); error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:61:6 | -LL | / const VALS_U64: (u64,) = -LL | | ( -LL | | u64::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U64: (u64,) = + | ---------------------- +LL | ( +LL | u64::MAX * 2, + | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -111,12 +103,11 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:14:6 | -LL | / const VALS_I8: (i8,) = -LL | | ( -LL | | i8::MIN * 2, - | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I8: (i8,) = + | -------------------- +LL | ( +LL | i8::MIN * 2, + | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -130,12 +121,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:21:6 | -LL | / const VALS_I16: (i16,) = -LL | | ( -LL | | i16::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I16: (i16,) = + | ---------------------- +LL | ( +LL | i16::MIN * 2, + | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -149,12 +139,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:28:6 | -LL | / const VALS_I32: (i32,) = -LL | | ( -LL | | i32::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I32: (i32,) = + | ---------------------- +LL | ( +LL | i32::MIN * 2, + | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -168,12 +157,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:35:6 | -LL | / const VALS_I64: (i64,) = -LL | | ( -LL | | i64::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_I64: (i64,) = + | ---------------------- +LL | ( +LL | i64::MIN * 2, + | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -187,12 +175,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:42:6 | -LL | / const VALS_U8: (u8,) = -LL | | ( -LL | | u8::MAX * 2, - | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U8: (u8,) = + | -------------------- +LL | ( +LL | u8::MAX * 2, + | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -206,11 +193,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:48:6 | -LL | / const VALS_U16: (u16,) = ( -LL | | u16::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U16: (u16,) = ( + | ---------------------- +LL | u16::MAX * 2, + | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -224,11 +210,10 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:54:6 | -LL | / const VALS_U32: (u32,) = ( -LL | | u32::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U32: (u32,) = ( + | ---------------------- +LL | u32::MAX * 2, + | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 @@ -242,12 +227,11 @@ Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const-eval-overflow2c.rs:61:6 | -LL | / const VALS_U64: (u64,) = -LL | | ( -LL | | u64::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow -LL | | ); - | |_______- +LL | const VALS_U64: (u64,) = + | ---------------------- +LL | ( +LL | u64::MAX * 2, + | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow | note: the lint level is defined here --> $DIR/const-eval-overflow2c.rs:8:9 diff --git a/src/test/ui/consts/const-eval/const-eval-query-stack.stderr b/src/test/ui/consts/const-eval/const-eval-query-stack.stderr index bbec2a830e64..0ae7bfa86bc7 100644 --- a/src/test/ui/consts/const-eval/const-eval-query-stack.stderr +++ b/src/test/ui/consts/const-eval/const-eval-query-stack.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/const-eval-query-stack.rs:19:16 | LL | const X: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | note: the lint level is defined here --> $DIR/const-eval-query-stack.rs:18:8 @@ -40,9 +38,7 @@ warning: any use of this value will cause an error --> $DIR/const-eval-query-stack.rs:19:16 | LL | const X: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | note: the lint level is defined here --> $DIR/const-eval-query-stack.rs:18:8 diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr index 8cbc6a399af2..655a7d520545 100644 --- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr +++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:26:49 | LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u }; - | --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -14,9 +12,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:30:43 | LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -25,9 +21,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:34:45 | LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -36,9 +30,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:38:45 | LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -47,9 +39,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:42:45 | LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -58,7 +48,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const-pointer-values-in-various-types.rs:46:5 | LL | const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -69,9 +59,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:49:43 | LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -80,9 +68,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:53:45 | LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -91,9 +77,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:57:45 | LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -102,9 +86,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:61:45 | LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -113,7 +95,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const-pointer-values-in-various-types.rs:65:5 | LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -124,9 +106,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:68:45 | LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -135,9 +115,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:72:45 | LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -146,9 +124,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:76:47 | LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey }; - | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -157,9 +133,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:80:47 | LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character }; - | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -168,9 +142,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:84:39 | LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 }; - | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -179,9 +151,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:88:41 | LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -190,9 +160,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:92:41 | LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -201,9 +169,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:96:41 | LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -212,9 +178,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:100:43 | LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -223,9 +187,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:104:39 | LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 }; - | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -234,9 +196,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:108:41 | LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -245,9 +205,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:112:41 | LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -256,9 +214,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:116:41 | LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -267,9 +223,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:120:43 | LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -278,9 +232,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:124:41 | LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -289,9 +241,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:128:41 | LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -300,9 +250,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:132:43 | LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -311,9 +259,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:136:43 | LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -326,9 +272,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:26:49 | LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u }; - | --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -339,9 +283,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:30:43 | LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -352,9 +294,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:34:45 | LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -365,9 +305,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:38:45 | LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -378,9 +316,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:42:45 | LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -391,9 +327,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:49:43 | LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -404,9 +338,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:53:45 | LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -417,9 +349,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:57:45 | LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -430,9 +360,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:61:45 | LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -443,9 +371,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:68:45 | LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -456,9 +382,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:72:45 | LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 }; - | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -469,9 +393,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:76:47 | LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey }; - | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -482,9 +404,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:80:47 | LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character }; - | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -495,9 +415,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:84:39 | LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 }; - | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -508,9 +426,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:88:41 | LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -521,9 +437,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:92:41 | LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -534,9 +448,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:96:41 | LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -547,9 +459,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:100:43 | LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -560,9 +470,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:104:39 | LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 }; - | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -573,9 +481,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:108:41 | LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -586,9 +492,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:112:41 | LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -599,9 +503,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:116:41 | LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -612,9 +514,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:120:43 | LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -625,9 +525,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:124:41 | LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -638,9 +536,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:128:41 | LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 }; - | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -651,9 +547,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:132:43 | LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -664,9 +558,7 @@ error: any use of this value will cause an error --> $DIR/const-pointer-values-in-various-types.rs:136:43 | LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character }; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr index daf3d8927c19..f6ffa1ef2969 100644 --- a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr +++ b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr @@ -33,7 +33,7 @@ LL | x(y) | inside `Y` at $DIR/const_fn_ptr_fail2.rs:15:18 ... LL | const Y: usize = bar(X, 2); // FIXME: should fail to typeck someday - | --------------------------- + | -------------- | note: the lint level is defined here --> $DIR/const_fn_ptr_fail2.rs:4:10 @@ -55,7 +55,7 @@ LL | x(y) | inside `Z` at $DIR/const_fn_ptr_fail2.rs:16:18 ... LL | const Z: usize = bar(double, 2); // FIXME: should fail to typeck someday - | -------------------------------- + | -------------- | note: the lint level is defined here --> $DIR/const_fn_ptr_fail2.rs:4:10 diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr index 9057b58ded9d..adfb4cc61cc6 100644 --- a/src/test/ui/consts/const-eval/erroneous-const.stderr +++ b/src/test/ui/consts/const-eval/erroneous-const.stderr @@ -14,9 +14,7 @@ warning: any use of this value will cause an error --> $DIR/erroneous-const.rs:6:22 | LL | const VOID: () = [()][2]; - | -----------------^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 2 + | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2 | note: the lint level is defined here --> $DIR/erroneous-const.rs:2:9 @@ -46,9 +44,7 @@ warning: any use of this value will cause an error --> $DIR/erroneous-const.rs:6:22 | LL | const VOID: () = [()][2]; - | -----------------^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 2 + | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2 | note: the lint level is defined here --> $DIR/erroneous-const.rs:2:9 diff --git a/src/test/ui/consts/const-eval/erroneous-const2.stderr b/src/test/ui/consts/const-eval/erroneous-const2.stderr index bf6cc8410a7e..e947d93e4058 100644 --- a/src/test/ui/consts/const-eval/erroneous-const2.stderr +++ b/src/test/ui/consts/const-eval/erroneous-const2.stderr @@ -14,9 +14,7 @@ warning: any use of this value will cause an error --> $DIR/erroneous-const2.rs:6:22 | LL | const VOID: () = [()][2]; - | -----------------^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 2 + | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2 | note: the lint level is defined here --> $DIR/erroneous-const2.rs:2:9 @@ -40,9 +38,7 @@ warning: any use of this value will cause an error --> $DIR/erroneous-const2.rs:6:22 | LL | const VOID: () = [()][2]; - | -----------------^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 2 + | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2 | note: the lint level is defined here --> $DIR/erroneous-const2.rs:2:9 diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr index adaa4716f153..00ab0dfc557d 100644 --- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr +++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr @@ -2,7 +2,7 @@ error: untyped pointers are not allowed in constant --> $DIR/alloc_intrinsic_nontransient_fail.rs:6:1 | LL | const FOO: *const i32 = foo(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr index 8ce92f722612..f1a780926e74 100644 --- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr +++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/alloc_intrinsic_uninit.rs:8:1 | LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr index cf95842530b6..2eb401226f87 100644 --- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr +++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/alloc_intrinsic_uninit.rs:8:1 | LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr index 8f4fea96c593..36002b850b7e 100644 --- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr +++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr @@ -2,7 +2,7 @@ error: untyped pointers are not allowed in constant --> $DIR/alloc_intrinsic_untyped.rs:6:1 | LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr index 7b3e46fccca7..da4a21e08ab1 100644 --- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr +++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/index-out-of-bounds-never-type.rs:10:61 | LL | const VOID: ! = { let x = 0 * std::mem::size_of::(); [][x] }; - | --------------------------------------------------------^^^^^--- - | | - | index out of bounds: the length is 0 but the index is 0 + | ------------- ^^^^^ index out of bounds: the length is 0 but the index is 0 | note: the lint level is defined here --> $DIR/index-out-of-bounds-never-type.rs:4:9 @@ -27,9 +25,7 @@ warning: any use of this value will cause an error --> $DIR/index-out-of-bounds-never-type.rs:10:61 | LL | const VOID: ! = { let x = 0 * std::mem::size_of::(); [][x] }; - | --------------------------------------------------------^^^^^--- - | | - | index out of bounds: the length is 0 but the index is 0 + | ------------- ^^^^^ index out of bounds: the length is 0 but the index is 0 | note: the lint level is defined here --> $DIR/index-out-of-bounds-never-type.rs:4:9 diff --git a/src/test/ui/consts/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr index 53ed32638ced..91065f416825 100644 --- a/src/test/ui/consts/const-eval/issue-43197.stderr +++ b/src/test/ui/consts/const-eval/issue-43197.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/issue-43197.rs:10:20 | LL | const X: u32 = 0 - 1; - | ---------------^^^^^- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/issue-43197.rs:3:9 @@ -18,9 +16,7 @@ warning: any use of this value will cause an error --> $DIR/issue-43197.rs:13:24 | LL | const Y: u32 = foo(0 - 1); - | -------------------^^^^^-- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -65,9 +61,7 @@ warning: any use of this value will cause an error --> $DIR/issue-43197.rs:10:20 | LL | const X: u32 = 0 - 1; - | ---------------^^^^^- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/issue-43197.rs:3:9 @@ -82,9 +76,7 @@ warning: any use of this value will cause an error --> $DIR/issue-43197.rs:13:24 | LL | const Y: u32 = foo(0 - 1); - | -------------------^^^^^-- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/issue-43197.rs:3:9 diff --git a/src/test/ui/consts/const-eval/issue-44578.stderr b/src/test/ui/consts/const-eval/issue-44578.stderr index 5ecdb7ef5568..81e563b4f546 100644 --- a/src/test/ui/consts/const-eval/issue-44578.stderr +++ b/src/test/ui/consts/const-eval/issue-44578.stderr @@ -12,9 +12,7 @@ warning: any use of this value will cause an error --> $DIR/issue-44578.rs:15:24 | LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize]; - | -------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | index out of bounds: the length is 1 but the index is 1 + | ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | note: the lint level is defined here --> $DIR/issue-44578.rs:3:10 diff --git a/src/test/ui/consts/const-eval/issue-50814-2.stderr b/src/test/ui/consts/const-eval/issue-50814-2.stderr index 67af3b2b1d3a..cc19caca7241 100644 --- a/src/test/ui/consts/const-eval/issue-50814-2.stderr +++ b/src/test/ui/consts/const-eval/issue-50814-2.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/issue-50814-2.rs:14:24 | LL | const BAR: usize = [5, 6, 7][T::BOO]; - | -------------------^^^^^^^^^^^^^^^^^- - | | - | index out of bounds: the length is 3 but the index is 42 + | ---------------- ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -30,9 +28,7 @@ error: any use of this value will cause an error --> $DIR/issue-50814-2.rs:14:24 | LL | const BAR: usize = [5, 6, 7][T::BOO]; - | -------------------^^^^^^^^^^^^^^^^^- - | | - | index out of bounds: the length is 3 but the index is 42 + | ---------------- ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr index b82bc9ca2f81..6ceef91a042a 100644 --- a/src/test/ui/consts/const-eval/issue-50814.stderr +++ b/src/test/ui/consts/const-eval/issue-50814.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/issue-50814.rs:15:21 | LL | const MAX: u8 = A::MAX + B::MAX; - | ----------------^^^^^^^^^^^^^^^- - | | - | attempt to compute `u8::MAX + u8::MAX`, which would overflow + | ------------- ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -30,9 +28,7 @@ error: any use of this value will cause an error --> $DIR/issue-50814.rs:15:21 | LL | const MAX: u8 = A::MAX + B::MAX; - | ----------------^^^^^^^^^^^^^^^- - | | - | attempt to compute `u8::MAX + u8::MAX`, which would overflow + | ------------- ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr index 1a7d38614209..b007dda246de 100644 --- a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr +++ b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr @@ -1,16 +1,11 @@ error: any use of this value will cause an error --> $DIR/partial_ptr_overwrite.rs:8:9 | -LL | / const PARTIAL_OVERWRITE: () = { -LL | | let mut p = &42; -LL | | unsafe { -LL | | let ptr: *mut _ = &mut p; -LL | | *(ptr as *mut u8) = 123; - | | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4 -... | -LL | | let x = *p; -LL | | }; - | |__- +LL | const PARTIAL_OVERWRITE: () = { + | --------------------------- +... +LL | *(ptr as *mut u8) = 123; + | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -22,16 +17,11 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/partial_ptr_overwrite.rs:8:9 | -LL | / const PARTIAL_OVERWRITE: () = { -LL | | let mut p = &42; -LL | | unsafe { -LL | | let ptr: *mut _ = &mut p; -LL | | *(ptr as *mut u8) = 123; - | | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4 -... | -LL | | let x = *p; -LL | | }; - | |__- +LL | const PARTIAL_OVERWRITE: () = { + | --------------------------- +... +LL | *(ptr as *mut u8) = 123; + | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr index be845339dfe6..cfca8ef07464 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr @@ -43,21 +43,15 @@ LL | [1, 2, 3][4] warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:15:5 | -LL | 0 - 1 - | ^^^^^ - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow - | inside `overflow` at $DIR/promoted_errors.rs:15:5 - | inside `X` at $DIR/promoted_errors.rs:43:29 +LL | 0 - 1 + | ^^^^^ + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | inside `overflow` at $DIR/promoted_errors.rs:15:5 + | inside `X` at $DIR/promoted_errors.rs:43:29 ... -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 @@ -70,15 +64,10 @@ LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:43:28 | -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); - | | ^^^^^^^^^^^ referenced constant has errors -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- +LL | let _x: &'static u32 = &overflow(); + | ^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -89,21 +78,15 @@ Future incompatibility report: Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:15:5 | -LL | 0 - 1 - | ^^^^^ - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow - | inside `overflow` at $DIR/promoted_errors.rs:15:5 - | inside `X` at $DIR/promoted_errors.rs:43:29 +LL | 0 - 1 + | ^^^^^ + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | inside `overflow` at $DIR/promoted_errors.rs:15:5 + | inside `X` at $DIR/promoted_errors.rs:43:29 ... -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 @@ -117,15 +100,10 @@ Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:43:28 | -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); - | | ^^^^^^^^^^^ referenced constant has errors -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- +LL | let _x: &'static u32 = &overflow(); + | ^^^^^^^^^^^ referenced constant has errors | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr index c91d52336c36..984484a850f4 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr @@ -43,21 +43,15 @@ LL | [1, 2, 3][4] warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:21:5 | -LL | 1 / 0 - | ^^^^^ - | | - | attempt to divide `1_i32` by zero - | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5 - | inside `X` at $DIR/promoted_errors.rs:46:29 +LL | 1 / 0 + | ^^^^^ + | | + | attempt to divide `1_i32` by zero + | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5 + | inside `X` at $DIR/promoted_errors.rs:46:29 ... -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 @@ -70,16 +64,11 @@ LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:46:28 | -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -LL | | let _x: &'static i32 = &div_by_zero1(); - | | ^^^^^^^^^^^^^^^ referenced constant has errors -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- +... +LL | let _x: &'static i32 = &div_by_zero1(); + | ^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -90,21 +79,15 @@ Future incompatibility report: Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:21:5 | -LL | 1 / 0 - | ^^^^^ - | | - | attempt to divide `1_i32` by zero - | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5 - | inside `X` at $DIR/promoted_errors.rs:46:29 +LL | 1 / 0 + | ^^^^^ + | | + | attempt to divide `1_i32` by zero + | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5 + | inside `X` at $DIR/promoted_errors.rs:46:29 ... -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 @@ -118,16 +101,11 @@ Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:46:28 | -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -LL | | let _x: &'static i32 = &div_by_zero1(); - | | ^^^^^^^^^^^^^^^ referenced constant has errors -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- +... +LL | let _x: &'static i32 = &div_by_zero1(); + | ^^^^^^^^^^^^^^^ referenced constant has errors | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr index be845339dfe6..cfca8ef07464 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr @@ -43,21 +43,15 @@ LL | [1, 2, 3][4] warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:15:5 | -LL | 0 - 1 - | ^^^^^ - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow - | inside `overflow` at $DIR/promoted_errors.rs:15:5 - | inside `X` at $DIR/promoted_errors.rs:43:29 +LL | 0 - 1 + | ^^^^^ + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | inside `overflow` at $DIR/promoted_errors.rs:15:5 + | inside `X` at $DIR/promoted_errors.rs:43:29 ... -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 @@ -70,15 +64,10 @@ LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:43:28 | -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); - | | ^^^^^^^^^^^ referenced constant has errors -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- +LL | let _x: &'static u32 = &overflow(); + | ^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -89,21 +78,15 @@ Future incompatibility report: Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:15:5 | -LL | 0 - 1 - | ^^^^^ - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow - | inside `overflow` at $DIR/promoted_errors.rs:15:5 - | inside `X` at $DIR/promoted_errors.rs:43:29 +LL | 0 - 1 + | ^^^^^ + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | inside `overflow` at $DIR/promoted_errors.rs:15:5 + | inside `X` at $DIR/promoted_errors.rs:43:29 ... -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 @@ -117,15 +100,10 @@ Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/promoted_errors.rs:43:28 | -LL | / const X: () = { -LL | | let _x: &'static u32 = &overflow(); - | | ^^^^^^^^^^^ referenced constant has errors -LL | | -LL | | -... | -LL | | let _x: &'static i32 = &oob(); -LL | | }; - | |__- +LL | const X: () = { + | ----------- +LL | let _x: &'static u32 = &overflow(); + | ^^^^^^^^^^^ referenced constant has errors | note: the lint level is defined here --> $DIR/promoted_errors.rs:11:9 diff --git a/src/test/ui/consts/const-eval/pub_const_err.stderr b/src/test/ui/consts/const-eval/pub_const_err.stderr index 56d66827626b..36197a7ab598 100644 --- a/src/test/ui/consts/const-eval/pub_const_err.stderr +++ b/src/test/ui/consts/const-eval/pub_const_err.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/pub_const_err.rs:6:20 | LL | pub const Z: u32 = 0 - 1; - | -------------------^^^^^- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/pub_const_err.rs:2:9 @@ -21,9 +19,7 @@ warning: any use of this value will cause an error --> $DIR/pub_const_err.rs:6:20 | LL | pub const Z: u32 = 0 - 1; - | -------------------^^^^^- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/pub_const_err.rs:2:9 diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr index 202ea781e975..2eef3b8f5c41 100644 --- a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr +++ b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/pub_const_err_bin.rs:4:20 | LL | pub const Z: u32 = 0 - 1; - | -------------------^^^^^- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/pub_const_err_bin.rs:2:9 @@ -21,9 +19,7 @@ warning: any use of this value will cause an error --> $DIR/pub_const_err_bin.rs:4:20 | LL | pub const Z: u32 = 0 - 1; - | -------------------^^^^^- - | | - | attempt to compute `0_u32 - 1_u32`, which would overflow + | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/pub_const_err_bin.rs:2:9 diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr index a55fd8c156e0..0e3743588100 100644 --- a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr +++ b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/ref_to_int_match.rs:25:27 | LL | const BAR: Int = unsafe { Foo { r: &42 }.f }; - | --------------------------^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -29,9 +27,7 @@ error: any use of this value will cause an error --> $DIR/ref_to_int_match.rs:25:27 | LL | const BAR: Int = unsafe { Foo { r: &42 }.f }; - | --------------------------^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr index a55fd8c156e0..0e3743588100 100644 --- a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr +++ b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/ref_to_int_match.rs:25:27 | LL | const BAR: Int = unsafe { Foo { r: &42 }.f }; - | --------------------------^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -29,9 +27,7 @@ error: any use of this value will cause an error --> $DIR/ref_to_int_match.rs:25:27 | LL | const BAR: Int = unsafe { Foo { r: &42 }.f }; - | --------------------------^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/transmute-const.32bit.stderr b/src/test/ui/consts/const-eval/transmute-const.32bit.stderr index ba4c3799158f..09fd79986958 100644 --- a/src/test/ui/consts/const-eval/transmute-const.32bit.stderr +++ b/src/test/ui/consts/const-eval/transmute-const.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/transmute-const.rs:4:1 | LL | static FOO: bool = unsafe { mem::transmute(3u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { diff --git a/src/test/ui/consts/const-eval/transmute-const.64bit.stderr b/src/test/ui/consts/const-eval/transmute-const.64bit.stderr index ba4c3799158f..09fd79986958 100644 --- a/src/test/ui/consts/const-eval/transmute-const.64bit.stderr +++ b/src/test/ui/consts/const-eval/transmute-const.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/transmute-const.rs:4:1 | LL | static FOO: bool = unsafe { mem::transmute(3u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { diff --git a/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr b/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr index 7c4ae1c56f61..8560112ae3b7 100644 --- a/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr +++ b/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr @@ -1,14 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum-overwrite.rs:8:1 | -LL | / const _: u8 = { -LL | | -LL | | let mut e = E::A(1); -LL | | let p = if let E::A(x) = &mut e { x as *mut u8 } else { unreachable!() }; -... | -LL | | unsafe { *p } -LL | | }; - | |__^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes +LL | const _: u8 = { + | ^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { diff --git a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr index c1cf22c8839b..2f8b44da0fc9 100644 --- a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:23:1 | LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x00000001, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x00000001, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -13,7 +13,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:26:1 | LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -23,7 +23,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:30:1 | LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -32,7 +32,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:43:1 | LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x00000000, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x00000000, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -43,7 +43,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:45:1 | LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -52,7 +52,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:49:1 | LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -61,7 +61,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:59:1 | LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -72,7 +72,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:63:1 | LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -81,7 +81,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:81:1 | LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of the never type `!` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of the never type `!` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -92,7 +92,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:83:1 | LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of uninhabited type Never + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of uninhabited type Never | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -103,7 +103,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:91:1 | LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) })); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -130,7 +130,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:26:1 | LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -141,7 +141,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:30:1 | LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -152,7 +152,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:45:1 | LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -163,7 +163,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:49:1 | LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -174,7 +174,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:63:1 | LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr index 5e749a6e735e..3a05a5150f1a 100644 --- a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:23:1 | LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x0000000000000001, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x0000000000000001, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -13,7 +13,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:26:1 | LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -23,7 +23,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:30:1 | LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -32,7 +32,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:43:1 | LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x0000000000000000, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x0000000000000000, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -43,7 +43,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:45:1 | LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -52,7 +52,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:49:1 | LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -61,7 +61,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:59:1 | LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -72,7 +72,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:63:1 | LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -81,7 +81,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:81:1 | LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of the never type `!` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of the never type `!` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -92,7 +92,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:83:1 | LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of uninhabited type Never + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a value of uninhabited type Never | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -103,7 +103,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-enum.rs:91:1 | LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) })); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -130,7 +130,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:26:1 | LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -141,7 +141,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:30:1 | LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -152,7 +152,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:45:1 | LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -163,7 +163,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:49:1 | LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -174,7 +174,7 @@ error: any use of this value will cause an error --> $DIR/ub-enum.rs:63:1 | LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr b/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr index 1da829ad1251..c6422447a4b7 100644 --- a/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr @@ -13,9 +13,8 @@ LL | unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) }; error[E0080]: it is undefined behavior to use this value --> $DIR/ub-incorrect-vtable.rs:34:1 | -LL | / const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> = -LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) }; - | |_____________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2 +LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -25,9 +24,8 @@ LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1us error[E0080]: it is undefined behavior to use this value --> $DIR/ub-incorrect-vtable.rs:39:1 | -LL | / const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> = -LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) }; - | |______________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object +LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr b/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr index 1139976f390f..e594ad71b5b4 100644 --- a/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr @@ -13,9 +13,8 @@ LL | unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) }; error[E0080]: it is undefined behavior to use this value --> $DIR/ub-incorrect-vtable.rs:34:1 | -LL | / const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> = -LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) }; - | |_____________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2 +LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -25,9 +24,8 @@ LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1us error[E0080]: it is undefined behavior to use this value --> $DIR/ub-incorrect-vtable.rs:39:1 | -LL | / const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> = -LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) }; - | |______________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object +LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr b/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr index 5964d494a14f..8eece9e30e4b 100644 --- a/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr @@ -1,14 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-int-array.rs:14:1 | -LL | / const UNINIT_INT_0: [u32; 3] = unsafe { -LL | | -LL | | -LL | | [ -... | -LL | | ] -LL | | }; - | |__^ constructing invalid value at [0]: encountered uninitialized bytes +LL | const UNINIT_INT_0: [u32; 3] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 12, align: 4) { @@ -18,14 +12,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/ub-int-array.rs:23:1 | -LL | / const UNINIT_INT_1: [u32; 3] = unsafe { -LL | | -LL | | -LL | | mem::transmute( -... | -LL | | ) -LL | | }; - | |__^ constructing invalid value at [1]: encountered uninitialized bytes +LL | const UNINIT_INT_1: [u32; 3] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 12, align: 4) { @@ -35,14 +23,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/ub-int-array.rs:43:1 | -LL | / const UNINIT_INT_2: [u32; 3] = unsafe { -LL | | -LL | | -LL | | mem::transmute( -... | -LL | | ) -LL | | }; - | |__^ constructing invalid value at [2]: encountered uninitialized bytes +LL | const UNINIT_INT_2: [u32; 3] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 12, align: 4) { diff --git a/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr b/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr index 5964d494a14f..8eece9e30e4b 100644 --- a/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr @@ -1,14 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-int-array.rs:14:1 | -LL | / const UNINIT_INT_0: [u32; 3] = unsafe { -LL | | -LL | | -LL | | [ -... | -LL | | ] -LL | | }; - | |__^ constructing invalid value at [0]: encountered uninitialized bytes +LL | const UNINIT_INT_0: [u32; 3] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 12, align: 4) { @@ -18,14 +12,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/ub-int-array.rs:23:1 | -LL | / const UNINIT_INT_1: [u32; 3] = unsafe { -LL | | -LL | | -LL | | mem::transmute( -... | -LL | | ) -LL | | }; - | |__^ constructing invalid value at [1]: encountered uninitialized bytes +LL | const UNINIT_INT_1: [u32; 3] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 12, align: 4) { @@ -35,14 +23,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/ub-int-array.rs:43:1 | -LL | / const UNINIT_INT_2: [u32; 3] = unsafe { -LL | | -LL | | -LL | | mem::transmute( -... | -LL | | ) -LL | | }; - | |__^ constructing invalid value at [2]: encountered uninitialized bytes +LL | const UNINIT_INT_2: [u32; 3] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 12, align: 4) { diff --git a/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr b/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr index 6c1a9d25f230..d450a814cfa7 100644 --- a/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:12:1 | LL | const NULL_PTR: NonNull = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -19,7 +19,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:23:1 | LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -30,7 +30,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:25:1 | LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -41,7 +41,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:33:1 | LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -52,7 +52,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:41:1 | LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -63,7 +63,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:47:1 | LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr b/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr index f38274737376..ed0d91aabd33 100644 --- a/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:12:1 | LL | const NULL_PTR: NonNull = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -19,7 +19,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:23:1 | LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -30,7 +30,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:25:1 | LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -41,7 +41,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:33:1 | LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -52,7 +52,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:41:1 | LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -63,7 +63,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:47:1 | LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr index c9e101cb6e46..b60e3337b444 100644 --- a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:13:1 | LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:17:1 | LL | const UNALIGNED_BOX: Box = unsafe { mem::transmute(&[0u8; 4]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -24,7 +24,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:21:1 | LL | const NULL: &u16 = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference + | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -35,7 +35,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:24:1 | LL | const NULL_BOX: Box = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -46,7 +46,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:31:1 | LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -56,9 +56,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:39 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | unable to turn pointer into raw bytes + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -67,9 +65,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:38 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -78,9 +74,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:86 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^---- - | | - | unable to turn pointer into raw bytes + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -89,9 +83,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:85 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^---- - | | - | referenced constant has errors + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -100,7 +92,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:47:1 | LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -111,7 +103,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:50:1 | LL | const USIZE_AS_BOX: Box = unsafe { mem::transmute(1337usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -122,7 +114,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:53:1 | LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -133,7 +125,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:56:1 | LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -144,7 +136,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:58:1 | LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value + | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -155,7 +147,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:60:1 | LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x0000000d, but expected a function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x0000000d, but expected a function pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -166,7 +158,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:62:1 | LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -181,7 +173,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:31:1 | LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -192,9 +184,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:39 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | unable to turn pointer into raw bytes + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -205,9 +195,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:38 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -218,9 +206,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:86 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^---- - | | - | unable to turn pointer into raw bytes + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -231,9 +217,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:85 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^---- - | | - | referenced constant has errors + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr index b3d9500333aa..505ef2dd7d78 100644 --- a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:13:1 | LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:17:1 | LL | const UNALIGNED_BOX: Box = unsafe { mem::transmute(&[0u8; 4]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -24,7 +24,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:21:1 | LL | const NULL: &u16 = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference + | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -35,7 +35,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:24:1 | LL | const NULL_BOX: Box = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -46,7 +46,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:31:1 | LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -56,9 +56,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:39 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | unable to turn pointer into raw bytes + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -67,9 +65,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:38 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -78,9 +74,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:86 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^---- - | | - | unable to turn pointer into raw bytes + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -89,9 +83,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:85 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^---- - | | - | referenced constant has errors + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -100,7 +92,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:47:1 | LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -111,7 +103,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:50:1 | LL | const USIZE_AS_BOX: Box = unsafe { mem::transmute(1337usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -122,7 +114,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:53:1 | LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -133,7 +125,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:56:1 | LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -144,7 +136,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:58:1 | LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value + | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -155,7 +147,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:60:1 | LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x000000000000000d, but expected a function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x000000000000000d, but expected a function pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -166,7 +158,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-ref-ptr.rs:62:1 | LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -181,7 +173,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:31:1 | LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -192,9 +184,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:39 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | unable to turn pointer into raw bytes + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -205,9 +195,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:35:38 | LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; - | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -218,9 +206,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:86 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^---- - | | - | unable to turn pointer into raw bytes + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -231,9 +217,7 @@ error: any use of this value will cause an error --> $DIR/ub-ref-ptr.rs:41:85 | LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; - | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^---- - | | - | referenced constant has errors + | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr b/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr index 38c71c20fa52..7f0feb130049 100644 --- a/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:15:1 | LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 0, align: 1) {} @@ -11,7 +11,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:18:1 | LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -22,7 +22,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:21:1 | LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 0, align: 1) {} diff --git a/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr b/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr index 7cfa888b1a15..4dcbbc2f5e41 100644 --- a/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:15:1 | LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 0, align: 1) {} @@ -11,7 +11,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:18:1 | LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -22,7 +22,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:21:1 | LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 0, align: 1) {} diff --git a/src/test/ui/consts/const-eval/ub-upvars.32bit.stderr b/src/test/ui/consts/const-eval/ub-upvars.32bit.stderr index d7de743afa91..43f73f6ec7f2 100644 --- a/src/test/ui/consts/const-eval/ub-upvars.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-upvars.32bit.stderr @@ -1,12 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-upvars.rs:6:1 | -LL | / const BAD_UPVAR: &dyn FnOnce() = &{ -LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) }; -LL | | let another_var = 13; -LL | | move || { let _ = bad_ref; let _ = another_var; } -LL | | }; - | |__^ constructing invalid value at ...: encountered a null reference +LL | const BAD_UPVAR: &dyn FnOnce() = &{ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...: encountered a null reference | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/consts/const-eval/ub-upvars.64bit.stderr b/src/test/ui/consts/const-eval/ub-upvars.64bit.stderr index 6df58f6eaae3..64185a063629 100644 --- a/src/test/ui/consts/const-eval/ub-upvars.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-upvars.64bit.stderr @@ -1,12 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-upvars.rs:6:1 | -LL | / const BAD_UPVAR: &dyn FnOnce() = &{ -LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) }; -LL | | let another_var = 13; -LL | | move || { let _ = bad_ref; let _ = another_var; } -LL | | }; - | |__^ constructing invalid value at ...: encountered a null reference +LL | const BAD_UPVAR: &dyn FnOnce() = &{ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...: encountered a null reference | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr index 25062a5a3968..74f21c7c34fc 100644 --- a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:37:1 | LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:39:1 | LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -24,7 +24,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:42:1 | LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -34,7 +34,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:46:1 | LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -43,7 +43,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:49:1 | LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -54,7 +54,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:53:1 | LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:: { uninit: () }]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized data in `str` + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized data in `str` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -65,7 +65,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:56:1 | LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:: { uninit: () }]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered uninitialized data in `str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered uninitialized data in `str` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -75,12 +75,8 @@ LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUni error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:63:1 | -LL | / const SLICE_LENGTH_UNINIT: &[u8] = unsafe { -LL | | -LL | | let uninit_len = MaybeUninit:: { uninit: () }; -LL | | mem::transmute((42, uninit_len)) -LL | | }; - | |__^ constructing invalid value: encountered uninitialized reference +LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -91,7 +87,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:69:1 | LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -102,7 +98,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:72:1 | LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -113,7 +109,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:75:1 | LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -122,7 +118,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:79:1 | LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -133,7 +129,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:82:1 | LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -142,7 +138,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:87:1 | LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -153,9 +149,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:87:40 | LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; - | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -164,7 +158,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:95:1 | LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -175,9 +169,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:95:42 | LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -186,7 +178,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:100:1 | LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..1[0]: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..1[0]: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -197,9 +189,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:100:42 | LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -207,12 +197,8 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:109:1 | -LL | / const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe { -LL | | -LL | | let uninit_len = MaybeUninit:: { uninit: () }; -LL | | mem::transmute((42, uninit_len)) -LL | | }; - | |__^ constructing invalid value: encountered uninitialized raw pointer +LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -223,7 +209,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:117:1 | LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -234,7 +220,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:120:1 | LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -245,7 +231,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:123:1 | LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -256,7 +242,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:125:1 | LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -267,7 +253,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:127:1 | LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -278,7 +264,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:129:1 | LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -289,7 +275,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:131:1 | LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -300,7 +286,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:135:1 | LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -311,7 +297,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:139:1 | LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -322,7 +308,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:141:1 | LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -349,7 +335,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:42:1 | LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -360,7 +346,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:46:1 | LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -371,7 +357,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:75:1 | LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -382,7 +368,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:82:1 | LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -393,9 +379,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:87:40 | LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; - | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -406,9 +390,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:95:42 | LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -419,9 +401,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:100:42 | LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr index e3a9214b1a59..1775b0dc2ed9 100644 --- a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:37:1 | LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:39:1 | LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -24,7 +24,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:42:1 | LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -34,7 +34,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:46:1 | LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -43,7 +43,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:49:1 | LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -54,7 +54,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:53:1 | LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:: { uninit: () }]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized data in `str` + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized data in `str` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -65,7 +65,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:56:1 | LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:: { uninit: () }]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered uninitialized data in `str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered uninitialized data in `str` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -75,12 +75,8 @@ LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUni error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:63:1 | -LL | / const SLICE_LENGTH_UNINIT: &[u8] = unsafe { -LL | | -LL | | let uninit_len = MaybeUninit:: { uninit: () }; -LL | | mem::transmute((42, uninit_len)) -LL | | }; - | |__^ constructing invalid value: encountered uninitialized reference +LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -91,7 +87,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:69:1 | LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -102,7 +98,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:72:1 | LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -113,7 +109,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:75:1 | LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -122,7 +118,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:79:1 | LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -133,7 +129,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:82:1 | LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -142,7 +138,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:87:1 | LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -153,9 +149,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:87:40 | LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; - | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -164,7 +158,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:95:1 | LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -175,9 +169,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:95:42 | LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -186,7 +178,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:100:1 | LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..1[0]: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..1[0]: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -197,9 +189,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:100:42 | LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -207,12 +197,8 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:109:1 | -LL | / const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe { -LL | | -LL | | let uninit_len = MaybeUninit:: { uninit: () }; -LL | | mem::transmute((42, uninit_len)) -LL | | }; - | |__^ constructing invalid value: encountered uninitialized raw pointer +LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -223,7 +209,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:117:1 | LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -234,7 +220,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:120:1 | LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -245,7 +231,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:123:1 | LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -256,7 +242,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:125:1 | LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -267,7 +253,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:127:1 | LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -278,7 +264,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:129:1 | LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -289,7 +275,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:131:1 | LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function) | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -300,7 +286,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:135:1 | LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..: encountered 0x03, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..: encountered 0x03, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -311,7 +297,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:139:1 | LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -322,7 +308,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-wide-ptr.rs:141:1 | LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -349,7 +335,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:42:1 | LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -360,7 +346,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:46:1 | LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -371,7 +357,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:75:1 | LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -382,7 +368,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:82:1 | LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -393,9 +379,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:87:40 | LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; - | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -406,9 +390,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:95:42 | LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -419,9 +401,7 @@ error: any use of this value will cause an error --> $DIR/ub-wide-ptr.rs:100:42 | LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); - | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | referenced constant has errors + | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/union-const-eval-field.stderr b/src/test/ui/consts/const-eval/union-const-eval-field.stderr index f962afadffb1..c512e6825042 100644 --- a/src/test/ui/consts/const-eval/union-const-eval-field.stderr +++ b/src/test/ui/consts/const-eval/union-const-eval-field.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/union-const-eval-field.rs:28:5 | LL | const FIELD3: Field3 = unsafe { UNION.field3 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/src/test/ui/consts/const-eval/union-ice.stderr b/src/test/ui/consts/const-eval/union-ice.stderr index 6f1fce3f980d..21a54550900b 100644 --- a/src/test/ui/consts/const-eval/union-ice.stderr +++ b/src/test/ui/consts/const-eval/union-ice.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/union-ice.rs:14:1 | LL | const FIELD3: Field3 = unsafe { UNION.field3 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -12,11 +12,8 @@ LL | const FIELD3: Field3 = unsafe { UNION.field3 }; error[E0080]: it is undefined behavior to use this value --> $DIR/union-ice.rs:16:1 | -LL | / const FIELD_PATH: Struct = Struct { -LL | | a: 42, -LL | | b: unsafe { UNION.field3 }, -LL | | }; - | |__^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes +LL | const FIELD_PATH: Struct = Struct { + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -26,14 +23,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/union-ice.rs:26:1 | -LL | / const FIELD_PATH2: Struct2 = Struct2 { -LL | | b: [ -LL | | 21, -LL | | unsafe { UNION.field3 }, -... | -LL | | a: 42, -LL | | }; - | |__^ constructing invalid value at .b[1]: encountered uninitialized bytes +LL | const FIELD_PATH2: Struct2 = Struct2 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b[1]: encountered uninitialized bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 40, align: 8) { diff --git a/src/test/ui/consts/const-eval/union-ub.32bit.stderr b/src/test/ui/consts/const-eval/union-ub.32bit.stderr index c1b84ef330eb..baf682596600 100644 --- a/src/test/ui/consts/const-eval/union-ub.32bit.stderr +++ b/src/test/ui/consts/const-eval/union-ub.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/union-ub.rs:33:1 | LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/union-ub.rs:35:1 | LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { diff --git a/src/test/ui/consts/const-eval/union-ub.64bit.stderr b/src/test/ui/consts/const-eval/union-ub.64bit.stderr index c1b84ef330eb..baf682596600 100644 --- a/src/test/ui/consts/const-eval/union-ub.64bit.stderr +++ b/src/test/ui/consts/const-eval/union-ub.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/union-ub.rs:33:1 | LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/union-ub.rs:35:1 | LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { diff --git a/src/test/ui/consts/const-eval/unused-broken-const.stderr b/src/test/ui/consts/const-eval/unused-broken-const.stderr index bfc076aa5e64..df5bd524f272 100644 --- a/src/test/ui/consts/const-eval/unused-broken-const.stderr +++ b/src/test/ui/consts/const-eval/unused-broken-const.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/unused-broken-const.rs:5:18 | LL | const FOO: i32 = [][0]; - | -----------------^^^^^- - | | - | index out of bounds: the length is 0 but the index is 0 + | -------------- ^^^^^ index out of bounds: the length is 0 but the index is 0 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ error: any use of this value will cause an error --> $DIR/unused-broken-const.rs:5:18 | LL | const FOO: i32 = [][0]; - | -----------------^^^^^- - | | - | index out of bounds: the length is 0 but the index is 0 + | -------------- ^^^^^ index out of bounds: the length is 0 but the index is 0 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr index 22afc9779e85..bdaeb4a0fbee 100644 --- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr +++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr @@ -26,7 +26,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_uninhabited_zsts.rs:23:1 | LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 0, align: 1) {} diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr index 22afc9779e85..bdaeb4a0fbee 100644 --- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr +++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr @@ -26,7 +26,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_uninhabited_zsts.rs:23:1 | LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 0, align: 1) {} diff --git a/src/test/ui/consts/const-float-bits-reject-conv.stderr b/src/test/ui/consts/const-float-bits-reject-conv.stderr index d822171df723..b77c6591d497 100644 --- a/src/test/ui/consts/const-float-bits-reject-conv.stderr +++ b/src/test/ui/consts/const-float-bits-reject-conv.stderr @@ -60,7 +60,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:30:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -73,7 +73,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:33:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -85,7 +85,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:41:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); | ^^^^^^^^^^^ referenced constant has errors @@ -97,7 +97,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:44:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); | ^^^^^^^^^^^ referenced constant has errors @@ -167,7 +167,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:57:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -179,7 +179,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:60:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -191,7 +191,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:66:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); | ^^^^^^^^^^^ referenced constant has errors @@ -203,7 +203,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:69:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); | ^^^^^^^^^^^ referenced constant has errors @@ -219,7 +219,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:30:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -233,7 +233,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:33:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -247,7 +247,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:41:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); | ^^^^^^^^^^^ referenced constant has errors @@ -261,7 +261,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:44:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); | ^^^^^^^^^^^ referenced constant has errors @@ -275,7 +275,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:57:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -289,7 +289,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:60:34 | LL | const _: () = assert!($a); - | -------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); | ^^^^^^^^^^^ referenced constant has errors @@ -303,7 +303,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:66:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); | ^^^^^^^^^^^ referenced constant has errors @@ -317,7 +317,7 @@ error: any use of this value will cause an error --> $DIR/const-float-bits-reject-conv.rs:69:38 | LL | const _: () = assert!($a == $b); - | -------------------------------- + | ----------- ... LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); | ^^^^^^^^^^^ referenced constant has errors diff --git a/src/test/ui/consts/const-len-underflow-separate-spans.stderr b/src/test/ui/consts/const-len-underflow-separate-spans.stderr index 0c10783476ab..d1bf4b92e6a5 100644 --- a/src/test/ui/consts/const-len-underflow-separate-spans.stderr +++ b/src/test/ui/consts/const-len-underflow-separate-spans.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-len-underflow-separate-spans.rs:7:20 | LL | const LEN: usize = ONE - TWO; - | -------------------^^^^^^^^^- - | | - | attempt to compute `1_usize - 2_usize`, which would overflow + | ---------------- ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -24,9 +22,7 @@ error: any use of this value will cause an error --> $DIR/const-len-underflow-separate-spans.rs:7:20 | LL | const LEN: usize = ONE - TWO; - | -------------------^^^^^^^^^- - | | - | attempt to compute `1_usize - 2_usize`, which would overflow + | ---------------- ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr b/src/test/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr index 9c1733e827d1..f2aec37a7292 100644 --- a/src/test/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr +++ b/src/test/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr @@ -14,7 +14,7 @@ error: encountered dangling pointer in final constant --> $DIR/mut_ref_in_final_dynamic_check.rs:25:1 | LL | const B: Option<&mut i32> = helper2(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-pattern-irrefutable.stderr b/src/test/ui/consts/const-pattern-irrefutable.stderr index 3e3bc1979a2e..a2b8f072c6ea 100644 --- a/src/test/ui/consts/const-pattern-irrefutable.stderr +++ b/src/test/ui/consts/const-pattern-irrefutable.stderr @@ -2,7 +2,7 @@ error[E0005]: refutable pattern in local binding: `0_u8..=1_u8` and `3_u8..=u8:: --> $DIR/const-pattern-irrefutable.rs:12:9 | LL | const a: u8 = 2; - | ---------------- constant defined here + | ----------- constant defined here ... LL | let a = 4; | ^ @@ -16,7 +16,7 @@ error[E0005]: refutable pattern in local binding: `0_u8..=1_u8` and `3_u8..=u8:: --> $DIR/const-pattern-irrefutable.rs:13:9 | LL | pub const b: u8 = 2; - | -------------------- constant defined here + | --------------- constant defined here ... LL | let c = 4; | ^ @@ -30,7 +30,7 @@ error[E0005]: refutable pattern in local binding: `0_u8..=1_u8` and `3_u8..=u8:: --> $DIR/const-pattern-irrefutable.rs:14:9 | LL | pub const d: u8 = 2; - | -------------------- constant defined here + | --------------- constant defined here ... LL | let d = 4; | ^ diff --git a/src/test/ui/consts/const-points-to-static.32bit.stderr b/src/test/ui/consts/const-points-to-static.32bit.stderr index db7d489ade7f..97825dd0eb51 100644 --- a/src/test/ui/consts/const-points-to-static.32bit.stderr +++ b/src/test/ui/consts/const-points-to-static.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const-points-to-static.rs:6:1 | LL | const TEST: &u8 = &MY_STATIC; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable + | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/src/test/ui/consts/const-points-to-static.64bit.stderr b/src/test/ui/consts/const-points-to-static.64bit.stderr index de5e02ae58f7..0d4a5a8ce4f3 100644 --- a/src/test/ui/consts/const-points-to-static.64bit.stderr +++ b/src/test/ui/consts/const-points-to-static.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const-points-to-static.rs:6:1 | LL | const TEST: &u8 = &MY_STATIC; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable + | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/src/test/ui/consts/const-prop-read-static-in-const.stderr b/src/test/ui/consts/const-prop-read-static-in-const.stderr index a60cd16f05a1..ea5ad24b0b13 100644 --- a/src/test/ui/consts/const-prop-read-static-in-const.stderr +++ b/src/test/ui/consts/const-prop-read-static-in-const.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-prop-read-static-in-const.rs:5:18 | LL | const TEST: u8 = MY_STATIC; - | -----------------^^^^^^^^^- - | | - | constant accesses static + | -------------- ^^^^^^^^^ constant accesses static | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -25,9 +23,7 @@ error: any use of this value will cause an error --> $DIR/const-prop-read-static-in-const.rs:5:18 | LL | const TEST: u8 = MY_STATIC; - | -----------------^^^^^^^^^- - | | - | constant accesses static + | -------------- ^^^^^^^^^ constant accesses static | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr index c6e0b321124b..d19a89378eca 100644 --- a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr +++ b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31 | LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; - | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | `extern type` does not have known layout + | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -14,9 +12,7 @@ error: any use of this value will cause an error --> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32 | LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; - | -------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | `extern type` does not have known layout + | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -28,9 +24,7 @@ error: any use of this value will cause an error --> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31 | LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; - | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | `extern type` does not have known layout + | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -41,9 +35,7 @@ error: any use of this value will cause an error --> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32 | LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; - | -------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | `extern type` does not have known layout + | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const-slice-oob.stderr b/src/test/ui/consts/const-slice-oob.stderr index c9f949727bc6..27c21e7af149 100644 --- a/src/test/ui/consts/const-slice-oob.stderr +++ b/src/test/ui/consts/const-slice-oob.stderr @@ -2,9 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-slice-oob.rs:4:18 | LL | const BAR: u32 = FOO[5]; - | -----------------^^^^^^- - | | - | index out of bounds: the length is 3 but the index is 5 + | -------------- ^^^^^^ index out of bounds: the length is 3 but the index is 5 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ error: any use of this value will cause an error --> $DIR/const-slice-oob.rs:4:18 | LL | const BAR: u32 = FOO[5]; - | -----------------^^^^^^- - | | - | index out of bounds: the length is 3 but the index is 5 + | -------------- ^^^^^^ index out of bounds: the length is 3 but the index is 5 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr index ee95b0d51805..e450f4aa3bd5 100644 --- a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr +++ b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr @@ -1,15 +1,11 @@ error: any use of this value will cause an error --> $DIR/const_eval_limit_reached.rs:6:11 | -LL | / const X: usize = { -LL | | let mut x = 0; -LL | | while x != 1000 { - | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) -LL | | -... | -LL | | x -LL | | }; - | |__- +LL | const X: usize = { + | -------------- +LL | let mut x = 0; +LL | while x != 1000 { + | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -21,15 +17,11 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $DIR/const_eval_limit_reached.rs:6:11 | -LL | / const X: usize = { -LL | | let mut x = 0; -LL | | while x != 1000 { - | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) -LL | | -... | -LL | | x -LL | | }; - | |__- +LL | const X: usize = { + | -------------- +LL | let mut x = 0; +LL | while x != 1000 { + | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/dangling-alloc-id-ice.stderr b/src/test/ui/consts/dangling-alloc-id-ice.stderr index 24f574498722..8410034c041d 100644 --- a/src/test/ui/consts/dangling-alloc-id-ice.stderr +++ b/src/test/ui/consts/dangling-alloc-id-ice.stderr @@ -1,12 +1,8 @@ error: encountered dangling pointer in final constant --> $DIR/dangling-alloc-id-ice.rs:9:1 | -LL | / const FOO: &() = { -LL | | -LL | | let y = (); -LL | | unsafe { Foo { y: &y }.long_live_the_unit } -LL | | }; - | |__^ +LL | const FOO: &() = { + | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/consts/dangling_raw_ptr.stderr b/src/test/ui/consts/dangling_raw_ptr.stderr index a79ac62d5cdb..bdfe1e4effe3 100644 --- a/src/test/ui/consts/dangling_raw_ptr.stderr +++ b/src/test/ui/consts/dangling_raw_ptr.stderr @@ -1,11 +1,8 @@ error: encountered dangling pointer in final constant --> $DIR/dangling_raw_ptr.rs:1:1 | -LL | / const FOO: *const u32 = { -LL | | let x = 42; -LL | | &x -LL | | }; - | |__^ +LL | const FOO: *const u32 = { + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/consts/issue-36163.stderr b/src/test/ui/consts/issue-36163.stderr index 9ac6c984cb0c..4797d10b7a80 100644 --- a/src/test/ui/consts/issue-36163.stderr +++ b/src/test/ui/consts/issue-36163.stderr @@ -8,7 +8,7 @@ note: ...which requires const-evaluating + checking `A`... --> $DIR/issue-36163.rs:1:1 | LL | const A: isize = Foo::B as isize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ = note: ...which again requires const-evaluating + checking `Foo::B::{constant#0}`, completing the cycle note: cycle used when simplifying constant for the type system `Foo::B::{constant#0}` --> $DIR/issue-36163.rs:4:9 diff --git a/src/test/ui/consts/issue-63952.32bit.stderr b/src/test/ui/consts/issue-63952.32bit.stderr index 0d7708375826..755c7fb7d4d9 100644 --- a/src/test/ui/consts/issue-63952.32bit.stderr +++ b/src/test/ui/consts/issue-63952.32bit.stderr @@ -1,14 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/issue-63952.rs:17:1 | -LL | / const SLICE_WAY_TOO_LONG: &[u8] = unsafe { -LL | | SliceTransmute { -LL | | repr: SliceRepr { -LL | | ptr: &42, -... | -LL | | .slice -LL | | }; - | |__^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object +LL | const SLICE_WAY_TOO_LONG: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/consts/issue-63952.64bit.stderr b/src/test/ui/consts/issue-63952.64bit.stderr index 9b0f45920d60..abdb9a4f7920 100644 --- a/src/test/ui/consts/issue-63952.64bit.stderr +++ b/src/test/ui/consts/issue-63952.64bit.stderr @@ -1,14 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/issue-63952.rs:17:1 | -LL | / const SLICE_WAY_TOO_LONG: &[u8] = unsafe { -LL | | SliceTransmute { -LL | | repr: SliceRepr { -LL | | ptr: &42, -... | -LL | | .slice -LL | | }; - | |__^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object +LL | const SLICE_WAY_TOO_LONG: &[u8] = unsafe { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/issue-79690.64bit.stderr b/src/test/ui/consts/issue-79690.64bit.stderr index 14c42d893c34..c7aba5553708 100644 --- a/src/test/ui/consts/issue-79690.64bit.stderr +++ b/src/test/ui/consts/issue-79690.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/issue-79690.rs:30:1 | LL | const G: Fat = unsafe { Transmute { t: FOO }.u }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .1..size.foo: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes + | ^^^^^^^^^^^^ constructing invalid value at .1..size.foo: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/issue-83182.32bit.stderr b/src/test/ui/consts/issue-83182.32bit.stderr index fdd56bce9581..c810c8a7848c 100644 --- a/src/test/ui/consts/issue-83182.32bit.stderr +++ b/src/test/ui/consts/issue-83182.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/issue-83182.rs:5:1 | LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a pointer in `str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a pointer in `str` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/consts/issue-83182.64bit.stderr b/src/test/ui/consts/issue-83182.64bit.stderr index 284c1da3b3ed..5fc2c934474d 100644 --- a/src/test/ui/consts/issue-83182.64bit.stderr +++ b/src/test/ui/consts/issue-83182.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/issue-83182.rs:5:1 | LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a pointer in `str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ..0: encountered a pointer in `str` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/issue-miri-1910.stderr b/src/test/ui/consts/issue-miri-1910.stderr index e76a1f96b46a..afcf11bd5f24 100644 --- a/src/test/ui/consts/issue-miri-1910.stderr +++ b/src/test/ui/consts/issue-miri-1910.stderr @@ -1,22 +1,18 @@ error: any use of this value will cause an error --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | unable to turn pointer into raw bytes - | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `C` at $DIR/issue-miri-1910.rs:7:5 +LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | unable to turn pointer into raw bytes + | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `C` at $DIR/issue-miri-1910.rs:7:5 | ::: $DIR/issue-miri-1910.rs:4:1 | -LL | / const C: () = unsafe { -LL | | let foo = Some(&42 as *const i32); -LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3; -LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); -LL | | }; - | |__- +LL | const C: () = unsafe { + | ----------- | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -28,22 +24,18 @@ Future incompatibility report: Future breakage diagnostic: error: any use of this value will cause an error --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | unable to turn pointer into raw bytes - | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `C` at $DIR/issue-miri-1910.rs:7:5 +LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | unable to turn pointer into raw bytes + | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `C` at $DIR/issue-miri-1910.rs:7:5 | ::: $DIR/issue-miri-1910.rs:4:1 | -LL | / const C: () = unsafe { -LL | | let foo = Some(&42 as *const i32); -LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3; -LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); -LL | | }; - | |__- +LL | const C: () = unsafe { + | ----------- | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/miri_unleashed/assoc_const.stderr b/src/test/ui/consts/miri_unleashed/assoc_const.stderr index 1765c9ed10a3..1f82ac827ad1 100644 --- a/src/test/ui/consts/miri_unleashed/assoc_const.stderr +++ b/src/test/ui/consts/miri_unleashed/assoc_const.stderr @@ -30,7 +30,7 @@ LL | pub unsafe fn drop_in_place(to_drop: *mut T) { ::: $DIR/assoc_const.rs:14:5 | LL | const F: u32 = (U::X, 42).1; - | ---------------------------- + | ------------ | note: the lint level is defined here --> $DIR/assoc_const.rs:4:10 diff --git a/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr b/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr index f7be42de03fd..cbf02199f5bf 100644 --- a/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr +++ b/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr @@ -12,9 +12,7 @@ warning: any use of this value will cause an error --> $DIR/assoc_const_2.rs:12:20 | LL | const F: u32 = 100 / U::X; - | ---------------^^^^^^^^^^- - | | - | attempt to divide `100_u32` by zero + | ------------ ^^^^^^^^^^ attempt to divide `100_u32` by zero | note: the lint level is defined here --> $DIR/assoc_const_2.rs:3:10 diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr index 98d4dff648a5..fa2088124b0b 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr @@ -51,12 +51,11 @@ Future incompatibility report: Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/const_refers_to_static.rs:13:5 | -LL | / const MUTATE_INTERIOR_MUT: usize = { -LL | | static FOO: AtomicUsize = AtomicUsize::new(0); -LL | | FOO.fetch_add(1, Ordering::Relaxed) - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add` -LL | | }; - | |__- +LL | const MUTATE_INTERIOR_MUT: usize = { + | -------------------------------- +LL | static FOO: AtomicUsize = AtomicUsize::new(0); +LL | FOO.fetch_add(1, Ordering::Relaxed) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add` | note: the lint level is defined here --> $DIR/const_refers_to_static.rs:3:10 @@ -70,12 +69,11 @@ Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/const_refers_to_static.rs:18:14 | -LL | / const READ_INTERIOR_MUT: usize = { -LL | | static FOO: AtomicUsize = AtomicUsize::new(0); -LL | | unsafe { *(&FOO as *const _ as *const usize) } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | }; - | |__- +LL | const READ_INTERIOR_MUT: usize = { + | ------------------------------ +LL | static FOO: AtomicUsize = AtomicUsize::new(0); +LL | unsafe { *(&FOO as *const _ as *const usize) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static.rs:3:10 @@ -90,9 +88,7 @@ warning: any use of this value will cause an error --> $DIR/const_refers_to_static.rs:22:32 | LL | const READ_MUT: u32 = unsafe { MUTABLE }; - | -------------------------------^^^^^^^--- - | | - | constant accesses static + | ------------------- ^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static.rs:3:10 diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr index 9eda2f60c8f2..b3ad81e49bc1 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr @@ -1,12 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static2.rs:11:1 | -LL | / const REF_INTERIOR_MUT: &usize = { -LL | | -LL | | static FOO: AtomicUsize = AtomicUsize::new(0); -LL | | unsafe { &*(&FOO as *const _ as *const usize) } -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const REF_INTERIOR_MUT: &usize = { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -16,12 +12,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static2.rs:18:1 | -LL | / const READ_IMMUT: &usize = { -LL | | -LL | | static FOO: usize = 0; -LL | | &FOO -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const READ_IMMUT: &usize = { + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr index 7aa826dbb764..24bd07092826 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr @@ -1,12 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static2.rs:11:1 | -LL | / const REF_INTERIOR_MUT: &usize = { -LL | | -LL | | static FOO: AtomicUsize = AtomicUsize::new(0); -LL | | unsafe { &*(&FOO as *const _ as *const usize) } -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const REF_INTERIOR_MUT: &usize = { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -16,12 +12,8 @@ LL | | }; error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static2.rs:18:1 | -LL | / const READ_IMMUT: &usize = { -LL | | -LL | | static FOO: usize = 0; -LL | | &FOO -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const READ_IMMUT: &usize = { + | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr index b5d8872e633a..20a96b57f29b 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr @@ -1,11 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static_cross_crate.rs:12:1 | -LL | / const SLICE_MUT: &[u8; 1] = { -LL | | -LL | | unsafe { &static_cross_crate::ZERO } -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const SLICE_MUT: &[u8; 1] = { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -21,11 +18,8 @@ LL | SLICE_MUT => true, error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static_cross_crate.rs:17:1 | -LL | / const U8_MUT: &u8 = { -LL | | -LL | | unsafe { &static_cross_crate::ZERO[0] } -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const U8_MUT: &u8 = { + | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -41,14 +35,10 @@ LL | U8_MUT => true, warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:25:15 | -LL | / const U8_MUT2: &u8 = { -LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT2: &u8 = { + | ------------------ +LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:23:8 @@ -67,14 +57,10 @@ LL | U8_MUT2 => true, warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:32:20 | -LL | / const U8_MUT3: &u8 = { -LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT3: &u8 = { + | ------------------ +LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:30:8 @@ -174,14 +160,10 @@ Future incompatibility report: Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:25:15 | -LL | / const U8_MUT2: &u8 = { -LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT2: &u8 = { + | ------------------ +LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:23:8 @@ -195,14 +177,10 @@ Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:32:20 | -LL | / const U8_MUT3: &u8 = { -LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT3: &u8 = { + | ------------------ +LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:30:8 diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr index ec3eeb912b21..dfa0f76baa18 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr @@ -1,11 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static_cross_crate.rs:12:1 | -LL | / const SLICE_MUT: &[u8; 1] = { -LL | | -LL | | unsafe { &static_cross_crate::ZERO } -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const SLICE_MUT: &[u8; 1] = { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -21,11 +18,8 @@ LL | SLICE_MUT => true, error[E0080]: it is undefined behavior to use this value --> $DIR/const_refers_to_static_cross_crate.rs:17:1 | -LL | / const U8_MUT: &u8 = { -LL | | -LL | | unsafe { &static_cross_crate::ZERO[0] } -LL | | }; - | |__^ constructing invalid value: encountered a reference pointing to a static variable +LL | const U8_MUT: &u8 = { + | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -41,14 +35,10 @@ LL | U8_MUT => true, warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:25:15 | -LL | / const U8_MUT2: &u8 = { -LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT2: &u8 = { + | ------------------ +LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:23:8 @@ -67,14 +57,10 @@ LL | U8_MUT2 => true, warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:32:20 | -LL | / const U8_MUT3: &u8 = { -LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT3: &u8 = { + | ------------------ +LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:30:8 @@ -174,14 +160,10 @@ Future incompatibility report: Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:25:15 | -LL | / const U8_MUT2: &u8 = { -LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT2: &u8 = { + | ------------------ +LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:23:8 @@ -195,14 +177,10 @@ Future breakage diagnostic: warning: any use of this value will cause an error --> $DIR/const_refers_to_static_cross_crate.rs:32:20 | -LL | / const U8_MUT3: &u8 = { -LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static -LL | | -LL | | -LL | | -LL | | }; - | |__- +LL | const U8_MUT3: &u8 = { + | ------------------ +LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static | note: the lint level is defined here --> $DIR/const_refers_to_static_cross_crate.rs:30:8 diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr b/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr index 70ce8db482a3..bb8636f1225a 100644 --- a/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr +++ b/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr @@ -1,10 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:17:1 | -LL | / const MUH: Meh = Meh { -LL | | x: &UnsafeCell::new(42), -LL | | }; - | |__^ constructing invalid value at .x.: encountered `UnsafeCell` in a `const` +LL | const MUH: Meh = Meh { + | ^^^^^^^^^^^^^^ constructing invalid value at .x.: encountered `UnsafeCell` in a `const` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -15,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:27:1 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...x: encountered `UnsafeCell` in a `const` + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...x: encountered `UnsafeCell` in a `const` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -26,7 +24,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:31:1 | LL | const BLUNT: &mut i32 = &mut 42; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr b/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr index 8ea00aace3da..f1652da922a5 100644 --- a/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr +++ b/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr @@ -1,10 +1,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:17:1 | -LL | / const MUH: Meh = Meh { -LL | | x: &UnsafeCell::new(42), -LL | | }; - | |__^ constructing invalid value at .x.: encountered `UnsafeCell` in a `const` +LL | const MUH: Meh = Meh { + | ^^^^^^^^^^^^^^ constructing invalid value at .x.: encountered `UnsafeCell` in a `const` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -15,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:27:1 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...x: encountered `UnsafeCell` in a `const` + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at ...x: encountered `UnsafeCell` in a `const` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -26,7 +24,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/mutable_references_err.rs:31:1 | LL | const BLUNT: &mut i32 = &mut 42; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` + | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr b/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr index b5b5a965295a..e145f6dd2ef5 100644 --- a/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr +++ b/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr @@ -2,7 +2,7 @@ error: untyped pointers are not allowed in constant --> $DIR/raw_mutable_const.rs:7:1 | LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: skipping const checks | diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr index 594576fe2cf3..69936ee6c13e 100644 --- a/src/test/ui/consts/ptr_comparisons.stderr +++ b/src/test/ui/consts/ptr_comparisons.stderr @@ -22,9 +22,7 @@ error: any use of this value will cause an error --> $DIR/ptr_comparisons.rs:65:27 | LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 }; - | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -34,9 +32,7 @@ error: any use of this value will cause an error --> $DIR/ptr_comparisons.rs:70:27 | LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 }; - | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 @@ -49,9 +45,7 @@ error: any use of this value will cause an error --> $DIR/ptr_comparisons.rs:65:27 | LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 }; - | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -62,9 +56,7 @@ error: any use of this value will cause an error --> $DIR/ptr_comparisons.rs:70:27 | LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 }; - | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------- - | | - | unable to turn pointer into raw bytes + | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/raw-ptr-const.stderr b/src/test/ui/consts/raw-ptr-const.stderr index 974b1c3ff45b..0ebe1e95ca3e 100644 --- a/src/test/ui/consts/raw-ptr-const.stderr +++ b/src/test/ui/consts/raw-ptr-const.stderr @@ -2,7 +2,7 @@ error: untyped pointers are not allowed in constant --> $DIR/raw-ptr-const.rs:7:1 | LL | const CONST_RAW: *const Vec = &Vec::new() as *const _; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/consts/recursive-zst-static.default.stderr b/src/test/ui/consts/recursive-zst-static.default.stderr index 104899f49001..d68960b09721 100644 --- a/src/test/ui/consts/recursive-zst-static.default.stderr +++ b/src/test/ui/consts/recursive-zst-static.default.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO` --> $DIR/recursive-zst-static.rs:10:1 | LL | static FOO: () = FOO; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `FOO`... --> $DIR/recursive-zst-static.rs:10:18 diff --git a/src/test/ui/consts/recursive-zst-static.unleash.stderr b/src/test/ui/consts/recursive-zst-static.unleash.stderr index 104899f49001..d68960b09721 100644 --- a/src/test/ui/consts/recursive-zst-static.unleash.stderr +++ b/src/test/ui/consts/recursive-zst-static.unleash.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO` --> $DIR/recursive-zst-static.rs:10:1 | LL | static FOO: () = FOO; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `FOO`... --> $DIR/recursive-zst-static.rs:10:18 diff --git a/src/test/ui/consts/recursive.stderr b/src/test/ui/consts/recursive.stderr index 8d1e10d4176f..647ed1db20bd 100644 --- a/src/test/ui/consts/recursive.stderr +++ b/src/test/ui/consts/recursive.stderr @@ -21,7 +21,7 @@ LL | f(x); | inside `X` at $DIR/recursive.rs:9:15 ... LL | const X: () = f(1); - | ------------------- + | ----------- | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -42,7 +42,7 @@ LL | f(x); | inside `X` at $DIR/recursive.rs:9:15 ... LL | const X: () = f(1); - | ------------------- + | ----------- | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/std/alloc.32bit.stderr b/src/test/ui/consts/std/alloc.32bit.stderr index 33e574b17087..79efcd3f62ee 100644 --- a/src/test/ui/consts/std/alloc.32bit.stderr +++ b/src/test/ui/consts/std/alloc.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/alloc.rs:9:1 | LL | const LAYOUT_INVALID_ZERO: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x00000000, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x00000000, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/alloc.rs:13:1 | LL | const LAYOUT_INVALID_THREE: Layout = unsafe { Layout::from_size_align_unchecked(9, 3) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x00000003, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x00000003, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/consts/std/alloc.64bit.stderr b/src/test/ui/consts/std/alloc.64bit.stderr index 9556e30334d2..cb477b72b312 100644 --- a/src/test/ui/consts/std/alloc.64bit.stderr +++ b/src/test/ui/consts/std/alloc.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/alloc.rs:9:1 | LL | const LAYOUT_INVALID_ZERO: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x0000000000000000, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x0000000000000000, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/alloc.rs:13:1 | LL | const LAYOUT_INVALID_THREE: Layout = unsafe { Layout::from_size_align_unchecked(9, 3) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x0000000000000003, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.: encountered 0x0000000000000003, but expected a valid enum tag | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/std/cell.stderr b/src/test/ui/consts/std/cell.stderr index 355c326f0b6f..937fa7db0c8c 100644 --- a/src/test/ui/consts/std/cell.stderr +++ b/src/test/ui/consts/std/cell.stderr @@ -2,25 +2,25 @@ error: encountered dangling pointer in final constant --> $DIR/cell.rs:6:1 | LL | static FOO: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered dangling pointer in final constant --> $DIR/cell.rs:8:1 | LL | const FOO_CONST: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered dangling pointer in final constant --> $DIR/cell.rs:22:1 | LL | const FOO4_CONST: Wrap<*mut u32> = Wrap(FOO3_CONST.0.as_ptr()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: encountered dangling pointer in final constant --> $DIR/cell.rs:27:1 | LL | const FOO2: *mut u32 = Cell::new(42).as_ptr(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/consts/uninhabited-const-issue-61744.stderr b/src/test/ui/consts/uninhabited-const-issue-61744.stderr index 17dd6131436c..d3177784789f 100644 --- a/src/test/ui/consts/uninhabited-const-issue-61744.stderr +++ b/src/test/ui/consts/uninhabited-const-issue-61744.stderr @@ -135,7 +135,7 @@ LL | hint_unreachable() | inside `::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36 ... LL | const CONSTANT: i32 = unsafe { fake_type() }; - | --------------------------------------------- + | ------------------- | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -288,7 +288,7 @@ LL | hint_unreachable() | inside `::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36 ... LL | const CONSTANT: i32 = unsafe { fake_type() }; - | --------------------------------------------- + | ------------------- | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/consts/validate_never_arrays.32bit.stderr b/src/test/ui/consts/validate_never_arrays.32bit.stderr index fe36d9d2a28b..a5dbc718145c 100644 --- a/src/test/ui/consts/validate_never_arrays.32bit.stderr +++ b/src/test/ui/consts/validate_never_arrays.32bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:4:1 | LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1] + | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1] | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:7:1 | LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` + | ^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { @@ -24,7 +24,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:8:1 | LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` + | ^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 4) { diff --git a/src/test/ui/consts/validate_never_arrays.64bit.stderr b/src/test/ui/consts/validate_never_arrays.64bit.stderr index 9c545ac15464..dac4e200a89d 100644 --- a/src/test/ui/consts/validate_never_arrays.64bit.stderr +++ b/src/test/ui/consts/validate_never_arrays.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:4:1 | LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1] + | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1] | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { @@ -13,7 +13,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:7:1 | LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` + | ^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { @@ -24,7 +24,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:8:1 | LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` + | ^^^^^^^^^^^^^ constructing invalid value at .[0]: encountered a value of the never type `!` | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 16, align: 8) { diff --git a/src/test/ui/consts/write-to-static-mut-in-static.stderr b/src/test/ui/consts/write-to-static-mut-in-static.stderr index 8d5113cbfd9f..395b2d42f97a 100644 --- a/src/test/ui/consts/write-to-static-mut-in-static.stderr +++ b/src/test/ui/consts/write-to-static-mut-in-static.stderr @@ -8,7 +8,7 @@ error[E0391]: cycle detected when const-evaluating + checking `C` --> $DIR/write-to-static-mut-in-static.rs:5:1 | LL | pub static mut C: u32 = unsafe { C = 1; 0 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `C`... --> $DIR/write-to-static-mut-in-static.rs:5:34 diff --git a/src/test/ui/derives/derive-assoc-type-not-impl.stderr b/src/test/ui/derives/derive-assoc-type-not-impl.stderr index 592cc0ae90f7..55847aeec559 100644 --- a/src/test/ui/derives/derive-assoc-type-not-impl.stderr +++ b/src/test/ui/derives/derive-assoc-type-not-impl.stderr @@ -8,7 +8,7 @@ LL | struct Bar { | doesn't satisfy `Bar: Clone` ... LL | struct NotClone; - | ---------------- doesn't satisfy `NotClone: Clone` + | --------------- doesn't satisfy `NotClone: Clone` ... LL | Bar:: { x: 1 }.clone(); | ^^^^^ method cannot be called on `Bar` due to unsatisfied trait bounds diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr index 19d2425ff23f..f655600b7600 100644 --- a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr @@ -11,7 +11,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | @@ -31,7 +31,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.stderr b/src/test/ui/derives/derives-span-PartialEq-enum.stderr index 419832817ca1..ce4b00bfbf57 100644 --- a/src/test/ui/derives/derives-span-PartialEq-enum.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-enum.stderr @@ -11,7 +11,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-enum.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | @@ -31,7 +31,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-enum.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-struct.stderr index 0000f882542a..c5c8f255fb3d 100644 --- a/src/test/ui/derives/derives-span-PartialEq-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-struct.stderr @@ -11,7 +11,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-struct.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | @@ -31,7 +31,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-struct.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr index 07fa900a8c82..f5d609cb33fe 100644 --- a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr @@ -11,7 +11,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-tuple-struct.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | @@ -31,7 +31,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Error` --> $DIR/derives-span-PartialEq-tuple-struct.rs:4:1 | LL | struct Error; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(PartialEq)]` | diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index bfb673f86f41..f3ff95a85da1 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -7,7 +7,7 @@ LL | #[derive(Eqr)] ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub macro Eq($item:item) { - | ------------------------ similarly named derive macro `Eq` defined here + | ------------ similarly named derive macro `Eq` defined here error: cannot find derive macro `Eqr` in this scope --> $DIR/deriving-meta-unknown-trait.rs:1:10 @@ -18,7 +18,7 @@ LL | #[derive(Eqr)] ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub macro Eq($item:item) { - | ------------------------ similarly named derive macro `Eq` defined here + | ------------ similarly named derive macro `Eq` defined here error: aborting due to 2 previous errors diff --git a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr index 451058cd0ee0..7875f0723566 100644 --- a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr +++ b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr @@ -11,7 +11,7 @@ note: an implementation of `PartialEq<_>` might be missing for `NoCloneOrEq` --> $DIR/deriving-no-inner-impl-error-message.rs:1:1 | LL | struct NoCloneOrEq; - | ^^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]` | @@ -31,7 +31,7 @@ note: an implementation of `PartialEq<_>` might be missing for `NoCloneOrEq` --> $DIR/deriving-no-inner-impl-error-message.rs:1:1 | LL | struct NoCloneOrEq; - | ^^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]` | diff --git a/src/test/ui/derives/issue-91492.stderr b/src/test/ui/derives/issue-91492.stderr index e479b539fec2..5b4feaeb52a3 100644 --- a/src/test/ui/derives/issue-91492.stderr +++ b/src/test/ui/derives/issue-91492.stderr @@ -2,7 +2,7 @@ error[E0599]: the method `extend_from_slice` exists for mutable reference `&mut --> $DIR/issue-91492.rs:4:9 | LL | pub struct NoDerives; - | --------------------- doesn't satisfy `NoDerives: Clone` + | -------------------- doesn't satisfy `NoDerives: Clone` LL | fn fun1(foo: &mut Vec, bar: &[NoDerives]) { LL | foo.extend_from_slice(bar); | ^^^^^^^^^^^^^^^^^ @@ -18,7 +18,7 @@ error[E0599]: the method `extend_from_slice` exists for mutable reference `&mut --> $DIR/issue-91492.rs:12:9 | LL | pub struct SomeDerives; - | ----------------------- doesn't satisfy `SomeDerives: Clone` + | ---------------------- doesn't satisfy `SomeDerives: Clone` LL | fn fun2(foo: &mut Vec, bar: &[SomeDerives]) { LL | foo.extend_from_slice(bar); | ^^^^^^^^^^^^^^^^^ @@ -34,7 +34,7 @@ error[E0599]: the method `use_clone` exists for struct `Object $DIR/issue-91492.rs:22:9 | LL | pub struct NoDerives; - | --------------------- doesn't satisfy `NoDerives: Clone` + | -------------------- doesn't satisfy `NoDerives: Clone` ... LL | struct Object(T, A); | ------ method `use_clone` not found for this struct diff --git a/src/test/ui/derives/issue-91550.stderr b/src/test/ui/derives/issue-91550.stderr index b1bec5432e3e..3608052e2ffc 100644 --- a/src/test/ui/derives/issue-91550.stderr +++ b/src/test/ui/derives/issue-91550.stderr @@ -2,7 +2,7 @@ error[E0599]: the method `insert` exists for struct `HashSet`, but its tr --> $DIR/issue-91550.rs:8:8 | LL | struct Value(u32); - | ------------------ + | ------------ | | | doesn't satisfy `Value: Eq` | doesn't satisfy `Value: Hash` @@ -22,7 +22,7 @@ error[E0599]: the method `use_eq` exists for struct `Object`, but its --> $DIR/issue-91550.rs:26:9 | LL | pub struct NoDerives; - | --------------------- doesn't satisfy `NoDerives: Eq` + | -------------------- doesn't satisfy `NoDerives: Eq` LL | LL | struct Object(T); | ------ method `use_eq` not found for this struct @@ -41,7 +41,7 @@ error[E0599]: the method `use_ord` exists for struct `Object`, but it --> $DIR/issue-91550.rs:27:9 | LL | pub struct NoDerives; - | --------------------- doesn't satisfy `NoDerives: Ord` + | -------------------- doesn't satisfy `NoDerives: Ord` LL | LL | struct Object(T); | ------ method `use_ord` not found for this struct @@ -60,7 +60,7 @@ error[E0599]: the method `use_ord_and_partial_ord` exists for struct `Object $DIR/issue-91550.rs:28:9 | LL | pub struct NoDerives; - | --------------------- + | -------------------- | | | doesn't satisfy `NoDerives: Ord` | doesn't satisfy `NoDerives: PartialOrd` diff --git a/src/test/ui/destructuring-assignment/note-unsupported.stderr b/src/test/ui/destructuring-assignment/note-unsupported.stderr index 3e2282743bfc..e45344aa51fc 100644 --- a/src/test/ui/destructuring-assignment/note-unsupported.stderr +++ b/src/test/ui/destructuring-assignment/note-unsupported.stderr @@ -52,14 +52,8 @@ LL | struct S { x: u8, y: u8 } note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait AddAssign { -LL | | /// Performs the `+=` operation. -LL | | /// -LL | | /// # Example -... | -LL | | fn add_assign(&mut self, rhs: Rhs); -LL | | } - | |_^ +LL | pub trait AddAssign { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0067]: invalid left-hand side of assignment --> $DIR/note-unsupported.rs:17:22 diff --git a/src/test/ui/did_you_mean/compatible-variants-in-pat.stderr b/src/test/ui/did_you_mean/compatible-variants-in-pat.stderr index a4c77e08efe1..473468af6eef 100644 --- a/src/test/ui/did_you_mean/compatible-variants-in-pat.stderr +++ b/src/test/ui/did_you_mean/compatible-variants-in-pat.stderr @@ -15,7 +15,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants-in-pat.rs:21:9 | LL | struct S; - | --------- unit struct defined here + | -------- unit struct defined here ... LL | match s { | - this expression has type `Option` @@ -40,7 +40,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants-in-pat.rs:32:9 | LL | struct S; - | --------- unit struct defined here + | -------- unit struct defined here ... LL | match s { | - this expression has type `Result` diff --git a/src/test/ui/dropck/issue-38868.stderr b/src/test/ui/dropck/issue-38868.stderr index f267abc0bfa7..ec81c2ea646f 100644 --- a/src/test/ui/dropck/issue-38868.stderr +++ b/src/test/ui/dropck/issue-38868.stderr @@ -1,21 +1,15 @@ error[E0366]: `Drop` impls cannot be specialized --> $DIR/issue-38868.rs:5:1 | -LL | / impl Drop for List { -LL | | fn drop(&mut self) { -LL | | panic!() -LL | | } -LL | | } - | |_^ +LL | impl Drop for List { + | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: `i32` is not a generic parameter note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/issue-38868.rs:1:1 | -LL | / pub struct List { -LL | | head: T, -LL | | } - | |_^ +LL | pub struct List { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/dropck/reject-specialized-drops-8142.stderr b/src/test/ui/dropck/reject-specialized-drops-8142.stderr index 7f50cf5ab15d..ebd484b88000 100644 --- a/src/test/ui/dropck/reject-specialized-drops-8142.stderr +++ b/src/test/ui/dropck/reject-specialized-drops-8142.stderr @@ -8,7 +8,7 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:4:1 | LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not --> $DIR/reject-specialized-drops-8142.rs:28:67 @@ -20,33 +20,33 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:5:1 | LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ error[E0366]: `Drop` impls cannot be specialized --> $DIR/reject-specialized-drops-8142.rs:34:1 | LL | impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `'static` is not a generic parameter note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/reject-specialized-drops-8142.rs:7:1 | LL | struct N<'n> { x: &'n i8 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0366]: `Drop` impls cannot be specialized --> $DIR/reject-specialized-drops-8142.rs:39:1 | LL | impl Drop for P { fn drop(&mut self) { } } // REJECT - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `i8` is not a generic parameter note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/reject-specialized-drops-8142.rs:9:1 | LL | struct P { x: *const Tp } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not --> $DIR/reject-specialized-drops-8142.rs:42:14 @@ -58,7 +58,7 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:10:1 | LL | struct Q { x: *const Tq } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not --> $DIR/reject-specialized-drops-8142.rs:45:21 @@ -70,59 +70,59 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:11:1 | LL | struct R { x: *const Tr } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0366]: `Drop` impls cannot be specialized --> $DIR/reject-specialized-drops-8142.rs:54:1 | LL | impl Drop for V { fn drop(&mut self) { } } // REJECT - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `One` is mentioned multiple times note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/reject-specialized-drops-8142.rs:15:1 | LL | struct V { x: *const Tva, y: *const Tvb } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error[E0366]: `Drop` impls cannot be specialized --> $DIR/reject-specialized-drops-8142.rs:57:1 | LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `'lw` is mentioned multiple times note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/reject-specialized-drops-8142.rs:16:1 | LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error[E0366]: `Drop` impls cannot be specialized --> $DIR/reject-specialized-drops-8142.rs:60:1 | LL | impl Drop for X<3> { fn drop(&mut self) { } } // REJECT - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `3_usize` is not a generic parameter note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/reject-specialized-drops-8142.rs:17:1 | LL | struct X; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0366]: `Drop` impls cannot be specialized --> $DIR/reject-specialized-drops-8142.rs:63:1 | LL | impl Drop for Y { fn drop(&mut self) { } } // REJECT - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `Ca` is mentioned multiple times note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/reject-specialized-drops-8142.rs:18:1 | LL | struct Y; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the enum it is implemented for does not --> $DIR/reject-specialized-drops-8142.rs:66:14 @@ -134,7 +134,7 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:20:1 | LL | enum Enum { Variant(T) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not --> $DIR/reject-specialized-drops-8142.rs:69:14 @@ -146,7 +146,7 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:21:1 | LL | struct TupleStruct(T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not --> $DIR/reject-specialized-drops-8142.rs:72:21 @@ -158,7 +158,7 @@ note: the implementor must specify the same requirement --> $DIR/reject-specialized-drops-8142.rs:22:1 | LL | union Union { f: T } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to 13 previous errors diff --git a/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr b/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr index 5176684e1534..3d9685db683f 100644 --- a/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr +++ b/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr @@ -7,10 +7,8 @@ LL | T: 'static, note: the implementor must specify the same requirement --> $DIR/relate_lt_in_type_outlives_bound.rs:1:1 | -LL | / struct Wrapper<'a, T>(&'a T) -LL | | where -LL | | T: 'a; - | |__________^ +LL | struct Wrapper<'a, T>(&'a T) + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/duplicate/dupe-symbols-6.stderr b/src/test/ui/duplicate/dupe-symbols-6.stderr index 8d5b7fb35bf0..6692a63dce8f 100644 --- a/src/test/ui/duplicate/dupe-symbols-6.stderr +++ b/src/test/ui/duplicate/dupe-symbols-6.stderr @@ -2,7 +2,7 @@ error: symbol `fail` is already defined --> $DIR/dupe-symbols-6.rs:10:1 | LL | static HELLO_TWICE: u16 = 0; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr index 48e5ea8ec866..5fc0a916a09c 100644 --- a/src/test/ui/empty/empty-struct-braces-expr.stderr +++ b/src/test/ui/empty/empty-struct-braces-expr.stderr @@ -10,7 +10,7 @@ LL | let e1 = Empty1; ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; - | ------------------- similarly named unit struct `XEmpty2` defined here + | ------------------ similarly named unit struct `XEmpty2` defined here | help: use struct literal syntax instead | @@ -33,7 +33,7 @@ LL | let e1 = Empty1(); ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; - | ------------------- similarly named unit struct `XEmpty2` defined here + | ------------------ similarly named unit struct `XEmpty2` defined here | help: use struct literal syntax instead | @@ -73,7 +73,7 @@ LL | let xe1 = XEmpty1; LL | pub struct XEmpty1 {} | ------------------ `XEmpty1` defined here LL | pub struct XEmpty2; - | ------------------- similarly named unit struct `XEmpty2` defined here + | ------------------ similarly named unit struct `XEmpty2` defined here | help: use struct literal syntax instead | @@ -95,7 +95,7 @@ LL | let xe1 = XEmpty1(); LL | pub struct XEmpty1 {} | ------------------ `XEmpty1` defined here LL | pub struct XEmpty2; - | ------------------- similarly named unit struct `XEmpty2` defined here + | ------------------ similarly named unit struct `XEmpty2` defined here | help: use struct literal syntax instead | diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr index 28191615afda..7fb5cb2034a8 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-2.stderr @@ -10,7 +10,7 @@ LL | Empty1() => () ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use struct pattern syntax instead | @@ -33,7 +33,7 @@ LL | pub struct XEmpty1 {} | ------------------ `XEmpty1` defined here LL | pub struct XEmpty2; LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use struct pattern syntax instead | @@ -56,7 +56,7 @@ LL | Empty1(..) => () ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use struct pattern syntax instead | @@ -79,7 +79,7 @@ LL | pub struct XEmpty1 {} | ------------------ `XEmpty1` defined here LL | pub struct XEmpty2; LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use struct pattern syntax instead | diff --git a/src/test/ui/empty/empty-struct-unit-expr.stderr b/src/test/ui/empty/empty-struct-unit-expr.stderr index c15253ba9cd7..cd51274dce81 100644 --- a/src/test/ui/empty/empty-struct-unit-expr.stderr +++ b/src/test/ui/empty/empty-struct-unit-expr.stderr @@ -2,7 +2,7 @@ error[E0618]: expected function, found `Empty2` --> $DIR/empty-struct-unit-expr.rs:15:14 | LL | struct Empty2; - | -------------- `Empty2` defined here + | ------------- `Empty2` defined here ... LL | let e2 = Empty2(); | ^^^^^^-- diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr index b1b253385fd3..acd1070d5d6f 100644 --- a/src/test/ui/empty/empty-struct-unit-pat.stderr +++ b/src/test/ui/empty/empty-struct-unit-pat.stderr @@ -10,7 +10,7 @@ LL | Empty2() => () ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use this syntax instead | @@ -30,9 +30,9 @@ LL | XEmpty2() => () ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; - | ------------------- `XEmpty2` defined here + | ------------------ `XEmpty2` defined here LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use this syntax instead | @@ -55,7 +55,7 @@ LL | Empty2(..) => () ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use this syntax instead | @@ -75,9 +75,9 @@ LL | XEmpty2(..) => () ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; - | ------------------- `XEmpty2` defined here + | ------------------ `XEmpty2` defined here LL | pub struct XEmpty6(); - | --------------------- similarly named tuple struct `XEmpty6` defined here + | ------------------ similarly named tuple struct `XEmpty6` defined here | help: use this syntax instead | diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr index d4519af54085..6f5bb4309c35 100644 --- a/src/test/ui/error-codes/E0004-2.stderr +++ b/src/test/ui/error-codes/E0004-2.stderr @@ -7,17 +7,14 @@ LL | match x { } note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | None, - | | ^^^^ not covered -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | None, + | ^^^^ not covered +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index 55b1112b5f8e..f01a77bd374b 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -9,16 +9,11 @@ LL | let Some(y) = x; note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | None, - | | ^^^^ not covered -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | None, + | ^^^^ not covered = note: the matched value is of type `Option` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/error-codes/E0017.stderr b/src/test/ui/error-codes/E0017.stderr index 7d959b6d148e..830e4db345ac 100644 --- a/src/test/ui/error-codes/E0017.stderr +++ b/src/test/ui/error-codes/E0017.stderr @@ -11,7 +11,7 @@ note: `const` item defined here --> $DIR/E0017.rs:2:1 | LL | const C: i32 = 2; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0764]: mutable references are not allowed in the final value of constants --> $DIR/E0017.rs:5:30 @@ -52,7 +52,7 @@ note: `const` item defined here --> $DIR/E0017.rs:2:1 | LL | const C: i32 = 2; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0764]: mutable references are not allowed in the final value of statics --> $DIR/E0017.rs:11:38 diff --git a/src/test/ui/error-codes/E0075.stderr b/src/test/ui/error-codes/E0075.stderr index d8b90d0691da..3f927726a030 100644 --- a/src/test/ui/error-codes/E0075.stderr +++ b/src/test/ui/error-codes/E0075.stderr @@ -2,7 +2,7 @@ error[E0075]: SIMD vector cannot be empty --> $DIR/E0075.rs:4:1 | LL | struct Bad; - | ^^^^^^^^^^^ + | ^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0076.stderr b/src/test/ui/error-codes/E0076.stderr index 2c2842d152b5..7d4ff8798168 100644 --- a/src/test/ui/error-codes/E0076.stderr +++ b/src/test/ui/error-codes/E0076.stderr @@ -2,7 +2,7 @@ error[E0076]: SIMD vector should be homogeneous --> $DIR/E0076.rs:4:1 | LL | struct Bad(u16, u32, u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type + | ^^^^^^^^^^ SIMD elements must have the same type error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0077.stderr b/src/test/ui/error-codes/E0077.stderr index 1938a9a272a1..9a84b2ec4069 100644 --- a/src/test/ui/error-codes/E0077.stderr +++ b/src/test/ui/error-codes/E0077.stderr @@ -2,7 +2,7 @@ error[E0077]: SIMD vector element type should be a primitive scalar (integer/flo --> $DIR/E0077.rs:4:1 | LL | struct Bad(String); - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0152.stderr b/src/test/ui/error-codes/E0152.stderr index 5cdfe1cc5562..29f7e4ad683d 100644 --- a/src/test/ui/error-codes/E0152.stderr +++ b/src/test/ui/error-codes/E0152.stderr @@ -2,7 +2,7 @@ error[E0152]: found duplicate lang item `owned_box` --> $DIR/E0152.rs:5:1 | LL | struct Foo(T); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: the lang item is first defined in crate `alloc` (which `std` depends on) = note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rlib diff --git a/src/test/ui/error-codes/E0191.stderr b/src/test/ui/error-codes/E0191.stderr index d69a14916e19..cf80c9c46ca2 100644 --- a/src/test/ui/error-codes/E0191.stderr +++ b/src/test/ui/error-codes/E0191.stderr @@ -2,7 +2,7 @@ error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must b --> $DIR/E0191.rs:5:16 | LL | type Bar; - | --------- `Bar` defined here + | -------- `Bar` defined here ... LL | type Foo = dyn Trait; | ^^^^^ help: specify the associated type: `Trait` diff --git a/src/test/ui/error-codes/E0201.stderr b/src/test/ui/error-codes/E0201.stderr index af029603fa17..94e06894144c 100644 --- a/src/test/ui/error-codes/E0201.stderr +++ b/src/test/ui/error-codes/E0201.stderr @@ -18,10 +18,10 @@ error[E0201]: duplicate definitions with name `Quux`: --> $DIR/E0201.rs:18:5 | LL | type Quux = u32; - | ---------------- previous definition of `Quux` here + | --------- previous definition of `Quux` here ... LL | type Quux = u32; - | ^^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^ duplicate definition error: aborting due to 3 previous errors diff --git a/src/test/ui/error-codes/E0220.stderr b/src/test/ui/error-codes/E0220.stderr index 4fa83d8bf6e8..11763ce788da 100644 --- a/src/test/ui/error-codes/E0220.stderr +++ b/src/test/ui/error-codes/E0220.stderr @@ -8,7 +8,7 @@ error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must b --> $DIR/E0220.rs:5:16 | LL | type Bar; - | --------- `Bar` defined here + | -------- `Bar` defined here ... LL | type Foo = dyn Trait; | ^^^^^^^^^^^^ help: specify the associated type: `Trait` diff --git a/src/test/ui/error-codes/E0221.stderr b/src/test/ui/error-codes/E0221.stderr index f3dbf122de3b..5414d77ad7c5 100644 --- a/src/test/ui/error-codes/E0221.stderr +++ b/src/test/ui/error-codes/E0221.stderr @@ -2,10 +2,10 @@ error[E0221]: ambiguous associated type `A` in bounds of `Self` --> $DIR/E0221.rs:11:16 | LL | type A: T1; - | ----------- ambiguous `A` from `Foo` + | ---------- ambiguous `A` from `Foo` ... LL | type A: T2; - | ----------- ambiguous `A` from `Bar` + | ---------- ambiguous `A` from `Bar` LL | fn do_something() { LL | let _: Self::A; | ^^^^^^^ ambiguous associated type `A` @@ -23,7 +23,7 @@ error[E0221]: ambiguous associated type `Err` in bounds of `Self` --> $DIR/E0221.rs:21:16 | LL | type Err: T3; - | ------------- ambiguous `Err` from `My` + | ------------ ambiguous `Err` from `My` LL | fn test() { LL | let _: Self::Err; | ^^^^^^^^^ ambiguous associated type `Err` diff --git a/src/test/ui/error-codes/E0264.stderr b/src/test/ui/error-codes/E0264.stderr index 403c0aa4146c..e8e35a12cbb4 100644 --- a/src/test/ui/error-codes/E0264.stderr +++ b/src/test/ui/error-codes/E0264.stderr @@ -2,7 +2,7 @@ error[E0264]: unknown external lang item: `cake` --> $DIR/E0264.rs:5:5 | LL | fn cake(); - | ^^^^^^^^^^ + | ^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr index 95d95003c616..693b079238d7 100644 --- a/src/test/ui/error-codes/E0297.stderr +++ b/src/test/ui/error-codes/E0297.stderr @@ -7,16 +7,11 @@ LL | for Some(x) in xs {} note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | None, - | | ^^^^ not covered -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | None, + | ^^^^ not covered = note: the matched value is of type `Option` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0374.stderr b/src/test/ui/error-codes/E0374.stderr index 7ab0f82fc236..68e15e6f8fe8 100644 --- a/src/test/ui/error-codes/E0374.stderr +++ b/src/test/ui/error-codes/E0374.stderr @@ -1,9 +1,8 @@ error[E0374]: the trait `CoerceUnsized` may only be implemented for a coercion between structures with one field being coerced, none found --> $DIR/E0374.rs:8:1 | -LL | / impl CoerceUnsized> for Foo -LL | | where T: CoerceUnsized {} - | |________________________________^ +LL | impl CoerceUnsized> for Foo + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0376.stderr b/src/test/ui/error-codes/E0376.stderr index 015448c39eaa..e91efb045c15 100644 --- a/src/test/ui/error-codes/E0376.stderr +++ b/src/test/ui/error-codes/E0376.stderr @@ -2,7 +2,7 @@ error[E0376]: the trait `CoerceUnsized` may only be implemented for a coercion b --> $DIR/E0376.rs:8:1 | LL | impl CoerceUnsized for Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0388.stderr b/src/test/ui/error-codes/E0388.stderr index 4886a156d2ea..106efc19ac9c 100644 --- a/src/test/ui/error-codes/E0388.stderr +++ b/src/test/ui/error-codes/E0388.stderr @@ -11,7 +11,7 @@ note: `const` item defined here --> $DIR/E0388.rs:2:1 | LL | const C: i32 = 2; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0764]: mutable references are not allowed in the final value of constants --> $DIR/E0388.rs:4:30 @@ -52,7 +52,7 @@ note: `const` item defined here --> $DIR/E0388.rs:2:1 | LL | const C: i32 = 2; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0764]: mutable references are not allowed in the final value of statics --> $DIR/E0388.rs:10:38 diff --git a/src/test/ui/error-codes/E0393.stderr b/src/test/ui/error-codes/E0393.stderr index 8aadf5c8b471..d9f70b729301 100644 --- a/src/test/ui/error-codes/E0393.stderr +++ b/src/test/ui/error-codes/E0393.stderr @@ -2,7 +2,7 @@ error[E0393]: the type parameter `T` must be explicitly specified --> $DIR/E0393.rs:3:47 | LL | trait A {} - | ------------------ type parameter `T` must be specified for this + | --------------- type parameter `T` must be specified for this LL | LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {} | ^ help: set the type parameter to the desired type: `A` diff --git a/src/test/ui/error-codes/E0445.stderr b/src/test/ui/error-codes/E0445.stderr index 1a66e0a2f975..23b7a3350476 100644 --- a/src/test/ui/error-codes/E0445.stderr +++ b/src/test/ui/error-codes/E0445.stderr @@ -5,7 +5,7 @@ LL | trait Foo { | --------- `Foo` declared as private ... LL | pub trait Bar : Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `Foo` in public interface --> $DIR/E0445.rs:7:1 @@ -14,7 +14,7 @@ LL | trait Foo { | --------- `Foo` declared as private ... LL | pub struct Bar2(pub T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `Foo` in public interface --> $DIR/E0445.rs:9:1 diff --git a/src/test/ui/error-codes/E0446.stderr b/src/test/ui/error-codes/E0446.stderr index 35e79e448d5a..b6a195c40a93 100644 --- a/src/test/ui/error-codes/E0446.stderr +++ b/src/test/ui/error-codes/E0446.stderr @@ -2,7 +2,7 @@ error[E0446]: private type `Bar` in public interface --> $DIR/E0446.rs:4:5 | LL | struct Bar(u32); - | ---------------- `Bar` declared as private + | ---------- `Bar` declared as private LL | LL | pub fn bar() -> Bar { | ^^^^^^^^^^^^^^^^^^^ can't leak private type diff --git a/src/test/ui/error-codes/E0520.stderr b/src/test/ui/error-codes/E0520.stderr index be7b95465a5f..65ebfcdbe32c 100644 --- a/src/test/ui/error-codes/E0520.stderr +++ b/src/test/ui/error-codes/E0520.stderr @@ -11,13 +11,11 @@ LL | #![feature(specialization)] error[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/E0520.rs:17:5 | -LL | / impl SpaceLlama for T { -LL | | fn fly(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl SpaceLlama for T { + | ------------------------------- parent `impl` is here ... -LL | default fn fly(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly` +LL | default fn fly(&self) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly` | = note: to specialize, `fly` in the parent `impl` must be marked `default` diff --git a/src/test/ui/error-festival.stderr b/src/test/ui/error-festival.stderr index 81aa268cacc5..43122c13efba 100644 --- a/src/test/ui/error-festival.stderr +++ b/src/test/ui/error-festival.stderr @@ -44,14 +44,8 @@ LL | enum Question { note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait Not { -LL | | /// The resulting type after applying the `!` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn not(self) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Not { + | ^^^^^^^^^^^^^ error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/error-festival.rs:25:5 diff --git a/src/test/ui/extern/extern-main-issue-86110.stderr b/src/test/ui/extern/extern-main-issue-86110.stderr index cd3de227dcff..18dfddc46bd3 100644 --- a/src/test/ui/extern/extern-main-issue-86110.stderr +++ b/src/test/ui/extern/extern-main-issue-86110.stderr @@ -2,7 +2,7 @@ error: the `main` function cannot be declared in an `extern` block --> $DIR/extern-main-issue-86110.rs:4:5 | LL | fn main(); - | ^^^^^^^^^^ + | ^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/extern/extern-types-distinct-types.stderr b/src/test/ui/extern/extern-types-distinct-types.stderr index f69629232aed..ca25aa64eb8b 100644 --- a/src/test/ui/extern/extern-types-distinct-types.stderr +++ b/src/test/ui/extern/extern-types-distinct-types.stderr @@ -2,9 +2,9 @@ error[E0308]: mismatched types --> $DIR/extern-types-distinct-types.rs:9:5 | LL | type A; - | ------- the found foreign type + | ------ the found foreign type LL | type B; - | ------- the expected foreign type + | ------ the expected foreign type ... LL | fn foo(r: &A) -> &B { | -- expected `&B` because of return type diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index 21180f31bbd2..f8349391a0fe 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -9,15 +9,11 @@ LL | let Ok(_x) = foo(); note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[lang = "Ok"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | | ^^^ not covered -LL | | } - | |_- +LL | pub enum Result { + | --------------------- +... +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | ^^^ not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr index 68594bba4863..c7ebb9880f71 100644 --- a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr +++ b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr @@ -14,10 +14,10 @@ error[E0276]: impl has stricter requirements than trait --> $DIR/generic-associated-types-where.rs:22:5 | LL | type Assoc3; - | --------------- definition of `Assoc3` from trait + | -------------- definition of `Assoc3` from trait ... LL | type Assoc3 = Vec where T: Iterator; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator` + | ^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator` error: aborting due to 2 previous errors diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr index 3d90471e398e..6aa52b179a3c 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.stderr +++ b/src/test/ui/generic-associated-types/impl_bounds.stderr @@ -2,25 +2,25 @@ error: `impl` associated type signature for `A` doesn't match `trait` associated --> $DIR/impl_bounds.rs:15:5 | LL | type A<'a> where Self: 'a; - | -------------------------- expected + | ---------- expected ... LL | type A<'a> = (&'a ()) where Self: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found + | ^^^^^^^^^^ found error: `impl` associated type signature for `B` doesn't match `trait` associated type signature --> $DIR/impl_bounds.rs:17:5 | LL | type B<'a, 'b> where 'a: 'b; - | ---------------------------- expected + | -------------- expected ... LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found + | ^^^^^^^^^^^^^^ found error[E0478]: lifetime bound not satisfied --> $DIR/impl_bounds.rs:17:22 | LL | type B<'a, 'b> where 'a: 'b; - | ---------------------------- definition of `B` from trait + | -------------- definition of `B` from trait ... LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; | ^^^^^^^^^^^^^^^ - help: try copying this clause from the trait: `, 'a: 'b` @@ -40,7 +40,7 @@ error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/impl_bounds.rs:20:5 | LL | type C = String where Self: Copy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T` + | ^^^^^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Copy` for `Fooy` --> $DIR/impl_bounds.rs:11:10 @@ -54,7 +54,7 @@ LL | trait Foo { | --- in this trait ... LL | type C where Self: Clone; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ this trait associated type doesn't have the requirement `Fooy: Copy` + | ^^^^^^ this trait associated type doesn't have the requirement `Fooy: Copy` = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | diff --git a/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr b/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr index 39beac38c0b6..c560e2405d5a 100644 --- a/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr +++ b/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr @@ -2,10 +2,10 @@ error[E0276]: impl has stricter requirements than trait --> $DIR/issue-47206-where-clause.rs:12:5 | LL | type Assoc3; - | --------------- definition of `Assoc3` from trait + | -------------- definition of `Assoc3` from trait ... LL | type Assoc3 = Vec where T: Iterator; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator` + | ^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator` error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr index c4a7d8faa411..d487f19ba749 100644 --- a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr +++ b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr @@ -45,7 +45,7 @@ note: ...does not necessarily outlive the static lifetime introduced by the comp --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:1 | LL | impl C for Box {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: incompatible lifetime on type --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:18 diff --git a/src/test/ui/generic-associated-types/issue-90014.stderr b/src/test/ui/generic-associated-types/issue-90014.stderr index 51fe3360c7eb..457c582e8c8d 100644 --- a/src/test/ui/generic-associated-types/issue-90014.stderr +++ b/src/test/ui/generic-associated-types/issue-90014.stderr @@ -2,7 +2,7 @@ error[E0477]: the type `&mut ()` does not fulfill the required lifetime --> $DIR/issue-90014.rs:14:20 | LL | type Fut<'a> where Self: 'a; - | ---------------------------- definition of `Fut` from trait + | ------------ definition of `Fut` from trait ... LL | type Fut<'a> = impl Future; | ^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a` diff --git a/src/test/ui/generic-associated-types/issue-91883.stderr b/src/test/ui/generic-associated-types/issue-91883.stderr index ed700876e02d..baf4889cc1dd 100644 --- a/src/test/ui/generic-associated-types/issue-91883.stderr +++ b/src/test/ui/generic-associated-types/issue-91883.stderr @@ -1,14 +1,11 @@ error[E0478]: lifetime bound not satisfied --> $DIR/issue-91883.rs:32:24 | -LL | / type Cursor<'tx>: Cursor<'tx> -LL | | where -LL | | 'db: 'tx, -LL | | Self: 'tx; - | |__________________- definition of `Cursor` from trait +LL | type Cursor<'tx>: Cursor<'tx> + | ----------------------------- definition of `Cursor` from trait ... -LL | type Cursor<'tx> = CursorImpl<'tx>; - | ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx` +LL | type Cursor<'tx> = CursorImpl<'tx>; + | ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx` | note: lifetime parameter instantiated with the lifetime `'db` as defined here --> $DIR/issue-91883.rs:31:6 diff --git a/src/test/ui/generic-associated-types/issue-92033.stderr b/src/test/ui/generic-associated-types/issue-92033.stderr index 5b90199b8091..6dd901027d7b 100644 --- a/src/test/ui/generic-associated-types/issue-92033.stderr +++ b/src/test/ui/generic-associated-types/issue-92033.stderr @@ -1,13 +1,11 @@ error[E0477]: the type `&'s Texture` does not fulfill the required lifetime --> $DIR/issue-92033.rs:22:28 | -LL | / type TextureIter<'a>: Iterator -LL | | where -LL | | Self: 'a; - | |_________________- definition of `TextureIter` from trait +LL | type TextureIter<'a>: Iterator + | -------------------------------------------------- definition of `TextureIter` from trait ... -LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a` +LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a` | note: type must outlive the lifetime `'a` as defined here --> $DIR/issue-92033.rs:22:22 diff --git a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr index 1322914797b1..2804364890f0 100644 --- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr +++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr @@ -2,7 +2,7 @@ error[E0599]: the method `f` exists for struct `S`, but its trait bounds were no --> $DIR/method-unsatified-assoc-type-predicate.rs:30:7 | LL | struct S; - | --------- + | -------- | | | | | method `f` not found for this struct | doesn't satisfy `::Y = i32` diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr index 9e0896127a8a..0256d2f20fc1 100644 --- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr +++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr @@ -2,10 +2,10 @@ error: `impl` associated type signature for `Assoc` doesn't match `trait` associ --> $DIR/missing-where-clause-on-trait.rs:9:5 | LL | type Assoc<'a, 'b>; - | ------------------- expected + | ------------------ expected ... LL | type Assoc<'a, 'b> = () where 'a: 'b; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found + | ^^^^^^^^^^^^^^^^^^ found error: aborting due to previous error diff --git a/src/test/ui/impl-trait/issues/issue-62742.stderr b/src/test/ui/impl-trait/issues/issue-62742.stderr index 44d775b695ee..2d14faf76775 100644 --- a/src/test/ui/impl-trait/issues/issue-62742.stderr +++ b/src/test/ui/impl-trait/issues/issue-62742.stderr @@ -18,7 +18,7 @@ LL | WrongImpl::<()>::foo(0i32); | ^^^ function or associated item cannot be called on `SafeImpl<(), RawImpl<()>>` due to unsatisfied trait bounds ... LL | pub struct RawImpl(PhantomData); - | -------------------------------------- doesn't satisfy `RawImpl<()>: Raw<()>` + | --------------------- doesn't satisfy `RawImpl<()>: Raw<()>` ... LL | pub struct SafeImpl>(PhantomData<(A, T)>); | -------- function or associated item `foo` not found for this struct @@ -28,10 +28,8 @@ LL | pub struct SafeImpl>(PhantomData<(A, T)>); note: the following trait must be implemented --> $DIR/issue-62742.rs:12:1 | -LL | / pub trait Raw { -LL | | type Value; -LL | | } - | |_^ +LL | pub trait Raw { + | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `RawImpl<()>: Raw<()>` is not satisfied --> $DIR/issue-62742.rs:6:5 diff --git a/src/test/ui/infinite/infinite-struct.stderr b/src/test/ui/infinite/infinite-struct.stderr index 383e13fd4b09..214be091ccec 100644 --- a/src/test/ui/infinite/infinite-struct.stderr +++ b/src/test/ui/infinite/infinite-struct.stderr @@ -2,9 +2,8 @@ error[E0072]: recursive type `Take` has infinite size --> $DIR/infinite-struct.rs:1:1 | LL | struct Take(Take); - | ^^^^^^^^^^^^----^^ - | | | - | | recursive without indirection + | ^^^^^^^^^^^ ---- recursive without indirection + | | | recursive type has infinite size | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Take` representable @@ -16,7 +15,7 @@ error[E0391]: cycle detected when computing drop-check constraints for `Take` --> $DIR/infinite-struct.rs:1:1 | LL | struct Take(Take); - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = note: ...which immediately requires computing drop-check constraints for `Take` again = note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Take } }` diff --git a/src/test/ui/infinite/infinite-trait-alias-recursion.stderr b/src/test/ui/infinite/infinite-trait-alias-recursion.stderr index 5ecaedb3cb2c..b925b3b018c0 100644 --- a/src/test/ui/infinite/infinite-trait-alias-recursion.stderr +++ b/src/test/ui/infinite/infinite-trait-alias-recursion.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when computing the super predicates of `T1` --> $DIR/infinite-trait-alias-recursion.rs:3:1 | LL | trait T1 = T2; - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ | note: ...which requires computing the super traits of `T1`... --> $DIR/infinite-trait-alias-recursion.rs:3:12 @@ -13,7 +13,7 @@ note: ...which requires computing the super predicates of `T2`... --> $DIR/infinite-trait-alias-recursion.rs:6:1 | LL | trait T2 = T3; - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ note: ...which requires computing the super traits of `T2`... --> $DIR/infinite-trait-alias-recursion.rs:6:12 | @@ -23,7 +23,7 @@ note: ...which requires computing the super predicates of `T3`... --> $DIR/infinite-trait-alias-recursion.rs:8:1 | LL | trait T3 = T1 + T3; - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ note: ...which requires computing the super traits of `T3`... --> $DIR/infinite-trait-alias-recursion.rs:8:12 | diff --git a/src/test/ui/invalid_dispatch_from_dyn_impls.stderr b/src/test/ui/invalid_dispatch_from_dyn_impls.stderr index 6d62d4fd0711..b5b32d2f0bd3 100644 --- a/src/test/ui/invalid_dispatch_from_dyn_impls.stderr +++ b/src/test/ui/invalid_dispatch_from_dyn_impls.stderr @@ -1,22 +1,16 @@ error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else --> $DIR/invalid_dispatch_from_dyn_impls.rs:10:1 | -LL | / impl DispatchFromDyn> for WrapperWithExtraField -LL | | where -LL | | T: DispatchFromDyn, -LL | | {} - | |__^ +LL | impl DispatchFromDyn> for WrapperWithExtraField + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: extra field `1` of type `i32` is not allowed error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions --> $DIR/invalid_dispatch_from_dyn_impls.rs:21:1 | -LL | / impl DispatchFromDyn> for MultiplePointers -LL | | where -LL | | T: Unsize, -LL | | {} - | |__^ +LL | impl DispatchFromDyn> for MultiplePointers + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced = note: currently, 2 fields need coercions: `ptr1` (`*const T` to `*const U`), `ptr2` (`*const T` to `*const U`) @@ -25,25 +19,19 @@ error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion --> $DIR/invalid_dispatch_from_dyn_impls.rs:31:1 | LL | impl DispatchFromDyn> for NothingToCoerce {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0378]: structs implementing `DispatchFromDyn` may not have `#[repr(packed)]` or `#[repr(C)]` --> $DIR/invalid_dispatch_from_dyn_impls.rs:37:1 | -LL | / impl DispatchFromDyn> for HasReprC -LL | | where -LL | | T: Unsize, -LL | | {} - | |__^ +LL | impl DispatchFromDyn> for HasReprC + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else --> $DIR/invalid_dispatch_from_dyn_impls.rs:46:1 | -LL | / impl DispatchFromDyn> for OverAligned -LL | | where -LL | | T: Unsize, -LL | | {} - | |__^ +LL | impl DispatchFromDyn> for OverAligned + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: extra field `1` of type `OverAlignedZst` is not allowed diff --git a/src/test/ui/issues/issue-14091-2.stderr b/src/test/ui/issues/issue-14091-2.stderr index fbfa6e1abb2d..a191afd7980c 100644 --- a/src/test/ui/issues/issue-14091-2.stderr +++ b/src/test/ui/issues/issue-14091-2.stderr @@ -8,18 +8,12 @@ note: an implementation of `Not` might be missing for `BytePos` --> $DIR/issue-14091-2.rs:6:1 | LL | pub struct BytePos(pub u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ must implement `Not` + | ^^^^^^^^^^^^^^^^^^ must implement `Not` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait Not { -LL | | /// The resulting type after applying the `!` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn not(self) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Not { + | ^^^^^^^^^^^^^ = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16250.stderr b/src/test/ui/issues/issue-16250.stderr index 45f854f93ecb..ae3b7f334c65 100644 --- a/src/test/ui/issues/issue-16250.stderr +++ b/src/test/ui/issues/issue-16250.stderr @@ -16,7 +16,7 @@ note: the type is defined here --> $DIR/issue-16250.rs:3:1 | LL | pub struct Foo; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16725.stderr b/src/test/ui/issues/issue-16725.stderr index 84359803bbae..5f6eae73e585 100644 --- a/src/test/ui/issues/issue-16725.stderr +++ b/src/test/ui/issues/issue-16725.stderr @@ -8,7 +8,7 @@ note: the function `bar` is defined here --> $DIR/auxiliary/issue-16725.rs:2:5 | LL | fn bar(); - | ^^^^^^^^^ + | ^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17252.stderr b/src/test/ui/issues/issue-17252.stderr index 4856418ed600..3a629e1ebf47 100644 --- a/src/test/ui/issues/issue-17252.stderr +++ b/src/test/ui/issues/issue-17252.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO` --> $DIR/issue-17252.rs:1:1 | LL | const FOO: usize = FOO; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | = note: ...which immediately requires const-evaluating + checking `FOO` again note: cycle used when const-evaluating + checking `main::{constant#0}` diff --git a/src/test/ui/issues/issue-17718-const-privacy.stderr b/src/test/ui/issues/issue-17718-const-privacy.stderr index d4595be74903..133a6360bf9a 100644 --- a/src/test/ui/issues/issue-17718-const-privacy.stderr +++ b/src/test/ui/issues/issue-17718-const-privacy.stderr @@ -20,7 +20,7 @@ note: the constant `BAR` is defined here --> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1 | LL | const BAR: usize = 3; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-17959.stderr b/src/test/ui/issues/issue-17959.stderr index f00356f602e9..fb795febf795 100644 --- a/src/test/ui/issues/issue-17959.stderr +++ b/src/test/ui/issues/issue-17959.stderr @@ -7,10 +7,8 @@ LL | impl Drop for G { note: the implementor must specify the same requirement --> $DIR/issue-17959.rs:7:1 | -LL | / struct G { -LL | | _ptr: *const T -LL | | } - | |_^ +LL | struct G { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-18389.stderr b/src/test/ui/issues/issue-18389.stderr index dc476f5edc70..6ce78c45d6e5 100644 --- a/src/test/ui/issues/issue-18389.stderr +++ b/src/test/ui/issues/issue-18389.stderr @@ -8,9 +8,7 @@ LL | / pub trait Public: Private< LL | | LL | | ::P, LL | | ::R -... | -LL | | fn call_inner(&self); -LL | | } +LL | | > { | |_^ can't leak private trait error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19482.stderr b/src/test/ui/issues/issue-19482.stderr index 42a5a0159690..d51cc1f081e2 100644 --- a/src/test/ui/issues/issue-19482.stderr +++ b/src/test/ui/issues/issue-19482.stderr @@ -2,7 +2,7 @@ error[E0191]: the value of the associated type `A` (from trait `Foo`) must be sp --> $DIR/issue-19482.rs:10:16 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here ... LL | fn bar(x: &dyn Foo) {} | ^^^ help: specify the associated type: `Foo` diff --git a/src/test/ui/issues/issue-20714.stderr b/src/test/ui/issues/issue-20714.stderr index 456aff05750d..2d88ce5e5110 100644 --- a/src/test/ui/issues/issue-20714.stderr +++ b/src/test/ui/issues/issue-20714.stderr @@ -2,7 +2,7 @@ error[E0618]: expected function, found `G` --> $DIR/issue-20714.rs:4:13 | LL | struct G; - | --------- `G` defined here + | -------- `G` defined here ... LL | let g = G(); | ^-- diff --git a/src/test/ui/issues/issue-20772.stderr b/src/test/ui/issues/issue-20772.stderr index c964dc41dcea..22b9f5bd4cb9 100644 --- a/src/test/ui/issues/issue-20772.stderr +++ b/src/test/ui/issues/issue-20772.stderr @@ -1,19 +1,15 @@ error[E0391]: cycle detected when computing the super traits of `T` with associated type name `Item` --> $DIR/issue-20772.rs:1:1 | -LL | / trait T : Iterator -LL | | -LL | | {} - | |__^ +LL | trait T : Iterator + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ...which immediately requires computing the super traits of `T` with associated type name `Item` again note: cycle used when computing the super traits of `T` --> $DIR/issue-20772.rs:1:1 | -LL | / trait T : Iterator -LL | | -LL | | {} - | |__^ +LL | trait T : Iterator + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-21701.stderr b/src/test/ui/issues/issue-21701.stderr index 0405ce551b0a..ada6f44319de 100644 --- a/src/test/ui/issues/issue-21701.stderr +++ b/src/test/ui/issues/issue-21701.stderr @@ -12,7 +12,7 @@ error[E0618]: expected function, found `Bar` --> $DIR/issue-21701.rs:9:13 | LL | struct Bar; - | ----------- `Bar` defined here + | ---------- `Bar` defined here ... LL | let f = Bar(); | ^^^-- diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr index 93c2444f884d..4909398bb848 100644 --- a/src/test/ui/issues/issue-21950.stderr +++ b/src/test/ui/issues/issue-21950.stderr @@ -1,13 +1,11 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-21950.rs:10:25 | -LL | / trait Add { -LL | | type Output; -LL | | } - | |_- type parameter `Rhs` must be specified for this +LL | trait Add { + | ------------------- type parameter `Rhs` must be specified for this ... -LL | let x = &10 as &dyn Add; - | ^^^ help: set the type parameter to the desired type: `Add` +LL | let x = &10 as &dyn Add; + | ^^^ help: set the type parameter to the desired type: `Add` | = note: because of the default `Self` reference, type parameters must be specified on object types @@ -15,7 +13,7 @@ error[E0191]: the value of the associated type `Output` (from trait `Add`) must --> $DIR/issue-21950.rs:10:25 | LL | type Output; - | ------------ `Output` defined here + | ----------- `Output` defined here ... LL | let x = &10 as &dyn Add; | ^^^ help: specify the associated type: `Add` diff --git a/src/test/ui/issues/issue-22370.stderr b/src/test/ui/issues/issue-22370.stderr index 4da346f56ab7..cd27c4e4e4ed 100644 --- a/src/test/ui/issues/issue-22370.stderr +++ b/src/test/ui/issues/issue-22370.stderr @@ -2,7 +2,7 @@ error[E0393]: the type parameter `T` must be explicitly specified --> $DIR/issue-22370.rs:3:14 | LL | trait A {} - | ------------------ type parameter `T` must be specified for this + | --------------- type parameter `T` must be specified for this LL | LL | fn f(a: &dyn A) {} | ^ help: set the type parameter to the desired type: `A` diff --git a/src/test/ui/issues/issue-22434.stderr b/src/test/ui/issues/issue-22434.stderr index 79b9d85610bc..b97fa2503b8a 100644 --- a/src/test/ui/issues/issue-22434.stderr +++ b/src/test/ui/issues/issue-22434.stderr @@ -2,7 +2,7 @@ error[E0191]: the value of the associated type `A` (from trait `Foo`) must be sp --> $DIR/issue-22434.rs:5:23 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here ... LL | type I<'a> = &'a (dyn Foo + 'a); | ^^^ help: specify the associated type: `Foo` diff --git a/src/test/ui/issues/issue-23302-3.stderr b/src/test/ui/issues/issue-23302-3.stderr index 1a07d4a95bcf..dcb99605da01 100644 --- a/src/test/ui/issues/issue-23302-3.stderr +++ b/src/test/ui/issues/issue-23302-3.stderr @@ -2,19 +2,19 @@ error[E0391]: cycle detected when const-evaluating + checking `A` --> $DIR/issue-23302-3.rs:1:1 | LL | const A: i32 = B; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `B`... --> $DIR/issue-23302-3.rs:3:1 | LL | const B: i32 = A; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ = note: ...which again requires const-evaluating + checking `A`, completing the cycle note: cycle used when simplifying constant for the type system `A` --> $DIR/issue-23302-3.rs:1:1 | LL | const A: i32 = B; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-25901.stderr b/src/test/ui/issues/issue-25901.stderr index 5c35250bc3f3..e933745c44e8 100644 --- a/src/test/ui/issues/issue-25901.stderr +++ b/src/test/ui/issues/issue-25901.stderr @@ -9,7 +9,7 @@ note: deref defined here --> $DIR/issue-25901.rs:10:5 | LL | type Target = B; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ note: impl defined here, but it is not `const` --> $DIR/issue-25901.rs:9:1 | diff --git a/src/test/ui/issues/issue-2718-a.stderr b/src/test/ui/issues/issue-2718-a.stderr index 4aec27f9684f..c6e703f4876f 100644 --- a/src/test/ui/issues/issue-2718-a.stderr +++ b/src/test/ui/issues/issue-2718-a.stderr @@ -2,9 +2,8 @@ error[E0072]: recursive type `Pong` has infinite size --> $DIR/issue-2718-a.rs:8:5 | LL | pub struct Pong(SendPacket); - | ^^^^^^^^^^^^^^^^----------------^^ - | | | - | | recursive without indirection + | ^^^^^^^^^^^^^^^ ---------------- recursive without indirection + | | | recursive type has infinite size | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Pong` representable diff --git a/src/test/ui/issues/issue-33504.stderr b/src/test/ui/issues/issue-33504.stderr index ec15525ed060..d9e7c3b16e76 100644 --- a/src/test/ui/issues/issue-33504.stderr +++ b/src/test/ui/issues/issue-33504.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-33504.rs:7:13 | LL | struct Test; - | ------------ unit struct defined here + | ----------- unit struct defined here ... LL | let Test = 1; | ^^^^ - this expression has type `{integer}` diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr index 319886f87838..a66289a1cf8e 100644 --- a/src/test/ui/issues/issue-35241.stderr +++ b/src/test/ui/issues/issue-35241.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-35241.rs:3:20 | LL | struct Foo(u32); - | ---------------- fn(u32) -> Foo {Foo} defined here + | ---------- fn(u32) -> Foo {Foo} defined here LL | LL | fn test() -> Foo { Foo } | --- ^^^ expected struct `Foo`, found fn item diff --git a/src/test/ui/issues/issue-38857.stderr b/src/test/ui/issues/issue-38857.stderr index e9d229f74e8d..23090c1ed786 100644 --- a/src/test/ui/issues/issue-38857.stderr +++ b/src/test/ui/issues/issue-38857.stderr @@ -14,7 +14,7 @@ note: the module `sys` is defined here --> $SRC_DIR/std/src/lib.rs:LL:COL | LL | mod sys; - | ^^^^^^^^ + | ^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-43355.stderr b/src/test/ui/issues/issue-43355.stderr index 23d8ed1848f5..531130fecab1 100644 --- a/src/test/ui/issues/issue-43355.stderr +++ b/src/test/ui/issues/issue-43355.stderr @@ -2,7 +2,7 @@ error[E0119]: conflicting implementations of trait `Trait1>` --> $DIR/issue-43355.rs:13:1 | LL | impl Trait1 for T where T: Trait2 { - | --------------------------------------------- first implementation here + | -------------------------- first implementation here ... LL | impl Trait1> for A { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A` diff --git a/src/test/ui/issues/issue-46771.stderr b/src/test/ui/issues/issue-46771.stderr index a37b56489595..512827b2dbdc 100644 --- a/src/test/ui/issues/issue-46771.stderr +++ b/src/test/ui/issues/issue-46771.stderr @@ -2,7 +2,7 @@ error[E0618]: expected function, found `Foo` --> $DIR/issue-46771.rs:3:23 | LL | struct Foo; - | ----------- `Foo` defined here + | ---------- `Foo` defined here LL | (1 .. 2).find(|_| Foo(0) == 0); | ^^^--- | | diff --git a/src/test/ui/issues/issue-4968.stderr b/src/test/ui/issues/issue-4968.stderr index 57ff7fe09e5b..bbaca4ed28f5 100644 --- a/src/test/ui/issues/issue-4968.stderr +++ b/src/test/ui/issues/issue-4968.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-4968.rs:5:16 | LL | const A: (isize,isize) = (4,2); - | ------------------------------- constant defined here + | ---------------------- constant defined here LL | fn main() { LL | match 42 { A => () } | -- ^ diff --git a/src/test/ui/issues/issue-69602-type-err-during-codegen-ice.stderr b/src/test/ui/issues/issue-69602-type-err-during-codegen-ice.stderr index cb5b397849c0..2c2cd5c5244c 100644 --- a/src/test/ui/issues/issue-69602-type-err-during-codegen-ice.stderr +++ b/src/test/ui/issues/issue-69602-type-err-during-codegen-ice.stderr @@ -8,7 +8,7 @@ error[E0046]: not all trait items implemented, missing: `MyA` --> $DIR/issue-69602-type-err-during-codegen-ice.rs:16:1 | LL | type MyA: TraitA; - | ----------------- `MyA` from trait + | ---------------- `MyA` from trait ... LL | impl TraitB for B { | ^^^^^^^^^^^^^^^^^ missing `MyA` in implementation diff --git a/src/test/ui/issues/issue-73112.stderr b/src/test/ui/issues/issue-73112.stderr index 5a548378c268..4b8b979665cc 100644 --- a/src/test/ui/issues/issue-73112.stderr +++ b/src/test/ui/issues/issue-73112.stderr @@ -1,19 +1,14 @@ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/issue-73112.rs:9:5 | -LL | / struct SomeStruct { -LL | | -LL | | page_table: PageTable, -LL | | } - | |_____^ +LL | struct SomeStruct { + | ^^^^^^^^^^^^^^^^^ | note: `PageTable` has a `#[repr(align)]` attribute --> $DIR/auxiliary/issue-73112.rs:8:1 | -LL | / pub struct PageTable { -LL | | entries: [PageTableEntry; 512], -LL | | } - | |_^ +LL | pub struct PageTable { + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-76191.stderr b/src/test/ui/issues/issue-76191.stderr index fb8ed43674f2..13749804796b 100644 --- a/src/test/ui/issues/issue-76191.stderr +++ b/src/test/ui/issues/issue-76191.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-76191.rs:13:9 | LL | const RANGE: RangeInclusive = 0..=255; - | ------------------------------------------- constant defined here + | -------------------------------- constant defined here ... LL | match n { | - this expression has type `i32` @@ -23,7 +23,7 @@ error[E0308]: mismatched types --> $DIR/issue-76191.rs:15:9 | LL | const RANGE2: RangeInclusive = panic!(); - | --------------------------------------------- constant defined here + | --------------------------------- constant defined here ... LL | match n { | - this expression has type `i32` diff --git a/src/test/ui/issues/issue-77919.stderr b/src/test/ui/issues/issue-77919.stderr index c986e47fb558..a55ac23e3ed9 100644 --- a/src/test/ui/issues/issue-77919.stderr +++ b/src/test/ui/issues/issue-77919.stderr @@ -21,7 +21,7 @@ error[E0046]: not all trait items implemented, missing: `VAL` --> $DIR/issue-77919.rs:12:1 | LL | const VAL: T; - | ------------- `VAL` from trait + | ------------ `VAL` from trait ... LL | impl TypeVal for Multiply where N: TypeVal {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation diff --git a/src/test/ui/keyword/keyword-self-as-type-param.stderr b/src/test/ui/keyword/keyword-self-as-type-param.stderr index fd101b32b4c9..419652e13492 100644 --- a/src/test/ui/keyword/keyword-self-as-type-param.stderr +++ b/src/test/ui/keyword/keyword-self-as-type-param.stderr @@ -18,9 +18,8 @@ error[E0072]: recursive type `Foo` has infinite size --> $DIR/keyword-self-as-type-param.rs:3:1 | LL | struct Foo(Self); - | ^^^^^^^^^^^^^^^^^----^^ - | | | - | | recursive without indirection + | ^^^^^^^^^^^^^^^^ ---- recursive without indirection + | | | recursive type has infinite size | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable diff --git a/src/test/ui/layout/debug.stderr b/src/test/ui/layout/debug.stderr index 7dbcc1518550..7ba9657fcd6f 100644 --- a/src/test/ui/layout/debug.stderr +++ b/src/test/ui/layout/debug.stderr @@ -84,7 +84,7 @@ error: layout_of(E) = Layout { --> $DIR/debug.rs:6:1 | LL | enum E { Foo, Bar(!, i32, i32) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(S) = Layout { fields: Arbitrary { @@ -128,7 +128,7 @@ error: layout_of(S) = Layout { --> $DIR/debug.rs:9:1 | LL | struct S { f1: i32, f2: (), f3: i32 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ error: layout_of(U) = Layout { fields: Union( @@ -150,7 +150,7 @@ error: layout_of(U) = Layout { --> $DIR/debug.rs:12:1 | LL | union U { f1: (i32, i32), f3: i32 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ error: layout_of(std::result::Result) = Layout { fields: Arbitrary { @@ -279,7 +279,7 @@ error: layout_of(std::result::Result) = Layout { --> $DIR/debug.rs:15:1 | LL | type Test = Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ error: layout_of(i32) = Layout { fields: Primitive, @@ -305,7 +305,7 @@ error: layout_of(i32) = Layout { --> $DIR/debug.rs:18:1 | LL | type T = impl std::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/layout/hexagon-enum.stderr b/src/test/ui/layout/hexagon-enum.stderr index ba919df771fc..f3123cb0ad22 100644 --- a/src/test/ui/layout/hexagon-enum.stderr +++ b/src/test/ui/layout/hexagon-enum.stderr @@ -66,7 +66,7 @@ error: layout_of(A) = Layout { --> $DIR/hexagon-enum.rs:16:1 | LL | enum A { Apple } - | ^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(B) = Layout { fields: Arbitrary { @@ -136,7 +136,7 @@ error: layout_of(B) = Layout { --> $DIR/hexagon-enum.rs:20:1 | LL | enum B { Banana = 255, } - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(C) = Layout { fields: Arbitrary { @@ -206,7 +206,7 @@ error: layout_of(C) = Layout { --> $DIR/hexagon-enum.rs:24:1 | LL | enum C { Chaenomeles = 256, } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(P) = Layout { fields: Arbitrary { @@ -276,7 +276,7 @@ error: layout_of(P) = Layout { --> $DIR/hexagon-enum.rs:28:1 | LL | enum P { Peach = 0x1000_0000isize, } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(T) = Layout { fields: Arbitrary { @@ -346,7 +346,7 @@ error: layout_of(T) = Layout { --> $DIR/hexagon-enum.rs:34:1 | LL | enum T { Tangerine = TANGERINE as isize } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/layout/homogeneous-aggr-zero-sized-c-struct.stderr b/src/test/ui/layout/homogeneous-aggr-zero-sized-c-struct.stderr index 6c97a09b0c66..e19216a99dbe 100644 --- a/src/test/ui/layout/homogeneous-aggr-zero-sized-c-struct.stderr +++ b/src/test/ui/layout/homogeneous-aggr-zero-sized-c-struct.stderr @@ -2,13 +2,13 @@ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 byt --> $DIR/homogeneous-aggr-zero-sized-c-struct.rs:22:1 | LL | pub type TestMiddle = Middle; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/homogeneous-aggr-zero-sized-c-struct.rs:33:1 | LL | pub type TestFinal = Final; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/layout/homogeneous-aggr-zero-sized-repr-rust.stderr b/src/test/ui/layout/homogeneous-aggr-zero-sized-repr-rust.stderr index 322948ff7839..17d639da0240 100644 --- a/src/test/ui/layout/homogeneous-aggr-zero-sized-repr-rust.stderr +++ b/src/test/ui/layout/homogeneous-aggr-zero-sized-repr-rust.stderr @@ -2,31 +2,31 @@ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 byt --> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:53:1 | LL | pub type Test1 = BaseCase; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:57:1 | LL | pub type Test2 = WithPhantomData; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:61:1 | LL | pub type Test3 = WithEmptyRustStruct; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:65:1 | LL | pub type Test4 = WithTransitivelyEmptyRustStruct; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:69:1 | LL | pub type Test5 = WithEmptyRustEnum; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr b/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr index 33dfa307c1d2..84d8bc799b93 100644 --- a/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr +++ b/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr @@ -105,11 +105,8 @@ error: layout_of(MissingPayloadField) = Layout { } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1 | -LL | / pub enum MissingPayloadField { -LL | | Some(u8), -LL | | None -LL | | } - | |_^ +LL | pub enum MissingPayloadField { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(CommonPayloadField) = Layout { fields: Arbitrary { @@ -237,11 +234,8 @@ error: layout_of(CommonPayloadField) = Layout { } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1 | -LL | / pub enum CommonPayloadField { -LL | | A(u8), -LL | | B(u8), -LL | | } - | |_^ +LL | pub enum CommonPayloadField { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { fields: Arbitrary { @@ -366,11 +360,8 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1 | -LL | / pub enum CommonPayloadFieldIsMaybeUninit { -LL | | A(u8), -LL | | B(MaybeUninit), -LL | | } - | |_^ +LL | pub enum CommonPayloadFieldIsMaybeUninit { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(NicheFirst) = Layout { fields: Arbitrary { @@ -513,12 +504,8 @@ error: layout_of(NicheFirst) = Layout { } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1 | -LL | / pub enum NicheFirst { -LL | | A(HasNiche, u8), -LL | | B, -LL | | C -LL | | } - | |_^ +LL | pub enum NicheFirst { + | ^^^^^^^^^^^^^^^^^^^ error: layout_of(NicheSecond) = Layout { fields: Arbitrary { @@ -661,12 +648,8 @@ error: layout_of(NicheSecond) = Layout { } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1 | -LL | / pub enum NicheSecond { -LL | | A(u8, HasNiche), -LL | | B, -LL | | C, -LL | | } - | |_^ +LL | pub enum NicheSecond { + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/layout/thumb-enum.stderr b/src/test/ui/layout/thumb-enum.stderr index 9db9ad5a7848..e6ed626d5f1a 100644 --- a/src/test/ui/layout/thumb-enum.stderr +++ b/src/test/ui/layout/thumb-enum.stderr @@ -66,7 +66,7 @@ error: layout_of(A) = Layout { --> $DIR/thumb-enum.rs:16:1 | LL | enum A { Apple } - | ^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(B) = Layout { fields: Arbitrary { @@ -136,7 +136,7 @@ error: layout_of(B) = Layout { --> $DIR/thumb-enum.rs:20:1 | LL | enum B { Banana = 255, } - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(C) = Layout { fields: Arbitrary { @@ -206,7 +206,7 @@ error: layout_of(C) = Layout { --> $DIR/thumb-enum.rs:24:1 | LL | enum C { Chaenomeles = 256, } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(P) = Layout { fields: Arbitrary { @@ -276,7 +276,7 @@ error: layout_of(P) = Layout { --> $DIR/thumb-enum.rs:28:1 | LL | enum P { Peach = 0x1000_0000isize, } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: layout_of(T) = Layout { fields: Arbitrary { @@ -346,7 +346,7 @@ error: layout_of(T) = Layout { --> $DIR/thumb-enum.rs:34:1 | LL | enum T { Tangerine = TANGERINE as isize } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/layout/zero-sized-array-union.stderr b/src/test/ui/layout/zero-sized-array-union.stderr index 8faf8593294c..de2b863e4caa 100644 --- a/src/test/ui/layout/zero-sized-array-union.stderr +++ b/src/test/ui/layout/zero-sized-array-union.stderr @@ -2,25 +2,25 @@ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 byt --> $DIR/zero-sized-array-union.rs:59:1 | LL | type TestBaz1 = Baz1; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/zero-sized-array-union.rs:70:1 | LL | type TestBaz2 = Baz2; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/zero-sized-array-union.rs:81:1 | LL | type TestBaz3 = Baz3; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) --> $DIR/zero-sized-array-union.rs:92:1 | LL | type TestBaz4 = Baz4; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/limits/issue-56762.stderr b/src/test/ui/limits/issue-56762.stderr index f26ef280b20b..e6b9c6762789 100644 --- a/src/test/ui/limits/issue-56762.stderr +++ b/src/test/ui/limits/issue-56762.stderr @@ -2,13 +2,13 @@ error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the --> $DIR/issue-56762.rs:19:1 | LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the current architecture --> $DIR/issue-56762.rs:21:1 | LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.stderr b/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.stderr index dcb954a4bc0c..06a070822630 100644 --- a/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.stderr +++ b/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.stderr @@ -2,7 +2,7 @@ error: symbol `collision` is already defined --> $DIR/auxiliary/def_colliding_external.rs:6:5 | LL | pub static collision: *const i32; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr b/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr index 7e395e67378f..e0be1ac2117b 100644 --- a/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr +++ b/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr @@ -2,7 +2,7 @@ error: symbol `collision` is already defined --> $DIR/linkage-detect-local-generated-name-collision.rs:10:9 | LL | pub static collision: *const i32; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/linkage-attr/linkage-requires-raw-ptr.stderr b/src/test/ui/linkage-attr/linkage-requires-raw-ptr.stderr index a80b495f97fa..5abbe745c6a2 100644 --- a/src/test/ui/linkage-attr/linkage-requires-raw-ptr.stderr +++ b/src/test/ui/linkage-attr/linkage-requires-raw-ptr.stderr @@ -2,7 +2,7 @@ error: must have type `*const T` or `*mut T` due to `#[linkage]` attribute --> $DIR/auxiliary/def_illtyped_external.rs:5:1 | LL | pub static EXTERN: u32 = 0; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/linkage-attr/linkage2.stderr b/src/test/ui/linkage-attr/linkage2.stderr index 6ffe07170ede..a6ac0aad0778 100644 --- a/src/test/ui/linkage-attr/linkage2.stderr +++ b/src/test/ui/linkage-attr/linkage2.stderr @@ -2,7 +2,7 @@ error: must have type `*const T` or `*mut T` due to `#[linkage]` attribute --> $DIR/linkage2.rs:12:5 | LL | static foo: i32; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/linkage-attr/linkage3.stderr b/src/test/ui/linkage-attr/linkage3.stderr index 0cbac28349d5..f2579c6e850f 100644 --- a/src/test/ui/linkage-attr/linkage3.stderr +++ b/src/test/ui/linkage-attr/linkage3.stderr @@ -2,7 +2,7 @@ error: invalid linkage specified --> $DIR/linkage3.rs:11:5 | LL | static foo: *const i32; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr index c14529a7d090..915b3b86fe80 100644 --- a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/allowed-cli-deny-by-default-lint.rs:6:16 | LL | const C: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ warning: any use of this value will cause an error --> $DIR/allowed-cli-deny-by-default-lint.rs:6:16 | LL | const C: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr index dd71a168960a..3b36d1d02271 100644 --- a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/allowed-deny-by-default-lint.rs:7:16 | LL | const C: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ warning: any use of this value will cause an error --> $DIR/allowed-deny-by-default-lint.rs:7:16 | LL | const C: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr index d4e80584669a..a2e5baa8b9d4 100644 --- a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr @@ -2,9 +2,7 @@ warning: any use of this value will cause an error --> $DIR/deny-by-default-lint.rs:5:16 | LL | const C: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -17,9 +15,7 @@ warning: any use of this value will cause an error --> $DIR/deny-by-default-lint.rs:5:16 | LL | const C: i32 = 1 / 0; - | ---------------^^^^^- - | | - | attempt to divide `1_i32` by zero + | ------------ ^^^^^ attempt to divide `1_i32` by zero | = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/src/test/ui/lint/issue-14309.stderr b/src/test/ui/lint/issue-14309.stderr index 799991f7ee4b..a9538b5e3a49 100644 --- a/src/test/ui/lint/issue-14309.stderr +++ b/src/test/ui/lint/issue-14309.stderr @@ -14,10 +14,8 @@ LL | #![deny(improper_ctypes)] note: the type is defined here --> $DIR/issue-14309.rs:4:1 | -LL | / struct A { -LL | | x: i32 -LL | | } - | |_^ +LL | struct A { + | ^^^^^^^^ error: `extern` block uses type `A`, which is not FFI-safe --> $DIR/issue-14309.rs:31:15 @@ -30,10 +28,8 @@ LL | fn bar(x: B); note: the type is defined here --> $DIR/issue-14309.rs:4:1 | -LL | / struct A { -LL | | x: i32 -LL | | } - | |_^ +LL | struct A { + | ^^^^^^^^ error: `extern` block uses type `A`, which is not FFI-safe --> $DIR/issue-14309.rs:33:15 @@ -46,10 +42,8 @@ LL | fn qux(x: A2); note: the type is defined here --> $DIR/issue-14309.rs:4:1 | -LL | / struct A { -LL | | x: i32 -LL | | } - | |_^ +LL | struct A { + | ^^^^^^^^ error: `extern` block uses type `A`, which is not FFI-safe --> $DIR/issue-14309.rs:34:16 @@ -62,10 +56,8 @@ LL | fn quux(x: B2); note: the type is defined here --> $DIR/issue-14309.rs:4:1 | -LL | / struct A { -LL | | x: i32 -LL | | } - | |_^ +LL | struct A { + | ^^^^^^^^ error: `extern` block uses type `A`, which is not FFI-safe --> $DIR/issue-14309.rs:36:16 @@ -78,10 +70,8 @@ LL | fn fred(x: D); note: the type is defined here --> $DIR/issue-14309.rs:4:1 | -LL | / struct A { -LL | | x: i32 -LL | | } - | |_^ +LL | struct A { + | ^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/lint/lint-const-item-mutation.stderr b/src/test/ui/lint/lint-const-item-mutation.stderr index 540e076c7e4c..94d876423e74 100644 --- a/src/test/ui/lint/lint-const-item-mutation.stderr +++ b/src/test/ui/lint/lint-const-item-mutation.stderr @@ -10,7 +10,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:26:1 | LL | const ARRAY: [u8; 1] = [25]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ warning: attempting to modify a `const` item --> $DIR/lint-const-item-mutation.rs:38:5 @@ -23,7 +23,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:27:1 | LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: attempting to modify a `const` item --> $DIR/lint-const-item-mutation.rs:39:5 @@ -36,7 +36,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:27:1 | LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item --> $DIR/lint-const-item-mutation.rs:40:5 @@ -55,7 +55,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:27:1 | LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item --> $DIR/lint-const-item-mutation.rs:41:5 @@ -69,7 +69,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:27:1 | LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item --> $DIR/lint-const-item-mutation.rs:42:5 @@ -83,7 +83,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:27:1 | LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: attempting to modify a `const` item --> $DIR/lint-const-item-mutation.rs:54:5 @@ -96,7 +96,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:30:1 | LL | const MUTABLE2: Mutable2 = Mutable2 { msg: "", other: String::new() }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item --> $DIR/lint-const-item-mutation.rs:55:5 @@ -115,7 +115,7 @@ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:31:1 | LL | const VEC: Vec = Vec::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ warning: 8 warnings emitted diff --git a/src/test/ui/lint/lint-ctypes-enum.stderr b/src/test/ui/lint/lint-ctypes-enum.stderr index 1601bd9d6292..de532f69ac0a 100644 --- a/src/test/ui/lint/lint-ctypes-enum.stderr +++ b/src/test/ui/lint/lint-ctypes-enum.stderr @@ -14,10 +14,8 @@ LL | #![deny(improper_ctypes)] note: the type is defined here --> $DIR/lint-ctypes-enum.rs:9:1 | -LL | / enum U { -LL | | A, -LL | | } - | |_^ +LL | enum U { + | ^^^^^^ error: `extern` block uses type `B`, which is not FFI-safe --> $DIR/lint-ctypes-enum.rs:61:13 @@ -30,11 +28,8 @@ LL | fn bf(x: B); note: the type is defined here --> $DIR/lint-ctypes-enum.rs:12:1 | -LL | / enum B { -LL | | C, -LL | | D, -LL | | } - | |_^ +LL | enum B { + | ^^^^^^ error: `extern` block uses type `T`, which is not FFI-safe --> $DIR/lint-ctypes-enum.rs:62:13 @@ -47,12 +42,8 @@ LL | fn tf(x: T); note: the type is defined here --> $DIR/lint-ctypes-enum.rs:16:1 | -LL | / enum T { -LL | | E, -LL | | F, -LL | | G, -LL | | } - | |_^ +LL | enum T { + | ^^^^^^ error: `extern` block uses type `u128`, which is not FFI-safe --> $DIR/lint-ctypes-enum.rs:74:23 diff --git a/src/test/ui/lint/lint-ctypes-fn.stderr b/src/test/ui/lint/lint-ctypes-fn.stderr index 740075ca7dff..6f8d76411aae 100644 --- a/src/test/ui/lint/lint-ctypes-fn.stderr +++ b/src/test/ui/lint/lint-ctypes-fn.stderr @@ -100,7 +100,7 @@ note: the type is defined here --> $DIR/lint-ctypes-fn.rs:28:1 | LL | pub struct ZeroSize; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe --> $DIR/lint-ctypes-fn.rs:110:40 @@ -113,7 +113,7 @@ note: the type is defined here --> $DIR/lint-ctypes-fn.rs:63:1 | LL | pub struct ZeroSizeWithPhantomData(PhantomData); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `extern` fn uses type `PhantomData`, which is not FFI-safe --> $DIR/lint-ctypes-fn.rs:113:51 diff --git a/src/test/ui/lint/lint-ctypes.stderr b/src/test/ui/lint/lint-ctypes.stderr index 342b6bfc6f87..bfec40e19553 100644 --- a/src/test/ui/lint/lint-ctypes.stderr +++ b/src/test/ui/lint/lint-ctypes.stderr @@ -15,7 +15,7 @@ note: the type is defined here --> $DIR/lint-ctypes.rs:26:1 | LL | pub struct Foo; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: `extern` block uses type `Foo`, which is not FFI-safe --> $DIR/lint-ctypes.rs:49:28 @@ -29,7 +29,7 @@ note: the type is defined here --> $DIR/lint-ctypes.rs:26:1 | LL | pub struct Foo; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error: `extern` block uses type `((),)`, which is not FFI-safe --> $DIR/lint-ctypes.rs:51:25 @@ -139,7 +139,7 @@ note: the type is defined here --> $DIR/lint-ctypes.rs:22:1 | LL | pub struct ZeroSize; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe --> $DIR/lint-ctypes.rs:64:33 @@ -152,7 +152,7 @@ note: the type is defined here --> $DIR/lint-ctypes.rs:45:1 | LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `extern` block uses type `PhantomData`, which is not FFI-safe --> $DIR/lint-ctypes.rs:67:12 diff --git a/src/test/ui/lint/uninitialized-zeroed.stderr b/src/test/ui/lint/uninitialized-zeroed.stderr index b6a66f0a95ad..88121a1836da 100644 --- a/src/test/ui/lint/uninitialized-zeroed.stderr +++ b/src/test/ui/lint/uninitialized-zeroed.stderr @@ -400,11 +400,8 @@ LL | let _val: Fruit = mem::uninitialized(); note: enums have to be initialized to a variant --> $DIR/uninitialized-zeroed.rs:26:1 | -LL | / enum Fruit { -LL | | Apple, -LL | | Banana, -LL | | } - | |_^ +LL | enum Fruit { + | ^^^^^^^^^^ error: the type `[bool; 2]` does not permit being left uninitialized --> $DIR/uninitialized-zeroed.rs:101:31 diff --git a/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr index 1d57b32d47e8..bf85a2d75db2 100644 --- a/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr +++ b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr @@ -13,70 +13,60 @@ LL | pong!(); error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` --> $DIR/main.rs:10:20 | -LL | / macro_rules! pong { -LL | | () => { syntax error }; - | | ^^^^^ expected one of 8 possible tokens -LL | | } - | |__- in this expansion of `pong!` (#2) +LL | / macro_rules! pong { +LL | | () => { syntax error }; + | | ^^^^^ expected one of 8 possible tokens +LL | | } + | |_- in this expansion of `pong!` (#2) ... -LL | ping!(); - | ------- in this macro invocation (#1) +LL | ping!(); + | ------- in this macro invocation (#1) | ::: $DIR/auxiliary/ping.rs:5:1 | -LL | / macro_rules! ping { -LL | | () => { -LL | | pong!(); - | | ------- in this macro invocation (#2) -LL | | } -LL | | } - | |_- in this expansion of `ping!` (#1) +LL | macro_rules! ping { + | ----------------- in this expansion of `ping!` (#1) +LL | () => { +LL | pong!(); + | ------- in this macro invocation (#2) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` --> $DIR/main.rs:10:20 | -LL | / macro_rules! pong { -LL | | () => { syntax error }; - | | ^^^^^ expected one of 8 possible tokens -LL | | } - | |__- in this expansion of `pong!` (#5) +LL | / macro_rules! pong { +LL | | () => { syntax error }; + | | ^^^^^ expected one of 8 possible tokens +LL | | } + | |_- in this expansion of `pong!` (#5) ... -LL | deep!(); - | ------- in this macro invocation (#1) +LL | deep!(); + | ------- in this macro invocation (#1) | ::: $DIR/auxiliary/ping.rs:5:1 | -LL | / macro_rules! ping { -LL | | () => { -LL | | pong!(); - | | ------- in this macro invocation (#5) -LL | | } -LL | | } - | |_- in this expansion of `ping!` (#4) +LL | macro_rules! ping { + | ----------------- in this expansion of `ping!` (#4) +LL | () => { +LL | pong!(); + | ------- in this macro invocation (#5) ... -LL | / macro_rules! deep { -LL | | () => { -LL | | foo!(); - | | ------ in this macro invocation (#2) -LL | | } -LL | | } - | |__- in this expansion of `deep!` (#1) +LL | macro_rules! deep { + | ----------------- in this expansion of `deep!` (#1) +LL | () => { +LL | foo!(); + | ------ in this macro invocation (#2) ... -LL | / macro_rules! foo { -LL | | () => { -LL | | bar!(); - | | ------ in this macro invocation (#3) -LL | | } -LL | | } - | |__- in this expansion of `foo!` (#2) +LL | macro_rules! foo { + | ---------------- in this expansion of `foo!` (#2) +LL | () => { +LL | bar!(); + | ------ in this macro invocation (#3) ... -LL | / macro_rules! bar { -LL | | () => { -LL | | ping!(); - | | ------- in this macro invocation (#4) -LL | | } -LL | | } - | |__- in this expansion of `bar!` (#3) +LL | macro_rules! bar { + | ---------------- in this expansion of `bar!` (#3) +LL | () => { +LL | ping!(); + | ------- in this macro invocation (#4) error: aborting due to 3 previous errors diff --git a/src/test/ui/macros/unknown-builtin.stderr b/src/test/ui/macros/unknown-builtin.stderr index 7b04e05293ea..8f9dba16578e 100644 --- a/src/test/ui/macros/unknown-builtin.stderr +++ b/src/test/ui/macros/unknown-builtin.stderr @@ -7,12 +7,8 @@ LL | macro_rules! unknown { () => () } error[E0773]: attempted to define built-in macro more than once --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | -LL | / macro_rules! line { -LL | | () => { -LL | | /* compiler built-in */ -LL | | }; -LL | | } - | |_____^ +LL | macro_rules! line { + | ^^^^^^^^^^^^^^^^^ | note: previously defined here --> $DIR/unknown-builtin.rs:9:1 diff --git a/src/test/ui/marker_trait_attr/marker-trait-with-associated-items.stderr b/src/test/ui/marker_trait_attr/marker-trait-with-associated-items.stderr index ae7d5a98b087..ac218e30b9b8 100644 --- a/src/test/ui/marker_trait_attr/marker-trait-with-associated-items.stderr +++ b/src/test/ui/marker_trait_attr/marker-trait-with-associated-items.stderr @@ -2,13 +2,13 @@ error[E0714]: marker traits cannot have associated items --> $DIR/marker-trait-with-associated-items.rs:6:5 | LL | const N: usize; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error[E0714]: marker traits cannot have associated items --> $DIR/marker-trait-with-associated-items.rs:12:5 | LL | type Output; - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^ error[E0714]: marker traits cannot have associated items --> $DIR/marker-trait-with-associated-items.rs:18:5 @@ -20,13 +20,13 @@ error[E0714]: marker traits cannot have associated items --> $DIR/marker-trait-with-associated-items.rs:24:5 | LL | const N: usize = 43; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ error[E0714]: marker traits cannot have associated items --> $DIR/marker-trait-with-associated-items.rs:30:5 | LL | type Output = (); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error[E0714]: marker traits cannot have associated items --> $DIR/marker-trait-with-associated-items.rs:36:5 diff --git a/src/test/ui/match/match_non_exhaustive.stderr b/src/test/ui/match/match_non_exhaustive.stderr index 6206dc85ea05..9d92f8fdbb4b 100644 --- a/src/test/ui/match/match_non_exhaustive.stderr +++ b/src/test/ui/match/match_non_exhaustive.stderr @@ -25,7 +25,7 @@ note: `E1` defined here --> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1 | LL | pub enum E1 {} - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ = note: the matched value is of type `E1`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -44,7 +44,7 @@ note: `E2` defined here --> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1 | LL | pub enum E2 { A, B } - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ = note: the matched value is of type `E2`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index 57662e1e265a..4be588fe7f92 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -50,7 +50,7 @@ error[E0599]: `Foo` is not an iterator --> $DIR/method-call-err-msg.rs:19:7 | LL | pub struct Foo; - | --------------- + | -------------- | | | | | method `take` not found for this struct | doesn't satisfy `Foo: Iterator` @@ -64,14 +64,8 @@ LL | .take() note: the following trait must be implemented --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | -LL | / pub trait Iterator { -LL | | /// The type of the elements being iterated over. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Item; -... | -LL | | } -LL | | } - | |_^ +LL | pub trait Iterator { + | ^^^^^^^^^^^^^^^^^^ = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `take`, perhaps you need to implement it: candidate #1: `Iterator` diff --git a/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr b/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr index 73c9f86e0022..ffd95b48ac2b 100644 --- a/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr +++ b/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr @@ -10,18 +10,12 @@ note: an implementation of `AddAssign<_>` might be missing for `Foo` --> $DIR/assignment-operator-unimplemented.rs:1:1 | LL | struct Foo; - | ^^^^^^^^^^^ must implement `AddAssign<_>` + | ^^^^^^^^^^ must implement `AddAssign<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait AddAssign { -LL | | /// Performs the `+=` operation. -LL | | /// -LL | | /// # Example -... | -LL | | fn add_assign(&mut self, rhs: Rhs); -LL | | } - | |_^ +LL | pub trait AddAssign { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr index fed47e0f1747..3968774e3579 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.stderr +++ b/src/test/ui/mismatched_types/closure-arg-count.stderr @@ -188,7 +188,7 @@ LL | call(Foo); | required by a bound introduced by this call ... LL | struct Foo(u8); - | --------------- takes 1 argument + | ---------- takes 1 argument | note: required by a bound in `call` --> $DIR/closure-arg-count.rs:42:30 diff --git a/src/test/ui/missing-trait-bounds/issue-69725.stderr b/src/test/ui/missing-trait-bounds/issue-69725.stderr index 6395bca300c9..980d9dd167d2 100644 --- a/src/test/ui/missing-trait-bounds/issue-69725.stderr +++ b/src/test/ui/missing-trait-bounds/issue-69725.stderr @@ -7,7 +7,7 @@ LL | let _ = Struct::::new().clone(); ::: $DIR/auxiliary/issue-69725.rs:2:1 | LL | pub struct Struct(A); - | ------------------------ doesn't satisfy `Struct: Clone` + | -------------------- doesn't satisfy `Struct: Clone` | = note: the following trait bounds were not satisfied: `A: Clone` diff --git a/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr index f3c6b39e62ed..9e94aa2c7b3b 100644 --- a/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr +++ b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr @@ -30,7 +30,7 @@ error[E0599]: the method `foo` exists for reference `&Fin`, but its trait bou --> $DIR/missing-trait-bounds-for-method-call.rs:27:14 | LL | struct Fin where T: Bar { - | -------------------------- doesn't satisfy `Fin: Bar` + | ------------- doesn't satisfy `Fin: Bar` ... LL | self.foo(); | ^^^ method cannot be called on `&Fin` due to unsatisfied trait bounds diff --git a/src/test/ui/moves/move-deref-coercion.stderr b/src/test/ui/moves/move-deref-coercion.stderr index e3bdf6d78320..5760f4a7fdc3 100644 --- a/src/test/ui/moves/move-deref-coercion.stderr +++ b/src/test/ui/moves/move-deref-coercion.stderr @@ -12,7 +12,7 @@ note: deref defined here --> $DIR/move-deref-coercion.rs:17:5 | LL | type Target = NotCopy; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error[E0382]: borrow of partially moved value: `val` --> $DIR/move-deref-coercion.rs:30:5 @@ -28,7 +28,7 @@ note: deref defined here --> $DIR/move-deref-coercion.rs:17:5 | LL | type Target = NotCopy; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr index ccdd4dd272e9..fbd86bdb661f 100644 --- a/src/test/ui/namespace/namespace-mix.stderr +++ b/src/test/ui/namespace/namespace-mix.stderr @@ -33,7 +33,7 @@ LL | check(xm1::S); ::: $DIR/auxiliary/namespace-mix.rs:3:5 | LL | pub struct TS(); - | ---------------- similarly named tuple struct `TS` defined here + | ------------- similarly named tuple struct `TS` defined here | = note: can't use a type alias as a constructor help: a tuple struct with a similar name exists diff --git a/src/test/ui/never_type/never-from-impl-is-reserved.stderr b/src/test/ui/never_type/never-from-impl-is-reserved.stderr index 871c51205282..f9f7c787ecbc 100644 --- a/src/test/ui/never_type/never-from-impl-is-reserved.stderr +++ b/src/test/ui/never_type/never-from-impl-is-reserved.stderr @@ -5,7 +5,7 @@ LL | impl MyTrait for MyFoo {} | ---------------------- first implementation here LL | // This will conflict with the first impl if we impl `for T: From`. LL | impl MyTrait for T where T: From {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFoo` + | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFoo` | = note: permitting this impl would forbid us from adding `impl From for T` later; see rust-lang/rust#64715 for details diff --git a/src/test/ui/no-capture-arc.stderr b/src/test/ui/no-capture-arc.stderr index 7fa2090e3e61..9ae41e78c227 100644 --- a/src/test/ui/no-capture-arc.stderr +++ b/src/test/ui/no-capture-arc.stderr @@ -17,7 +17,7 @@ note: deref defined here --> $SRC_DIR/alloc/src/sync.rs:LL:COL | LL | type Target = T; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/no-reuse-move-arc.stderr b/src/test/ui/no-reuse-move-arc.stderr index bcc4506dc8d1..564b05854740 100644 --- a/src/test/ui/no-reuse-move-arc.stderr +++ b/src/test/ui/no-reuse-move-arc.stderr @@ -17,7 +17,7 @@ note: deref defined here --> $SRC_DIR/alloc/src/sync.rs:LL:COL | LL | type Target = T; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr index c94adfe4ab38..920720a4f53e 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr @@ -38,14 +38,8 @@ LL | enum E { A, B } note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL | -LL | / pub trait BitOr { -LL | | /// The resulting type after applying the `|` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn bitor(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait BitOr { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/fn-header-semantic-fail.stderr b/src/test/ui/parser/fn-header-semantic-fail.stderr index bd3b9181123b..75d27c614e20 100644 --- a/src/test/ui/parser/fn-header-semantic-fail.stderr +++ b/src/test/ui/parser/fn-header-semantic-fail.stderr @@ -234,30 +234,30 @@ LL | const async unsafe extern "C" fn ft5(); LL | const async unsafe extern "C" fn ft5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `(): Future` -error[E0391]: cycle detected when computing type of `main::::ft5::{opaque#0}` +error[E0391]: cycle detected when computing type of `main::::ft5::{opaque#0}` --> $DIR/fn-header-semantic-fail.rs:34:48 | LL | const async unsafe extern "C" fn ft5() {} | ^ | -note: ...which requires borrow-checking `main::::ft5`... +note: ...which requires borrow-checking `main::::ft5`... --> $DIR/fn-header-semantic-fail.rs:34:9 | LL | const async unsafe extern "C" fn ft5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires processing `main::::ft5`... +note: ...which requires processing `main::::ft5`... --> $DIR/fn-header-semantic-fail.rs:34:9 | LL | const async unsafe extern "C" fn ft5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const checking `main::::ft5`... +note: ...which requires const checking `main::::ft5`... --> $DIR/fn-header-semantic-fail.rs:34:9 | LL | const async unsafe extern "C" fn ft5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires computing whether `impl core::future::future::Future` is freeze... = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future: core::marker::Freeze`... - = note: ...which again requires computing type of `main::::ft5::{opaque#0}`, completing the cycle + = note: ...which again requires computing type of `main::::ft5::{opaque#0}`, completing the cycle note: cycle used when checking item types in top-level module --> $DIR/fn-header-semantic-fail.rs:5:1 | @@ -270,30 +270,30 @@ LL | | } LL | | } | |_^ -error[E0391]: cycle detected when computing type of `main::::fi5::{opaque#0}` +error[E0391]: cycle detected when computing type of `main::::fi5::{opaque#0}` --> $DIR/fn-header-semantic-fail.rs:47:48 | LL | const async unsafe extern "C" fn fi5() {} | ^ | -note: ...which requires borrow-checking `main::::fi5`... +note: ...which requires borrow-checking `main::::fi5`... --> $DIR/fn-header-semantic-fail.rs:47:9 | LL | const async unsafe extern "C" fn fi5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires processing `main::::fi5`... +note: ...which requires processing `main::::fi5`... --> $DIR/fn-header-semantic-fail.rs:47:9 | LL | const async unsafe extern "C" fn fi5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const checking `main::::fi5`... +note: ...which requires const checking `main::::fi5`... --> $DIR/fn-header-semantic-fail.rs:47:9 | LL | const async unsafe extern "C" fn fi5() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires computing whether `impl core::future::future::Future` is freeze... = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future: core::marker::Freeze`... - = note: ...which again requires computing type of `main::::fi5::{opaque#0}`, completing the cycle + = note: ...which again requires computing type of `main::::fi5::{opaque#0}`, completing the cycle note: cycle used when checking item types in top-level module --> $DIR/fn-header-semantic-fail.rs:5:1 | diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr index 07b678bc8731..019cd414d2e9 100644 --- a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr +++ b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr @@ -16,9 +16,9 @@ LL | Z0() => {} ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1 | LL | pub struct Z0; - | -------------- `Z0` defined here + | ------------- `Z0` defined here LL | pub struct Z1(); - | ---------------- similarly named tuple struct `Z1` defined here + | ------------- similarly named tuple struct `Z1` defined here | help: use this syntax instead | @@ -38,9 +38,9 @@ LL | Z0(x) => {} ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1 | LL | pub struct Z0; - | -------------- `Z0` defined here + | ------------- `Z0` defined here LL | pub struct Z1(); - | ---------------- similarly named tuple struct `Z1` defined here + | ------------- similarly named tuple struct `Z1` defined here | help: use this syntax instead | @@ -126,7 +126,7 @@ LL | Z1(x) => {} ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:2:1 | LL | pub struct Z1(); - | ---------------- tuple struct has 0 fields + | ------------- tuple struct has 0 fields error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields --> $DIR/pat-tuple-field-count-cross.rs:18:9 diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr index 1c44f7e5f6f1..9e13a2dc9fbf 100644 --- a/src/test/ui/pattern/pat-tuple-overfield.stderr +++ b/src/test/ui/pattern/pat-tuple-overfield.stderr @@ -271,7 +271,7 @@ error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 --> $DIR/pat-tuple-overfield.rs:59:12 | LL | struct Z1(); - | ------------ tuple struct has 0 fields + | --------- tuple struct has 0 fields ... LL | Z1(_) => {} | ^ expected 0 fields, found 1 @@ -280,7 +280,7 @@ error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has --> $DIR/pat-tuple-overfield.rs:60:12 | LL | struct Z1(); - | ------------ tuple struct has 0 fields + | --------- tuple struct has 0 fields ... LL | Z1(_, _) => {} | ^ ^ expected 0 fields, found 2 diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr index 296465eb8183..643e734f9d4f 100644 --- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr +++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr @@ -7,13 +7,8 @@ LL | match HiddenEnum::A { note: `HiddenEnum` defined here --> $DIR/auxiliary/hidden.rs:1:1 | -LL | / pub enum HiddenEnum { -LL | | A, -LL | | B, -LL | | #[doc(hidden)] -LL | | C, -LL | | } - | |_^ +LL | pub enum HiddenEnum { + | ^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `HiddenEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -30,14 +25,11 @@ LL | match HiddenEnum::A { note: `HiddenEnum` defined here --> $DIR/auxiliary/hidden.rs:3:5 | -LL | / pub enum HiddenEnum { -LL | | A, -LL | | B, - | | ^ not covered -LL | | #[doc(hidden)] -LL | | C, -LL | | } - | |_- +LL | pub enum HiddenEnum { + | ------------------- +LL | A, +LL | B, + | ^ not covered = note: the matched value is of type `HiddenEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -54,14 +46,11 @@ LL | match HiddenEnum::A { note: `HiddenEnum` defined here --> $DIR/auxiliary/hidden.rs:3:5 | -LL | / pub enum HiddenEnum { -LL | | A, -LL | | B, - | | ^ not covered -LL | | #[doc(hidden)] -LL | | C, -LL | | } - | |_- +LL | pub enum HiddenEnum { + | ------------------- +LL | A, +LL | B, + | ^ not covered = note: the matched value is of type `HiddenEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | @@ -78,15 +67,11 @@ LL | match None { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr index 717bb53c3275..2247b818d438 100644 --- a/src/test/ui/pattern/usefulness/issue-35609.stderr +++ b/src/test/ui/pattern/usefulness/issue-35609.stderr @@ -108,14 +108,8 @@ LL | match Some(A) { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), -LL | | } - | |_^ +LL | pub enum Option { + | ^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-3601.stderr b/src/test/ui/pattern/usefulness/issue-3601.stderr index 4e0adcc1ba2a..eb8c63919b64 100644 --- a/src/test/ui/pattern/usefulness/issue-3601.stderr +++ b/src/test/ui/pattern/usefulness/issue-3601.stderr @@ -11,7 +11,7 @@ LL | / pub struct Box< LL | | T: ?Sized, LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, LL | | >(Unique, A); - | |________________^ + | |_^ = note: the matched value is of type `Box` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index 3326e6b85a47..a2b66f5ed675 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -20,18 +20,14 @@ LL | match Some(Some(North)) { note: `Option>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ - | | | - | | not covered - | | not covered -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ + | | + | not covered + | not covered = note: the matched value is of type `Option>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index 88178d642919..4607cfaae171 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -7,15 +7,11 @@ LL | match private::DATA { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index 89b4e06efdac..f2362c316dfb 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -37,15 +37,11 @@ LL | match Some(10) { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr b/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr index 559539178cbe..98c75953add8 100644 --- a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr +++ b/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr @@ -7,16 +7,11 @@ LL | match UnstableEnum::Stable { note: `UnstableEnum` defined here --> $DIR/auxiliary/unstable.rs:9:5 | -LL | / pub enum UnstableEnum { -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable, -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable2, - | | ^^^^^^^ not covered -LL | | #[unstable(feature = "unstable_test_feature", issue = "none")] -LL | | Unstable, -LL | | } - | |_- +LL | pub enum UnstableEnum { + | --------------------- +... +LL | Stable2, + | ^^^^^^^ not covered = note: the matched value is of type `UnstableEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | @@ -33,14 +28,8 @@ LL | match UnstableEnum::Stable { note: `UnstableEnum` defined here --> $DIR/auxiliary/unstable.rs:5:1 | -LL | / pub enum UnstableEnum { -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable, -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -... | -LL | | Unstable, -LL | | } - | |_^ +LL | pub enum UnstableEnum { + | ^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UnstableEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr b/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr index b5f1805deef1..f07a25ca89b2 100644 --- a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr +++ b/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr @@ -7,15 +7,11 @@ LL | match UnstableEnum::Stable { note: `UnstableEnum` defined here --> $DIR/auxiliary/unstable.rs:11:5 | -LL | / pub enum UnstableEnum { -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable, -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -... | -LL | | Unstable, - | | ^^^^^^^^ not covered -LL | | } - | |_- +LL | pub enum UnstableEnum { + | --------------------- +... +LL | Unstable, + | ^^^^^^^^ not covered = note: the matched value is of type `UnstableEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/privacy/issue-30079.stderr b/src/test/ui/privacy/issue-30079.stderr index e40b19420593..dc98cfe3bb6c 100644 --- a/src/test/ui/privacy/issue-30079.stderr +++ b/src/test/ui/privacy/issue-30079.stderr @@ -12,19 +12,19 @@ error[E0446]: private type `m2::Priv` in public interface --> $DIR/issue-30079.rs:18:9 | LL | struct Priv; - | ------------ `m2::Priv` declared as private + | ----------- `m2::Priv` declared as private LL | impl ::std::ops::Deref for ::SemiPriv { LL | type Target = Priv; - | ^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^ can't leak private type error[E0446]: private type `m3::Priv` in public interface --> $DIR/issue-30079.rs:35:9 | LL | struct Priv; - | ------------ `m3::Priv` declared as private + | ----------- `m3::Priv` declared as private LL | impl ::SemiPrivTrait for () { LL | type Assoc = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error: aborting due to 2 previous errors; 1 warning emitted diff --git a/src/test/ui/privacy/privacy5.stderr b/src/test/ui/privacy/privacy5.stderr index d0c0c6b8bb59..680161272cef 100644 --- a/src/test/ui/privacy/privacy5.stderr +++ b/src/test/ui/privacy/privacy5.stderr @@ -373,7 +373,7 @@ note: the tuple struct constructor `A` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 | LL | pub struct A(()); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:91:20 @@ -390,7 +390,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:92:20 @@ -407,7 +407,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:95:16 @@ -424,7 +424,7 @@ note: the tuple struct constructor `A` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 | LL | pub struct A(()); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:96:16 @@ -441,7 +441,7 @@ note: the tuple struct constructor `A` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 | LL | pub struct A(()); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:97:22 @@ -458,7 +458,7 @@ note: the tuple struct constructor `A` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 | LL | pub struct A(()); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:98:22 @@ -475,7 +475,7 @@ note: the tuple struct constructor `A` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 | LL | pub struct A(()); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:100:16 @@ -492,7 +492,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:101:16 @@ -509,7 +509,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:102:22 @@ -526,7 +526,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:103:22 @@ -543,7 +543,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:104:22 @@ -560,7 +560,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:105:16 @@ -577,7 +577,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:107:16 @@ -594,7 +594,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:108:16 @@ -611,7 +611,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:109:16 @@ -628,7 +628,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:110:16 @@ -645,7 +645,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:111:22 @@ -662,7 +662,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:112:22 @@ -679,7 +679,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:113:22 @@ -696,7 +696,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:114:22 @@ -713,7 +713,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:122:21 @@ -730,7 +730,7 @@ note: the tuple struct constructor `A` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 | LL | pub struct A(()); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:123:21 @@ -747,7 +747,7 @@ note: the tuple struct constructor `B` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 | LL | pub struct B(isize); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:124:21 @@ -764,7 +764,7 @@ note: the tuple struct constructor `C` is defined here --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 | LL | pub struct C(pub isize, isize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error: aborting due to 48 previous errors diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.stderr index ba62a228b09f..1abeafe398f4 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.stderr +++ b/src/test/ui/privacy/private-in-public-assoc-ty.stderr @@ -2,16 +2,16 @@ error[E0446]: private type `Priv` in public interface --> $DIR/private-in-public-assoc-ty.rs:17:9 | LL | struct Priv; - | ------------ `Priv` declared as private + | ----------- `Priv` declared as private ... LL | type A = Priv; - | ^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^ can't leak private type warning: private trait `PrivTr` in public interface (error E0445) --> $DIR/private-in-public-assoc-ty.rs:24:9 | LL | type Alias1: PrivTr; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(private_in_public)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -21,7 +21,7 @@ warning: private type `Priv` in public interface (error E0446) --> $DIR/private-in-public-assoc-ty.rs:27:9 | LL | type Alias2: PubTrAux1 = u8; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -30,7 +30,7 @@ warning: private type `Priv` in public interface (error E0446) --> $DIR/private-in-public-assoc-ty.rs:30:9 | LL | type Alias3: PubTrAux2 = u8; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -39,19 +39,19 @@ error[E0446]: private type `Priv` in public interface --> $DIR/private-in-public-assoc-ty.rs:34:9 | LL | struct Priv; - | ------------ `Priv` declared as private + | ----------- `Priv` declared as private ... LL | type Alias4 = Priv; - | ^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^ can't leak private type error[E0446]: private type `Priv` in public interface --> $DIR/private-in-public-assoc-ty.rs:41:9 | LL | struct Priv; - | ------------ `Priv` declared as private + | ----------- `Priv` declared as private ... LL | type Alias1 = Priv; - | ^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^ can't leak private type error[E0445]: private trait `PrivTr` in public interface --> $DIR/private-in-public-assoc-ty.rs:44:9 @@ -60,7 +60,7 @@ LL | trait PrivTr {} | ------------ `PrivTr` declared as private ... LL | type Exist = impl PrivTr; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^ can't leak private trait error: aborting due to 4 previous errors; 3 warnings emitted diff --git a/src/test/ui/privacy/private-in-public-lint.stderr b/src/test/ui/privacy/private-in-public-lint.stderr index dd5f5b6f8f8f..1e98e3bed147 100644 --- a/src/test/ui/privacy/private-in-public-lint.stderr +++ b/src/test/ui/privacy/private-in-public-lint.stderr @@ -2,7 +2,7 @@ error[E0446]: private type `m1::Priv` in public interface --> $DIR/private-in-public-lint.rs:6:9 | LL | struct Priv; - | ------------ `m1::Priv` declared as private + | ----------- `m1::Priv` declared as private ... LL | pub fn f() -> Priv {Priv} | ^^^^^^^^^^^^^^^^^^ can't leak private type @@ -11,7 +11,7 @@ error[E0446]: private type `m2::Priv` in public interface --> $DIR/private-in-public-lint.rs:15:9 | LL | struct Priv; - | ------------ `m2::Priv` declared as private + | ----------- `m2::Priv` declared as private ... LL | pub fn f() -> Priv {Priv} | ^^^^^^^^^^^^^^^^^^ can't leak private type diff --git a/src/test/ui/privacy/private-in-public-warn.stderr b/src/test/ui/privacy/private-in-public-warn.stderr index 5f2c4935bad3..f2ff6cf2fdbc 100644 --- a/src/test/ui/privacy/private-in-public-warn.stderr +++ b/src/test/ui/privacy/private-in-public-warn.stderr @@ -2,7 +2,7 @@ error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:15:5 | LL | pub type Alias = Priv; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/private-in-public-warn.rs:5:9 @@ -34,7 +34,7 @@ error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:24:9 | LL | const C: Priv = Priv; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -43,10 +43,10 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public-warn.rs:26:9 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | type Alias = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:27:9 @@ -70,7 +70,7 @@ error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:33:9 | LL | pub static ES: Priv; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -79,7 +79,7 @@ error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:35:9 | LL | pub fn ef1(arg: Priv); - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -88,7 +88,7 @@ error: private type `types::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:37:9 | LL | pub fn ef2() -> Priv; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -97,16 +97,16 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public-warn.rs:41:9 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | type Alias = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error: private trait `traits::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:50:5 | LL | pub type Alias = T; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -115,7 +115,7 @@ error: private trait `traits::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:53:5 | LL | pub trait Tr1: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -124,7 +124,7 @@ error: private trait `traits::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:55:5 | LL | pub trait Tr2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -133,7 +133,7 @@ error: private trait `traits::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:58:9 | LL | type Alias: PrivTr; - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -151,7 +151,7 @@ error: private trait `traits::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:64:5 | LL | impl Pub {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -160,7 +160,7 @@ error: private trait `traits_where::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:74:5 | LL | pub type Alias where T: PrivTr = T; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -169,7 +169,7 @@ error: private trait `traits_where::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:78:5 | LL | pub trait Tr2 where T: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -187,7 +187,7 @@ error: private trait `traits_where::PrivTr` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:86:5 | LL | impl Pub where T: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -196,7 +196,7 @@ error: private trait `generics::PrivTr` in public interface (erro --> $DIR/private-in-public-warn.rs:98:5 | LL | pub trait Tr1: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -205,7 +205,7 @@ error: private type `generics::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:101:5 | LL | pub trait Tr2: PubTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -214,7 +214,7 @@ error: private type `generics::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:103:5 | LL | pub trait Tr3: PubTr<[Priv; 1]> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -223,7 +223,7 @@ error: private type `generics::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:105:5 | LL | pub trait Tr4: PubTr> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -232,10 +232,10 @@ error[E0446]: private type `impls::Priv` in public interface --> $DIR/private-in-public-warn.rs:132:9 | LL | struct Priv; - | ------------ `impls::Priv` declared as private + | ----------- `impls::Priv` declared as private ... LL | type Alias = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error: private type `aliases_pub::Priv` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:203:9 @@ -250,43 +250,43 @@ error[E0446]: private type `aliases_pub::Priv` in public interface --> $DIR/private-in-public-warn.rs:207:9 | LL | struct Priv; - | ------------ `aliases_pub::Priv` declared as private + | ----------- `aliases_pub::Priv` declared as private ... LL | type Check = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error[E0446]: private type `aliases_pub::Priv` in public interface --> $DIR/private-in-public-warn.rs:210:9 | LL | struct Priv; - | ------------ `aliases_pub::Priv` declared as private + | ----------- `aliases_pub::Priv` declared as private ... LL | type Check = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error[E0446]: private type `aliases_pub::Priv` in public interface --> $DIR/private-in-public-warn.rs:213:9 | LL | struct Priv; - | ------------ `aliases_pub::Priv` declared as private + | ----------- `aliases_pub::Priv` declared as private ... LL | type Check = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error[E0446]: private type `aliases_pub::Priv` in public interface --> $DIR/private-in-public-warn.rs:216:9 | LL | struct Priv; - | ------------ `aliases_pub::Priv` declared as private + | ----------- `aliases_pub::Priv` declared as private ... LL | type Check = Priv; - | ^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^ can't leak private type error: private trait `PrivTr1` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:246:5 | LL | pub trait Tr1: PrivUseAliasTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -295,7 +295,7 @@ error: private trait `PrivTr1` in public interface (error E0445) --> $DIR/private-in-public-warn.rs:249:5 | LL | pub trait Tr2: PrivUseAliasTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -304,7 +304,7 @@ error: private type `Priv2` in public interface (error E0446) --> $DIR/private-in-public-warn.rs:249:5 | LL | pub trait Tr2: PrivUseAliasTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 diff --git a/src/test/ui/privacy/private-in-public.stderr b/src/test/ui/privacy/private-in-public.stderr index e8bb2cde4be8..887eebf53efa 100644 --- a/src/test/ui/privacy/private-in-public.stderr +++ b/src/test/ui/privacy/private-in-public.stderr @@ -2,25 +2,25 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:13:5 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub const C: Priv = Priv; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^^^^^^ can't leak private type error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:14:5 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub static S: Priv = Priv; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^^^^^^^ can't leak private type error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:15:5 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub fn f1(arg: Priv) {} | ^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -29,7 +29,7 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:16:5 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub fn f2() -> Priv { panic!() } | ^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -38,7 +38,7 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:17:19 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub struct S1(pub Priv); | ^^^^^^^^ can't leak private type @@ -47,7 +47,7 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:18:21 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub struct S2 { pub field: Priv } | ^^^^^^^^^^^^^^^ can't leak private type @@ -56,16 +56,16 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:20:9 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub const C: Priv = Priv; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^^^^^^ can't leak private type error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:21:9 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub fn f1(arg: Priv) {} | ^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -74,7 +74,7 @@ error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public.rs:22:9 | LL | struct Priv; - | ------------ `types::Priv` declared as private + | ----------- `types::Priv` declared as private ... LL | pub fn f2() -> Priv { panic!() } | ^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -86,7 +86,7 @@ LL | trait PrivTr {} | ------------ `traits::PrivTr` declared as private ... LL | pub enum E { V(T) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `traits::PrivTr` in public interface --> $DIR/private-in-public.rs:32:5 @@ -104,18 +104,16 @@ LL | trait PrivTr {} | ------------ `traits::PrivTr` declared as private ... LL | pub struct S1(T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `traits::PrivTr` in public interface --> $DIR/private-in-public.rs:34:5 | -LL | trait PrivTr {} - | ------------ `traits::PrivTr` declared as private +LL | trait PrivTr {} + | ------------ `traits::PrivTr` declared as private ... -LL | / impl Pub { -LL | | pub fn f(arg: U) {} -LL | | } - | |_____^ can't leak private trait +LL | impl Pub { + | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `traits::PrivTr` in public interface --> $DIR/private-in-public.rs:35:9 @@ -133,7 +131,7 @@ LL | trait PrivTr {} | ------------ `traits_where::PrivTr` declared as private ... LL | pub enum E where T: PrivTr { V(T) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `traits_where::PrivTr` in public interface --> $DIR/private-in-public.rs:46:5 @@ -151,20 +149,16 @@ LL | trait PrivTr {} | ------------ `traits_where::PrivTr` declared as private ... LL | pub struct S1(T) where T: PrivTr; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + | ^^^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `traits_where::PrivTr` in public interface --> $DIR/private-in-public.rs:50:5 | -LL | trait PrivTr {} - | ------------ `traits_where::PrivTr` declared as private +LL | trait PrivTr {} + | ------------ `traits_where::PrivTr` declared as private ... -LL | / impl Pub where T: PrivTr { -LL | | -LL | | pub fn f(arg: U) where U: PrivTr {} -LL | | -LL | | } - | |_____^ can't leak private trait +LL | impl Pub where T: PrivTr { + | ^^^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `traits_where::PrivTr` in public interface --> $DIR/private-in-public.rs:52:9 @@ -179,7 +173,7 @@ error[E0446]: private type `generics::Priv` in public interface --> $DIR/private-in-public.rs:63:5 | LL | struct Priv(T); - | ----------------------- `generics::Priv` declared as private + | ------------------- `generics::Priv` declared as private ... LL | pub fn f1(arg: [Priv; 1]) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -188,7 +182,7 @@ error[E0446]: private type `generics::Priv` in public interface --> $DIR/private-in-public.rs:64:5 | LL | struct Priv(T); - | ----------------------- `generics::Priv` declared as private + | ------------------- `generics::Priv` declared as private ... LL | pub fn f2(arg: Pub) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -197,7 +191,7 @@ error[E0446]: private type `generics::Priv` in public interface --> $DIR/private-in-public.rs:65:5 | LL | struct Priv(T); - | ----------------------- `generics::Priv` declared as private + | ------------------- `generics::Priv` declared as private ... LL | pub fn f3(arg: Priv) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -206,7 +200,7 @@ error[E0446]: private type `impls::Priv` in public interface --> $DIR/private-in-public.rs:80:9 | LL | struct Priv; - | ------------ `impls::Priv` declared as private + | ----------- `impls::Priv` declared as private ... LL | pub fn f(arg: Priv) {} | ^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -224,7 +218,7 @@ error[E0446]: private type `aliases_pub::Priv` in public interface --> $DIR/private-in-public.rs:104:5 | LL | struct Priv; - | ------------ `aliases_pub::Priv` declared as private + | ----------- `aliases_pub::Priv` declared as private ... LL | pub fn f3(arg: ::Assoc) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -233,7 +227,7 @@ error[E0446]: private type `aliases_pub::Priv` in public interface --> $DIR/private-in-public.rs:109:9 | LL | struct Priv; - | ------------ `aliases_pub::Priv` declared as private + | ----------- `aliases_pub::Priv` declared as private ... LL | pub fn f(arg: Priv) {} | ^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -242,7 +236,7 @@ error[E0446]: private type `Priv1` in public interface --> $DIR/private-in-public.rs:131:5 | LL | struct Priv1; - | ------------- `Priv1` declared as private + | ------------ `Priv1` declared as private ... LL | pub fn f1(arg: PrivUseAlias) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -251,7 +245,7 @@ error[E0446]: private type `Priv2` in public interface --> $DIR/private-in-public.rs:132:5 | LL | struct Priv2; - | ------------- `Priv2` declared as private + | ------------ `Priv2` declared as private ... LL | pub fn f2(arg: PrivAlias) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -269,7 +263,7 @@ error[E0446]: private type `aliases_priv::Priv` in public interface --> $DIR/private-in-public.rs:133:5 | LL | struct Priv; - | ------------ `aliases_priv::Priv` declared as private + | ----------- `aliases_priv::Priv` declared as private ... LL | pub fn f3(arg: ::Assoc) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -278,7 +272,7 @@ error[E0446]: private type `aliases_params::Priv` in public interface --> $DIR/private-in-public.rs:143:5 | LL | struct Priv; - | ------------ `aliases_params::Priv` declared as private + | ----------- `aliases_params::Priv` declared as private ... LL | pub fn f2(arg: PrivAliasGeneric) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -287,7 +281,7 @@ error[E0446]: private type `aliases_params::Priv` in public interface --> $DIR/private-in-public.rs:145:5 | LL | struct Priv; - | ------------ `aliases_params::Priv` declared as private + | ----------- `aliases_params::Priv` declared as private ... LL | pub fn f3(arg: Result) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr index e7e968839b6f..aecd8b58c831 100644 --- a/src/test/ui/privacy/private-inferred-type.stderr +++ b/src/test/ui/privacy/private-inferred-type.stderr @@ -2,19 +2,19 @@ error[E0446]: private type `Priv` in public interface --> $DIR/private-inferred-type.rs:61:36 | LL | struct Priv; - | ------------ `Priv` declared as private + | ----------- `Priv` declared as private ... LL | impl TraitWithAssocTy for u8 { type AssocTy = Priv; } - | ^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^ can't leak private type error[E0446]: private type `S2` in public interface --> $DIR/private-inferred-type.rs:83:9 | LL | struct S2; - | ---------- `S2` declared as private + | --------- `S2` declared as private ... LL | type Target = S2Alias; - | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^ can't leak private type error: type `Priv` is private --> $DIR/private-inferred-type.rs:97:9 diff --git a/src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr b/src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr index f64b8569015d..e62a440d8f56 100644 --- a/src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr +++ b/src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr @@ -20,7 +20,7 @@ error: trait `OtherTrait` from private dependency 'priv_dep' in public interface --> $DIR/pub-priv1.rs:35:5 | LL | type Foo: OtherTrait; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/privacy/restricted/private-in-public.stderr b/src/test/ui/privacy/restricted/private-in-public.stderr index ee9c031ebff2..65d996f0f070 100644 --- a/src/test/ui/privacy/restricted/private-in-public.stderr +++ b/src/test/ui/privacy/restricted/private-in-public.stderr @@ -2,7 +2,7 @@ error[E0446]: private type `Priv` in public interface --> $DIR/private-in-public.rs:6:9 | LL | struct Priv; - | ------------ `Priv` declared as private + | ----------- `Priv` declared as private ... LL | pub(crate) fn g(_: Priv) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type @@ -11,7 +11,7 @@ error[E0446]: private type `Priv` in public interface --> $DIR/private-in-public.rs:7:9 | LL | struct Priv; - | ------------ `Priv` declared as private + | ----------- `Priv` declared as private ... LL | pub(crate) fn h(_: Priv) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index c81520c35cd4..1acd221b42c5 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -34,7 +34,7 @@ note: the struct `Crate` is defined here --> $DIR/auxiliary/pub_restricted.rs:1:1 | LL | pub(crate) struct Crate; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: function `f` is private --> $DIR/test.rs:30:19 diff --git a/src/test/ui/privacy/where-priv-type.stderr b/src/test/ui/privacy/where-priv-type.stderr index 378c14810d92..7eb71346ae9c 100644 --- a/src/test/ui/privacy/where-priv-type.stderr +++ b/src/test/ui/privacy/where-priv-type.stderr @@ -1,13 +1,8 @@ warning: private type `PrivTy` in public interface (error E0446) --> $DIR/where-priv-type.rs:19:1 | -LL | / pub struct S -LL | | -LL | | -LL | | where -LL | | PrivTy: -LL | | {} - | |__^ +LL | pub struct S + | ^^^^^^^^^^^^ | = note: `#[warn(private_in_public)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -16,13 +11,8 @@ LL | | {} warning: private type `PrivTy` in public interface (error E0446) --> $DIR/where-priv-type.rs:27:1 | -LL | / pub enum E -LL | | -LL | | -LL | | where -LL | | PrivTy: -LL | | {} - | |__^ +LL | pub enum E + | ^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #34537 @@ -43,17 +33,11 @@ LL | | PrivTy: error[E0446]: private type `PrivTy` in public interface --> $DIR/where-priv-type.rs:43:1 | -LL | struct PrivTy; - | -------------- `PrivTy` declared as private +LL | struct PrivTy; + | ------------- `PrivTy` declared as private ... -LL | / impl S -LL | | -LL | | where -LL | | PrivTy: -... | -LL | | {} -LL | | } - | |_^ can't leak private type +LL | impl S + | ^^^^^^ can't leak private type warning: private type `PrivTy` in public interface (error E0446) --> $DIR/where-priv-type.rs:48:5 @@ -72,7 +56,7 @@ error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface --> $DIR/where-priv-type.rs:80:5 | LL | type AssocTy = Const<{ my_const_fn(U) }>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^ can't leak private type ... LL | const fn my_const_fn(val: u8) -> u8 { | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private diff --git a/src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr b/src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr index 9ce7b9a139f5..a433cebbbc09 100644 --- a/src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr +++ b/src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr @@ -1,28 +1,20 @@ error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:19:1 | -LL | trait PrivTr {} - | ------------ `PrivTr` declared as private +LL | trait PrivTr {} + | ------------ `PrivTr` declared as private ... -LL | / pub struct S -LL | | -LL | | where -LL | | PubTy: PrivTr -LL | | {} - | |__^ can't leak private trait +LL | pub struct S + | ^^^^^^^^^^^^ can't leak private trait error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:26:1 | -LL | trait PrivTr {} - | ------------ `PrivTr` declared as private +LL | trait PrivTr {} + | ------------ `PrivTr` declared as private ... -LL | / pub enum E -LL | | -LL | | where -LL | | PubTy: PrivTr -LL | | {} - | |__^ can't leak private trait +LL | pub enum E + | ^^^^^^^^^^ can't leak private trait error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:33:1 @@ -39,17 +31,11 @@ LL | | PubTy: PrivTr error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:40:1 | -LL | trait PrivTr {} - | ------------ `PrivTr` declared as private +LL | trait PrivTr {} + | ------------ `PrivTr` declared as private ... -LL | / impl S -LL | | -LL | | where -LL | | PubTy: PrivTr -... | -LL | | {} -LL | | } - | |_^ can't leak private trait +LL | impl S + | ^^^^^^ can't leak private trait error[E0445]: private trait `PrivTr` in public interface --> $DIR/where-pub-type-impls-priv-trait.rs:45:5 diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index e518c6ab8003..a534b9d5377a 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -76,7 +76,7 @@ LL | #[derive(Dlone)] ::: $SRC_DIR/core/src/clone.rs:LL:COL | LL | pub macro Clone($item:item) { - | --------------------------- similarly named derive macro `Clone` defined here + | --------------- similarly named derive macro `Clone` defined here error: cannot find derive macro `Dlone` in this scope --> $DIR/resolve-error.rs:35:10 @@ -87,7 +87,7 @@ LL | #[derive(Dlone)] ::: $SRC_DIR/core/src/clone.rs:LL:COL | LL | pub macro Clone($item:item) { - | --------------------------- similarly named derive macro `Clone` defined here + | --------------- similarly named derive macro `Clone` defined here error: cannot find attribute `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:32:3 diff --git a/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr b/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr index 29d45858ff15..39d4f5ac8d3c 100644 --- a/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr +++ b/src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr @@ -2,28 +2,28 @@ error[E0446]: private type `Snail` in public interface --> $DIR/issue-33174-restricted-type-in-public-interface.rs:18:1 | LL | pub(crate) struct Snail; - | ------------------------ `Snail` declared as private + | ----------------------- `Snail` declared as private ... LL | pub type Helix_pomatia = Shell; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type error[E0446]: crate-private type `Turtle` in public interface --> $DIR/issue-33174-restricted-type-in-public-interface.rs:21:1 | LL | pub(super) struct Turtle; - | ------------------------- `Turtle` declared as crate-private + | ------------------------ `Turtle` declared as crate-private ... LL | pub type Dermochelys_coriacea = Shell; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type error[E0446]: private type `Tortoise` in public interface --> $DIR/issue-33174-restricted-type-in-public-interface.rs:24:1 | LL | struct Tortoise; - | ---------------- `Tortoise` declared as private + | --------------- `Tortoise` declared as private ... LL | pub type Testudo_graeca = Shell; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type error: aborting due to 3 previous errors diff --git a/src/test/ui/recursion/recursive-static-definition.stderr b/src/test/ui/recursion/recursive-static-definition.stderr index d4d2c8c3d9cc..1359761457a6 100644 --- a/src/test/ui/recursion/recursive-static-definition.stderr +++ b/src/test/ui/recursion/recursive-static-definition.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO` --> $DIR/recursive-static-definition.rs:1:1 | LL | pub static FOO: u32 = FOO; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `FOO`... --> $DIR/recursive-static-definition.rs:1:23 diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr index a9159562d9d5..acbd0d05984f 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -9,15 +9,11 @@ LL | let Ok(x) = res; note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[lang = "Ok"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | | ^^^ not covered -LL | | } - | |_- +LL | pub enum Result { + | --------------------- +... +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | ^^^ not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/repr/repr-packed-contains-align.stderr b/src/test/ui/repr/repr-packed-contains-align.stderr index 32f9bb8bf33d..531004e8e202 100644 --- a/src/test/ui/repr/repr-packed-contains-align.stderr +++ b/src/test/ui/repr/repr-packed-contains-align.stderr @@ -2,25 +2,25 @@ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:19:1 | LL | struct SC(SA); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^ | note: `SA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:5:1 | LL | struct SA(i32); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:22:1 | LL | struct SD(SB); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^ | note: `SA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:5:1 | LL | struct SA(i32); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^ note: `SD` contains a field of type `SB` --> $DIR/repr-packed-contains-align.rs:22:11 | @@ -36,29 +36,25 @@ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:25:1 | LL | struct SE(UA); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^ | note: `UA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:10:1 | -LL | / union UA { -LL | | i: i32 -LL | | } - | |_^ +LL | union UA { + | ^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:28:1 | LL | struct SF(UB); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^ | note: `UA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:10:1 | -LL | / union UA { -LL | | i: i32 -LL | | } - | |_^ +LL | union UA { + | ^^^^^^^^ note: `SF` contains a field of type `UB` --> $DIR/repr-packed-contains-align.rs:28:11 | @@ -73,34 +69,26 @@ LL | a: UA error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:31:1 | -LL | / union UC { -LL | | a: UA -LL | | } - | |_^ +LL | union UC { + | ^^^^^^^^ | note: `UA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:10:1 | -LL | / union UA { -LL | | i: i32 -LL | | } - | |_^ +LL | union UA { + | ^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:36:1 | -LL | / union UD { -LL | | n: UB -LL | | } - | |_^ +LL | union UD { + | ^^^^^^^^ | note: `UA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:10:1 | -LL | / union UA { -LL | | i: i32 -LL | | } - | |_^ +LL | union UA { + | ^^^^^^^^ note: `UD` contains a field of type `UB` --> $DIR/repr-packed-contains-align.rs:37:5 | @@ -115,30 +103,26 @@ LL | a: UA error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:41:1 | -LL | / union UE { -LL | | a: SA -LL | | } - | |_^ +LL | union UE { + | ^^^^^^^^ | note: `SA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:5:1 | LL | struct SA(i32); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/repr-packed-contains-align.rs:46:1 | -LL | / union UF { -LL | | n: SB -LL | | } - | |_^ +LL | union UF { + | ^^^^^^^^ | note: `SA` has a `#[repr(align)]` attribute --> $DIR/repr-packed-contains-align.rs:5:1 | LL | struct SA(i32); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^ note: `UF` contains a field of type `SB` --> $DIR/repr-packed-contains-align.rs:47:5 | diff --git a/src/test/ui/repr/repr-transparent-issue-87496.stderr b/src/test/ui/repr/repr-transparent-issue-87496.stderr index c488755cc242..3dc13b1c13c9 100644 --- a/src/test/ui/repr/repr-transparent-issue-87496.stderr +++ b/src/test/ui/repr/repr-transparent-issue-87496.stderr @@ -10,7 +10,7 @@ note: the type is defined here --> $DIR/repr-transparent-issue-87496.rs:6:1 | LL | struct TransparentCustomZst(()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: 1 warning emitted diff --git a/src/test/ui/repr/repr-transparent.stderr b/src/test/ui/repr/repr-transparent.stderr index 001a181881f1..6ff3641bc15d 100644 --- a/src/test/ui/repr/repr-transparent.stderr +++ b/src/test/ui/repr/repr-transparent.stderr @@ -2,9 +2,8 @@ error[E0690]: transparent struct needs at most one non-zero-sized field, but has --> $DIR/repr-transparent.rs:26:1 | LL | struct MultipleNonZst(u8, u8); - | ^^^^^^^^^^^^^^^^^^^^^^--^^--^^ - | | | | - | | | this field is non-zero-sized + | ^^^^^^^^^^^^^^^^^^^^^ -- -- this field is non-zero-sized + | | | | | this field is non-zero-sized | needs at most one non-zero-sized field, but has 2 @@ -12,9 +11,8 @@ error[E0690]: transparent struct needs at most one non-zero-sized field, but has --> $DIR/repr-transparent.rs:32:1 | LL | pub struct StructWithProjection(f32, ::It); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^-------------------^^ - | | | | - | | | this field is non-zero-sized + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- ------------------- this field is non-zero-sized + | | | | | this field is non-zero-sized | needs at most one non-zero-sized field, but has 2 diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr index 0dcf0184db10..f839bd424322 100644 --- a/src/test/ui/resolve/issue-23305.stderr +++ b/src/test/ui/resolve/issue-23305.stderr @@ -1,10 +1,10 @@ -error[E0391]: cycle detected when computing type of `` +error[E0391]: cycle detected when computing type of `` --> $DIR/issue-23305.rs:5:16 | LL | impl dyn ToNbt {} | ^^^^ | - = note: ...which immediately requires computing type of `` again + = note: ...which immediately requires computing type of `` again note: cycle used when collecting item types in top-level module --> $DIR/issue-23305.rs:1:1 | diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr index ada053014ef5..17a666a401ce 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ b/src/test/ui/resolve/privacy-struct-ctor.stderr @@ -114,7 +114,7 @@ note: the tuple struct constructor `S` is defined here --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5 | LL | pub struct S(u8); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0603]: tuple struct constructor `Z` is private --> $DIR/privacy-struct-ctor.rs:45:19 @@ -131,7 +131,7 @@ note: the tuple struct constructor `Z` is defined here --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9 | LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 10 previous errors diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr index 7f623e47353b..aa99c1a33352 100644 --- a/src/test/ui/resolve/resolve-self-in-impl.stderr +++ b/src/test/ui/resolve/resolve-self-in-impl.stderr @@ -1,10 +1,10 @@ -error[E0391]: cycle detected when computing type of `` +error[E0391]: cycle detected when computing type of `` --> $DIR/resolve-self-in-impl.rs:14:13 | LL | impl Tr for Self {} | ^^^^ | - = note: ...which immediately requires computing type of `` again + = note: ...which immediately requires computing type of `` again note: cycle used when collecting item types in top-level module --> $DIR/resolve-self-in-impl.rs:1:1 | @@ -17,13 +17,13 @@ LL | | LL | | fn main() {} | |____________^ -error[E0391]: cycle detected when computing type of `` +error[E0391]: cycle detected when computing type of `` --> $DIR/resolve-self-in-impl.rs:15:15 | LL | impl Tr for S {} | ^^^^ | - = note: ...which immediately requires computing type of `` again + = note: ...which immediately requires computing type of `` again note: cycle used when collecting item types in top-level module --> $DIR/resolve-self-in-impl.rs:1:1 | @@ -36,13 +36,13 @@ LL | | LL | | fn main() {} | |____________^ -error[E0391]: cycle detected when computing type of `` +error[E0391]: cycle detected when computing type of `` --> $DIR/resolve-self-in-impl.rs:16:6 | LL | impl Self {} | ^^^^ | - = note: ...which immediately requires computing type of `` again + = note: ...which immediately requires computing type of `` again note: cycle used when collecting item types in top-level module --> $DIR/resolve-self-in-impl.rs:1:1 | @@ -55,13 +55,13 @@ LL | | LL | | fn main() {} | |____________^ -error[E0391]: cycle detected when computing type of `` +error[E0391]: cycle detected when computing type of `` --> $DIR/resolve-self-in-impl.rs:17:8 | LL | impl S {} | ^^^^ | - = note: ...which immediately requires computing type of `` again + = note: ...which immediately requires computing type of `` again note: cycle used when collecting item types in top-level module --> $DIR/resolve-self-in-impl.rs:1:1 | @@ -74,13 +74,13 @@ LL | | LL | | fn main() {} | |____________^ -error[E0391]: cycle detected when computing trait implemented by `` +error[E0391]: cycle detected when computing trait implemented by `` --> $DIR/resolve-self-in-impl.rs:18:1 | LL | impl Tr for S {} | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: ...which immediately requires computing trait implemented by `` again + = note: ...which immediately requires computing trait implemented by `` again note: cycle used when collecting item types in top-level module --> $DIR/resolve-self-in-impl.rs:1:1 | diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.stderr b/src/test/ui/rfc-2005-default-binding-mode/const.stderr index 10d30ec1a1b1..0f567125432b 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/const.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const.rs:14:9 | LL | const FOO: Foo = Foo{bar: 5}; - | ----------------------------- constant defined here + | -------------- constant defined here ... LL | match &f { | -- this expression has type `&Foo` diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum.stderr b/src/test/ui/rfc-2008-non-exhaustive/enum.stderr index 5ef078c20057..872cb9b8bc68 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/enum.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/enum.stderr @@ -8,7 +8,7 @@ note: `EmptyNonExhaustiveEnum` defined here --> $DIR/auxiliary/enums.rs:18:1 | LL | pub enum EmptyNonExhaustiveEnum {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `EmptyNonExhaustiveEnum`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -26,12 +26,8 @@ LL | match enum_unit { note: `NonExhaustiveEnum` defined here --> $DIR/auxiliary/enums.rs:4:1 | -LL | / pub enum NonExhaustiveEnum { -LL | | Unit, -LL | | Tuple(u32), -LL | | Struct { field: u32 }, -LL | | } - | |_^ +LL | pub enum NonExhaustiveEnum { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -48,12 +44,8 @@ LL | match enum_unit {}; note: `NonExhaustiveEnum` defined here --> $DIR/auxiliary/enums.rs:4:1 | -LL | / pub enum NonExhaustiveEnum { -LL | | Unit, -LL | | Tuple(u32), -LL | | Struct { field: u32 }, -LL | | } - | |_^ +LL | pub enum NonExhaustiveEnum { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr index 272b2ef6ee1d..2b34d0711793 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr @@ -25,7 +25,7 @@ note: the tuple struct constructor `TupleStruct` is defined here --> $DIR/auxiliary/structs.rs:12:1 | LL | pub struct TupleStruct(pub u16, pub u16); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: unit struct `UnitStruct` is private --> $DIR/struct.rs:32:32 @@ -37,7 +37,7 @@ note: the unit struct `UnitStruct` is defined here --> $DIR/auxiliary/structs.rs:9:1 | LL | pub struct UnitStruct; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error[E0639]: cannot create non-exhaustive struct using struct expression --> $DIR/struct.rs:7:14 diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr index 2dc4eabb8630..66e93291c72a 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr @@ -8,7 +8,7 @@ note: `IndirectUninhabitedEnum` defined here --> $DIR/auxiliary/uninhabited.rs:26:1 | LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -27,7 +27,7 @@ note: `IndirectUninhabitedStruct` defined here --> $DIR/auxiliary/uninhabited.rs:28:1 | LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -46,7 +46,7 @@ note: `IndirectUninhabitedTupleStruct` defined here --> $DIR/auxiliary/uninhabited.rs:30:1 | LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedTupleStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -65,7 +65,7 @@ note: `IndirectUninhabitedVariants` defined here --> $DIR/auxiliary/uninhabited.rs:32:1 | LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedVariants` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr index f0cb13de3f79..ef97c1fa17f3 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr @@ -8,7 +8,7 @@ note: `IndirectUninhabitedEnum` defined here --> $DIR/auxiliary/uninhabited.rs:26:1 | LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -27,7 +27,7 @@ note: `IndirectUninhabitedStruct` defined here --> $DIR/auxiliary/uninhabited.rs:28:1 | LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -46,7 +46,7 @@ note: `IndirectUninhabitedTupleStruct` defined here --> $DIR/auxiliary/uninhabited.rs:30:1 | LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedTupleStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -65,7 +65,7 @@ note: `IndirectUninhabitedVariants` defined here --> $DIR/auxiliary/uninhabited.rs:32:1 | LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `IndirectUninhabitedVariants` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr index 49febd9241dc..32a5c07f1968 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr @@ -7,9 +7,8 @@ LL | match x {} note: `UninhabitedEnum` defined here --> $DIR/auxiliary/uninhabited.rs:5:1 | -LL | / pub enum UninhabitedEnum { -LL | | } - | |_^ +LL | pub enum UninhabitedEnum { + | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -27,10 +26,8 @@ LL | match x {} note: `UninhabitedStruct` defined here --> $DIR/auxiliary/uninhabited.rs:9:1 | -LL | / pub struct UninhabitedStruct { -LL | | _priv: !, -LL | | } - | |_^ +LL | pub struct UninhabitedStruct { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UninhabitedStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -49,7 +46,7 @@ note: `UninhabitedTupleStruct` defined here --> $DIR/auxiliary/uninhabited.rs:14:1 | LL | pub struct UninhabitedTupleStruct(!); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UninhabitedTupleStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -67,13 +64,12 @@ LL | match x {} note: `UninhabitedVariants` defined here --> $DIR/auxiliary/uninhabited.rs:17:23 | -LL | / pub enum UninhabitedVariants { -LL | | #[non_exhaustive] Tuple(!), - | | ^^^^^ not covered -LL | | #[non_exhaustive] Struct { x: ! } - | | ^^^^^^ not covered -LL | | } - | |_- +LL | pub enum UninhabitedVariants { + | ---------------------------- +LL | #[non_exhaustive] Tuple(!), + | ^^^^^ not covered +LL | #[non_exhaustive] Struct { x: ! } + | ^^^^^^ not covered = note: the matched value is of type `UninhabitedVariants` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr index e18c2678d323..d854ea28ff68 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr @@ -7,9 +7,8 @@ LL | match x {} note: `UninhabitedEnum` defined here --> $DIR/auxiliary/uninhabited.rs:5:1 | -LL | / pub enum UninhabitedEnum { -LL | | } - | |_^ +LL | pub enum UninhabitedEnum { + | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -27,10 +26,8 @@ LL | match x {} note: `UninhabitedStruct` defined here --> $DIR/auxiliary/uninhabited.rs:9:1 | -LL | / pub struct UninhabitedStruct { -LL | | _priv: !, -LL | | } - | |_^ +LL | pub struct UninhabitedStruct { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UninhabitedStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -49,7 +46,7 @@ note: `UninhabitedTupleStruct` defined here --> $DIR/auxiliary/uninhabited.rs:14:1 | LL | pub struct UninhabitedTupleStruct(!); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UninhabitedTupleStruct` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | @@ -67,13 +64,12 @@ LL | match x {} note: `UninhabitedVariants` defined here --> $DIR/auxiliary/uninhabited.rs:17:23 | -LL | / pub enum UninhabitedVariants { -LL | | #[non_exhaustive] Tuple(!), - | | ^^^^^ not covered -LL | | #[non_exhaustive] Struct { x: ! } - | | ^^^^^^ not covered -LL | | } - | |_- +LL | pub enum UninhabitedVariants { + | ---------------------------- +LL | #[non_exhaustive] Tuple(!), + | ^^^^^ not covered +LL | #[non_exhaustive] Struct { x: ! } + | ^^^^^^ not covered = note: the matched value is of type `UninhabitedVariants` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr index 1da8e648251a..76300cce55cd 100644 --- a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/cross-crate.rs:4:1 | -LL | / struct Foo<'a, T> { -LL | | bar: std::slice::IterMut<'a, T> -LL | | } - | |_^ +LL | struct Foo<'a, T> { + | ^^^^^^^^^^^^^^^^^ | = note: T: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.stderr b/src/test/ui/rfc-2093-infer-outlives/enum.stderr index 868ca2c4587d..b6ce2450e22a 100644 --- a/src/test/ui/rfc-2093-infer-outlives/enum.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/enum.stderr @@ -1,30 +1,24 @@ error: rustc_outlives --> $DIR/enum.rs:7:1 | -LL | / enum Foo<'a, T> { -LL | | One(Bar<'a, T>) -LL | | } - | |_^ +LL | enum Foo<'a, T> { + | ^^^^^^^^^^^^^^^ | = note: T: 'a error: rustc_outlives --> $DIR/enum.rs:13:1 | -LL | / struct Bar<'b, U> { -LL | | field2: &'b U -LL | | } - | |_^ +LL | struct Bar<'b, U> { + | ^^^^^^^^^^^^^^^^^ | = note: U: 'b error: rustc_outlives --> $DIR/enum.rs:19:1 | -LL | / enum Ying<'c, K> { -LL | | One(&'c Yang) -LL | | } - | |_^ +LL | enum Ying<'c, K> { + | ^^^^^^^^^^^^^^^^ | = note: K: 'c diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr index 4608962c7c3f..595a5c28088d 100644 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr @@ -1,11 +1,8 @@ error: rustc_outlives --> $DIR/explicit-dyn.rs:7:1 | -LL | / struct Foo<'a, A> -LL | | { -LL | | foo: Box> -LL | | } - | |_^ +LL | struct Foo<'a, A> + | ^^^^^^^^^^^^^^^^^ | = note: A: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr index 062f5d5e9a73..3059f95aefbd 100644 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/explicit-enum.rs:4:1 | -LL | / enum Foo<'a, U> { -LL | | One(Bar<'a, U>) -LL | | } - | |_^ +LL | enum Foo<'a, U> { + | ^^^^^^^^^^^^^^^ | = note: U: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr index a85aa3d7565b..589e95899132 100644 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr @@ -1,11 +1,8 @@ error: rustc_outlives --> $DIR/explicit-projection.rs:8:1 | -LL | / struct Foo<'a, A, B> where A: Trait<'a, B> -LL | | { -LL | | foo: >::Type -LL | | } - | |_^ +LL | struct Foo<'a, A, B> where A: Trait<'a, B> + | ^^^^^^^^^^^^^^^^^^^^ | = note: B: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr index 309c54bb4493..9912e36b29c1 100644 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/explicit-struct.rs:4:1 | -LL | / struct Foo<'b, U> { -LL | | bar: Bar<'b, U> -LL | | } - | |_^ +LL | struct Foo<'b, U> { + | ^^^^^^^^^^^^^^^^^ | = note: U: 'b diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr index 47c283faf507..2c6d06aa8c7f 100644 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/explicit-union.rs:5:1 | -LL | / union Foo<'b, U: Copy> { -LL | | bar: Bar<'b, U> -LL | | } - | |_^ +LL | union Foo<'b, U: Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^ | = note: U: 'b diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr index 10387f51b1e4..4350e6e8beec 100644 --- a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr @@ -1,11 +1,8 @@ error: rustc_outlives --> $DIR/nested-enum.rs:4:1 | -LL | / enum Foo<'a, T> { -LL | | -LL | | One(Bar<'a, T>) -LL | | } - | |_^ +LL | enum Foo<'a, T> { + | ^^^^^^^^^^^^^^^ | = note: T: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr index ffdd5542bb4b..c08add7edede 100644 --- a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/nested-regions.rs:4:1 | -LL | / struct Foo<'a, 'b, T> { -LL | | x: &'a &'b T -LL | | } - | |_^ +LL | struct Foo<'a, 'b, T> { + | ^^^^^^^^^^^^^^^^^^^^^ | = note: 'b: 'a = note: T: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr index 86bcbe640e4b..769555234437 100644 --- a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/nested-structs.rs:4:1 | -LL | / struct Foo<'a, T> { -LL | | field1: Bar<'a, T> -LL | | } - | |_^ +LL | struct Foo<'a, T> { + | ^^^^^^^^^^^^^^^^^ | = note: T: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr index e0f248fa38a0..0116a2a68ceb 100644 --- a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/nested-union.rs:5:1 | -LL | / union Foo<'a, T: Copy> { -LL | | field1: Bar<'a, T> -LL | | } - | |_^ +LL | union Foo<'a, T: Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^ | = note: T: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/projection.stderr b/src/test/ui/rfc-2093-infer-outlives/projection.stderr index 840676e79667..d9342013f554 100644 --- a/src/test/ui/rfc-2093-infer-outlives/projection.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/projection.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/projection.rs:4:1 | -LL | / struct Foo<'a, T: Iterator> { -LL | | bar: &'a T::Item -LL | | } - | |_^ +LL | struct Foo<'a, T: Iterator> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ::Item: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/reference.stderr b/src/test/ui/rfc-2093-infer-outlives/reference.stderr index d69aaf6f849f..508114357817 100644 --- a/src/test/ui/rfc-2093-infer-outlives/reference.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/reference.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/reference.rs:4:1 | -LL | / struct Foo<'a, T> { -LL | | bar: &'a T, -LL | | } - | |_^ +LL | struct Foo<'a, T> { + | ^^^^^^^^^^^^^^^^^ | = note: T: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr index 7836b3f5aabe..9c836b190cff 100644 --- a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr @@ -1,11 +1,8 @@ error: rustc_outlives --> $DIR/self-dyn.rs:8:1 | -LL | / struct Foo<'a, 'b, A> -LL | | { -LL | | foo: Box> -LL | | } - | |_^ +LL | struct Foo<'a, 'b, A> + | ^^^^^^^^^^^^^^^^^^^^^ | = note: A: 'a diff --git a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr index b972ad844660..2b4625f77a5e 100644 --- a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr @@ -1,10 +1,8 @@ error: rustc_outlives --> $DIR/self-structs.rs:4:1 | -LL | / struct Foo<'a, 'b, T> { -LL | | field1: dyn Bar<'a, 'b, T> -LL | | } - | |_^ +LL | struct Foo<'a, 'b, T> { + | ^^^^^^^^^^^^^^^^^^^^^ | = note: T: 'a diff --git a/src/test/ui/simd/type-len.stderr b/src/test/ui/simd/type-len.stderr index f122d8bb0dc6..2a6bd1b0fd58 100644 --- a/src/test/ui/simd/type-len.stderr +++ b/src/test/ui/simd/type-len.stderr @@ -2,37 +2,37 @@ error[E0075]: SIMD vector cannot be empty --> $DIR/type-len.rs:6:1 | LL | struct empty; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0075]: SIMD vector cannot be empty --> $DIR/type-len.rs:9:1 | LL | struct empty2([f32; 0]); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error[E0076]: SIMD vector should be homogeneous --> $DIR/type-len.rs:15:1 | LL | struct i64f64(i64, f64); - | ^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type + | ^^^^^^^^^^^^^ SIMD elements must have the same type error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type --> $DIR/type-len.rs:20:1 | LL | struct FooV(Foo, Foo); - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type --> $DIR/type-len.rs:23:1 | LL | struct FooV2([Foo; 2]); - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ error[E0075]: SIMD vector cannot have more than 32768 elements --> $DIR/type-len.rs:26:1 | LL | struct TooBig([f32; 65536]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/span/impl-wrong-item-for-trait.stderr b/src/test/ui/span/impl-wrong-item-for-trait.stderr index 82ef13f3362d..f919092f9ee9 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.stderr +++ b/src/test/ui/span/impl-wrong-item-for-trait.stderr @@ -38,7 +38,7 @@ error[E0046]: not all trait items implemented, missing: `MY_CONST` --> $DIR/impl-wrong-item-for-trait.rs:19:1 | LL | const MY_CONST: u32; - | -------------------- `MY_CONST` from trait + | ------------------- `MY_CONST` from trait ... LL | impl Foo for FooMethodForConst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `MY_CONST` in implementation diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index e0cfe04cf418..eea94643e0a0 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -29,14 +29,8 @@ LL | enum World { note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Add { -LL | | /// The resulting type after applying the `+` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn add(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Add { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot add `String` to `&str` --> $DIR/issue-39018.rs:11:22 diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr index acfc60b51f33..79b13f45fd8e 100644 --- a/src/test/ui/span/multiline-span-E0072.stderr +++ b/src/test/ui/span/multiline-span-E0072.stderr @@ -3,12 +3,10 @@ error[E0072]: recursive type `ListNode` has infinite size | LL | / struct LL | | ListNode -LL | | { -LL | | head: u8, -LL | | tail: Option, - | | ---------------- recursive without indirection -LL | | } - | |_^ recursive type has infinite size + | |________^ recursive type has infinite size +... +LL | tail: Option, + | ---------------- recursive without indirection | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable | diff --git a/src/test/ui/span/transitive-dep-span.stderr b/src/test/ui/span/transitive-dep-span.stderr index 2b3dfc5c1353..4dc3e5721160 100644 --- a/src/test/ui/span/transitive-dep-span.stderr +++ b/src/test/ui/span/transitive-dep-span.stderr @@ -1,19 +1,18 @@ error: expected one of `!` or `::`, found `error` --> $DIR/auxiliary/transitive_dep_three.rs:6:27 | -LL | / macro_rules! parse_error { -LL | | () => { parse error } - | | ^^^^^ expected one of `!` or `::` -LL | | } - | |_________- in this expansion of `transitive_dep_two::parse_error!` +LL | macro_rules! parse_error { + | ------------------------ in this expansion of `transitive_dep_two::parse_error!` +LL | () => { parse error } + | ^^^^^ expected one of `!` or `::` | ::: $DIR/transitive-dep-span.rs:13:1 | -LL | transitive_dep_two::parse_error!(); - | ---------------------------------- - | | - | in this macro invocation - | in this macro invocation +LL | transitive_dep_two::parse_error!(); + | ---------------------------------- + | | + | in this macro invocation + | in this macro invocation error: aborting due to previous error diff --git a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr index 3f1a5495e212..360b7bc787a2 100644 --- a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr +++ b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr @@ -11,67 +11,55 @@ LL | #![feature(specialization)] error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:20:5 | -LL | / impl Foo for T { -LL | | fn foo(&self) {} -LL | | fn bar(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Foo for T { + | ----------------- parent `impl` is here ... -LL | fn foo(&self) {} - | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo` +LL | fn foo(&self) {} + | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | = note: to specialize, `foo` in the parent `impl` must be marked `default` error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:23:5 | -LL | / impl Foo for T { -LL | | fn foo(&self) {} -LL | | fn bar(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Foo for T { + | ----------------- parent `impl` is here ... -LL | fn bar(&self) {} - | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar` +LL | fn bar(&self) {} + | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar` | = note: to specialize, `bar` in the parent `impl` must be marked `default` error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:37:5 | -LL | / impl Bar for T { -LL | | type T = u8; -LL | | } - | |_- parent `impl` is here +LL | impl Bar for T { + | ----------------- parent `impl` is here ... -LL | type T = (); - | ^^^^^^^^^^^^ cannot specialize default item `T` +LL | type T = (); + | ^^^^^^^^^^^^ cannot specialize default item `T` | = note: to specialize, `T` in the parent `impl` must be marked `default` error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:55:5 | -LL | / impl Baz for T { -LL | | fn baz(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Baz for T { + | ------------------------ parent `impl` is here ... -LL | fn baz(&self) {} - | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz` +LL | fn baz(&self) {} + | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz` | = note: to specialize, `baz` in the parent `impl` must be marked `default` error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:74:5 | -LL | / impl Redundant for T { -LL | | fn redundant(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Redundant for T { + | ------------------------------ parent `impl` is here ... -LL | fn redundant(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant` +LL | fn redundant(&self) {} + | ^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant` | = note: to specialize, `redundant` in the parent `impl` must be marked `default` diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr index d2350bc7e4f9..53a22305e816 100644 --- a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr +++ b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr @@ -12,7 +12,7 @@ error[E0599]: the method `foo_one` exists for struct `MyStruct`, but its trait b --> $DIR/specialization-trait-not-implemented.rs:22:29 | LL | struct MyStruct; - | ---------------- + | --------------- | | | | | method `foo_one` not found for this struct | doesn't satisfy `MyStruct: Foo` @@ -21,18 +21,17 @@ LL | println!("{}", MyStruct.foo_one()); | ^^^^^^^ method cannot be called on `MyStruct` due to unsatisfied trait bounds | note: trait bound `MyStruct: Foo` was not satisfied - --> $DIR/specialization-trait-not-implemented.rs:14:17 + --> $DIR/specialization-trait-not-implemented.rs:14:1 | LL | default impl Foo for T { - | ^^^ ^ + | ^^^^^^^^^^^^^^^^---^^^^^- + | | + | unsatisfied trait bound introduced here note: the following trait must be implemented --> $DIR/specialization-trait-not-implemented.rs:7:1 | -LL | / trait Foo { -LL | | fn foo_one(&self) -> &'static str; -LL | | fn foo_two(&self) -> &'static str; -LL | | } - | |_^ +LL | trait Foo { + | ^^^^^^^^^ = help: items from traits can only be used if the trait is implemented and in scope note: `Foo` defines an item `foo_one`, perhaps you need to implement it --> $DIR/specialization-trait-not-implemented.rs:7:1 diff --git a/src/test/ui/specialization/issue-50452-fail.stderr b/src/test/ui/specialization/issue-50452-fail.stderr index 8e7c5037eff8..7249ad73871c 100644 --- a/src/test/ui/specialization/issue-50452-fail.stderr +++ b/src/test/ui/specialization/issue-50452-fail.stderr @@ -11,13 +11,11 @@ LL | #![feature(specialization)] error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/issue-50452-fail.rs:10:5 | -LL | fn foo() {} - | ^^^^^^^^^^^ cannot specialize default item `foo` +LL | fn foo() {} + | ^^^^^^^^^^^ cannot specialize default item `foo` ... -LL | / impl Foo for T { -LL | | fn foo() {} -LL | | } - | |_- parent `impl` is here +LL | impl Foo for T { + | ----------------- parent `impl` is here | = note: to specialize, `foo` in the parent `impl` must be marked `default` diff --git a/src/test/ui/specialization/issue-52050.stderr b/src/test/ui/specialization/issue-52050.stderr index 8732b10d8f80..6d24997a5bf5 100644 --- a/src/test/ui/specialization/issue-52050.stderr +++ b/src/test/ui/specialization/issue-52050.stderr @@ -11,15 +11,11 @@ LL | #![feature(specialization)] error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()` --> $DIR/issue-52050.rs:28:1 | -LL | / impl IntoPyDictPointer for I -LL | | where -LL | | I: Iterator, -LL | | { -LL | | } - | |_- first implementation here -LL | -LL | impl IntoPyDictPointer for () - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()` +LL | impl IntoPyDictPointer for I + | ------------------------------- first implementation here +... +LL | impl IntoPyDictPointer for () + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()` | = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions diff --git a/src/test/ui/specialization/min_specialization/dyn-trait-assoc-types.stderr b/src/test/ui/specialization/min_specialization/dyn-trait-assoc-types.stderr index 6345cee2c378..db5558f16be0 100644 --- a/src/test/ui/specialization/min_specialization/dyn-trait-assoc-types.stderr +++ b/src/test/ui/specialization/min_specialization/dyn-trait-assoc-types.stderr @@ -1,20 +1,14 @@ error: specializing impl repeats parameter `T` --> $DIR/dyn-trait-assoc-types.rs:22:1 | -LL | / impl<'a, T> Specializable for dyn B + 'a { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl<'a, T> Specializable for dyn B + 'a { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: specializing impl repeats parameter `T` --> $DIR/dyn-trait-assoc-types.rs:27:1 | -LL | / impl<'a, T> Specializable for dyn C + 'a { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl<'a, T> Specializable for dyn C + 'a { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr b/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr index 1a7eb82c95b3..450984aacc78 100644 --- a/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr +++ b/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr @@ -1,11 +1,8 @@ error: cannot specialize on `Binder(ProjectionPredicate(ProjectionTy { substs: [V], item_def_id: DefId(0:6 ~ repeated_projection_type[54ea]::Id::This) }, Ty((I,))), [])` --> $DIR/repeated_projection_type.rs:19:1 | -LL | / impl> X for V { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl> X for V { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/min_specialization/repeating_lifetimes.stderr b/src/test/ui/specialization/min_specialization/repeating_lifetimes.stderr index ce9309f70122..16dccb10b453 100644 --- a/src/test/ui/specialization/min_specialization/repeating_lifetimes.stderr +++ b/src/test/ui/specialization/min_specialization/repeating_lifetimes.stderr @@ -1,11 +1,8 @@ error: specializing impl repeats parameter `'a` --> $DIR/repeating_lifetimes.rs:14:1 | -LL | / impl<'a> X for (&'a u8, &'a u8) { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl<'a> X for (&'a u8, &'a u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/min_specialization/repeating_param.stderr b/src/test/ui/specialization/min_specialization/repeating_param.stderr index 8b4be1c49953..5e6adf723b54 100644 --- a/src/test/ui/specialization/min_specialization/repeating_param.stderr +++ b/src/test/ui/specialization/min_specialization/repeating_param.stderr @@ -1,11 +1,8 @@ error: specializing impl repeats parameter `T` --> $DIR/repeating_param.rs:12:1 | -LL | / impl X for (T, T) { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl X for (T, T) { + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/min_specialization/spec-marker-supertraits.stderr b/src/test/ui/specialization/min_specialization/spec-marker-supertraits.stderr index 964109dd10f4..b1ab58551e68 100644 --- a/src/test/ui/specialization/min_specialization/spec-marker-supertraits.stderr +++ b/src/test/ui/specialization/min_specialization/spec-marker-supertraits.stderr @@ -1,13 +1,8 @@ error: cannot specialize on trait `HasMethod` --> $DIR/spec-marker-supertraits.rs:22:1 | -LL | / impl Spec for T { -LL | | -LL | | fn spec_me(&self) { -LL | | self.method(); -LL | | } -LL | | } - | |_^ +LL | impl Spec for T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/min_specialization/specialization_marker.stderr b/src/test/ui/specialization/min_specialization/specialization_marker.stderr index ffeced198211..b47c14f3c9fd 100644 --- a/src/test/ui/specialization/min_specialization/specialization_marker.stderr +++ b/src/test/ui/specialization/min_specialization/specialization_marker.stderr @@ -8,7 +8,7 @@ error[E0714]: marker traits cannot have associated items --> $DIR/specialization_marker.rs:13:5 | LL | type X; - | ^^^^^^^ + | ^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/specialization/min_specialization/specialization_super_trait.stderr b/src/test/ui/specialization/min_specialization/specialization_super_trait.stderr index 5782ad01b39f..1f2ff99d4156 100644 --- a/src/test/ui/specialization/min_specialization/specialization_super_trait.stderr +++ b/src/test/ui/specialization/min_specialization/specialization_super_trait.stderr @@ -1,11 +1,8 @@ error: cannot specialize on trait `Default` --> $DIR/specialization_super_trait.rs:13:1 | -LL | / impl SpecMarker for T { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl SpecMarker for T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/min_specialization/specialization_trait.stderr b/src/test/ui/specialization/min_specialization/specialization_trait.stderr index 8a70d6cc1bf2..ecb07ba908eb 100644 --- a/src/test/ui/specialization/min_specialization/specialization_trait.stderr +++ b/src/test/ui/specialization/min_specialization/specialization_trait.stderr @@ -1,29 +1,20 @@ error: cannot specialize on `'static` lifetime --> $DIR/specialization_trait.rs:11:1 | -LL | / impl SpecMarker for &'static u8 { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl SpecMarker for &'static u8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: specializing impl repeats parameter `T` --> $DIR/specialization_trait.rs:16:1 | -LL | / impl SpecMarker for (T, T) { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl SpecMarker for (T, T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: cannot specialize on trait `Clone` --> $DIR/specialization_trait.rs:21:1 | -LL | / impl SpecMarker for [T] { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl SpecMarker for [T] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/specialization/min_specialization/specialize_on_static.stderr b/src/test/ui/specialization/min_specialization/specialize_on_static.stderr index d1809d6dfbb5..9a16798f15cd 100644 --- a/src/test/ui/specialization/min_specialization/specialize_on_static.stderr +++ b/src/test/ui/specialization/min_specialization/specialize_on_static.stderr @@ -1,11 +1,8 @@ error: cannot specialize on `'static` lifetime --> $DIR/specialize_on_static.rs:13:1 | -LL | / impl X for &'static u8 { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl X for &'static u8 { + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/min_specialization/specialize_on_trait.stderr b/src/test/ui/specialization/min_specialization/specialize_on_trait.stderr index 35445fd09b94..92daddbd8008 100644 --- a/src/test/ui/specialization/min_specialization/specialize_on_trait.stderr +++ b/src/test/ui/specialization/min_specialization/specialize_on_trait.stderr @@ -1,11 +1,8 @@ error: cannot specialize on trait `SpecMarker` --> $DIR/specialize_on_trait.rs:15:1 | -LL | / impl X for T { -LL | | -LL | | fn f() {} -LL | | } - | |_^ +LL | impl X for T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/non-defaulted-item-fail.stderr b/src/test/ui/specialization/non-defaulted-item-fail.stderr index 85ccbd809b02..8b7d6797275b 100644 --- a/src/test/ui/specialization/non-defaulted-item-fail.stderr +++ b/src/test/ui/specialization/non-defaulted-item-fail.stderr @@ -11,45 +11,33 @@ LL | #![feature(specialization, associated_type_defaults)] error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/non-defaulted-item-fail.rs:30:5 | -LL | / impl Foo for Box { -LL | | type Ty = bool; -LL | | const CONST: u8 = 0; -LL | | fn foo(&self) -> bool { false } -LL | | } - | |_- parent `impl` is here +LL | impl Foo for Box { + | ---------------------- parent `impl` is here ... -LL | type Ty = Vec<()>; - | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty` +LL | type Ty = Vec<()>; + | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty` | = note: to specialize, `Ty` in the parent `impl` must be marked `default` error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/non-defaulted-item-fail.rs:32:5 | -LL | / impl Foo for Box { -LL | | type Ty = bool; -LL | | const CONST: u8 = 0; -LL | | fn foo(&self) -> bool { false } -LL | | } - | |_- parent `impl` is here +LL | impl Foo for Box { + | ---------------------- parent `impl` is here ... -LL | const CONST: u8 = 42; - | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST` +LL | const CONST: u8 = 42; + | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST` | = note: to specialize, `CONST` in the parent `impl` must be marked `default` error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/non-defaulted-item-fail.rs:34:5 | -LL | / impl Foo for Box { -LL | | type Ty = bool; -LL | | const CONST: u8 = 0; -LL | | fn foo(&self) -> bool { false } -LL | | } - | |_- parent `impl` is here +LL | impl Foo for Box { + | ---------------------- parent `impl` is here ... -LL | fn foo(&self) -> bool { true } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` +LL | fn foo(&self) -> bool { true } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | = note: to specialize, `foo` in the parent `impl` must be marked `default` @@ -57,7 +45,7 @@ error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is no --> $DIR/non-defaulted-item-fail.rs:46:5 | LL | impl Foo for Vec {} - | ------------------------- parent `impl` is here + | ---------------------- parent `impl` is here ... LL | type Ty = Vec<()>; | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty` @@ -68,7 +56,7 @@ error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is --> $DIR/non-defaulted-item-fail.rs:48:5 | LL | impl Foo for Vec {} - | ------------------------- parent `impl` is here + | ---------------------- parent `impl` is here ... LL | const CONST: u8 = 42; | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST` @@ -79,7 +67,7 @@ error[E0520]: `foo` specializes an item from a parent `impl`, but that item is n --> $DIR/non-defaulted-item-fail.rs:50:5 | LL | impl Foo for Vec {} - | ------------------------- parent `impl` is here + | ---------------------- parent `impl` is here ... LL | fn foo(&self) -> bool { true } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` diff --git a/src/test/ui/specialization/specialization-no-default.stderr b/src/test/ui/specialization/specialization-no-default.stderr index 711c1fda1499..28c869a70559 100644 --- a/src/test/ui/specialization/specialization-no-default.stderr +++ b/src/test/ui/specialization/specialization-no-default.stderr @@ -11,67 +11,55 @@ LL | #![feature(specialization)] error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:20:5 | -LL | / impl Foo for T { -LL | | fn foo(&self) {} -LL | | fn bar(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Foo for T { + | ----------------- parent `impl` is here ... -LL | fn foo(&self) {} - | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo` +LL | fn foo(&self) {} + | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | = note: to specialize, `foo` in the parent `impl` must be marked `default` error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:23:5 | -LL | / impl Foo for T { -LL | | fn foo(&self) {} -LL | | fn bar(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Foo for T { + | ----------------- parent `impl` is here ... -LL | fn bar(&self) {} - | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar` +LL | fn bar(&self) {} + | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar` | = note: to specialize, `bar` in the parent `impl` must be marked `default` error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:37:5 | -LL | / impl Bar for T { -LL | | type T = u8; -LL | | } - | |_- parent `impl` is here +LL | impl Bar for T { + | ----------------- parent `impl` is here ... -LL | type T = (); - | ^^^^^^^^^^^^ cannot specialize default item `T` +LL | type T = (); + | ^^^^^^^^^^^^ cannot specialize default item `T` | = note: to specialize, `T` in the parent `impl` must be marked `default` error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:55:5 | -LL | / impl Baz for T { -LL | | fn baz(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Baz for T { + | ------------------------ parent `impl` is here ... -LL | fn baz(&self) {} - | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz` +LL | fn baz(&self) {} + | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz` | = note: to specialize, `baz` in the parent `impl` must be marked `default` error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/specialization-no-default.rs:74:5 | -LL | / impl Redundant for T { -LL | | fn redundant(&self) {} -LL | | } - | |_- parent `impl` is here +LL | impl Redundant for T { + | ------------------------------ parent `impl` is here ... -LL | default fn redundant(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant` +LL | default fn redundant(&self) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant` | = note: to specialize, `redundant` in the parent `impl` must be marked `default` diff --git a/src/test/ui/static/static-priv-by-default2.stderr b/src/test/ui/static/static-priv-by-default2.stderr index d731da79246e..b14e096d62a0 100644 --- a/src/test/ui/static/static-priv-by-default2.stderr +++ b/src/test/ui/static/static-priv-by-default2.stderr @@ -20,7 +20,7 @@ note: the static `private` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:3:1 | LL | static private: isize = 0; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/statics/uninhabited-static.stderr b/src/test/ui/statics/uninhabited-static.stderr index 855e5dca92a7..10b86bb49869 100644 --- a/src/test/ui/statics/uninhabited-static.stderr +++ b/src/test/ui/statics/uninhabited-static.stderr @@ -27,7 +27,7 @@ error: static of uninhabited type --> $DIR/uninhabited-static.rs:12:1 | LL | static VOID2: Void = unsafe { std::mem::transmute(()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #74840 @@ -37,7 +37,7 @@ error: static of uninhabited type --> $DIR/uninhabited-static.rs:16:1 | LL | static NEVER2: Void = unsafe { std::mem::transmute(()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #74840 diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index d6163a5a7cfe..54122cb7360b 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -19,7 +19,7 @@ LL | #[tests] ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL | LL | pub macro test($item:item) { - | -------------------------- similarly named attribute macro `test` defined here + | -------------- similarly named attribute macro `test` defined here error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 diff --git a/src/test/ui/suggestions/const-in-struct-pat.stderr b/src/test/ui/suggestions/const-in-struct-pat.stderr index 784f1bdb6cf3..c8b93f3dc48f 100644 --- a/src/test/ui/suggestions/const-in-struct-pat.stderr +++ b/src/test/ui/suggestions/const-in-struct-pat.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-in-struct-pat.rs:8:17 | LL | struct foo; - | ----------- unit struct defined here + | ---------- unit struct defined here ... LL | let Thing { foo } = t; | ^^^ - this expression has type `Thing` diff --git a/src/test/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr b/src/test/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr index af64c09d5cad..618bcaca14c4 100644 --- a/src/test/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr +++ b/src/test/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr @@ -8,7 +8,7 @@ LL | let A = 3; | help: introduce a variable instead: `a_var` ... LL | const A: i32 = 2; - | ----------------- constant defined here + | ------------ constant defined here | = note: the matched value is of type `i32` diff --git a/src/test/ui/suggestions/derive-trait-for-method-call.stderr b/src/test/ui/suggestions/derive-trait-for-method-call.stderr index 65167ce4a29e..0ec57fabdad6 100644 --- a/src/test/ui/suggestions/derive-trait-for-method-call.stderr +++ b/src/test/ui/suggestions/derive-trait-for-method-call.stderr @@ -23,14 +23,8 @@ LL | let y = x.test(); note: the following trait must be implemented --> $SRC_DIR/core/src/default.rs:LL:COL | -LL | / pub trait Default: Sized { -LL | | /// Returns the "default value" for a type. -LL | | /// -LL | | /// Default values are often some kind of initial value, identity value, or anything else that -... | -LL | | fn default() -> Self; -LL | | } - | |_^ +LL | pub trait Default: Sized { + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider annotating `Enum` with `#[derive(Clone)]` | LL | #[derive(Clone)] @@ -79,7 +73,7 @@ LL | let y = x.test(); ::: $SRC_DIR/std/src/time.rs:LL:COL | LL | pub struct Instant(time::Instant); - | ---------------------------------- doesn't satisfy `Instant: Default` + | ------------------ doesn't satisfy `Instant: Default` | ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 25ce458f6d81..505ed2ad7b37 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -40,7 +40,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:30:16 | LL | struct S(usize, usize); - | ----------------------- fn(usize, usize) -> S {S} defined here + | -------- fn(usize, usize) -> S {S} defined here ... LL | let _: S = S; | - ^ expected struct `S`, found fn item @@ -76,7 +76,7 @@ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:32:16 | LL | struct V(); - | ----------- fn() -> V {V} defined here + | -------- fn() -> V {V} defined here ... LL | let _: V = V; | - ^ expected struct `V`, found fn item diff --git a/src/test/ui/suggestions/invalid-bin-op.stderr b/src/test/ui/suggestions/invalid-bin-op.stderr index 94bd2d415658..08502dfeb2d5 100644 --- a/src/test/ui/suggestions/invalid-bin-op.stderr +++ b/src/test/ui/suggestions/invalid-bin-op.stderr @@ -10,7 +10,7 @@ note: an implementation of `PartialEq<_>` might be missing for `S` --> $DIR/invalid-bin-op.rs:5:1 | LL | struct S(T); - | ^^^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^ must implement `PartialEq<_>` help: consider annotating `S` with `#[derive(PartialEq)]` | LL | #[derive(PartialEq)] diff --git a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr b/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr index ee29a56f3f8c..4c75fbe4c786 100644 --- a/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr +++ b/src/test/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr @@ -2,7 +2,7 @@ error[E0046]: not all trait items implemented, missing: `Type`, `bar`, `baz` --> $DIR/missing-assoc-fn-applicable-suggestions.rs:15:1 | LL | type Type; - | ---------- `Type` from trait + | --------- `Type` from trait LL | fn bar(_: T) -> Self; | ------------------------ `bar` from trait LL | fn baz(_: T) -> Self where T: TraitB, ::Item: Copy; diff --git a/src/test/ui/suggestions/suggest-trait-items.stderr b/src/test/ui/suggestions/suggest-trait-items.stderr index 4abc34466106..8bc3df7b817e 100644 --- a/src/test/ui/suggestions/suggest-trait-items.stderr +++ b/src/test/ui/suggestions/suggest-trait-items.stderr @@ -47,7 +47,7 @@ error[E0046]: not all trait items implemented, missing: `Type`, `foo`, `bar`, `q --> $DIR/suggest-trait-items.rs:11:1 | LL | type Type; - | ---------- `Type` from trait + | --------- `Type` from trait LL | LL | fn foo(); | --------- `foo` from trait @@ -63,7 +63,7 @@ error[E0046]: not all trait items implemented, missing: `Const` --> $DIR/suggest-trait-items.rs:40:1 | LL | const Const: i32; - | ----------------- `Const` from trait + | ---------------- `Const` from trait ... LL | impl Bar for B { | ^^^^^^^^^^^^^^ missing `Const` in implementation diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr index 5409e32c436f..7038a572bec0 100644 --- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr +++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr @@ -18,10 +18,10 @@ error[E0191]: the value of the associated types `A` (from trait `T`), `C` (from --> $DIR/use-type-argument-instead-of-assoc-type.rs:7:16 | LL | type A; - | ------- `A` defined here + | ------ `A` defined here LL | type B; LL | type C; - | ------- `C` defined here + | ------ `C` defined here ... LL | i: Box>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated types `A`, `C` must be specified diff --git a/src/test/ui/traits/alias/only-maybe-bound.stderr b/src/test/ui/traits/alias/only-maybe-bound.stderr index 06c707e4332a..175ec8120ecc 100644 --- a/src/test/ui/traits/alias/only-maybe-bound.stderr +++ b/src/test/ui/traits/alias/only-maybe-bound.stderr @@ -2,7 +2,7 @@ error[E0224]: at least one trait is required for an object type --> $DIR/only-maybe-bound.rs:13:12 | LL | trait _1 = _0; - | -------------- this alias does not contain a trait + | -------- this alias does not contain a trait ... LL | type _T0 = dyn _1; | ^^^^^^ @@ -11,7 +11,7 @@ error[E0224]: at least one trait is required for an object type --> $DIR/only-maybe-bound.rs:19:12 | LL | trait _2 = _1 + _1; - | ------------------- this alias does not contain a trait + | -------- this alias does not contain a trait LL | LL | type _T1 = dyn _2; | ^^^^^^ diff --git a/src/test/ui/traits/bound/same-crate-name.stderr b/src/test/ui/traits/bound/same-crate-name.stderr index ef39a70066db..f66cad77fcd1 100644 --- a/src/test/ui/traits/bound/same-crate-name.stderr +++ b/src/test/ui/traits/bound/same-crate-name.stderr @@ -10,7 +10,7 @@ help: trait impl with same name found --> $DIR/auxiliary/crate_a2.rs:5:1 | LL | impl Bar for Foo {} - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate `crate_a2` are being used? = help: the trait `main::a::Bar` is implemented for `ImplementsTraitForUsize` note: required by a bound in `try_foo` @@ -46,7 +46,7 @@ help: trait impl with same name found --> $DIR/auxiliary/crate_a2.rs:13:1 | LL | impl Bar for ImplementsWrongTraitConditionally {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate `crate_a2` are being used? = help: the trait `main::a::Bar` is implemented for `ImplementsTraitForUsize` note: required by a bound in `try_foo` diff --git a/src/test/ui/traits/copy-impl-cannot-normalize.stderr b/src/test/ui/traits/copy-impl-cannot-normalize.stderr index cc540ea905a1..afdad160919f 100644 --- a/src/test/ui/traits/copy-impl-cannot-normalize.stderr +++ b/src/test/ui/traits/copy-impl-cannot-normalize.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: TraitFoo` is not satisfied --> $DIR/copy-impl-cannot-normalize.rs:22:1 | LL | impl Copy for Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitFoo` is not implemented for `T` + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitFoo` is not implemented for `T` | help: consider restricting type parameter `T` | diff --git a/src/test/ui/traits/issue-33140-hack-boundaries.stderr b/src/test/ui/traits/issue-33140-hack-boundaries.stderr index c87f1ff1f3f1..62cfca545b26 100644 --- a/src/test/ui/traits/issue-33140-hack-boundaries.stderr +++ b/src/test/ui/traits/issue-33140-hack-boundaries.stderr @@ -60,7 +60,7 @@ error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std:: LL | impl Trait5 for dyn Send {} | ------------------------ first implementation here LL | impl Trait5 for dyn Send where u32: Copy {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` error: aborting due to 8 previous errors diff --git a/src/test/ui/traits/issue-65673.stderr b/src/test/ui/traits/issue-65673.stderr index 71f3a0e7c7ca..8f01d7c53e77 100644 --- a/src/test/ui/traits/issue-65673.stderr +++ b/src/test/ui/traits/issue-65673.stderr @@ -2,7 +2,7 @@ error[E0224]: at least one trait is required for an object type --> $DIR/issue-65673.rs:9:16 | LL | trait Alias = where T: Trait; - | -------------------------------- this alias does not contain a trait + | -------------- this alias does not contain a trait ... LL | type Ctx = dyn Alias; | ^^^^^^^^^^^^ diff --git a/src/test/ui/traits/issue-71036.stderr b/src/test/ui/traits/issue-71036.stderr index db1f69466608..3ee6db40e873 100644 --- a/src/test/ui/traits/issue-71036.stderr +++ b/src/test/ui/traits/issue-71036.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `&'a T: Unsize<&'a U>` is not satisfied --> $DIR/issue-71036.rs:11:1 | LL | impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn> for Foo<'a, T> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unsize<&'a U>` is not implemented for `&'a T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unsize<&'a U>` is not implemented for `&'a T` | = note: all implementations of `Unsize` are provided automatically by the compiler, see for more information = note: required because of the requirements on the impl of `DispatchFromDyn<&'a &'a U>` for `&'a &'a T` diff --git a/src/test/ui/traits/issue-78372.stderr b/src/test/ui/traits/issue-78372.stderr index 7574c9107d9a..7e781016e1f0 100644 --- a/src/test/ui/traits/issue-78372.stderr +++ b/src/test/ui/traits/issue-78372.stderr @@ -54,7 +54,7 @@ error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion --> $DIR/issue-78372.rs:3:1 | LL | impl DispatchFromDyn> for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/traits/item-privacy.stderr b/src/test/ui/traits/item-privacy.stderr index a7954f7b2459..06ed5ac081dc 100644 --- a/src/test/ui/traits/item-privacy.stderr +++ b/src/test/ui/traits/item-privacy.stderr @@ -116,7 +116,7 @@ error[E0624]: associated constant `A` is private --> $DIR/item-privacy.rs:101:14 | LL | const A: u8 = 0; - | ---------------- private associated constant defined here + | ----------- private associated constant defined here ... LL | ::A; | ^ private associated constant diff --git a/src/test/ui/traits/object/with-self-in-projection-output-bad.stderr b/src/test/ui/traits/object/with-self-in-projection-output-bad.stderr index 45978a84068d..641bfe236660 100644 --- a/src/test/ui/traits/object/with-self-in-projection-output-bad.stderr +++ b/src/test/ui/traits/object/with-self-in-projection-output-bad.stderr @@ -2,7 +2,7 @@ error[E0191]: the value of the associated type `Output` (from trait `Base`) must --> $DIR/with-self-in-projection-output-bad.rs:45:21 | LL | type Output; - | ------------ `Output` defined here + | ----------- `Output` defined here ... LL | let _x: Box> = Box::new(2u32); | ^^^^^^^^^^^^^^^^^^ help: specify the associated type: `Helper` @@ -11,7 +11,7 @@ error[E0191]: the value of the associated type `Output` (from trait `Base`) must --> $DIR/with-self-in-projection-output-bad.rs:48:21 | LL | type Output; - | ------------ `Output` defined here + | ----------- `Output` defined here ... LL | let _y: Box> = Box::new(2u32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated type: `NormalizableHelper` diff --git a/src/test/ui/traits/vtable/vtable-diamond.stderr b/src/test/ui/traits/vtable/vtable-diamond.stderr index f71bed84d562..f3718c5d852f 100644 --- a/src/test/ui/traits/vtable/vtable-diamond.stderr +++ b/src/test/ui/traits/vtable/vtable-diamond.stderr @@ -10,11 +10,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-diamond.rs:21:1 | -LL | / trait D: B + C { -LL | | -LL | | fn foo_d(&self) {} -LL | | } - | |_^ +LL | trait D: B + C { + | ^^^^^^^^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -25,11 +22,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-diamond.rs:15:1 | -LL | / trait C: A { -LL | | -LL | | fn foo_c(&self) {} -LL | | } - | |_^ +LL | trait C: A { + | ^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/vtable/vtable-multi-level.stderr b/src/test/ui/traits/vtable/vtable-multi-level.stderr index 915fd701b033..d4d7a8fa3a47 100644 --- a/src/test/ui/traits/vtable/vtable-multi-level.stderr +++ b/src/test/ui/traits/vtable/vtable-multi-level.stderr @@ -31,11 +31,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:95:1 | -LL | / trait O: G + N { -LL | | -LL | | fn foo_o(&self) {} -LL | | } - | |_^ +LL | trait O: G + N { + | ^^^^^^^^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -45,11 +42,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:19:1 | -LL | / trait B { -LL | | -LL | | fn foo_b(&self) {} -LL | | } - | |_^ +LL | trait B { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -59,11 +53,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:30:1 | -LL | / trait D { -LL | | -LL | | fn foo_d(&self) {} -LL | | } - | |_^ +LL | trait D { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -73,11 +64,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:36:1 | -LL | / trait E { -LL | | -LL | | fn foo_e(&self) {} -LL | | } - | |_^ +LL | trait E { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -90,11 +78,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:42:1 | -LL | / trait F: D + E { -LL | | -LL | | fn foo_f(&self) {} -LL | | } - | |_^ +LL | trait F: D + E { + | ^^^^^^^^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -104,11 +89,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:53:1 | -LL | / trait H { -LL | | -LL | | fn foo_h(&self) {} -LL | | } - | |_^ +LL | trait H { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -118,11 +100,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:59:1 | -LL | / trait I { -LL | | -LL | | fn foo_i(&self) {} -LL | | } - | |_^ +LL | trait I { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -135,11 +114,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:65:1 | -LL | / trait J: H + I { -LL | | -LL | | fn foo_j(&self) {} -LL | | } - | |_^ +LL | trait J: H + I { + | ^^^^^^^^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -149,11 +125,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:71:1 | -LL | / trait K { -LL | | -LL | | fn foo_k(&self) {} -LL | | } - | |_^ +LL | trait K { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -163,11 +136,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:77:1 | -LL | / trait L { -LL | | -LL | | fn foo_l(&self) {} -LL | | } - | |_^ +LL | trait L { + | ^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -180,11 +150,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:83:1 | -LL | / trait M: K + L { -LL | | -LL | | fn foo_m(&self) {} -LL | | } - | |_^ +LL | trait M: K + L { + | ^^^^^^^^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -204,11 +171,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multi-level.rs:89:1 | -LL | / trait N: J + M { -LL | | -LL | | fn foo_n(&self) {} -LL | | } - | |_^ +LL | trait N: J + M { + | ^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/src/test/ui/traits/vtable/vtable-multiple.stderr b/src/test/ui/traits/vtable/vtable-multiple.stderr index f1c8947f9069..0dcd84433090 100644 --- a/src/test/ui/traits/vtable/vtable-multiple.stderr +++ b/src/test/ui/traits/vtable/vtable-multiple.stderr @@ -9,11 +9,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multiple.rs:16:1 | -LL | / trait C: A + B { -LL | | -LL | | fn foo_c(&self) {} -LL | | } - | |_^ +LL | trait C: A + B { + | ^^^^^^^^^^^^^^ error: vtable entries for ``: [ MetadataDropInPlace, @@ -23,11 +20,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-multiple.rs:10:1 | -LL | / trait B { -LL | | -LL | | fn foo_b(&self) {} -LL | | } - | |_^ +LL | trait B { + | ^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/vtable/vtable-non-object-safe.stderr b/src/test/ui/traits/vtable/vtable-non-object-safe.stderr index bbfbde222f33..9345c2711978 100644 --- a/src/test/ui/traits/vtable/vtable-non-object-safe.stderr +++ b/src/test/ui/traits/vtable/vtable-non-object-safe.stderr @@ -10,7 +10,7 @@ error: vtable entries for ` as A>`: [ --> $DIR/vtable-non-object-safe.rs:8:1 | LL | trait A: Iterator {} - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/traits/vtable/vtable-vacant.stderr b/src/test/ui/traits/vtable/vtable-vacant.stderr index c8cf58399723..5346a7027163 100644 --- a/src/test/ui/traits/vtable/vtable-vacant.stderr +++ b/src/test/ui/traits/vtable/vtable-vacant.stderr @@ -9,12 +9,8 @@ error: vtable entries for ``: [ ] --> $DIR/vtable-vacant.rs:15:1 | -LL | / trait B: A { -LL | | -LL | | fn foo_b1(&self) {} -LL | | fn foo_b2(&self) where Self: Send {} -LL | | } - | |_^ +LL | trait B: A { + | ^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr index f007f71a73c4..aaa3159e0b04 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr @@ -16,7 +16,7 @@ note: `V` could also refer to the associated type defined here --> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:26:5 | LL | type V; - | ^^^^^^^ + | ^^^^^^ error: ambiguous associated item --> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:32:15 @@ -35,7 +35,7 @@ note: `V` could also refer to the associated type defined here --> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:26:5 | LL | type V; - | ^^^^^^^ + | ^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr b/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr index f4a0cdb1625b..6745b8ef69cc 100644 --- a/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr @@ -8,7 +8,7 @@ note: ...which requires type-checking `CONST_BUG`... --> $DIR/issue-53092-2.rs:6:1 | LL | const CONST_BUG: Bug = unsafe { std::mem::transmute(|_: u8| ()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires computing layout of `Bug`... = note: ...which requires normalizing `Bug`... = note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index ebce257b278b..a8139063db1d 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -32,18 +32,12 @@ note: an implementation of `std::ops::Neg` might be missing for `Z` --> $DIR/type-ascription-precedence.rs:9:1 | LL | struct Z; - | ^^^^^^^^^ must implement `std::ops::Neg` + | ^^^^^^^^ must implement `std::ops::Neg` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | -LL | / pub trait Neg { -LL | | /// The resulting type after applying the `-` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn neg(self) -> Self::Output; -LL | | } - | |_^ +LL | pub trait Neg { + | ^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:45:5 diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr b/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr index ea259cf3d378..67a4745b399d 100644 --- a/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr +++ b/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr @@ -1,13 +1,11 @@ error[E0393]: the type parameter `T` must be explicitly specified --> $DIR/type-parameter-defaults-referencing-Self.rs:8:16 | -LL | / trait Foo { -LL | | fn method(&self); -LL | | } - | |_- type parameter `T` must be specified for this -LL | -LL | fn foo(x: &dyn Foo) { } - | ^^^ help: set the type parameter to the desired type: `Foo` +LL | trait Foo { + | ----------------- type parameter `T` must be specified for this +... +LL | fn foo(x: &dyn Foo) { } + | ^^^ help: set the type parameter to the desired type: `Foo` | = note: because of the default `Self` reference, type parameters must be specified on object types diff --git a/src/test/ui/type/type-params-in-different-spaces-1.stderr b/src/test/ui/type/type-params-in-different-spaces-1.stderr index eeb09a9f02ea..4e73e10a3014 100644 --- a/src/test/ui/type/type-params-in-different-spaces-1.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-1.stderr @@ -1,16 +1,12 @@ error[E0308]: mismatched types --> $DIR/type-params-in-different-spaces-1.rs:5:17 | -LL | / trait BrokenAdd: Copy + Add { -LL | | fn broken_add(&self, rhs: T) -> Self { - | | - found type parameter -LL | | *self + rhs - | | ^^^ expected type parameter `Self`, found type parameter `T` -LL | | -... | -LL | | } -LL | | } - | |_- expected type parameter +LL | trait BrokenAdd: Copy + Add { + | ---------------------------------------- expected type parameter +LL | fn broken_add(&self, rhs: T) -> Self { + | - found type parameter +LL | *self + rhs + | ^^^ expected type parameter `Self`, found type parameter `T` | = note: expected type parameter `Self` found type parameter `T` diff --git a/src/test/ui/type/type-params-in-different-spaces-3.stderr b/src/test/ui/type/type-params-in-different-spaces-3.stderr index 880c138d2876..c538d67316c6 100644 --- a/src/test/ui/type/type-params-in-different-spaces-3.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-3.stderr @@ -1,16 +1,14 @@ error[E0308]: mismatched types --> $DIR/type-params-in-different-spaces-3.rs:3:9 | -LL | / trait Tr : Sized { -LL | | fn test(u: X) -> Self { - | | - ---- expected `Self` because of return type - | | | - | | found type parameter -LL | | u - | | ^ expected type parameter `Self`, found type parameter `X` -LL | | } -LL | | } - | |_- expected type parameter +LL | trait Tr : Sized { + | ---------------- expected type parameter +LL | fn test(u: X) -> Self { + | - ---- expected `Self` because of return type + | | + | found type parameter +LL | u + | ^ expected type parameter `Self`, found type parameter `X` | = note: expected type parameter `Self` found type parameter `X` diff --git a/src/test/ui/type/type-recursive.stderr b/src/test/ui/type/type-recursive.stderr index 04392f7390df..3202710286e1 100644 --- a/src/test/ui/type/type-recursive.stderr +++ b/src/test/ui/type/type-recursive.stderr @@ -42,9 +42,8 @@ error[E0072]: recursive type `T4` has infinite size --> $DIR/type-recursive.rs:16:1 | LL | struct T4(Option); - | ^^^^^^^^^^----------^^ - | | | - | | recursive without indirection + | ^^^^^^^^^ ---------- recursive without indirection + | | | recursive type has infinite size | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T4` representable diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr index 74216d265d03..2c107b1f7a47 100644 --- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr +++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr @@ -7,15 +7,11 @@ LL | let _ = match x { note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[lang = "Ok"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | | ^^^ not covered -LL | | } - | |_- +LL | pub enum Result { + | --------------------- +... +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | ^^^ not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -93,15 +89,11 @@ LL | let _ = match x { note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[lang = "Ok"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | | ^^^ not covered -LL | | } - | |_- +LL | pub enum Result { + | --------------------- +... +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | ^^^ not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -120,15 +112,11 @@ LL | let Ok(x) = x; note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | / pub enum Result { -LL | | /// Contains the success value -LL | | #[lang = "Ok"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | | ^^^ not covered -LL | | } - | |_- +LL | pub enum Result { + | --------------------- +... +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | ^^^ not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr index b5c72aa52477..c277d5b761d8 100644 --- a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr +++ b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr @@ -8,7 +8,7 @@ LL | union U5 { | doesn't satisfy `U5: Clone` ... LL | struct CloneNoCopy; - | ------------------- doesn't satisfy `CloneNoCopy: Copy` + | ------------------ doesn't satisfy `CloneNoCopy: Copy` ... LL | let w = u.clone(); | ^^^^^ method cannot be called on `U5` due to unsatisfied trait bounds diff --git a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr index b5c72aa52477..c277d5b761d8 100644 --- a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr +++ b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr @@ -8,7 +8,7 @@ LL | union U5 { | doesn't satisfy `U5: Clone` ... LL | struct CloneNoCopy; - | ------------------- doesn't satisfy `CloneNoCopy: Copy` + | ------------------ doesn't satisfy `CloneNoCopy: Copy` ... LL | let w = u.clone(); | ^^^^^ method cannot be called on `U5` due to unsatisfied trait bounds diff --git a/src/test/ui/union/union-repr-c.stderr b/src/test/ui/union/union-repr-c.stderr index ae84cc7811bb..9abf440f7356 100644 --- a/src/test/ui/union/union-repr-c.stderr +++ b/src/test/ui/union/union-repr-c.stderr @@ -14,10 +14,8 @@ LL | #![deny(improper_ctypes)] note: the type is defined here --> $DIR/union-repr-c.rs:9:1 | -LL | / union W { -LL | | a: u8, -LL | | } - | |_^ +LL | union W { + | ^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index 5c40787febfb..98a9bd07ed21 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -16,7 +16,7 @@ LL | / pub struct Box< LL | | T: ?Sized, LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, LL | | >(Unique, A); - | |________________- doesn't satisfy `Box: Clone` + | |_- doesn't satisfy `Box: Clone` | = note: the following trait bounds were not satisfied: `dyn Foo: Sized` diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index 02ce371c8d5e..7af9c684b72e 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -13,7 +13,7 @@ LL | / pub struct Box< LL | | T: ?Sized, LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, LL | | >(Unique, A); - | |________________- doesn't satisfy `Box: Clone` + | |_- doesn't satisfy `Box: Clone` | = note: the following trait bounds were not satisfied: `R: Clone` diff --git a/src/test/ui/unspecified-self-in-trait-ref.stderr b/src/test/ui/unspecified-self-in-trait-ref.stderr index 2ba921871577..7869176bb3ad 100644 --- a/src/test/ui/unspecified-self-in-trait-ref.stderr +++ b/src/test/ui/unspecified-self-in-trait-ref.stderr @@ -91,13 +91,11 @@ LL | let e = >::lol(); error[E0393]: the type parameter `A` must be explicitly specified --> $DIR/unspecified-self-in-trait-ref.rs:26:13 | -LL | / pub trait Bar { -LL | | fn foo(&self); -LL | | } - | |_- type parameter `A` must be specified for this +LL | pub trait Bar { + | ------------------------------ type parameter `A` must be specified for this ... -LL | let e = Bar::::lol(); - | ^^^^^^^^^^^^ missing reference to `A` +LL | let e = Bar::::lol(); + | ^^^^^^^^^^^^ missing reference to `A` | = note: because of the default `Self` reference, type parameters must be specified on object types diff --git a/src/test/ui/use/use-from-trait-xc.stderr b/src/test/ui/use/use-from-trait-xc.stderr index 14523afbdac0..4c4c2f6225f1 100644 --- a/src/test/ui/use/use-from-trait-xc.stderr +++ b/src/test/ui/use/use-from-trait-xc.stderr @@ -50,7 +50,7 @@ note: the struct `Foo` is defined here --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 | LL | struct Foo; - | ^^^^^^^^^^^ + | ^^^^^^^^^^ error[E0603]: struct `Foo` is private --> $DIR/use-from-trait-xc.rs:17:24 @@ -62,7 +62,7 @@ note: the struct `Foo` is defined here --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 | LL | struct Foo; - | ^^^^^^^^^^^ + | ^^^^^^^^^^ error: aborting due to 9 previous errors diff --git a/src/test/ui/variance/variance-associated-consts.stderr b/src/test/ui/variance/variance-associated-consts.stderr index d1bf34781dfb..219f5bca9e30 100644 --- a/src/test/ui/variance/variance-associated-consts.stderr +++ b/src/test/ui/variance/variance-associated-consts.stderr @@ -1,10 +1,8 @@ error[E0208]: [o] --> $DIR/variance-associated-consts.rs:13:1 | -LL | / struct Foo { -LL | | field: [u8; ::Const] -LL | | } - | |_^ +LL | struct Foo { + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/variance/variance-associated-types.stderr b/src/test/ui/variance/variance-associated-types.stderr index b9aa9695f622..94f770eda33e 100644 --- a/src/test/ui/variance/variance-associated-types.stderr +++ b/src/test/ui/variance/variance-associated-types.stderr @@ -1,18 +1,14 @@ error[E0208]: [-, +] --> $DIR/variance-associated-types.rs:13:1 | -LL | / struct Foo<'a, T : Trait<'a>> { -LL | | field: (T, &'a ()) -LL | | } - | |_^ +LL | struct Foo<'a, T : Trait<'a>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o, o] --> $DIR/variance-associated-types.rs:18:1 | -LL | / struct Bar<'a, T : Trait<'a>> { -LL | | field: >::Type -LL | | } - | |_^ +LL | struct Bar<'a, T : Trait<'a>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/variance/variance-object-types.stderr b/src/test/ui/variance/variance-object-types.stderr index 2a5d8f91e1ec..ceee53aff105 100644 --- a/src/test/ui/variance/variance-object-types.stderr +++ b/src/test/ui/variance/variance-object-types.stderr @@ -1,10 +1,8 @@ error[E0208]: [o] --> $DIR/variance-object-types.rs:7:1 | -LL | / struct Foo<'a> { -LL | | x: Box &'a i32 + 'static> -LL | | } - | |_^ +LL | struct Foo<'a> { + | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/variance/variance-regions-direct.stderr b/src/test/ui/variance/variance-regions-direct.stderr index 8c9c89955bd3..25fb22732151 100644 --- a/src/test/ui/variance/variance-regions-direct.stderr +++ b/src/test/ui/variance/variance-regions-direct.stderr @@ -1,64 +1,44 @@ error[E0208]: [-, -, -] --> $DIR/variance-regions-direct.rs:9:1 | -LL | / struct Test2<'a, 'b, 'c> { -LL | | x: &'a isize, -LL | | y: &'b [isize], -LL | | c: &'c str -LL | | } - | |_^ +LL | struct Test2<'a, 'b, 'c> { + | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+, +, +] --> $DIR/variance-regions-direct.rs:18:1 | -LL | / struct Test3<'a, 'b, 'c> { -LL | | x: extern "Rust" fn(&'a isize), -LL | | y: extern "Rust" fn(&'b [isize]), -LL | | c: extern "Rust" fn(&'c str), -LL | | } - | |_^ +LL | struct Test3<'a, 'b, 'c> { + | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [-, o] --> $DIR/variance-regions-direct.rs:27:1 | -LL | / struct Test4<'a, 'b:'a> { -LL | | x: &'a mut &'b isize, -LL | | } - | |_^ +LL | struct Test4<'a, 'b:'a> { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+, o] --> $DIR/variance-regions-direct.rs:35:1 | -LL | / struct Test5<'a, 'b:'a> { -LL | | x: extern "Rust" fn(&'a mut &'b isize), -LL | | } - | |_^ +LL | struct Test5<'a, 'b:'a> { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [-, o] --> $DIR/variance-regions-direct.rs:45:1 | -LL | / struct Test6<'a, 'b:'a> { -LL | | x: &'a mut extern "Rust" fn(&'b isize), -LL | | } - | |_^ +LL | struct Test6<'a, 'b:'a> { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [*] --> $DIR/variance-regions-direct.rs:52:1 | -LL | / struct Test7<'a> { -LL | | x: isize -LL | | } - | |_^ +LL | struct Test7<'a> { + | ^^^^^^^^^^^^^^^^ error[E0208]: [+, -, o] --> $DIR/variance-regions-direct.rs:59:1 | -LL | / enum Test8<'a, 'b, 'c:'b> { -LL | | Test8A(extern "Rust" fn(&'a isize)), -LL | | Test8B(&'b [isize]), -LL | | Test8C(&'b mut &'c str), -LL | | } - | |_^ +LL | enum Test8<'a, 'b, 'c:'b> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 7 previous errors diff --git a/src/test/ui/variance/variance-regions-indirect.stderr b/src/test/ui/variance/variance-regions-indirect.stderr index 17efc6231d5e..fc52492d7efd 100644 --- a/src/test/ui/variance/variance-regions-indirect.stderr +++ b/src/test/ui/variance/variance-regions-indirect.stderr @@ -1,44 +1,32 @@ error[E0208]: [+, -, o, *] --> $DIR/variance-regions-indirect.rs:8:1 | -LL | / enum Base<'a, 'b, 'c:'b, 'd> { -LL | | Test8A(extern "Rust" fn(&'a isize)), -LL | | Test8B(&'b [isize]), -LL | | Test8C(&'b mut &'c str), -LL | | } - | |_^ +LL | enum Base<'a, 'b, 'c:'b, 'd> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [*, o, -, +] --> $DIR/variance-regions-indirect.rs:15:1 | -LL | / struct Derived1<'w, 'x:'y, 'y, 'z> { -LL | | f: Base<'z, 'y, 'x, 'w> -LL | | } - | |_^ +LL | struct Derived1<'w, 'x:'y, 'y, 'z> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o, o, *] --> $DIR/variance-regions-indirect.rs:20:1 | -LL | / struct Derived2<'a, 'b:'a, 'c> { -LL | | f: Base<'a, 'a, 'b, 'c> -LL | | } - | |_^ +LL | struct Derived2<'a, 'b:'a, 'c> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o, -, *] --> $DIR/variance-regions-indirect.rs:25:1 | -LL | / struct Derived3<'a:'b, 'b, 'c> { -LL | | f: Base<'a, 'b, 'a, 'c> -LL | | } - | |_^ +LL | struct Derived3<'a:'b, 'b, 'c> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+, -, o] --> $DIR/variance-regions-indirect.rs:30:1 | -LL | / struct Derived4<'a, 'b, 'c:'b> { -LL | | f: Base<'a, 'b, 'c, 'a> -LL | | } - | |_^ +LL | struct Derived4<'a, 'b, 'c:'b> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/variance/variance-trait-bounds.stderr b/src/test/ui/variance/variance-trait-bounds.stderr index 98bc1b003c39..e3ef339f423b 100644 --- a/src/test/ui/variance/variance-trait-bounds.stderr +++ b/src/test/ui/variance/variance-trait-bounds.stderr @@ -1,34 +1,26 @@ error[E0208]: [+, +] --> $DIR/variance-trait-bounds.rs:16:1 | -LL | / struct TestStruct> { -LL | | t: T, u: U -LL | | } - | |_^ +LL | struct TestStruct> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [*, +] --> $DIR/variance-trait-bounds.rs:21:1 | -LL | / enum TestEnum> { -LL | | Foo(T) -LL | | } - | |_^ +LL | enum TestEnum> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [*, +] --> $DIR/variance-trait-bounds.rs:26:1 | -LL | / struct TestContraStruct> { -LL | | t: T -LL | | } - | |_^ +LL | struct TestContraStruct> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [*, +] --> $DIR/variance-trait-bounds.rs:31:1 | -LL | / struct TestBox+Setter> { -LL | | t: T -LL | | } - | |_^ +LL | struct TestBox+Setter> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/variance/variance-trait-object-bound.stderr b/src/test/ui/variance/variance-trait-object-bound.stderr index fb0fab1950ce..c86cf1f82b45 100644 --- a/src/test/ui/variance/variance-trait-object-bound.stderr +++ b/src/test/ui/variance/variance-trait-object-bound.stderr @@ -1,10 +1,8 @@ error[E0208]: [-] --> $DIR/variance-trait-object-bound.rs:14:1 | -LL | / struct TOption<'a> { -LL | | v: Option>, -LL | | } - | |_^ +LL | struct TOption<'a> { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/variance/variance-types-bounds.stderr b/src/test/ui/variance/variance-types-bounds.stderr index 5cffdffc7f2d..dbe8af75d517 100644 --- a/src/test/ui/variance/variance-types-bounds.stderr +++ b/src/test/ui/variance/variance-types-bounds.stderr @@ -1,46 +1,32 @@ error[E0208]: [+, +] --> $DIR/variance-types-bounds.rs:7:1 | -LL | / struct TestImm { -LL | | x: A, -LL | | y: B, -LL | | } - | |_^ +LL | struct TestImm { + | ^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+, o] --> $DIR/variance-types-bounds.rs:13:1 | -LL | / struct TestMut { -LL | | x: A, -LL | | y: &'static mut B, -LL | | } - | |_^ +LL | struct TestMut { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+, o] --> $DIR/variance-types-bounds.rs:19:1 | -LL | / struct TestIndirect { -LL | | m: TestMut -LL | | } - | |_^ +LL | struct TestIndirect { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o, o] --> $DIR/variance-types-bounds.rs:24:1 | -LL | / struct TestIndirect2 { -LL | | n: TestMut, -LL | | m: TestMut -LL | | } - | |_^ +LL | struct TestIndirect2 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o, o] --> $DIR/variance-types-bounds.rs:38:1 | -LL | / struct TestObject { -LL | | n: Box+Send>, -LL | | m: Box+Send>, -LL | | } - | |_^ +LL | struct TestObject { + | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/variance/variance-types.stderr b/src/test/ui/variance/variance-types.stderr index 05bd4747cf16..8358b18b73ce 100644 --- a/src/test/ui/variance/variance-types.stderr +++ b/src/test/ui/variance/variance-types.stderr @@ -1,52 +1,38 @@ error[E0208]: [-, o, o] --> $DIR/variance-types.rs:10:1 | -LL | / struct InvariantMut<'a,A:'a,B:'a> { -LL | | t: &'a mut (A,B) -LL | | } - | |_^ +LL | struct InvariantMut<'a,A:'a,B:'a> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o] --> $DIR/variance-types.rs:15:1 | -LL | / struct InvariantCell { -LL | | t: Cell -LL | | } - | |_^ +LL | struct InvariantCell { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [o] --> $DIR/variance-types.rs:20:1 | -LL | / struct InvariantIndirect { -LL | | t: InvariantCell -LL | | } - | |_^ +LL | struct InvariantIndirect { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+] --> $DIR/variance-types.rs:25:1 | -LL | / struct Covariant { -LL | | t: A, u: fn() -> A -LL | | } - | |_^ +LL | struct Covariant { + | ^^^^^^^^^^^^^^^^^^^ error[E0208]: [-] --> $DIR/variance-types.rs:30:1 | -LL | / struct Contravariant { -LL | | t: fn(A) -LL | | } - | |_^ +LL | struct Contravariant { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0208]: [+, -, o] --> $DIR/variance-types.rs:35:1 | -LL | / enum Enum { -LL | | Foo(Covariant), -LL | | Bar(Contravariant), -LL | | Zed(Covariant,Contravariant) -LL | | } - | |_^ +LL | enum Enum { + | ^^^^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/wasm-custom-section-relocations.stderr b/src/test/ui/wasm-custom-section-relocations.stderr index eb8ab2644a33..a37edc51d197 100644 --- a/src/test/ui/wasm-custom-section-relocations.stderr +++ b/src/test/ui/wasm-custom-section-relocations.stderr @@ -2,13 +2,13 @@ error: statics with a custom `#[link_section]` must be a simple list of bytes on --> $DIR/wasm-custom-section-relocations.rs:4:1 | LL | pub static A: &[u8] = &[1]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: statics with a custom `#[link_section]` must be a simple list of bytes on the wasm target with no extra levels of indirection such as references --> $DIR/wasm-custom-section-relocations.rs:13:1 | LL | pub static D: &usize = &C; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr b/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr index 16d198725523..f976466841c8 100644 --- a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr +++ b/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr @@ -25,12 +25,12 @@ note: the anonymous lifetime #1 defined here... --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:5 | LL | pub fn repro(_: Wrapper); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl` --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:13:1 | LL | impl Trait for Ref {} - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/xcrate/xcrate-private-by-default.stderr b/src/test/ui/xcrate/xcrate-private-by-default.stderr index a97f55de5f83..0bdd4002f40a 100644 --- a/src/test/ui/xcrate/xcrate-private-by-default.stderr +++ b/src/test/ui/xcrate/xcrate-private-by-default.stderr @@ -8,7 +8,7 @@ note: the static `j` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:47:1 | LL | static j: isize = 0; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ error[E0603]: function `k` is private --> $DIR/xcrate-private-by-default.rs:25:29 @@ -32,7 +32,7 @@ note: the unit struct `l` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:49:1 | LL | struct l; - | ^^^^^^^^^ + | ^^^^^^^^ error[E0603]: enum `m` is private --> $DIR/xcrate-private-by-default.rs:29:35 @@ -56,7 +56,7 @@ note: the type alias `n` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:51:1 | LL | type n = isize; - | ^^^^^^^^^^^^^^^ + | ^^^^^^ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:35:29 diff --git a/src/tools/clippy/clippy_lints/src/operators/numeric_arithmetic.rs b/src/tools/clippy/clippy_lints/src/operators/numeric_arithmetic.rs index 82f454d02f71..b6097710dc68 100644 --- a/src/tools/clippy/clippy_lints/src/operators/numeric_arithmetic.rs +++ b/src/tools/clippy/clippy_lints/src/operators/numeric_arithmetic.rs @@ -96,11 +96,12 @@ impl Context { } pub fn enter_body(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) { - let body_owner = cx.tcx.hir().body_owner_def_id(body.id()); + let body_owner = cx.tcx.hir().body_owner(body.id()); + let body_owner_def_id = cx.tcx.hir().local_def_id(body_owner); - match cx.tcx.hir().body_owner_kind(body_owner) { + match cx.tcx.hir().body_owner_kind(body_owner_def_id) { hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const => { - let body_span = cx.tcx.def_span(body_owner); + let body_span = cx.tcx.hir().span_with_body(body_owner); if let Some(span) = self.const_span { if span.contains(body_span) { @@ -115,7 +116,7 @@ impl Context { pub fn body_post(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) { let body_owner = cx.tcx.hir().body_owner(body.id()); - let body_span = cx.tcx.hir().span(body_owner); + let body_span = cx.tcx.hir().span_with_body(body_owner); if let Some(span) = self.const_span { if span.contains(body_span) { diff --git a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr index d930d486fde6..a6a767483ed4 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr @@ -25,7 +25,7 @@ error[E0046]: not all trait items implemented, missing: `VAL` --> $DIR/ice-6252.rs:10:1 | LL | const VAL: T; - | ------------- `VAL` from trait + | ------------ `VAL` from trait ... LL | impl TypeVal for Multiply where N: TypeVal {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation diff --git a/src/tools/clippy/tests/ui/derive_hash_xor_eq.stderr b/src/tools/clippy/tests/ui/derive_hash_xor_eq.stderr index e5184bd1407c..2a4abb0c5193 100644 --- a/src/tools/clippy/tests/ui/derive_hash_xor_eq.stderr +++ b/src/tools/clippy/tests/ui/derive_hash_xor_eq.stderr @@ -8,12 +8,8 @@ LL | #[derive(Hash)] note: `PartialEq` implemented here --> $DIR/derive_hash_xor_eq.rs:15:1 | -LL | / impl PartialEq for Bar { -LL | | fn eq(&self, _: &Bar) -> bool { -LL | | true -LL | | } -LL | | } - | |_^ +LL | impl PartialEq for Bar { + | ^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: you are deriving `Hash` but have implemented `PartialEq` explicitly @@ -25,12 +21,8 @@ LL | #[derive(Hash)] note: `PartialEq` implemented here --> $DIR/derive_hash_xor_eq.rs:24:1 | -LL | / impl PartialEq for Baz { -LL | | fn eq(&self, _: &Baz) -> bool { -LL | | true -LL | | } -LL | | } - | |_^ +LL | impl PartialEq for Baz { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: you are implementing `Hash` explicitly but have derived `PartialEq` diff --git a/src/tools/clippy/tests/ui/derive_ord_xor_partial_ord.stderr b/src/tools/clippy/tests/ui/derive_ord_xor_partial_ord.stderr index 32896c99dad0..baf8341aba90 100644 --- a/src/tools/clippy/tests/ui/derive_ord_xor_partial_ord.stderr +++ b/src/tools/clippy/tests/ui/derive_ord_xor_partial_ord.stderr @@ -8,12 +8,8 @@ LL | #[derive(Ord, PartialEq, Eq)] note: `PartialOrd` implemented here --> $DIR/derive_ord_xor_partial_ord.rs:24:1 | -LL | / impl PartialOrd for DeriveOrd { -LL | | fn partial_cmp(&self, other: &Self) -> Option { -LL | | Some(other.cmp(self)) -LL | | } -LL | | } - | |_^ +LL | impl PartialOrd for DeriveOrd { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error: you are deriving `Ord` but have implemented `PartialOrd` explicitly @@ -25,12 +21,8 @@ LL | #[derive(Ord, PartialEq, Eq)] note: `PartialOrd` implemented here --> $DIR/derive_ord_xor_partial_ord.rs:33:1 | -LL | / impl PartialOrd for DeriveOrdWithExplicitTypeVariable { -LL | | fn partial_cmp(&self, other: &Self) -> Option { -LL | | Some(other.cmp(self)) -LL | | } -LL | | } - | |_^ +LL | impl PartialOrd for DeriveOrdWithExplicitTypeVariable { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error: you are implementing `Ord` explicitly but have derived `PartialOrd` diff --git a/src/tools/clippy/tests/ui/needless_pass_by_value.stderr b/src/tools/clippy/tests/ui/needless_pass_by_value.stderr index d960c86a9f0e..38f33c53f128 100644 --- a/src/tools/clippy/tests/ui/needless_pass_by_value.stderr +++ b/src/tools/clippy/tests/ui/needless_pass_by_value.stderr @@ -124,7 +124,7 @@ help: consider marking this type as `Copy` --> $DIR/needless_pass_by_value.rs:123:1 | LL | struct CopyWrapper(u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: this argument is passed by value, but not consumed in the function body --> $DIR/needless_pass_by_value.rs:131:29 @@ -136,7 +136,7 @@ help: consider marking this type as `Copy` --> $DIR/needless_pass_by_value.rs:123:1 | LL | struct CopyWrapper(u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: this argument is passed by value, but not consumed in the function body --> $DIR/needless_pass_by_value.rs:131:45 @@ -148,7 +148,7 @@ help: consider marking this type as `Copy` --> $DIR/needless_pass_by_value.rs:123:1 | LL | struct CopyWrapper(u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: this argument is passed by value, but not consumed in the function body --> $DIR/needless_pass_by_value.rs:131:61 @@ -160,7 +160,7 @@ help: consider marking this type as `Copy` --> $DIR/needless_pass_by_value.rs:123:1 | LL | struct CopyWrapper(u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: this argument is passed by value, but not consumed in the function body --> $DIR/needless_pass_by_value.rs:143:40