diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2015-07-27 03:49:38 +0300 | 
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2015-07-29 01:59:31 +0300 | 
| commit | cca0ea718d363acb85e075aee41223f4da009e82 (patch) | |
| tree | 7c5686962bd85a27ff754f57a107b60086aac3b3 /src/libsyntax/parse/mod.rs | |
| parent | ffcdf0881b37340c9c90bdfd8b96149090a62378 (diff) | |
| download | rust-cca0ea718d363acb85e075aee41223f4da009e82.tar.gz rust-cca0ea718d363acb85e075aee41223f4da009e82.zip  | |
Replace illegal with invalid in most diagnostics
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 70da512e898..c5a73601d89 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -446,11 +446,11 @@ fn filtered_float_lit(data: token::InternedString, suffix: Option<&str>, Some(suf) => { if suf.len() >= 2 && looks_like_width_suffix(&['f'], suf) { // if it looks like a width, lets try to be helpful. - sd.span_err(sp, &*format!("illegal width `{}` for float literal, \ - valid widths are 32 and 64", &suf[1..])); + sd.span_err(sp, &*format!("invalid width `{}` for float literal", &suf[1..])); + sd.fileline_help(sp, "valid widths are 32 and 64"); } else { - sd.span_err(sp, &*format!("illegal suffix `{}` for float literal, \ - valid suffixes are `f32` and `f64`", suf)); + sd.span_err(sp, &*format!("invalid suffix `{}` for float literal", suf)); + sd.fileline_help(sp, "valid suffixes are `f32` and `f64`"); } ast::LitFloatUnsuffixed(data) @@ -619,11 +619,11 @@ pub fn integer_lit(s: &str, // i<digits> and u<digits> look like widths, so lets // give an error message along those lines if looks_like_width_suffix(&['i', 'u'], suf) { - sd.span_err(sp, &*format!("illegal width `{}` for integer literal; \ - valid widths are 8, 16, 32 and 64", + sd.span_err(sp, &*format!("invalid width `{}` for integer literal", &suf[1..])); + sd.fileline_help(sp, "valid widths are 8, 16, 32 and 64"); } else { - sd.span_err(sp, &*format!("illegal suffix `{}` for numeric literal", suf)); + sd.span_err(sp, &*format!("invalid suffix `{}` for numeric literal", suf)); sd.fileline_help(sp, "the suffix must be one of the integral types \ (`u32`, `isize`, etc)"); }  | 
