Rollup merge of #61844 - AaronKutch:master, r=Centril
Change `...` to `..=` where applicable This is mainly to fix #61816, but I decided to manually check a few thousand `...` throughout the code base to check for any other cases. I think I found a documentation bug in `src\libsyntax\ast.rs` where both `1..` and `1...` where mentioned. If there is internal support for both `1..` and `1..=` (that can exist before error handling gets to it), then I can add that back. There were some other cases that look like `// struct Closure<'l0...'li, T0...Tj, CK, CS, U0...Uk> {`, `// <P0 as Trait<P1...Pn>>::Foo: 'a`, and `assert!(min <= max, "discriminant range is {}...{}", min, max);`, but I am not sure if I should change those. There are a bunch of cases in the `/test/` directory that could be changed, but I presume I should just leave those be.
This commit is contained in:
commit
145abd88ca
@ -191,7 +191,7 @@ fn is_ascii_lowercase(b: u8) -> bool {
|
||||
fn case11_mask_mult_bool_match_range(bytes: &mut [u8]) {
|
||||
fn is_ascii_lowercase(b: u8) -> bool {
|
||||
match b {
|
||||
b'a'...b'z' => true,
|
||||
b'a'..=b'z' => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
@ -203,7 +203,7 @@ fn is_ascii_lowercase(b: u8) -> bool {
|
||||
fn case12_mask_shifted_bool_match_range(bytes: &mut [u8]) {
|
||||
fn is_ascii_lowercase(b: u8) -> bool {
|
||||
match b {
|
||||
b'a'...b'z' => true,
|
||||
b'a'..=b'z' => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
@ -215,7 +215,7 @@ fn is_ascii_lowercase(b: u8) -> bool {
|
||||
fn case13_subtract_shifted_bool_match_range(bytes: &mut [u8]) {
|
||||
fn is_ascii_lowercase(b: u8) -> bool {
|
||||
match b {
|
||||
b'a'...b'z' => true,
|
||||
b'a'..=b'z' => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
@ -227,7 +227,7 @@ fn is_ascii_lowercase(b: u8) -> bool {
|
||||
fn case14_subtract_multiplied_bool_match_range(bytes: &mut [u8]) {
|
||||
fn is_ascii_lowercase(b: u8) -> bool {
|
||||
match b {
|
||||
b'a'...b'z' => true,
|
||||
b'a'..=b'z' => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ fn from(c: char) -> Self {
|
||||
}
|
||||
}
|
||||
|
||||
/// Maps a byte in 0x00...0xFF to a `char` whose code point has the same value, in U+0000 to U+00FF.
|
||||
/// Maps a byte in 0x00..=0xFF to a `char` whose code point has the same value, in U+0000..=U+00FF.
|
||||
///
|
||||
/// Unicode is designed such that this effectively decodes bytes
|
||||
/// with the character encoding that IANA calls ISO-8859-1.
|
||||
|
@ -1042,8 +1042,8 @@ pub fn make_ascii_lowercase(&mut self) {
|
||||
|
||||
/// Checks if the value is an ASCII alphabetic character:
|
||||
///
|
||||
/// - U+0041 'A' ... U+005A 'Z', or
|
||||
/// - U+0061 'a' ... U+007A 'z'.
|
||||
/// - U+0041 'A' ..= U+005A 'Z', or
|
||||
/// - U+0061 'a' ..= U+007A 'z'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1075,7 +1075,7 @@ pub fn is_ascii_alphabetic(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII uppercase character:
|
||||
/// U+0041 'A' ... U+005A 'Z'.
|
||||
/// U+0041 'A' ..= U+005A 'Z'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1107,7 +1107,7 @@ pub fn is_ascii_uppercase(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII lowercase character:
|
||||
/// U+0061 'a' ... U+007A 'z'.
|
||||
/// U+0061 'a' ..= U+007A 'z'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1140,9 +1140,9 @@ pub fn is_ascii_lowercase(&self) -> bool {
|
||||
|
||||
/// Checks if the value is an ASCII alphanumeric character:
|
||||
///
|
||||
/// - U+0041 'A' ... U+005A 'Z', or
|
||||
/// - U+0061 'a' ... U+007A 'z', or
|
||||
/// - U+0030 '0' ... U+0039 '9'.
|
||||
/// - U+0041 'A' ..= U+005A 'Z', or
|
||||
/// - U+0061 'a' ..= U+007A 'z', or
|
||||
/// - U+0030 '0' ..= U+0039 '9'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1174,7 +1174,7 @@ pub fn is_ascii_alphanumeric(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII decimal digit:
|
||||
/// U+0030 '0' ... U+0039 '9'.
|
||||
/// U+0030 '0' ..= U+0039 '9'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1207,9 +1207,9 @@ pub fn is_ascii_digit(&self) -> bool {
|
||||
|
||||
/// Checks if the value is an ASCII hexadecimal digit:
|
||||
///
|
||||
/// - U+0030 '0' ... U+0039 '9', or
|
||||
/// - U+0041 'A' ... U+0046 'F', or
|
||||
/// - U+0061 'a' ... U+0066 'f'.
|
||||
/// - U+0030 '0' ..= U+0039 '9', or
|
||||
/// - U+0041 'A' ..= U+0046 'F', or
|
||||
/// - U+0061 'a' ..= U+0066 'f'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1242,10 +1242,10 @@ pub fn is_ascii_hexdigit(&self) -> bool {
|
||||
|
||||
/// Checks if the value is an ASCII punctuation character:
|
||||
///
|
||||
/// - U+0021 ... U+002F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - U+003A ... U+0040 `: ; < = > ? @`, or
|
||||
/// - U+005B ... U+0060 ``[ \ ] ^ _ ` ``, or
|
||||
/// - U+007B ... U+007E `{ | } ~`
|
||||
/// - U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - U+003A ..= U+0040 `: ; < = > ? @`, or
|
||||
/// - U+005B ..= U+0060 ``[ \ ] ^ _ ` ``, or
|
||||
/// - U+007B ..= U+007E `{ | } ~`
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1277,7 +1277,7 @@ pub fn is_ascii_punctuation(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII graphic character:
|
||||
/// U+0021 '!' ... U+007E '~'.
|
||||
/// U+0021 '!' ..= U+007E '~'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -1358,7 +1358,7 @@ pub fn is_ascii_whitespace(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII control character:
|
||||
/// U+0000 NUL ... U+001F UNIT SEPARATOR, or U+007F DELETE.
|
||||
/// U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE.
|
||||
/// Note that most ASCII whitespace characters are control
|
||||
/// characters, but SPACE is not.
|
||||
///
|
||||
|
@ -4166,8 +4166,8 @@ pub fn make_ascii_lowercase(&mut self) {
|
||||
|
||||
/// Checks if the value is an ASCII alphabetic character:
|
||||
///
|
||||
/// - U+0041 'A' ... U+005A 'Z', or
|
||||
/// - U+0061 'a' ... U+007A 'z'.
|
||||
/// - U+0041 'A' ..= U+005A 'Z', or
|
||||
/// - U+0061 'a' ..= U+007A 'z'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4202,7 +4202,7 @@ pub fn is_ascii_alphabetic(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII uppercase character:
|
||||
/// U+0041 'A' ... U+005A 'Z'.
|
||||
/// U+0041 'A' ..= U+005A 'Z'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4237,7 +4237,7 @@ pub fn is_ascii_uppercase(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII lowercase character:
|
||||
/// U+0061 'a' ... U+007A 'z'.
|
||||
/// U+0061 'a' ..= U+007A 'z'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4273,9 +4273,9 @@ pub fn is_ascii_lowercase(&self) -> bool {
|
||||
|
||||
/// Checks if the value is an ASCII alphanumeric character:
|
||||
///
|
||||
/// - U+0041 'A' ... U+005A 'Z', or
|
||||
/// - U+0061 'a' ... U+007A 'z', or
|
||||
/// - U+0030 '0' ... U+0039 '9'.
|
||||
/// - U+0041 'A' ..= U+005A 'Z', or
|
||||
/// - U+0061 'a' ..= U+007A 'z', or
|
||||
/// - U+0030 '0' ..= U+0039 '9'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4310,7 +4310,7 @@ pub fn is_ascii_alphanumeric(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII decimal digit:
|
||||
/// U+0030 '0' ... U+0039 '9'.
|
||||
/// U+0030 '0' ..= U+0039 '9'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4346,9 +4346,9 @@ pub fn is_ascii_digit(&self) -> bool {
|
||||
|
||||
/// Checks if the value is an ASCII hexadecimal digit:
|
||||
///
|
||||
/// - U+0030 '0' ... U+0039 '9', or
|
||||
/// - U+0041 'A' ... U+0046 'F', or
|
||||
/// - U+0061 'a' ... U+0066 'f'.
|
||||
/// - U+0030 '0' ..= U+0039 '9', or
|
||||
/// - U+0041 'A' ..= U+0046 'F', or
|
||||
/// - U+0061 'a' ..= U+0066 'f'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4384,10 +4384,10 @@ pub fn is_ascii_hexdigit(&self) -> bool {
|
||||
|
||||
/// Checks if the value is an ASCII punctuation character:
|
||||
///
|
||||
/// - U+0021 ... U+002F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - U+003A ... U+0040 `: ; < = > ? @`, or
|
||||
/// - U+005B ... U+0060 ``[ \ ] ^ _ ` ``, or
|
||||
/// - U+007B ... U+007E `{ | } ~`
|
||||
/// - U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - U+003A ..= U+0040 `: ; < = > ? @`, or
|
||||
/// - U+005B ..= U+0060 ``[ \ ] ^ _ ` ``, or
|
||||
/// - U+007B ..= U+007E `{ | } ~`
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4422,7 +4422,7 @@ pub fn is_ascii_punctuation(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII graphic character:
|
||||
/// U+0021 '!' ... U+007E '~'.
|
||||
/// U+0021 '!' ..= U+007E '~'.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -4509,7 +4509,7 @@ pub fn is_ascii_whitespace(&self) -> bool {
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII control character:
|
||||
/// U+0000 NUL ... U+001F UNIT SEPARATOR, or U+007F DELETE.
|
||||
/// U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE.
|
||||
/// Note that most ASCII whitespace characters are control
|
||||
/// characters, but SPACE is not.
|
||||
///
|
||||
|
@ -994,7 +994,7 @@ pub enum PatKind {
|
||||
/// A literal.
|
||||
Lit(P<Expr>),
|
||||
|
||||
/// A range pattern (e.g., `1...2` or `1..2`).
|
||||
/// A range pattern (e.g., `1..=2` or `1..2`).
|
||||
Range(P<Expr>, P<Expr>, RangeEnd),
|
||||
|
||||
/// `[a, b, ..i, y, z]` is represented as:
|
||||
|
@ -428,7 +428,7 @@ enum Constructor<'tcx> {
|
||||
Variant(DefId),
|
||||
/// Literal values.
|
||||
ConstantValue(&'tcx ty::Const<'tcx>),
|
||||
/// Ranges of literal values (`2...5` and `2..5`).
|
||||
/// Ranges of literal values (`2..=5` and `2..5`).
|
||||
ConstantRange(u128, u128, Ty<'tcx>, RangeEnd),
|
||||
/// Array patterns of length n.
|
||||
Slice(u64),
|
||||
@ -816,7 +816,7 @@ fn max_slice_length<'p, 'a: 'p, 'tcx: 'a, I>(
|
||||
/// `IntRange`s always store a contiguous range. This means that values are
|
||||
/// encoded such that `0` encodes the minimum value for the integer,
|
||||
/// regardless of the signedness.
|
||||
/// For example, the pattern `-128...127i8` is encoded as `0..=255`.
|
||||
/// For example, the pattern `-128..=127i8` is encoded as `0..=255`.
|
||||
/// This makes comparisons and arithmetic on interval endpoints much more
|
||||
/// straightforward. See `signed_bias` for details.
|
||||
///
|
||||
|
@ -136,7 +136,7 @@ pub fn parse(target: &Target) -> Result<TargetDataLayout, String> {
|
||||
}
|
||||
if bits >= i128_align_src && bits <= 128 {
|
||||
// Default alignment for i128 is decided by taking the alignment of
|
||||
// largest-sized i{64...128}.
|
||||
// largest-sized i{64..=128}.
|
||||
i128_align_src = bits;
|
||||
dl.i128_align = a;
|
||||
}
|
||||
|
@ -1181,7 +1181,7 @@ pub enum ExprKind {
|
||||
Field(P<Expr>, Ident),
|
||||
/// An indexing operation (e.g., `foo[2]`).
|
||||
Index(P<Expr>, P<Expr>),
|
||||
/// A range (e.g., `1..2`, `1..`, `..2`, `1...2`, `1...`, `...2`).
|
||||
/// A range (e.g., `1..2`, `1..`, `..2`, `1..=2`, `..=2`).
|
||||
Range(Option<P<Expr>>, Option<P<Expr>>, RangeLimits),
|
||||
|
||||
/// Variable reference, possibly containing `::` and/or type
|
||||
|
@ -234,7 +234,7 @@ pub fn can_continue_expr_unambiguously(&self) -> bool {
|
||||
pub const PREC_CLOSURE: i8 = -40;
|
||||
pub const PREC_JUMP: i8 = -30;
|
||||
pub const PREC_RANGE: i8 = -10;
|
||||
// The range 2 ... 14 is reserved for AssocOp binary operator precedences.
|
||||
// The range 2..=14 is reserved for AssocOp binary operator precedences.
|
||||
pub const PREC_PREFIX: i8 = 50;
|
||||
pub const PREC_POSTFIX: i8 = 60;
|
||||
pub const PREC_PAREN: i8 = 99;
|
||||
|
Loading…
Reference in New Issue
Block a user