-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coerce const FnDefs to implement const Fn traits #88963
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
fe62c9a
to
f8aa73d
Compare
that's not really something we do beta backports for. Why do you need a bootstrap compiler with this? There is no syntactical component here, afaict you can use cfg(bootstrap)? |
That is true, but does cfg work on bounds? Some trait functions require things like: Or is it fine to have no documentation for the |
I don't think it works on bounds, but you also don't need to duplicate the docs. The bootstrap version is a copy of the original function with dummy docs, while the original function gets the new attribute and a not(bootstrap) cfg |
I still want the "const Drop" mega PR to be backported. It allows ~const bounds on assoc fns on inherent impls. That is an AST change which should be backported. Maybe we could cherry pick the commit? f749e05 |
oh, I didn't know the ast validator ran on cfged out code. Still, even if I nominate this (which I'm not sure I want to), it's likely going to get rejected by the compiler team as "not critical for beta". We only backport bugfixes, nothing else. This would be a new kind of backport, so it would probably need an MCP and all. Better to just let it ride the trains and work without libcore/libstd right now. |
EDITED: It is probably not suitable for beta backport, the process doesn't favor changes backported to beta, for that purpose:
It is a simplified procedure, there are more to be done, but it doesn't help with AST changes. If those changes are backported into beta, it just means that it appears in the next stable release. It doesn't interact with the bootstrap compiler. |
You can use a macro to hide code from the ast validator. |
@bors r+ |
📌 Commit f8aa73d has been approved by |
Coerce const FnDefs to implement const Fn traits You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`. r? `@oli-obk` `@rustbot` label T-compiler F-const_trait_impl
…arth Rollup of 7 pull requests Successful merges: - rust-lang#85223 (rustdoc: Clarified the attribute which prompts the warning) - rust-lang#88847 (platform-support.md: correct ARMv7+MUSL platform triple notes) - rust-lang#88963 (Coerce const FnDefs to implement const Fn traits ) - rust-lang#89376 (Fix use after drop in self-profile with llvm events) - rust-lang#89422 (Replace whitespaces in doctests' name with dashes) - rust-lang#89440 (Clarify a sentence in the documentation of Vec (rust-lang#84488)) - rust-lang#89441 (Normalize after substituting via `field.ty()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Coerce const FnDefs to implement const Fn traits You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`. r? ``@oli-obk`` ``@rustbot`` label T-compiler F-const_trait_impl
…arth Rollup of 7 pull requests Successful merges: - rust-lang#85223 (rustdoc: Clarified the attribute which prompts the warning) - rust-lang#88847 (platform-support.md: correct ARMv7+MUSL platform triple notes) - rust-lang#88963 (Coerce const FnDefs to implement const Fn traits ) - rust-lang#89376 (Fix use after drop in self-profile with llvm events) - rust-lang#89422 (Replace whitespaces in doctests' name with dashes) - rust-lang#89440 (Clarify a sentence in the documentation of Vec (rust-lang#84488)) - rust-lang#89441 (Normalize after substituting via `field.ty()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
You can now pass a FnDef to a function expecting
F
whereF: ~const FnTrait
.r? @oli-obk
@rustbot label T-compiler F-const_trait_impl