Skip to content
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

Move metadata generation before analysis #64112

Closed
wants to merge 6 commits into from
Next

Don't call `self.parse()` in `Compiler::crate_name()` unless necessary.

  • Loading branch information...
nnethercote committed Aug 29, 2019
commit d61605cef866008a19e33eb596df1d76ff1571f3
@@ -126,17 +126,18 @@ impl Compiler {

pub fn crate_name(&self) -> Result<&Query<String>> {
self.queries.crate_name.compute(|| {
let parse_result = self.parse()?;
let krate = parse_result.peek();
let result = match self.crate_name {
Ok(match self.crate_name {
Some(ref crate_name) => crate_name.clone(),
None => rustc_codegen_utils::link::find_crate_name(
Some(self.session()),
&krate.attrs,
&self.input
),
};
Ok(result)
None => {
let parse_result = self.parse()?;
let krate = parse_result.peek();
rustc_codegen_utils::link::find_crate_name(
Some(self.session()),
&krate.attrs,
&self.input
)
}
})
})
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.