Skip to content

Commit 145abd8

Browse files
authored
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.
2 parents eb188f1 + 363940b commit 145abd8

File tree

9 files changed

+45
-45
lines changed

9 files changed

+45
-45
lines changed

src/libcore/benches/ascii.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ benches! {
191191
fn case11_mask_mult_bool_match_range(bytes: &mut [u8]) {
192192
fn is_ascii_lowercase(b: u8) -> bool {
193193
match b {
194-
b'a'...b'z' => true,
194+
b'a'..=b'z' => true,
195195
_ => false
196196
}
197197
}
@@ -203,7 +203,7 @@ benches! {
203203
fn case12_mask_shifted_bool_match_range(bytes: &mut [u8]) {
204204
fn is_ascii_lowercase(b: u8) -> bool {
205205
match b {
206-
b'a'...b'z' => true,
206+
b'a'..=b'z' => true,
207207
_ => false
208208
}
209209
}
@@ -215,7 +215,7 @@ benches! {
215215
fn case13_subtract_shifted_bool_match_range(bytes: &mut [u8]) {
216216
fn is_ascii_lowercase(b: u8) -> bool {
217217
match b {
218-
b'a'...b'z' => true,
218+
b'a'..=b'z' => true,
219219
_ => false
220220
}
221221
}
@@ -227,7 +227,7 @@ benches! {
227227
fn case14_subtract_multiplied_bool_match_range(bytes: &mut [u8]) {
228228
fn is_ascii_lowercase(b: u8) -> bool {
229229
match b {
230-
b'a'...b'z' => true,
230+
b'a'..=b'z' => true,
231231
_ => false
232232
}
233233
}

src/libcore/char/convert.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl From<char> for u32 {
123123
}
124124
}
125125

126-
/// Maps a byte in 0x00...0xFF to a `char` whose code point has the same value, in U+0000 to U+00FF.
126+
/// Maps a byte in 0x00..=0xFF to a `char` whose code point has the same value, in U+0000..=U+00FF.
127127
///
128128
/// Unicode is designed such that this effectively decodes bytes
129129
/// with the character encoding that IANA calls ISO-8859-1.

src/libcore/char/methods.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,8 @@ impl char {
10421042

10431043
/// Checks if the value is an ASCII alphabetic character:
10441044
///
1045-
/// - U+0041 'A' ... U+005A 'Z', or
1046-
/// - U+0061 'a' ... U+007A 'z'.
1045+
/// - U+0041 'A' ..= U+005A 'Z', or
1046+
/// - U+0061 'a' ..= U+007A 'z'.
10471047
///
10481048
/// # Examples
10491049
///
@@ -1075,7 +1075,7 @@ impl char {
10751075
}
10761076

10771077
/// Checks if the value is an ASCII uppercase character:
1078-
/// U+0041 'A' ... U+005A 'Z'.
1078+
/// U+0041 'A' ..= U+005A 'Z'.
10791079
///
10801080
/// # Examples
10811081
///
@@ -1107,7 +1107,7 @@ impl char {
11071107
}
11081108

11091109
/// Checks if the value is an ASCII lowercase character:
1110-
/// U+0061 'a' ... U+007A 'z'.
1110+
/// U+0061 'a' ..= U+007A 'z'.
11111111
///
11121112
/// # Examples
11131113
///
@@ -1140,9 +1140,9 @@ impl char {
11401140

11411141
/// Checks if the value is an ASCII alphanumeric character:
11421142
///
1143-
/// - U+0041 'A' ... U+005A 'Z', or
1144-
/// - U+0061 'a' ... U+007A 'z', or
1145-
/// - U+0030 '0' ... U+0039 '9'.
1143+
/// - U+0041 'A' ..= U+005A 'Z', or
1144+
/// - U+0061 'a' ..= U+007A 'z', or
1145+
/// - U+0030 '0' ..= U+0039 '9'.
11461146
///
11471147
/// # Examples
11481148
///
@@ -1174,7 +1174,7 @@ impl char {
11741174
}
11751175

11761176
/// Checks if the value is an ASCII decimal digit:
1177-
/// U+0030 '0' ... U+0039 '9'.
1177+
/// U+0030 '0' ..= U+0039 '9'.
11781178
///
11791179
/// # Examples
11801180
///
@@ -1207,9 +1207,9 @@ impl char {
12071207

12081208
/// Checks if the value is an ASCII hexadecimal digit:
12091209
///
1210-
/// - U+0030 '0' ... U+0039 '9', or
1211-
/// - U+0041 'A' ... U+0046 'F', or
1212-
/// - U+0061 'a' ... U+0066 'f'.
1210+
/// - U+0030 '0' ..= U+0039 '9', or
1211+
/// - U+0041 'A' ..= U+0046 'F', or
1212+
/// - U+0061 'a' ..= U+0066 'f'.
12131213
///
12141214
/// # Examples
12151215
///
@@ -1242,10 +1242,10 @@ impl char {
12421242

12431243
/// Checks if the value is an ASCII punctuation character:
12441244
///
1245-
/// - U+0021 ... U+002F `! " # $ % & ' ( ) * + , - . /`, or
1246-
/// - U+003A ... U+0040 `: ; < = > ? @`, or
1247-
/// - U+005B ... U+0060 ``[ \ ] ^ _ ` ``, or
1248-
/// - U+007B ... U+007E `{ | } ~`
1245+
/// - U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
1246+
/// - U+003A ..= U+0040 `: ; < = > ? @`, or
1247+
/// - U+005B ..= U+0060 ``[ \ ] ^ _ ` ``, or
1248+
/// - U+007B ..= U+007E `{ | } ~`
12491249
///
12501250
/// # Examples
12511251
///
@@ -1277,7 +1277,7 @@ impl char {
12771277
}
12781278

12791279
/// Checks if the value is an ASCII graphic character:
1280-
/// U+0021 '!' ... U+007E '~'.
1280+
/// U+0021 '!' ..= U+007E '~'.
12811281
///
12821282
/// # Examples
12831283
///
@@ -1358,7 +1358,7 @@ impl char {
13581358
}
13591359

13601360
/// Checks if the value is an ASCII control character:
1361-
/// U+0000 NUL ... U+001F UNIT SEPARATOR, or U+007F DELETE.
1361+
/// U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE.
13621362
/// Note that most ASCII whitespace characters are control
13631363
/// characters, but SPACE is not.
13641364
///

src/libcore/num/mod.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -4166,8 +4166,8 @@ impl u8 {
41664166

41674167
/// Checks if the value is an ASCII alphabetic character:
41684168
///
4169-
/// - U+0041 'A' ... U+005A 'Z', or
4170-
/// - U+0061 'a' ... U+007A 'z'.
4169+
/// - U+0041 'A' ..= U+005A 'Z', or
4170+
/// - U+0061 'a' ..= U+007A 'z'.
41714171
///
41724172
/// # Examples
41734173
///
@@ -4202,7 +4202,7 @@ impl u8 {
42024202
}
42034203

42044204
/// Checks if the value is an ASCII uppercase character:
4205-
/// U+0041 'A' ... U+005A 'Z'.
4205+
/// U+0041 'A' ..= U+005A 'Z'.
42064206
///
42074207
/// # Examples
42084208
///
@@ -4237,7 +4237,7 @@ impl u8 {
42374237
}
42384238

42394239
/// Checks if the value is an ASCII lowercase character:
4240-
/// U+0061 'a' ... U+007A 'z'.
4240+
/// U+0061 'a' ..= U+007A 'z'.
42414241
///
42424242
/// # Examples
42434243
///
@@ -4273,9 +4273,9 @@ impl u8 {
42734273

42744274
/// Checks if the value is an ASCII alphanumeric character:
42754275
///
4276-
/// - U+0041 'A' ... U+005A 'Z', or
4277-
/// - U+0061 'a' ... U+007A 'z', or
4278-
/// - U+0030 '0' ... U+0039 '9'.
4276+
/// - U+0041 'A' ..= U+005A 'Z', or
4277+
/// - U+0061 'a' ..= U+007A 'z', or
4278+
/// - U+0030 '0' ..= U+0039 '9'.
42794279
///
42804280
/// # Examples
42814281
///
@@ -4310,7 +4310,7 @@ impl u8 {
43104310
}
43114311

43124312
/// Checks if the value is an ASCII decimal digit:
4313-
/// U+0030 '0' ... U+0039 '9'.
4313+
/// U+0030 '0' ..= U+0039 '9'.
43144314
///
43154315
/// # Examples
43164316
///
@@ -4346,9 +4346,9 @@ impl u8 {
43464346

43474347
/// Checks if the value is an ASCII hexadecimal digit:
43484348
///
4349-
/// - U+0030 '0' ... U+0039 '9', or
4350-
/// - U+0041 'A' ... U+0046 'F', or
4351-
/// - U+0061 'a' ... U+0066 'f'.
4349+
/// - U+0030 '0' ..= U+0039 '9', or
4350+
/// - U+0041 'A' ..= U+0046 'F', or
4351+
/// - U+0061 'a' ..= U+0066 'f'.
43524352
///
43534353
/// # Examples
43544354
///
@@ -4384,10 +4384,10 @@ impl u8 {
43844384

43854385
/// Checks if the value is an ASCII punctuation character:
43864386
///
4387-
/// - U+0021 ... U+002F `! " # $ % & ' ( ) * + , - . /`, or
4388-
/// - U+003A ... U+0040 `: ; < = > ? @`, or
4389-
/// - U+005B ... U+0060 ``[ \ ] ^ _ ` ``, or
4390-
/// - U+007B ... U+007E `{ | } ~`
4387+
/// - U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
4388+
/// - U+003A ..= U+0040 `: ; < = > ? @`, or
4389+
/// - U+005B ..= U+0060 ``[ \ ] ^ _ ` ``, or
4390+
/// - U+007B ..= U+007E `{ | } ~`
43914391
///
43924392
/// # Examples
43934393
///
@@ -4422,7 +4422,7 @@ impl u8 {
44224422
}
44234423

44244424
/// Checks if the value is an ASCII graphic character:
4425-
/// U+0021 '!' ... U+007E '~'.
4425+
/// U+0021 '!' ..= U+007E '~'.
44264426
///
44274427
/// # Examples
44284428
///
@@ -4509,7 +4509,7 @@ impl u8 {
45094509
}
45104510

45114511
/// Checks if the value is an ASCII control character:
4512-
/// U+0000 NUL ... U+001F UNIT SEPARATOR, or U+007F DELETE.
4512+
/// U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE.
45134513
/// Note that most ASCII whitespace characters are control
45144514
/// characters, but SPACE is not.
45154515
///

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ pub enum PatKind {
994994
/// A literal.
995995
Lit(P<Expr>),
996996

997-
/// A range pattern (e.g., `1...2` or `1..2`).
997+
/// A range pattern (e.g., `1..=2` or `1..2`).
998998
Range(P<Expr>, P<Expr>, RangeEnd),
999999

10001000
/// `[a, b, ..i, y, z]` is represented as:

src/librustc_mir/hair/pattern/_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ enum Constructor<'tcx> {
428428
Variant(DefId),
429429
/// Literal values.
430430
ConstantValue(&'tcx ty::Const<'tcx>),
431-
/// Ranges of literal values (`2...5` and `2..5`).
431+
/// Ranges of literal values (`2..=5` and `2..5`).
432432
ConstantRange(u128, u128, Ty<'tcx>, RangeEnd),
433433
/// Array patterns of length n.
434434
Slice(u64),
@@ -816,7 +816,7 @@ fn max_slice_length<'p, 'a: 'p, 'tcx: 'a, I>(
816816
/// `IntRange`s always store a contiguous range. This means that values are
817817
/// encoded such that `0` encodes the minimum value for the integer,
818818
/// regardless of the signedness.
819-
/// For example, the pattern `-128...127i8` is encoded as `0..=255`.
819+
/// For example, the pattern `-128..=127i8` is encoded as `0..=255`.
820820
/// This makes comparisons and arithmetic on interval endpoints much more
821821
/// straightforward. See `signed_bias` for details.
822822
///

src/librustc_target/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl TargetDataLayout {
136136
}
137137
if bits >= i128_align_src && bits <= 128 {
138138
// Default alignment for i128 is decided by taking the alignment of
139-
// largest-sized i{64...128}.
139+
// largest-sized i{64..=128}.
140140
i128_align_src = bits;
141141
dl.i128_align = a;
142142
}

src/libsyntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ pub enum ExprKind {
11811181
Field(P<Expr>, Ident),
11821182
/// An indexing operation (e.g., `foo[2]`).
11831183
Index(P<Expr>, P<Expr>),
1184-
/// A range (e.g., `1..2`, `1..`, `..2`, `1...2`, `1...`, `...2`).
1184+
/// A range (e.g., `1..2`, `1..`, `..2`, `1..=2`, `..=2`).
11851185
Range(Option<P<Expr>>, Option<P<Expr>>, RangeLimits),
11861186

11871187
/// Variable reference, possibly containing `::` and/or type

src/libsyntax/util/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub const PREC_RESET: i8 = -100;
234234
pub const PREC_CLOSURE: i8 = -40;
235235
pub const PREC_JUMP: i8 = -30;
236236
pub const PREC_RANGE: i8 = -10;
237-
// The range 2 ... 14 is reserved for AssocOp binary operator precedences.
237+
// The range 2..=14 is reserved for AssocOp binary operator precedences.
238238
pub const PREC_PREFIX: i8 = 50;
239239
pub const PREC_POSTFIX: i8 = 60;
240240
pub const PREC_PAREN: i8 = 99;

0 commit comments

Comments
 (0)