Skip to content

Remove unneeded conversions in bootstrapping code #94862

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

Merged
merged 1 commit into from
Mar 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ impl PathSet {

fn one<P: Into<PathBuf>>(path: P, kind: Kind) -> PathSet {
let mut set = BTreeSet::new();
set.insert(TaskPath { path: path.into(), kind: Some(kind.into()) });
set.insert(TaskPath { path: path.into(), kind: Some(kind) });
PathSet::Set(set)
}

@@ -372,10 +372,7 @@ impl<'a> ShouldRun<'a> {
// multiple aliases for the same job
pub fn paths(mut self, paths: &[&str]) -> Self {
self.paths.insert(PathSet::Set(
paths
.iter()
.map(|p| TaskPath { path: p.into(), kind: Some(self.kind.into()) })
.collect(),
paths.iter().map(|p| TaskPath { path: p.into(), kind: Some(self.kind) }).collect(),
));
self
}
@@ -388,8 +385,7 @@ impl<'a> ShouldRun<'a> {
}

pub fn suite_path(mut self, suite: &str) -> Self {
self.paths
.insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind.into()) }));
self.paths.insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind) }));
self
}

@@ -1769,7 +1765,7 @@ impl<'a> Builder<'a> {
if should_run.paths.iter().any(|s| s.has(path, Some(desc.kind)))
&& !desc.is_excluded(
self,
&PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind.into()) }),
&PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind) }),
)
{
return true;
2 changes: 1 addition & 1 deletion src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
@@ -391,7 +391,7 @@ impl ErrorIndex {
add_dylib_path(
vec![
PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)),
PathBuf::from(builder.rustc_libdir(compiler)),
builder.rustc_libdir(compiler),
],
&mut cmd,
);