Remove restriction on type parameters preceding consts w/ feature const-generics
Removed the restriction on type parameters preceding const parameters when the feature const-generics is enabled.
Builds on #74676, which deals with unsorted generic parameters. This just lifts the check in lowering the AST to HIR that permits consts and types to be reordered with respect to each other. Lifetimes still must precede both
This change is not intended for min-const-generics, and is gated behind the `#![feature(const_generics)]`.
One thing is that it also permits type parameters without a default to come after consts, which I expected to not work, and was hoping to get more guidance on whether that should be permitted or how to prevent it otherwise.
I did not go through the RFC process for this pull request because there was prior work to get this feature added. In the previous PR that was cited, work was done to enable this change.
r? @lcnr
Rollup of 5 pull requests
Successful merges:
- #5825 (Add the new lint `same_item_push`)
- #5869 (New lint against `Self` as an arbitrary self type)
- #5870 (enable #[allow(clippy::unsafe_derive_deserialize)])
- #5871 (Lint .min(x).max(y) with x < y)
- #5874 (Make the docs clearer for new contributors)
Failed merges:
r? @ghost
changelog: rollup
Make the docs clearer for new contributors
It confused me before, so I made it extra obvious that you need to run
a script to set up your toolchain before you can build Clippy.
I also added a note so that new contributors aren't confused when
Clippy doesn't build as a result of a change in rustc's internals.
changelog: make `CONTRIBUTING.md` clearer for new contributors
enable #[allow(clippy::unsafe_derive_deserialize)]
Before this change this lint could not be allowed as the code we are checking is automatically generated.
changelog: Enable using the `allow` attribute on top of an ADT linted by [`unsafe_derive_deserialize`].
Fixes: #5789
This commit constrains the support added for handling unevaluated consts
in polymorphization (introduced in #75260) by:
- Skipping associated constants as this causes cycle errors.
- Skipping promoted constants when they contain `Self` as this ensures
`T` is used in constants of the form `<Self as Foo<T>>`.
Signed-off-by: David Wood <david@davidtw.co>
Upgrade the FreeBSD toolchain to version 11.4
FreeBSD 10 reached its end-of-life in October 2018, and that toolchain
caused issues in the LLVM 11 upgrade (#73526) that are resolved with the
toolchain from FreeBSD 11.
Closes#72390.
MinGW: disable self-contained mode when cross compiling
When cross compiling users have to provide own linker and libraries anyway.
Using rust provided MinGW crt objects is harmful here and has no benefits.
cc https://github.com/rust-lang/rust/issues/68887