Skip to content

Commit 9ea118f

Browse files
committed
add IntoIterator impl for self-contained linking components
1 parent 6898d88 commit 9ea118f

File tree

1 file changed

+13
-0
lines changed
  • compiler/rustc_target/src/spec

1 file changed

+13
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,19 @@ impl LinkSelfContainedComponents {
693693
}
694694
}
695695

696+
impl IntoIterator for LinkSelfContainedComponents {
697+
type Item = LinkSelfContainedComponents;
698+
type IntoIter = std::vec::IntoIter<LinkSelfContainedComponents>;
699+
700+
fn into_iter(self) -> Self::IntoIter {
701+
LinkSelfContainedComponents::all_components()
702+
.into_iter()
703+
.filter(|&s| self.contains(s))
704+
.collect::<Vec<_>>()
705+
.into_iter()
706+
}
707+
}
708+
696709
impl ToJson for LinkSelfContainedComponents {
697710
fn to_json(&self) -> Json {
698711
let components: Vec<_> = Self::all_components()

0 commit comments

Comments
 (0)