Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3f661d2
borrowck `DefId` -> `LocalDefId`
lcnr May 11, 2020
a8ed9aa
impl From<[T; N]> for Box<[T]>
pickfire Apr 13, 2020
eccaa01
rustc_target: Add a target spec option for static-pie support
petrochenkov May 1, 2020
96a466c
linker: Support `-static-pie` and `-static -shared`
petrochenkov May 1, 2020
08df311
librustc_mir: Add support for const fn offset/arith_offset
josephlr Apr 24, 2020
9b3dfd8
core: Make pointer offset methods "const fn"
josephlr Apr 24, 2020
88a37a2
test/ui/consts: Add tests for const ptr offsets
josephlr May 15, 2020
6b20f58
miri_unleached: We now allow offset in const fn
josephlr May 18, 2020
55577b4
librustc_mir: Add back use statement
josephlr May 25, 2020
6367b54
librustc_middle: Add function for computing unsigned abs
josephlr May 26, 2020
71ef841
Add checks and tests for computing abs(offset_bytes)
josephlr May 26, 2020
822ad87
Add Peekable::next_if
jyn514 May 18, 2020
a977df3
Implement RFC 2585
LeSeulArtichaut May 3, 2020
594c499
Add tests
LeSeulArtichaut May 3, 2020
bb67915
Apply suggestions from code review
LeSeulArtichaut May 13, 2020
3ce9d5c
Add more cases to the test
LeSeulArtichaut May 14, 2020
b3e012b
Fix inverted `if` condition
LeSeulArtichaut May 18, 2020
a41f763
Use the lowest of `unsafe_op_in_unsafe_fn` and `safe_borrow_packed` f…
LeSeulArtichaut May 18, 2020
a3bae5c
Fix wrong conflict resolution
LeSeulArtichaut May 19, 2020
925d5ac
Fix and bless tests
LeSeulArtichaut May 21, 2020
9671b44
Add tests for packed borrows in unsafe fns
LeSeulArtichaut May 22, 2020
3599ada
Mark deduplicated errors as expected in gate test
LeSeulArtichaut May 23, 2020
4a538d3
Do not hardcode lint name
LeSeulArtichaut May 23, 2020
e3d27ec
Add explanation about taking the minimum of the two lints
LeSeulArtichaut May 23, 2020
1b08850
Fix import
LeSeulArtichaut May 23, 2020
63066c0
Use `LintId`s to check for gated lints
LeSeulArtichaut May 23, 2020
db684be
Whitelist `unsafe_op_in_unsafe_fn` in rustdoc
LeSeulArtichaut May 27, 2020
3fea832
Fix spacing of expected/found notes without a label
estebank Dec 20, 2019
5ba2220
Name `RegionKind::ReVar` lifetimes in diagnostics
estebank Dec 20, 2019
eb0f4d5
Tweak output for mismatched impl item
estebank Dec 22, 2019
3811232
review comments
estebank Dec 23, 2019
2e2f820
review comment: use FxIndexSet
estebank Dec 27, 2019
d0d30b0
fix rebase
estebank Jan 7, 2020
2b35247
Modify wording
estebank Feb 17, 2020
500504c
fix rebase
estebank Mar 30, 2020
c52dbbc
fix rebase
estebank Apr 14, 2020
7d5415b
Add additional checks for isize overflow
josephlr May 27, 2020
cb6408a
Fix rebase
estebank May 28, 2020
f213acf
review comments: change wording and visual output
estebank May 28, 2020
0e3b31c
Update src/librustdoc/core.rs
nikomatsakis May 28, 2020
1bd6970
Account for `Self` as a type param
estebank May 28, 2020
ce10b6d
Rollup merge of #67460 - estebank:named-lts, r=nikomatsakis
RalfJung May 29, 2020
de90e0d
Rollup merge of #71095 - pickfire:box-from-array, r=dtolnay
RalfJung May 29, 2020
b014e61
Rollup merge of #71500 - josephlr:offset, r=oli-obk,RalfJung
RalfJung May 29, 2020
b08168e
Rollup merge of #71804 - petrochenkov:static-pie, r=cuviper
RalfJung May 29, 2020
4e2351e
Rollup merge of #71862 - LeSeulArtichaut:unsafe-block-in-unsafe-fn, r…
RalfJung May 29, 2020
92329c7
Rollup merge of #72103 - lcnr:borrowck-localdefid, r=jonas-schievink
RalfJung May 29, 2020
783cfb1
Rollup merge of #72310 - jyn514:peekable-next-if, r=dtolnay
RalfJung May 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Name RegionKind::ReVar lifetimes in diagnostics
  • Loading branch information
estebank committed May 27, 2020
commit 5ba22205a48f3c4232a899effc47fa1925ed9900
9 changes: 6 additions & 3 deletions src/librustc_infer/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,13 +987,16 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}

