Skip to content

Commit d6e3a32

Browse files
Urgautshepang
authored andcommitted
Update new target check-cfg instructions
1 parent 98c5f27 commit d6e3a32

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/building/new-target.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,18 @@ unexpected because stage0 doesn't know about the new target specification and
8686
we pass `--check-cfg` in order to tell it to check.
8787

8888
To fix the errors you will need to manually add the unexpected value to the
89-
`EXTRA_CHECK_CFGS` list in `src/bootstrap/src/lib.rs`. Here is an example for
90-
adding `NEW_TARGET_OS` as `target_os`:
89+
different `Cargo.toml` in `library/{std,alloc,core}/Cargo.toml`. Here is an
90+
example for adding `NEW_TARGET_ARCH` as `target_arch`:
91+
92+
*`library/std/Cargo.toml`*:
9193
```diff
92-
- (Some(Mode::Std), "target_os", Some(&["watchos"])),
93-
+ // #[cfg(bootstrap)] NEW_TARGET_OS
94-
+ (Some(Mode::Std), "target_os", Some(&["watchos", "NEW_TARGET_OS"])),
94+
[lints.rust.unexpected_cfgs]
95+
level = "warn"
96+
check-cfg = [
97+
'cfg(bootstrap)',
98+
- 'cfg(target_arch, values("xtensa"))',
99+
+ # #[cfg(bootstrap)] NEW_TARGET_ARCH
100+
+ 'cfg(target_arch, values("xtensa", "NEW_TARGET_ARCH"))',
95101
```
96102

97103
To use this target in bootstrap, we need to explicitly add the target triple to the `STAGE0_MISSING_TARGETS`

0 commit comments

Comments
 (0)