@@ -61,15 +61,9 @@ core-cfgs = \
6161 --cfg no_fp_fmt_parse
6262
6363alloc-cfgs = \
64- --cfg no_borrow \
65- --cfg no_fmt \
6664 --cfg no_global_oom_handling \
67- --cfg no_macros \
6865 --cfg no_rc \
69- --cfg no_str \
70- --cfg no_string \
71- --cfg no_sync \
72- --cfg no_thin
66+ --cfg no_sync
7367
7468quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host ) ,H, ) $<
7569 cmd_rustdoc = \
@@ -123,7 +117,7 @@ rustdoc-compiler_builtins: $(src)/compiler_builtins.rs rustdoc-core FORCE
123117# due to things that are "configured out" vs. entirely non-existing ones.
124118rustdoc-alloc : private rustc_target_flags = $(alloc-cfgs ) \
125119 -Arustdoc ::broken_intra_doc_links
126- rustdoc-alloc : $(src ) /alloc/lib.rs rustdoc-core rustdoc-compiler_builtins FORCE
120+ rustdoc-alloc : $(RUST_LIB_SRC ) /alloc/src /lib.rs rustdoc-core rustdoc-compiler_builtins FORCE
127121 +$(call if_changed,rustdoc)
128122
129123rustdoc-kernel : private rustc_target_flags = --extern alloc \
@@ -219,8 +213,6 @@ rusttest: rusttest-macros rusttest-kernel
219213# - `cargo` only considers the use case of building the standard library
220214# to use it in a given package. Thus we need to create a dummy package
221215# and pick the generated libraries from there.
222- # - Since we only keep a subset of upstream `alloc` in-tree, we need
223- # to recreate it on the fly by putting our sources on top.
224216# - The usual ways of modifying the dependency graph in `cargo` do not seem
225217# to apply for the `-Zbuild-std` steps, thus we have to mislead it
226218# by modifying the sources in the sysroot.
@@ -239,8 +231,6 @@ quiet_cmd_rustsysroot = RUSTSYSROOT
239231 rm -rf $(objtree ) /$(obj ) /test; \
240232 mkdir -p $(objtree ) /$(obj ) /test; \
241233 cp -a $(rustc_sysroot ) $(objtree ) /$(obj ) /test/sysroot; \
242- cp -r $(srctree ) /$(src ) /alloc/* \
243- $(objtree ) /$(obj ) /test/sysroot/lib/rustlib/src/rust/library/alloc/src; \
244234 echo '\# !/bin/sh' > $(objtree)/$(obj)/test/rustc_sysroot; \
245235 echo "$(RUSTC) --sysroot=$(abspath $(objtree)/$(obj)/test/sysroot) \"\$$@\"" \
246236 >> $(objtree)/$(obj)/test/rustc_sysroot; \
@@ -448,7 +438,7 @@ $(obj)/compiler_builtins.o: $(src)/compiler_builtins.rs $(obj)/core.o FORCE
448438$(obj ) /alloc.o : private skip_clippy = 1
449439$(obj ) /alloc.o : private skip_flags = -Dunreachable_pub
450440$(obj ) /alloc.o : private rustc_target_flags = $(alloc-cfgs )
451- $(obj ) /alloc.o : $(src ) /alloc/lib.rs $(obj ) /compiler_builtins.o FORCE
441+ $(obj ) /alloc.o : $(RUST_LIB_SRC ) /alloc/src /lib.rs $(obj ) /compiler_builtins.o FORCE
452442 +$(call if_changed_dep,rustc_library)
453443
454444$(obj ) /build_error.o : $(src ) /build_error.rs $(obj ) /compiler_builtins.o FORCE
0 commit comments