Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 133 additions & 18 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ dependencies = [
"memchr",
"proc-macro2",
"quote",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"serde",
"serde_derive",
"syn",
Expand All @@ -218,7 +218,7 @@ version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7db09fde9143e7ac4513358fb32ee32847125b63b18ea715afd487956da715da"
dependencies = [
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"serde",
"serde_derive",
"unicode-ident",
Expand Down Expand Up @@ -287,9 +287,9 @@ dependencies = [

[[package]]
name = "bitflags"
version = "2.10.0"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"

[[package]]
name = "blake3"
Expand Down Expand Up @@ -662,7 +662,7 @@ dependencies = [
"declare_clippy_lint",
"filetime",
"itertools",
"pulldown-cmark",
"pulldown-cmark 0.11.3",
"regex",
"rustc_tools_util 0.4.2",
"serde",
Expand Down Expand Up @@ -1250,6 +1250,12 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921"

[[package]]
name = "dtoa"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590"

[[package]]
name = "dyn-clone"
version = "1.0.20"
Expand Down Expand Up @@ -1417,7 +1423,7 @@ dependencies = [
"fluent-syntax",
"intl-memoizer",
"intl_pluralrules",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"self_cell",
"smallvec",
"unic-langid",
Expand Down Expand Up @@ -2104,7 +2110,7 @@ dependencies = [
"anyhow",
"clap",
"fs-err",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"rustdoc-json-types",
"serde",
"serde_json",
Expand Down Expand Up @@ -2361,6 +2367,35 @@ dependencies = [
"regex-automata",
]

[[package]]
name = "math-core"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "938914f21d07488e5c9b2386d951494976b158b9616ee67bbda5afa5c2924eeb"
dependencies = [
"math-core-renderer-internal",
"memchr",
"phf 0.13.1",
"rustc-hash 2.1.2",
"static_assertions",
"strum",
"strum_macros",
]

[[package]]
name = "math-core-renderer-internal"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3716dfbc3e092d5b212c0b03e6fedb60ffbceb21ed5df9346a09866f47d07e84"
dependencies = [
"bitflags",
"dtoa",
"stable-arena",
"static_assertions",
"strum",
"strum_macros",
]

[[package]]
name = "md-5"
version = "0.10.6"
Expand Down Expand Up @@ -2899,13 +2934,24 @@ dependencies = [
"phf_shared 0.12.1",
]

[[package]]
name = "phf"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
dependencies = [
"phf_macros",
"phf_shared 0.13.1",
"serde",
]

[[package]]
name = "phf_codegen"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
dependencies = [
"phf_generator",
"phf_generator 0.11.3",
"phf_shared 0.11.3",
]

Expand All @@ -2919,6 +2965,29 @@ dependencies = [
"rand 0.8.5",
]

[[package]]
name = "phf_generator"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
dependencies = [
"fastrand",
"phf_shared 0.13.1",
]

[[package]]
name = "phf_macros"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
dependencies = [
"phf_generator 0.13.1",
"phf_shared 0.13.1",
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "phf_shared"
version = "0.11.3"
Expand All @@ -2937,6 +3006,15 @@ dependencies = [
"siphasher",
]

[[package]]
name = "phf_shared"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
dependencies = [
"siphasher",
]

[[package]]
name = "pin-project-lite"
version = "0.2.16"
Expand Down Expand Up @@ -3093,6 +3171,18 @@ dependencies = [
"unicase",
]

[[package]]
name = "pulldown-cmark"
version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad"
dependencies = [
"bitflags",
"memchr",
"pulldown-cmark-escape",
"unicase",
]

[[package]]
name = "pulldown-cmark-escape"
version = "0.11.0"
Expand Down Expand Up @@ -3409,9 +3499,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustc-hash"
version = "2.1.1"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"

[[package]]
name = "rustc-literal-escaper"
Expand Down Expand Up @@ -3777,7 +3867,7 @@ dependencies = [
"memmap2",
"parking_lot",
"portable-atomic",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"rustc-stable-hash",
"rustc_arena",
"rustc_graphviz",
Expand Down Expand Up @@ -4454,7 +4544,7 @@ dependencies = [
name = "rustc_pattern_analysis"
version = "0.0.0"
dependencies = [
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"rustc_abi",
"rustc_apfloat",
"rustc_arena",
Expand Down Expand Up @@ -4548,7 +4638,7 @@ version = "0.0.0"
dependencies = [
"indexmap",
"itertools",
"pulldown-cmark",
"pulldown-cmark 0.13.3",
"rustc_arena",
"rustc_ast",
"rustc_ast_pretty",
Expand Down Expand Up @@ -4782,7 +4872,7 @@ dependencies = [
"derive-where",
"ena",
"indexmap",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"rustc_abi",
"rustc_ast_ir",
"rustc_data_structures",
Expand Down Expand Up @@ -4833,6 +4923,7 @@ dependencies = [
"expect-test",
"indexmap",
"itertools",
"math-core",
"minifier",
"proc-macro2",
"pulldown-cmark-escape",
Expand Down Expand Up @@ -4867,7 +4958,7 @@ version = "0.1.0"
dependencies = [
"bincode",
"rkyv",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"serde",
"serde_derive",
"serde_json",
Expand Down Expand Up @@ -5250,6 +5341,12 @@ dependencies = [
"color-eyre",
]

[[package]]
name = "stable-arena"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a6572b16faf73db61fab0b1d848ce108e20d026dc20dcb043a3f83c73ad1c09"

[[package]]
name = "stable_deref_trait"
version = "1.2.1"
Expand Down Expand Up @@ -5294,7 +5391,7 @@ version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"
dependencies = [
"phf_generator",
"phf_generator 0.11.3",
"phf_shared 0.11.3",
"proc-macro2",
"quote",
Expand All @@ -5315,6 +5412,24 @@ version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"

[[package]]
name = "strum"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd"

[[package]]
name = "strum_macros"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "syn"
version = "2.0.110"
Expand Down Expand Up @@ -5526,7 +5641,7 @@ dependencies = [
"ignore",
"miropt-test-tools",
"regex",
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
"semver",
"serde",
"similar",
Expand Down Expand Up @@ -5825,7 +5940,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb30dbbd9036155e74adad6812e9898d03ec374946234fbcebd5dfc7b9187b90"
dependencies = [
"rustc-hash 2.1.1",
"rustc-hash 2.1.2",
]

[[package]]
Expand Down
39 changes: 38 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use rustc_errors::{Applicability, msg};
use rustc_feature::template;
use rustc_hir::Target;
use rustc_hir::attrs::{
AttributeKind, CfgEntry, CfgHideShow, CfgInfo, DocAttribute, DocInline, HideOrShow,
AttributeKind, CfgEntry, CfgHideShow, CfgInfo, DocAttribute, DocAttributeSyntax, DocInline,
HideOrShow,
};
use rustc_session::errors::feature_err;
use rustc_span::{Span, Symbol, edition, sym};
Expand Down Expand Up @@ -574,6 +575,42 @@ impl DocParser {
}
}
}
Some(sym::syntax) => {
if !cx.features().rustdoc_texmath() {
feature_err(
cx.sess(),
sym::rustdoc_texmath,
path.span(),
msg!("the `#[doc(syntax)]` attribute is unstable"),
)
.emit();
}
let span = args.span().unwrap_or(path.span());
let tex_math_dollars = if let Some(v) = args.as_name_value()
&& let Some(syntax) = v.value_as_str()
{
match syntax.as_str() {
"+tex_math_dollars" => true,
"-tex_math_dollars" => false,
_ => {
cx.emit_lint(
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
MalformedDoc,
span,
);
false
}
}
} else {
cx.emit_lint(
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
MalformedDoc,
span,
);
false
};
self.attribute.syntax = Some(DocAttributeSyntax { tex_math_dollars, span });
}
Some(sym::spotlight) => {
let span = path.span();
cx.emit_lint(
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ declare_features! (
(internal, rustdoc_internals, "1.58.0", Some(90418)),
/// Allows using the `rustdoc::missing_doc_code_examples` lint
(unstable, rustdoc_missing_doc_code_examples, "1.31.0", Some(101730)),
/// Allows using the `#[doc(math_syntax)]` and `#[doc(no_math_syntax)]` crate attributes
(unstable, rustdoc_texmath, "CURRENT_RUSTC_VERSION", None),
/// Introduces a hierarchy of `Sized` traits (RFC 3729).
(unstable, sized_hierarchy, "1.89.0", Some(144404)),
/// Allows using `#[structural_match]` which indicates that a type is structurally matchable.
Expand Down
Loading
Loading