From aac2c7ddd887a410e44a2cdc4cb4735765b2924e Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 11 Sep 2022 14:37:55 +0200 Subject: [PATCH] Always print '_, even for erased lifetimes. --- compiler/rustc_middle/src/ty/print/pretty.rs | 25 +++---------------- .../derefer_complex_case.main.Derefer.diff | 12 ++++----- ...ness.no_downcast.EarlyOtherwiseBranch.diff | 6 ++--- ...float_to_exponential_common.ConstProp.diff | 18 ++++++------- .../issue_73223.main.SimplifyArmIdentity.diff | 2 +- .../mir-opt/issue_99325.main.mir_map.0.mir | 8 +++--- ...asts.SimplifyCfg-elaborate-drops.after.mir | 2 +- .../const-generics/issues/issue-83765.stderr | 8 +++--- .../const-ptr/forbidden_slices.64bit.stderr | 16 ++++++------ src/test/ui/issues/issue-21174.stderr | 4 +-- .../ui/polymorphization/predicates.stderr | 2 +- ...recursive-types-are-not-uninhabited.stderr | 4 +-- .../ui/specialization/issue-38091-2.stderr | 2 +- src/test/ui/transmute/main.stderr | 2 +- 14 files changed, 46 insertions(+), 65 deletions(-) diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index b6cd5396b1d..1546f551011 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1088,17 +1088,9 @@ pub trait PrettyPrinter<'tcx>: .generics_of(principal.def_id) .own_substs_no_defaults(cx.tcx(), principal.substs); - // Don't print `'_` if there's no unerased regions. - let print_regions = args.iter().any(|arg| match arg.unpack() { - GenericArgKind::Lifetime(r) => !r.is_erased(), - _ => false, - }); - let mut args = args.iter().cloned().filter(|arg| match arg.unpack() { - GenericArgKind::Lifetime(_) => print_regions, - _ => true, - }); let mut projections = predicates.projection_bounds(); + let mut args = args.iter().cloned(); let arg0 = args.next(); let projection0 = projections.next(); if arg0.is_some() || projection0.is_some() { @@ -1847,22 +1839,11 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> { ) -> Result { self = print_prefix(self)?; - // Don't print `'_` if there's no unerased regions. - let print_regions = self.tcx.sess.verbose() - || args.iter().any(|arg| match arg.unpack() { - GenericArgKind::Lifetime(r) => !r.is_erased(), - _ => false, - }); - let args = args.iter().cloned().filter(|arg| match arg.unpack() { - GenericArgKind::Lifetime(_) => print_regions, - _ => true, - }); - - if args.clone().next().is_some() { + if args.first().is_some() { if self.in_value { write!(self, "::")?; } - self.generic_delimiters(|cx| cx.comma_sep(args)) + self.generic_delimiters(|cx| cx.comma_sep(args.iter().cloned())) } else { Ok(self) } diff --git a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff b/src/test/mir-opt/derefer_complex_case.main.Derefer.diff index c353c375aa9..1e1c80aad34 100644 --- a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff +++ b/src/test/mir-opt/derefer_complex_case.main.Derefer.diff @@ -3,15 +3,15 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/derefer_complex_case.rs:+0:11: +0:11 - let mut _1: std::slice::Iter; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 + let mut _1: std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 let mut _2: &[i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 let _3: [i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:18: +1:26 - let mut _4: std::slice::Iter; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 + let mut _4: std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 let mut _5: (); // in scope 0 at $DIR/derefer_complex_case.rs:+0:1: +2:2 let _6: (); // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 let mut _7: std::option::Option<&i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 - let mut _8: &mut std::slice::Iter; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 - let mut _9: &mut std::slice::Iter; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 + let mut _8: &mut std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 + let mut _9: &mut std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26 let mut _10: isize; // in scope 0 at $DIR/derefer_complex_case.rs:+1:5: +1:40 let mut _11: !; // in scope 0 at $DIR/derefer_complex_case.rs:+1:5: +1:40 let mut _13: i32; // in scope 0 at $DIR/derefer_complex_case.rs:+1:34: +1:37 @@ -53,10 +53,10 @@ StorageLive(_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 _9 = &mut _4; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 _8 = &mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 - _7 = as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 + _7 = as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 // mir::Constant // + span: $DIR/derefer_complex_case.rs:6:17: 6:26 - // + literal: Const { ty: for<'r> fn(&'r mut std::slice::Iter) -> Option< as Iterator>::Item> { as Iterator>::next}, val: Value() } + // + literal: Const { ty: for<'r> fn(&'r mut std::slice::Iter<'_, i32>) -> Option< as Iterator>::Item> { as Iterator>::next}, val: Value() } } bb3: { diff --git a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff index 9e089b01b0f..659aed18f04 100644 --- a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff @@ -1,12 +1,12 @@ - // MIR for `no_downcast` before EarlyOtherwiseBranch + // MIR for `no_downcast` after EarlyOtherwiseBranch - fn no_downcast(_1: &E) -> u32 { + fn no_downcast(_1: &E<'_>) -> u32 { debug e => _1; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17 let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:26: +0:29 let mut _2: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:20: +1:30 let mut _3: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 - let mut _4: &E; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17 + let mut _4: &E<'_>; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17 scope 1 { } @@ -16,7 +16,7 @@ } bb1: { - _4 = deref_copy (((*_1) as Some).0: &E); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 + _4 = deref_copy (((*_1) as Some).0: &E<'_>); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 _2 = discriminant((*_4)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 } diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff index dca36b1a76d..b789ae22974 100644 --- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff +++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff @@ -1,24 +1,24 @@ - // MIR for `float_to_exponential_common` before ConstProp + // MIR for `float_to_exponential_common` after ConstProp - fn float_to_exponential_common(_1: &mut Formatter, _2: &T, _3: bool) -> Result<(), std::fmt::Error> { + fn float_to_exponential_common(_1: &mut Formatter<'_>, _2: &T, _3: bool) -> Result<(), std::fmt::Error> { debug fmt => _1; // in scope 0 at $DIR/funky_arms.rs:+0:35: +0:38 debug num => _2; // in scope 0 at $DIR/funky_arms.rs:+0:60: +0:63 debug upper => _3; // in scope 0 at $DIR/funky_arms.rs:+0:69: +0:74 let mut _0: std::result::Result<(), std::fmt::Error>; // return place in scope 0 at $DIR/funky_arms.rs:+0:85: +0:91 let _4: bool; // in scope 0 at $DIR/funky_arms.rs:+4:9: +4:19 - let mut _5: &std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 + let mut _5: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 let mut _7: std::option::Option; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45 - let mut _8: &std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45 + let mut _8: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45 let mut _9: isize; // in scope 0 at $DIR/funky_arms.rs:+13:12: +13:27 - let mut _11: &mut std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+15:43: +15:46 + let mut _11: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+15:43: +15:46 let mut _12: &T; // in scope 0 at $DIR/funky_arms.rs:+15:48: +15:51 let mut _13: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+15:53: +15:57 let mut _14: u32; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:79 let mut _15: u32; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:75 let mut _16: usize; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:68 let mut _17: bool; // in scope 0 at $DIR/funky_arms.rs:+15:81: +15:86 - let mut _18: &mut std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+17:46: +17:49 + let mut _18: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+17:46: +17:49 let mut _19: &T; // in scope 0 at $DIR/funky_arms.rs:+17:51: +17:54 let mut _20: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+17:56: +17:60 let mut _21: bool; // in scope 0 at $DIR/funky_arms.rs:+17:62: +17:67 @@ -38,10 +38,10 @@ StorageLive(_4); // scope 0 at $DIR/funky_arms.rs:+4:9: +4:19 StorageLive(_5); // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 _5 = &(*_1); // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 - _4 = Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 + _4 = Formatter::<'_>::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37 // mir::Constant // + span: $DIR/funky_arms.rs:15:26: 15:35 - // + literal: Const { ty: for<'r> fn(&'r Formatter) -> bool {Formatter::sign_plus}, val: Value() } + // + literal: Const { ty: for<'r> fn(&'r Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value() } } bb1: { @@ -66,10 +66,10 @@ StorageLive(_7); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45 StorageLive(_8); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45 _8 = &(*_1); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45 - _7 = Formatter::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45 + _7 = Formatter::<'_>::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45 // mir::Constant // + span: $DIR/funky_arms.rs:24:34: 24:43 - // + literal: Const { ty: for<'r> fn(&'r Formatter) -> Option {Formatter::precision}, val: Value() } + // + literal: Const { ty: for<'r> fn(&'r Formatter<'_>) -> Option {Formatter::<'_>::precision}, val: Value() } } bb5: { diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff index 76d8d939625..533907e7040 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff @@ -25,7 +25,7 @@ let _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _25: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _26: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _27: std::option::Option; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _27: std::option::Option>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 1 { debug split => _1; // in scope 1 at $DIR/issue-73223.rs:+1:9: +1:14 let _6: std::option::Option; // in scope 1 at $DIR/issue-73223.rs:+6:9: +6:14 diff --git a/src/test/mir-opt/issue_99325.main.mir_map.0.mir b/src/test/mir-opt/issue_99325.main.mir_map.0.mir index 8659ddfdb00..5428d865cd5 100644 --- a/src/test/mir-opt/issue_99325.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_99325.main.mir_map.0.mir @@ -26,7 +26,7 @@ fn main() -> () { let _19: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _20: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _21: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _22: std::option::Option; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _22: std::option::Option>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _23: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _24: (&&[u8], &&[u8; 4]); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _25: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -46,7 +46,7 @@ fn main() -> () { let _40: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _41: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _42: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _43: std::option::Option; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _43: std::option::Option>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 1 { debug left_val => _8; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _9; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -128,7 +128,7 @@ fn main() -> () { _21 = &(*_9); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _20 = &(*_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_22); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = Option::::None; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _22 = Option::>::None; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -237,7 +237,7 @@ fn main() -> () { _42 = &(*_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _41 = &(*_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_43); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _43 = Option::::None; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _43 = Option::>::None; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir index 899bb67fb3a..318b241fa73 100644 --- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir @@ -29,7 +29,7 @@ fn array_casts() -> () { let _31: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _32: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _33: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _34: std::option::Option; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _34: std::option::Option>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 1 { debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14 let _2: *mut usize; // in scope 1 at $DIR/retag.rs:+2:9: +2:10 diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/issues/issue-83765.stderr index d5f914f46f8..4becf3a364c 100644 --- a/src/test/ui/const-generics/issues/issue-83765.stderr +++ b/src/test/ui/const-generics/issues/issue-83765.stderr @@ -1,16 +1,16 @@ -error[E0391]: cycle detected when resolving instance ` as TensorDimension>::DIM` +error[E0391]: cycle detected when resolving instance ` as TensorDimension>::DIM` --> $DIR/issue-83765.rs:5:5 | LL | const DIM: usize; | ^^^^^^^^^^^^^^^^ | -note: ...which requires computing candidate for ` as TensorDimension>`... +note: ...which requires computing candidate for ` as TensorDimension>`... --> $DIR/issue-83765.rs:4:1 | LL | trait TensorDimension { | ^^^^^^^^^^^^^^^^^^^^^ - = note: ...which again requires resolving instance ` as TensorDimension>::DIM`, completing the cycle -note: cycle used when computing candidate for ` as TensorDimension>` + = note: ...which again requires resolving instance ` as TensorDimension>::DIM`, completing the cycle +note: cycle used when computing candidate for ` as TensorDimension>` --> $DIR/issue-83765.rs:4:1 | LL | trait TensorDimension { diff --git a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr index f88746af976..db42b7c9830 100644 --- a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr +++ b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr @@ -5,7 +5,7 @@ LL | &*ptr::slice_from_raw_parts(data, len) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) - | inside `std::slice::from_raw_parts::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:18:34 | @@ -19,7 +19,7 @@ LL | &*ptr::slice_from_raw_parts(data, len) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) - | inside `std::slice::from_raw_parts::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | inside `std::slice::from_raw_parts::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:19:33 | @@ -33,7 +33,7 @@ LL | &*ptr::slice_from_raw_parts(data, len) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds - | inside `std::slice::from_raw_parts::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:22:34 | @@ -92,7 +92,7 @@ LL | &*ptr::slice_from_raw_parts(data, len) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds - | inside `std::slice::from_raw_parts::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | inside `std::slice::from_raw_parts::<'_, u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:43:5 | @@ -111,7 +111,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:46:34 | @@ -130,7 +130,7 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `from_ptr_range::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:47:33 | @@ -230,7 +230,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:79:34 | @@ -249,7 +249,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:80:35 | diff --git a/src/test/ui/issues/issue-21174.stderr b/src/test/ui/issues/issue-21174.stderr index 09402c3d814..5981d9dc733 100644 --- a/src/test/ui/issues/issue-21174.stderr +++ b/src/test/ui/issues/issue-21174.stderr @@ -4,8 +4,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently- LL | let new: T::B = unsafe { std::mem::transmute(value) }; | ^^^^^^^^^^^^^^^^^^^ | - = note: source type: `::A` (this type does not have a fixed size) - = note: target type: `::B` (this type does not have a fixed size) + = note: source type: `>::A` (this type does not have a fixed size) + = note: target type: `>::B` (this type does not have a fixed size) error: aborting due to previous error diff --git a/src/test/ui/polymorphization/predicates.stderr b/src/test/ui/polymorphization/predicates.stderr index e5af1d7515f..80bb2af25cc 100644 --- a/src/test/ui/polymorphization/predicates.stderr +++ b/src/test/ui/polymorphization/predicates.stderr @@ -41,7 +41,7 @@ error: item has unused generic parameters LL | fn bar() { | ^^^ - generic parameter `I` is unused -note: the above error was encountered while instantiating `fn foo::, T>` +note: the above error was encountered while instantiating `fn foo::, T>` --> $DIR/predicates.rs:86:5 | LL | foo(x.iter()); 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 321ee0a3694..f2307899d3c 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -6,7 +6,7 @@ LL | let Ok(x) = res; | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html -note: `Result` defined here +note: `Result>` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | LL | pub enum Result { @@ -14,7 +14,7 @@ LL | pub enum Result { ... LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), | ^^^ not covered - = note: the matched value is of type `Result` + = note: the matched value is of type `Result>` help: you might want to use `if let` to ignore the variant that isn't matched | LL | let x = if let Ok(x) = res { x } else { todo!() }; diff --git a/src/test/ui/specialization/issue-38091-2.stderr b/src/test/ui/specialization/issue-38091-2.stderr index 146a56358be..31ae4b26e45 100644 --- a/src/test/ui/specialization/issue-38091-2.stderr +++ b/src/test/ui/specialization/issue-38091-2.stderr @@ -10,7 +10,7 @@ LL | #![feature(specialization)] error[E0275]: overflow evaluating the requirement `i32: Check` | -note: required for `i32` to implement `Iterate` +note: required for `i32` to implement `Iterate<'_>` --> $DIR/issue-38091-2.rs:11:13 | LL | impl<'a, T> Iterate<'a> for T diff --git a/src/test/ui/transmute/main.stderr b/src/test/ui/transmute/main.stderr index f48562094a4..d519f03682b 100644 --- a/src/test/ui/transmute/main.stderr +++ b/src/test/ui/transmute/main.stderr @@ -4,7 +4,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently- LL | transmute(x) | ^^^^^^^^^ | - = note: `::T` does not have a fixed size + = note: `>::T` does not have a fixed size error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> $DIR/main.rs:17:17