Commit Graph

235577 Commits

Author SHA1 Message Date
Nicholas Nethercote
95d1aa075f Record all declared features.
Currently `rust_20XX_preview` features aren't recorded as declared even
when they are explicit declared. Similarly, redundant edition-dependent
features (e.g. `test_2018_feature`) aren't recorded as declared.

This commit marks them as recorded. There is no detectable functional
change, but it makes things more consistent.
2023-10-05 18:01:11 +11:00
Nicholas Nethercote
eb209057b1 Rename Resolver::active_features.
For the reasons described in the previous commit.
2023-10-05 18:01:11 +11:00
Nicholas Nethercote
4602d9257d Rename Features::active_features.
The word "active" is currently used in two different and confusing ways:
- `ACTIVE_FEATURES` actually means "available unstable features"
- `Features::active_features` actually means "features declared in the
  crate's code", which can include feature within `ACTIVE_FEATURES` but
  also others.

(This is also distinct from "enabled" features which includes declared
features but also some edition-specific features automatically enabled
depending on the edition in use.)

This commit changes the `Features::active_features` to
`Features::declared_features` which actually matches its meaning.
Likewise, `Features::active` becomes `Features::declared`.
2023-10-05 18:01:11 +11:00
Nicholas Nethercote
b229be0127 Overhaul config::features.
The new way of doing things:
- Avoids some code duplication.
- Distinguishes the `crate_edition` (which comes from `--edition`) and
  the `features_edition` (which combines `--edition` along with any
  `rustc_20XX_preview` features), which is useful.
- Has a simpler initial loop, one that just looks for
  `rustc_20XX_preview` features in order to compute `features_edition`.
- Creates a fallible alternative to `Features::enabled`, which is
  useful.

It's not easy to see how exactly the old and new code are equivalent,
but it's reassuring to know that the test coverage is quite good for
this stuff.
2023-10-05 18:00:29 +11:00
Ralf Jung
5178ae60a1 Tree Borrows: do not create new tags as 'Active' 2023-10-05 08:18:56 +02:00
bors
6ed502d012 Auto merge of #3000 - RalfJung:no_std, r=oli-obk
auto-detect no_std where possible

r? `@oli-obk`
Cc https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/restricted_std.20sysroot.3F
2023-10-05 06:07:27 +00:00
bors
5236c8e1fa Auto merge of #116273 - compiler-errors:refine2, r=tmandry
Only trigger `refining_impl_trait` lint on reachable traits

Public but unreachable traits don't matter 😸

r? `@tmandry`
2023-10-05 03:00:30 +00:00
bors
b781645332 Auto merge of #116184 - compiler-errors:afit-lint, r=tmandry
Add `async_fn_in_trait` lint

cc https://github.com/rust-lang/rust/pull/115822#issuecomment-1731168465

Mostly unsure what the messaging should be. Feedback required.

r? `@tmandry`
2023-10-05 01:14:25 +00:00
Alex Macleod
5453a9f34d Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
Nicholas Nethercote
8ba9137840 Merge STABLE_REMOVED_FEATURES list into REMOVED_FEATURES.
There is a single features (`no_stack_check`) in
`STABLE_REMOVED_FEATURES`. But the treatment of
`STABLE_REMOVED_FEATURES` and `REMOVED_FEATURES` is actually identical.
So this commit just merges them, and uses a comment to record
`no_stack_check`'s unique "stable removed" status.

