diff options
| author | bors <bors@rust-lang.org> | 2025-10-04 06:19:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-10-04 06:19:58 +0000 |
| commit | a0f398e89df9767c93c81cd58d44fdba071258a8 (patch) | |
| tree | 6c65806622032e569ced4c44d25b0441398351f4 /compiler/rustc_feature/src/unstable.rs | |
| parent | 7950f244e7ef55b61a83d12f4662be643cd182d6 (diff) | |
| parent | 30442dc496138df6c6f56abe5f276392b78bdfbb (diff) | |
| download | rust-a0f398e89df9767c93c81cd58d44fdba071258a8.tar.gz rust-a0f398e89df9767c93c81cd58d44fdba071258a8.zip | |
Auto merge of #147308 - matthiaskrgr:rollup-ov04tbi, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang/rust#147245 (only replace the intended comma in pattern suggestions) - rust-lang/rust#147269 (Add regression test for 123953) - rust-lang/rust#147277 (Extract common logic for iterating over features) - rust-lang/rust#147292 (Respect `-Z` unstable options in `rustdoc --test`) - rust-lang/rust#147300 (Add xtensa arch to object file creation) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_feature/src/unstable.rs')
| -rw-r--r-- | compiler/rustc_feature/src/unstable.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index e63f29a9570..8397cd294e0 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -93,6 +93,16 @@ impl Features { &self.enabled_features } + /// Returns a iterator of enabled features in stable order. + pub fn enabled_features_iter_stable_order( + &self, + ) -> impl Iterator<Item = (Symbol, Span)> + Clone { + self.enabled_lang_features + .iter() + .map(|feat| (feat.gate_name, feat.attr_sp)) + .chain(self.enabled_lib_features.iter().map(|feat| (feat.gate_name, feat.attr_sp))) + } + /// Is the given feature enabled (via `#[feature(...)]`)? pub fn enabled(&self, feature: Symbol) -> bool { self.enabled_features.contains(&feature) |