fn push_ty_ref<'tcx>(
r: &ty::Region<'tcx>,
region: &ty::Region<'tcx>,
ty: Ty<'tcx>,
mutbl: hir::Mutability,
s: &mut DiagnosticStyledString,
) {
let mut r = r.to_string();
if r == "'_" {
let mut r = region.to_string();
if let ty::RegionKind::ReVar(var) = region {
// Show these named, not as `'_` or elide them in "expected/found" notes.
r = format!("'z{} ", var.index());
} else if r == "'_" {
r.clear();
} else {
r.push(' ');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
//! Error Reporting for `impl` items that do not match the obligations from their `trait`.

use crate::hir::def_id::DefId;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::{Subtype, ValuePairs};
use crate::traits::ObligationCauseCode::CompareImplMethodObligation;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::ErrorReported;
use rustc_middle::ty::Ty;
use rustc_middle::ty::error::ExpectedFound;
use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::{self, Ty};
use rustc_span::Span;

impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
Expand Down Expand Up @@ -52,9 +56,52 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
.tcx()
.sess
.struct_span_err(sp, "`impl` item signature doesn't match `trait` item signature");
err.note(&format!("expected `{:?}`\n found `{:?}`", expected, found));
err.span_label(sp, &format!("found {:?}", found));
err.span_label(impl_sp, &format!("expected {:?}", expected));

struct EarlyBoundRegionHighlighter(FxHashSet<DefId>);
impl<'tcx> ty::fold::TypeVisitor<'tcx> for EarlyBoundRegionHighlighter {
fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
debug!("LateBoundRegionNameCollector visit_region {:?}", r);
match *r {
ty::ReFree(free) => {
self.0.insert(free.scope);
}

ty::ReEarlyBound(bound) => {
self.0.insert(bound.def_id);
}
_ => {}
}
r.super_visit_with(self)
}
}

let mut visitor = EarlyBoundRegionHighlighter(FxHashSet::default());
expected.visit_with(&mut visitor);

let note = !visitor.0.is_empty();

if let Some((expected, found)) = self
.tcx()
.infer_ctxt()
.enter(|infcx| infcx.expected_found_str_ty(&ExpectedFound { expected, found }))
{
err.note_expected_found(&"", expected, &"", found);
} else {
// This fallback shouldn't be necessary, but let's keep it in just in case.
err.note(&format!("expected `{:?}`\n found `{:?}`", expected, found));
}
if note {
err.note(
"the lifetime requirements from the `trait` could not be fulfilled by the \
`impl`",
);
err.help(
"consider adding a named lifetime to the `trait` that constrains the item's \
`self` argument, its inputs and its output with it",
);
}
err.emit();
}
}
4 changes: 2 additions & 2 deletions src/test/ui/coercion/coerce-mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main() {
let x = 0;
f(&x);
//~^ ERROR mismatched types
//~| expected mutable reference `&mut i32`
//~| found reference `&{integer}`
//~| expected mutable reference `&'z1 mut i32`
//~| found reference `&'z2 {integer}`
//~| types differ in mutability
}
4 changes: 2 additions & 2 deletions src/test/ui/coercion/coerce-mut.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | f(&x);
| ^^ types differ in mutability
|
= note: expected mutable reference `&mut i32`
found reference `&{integer}`
= note: expected mutable reference `&'z1 mut i32`
found reference `&'z2 {integer}`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/compare-method/reordered-type-param.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LL | fn b<F:Clone,G>(&self, _x: G) -> G { panic!() }
| expected type parameter
|
= note: expected fn pointer `fn(&E, F) -> F`
found fn pointer `fn(&E, G) -> G`
found fn pointer `fn(&'z0 E, G) -> G`
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/hrtb/hrtb-exists-forall-fn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | let _: for<'b> fn(&'b u32) = foo();
| expected due to this
|
= note: expected fn pointer `for<'b> fn(&'b u32)`
found fn pointer `fn(&u32)`
found fn pointer `fn(&'z0 u32)`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LL | fn foo<B: Debug>(&self, a: &impl Debug, b: &B) { }
| expected type parameter
|
= note: expected fn pointer `fn(&(), &B, &impl Debug)`
found fn pointer `fn(&(), &impl Debug, &B)`
found fn pointer `fn(&'z0 (), &impl Debug, &B)`
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/impl-trait/trait_type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn fmt(&self, x: &str) -> () { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected fn pointer `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
found fn pointer `fn(&MyType, &str)`
found fn pointer `fn(&'z0 MyType, &str)`

error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
--> $DIR/trait_type.rs:12:11
Expand Down
4 changes: 3 additions & 1 deletion src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ LL | fn deref(&self) -> &Self::Target;
| --------------------------------- expected fn(&Struct) -> &(dyn Trait + 'static)
|
= note: expected `fn(&Struct) -> &(dyn Trait + 'static)`
found `fn(&Struct) -> &dyn Trait`
found `fn(&'z0 Struct) -> &dyn Trait`
= note: the lifetime requirements from the `trait` could not be fulfilled by the `impl`
= help: consider adding a named lifetime to the `trait` that constrains the item's `self` argument, its inputs and its output with it

error: aborting due to previous error

4 changes: 3 additions & 1 deletion src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&i32, &u32, &u32) -> &u32
|
= note: expected `fn(&i32, &'a u32, &u32) -> &'a u32`
found `fn(&i32, &u32, &u32) -> &u32`
found `fn(&'z0 i32, &'z1 u32, &'z2 u32) -> &'z2 u32`
= note: the lifetime requirements from the `trait` could not be fulfilled by the `impl`
= help: consider adding a named lifetime to the `trait` that constrains the item's `self` argument, its inputs and its output with it

error[E0623]: lifetime mismatch
--> $DIR/mismatched_trait_impl.rs:10:9
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-13033.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ impl Foo for Baz {
fn bar(&mut self, other: &dyn Foo) {}
//~^ ERROR method `bar` has an incompatible type for trait
//~| expected fn pointer `fn(&mut Baz, &mut dyn Foo)`
//~| found fn pointer `fn(&mut Baz, &dyn Foo)`
//~| found fn pointer `fn(&'z0 mut Baz, &dyn Foo)`
}

fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-13033.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | fn bar(&mut self, other: &dyn Foo) {}
| ^^^^^^^^ types differ in mutability
|
= note: expected fn pointer `fn(&mut Baz, &mut dyn Foo)`
found fn pointer `fn(&mut Baz, &dyn Foo)`
found fn pointer `fn(&'z0 mut Baz, &dyn Foo)`
help: consider change the type to match the mutability in trait
|
LL | fn bar(&mut self, other: &mut dyn Foo) {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-16683.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ note: ...so that the types are compatible
LL | self.a();
| ^
= note: expected `&'a Self`
found `&Self`
found `&'z0 Self`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-17758.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ note: ...so that the types are compatible
LL | self.foo();
| ^^^
= note: expected `&'a Self`
found `&Self`
found `&'z0 Self`

error: aborting due to previous error

Expand Down
8 changes: 6 additions & 2 deletions src/test/ui/issues/issue-20225.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ LL | extern "rust-call" fn call(&self, (_,): (T,)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T`
|
= note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))`
found fn pointer `extern "rust-call" fn(&Foo, (T,))`
found fn pointer `extern "rust-call" fn(&'z0 Foo, (T,))`
= help: type parameters must be constrained to match other types
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

error[E0053]: method `call_mut` has an incompatible type for trait
--> $DIR/issue-20225.rs:11:3
Expand All @@ -18,7 +20,9 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T`
|
= note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))`
found fn pointer `extern "rust-call" fn(&mut Foo, (T,))`
found fn pointer `extern "rust-call" fn(&'z0 mut Foo, (T,))`
= help: type parameters must be constrained to match other types
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

error[E0053]: method `call_once` has an incompatible type for trait
--> $DIR/issue-20225.rs:18:3
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-21332.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn next(&mut self) -> Result<i32, i32> { Ok(7) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
|
= note: expected fn pointer `fn(&mut S) -> std::option::Option<i32>`
found fn pointer `fn(&mut S) -> std::result::Result<i32, i32>`
found fn pointer `fn(&'z0 mut S) -> std::result::Result<i32, i32>`

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&i32, &i32) -> &i32
|
= note: expected `fn(&i32, &'a i32) -> &'a i32`
found `fn(&i32, &i32) -> &i32`
found `fn(&'z0 i32, &'z0 i32) -> &'z0 i32`
= note: the lifetime requirements from the `trait` could not be fulfilled by the `impl`
= help: consider adding a named lifetime to the `trait` that constrains the item's `self` argument, its inputs and its output with it

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/mismatched_types/E0053.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LL | fn bar(&mut self) { }
| ^^^^^^^^^ types differ in mutability
|
= note: expected fn pointer `fn(&Bar)`
found fn pointer `fn(&mut Bar)`
found fn pointer `fn(&'z0 mut Bar)`
help: consider change the type to match the mutability in trait
|
LL | fn bar(&self) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LL | fn bar(&mut self, bar: &Bar) { }
| ^^^^ types differ in mutability
|
= note: expected fn pointer `fn(&mut Bar, &mut Bar)`
found fn pointer `fn(&mut Bar, &Bar)`
found fn pointer `fn(&'z0 mut Bar, &'z1 Bar)`
help: consider change the type to match the mutability in trait
|
LL | fn bar(&mut self, bar: &mut Bar) { }
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/nll/type-alias-free-regions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ note: ...so that the expression is assignable
|
LL | C { f: b }
| ^
= note: expected `std::boxed::Box<std::boxed::Box<&isize>>`
= note: expected `std::boxed::Box<std::boxed::Box<&'z0 isize>>`
found `std::boxed::Box<std::boxed::Box<&isize>>`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6...
--> $DIR/type-alias-free-regions.rs:15:6
Expand Down Expand Up @@ -49,7 +49,7 @@ note: ...so that the expression is assignable
|
LL | C { f: Box::new(b.0) }
| ^^^
= note: expected `std::boxed::Box<&isize>`
= note: expected `std::boxed::Box<&'z1 isize>`
found `std::boxed::Box<&isize>`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6...
--> $DIR/type-alias-free-regions.rs:25:6
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions-fn-subtyping-return-static-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | want_F(bar);
| ^^^ expected concrete lifetime, found bound lifetime parameter 'cx
|
= note: expected fn pointer `for<'cx> fn(&'cx S) -> &'cx S`
found fn item `for<'a> fn(&'a S) -> &S {bar::<'_>}`
found fn item `for<'a> fn(&'a S) -> &'z2 S {bar::<'_>}`

error[E0308]: mismatched types
--> $DIR/regions-fn-subtyping-return-static-fail.rs:48:12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ note: ...so that the expression is assignable
|
LL | Box::new(v)
| ^
= note: expected `&[u8]`
= note: expected `&'z1 [u8]`
found `&'a [u8]`
note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9...
--> $DIR/region-object-lifetime-in-coercion.rs:25:9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | want_F(bar);
| ^^^ expected concrete lifetime, found bound lifetime parameter 'cx
|
= note: expected fn pointer `for<'cx> fn(&'cx S) -> &'cx S`
found fn item `for<'a> fn(&'a S) -> &S {bar::<'_>}`
found fn item `for<'a> fn(&'a S) -> &'z2 S {bar::<'_>}`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-nested-fns.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LL | | return z;
LL | | }));
| |_____^
= note: expected `&isize`
found `&isize`
found `&'z13 isize`

error[E0312]: lifetime of reference outlives lifetime of borrowed content...
--> $DIR/regions-nested-fns.rs:14:27
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-ret-borrowed-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ note: ...so that the expression is assignable
|
LL | with(|o| o)
| ^
= note: expected `&isize`
= note: expected `&'z0 isize`
found `&isize`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14...
--> $DIR/regions-ret-borrowed-1.rs:9:14
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-ret-borrowed.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ note: ...so that the expression is assignable
|
LL | with(|o| o)
| ^
= note: expected `&isize`
= note: expected `&'z0 isize`
found `&isize`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14...
--> $DIR/regions-ret-borrowed.rs:12:14
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-trait-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn get_ctxt(&self) -> &'a Ctxt {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected fn pointer `fn(&HasCtxt<'a>) -> &Ctxt`
found fn pointer `fn(&HasCtxt<'a>) -> &'a Ctxt`
found fn pointer `fn(&'z0 HasCtxt<'a>) -> &'a Ctxt`
note: the lifetime `'a` as defined on the impl at 12:6...
--> $DIR/regions-trait-1.rs:12:6
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-trait-object-subtyping.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ note: ...so that the expression is assignable
LL | x
| ^
= note: expected `&'b mut (dyn Dummy + 'b)`
found `&mut (dyn Dummy + 'b)`
found `&'z1 mut (dyn Dummy + 'b)`

error[E0308]: mismatched types
--> $DIR/regions-trait-object-subtyping.rs:22:5
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ LL | Opts::A(ref mut i) | Opts::B(ref i) => {}
| |
| first introduced with type `&mut isize` here
|
= note: expected type `&mut isize`
found type `&isize`
= note: expected type `&'z0 mut isize`
found type `&'z1 isize`
= note: in the same arm, a binding must have the same type in all alternatives

error: aborting due to 6 previous errors
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/span/coerce-suggestions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ error[E0308]: mismatched types
LL | test(&y);
| ^^ types differ in mutability
|
= note: expected mutable reference `&mut std::string::String`
found reference `&std::string::String`
= note: expected mutable reference `&'z2 mut std::string::String`
found reference `&'z3 std::string::String`

error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:14:11
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/traits/trait-impl-method-mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | unsafe fn jumbo(&self, x: &usize) { *self + *x; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
|
= note: expected fn pointer `fn(&usize, &usize) -> usize`
found fn pointer `unsafe fn(&usize, &usize)`
found fn pointer `unsafe fn(&'z0 usize, &'z1 usize)`

error: aborting due to previous error

Expand Down
Loading