diff options
| author | lqd <remy.rakic+github@gmail.com> | 2019-01-25 18:35:47 +0100 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic@gmail.com> | 2019-01-27 10:52:41 +0100 |
| commit | a6028263d2c9c3568f86e57d6b8400e05d3cfe1b (patch) | |
| tree | 34f745260534ae8b99f2054c1c323c9ffd8f17a1 | |
| parent | c1437c944c280ff9d761c45912167f1023d0e24c (diff) | |
| download | rust-a6028263d2c9c3568f86e57d6b8400e05d3cfe1b.tar.gz rust-a6028263d2c9c3568f86e57d6b8400e05d3cfe1b.zip | |
Handle higher-ranked lifetime conflict errors where the subtype is the `sup` region
These are happening since the switch to universes, and will now go through the "placeholder error" path, instead of the current fallback of E308 "mismatched types" errors.
| -rw-r--r-- | src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs b/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs index 7ece3d38a7f..636b66bef01 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs @@ -96,6 +96,30 @@ impl NiceRegionError<'me, 'gcx, 'tcx> { )) } + Some(RegionResolutionError::SubSupConflict( + vid, + _, + _, + _, + SubregionOrigin::Subtype(TypeTrace { + cause, + values: ValuePairs::TraitRefs(ExpectedFound { expected, found }), + }), + sup_placeholder @ ty::RePlaceholder(_), + )) + if expected.def_id == found.def_id => + { + Some(self.try_report_placeholders_trait( + Some(self.tcx().mk_region(ty::ReVar(*vid))), + cause, + None, + Some(*sup_placeholder), + expected.def_id, + expected.substs, + found.substs, + )) + } + Some(RegionResolutionError::ConcreteFailure( SubregionOrigin::Subtype(TypeTrace { cause, |
