Skip to content

Commit aa5a386

Browse files
Correctly handle doc(test(attr(...)))
1 parent 709525f commit aa5a386

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4867,9 +4867,9 @@ dependencies = [
48674867
"indexmap",
48684868
"itertools",
48694869
"minifier",
4870+
"proc-macro2",
48704871
"pulldown-cmark-escape",
48714872
"regex",
4872-
"rustc_proc_macro",
48734873
"rustdoc-json-types",
48744874
"serde",
48754875
"serde_json",

compiler/rustc_attr_parsing/src/attributes/doc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ impl DocParser {
115115
return;
116116
};
117117

118-
// FIXME: convert list into a Vec of `AttributeKind`.
119-
for _ in list.mixed() {
120-
// self.attribute.test_attrs.push(AttributeKind::parse());
118+
// FIXME: convert list into a Vec of `AttributeKind` because current code is awful.
119+
for attr in list.mixed() {
120+
self.attribute.test_attrs.push(attr.span());
121121
}
122122
}
123123
Some(name) => {

src/librustdoc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ base64 = "0.21.7"
1515
indexmap = { version = "2", features = ["serde"] }
1616
itertools = "0.12"
1717
minifier = { version = "0.3.5", default-features = false }
18+
proc-macro2 = "1.0.103"
1819
pulldown-cmark-escape = { version = "0.11.0", features = ["simd"] }
1920
regex = "1"
2021
rustdoc-json-types = { path = "../rustdoc-json-types" }
21-
rustc_proc_macro = { path = "../../compiler/rustc_proc_macro" }
2222
serde = { version = "1.0", features = ["derive"] }
2323
serde_json = "1.0"
2424
smallvec = "1.8.1"

src/librustdoc/doctest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::{panic, str};
1717

1818
pub(crate) use make::{BuildDocTestBuilder, DocTestBuilder};
1919
pub(crate) use markdown::test as test_markdown;
20+
use proc_macro2::{TokenStream, TokenTree};
2021
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxHasher, FxIndexMap, FxIndexSet};
2122
use rustc_errors::emitter::HumanReadableErrorType;
2223
use rustc_errors::{ColorConfig, DiagCtxtHandle};
@@ -25,7 +26,6 @@ use rustc_hir::def_id::LOCAL_CRATE;
2526
use rustc_hir::{Attribute, CRATE_HIR_ID};
2627
use rustc_interface::interface;
2728
use rustc_middle::ty::TyCtxt;
28-
use rustc_proc_macro::{TokenStream, TokenTree};
2929
use rustc_session::config::{self, CrateType, ErrorOutputType, Input};
3030
use rustc_session::lint;
3131
use rustc_span::edition::Edition;

src/librustdoc/doctest/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use std::env;
55
use std::str::FromStr;
66
use std::sync::Arc;
77

8+
use proc_macro2::{TokenStream, TokenTree};
89
use rustc_hir::attrs::AttributeKind;
910
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
1011
use rustc_hir::{self as hir, Attribute, CRATE_HIR_ID, intravisit};
1112
use rustc_middle::hir::nested_filter;
1213
use rustc_middle::ty::TyCtxt;
13-
use rustc_proc_macro::{TokenStream, TokenTree};
1414
use rustc_resolve::rustdoc::span_of_fragments;
1515
use rustc_span::source_map::SourceMap;
1616
use rustc_span::{BytePos, DUMMY_SP, FileName, Pos, Span};

0 commit comments

Comments
 (0)