Skip to content

Commit e50005a

Browse files
Rollup merge of rust-lang#48403 - lukaslueg:casted, r=steveklabnik
Fix spelling s/casted/cast/ r? @GuillaumeGomez
2 parents 6f2100b + f7693c0 commit e50005a

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

src/libcore/char.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub const MAX: char = '\u{10ffff}';
7979

8080
/// Converts a `u32` to a `char`.
8181
///
82-
/// Note that all [`char`]s are valid [`u32`]s, and can be casted to one with
82+
/// Note that all [`char`]s are valid [`u32`]s, and can be cast to one with
8383
/// [`as`]:
8484
///
8585
/// ```
@@ -131,7 +131,7 @@ pub fn from_u32(i: u32) -> Option<char> {
131131

132132
/// Converts a `u32` to a `char`, ignoring validity.
133133
///
134-
/// Note that all [`char`]s are valid [`u32`]s, and can be casted to one with
134+
/// Note that all [`char`]s are valid [`u32`]s, and can be cast to one with
135135
/// [`as`]:
136136
///
137137
/// ```

src/librustc_lint/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
182182
let mut err = cx.struct_span_lint(
183183
OVERFLOWING_LITERALS,
184184
parent_expr.span,
185-
"only u8 can be casted into char");
185+
"only u8 can be cast into char");
186186
err.span_suggestion(parent_expr.span,
187187
&"use a char literal instead",
188188
format!("'\\u{{{:X}}}'", lit_val));

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3114,7 +3114,7 @@ impl<'a> Parser<'a> {
31143114
let expr_str = self.sess.codemap().span_to_snippet(expr.span)
31153115
.unwrap_or(pprust::expr_to_string(&expr));
31163116
err.span_suggestion(expr.span,
3117-
&format!("try {} the casted value", op_verb),
3117+
&format!("try {} the cast value", op_verb),
31183118
format!("({})", expr_str));
31193119
err.emit();
31203120

src/test/run-pass/extern-types-pointer-cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that pointers to extern types can be casted from/to usize,
11+
// Test that pointers to extern types can be cast from/to usize,
1212
// despite being !Sized.
1313

1414
#![feature(extern_types)]

src/test/ui/cast_char.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
fn main() {
1414
const XYZ: char = 0x1F888 as char;
15-
//~^ ERROR only u8 can be casted into char
15+
//~^ ERROR only u8 can be cast into char
1616
const XY: char = 129160 as char;
17-
//~^ ERROR only u8 can be casted into char
17+
//~^ ERROR only u8 can be cast into char
1818
const ZYX: char = '\u{01F888}';
1919
println!("{}", XYZ);
2020
}

src/test/ui/cast_char.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: only u8 can be casted into char
1+
error: only u8 can be cast into char
22
--> $DIR/cast_char.rs:14:23
33
|
44
LL | const XYZ: char = 0x1F888 as char;
@@ -10,7 +10,7 @@ note: lint level defined here
1010
LL | #![deny(overflowing_literals)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

13-
error: only u8 can be casted into char
13+
error: only u8 can be cast into char
1414
--> $DIR/cast_char.rs:16:22
1515
|
1616
LL | const XY: char = 129160 as char;

src/test/ui/issue-22644.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | println!("{}", a as usize < long_name); //~ ERROR `<` is interpreted as
55
| ---------- ^ --------- interpreted as generic arguments
66
| | |
77
| | not interpreted as comparison
8-
| help: try comparing the casted value: `(a as usize)`
8+
| help: try comparing the cast value: `(a as usize)`
99

1010
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
1111
--> $DIR/issue-22644.rs:17:33
@@ -14,7 +14,7 @@ LL | println!("{}{}", a as usize < long_name, long_name);
1414
| ---------- ^ -------------------- interpreted as generic arguments
1515
| | |
1616
| | not interpreted as comparison
17-
| help: try comparing the casted value: `(a as usize)`
17+
| help: try comparing the cast value: `(a as usize)`
1818

1919
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
2020
--> $DIR/issue-22644.rs:19:31
@@ -23,7 +23,7 @@ LL | println!("{}", a as usize < 4); //~ ERROR `<` is interpreted as a start
2323
| ---------- ^ - interpreted as generic arguments
2424
| | |
2525
| | not interpreted as comparison
26-
| help: try comparing the casted value: `(a as usize)`
26+
| help: try comparing the cast value: `(a as usize)`
2727

2828
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
2929
--> $DIR/issue-22644.rs:21:31
@@ -32,7 +32,7 @@ LL | println!("{}{}", a: usize < long_name, long_name);
3232
| -------- ^ -------------------- interpreted as generic arguments
3333
| | |
3434
| | not interpreted as comparison
35-
| help: try comparing the casted value: `(a: usize)`
35+
| help: try comparing the cast value: `(a: usize)`
3636

3737
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
3838
--> $DIR/issue-22644.rs:23:29
@@ -41,7 +41,7 @@ LL | println!("{}", a: usize < 4); //~ ERROR `<` is interpreted as a start o
4141
| -------- ^ - interpreted as generic arguments
4242
| | |
4343
| | not interpreted as comparison
44-
| help: try comparing the casted value: `(a: usize)`
44+
| help: try comparing the cast value: `(a: usize)`
4545

4646
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
4747
--> $DIR/issue-22644.rs:28:20
@@ -50,7 +50,7 @@ LL | < //~ ERROR `<` is interpreted as a start of generic
5050
| ^ not interpreted as comparison
5151
LL | 4);
5252
| - interpreted as generic arguments
53-
help: try comparing the casted value
53+
help: try comparing the cast value
5454
|
5555
LL | println!("{}", (a
5656
LL | as
@@ -64,7 +64,7 @@ LL | < //~ ERROR `<` is interpreted as a start of generic
6464
| ^ not interpreted as comparison
6565
LL | 5);
6666
| - interpreted as generic arguments
67-
help: try comparing the casted value
67+
help: try comparing the cast value
6868
|
6969
LL | println!("{}", (a
7070
LL |
@@ -81,7 +81,7 @@ LL | println!("{}", a as usize << long_name); //~ ERROR `<` is interpreted a
8181
| ---------- ^^ --------- interpreted as generic arguments
8282
| | |
8383
| | not interpreted as shift
84-
| help: try shifting the casted value: `(a as usize)`
84+
| help: try shifting the cast value: `(a as usize)`
8585

8686
error: expected type, found `4`
8787
--> $DIR/issue-22644.rs:42:28

src/test/ui/issue-42954.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | $i as u32 < 0 //~ `<` is interpreted as a start of generic argument
55
| --------- ^ - interpreted as generic arguments
66
| | |
77
| | not interpreted as comparison
8-
| help: try comparing the casted value: `($i as u32)`
8+
| help: try comparing the cast value: `($i as u32)`
99
...
1010
LL | is_plainly_printable!(c);
1111
| ------------------------- in this macro invocation

0 commit comments

Comments
 (0)