-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Remove default config from bootstrap #145352
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
base: master
Are you sure you want to change the base?
Remove default config from bootstrap #145352
Conversation
This comment has been minimized.
This comment has been minimized.
e1f4e5c
to
9662ff8
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
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.
Heh, I had feedback for you, but I see that Clippy did it for me in one of the commits xD Let me know once it's ready and I'll check the changes locally, but in general looks great.
let mut full_bootstrap = false; | ||
let mut bootstrap_cache_path = None; | ||
let mut extended = false; | ||
let tools; |
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.
What does it mean for a variable to not be mut
here? If the variable is initialized only once, I would just initialize it at the end of the function, in the Config { ... }
struct literal.
let stage; | ||
let keep_stage; | ||
let keep_stage_std; | ||
let mut src = { |
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.
Could you please group the variables that have an "interesting" (i.e. non-Default) default together? Although I assume that once you remove the let XXX
vars and move them to the Config constructor, this will be less of an issue.
&get_toml, | ||
); | ||
let (mut toml, toml_path) = load_toml_config(&src, flags_config, &get_toml); | ||
config = toml_path.clone(); |
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.
Let's just initialize the variables at places where they are first used (let config;
). I don't think that the ultra long list of variable declarations at the start of the function win us anything.
This PR removes the default config initialization from parse_inner, as it introduced many assumptions during config setup. Instead, each variable is now manually initialized to eliminate certain invariants in parse_inner and streamline the process.
The PR is still a WIP and has been opened for an initial review.
r? @Kobzol