diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-12-02 23:08:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-02 23:08:58 +0100 |
| commit | 6f9f17fc08d9c3b1910b1d39f76a494d7524a2cc (patch) | |
| tree | d2570dd613f0bd41349f4c3bf44ea10b7b595f6f /compiler/rustc_trait_selection/src | |
| parent | 3586e4a326e923f9cbf2b724bb638b254a76407d (diff) | |
| parent | da182b6d95d4b8480045756a41270e43bc496c26 (diff) | |
| download | rust-6f9f17fc08d9c3b1910b1d39f76a494d7524a2cc.tar.gz rust-6f9f17fc08d9c3b1910b1d39f76a494d7524a2cc.zip | |
Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxu
Change `AttrArgs::Eq` to a struct variant Cleanups for simplifying https://github.com/rust-lang/rust/pull/131808 Basically changes `AttrArgs::Eq` to a struct variant and then avoids several matches on `AttrArgsEq` in favor of methods on it. This will make future refactorings simpler, as they can either keep methods or switch to field accesses without having to restructure code
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs index 7f42c932fcf..f10314c1c9e 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs @@ -1,7 +1,7 @@ use std::iter; use std::path::PathBuf; -use rustc_ast::{AttrArgs, AttrArgsEq, AttrKind, Attribute, MetaItemInner}; +use rustc_ast::{AttrArgs, AttrKind, Attribute, MetaItemInner}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::codes::*; use rustc_errors::{ErrorGuaranteed, struct_span_code_err}; @@ -639,8 +639,7 @@ impl<'tcx> OnUnimplementedDirective { let report_span = match &item.args { AttrArgs::Empty => item.path.span, AttrArgs::Delimited(args) => args.dspan.entire(), - AttrArgs::Eq(eq_span, AttrArgsEq::Ast(expr)) => eq_span.to(expr.span), - AttrArgs::Eq(span, AttrArgsEq::Hir(expr)) => span.to(expr.span), + AttrArgs::Eq { eq_span, value } => eq_span.to(value.span()), }; if let Some(item_def_id) = item_def_id.as_local() { |
