未验证 提交 90e941a9 编写于 作者: D David Wood

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: NDavid Wood <david@davidtw.co>
上级 4825e12f
......@@ -627,8 +627,9 @@ fn visit_const(&mut self, constant: &&'tcx ty::Const<'tcx>, location: Location)
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
),
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册