diff options
| author | David Wood <david@davidtw.co> | 2020-07-22 10:31:12 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2020-07-22 15:36:22 +0100 |
| commit | 90e941a974e3561efa18c148de24db1f401cd3c4 (patch) | |
| tree | 7f4a22cafc568ba2d9ecd15c8a98777773510b2c | |
| parent | 4825e12fc9c79954aa0fe18f5521efa6c19c7539 (diff) | |
| download | rust-90e941a974e3561efa18c148de24db1f401cd3c4.tar.gz rust-90e941a974e3561efa18c148de24db1f401cd3c4.zip | |
mir: improve polymorphic constant bug
This commit changes the span and content of the "collection encountered polymorphic constant" bug in monomorphization collection to point to the use of the constant rather than the definition. Signed-off-by: David Wood <david@davidtw.co>
| -rw-r--r-- | src/librustc_mir/monomorphize/collector.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index 0b5f27fc17a..e724180f4d8 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -627,8 +627,9 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { Ok(val) => collect_const_value(self.tcx, val, self.output), Err(ErrorHandled::Reported(ErrorReported) | ErrorHandled::Linted) => {} Err(ErrorHandled::TooGeneric) => span_bug!( - self.tcx.def_span(def.did), - "collection encountered polymorphic constant", + self.body.source_info(location).span, + "collection encountered polymorphic constant: {}", + substituted_constant ), } } |