This also lets `State::Stabilized` (which was a terrible name) be
removed.
2023-10-05 11:42:32 +11:00
Nicholas Nethercote
5d9559e026 Inline and remove feature_removed function.
It has a single call site. This increases consistency because other
errors within `features` are emitted directly.
2023-10-05 11:18:51 +11:00
Nicholas Nethercote
9e2cd038b0 Factor out some repeated feature-getting code. 2023-10-05 11:16:14 +11:00
Nicholas Nethercote
e24f394404 Add comments to config::features.
I found this function very confusing, and it took me quite some time to
work out what it was doing. These comments capture that hard-earned
knowledge.
2023-10-05 11:16:05 +11:00
Nicholas Nethercote
1ddb2872dd Streamline find_lang_feature_issue.
It currently processes `ACTIVE_FEATURES` separately from
`ACCEPTED_FEATURES`, `REMOVED_FEATURES`, and `STABLE_REMOVED_FEATURES`,
for no good reason. This commit treats them uniformly.
2023-10-05 10:23:26 +11:00
Nicholas Nethercote
3c1b60c1b4 Split declare_features!.
It's a macro with four clauses, three of which are doing one thing, and
the fourth is doing something completely different. This commit splits
it into two macros, which is more sensible.
2023-10-05 10:23:20 +11:00
Nicholas Nethercote
043a9873b9 Remove set! macro.
It has a single call site.
2023-10-05 10:23:20 +11:00
Nicholas Nethercote
53fe37de2e Remove unused Span from the set function in State::Active. 2023-10-05 10:18:29 +11:00
bors
afe67fa2ef Auto merge of #116370 - nnethercote:more-arena-stuff, r=cjgillot
Remove the `TypedArena::alloc_from_iter` specialization.

It was added in #78569. It's complicated and doesn't actually help
performance.

r? `@cjgillot`
2023-10-04 22:32:46 +00:00
Tyler Mandry
2f5249019e
Apply suggestions from code review
Co-authored-by: Travis Cross <tc@traviscross.com>
2023-10-04 18:20:05 -04:00
Michael Goulet
c5c6d703de Point to closure return instead of output if defaulted 2023-10-04 21:09:54 +00:00
Michael Goulet
dd5f26c42d Fix spans for comments in rustfmt 2023-10-04 21:09:54 +00:00
Michael Goulet
56794fa5f1 Fix clippy 2023-10-04 21:09:54 +00:00
Michael Goulet
1f079cfb44 Point to closure return instead of output if defaulted 2023-10-04 21:09:54 +00:00
Michael Goulet
89b14ae212 Fix clippy 2023-10-04 21:09:54 +00:00
Michael Goulet
137b6d0b01 Point to where missing return type should go 2023-10-04 21:09:54 +00:00
bors
2bbb619893 Auto merge of #114417 - chinedufn:fix-expect-unused-in-impl-block-rust-issue-114416, r=cjgillot
Fix multiple `expect` attribs in impl block

Closes #114416
2023-10-04 20:44:38 +00:00
bors
40c928e946 Auto merge of #3105 - RalfJung:sysroot-target, r=RalfJung
miri-script: print which sysroot target we are building
2023-10-04 20:19:16 +00:00
Ralf Jung
7d065db5c1 miri-script: print which sysroot target we are building 2023-10-04 22:17:15 +02:00
Ralf Jung
31a57557f6 auto-detect no_std where possible 2023-10-04 22:12:26 +02:00
Urgau
e46236cceb Clarify invalid_reference_casting lint around interior mutable types 2023-10-04 22:06:16 +02:00
Michael Howell
a46ccd8d3f Add URL to test case issues 2023-10-04 13:04:45 -07:00
Michael Howell
9266270ef5 Rename issue-\d+.rs tests to have meaningful names 2023-10-04 12:58:06 -07:00
Esteban Küber
041e54bd92 Tweak wording of E0562
Fix #80476.
2023-10-04 19:51:43 +00:00
León Orell Valerian Liehr
867cc41b5b
clean up struct field suggestions 2023-10-04 21:36:04 +02:00
Michael Howell
a198aff4a4 Add crate_name to test so that it can be renamed 2023-10-04 12:13:01 -07:00
Esteban Küber
8d92c996ca Fix test on WASM target by making ambiguity pruning more agressive 2023-10-04 18:58:06 +00:00
bors
eea26141ec Auto merge of #115200 - rcvalle:rust-cfi-fix-115199, r=workingjubilee
Disable CFI for core and std CFI violations

