diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2021-09-16 16:53:40 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2021-09-16 16:53:40 -0500 |
| commit | 31cdd8cdd2a20dbdeae3d3f79d5f9080d431a87d (patch) | |
| tree | 9260a4e81a536bd0a81f0c0e156c3e3aa660b2af /src/test/ui/object-lifetime | |
| parent | 237bb5e0088782945d2c3146e4907e3a5e9c7c2c (diff) | |
Propagate coercion cause into `try_coerce`
Currently, `coerce_inner` discards its `ObligationCause` when calling `try_coerce`. This interfers with other diagnostc improvements I'm working on, since we will lose the original span by the time the actual coercion occurs. Additionally, we now use the span of the trailing expression (rather than the span of the entire function) when performing a coercion in `check_return_expr`. This currently has no visible effect on any of the unit tests, but will unblock future diagnostic improvements.
Diffstat (limited to 'src/test/ui/object-lifetime')
| -rw-r--r-- | src/test/ui/object-lifetime/object-lifetime-default-elision.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr index 79ded5fc875..ee1a4612572 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr @@ -19,7 +19,7 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu | LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { | ^^ -note: ...so that the expression is assignable +note: ...so that the types are compatible --> $DIR/object-lifetime-default-elision.rs:71:5 | LL | ss @@ -48,7 +48,7 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu | LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { | ^^ -note: ...so that the expression is assignable +note: ...so that the types are compatible --> $DIR/object-lifetime-default-elision.rs:71:5 | LL | ss |
