Gate rustc-specific code under a feature

This commit is contained in:
Nadrieril
2023-12-11 20:46:35 +01:00
parent 42f4393824
commit 16bd6ac3ed
4 changed files with 41 additions and 16 deletions

View File

@@ -266,6 +266,7 @@ pub struct IntRange {
impl IntRange {
/// Best effort; will not know that e.g. `255u8..` is a singleton.
#[cfg_attr(not(feature = "rustc"), allow(dead_code))]
pub(crate) fn is_singleton(&self) -> bool {
// Since `lo` and `hi` can't be the same `Infinity` and `plus_one` never changes from finite
// to infinite, this correctly only detects ranges that contain exacly one `Finite(x)`.