Skip to content

Commit 487c0ce

Browse files
committed
Make markdown module public for doc-tests
1 parent 9a3548c commit 487c0ce

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/librustdoc/clean/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ crate struct ItemLink {
440440
pub(crate) fragment: Option<String>,
441441
}
442442

443-
crate struct RenderedLink {
443+
pub struct RenderedLink {
444444
/// The text the link was original written as.
445445
///
446446
/// This could potentially include disambiguators and backticks.

src/librustdoc/html/markdown.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ pub(crate) fn opts() -> Options {
4949

5050
/// When `to_string` is called, this struct will emit the HTML corresponding to
5151
/// the rendered version of the contained markdown string.
52-
crate struct Markdown<'a>(
53-
crate &'a str,
52+
pub struct Markdown<'a>(
53+
pub &'a str,
5454
/// A list of link replacements.
55-
crate &'a [RenderedLink],
55+
pub &'a [RenderedLink],
5656
/// The current list of used header IDs.
57-
crate &'a mut IdMap,
57+
pub &'a mut IdMap,
5858
/// Whether to allow the use of explicit error codes in doctest lang strings.
59-
crate ErrorCodes,
59+
pub ErrorCodes,
6060
/// Default edition to use when parsing doctests (to add a `fn main`).
61-
crate Edition,
62-
crate &'a Option<Playground>,
61+
pub Edition,
62+
pub &'a Option<Playground>,
6363
);
6464
/// A tuple struct like `Markdown` that renders the markdown with a table of contents.
6565
crate struct MarkdownWithToc<'a>(
@@ -81,7 +81,7 @@ crate struct MarkdownHtml<'a>(
8181
crate struct MarkdownSummaryLine<'a>(pub &'a str, pub &'a [RenderedLink]);
8282

8383
#[derive(Copy, Clone, PartialEq, Debug)]
84-
crate enum ErrorCodes {
84+
pub enum ErrorCodes {
8585
Yes,
8686
No,
8787
}
@@ -160,7 +160,7 @@ fn slugify(c: char) -> Option<char> {
160160
}
161161

162162
#[derive(Clone, Debug)]
163-
crate struct Playground {
163+
pub struct Playground {
164164
crate crate_name: Option<String>,
165165
crate url: String,
166166
}
@@ -923,7 +923,7 @@ impl LangString {
923923
}
924924

925925
impl Markdown<'_> {
926-
crate fn into_string(self) -> String {
926+
pub fn into_string(self) -> String {
927927
let Markdown(md, links, mut ids, codes, edition, playground) = self;
928928

929929
// This is actually common enough to special-case
@@ -1210,7 +1210,7 @@ crate fn rust_code_blocks(md: &str, extra_info: &ExtraInfo<'_, '_>) -> Vec<RustC
12101210
}
12111211

12121212
#[derive(Clone, Default, Debug)]
1213-
crate struct IdMap {
1213+
pub struct IdMap {
12141214
map: FxHashMap<String, usize>,
12151215
}
12161216

@@ -1243,7 +1243,7 @@ fn init_id_map() -> FxHashMap<String, usize> {
12431243
}
12441244

12451245
impl IdMap {
1246-
crate fn new() -> Self {
1246+
pub fn new() -> Self {
12471247
IdMap { map: init_id_map() }
12481248
}
12491249

src/librustdoc/html/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ crate mod escape;
22
crate mod format;
33
crate mod highlight;
44
crate mod layout;
5-
crate mod markdown;
5+
pub mod markdown;
66
crate mod render;
77
crate mod sources;
88
crate mod static_files;

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ mod error;
7777
mod doctest;
7878
mod fold;
7979
crate mod formats;
80-
crate mod html;
80+
pub mod html;
8181
mod json;
8282
mod markdown;
8383
mod passes;

0 commit comments

Comments
 (0)