-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Moved the main impl
for FnCtxt to its own file.
#77808
Conversation
This is a solution to the file length being over 3000, something Clippy has a problem with. The other solution to the file length is 1. to change the API of this struct by 2. encapulating certain fields of the struct into other structs.
(rust_highfive has picked a reviewer for you, use r? to override) |
@Nicholas-Baron another possible solution is to split the 'main' impl into several smaller impls, each of which has its own file. I think I prefer that in the long run since the new file here is already almost 3000 lines. |
@jyn514 Something like |
Sure, seems reasonable. I've never actually used this code before. |
@jyn514 The |
mod checks; | ||
mod suggestions; | ||
|
||
pub use _impl::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_impl
is a bit of an odd naming convention - I think you picked it because it has the main impl FnCtxt
. I'm not sure a better name for it though ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern comes from the _match.rs
file in the directory above it. Seeing that, my assumption is that Rust would not allow keywords as identifiers (a reasonable assumption).
Yes, I chose the name _impl.rs
because of that and the file before I moved it was fn_ctxt_impl.rs
.
I am fine with giving it a better name; I just cannot make one with the single brain I have.
@bors r+ |
📌 Commit ce7c73c has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#77765 (Add LLVM flags to limit DWARF version to 2 on BSD) - rust-lang#77788 (BTreeMap: fix gdb provider on BTreeMap with ZST keys or values) - rust-lang#77795 (Codegen backend interface refactor) - rust-lang#77808 (Moved the main `impl` for FnCtxt to its own file.) - rust-lang#77817 (Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`) - rust-lang#77829 (bootstrap: only use compiler-builtins-c if they exist) - rust-lang#77870 (Use intra-doc links for links to module-level docs) - rust-lang#77897 (Move `Strip` into a separate rustdoc pass) Failed merges: - rust-lang#77879 (Provide better documentation and help messages for x.py setup) - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests) r? `@ghost`
Resolves #77085 without breaking the API of the
FnCtxt
struct.This is a solution to the file length being over 3000 (see issue #60302).
The other solution to the file length is