Work around https://github.com/rust-lang/rust/issues/115199 by temporarily disabling CFI for core and std CFI violations to allow the user rebuild and use both core and std with CFI enabled using the Cargo build-std feature.
2023-10-04 18:54:49 +00:00
Camille GILLOT
e63d19c4dd Remove mir::LocalDecl::internal. 2023-10-04 17:55:15 +00:00
Ramon de C Valle
abece4facc Update documentation for LLVM CFI support
Updates documentation for LLVM CFI support with recommended information
since the user can now rebuild and use both core and std with CFI
enabled using the Cargo build-std feature.
2023-10-04 10:05:57 -07:00
Ramon de C Valle
7b45674015 Disable CFI for core and std CFI violations
Works around #115199 by temporarily disabling CFI for core and std CFI
violations to allow the user rebuild and use both core and std with CFI
enabled using the Cargo build-std feature.
2023-10-04 10:05:54 -07:00
bors
f306362fb9 Auto merge of #116413 - nnethercote:rm-E0551, r=compiler-errors
Remove E0551

Because it's the same as E0539.

Fixes #51489.

r? `@Nilstrieb`
2023-10-04 16:51:42 +00:00
Ikko Eltociear Ashimine
23efab4811
Fix typo in attrs.rs
documenation -> documentation
2023-10-05 00:03:04 +09:00
bors
2ffeb4636b Auto merge of #116381 - Mark-Simulacrum:drop-wasm32-unknown-emscripten, r=Kobzol
Remove wasm32-unknown-emscripten tests from CI

This builder tested the wasm32-unknown-emscripten target, which is tier 2 (and so not eligible for testing). In the recent beta [promotion](https://github.com/rust-lang/rust/pull/116362#issuecomment-1744960904), we ran into a problem with this target: emscripten doesn't support passing environment variables into the std environment, so we can't enable RUSTC_BOOTSTRAP for libtest in order to pass -Zunstable-options.

We worked around this for the beta/stable branches, but given this problem, and its tier 2 status, just dropping the target's tests entirely seems warranted. Downgrading to tier 3 may also be a good idea, but that is a separate conversation not proposed here.
2023-10-04 14:17:57 +00:00
bors
9554e477c2 Auto merge of #11605 - xFrednet:changelog-1-73, r=blyxyas
Changelog for Rust 1.73 🖊️

Roses are red,
violets are blue,
I'm tired... 💤
Oh nice, tea 🍵

---

### The cat of this release:

![cat-like-doritos](https://github.com/rust-lang/rust-clippy/assets/114838443/1ca9eb1e-3e5c-42a4-bda9-6f24a2e03015)

cc: `@Centri3` & `@blyxyas`

As the author, I call dibs on the 1.74 cat picture 🐈

---

changelog: none
2023-10-04 14:12:50 +00:00
Jakub Beránek
e53c778777
Bump host compiler on x64 dist Linux to LLVM 17.0.2 2023-10-04 12:57:46 +02:00
bors
65519f5fc0 Auto merge of #116360 - compiler-errors:async-span, r=oli-obk
Point to full `async fn` for future

Semi-follow-up to https://github.com/rust-lang/rust/pull/116296#discussion_r1342007575

cc `@asquared31415`
2023-10-04 09:55:02 +00:00
bors
716f211030 Auto merge of #116360 - compiler-errors:async-span, r=oli-obk
Point to full `async fn` for future

Semi-follow-up to https://github.com/rust-lang/rust/pull/116296#discussion_r1342007575

cc `@asquared31415`
2023-10-04 09:55:02 +00:00
Lukas Wirth
0aedec4849 Remove unnecessary features from rustc_abi 2023-10-04 11:43:57 +02:00
xFrednet
404217e631
Address PR Review <3 2023-10-04 10:28:52 +02:00
bors
9fbd593a56 Auto merge of #116353 - Kobzol:new-bors-event, r=Mark-Simulacrum
Add new bors try branches to CI

Workflows for the new bors weren't launching, because its branches weren't whitelisted here.

r? `@Mark-Simulacrum`
2023-10-04 07:46:03 +00:00