diff options
| author | kennytm <kennytm@gmail.com> | 2018-03-06 16:25:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-06 16:25:28 +0800 |
| commit | 43de95ca5b177bdb61a2ea8d8206a3234e75eff6 (patch) | |
| tree | afa07cfebb1a726ff2abbd1c9c9be10f237fb7b5 | |
| parent | 1733a61141d125beb45587dd89d54cd4a01cdd5a (diff) | |
| parent | f7693c06338c825d0d49eb1373e2039416b38389 (diff) | |
| download | rust-43de95ca5b177bdb61a2ea8d8206a3234e75eff6.tar.gz rust-43de95ca5b177bdb61a2ea8d8206a3234e75eff6.zip | |
Rollup merge of #48403 - lukaslueg:casted, r=steveklabnik
Fix spelling s/casted/cast/ r? @GuillaumeGomez
| -rw-r--r-- | src/libcore/char.rs | 4 | ||||
| -rw-r--r-- | src/librustc_lint/types.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/extern-types-pointer-cast.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/cast_char.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/cast_char.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issue-22644.stderr | 16 | ||||
| -rw-r--r-- | src/test/ui/issue-42954.stderr | 2 |
8 files changed, 18 insertions, 18 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 7215bd2a476..55d4b590f91 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -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`]: /// /// ``` @@ -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`]: /// /// ``` diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index ef9b3d38c63..5431318dff9 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -182,7 +182,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)); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 92584f5b519..da2a22df997 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3114,7 +3114,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(); diff --git a/src/test/run-pass/extern-types-pointer-cast.rs b/src/test/run-pass/extern-types-pointer-cast.rs index 628a570665a..0dede8eb70d 100644 --- a/src/test/run-pass/extern-types-pointer-cast.rs +++ b/src/test/run-pass/extern-types-pointer-cast.rs @@ -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)] diff --git a/src/test/ui/cast_char.rs b/src/test/ui/cast_char.rs index cd8ade5e51a..4dfa5037bc5 100644 --- a/src/test/ui/cast_char.rs +++ b/src/test/ui/cast_char.rs @@ -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); } diff --git a/src/test/ui/cast_char.stderr b/src/test/ui/cast_char.stderr index 481715fd9ce..600d7e61a09 100644 --- a/src/test/ui/cast_char.stderr +++ b/src/test/ui/cast_char.stderr @@ -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 | LL | const XYZ: char = 0x1F888 as char; @@ -10,7 +10,7 @@ note: lint level defined here LL | #![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 | LL | const XY: char = 129160 as char; diff --git a/src/test/ui/issue-22644.stderr b/src/test/ui/issue-22644.stderr index d5e87f89417..257b9bd235d 100644 --- a/src/test/ui/issue-22644.stderr +++ b/src/test/ui/issue-22644.stderr @@ -5,7 +5,7 @@ LL | println!("{}", a as usize < long_name); //~ ERROR `<` is interpreted as | ---------- ^ --------- 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 @@ -14,7 +14,7 @@ LL | println!("{}{}", a as usize < long_name, long_name); | ---------- ^ -------------------- 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 @@ -23,7 +23,7 @@ LL | println!("{}", a as usize < 4); //~ ERROR `<` is interpreted as a start | ---------- ^ - 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 @@ -32,7 +32,7 @@ LL | println!("{}{}", a: usize < long_name, long_name); | -------- ^ -------------------- 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 @@ -41,7 +41,7 @@ LL | println!("{}", a: usize < 4); //~ ERROR `<` is interpreted as a start o | -------- ^ - 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 @@ -50,7 +50,7 @@ LL | < //~ ERROR `<` is interpreted as a start of generic | ^ not interpreted as comparison LL | 4); | - interpreted as generic arguments -help: try comparing the casted value +help: try comparing the cast value | LL | println!("{}", (a LL | as @@ -64,7 +64,7 @@ LL | < //~ ERROR `<` is interpreted as a start of generic | ^ not interpreted as comparison LL | 5); | - interpreted as generic arguments -help: try comparing the casted value +help: try comparing the cast value | LL | println!("{}", (a LL | @@ -81,7 +81,7 @@ LL | println!("{}", a as usize << long_name); //~ ERROR `<` is interpreted a | ---------- ^^ --------- 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 diff --git a/src/test/ui/issue-42954.stderr b/src/test/ui/issue-42954.stderr index 1a3984181f6..9164434006f 100644 --- a/src/test/ui/issue-42954.stderr +++ b/src/test/ui/issue-42954.stderr @@ -5,7 +5,7 @@ LL | $i as u32 < 0 //~ `<` is interpreted as a start of generic argument | --------- ^ - 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)` ... LL | is_plainly_printable!(c); | ------------------------- in this macro invocation |
