@@ -37,30 +37,42 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
37
37
--output $(objtree ) /rust/doc --crate-name $(subst rustdoc-,,$@ ) \
38
38
@$(objtree ) /include/generated/rustc_cfg $<
39
39
40
- rustdoc : rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc rustdoc-kernel
40
+ # This is a temporary fix for the CSS, visible on `type`s (`Result`).
41
+ # It is already fixed in nightly.
42
+ RUSTDOC_FIX_BEFORE := .impl,.method,.type:not(.container-rustdoc),.associatedconstant,.associatedtype
43
+ RUSTDOC_FIX_AFTER := .impl,.impl-items .method,.methods .method,.impl-items \
44
+ .type,.methods .type,.impl-items .associatedconstant,.methods \
45
+ .associatedconstant,.impl-items .associatedtype,.methods .associatedtype
46
+
47
+ rustdoc : rustdoc-core rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc rustdoc-kernel
48
+ $(Q ) cp $(srctree ) /Documentation/rust/assets/* $(objtree ) /rust/doc
49
+ $(Q ) sed -i " s/$( RUSTDOC_FIX_BEFORE) /$( RUSTDOC_FIX_AFTER) /" \
50
+ $(objtree ) /rust/doc/rustdoc.css
41
51
42
52
rustdoc-macros : private rustdoc_host = yes
43
53
rustdoc-macros : private rustc_target_flags = --crate-type proc-macro \
44
54
--extern proc_macro
45
55
rustdoc-macros : $(srctree ) /rust/macros/lib.rs FORCE
46
56
$(call if_changed,rustdoc)
47
57
48
- rustdoc-compiler_builtins : $(srctree ) /rust/compiler_builtins.rs FORCE
58
+ rustdoc-compiler_builtins : $(srctree ) /rust/compiler_builtins.rs rustdoc-core FORCE
49
59
$(call if_changed,rustdoc)
50
60
51
61
# We need to allow `broken_intra_doc_links` because some
52
62
# `no_global_oom_handling` functions refer to non-`no_global_oom_handling`
53
63
# functions. Ideally `rustdoc` would have a way to distinguish broken links
54
64
# due to things that are "configured out" vs. entirely non-existing ones.
55
65
rustdoc-alloc : private rustc_target_flags = --cfg no_global_oom_handling \
56
- -Abroken_intra_doc_links
57
- rustdoc-alloc : $(srctree ) /rust/alloc/lib.rs FORCE
66
+ -Abroken_intra_doc_links
67
+ rustdoc-alloc : $(srctree ) /rust/alloc/lib.rs rustdoc-core \
68
+ rustdoc-compiler_builtins FORCE
58
69
$(call if_changed,rustdoc)
59
70
60
71
rustdoc-kernel : private rustc_target_flags = --extern alloc \
61
72
--extern build_error \
62
73
--extern macros=$(objtree)/rust/libmacros.so
63
- rustdoc-kernel : $(srctree ) /rust/kernel/lib.rs rustdoc-macros \
74
+ rustdoc-kernel : $(srctree ) /rust/kernel/lib.rs rustdoc-core \
75
+ rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc \
64
76
$(objtree)/rust/libmacros.so $(objtree)/rust/bindings_generated.rs FORCE
65
77
$(call if_changed,rustdoc)
66
78
@@ -299,3 +311,6 @@ $(objtree)/rust/kernel.o: $(srctree)/rust/kernel/lib.rs $(objtree)/rust/alloc.o
299
311
$(objtree ) /rust/core.o : private skip_clippy = 1
300
312
$(objtree ) /rust/core.o : $$(RUST_LIB_SRC ) /core/src/lib.rs FORCE
301
313
$(call if_changed_dep,rustc_library)
314
+
315
+ rustdoc-core : $$(RUST_LIB_SRC ) /core/src/lib.rs FORCE
316
+ $(call if_changed,rustdoc)
0 commit comments