Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling s/casted/cast/ #48403

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub const MAX: char = '\u{10ffff}';

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

/// Converts a `u32` to a `char`, ignoring validity.
///
/// Note that all [`char`]s are valid [`u32`]s, and can be casted to one with
/// Note that all [`char`]s are valid [`u32`]s, and can be cast to one with
/// [`as`]:
///
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_lint/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
let mut err = cx.struct_span_lint(
OVERFLOWING_LITERALS,
parent_expr.span,
"only u8 can be casted into char");
"only u8 can be cast into char");
err.span_suggestion(parent_expr.span,
&"use a char literal instead",
format!("'\\u{{{:X}}}'", lit_val));
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3094,7 +3094,7 @@ impl<'a> Parser<'a> {
let expr_str = self.sess.codemap().span_to_snippet(expr.span)
.unwrap_or(pprust::expr_to_string(&expr));
err.span_suggestion(expr.span,
&format!("try {} the casted value", op_verb),
&format!("try {} the cast value", op_verb),
format!("({})", expr_str));
err.emit();

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-types-pointer-cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test that pointers to extern types can be casted from/to usize,
// Test that pointers to extern types can be cast from/to usize,
// despite being !Sized.

#![feature(extern_types)]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/cast_char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

fn main() {
const XYZ: char = 0x1F888 as char;
//~^ ERROR only u8 can be casted into char
//~^ ERROR only u8 can be cast into char
const XY: char = 129160 as char;
//~^ ERROR only u8 can be casted into char
//~^ ERROR only u8 can be cast into char
const ZYX: char = '\u{01F888}';
println!("{}", XYZ);
}
4 changes: 2 additions & 2 deletions src/test/ui/cast_char.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: only u8 can be casted into char
error: only u8 can be cast into char
--> $DIR/cast_char.rs:14:23
|
14 | const XYZ: char = 0x1F888 as char;
Expand All @@ -10,7 +10,7 @@ note: lint level defined here
11 | #![deny(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^

error: only u8 can be casted into char
error: only u8 can be cast into char
--> $DIR/cast_char.rs:16:22
|
16 | const XY: char = 129160 as char;
Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/issue-22644.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| ---------- ^ --------- interpreted as generic arguments
| | |
| | not interpreted as comparison
| help: try comparing the casted value: `(a as usize)`
| help: try comparing the cast value: `(a as usize)`

error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:17:33
Expand All @@ -14,7 +14,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| ---------- ^ -------------------- interpreted as generic arguments
| | |
| | not interpreted as comparison
| help: try comparing the casted value: `(a as usize)`
| help: try comparing the cast value: `(a as usize)`

error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:19:31
Expand All @@ -23,7 +23,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| ---------- ^ - interpreted as generic arguments
| | |
| | not interpreted as comparison
| help: try comparing the casted value: `(a as usize)`
| help: try comparing the cast value: `(a as usize)`

error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:21:31
Expand All @@ -32,7 +32,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| -------- ^ -------------------- interpreted as generic arguments
| | |
| | not interpreted as comparison
| help: try comparing the casted value: `(a: usize)`
| help: try comparing the cast value: `(a: usize)`

error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:23:29
Expand All @@ -41,7 +41,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| -------- ^ - interpreted as generic arguments
| | |
| | not interpreted as comparison
| help: try comparing the casted value: `(a: usize)`
| help: try comparing the cast value: `(a: usize)`

error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:28:20
Expand All @@ -50,7 +50,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| ^ not interpreted as comparison
29 | 4);
| - interpreted as generic arguments
help: try comparing the casted value
help: try comparing the cast value
|
25 | println!("{}", (a
26 | as
Expand All @@ -64,7 +64,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
| ^ not interpreted as comparison
38 | 5);
| - interpreted as generic arguments
help: try comparing the casted value
help: try comparing the cast value
|
30 | println!("{}", (a
31 |
Expand All @@ -81,7 +81,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a shi
| ---------- ^^ --------- interpreted as generic arguments
| | |
| | not interpreted as shift
| help: try shifting the casted value: `(a as usize)`
| help: try shifting the cast value: `(a as usize)`

error: expected type, found `4`
--> $DIR/issue-22644.rs:42:28
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issue-42954.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error: `<` is interpreted as a start of generic arguments for `u32`, not a compa
| --------- ^ - interpreted as generic arguments
| | |
| | not interpreted as comparison
| help: try comparing the casted value: `($i as u32)`
| help: try comparing the cast value: `($i as u32)`
...
19 | is_plainly_printable!(c);
| ------------------------- in this macro invocation
Expand Down