mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Minor pub
and whitespace cleanups.
This commit is contained in:
parent
d8ea468994
commit
ce222328d7
@ -42,12 +42,9 @@ use std::collections::hash_map::Entry;
|
|||||||
|
|
||||||
#[derive(LintDiagnostic)]
|
#[derive(LintDiagnostic)]
|
||||||
#[diag(passes_diagnostic_diagnostic_on_unimplemented_only_for_traits)]
|
#[diag(passes_diagnostic_diagnostic_on_unimplemented_only_for_traits)]
|
||||||
pub struct DiagnosticOnUnimplementedOnlyForTraits;
|
struct DiagnosticOnUnimplementedOnlyForTraits;
|
||||||
|
|
||||||
pub(crate) fn target_from_impl_item<'tcx>(
|
fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) -> Target {
|
||||||
tcx: TyCtxt<'tcx>,
|
|
||||||
impl_item: &hir::ImplItem<'_>,
|
|
||||||
) -> Target {
|
|
||||||
match impl_item.kind {
|
match impl_item.kind {
|
||||||
hir::ImplItemKind::Const(..) => Target::AssocConst,
|
hir::ImplItemKind::Const(..) => Target::AssocConst,
|
||||||
hir::ImplItemKind::Fn(..) => {
|
hir::ImplItemKind::Fn(..) => {
|
||||||
@ -99,7 +96,7 @@ struct CheckAttrVisitor<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> CheckAttrVisitor<'tcx> {
|
impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||||
pub fn dcx(&self) -> &'tcx DiagCtxt {
|
fn dcx(&self) -> &'tcx DiagCtxt {
|
||||||
self.tcx.dcx()
|
self.tcx.dcx()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,8 +149,9 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// When there's a duplicate lang item, something went very wrong and there's no value in recovering or doing anything.
|
// When there's a duplicate lang item, something went very wrong and there's no value
|
||||||
// Give the user the one message to let them debug the mess they created and then wish them farewell.
|
// in recovering or doing anything. Give the user the one message to let them debug the
|
||||||
|
// mess they created and then wish them farewell.
|
||||||
self.tcx.dcx().emit_fatal(DuplicateLangItem {
|
self.tcx.dcx().emit_fatal(DuplicateLangItem {
|
||||||
local_span: item_span,
|
local_span: item_span,
|
||||||
lang_item_name,
|
lang_item_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user