Commit graph

27 commits

Author SHA1 Message Date
Ed Page 1b6ff9a62a test: Make edition explicit on packages
This is a follow up to 14646e6af6

I don't run these tests locally, so I missed them.
2024-02-29 15:48:41 -06:00
Urgau da5900740e Silently ignore cargo::rustc-check-cfg to avoid MSRV annoyance 2024-02-24 19:52:52 +01:00
Ed Page e7e8d8748a fix(compiler): Clarify we're showing a profile name 2024-02-08 14:01:39 -06:00
bors a4fe27a4ba Auto merge of #13383 - Urgau:check-cfg-docsrs, r=epage
Add `docsrs` cfg as a well known `--check-cfg`

Now that https://github.com/rust-lang/docs.rs/pull/2390 has been merged we can add the `docsrs` cfg in Cargo well known --check-cfg "list". The `docsrs` cfg used by at least [3k project on GitHub](https://github.com/search?q=lang%3Atoml+%2Frustdoc-args+%3D+%5C%5B%22--cfg%22%2C+%22docsrs%22%5C%5D%2F+NOT+is%3Afork&type=code&repo=&langOverride=&start_value=1) alone; including the cfg will help reduce the impact of enabling by default this feature.

> We include it here (in Cargo) instead of rustc, since there is a much closer relationship between Cargo and docs.rs than rustc and docs.rs. In particular, all users of docs.rs use Cargo, but not all users of rustc (like Rust-for-Linux) use docs.rs.

This is part of the last remaining bits of the `--check-cfg` feature.

r? `@epage`
2024-02-01 18:07:25 +00:00
Urgau dfc40a0ca6 Add docsrs cfg as a well known --check-cfg 2024-02-01 18:53:51 +01:00
Ed Page 675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
Urgau fecb8ff0c8 Go back to passing an empty values() when no features are declared
See https://github.com/rust-lang/rust/pull/119930
2024-01-18 09:45:09 +01:00
hi-rustin eac79ec152 Update other docs to use cargo:: syntax
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
hi-rustin ed9dc44f47 Update other tests to use cargo:: syntax
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
hi-rustin 25365d904c Use syntax_prefix to improve error message
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
hi-rustin 9ebe3b332a Extend the build directive syntax with cargo::
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
bors aa6e46e8ca Auto merge of #13012 - Urgau:check-cfg-fingerprint, r=epage
Include declared list of features in fingerprint for `-Zcheck-cfg`

This PR include the declared list of features in fingerprint for `-Zcheck-cfg` (#10554)

`--check-cfg` verifies that `#[cfg()]` attributes are valid in Rust code, which includes `--cfg features foo` definitions that came from `[features]` tables in `Cargo.toml`.  For us to correctly re-check cfgs on feature changes,we need to include them in the fingerprint.

For example, if a user deletes an entry from `[features]`, they should then get warnings about any `#[cfg()]` attributes left in the code.  Without this change, that won't happen.  With this change, it now does.
2023-12-01 21:46:28 +00:00
Urgau f32f43d879 Avoid fingerprint invalidation when reordering the declared features 2023-12-01 22:07:03 +01:00
Urgau 7d1fc45a29 Include declared list of features in fingerprint for -Zcheck-cfg
Otherwise changing (add, removing, ...) features from the `[features]`
table would not cause rustc to be called with the new `--check-cfg`,
showing potentially outdated warnings.
2023-12-01 22:05:22 +01:00
Urgau 6c4069b4b5 Add test showing the buggy behavior of check-cfg and the fingerprint 2023-12-01 21:59:26 +01:00
Urgau 4781592e18 Fix --check-cfg invocation with zero features 2023-11-19 18:08:32 +01:00
Ed Page 293f2250d6 feat(doc): Print the generated docs links
I've wanted something like this myself.  I dislike using `--open`
because I tend to move up to re-run my `cargo doc` run but then have to
edit it to remove `--open`.
Also makes it annoying when opening docs when `cargo doc` is wrapped by
a tool like `make`.

This was previously attempted in #5592:
- Unlike the request in #5562, this aligns with #5592 in always printing
  rather than using a flag as this seems generally useful
- Unlike #5592, this prints as an alternative to "Opening" to keep
  things light
- Unlike #5592, this prints afterwards as the link is only valid then

Fixes #5562
2023-10-19 10:51:56 -05:00
Urgau e396904b25 Add feature gate test for check-cfg config, build script and override 2023-10-27 17:10:49 +02:00
Urgau 4b93690c9d Adjust -Zcheck-cfg for new rustc syntax and behavior
This commit removes all the -Zcheck-cfg options (features, names,
values, output), as they don't make much sense now since features, names
and values are all combine together for upstream rustc and the output
option was only here because the other were.

Now the new behavior from cargo is to always pass one `--check-cfg`
argument to rustc for the `feature`s which implicitly enables well known
names and values.
2023-10-18 15:10:25 +02:00
Scott Schafer d89e73c171 chore: update check_cfg tests to use check 2023-02-20 12:20:26 -06:00
Scott Schafer ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
Eric Huss 1c3640e05c Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
Scott Schafer c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
Urgau 23f59d4eeb Add regression tests for check-cfg unstable config 2022-06-29 14:52:20 +02:00
Loïc BRANSTETT 805f5c2f0a Add tests for cargo:rustc-check-cfg 2022-05-18 21:26:56 +02:00
Loïc BRANSTETT cf496db45e Re-enable check-cfg tests under windows with a custom macro for escaping 2022-05-06 22:42:30 +02:00
Loïc BRANSTETT 2d0ca84b0e Move check cfg tests to their own module 2022-05-06 22:42:28 +02:00