Skip to content

Commit 21db004

Browse files
Fix invalid jump to def link generated on derive attributes
1 parent b2ee1b3 commit 21db004

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/librustdoc/html/render/span_map.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use rustc_hir::intravisit::{self, Visitor, VisitorExt};
77
use rustc_hir::{ExprKind,HirId,Item,ItemKind,Mod,Node,QPath};
88
use rustc_middle::hir::nested_filter;
99
use rustc_middle::ty::TyCtxt;
10-
use rustc_span::hygiene::MacroKind;
1110
use rustc_span::{BytePos,ExpnKind};
1211

1312
usecrate::clean::{self,PrimitiveType, rustc_span};
@@ -194,7 +193,7 @@ impl SpanMapVisitor<'_> {
194193
}
195194

196195
let macro_name = match data.kind{
197-
ExpnKind::Macro(MacroKind::Bang, macro_name) => macro_name,
196+
ExpnKind::Macro(_, macro_name) => macro_name,
198197
// Even though we don't handle this kind of macro, this `data` still comes from
199198
// expansion so we return `true` so we don't go any deeper in this code.
200199
_ => returntrue,

‎tests/rustdoc/jump-to-def-assoc-items.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ impl C {
2626
pubfnwat(){}
2727
}
2828

29+
//@ has - '//a[@href="{{channel}}/core/fmt/macros/macro.Debug.html"]' 'Debug'
30+
//@ has - '//a[@href="{{channel}}/core/cmp/macro.PartialEq.html"]' 'PartialEq'
31+
#[derive(Debug,PartialEq)]
2932
pubstructBar;
3033
implTraitforBar{
3134
typeT = Foo;

0 commit comments

Comments
 (0)