|
60 | 60 | core-cfgs = \
|
61 | 61 | --cfg no_fp_fmt_parse
|
62 | 62 |
|
| 63 | +ifeq ($(call rustc-min-version,108700),y) |
| 64 | +core-cfgs += --edition=2024 |
| 65 | +else |
| 66 | +core-cfgs += --edition=2021 |
| 67 | +endif |
| 68 | + |
63 | 69 | # `rustc` recognizes `--remap-path-prefix` since 1.26.0, but `rustdoc` only
|
64 | 70 | # since Rust 1.81.0. Moreover, `rustdoc` ICEs on out-of-tree builds since Rust
|
65 | 71 | # 1.82.0 (https://github.com/rust-lang/rust/issues/138520). Thus workaround both
|
@@ -106,7 +112,7 @@ rustdoc-macros: $(src)/macros/lib.rs FORCE
|
106 | 112 |
|
107 | 113 | # Starting with Rust 1.82.0, skipping `-Wrustdoc::unescaped_backticks` should
|
108 | 114 | # not be needed -- see https://github.com/rust-lang/rust/pull/128307.
|
109 |
| -rustdoc-core: private skip_flags = -Wrustdoc::unescaped_backticks |
| 115 | +rustdoc-core: private skip_flags = -Wrustdoc::unescaped_backticks --edition=2021 |
110 | 116 | rustdoc-core: private rustc_target_flags = $(core-cfgs)
|
111 | 117 | rustdoc-core: $(RUST_LIB_SRC)/core/src/lib.rs FORCE
|
112 | 118 | +$(call if_changed,rustdoc)
|
@@ -416,7 +422,7 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L
|
416 | 422 | cmd_rustc_library = \
|
417 | 423 | OBJTREE=$(abspath $(objtree)) \
|
418 | 424 | $(if $(skip_clippy),$(RUSTC),$(RUSTC_OR_CLIPPY)) \
|
419 |
| - $(filter-out $(skip_flags),$(rust_flags) $(rustc_target_flags)) \ |
| 425 | + $(filter-out $(skip_flags),$(rust_flags)) $(rustc_target_flags) \ |
420 | 426 | --emit=dep-info=$(depfile) --emit=obj=$@ \
|
421 | 427 | --emit=metadata=$(dir $@)$(patsubst %.o,lib%.rmeta,$(notdir $@)) \
|
422 | 428 | --crate-type rlib -L$(objtree)/$(obj) \
|
@@ -483,7 +489,7 @@ $(obj)/helpers/helpers.o: $(src)/helpers/helpers.c $(recordmcount_source) FORCE
|
483 | 489 | $(obj)/exports.o: private skip_gendwarfksyms = 1
|
484 | 490 |
|
485 | 491 | $(obj)/core.o: private skip_clippy = 1
|
486 |
| -$(obj)/core.o: private skip_flags = -Wunreachable_pub |
| 492 | +$(obj)/core.o: private skip_flags = -Wunreachable_pub --edition=2021 |
487 | 493 | $(obj)/core.o: private rustc_objcopy = $(foreach sym,$(redirect-intrinsics),--redefine-sym $(sym)=__rust$(sym))
|
488 | 494 | $(obj)/core.o: private rustc_target_flags = $(core-cfgs)
|
489 | 495 | $(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs \
|
|
0 commit comments