Skip to content

Commit 98ab94b

Browse files
committed
Use proper find_attr syntax
1 parent a9c068c commit 98ab94b

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustc_errors::codes::*;
1616
use rustc_errors::{
1717
Applicability, Diag, MultiSpan, StashKey, listify, pluralize, struct_span_code_err,
1818
};
19-
use rustc_hir::attrs::AttributeKind;
2019
use rustc_hir::attrs::diagnostic::OnUnimplementedNote;
2120
use rustc_hir::def::{CtorKind, DefKind, Res};
2221
use rustc_hir::def_id::DefId;

compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use rustc_errors::{
1414
Applicability, Diag, ErrorGuaranteed, Level, MultiSpan, StashKey, StringPart, Suggestions, msg,
1515
pluralize, struct_span_code_err,
1616
};
17-
use rustc_hir::attrs::AttributeKind;
1817
use rustc_hir::attrs::diagnostic::{AppendConstMessage, OnUnimplementedNote};
1918
use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId};
2019
use rustc_hir::intravisit::Visitor;
@@ -912,7 +911,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
912911
diag.long_ty_path(),
913912
);
914913

915-
if let Some(command) = find_attr!(self.tcx.get_all_attrs(impl_did), AttributeKind::OnConst {directive, ..} => directive.as_deref()).flatten(){
914+
if let Some(command) = find_attr!(self.tcx, impl_did, OnConst {directive, ..} => directive.as_deref()).flatten(){
916915
let note = command.evaluate_directive(
917916
predicate.skip_binder().trait_ref,
918917
&condition_options,

compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::path::PathBuf;
22

33
use rustc_hir as hir;
4-
use rustc_hir::attrs::AttributeKind;
54
use rustc_hir::attrs::diagnostic::{ConditionOptions, FormatArgs, OnUnimplementedNote};
65
use rustc_hir::def_id::LocalDefId;
76
use rustc_hir::find_attr;
@@ -44,7 +43,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
4443
}
4544
let (condition_options, format_args) =
4645
self.on_unimplemented_components(trait_pred, obligation, long_ty_path);
47-
if let Some(command) = find_attr!(self.tcx.get_all_attrs( trait_pred.def_id()), AttributeKind::OnUnimplemented {directive, ..} => directive.as_deref()).flatten() {
46+
if let Some(command) = find_attr!(self.tcx, trait_pred.def_id(), OnUnimplemented {directive, ..} => directive.as_deref()).flatten() {
4847
command.evaluate_directive(
4948
trait_pred.skip_binder().trait_ref,
5049
&condition_options,

0 commit comments

Comments
 (0)