use consistent names

This commit is contained in:
Nathan Stocks 2022-09-21 22:30:14 -06:00
parent c24a87315a
commit b8e03cfa55
2 changed files with 6 additions and 6 deletions

View File

@ -1862,11 +1862,11 @@ impl CheckAttrVisitor<'_> {
match std::fs::File::open(&file) {
Ok(_) => true,
Err(err) => {
Err(error) => {
self.tcx.sess.emit_err(DebugVisualizerUnreadable {
span: meta_item.span,
file: &file,
error: err,
error,
});
false
}

View File

@ -35,8 +35,8 @@ impl<'tcx> LanguageItemCollector<'tcx> {
fn check_for_lang(&mut self, actual_target: Target, hir_id: HirId) {
let attrs = self.tcx.hir().attrs(hir_id);
if let Some((value, span)) = extract(&attrs) {
match ITEM_REFS.get(&value).cloned() {
if let Some((name, span)) = extract(&attrs) {
match ITEM_REFS.get(&name).cloned() {
// Known lang item with attribute on correct target.
Some((item_index, expected_target)) if actual_target == expected_target => {
self.collect_item_extended(item_index, hir_id, span);
@ -45,14 +45,14 @@ impl<'tcx> LanguageItemCollector<'tcx> {
Some((_, expected_target)) => {
self.tcx.sess.emit_err(LangItemOnIncorrectTarget {
span,
name: value,
name,
expected_target,
actual_target,
});
}
// Unknown lang item.
_ => {
self.tcx.sess.emit_err(UnknownLangItem { span, name: value });
self.tcx.sess.emit_err(UnknownLangItem { span, name });
}
}
}