Skip to content

Rollup of 9 pull requests #54319

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

Merged
merged 25 commits into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4ced4f3
Add doc for impl From for Addr
phungleson Aug 21, 2018
1a0e8f9
Remove namespace for keywords
GuillaumeGomez Sep 10, 2018
fab6b06
Add treat-err-as-bug flag in rustdoc
GuillaumeGomez Sep 13, 2018
818938f
Remove treat-err-as-bug test
GuillaumeGomez Sep 14, 2018
fc6e1ed
Regression test for rust-lang/rust#53675.
pnkfelix Sep 14, 2018
1984079
lint to change numeric literal instead of into
csmoe Sep 16, 2018
0ff0669
replace old literal in expr
csmoe Sep 16, 2018
17a28f7
add test for numeric literal cast
csmoe Sep 16, 2018
d31a2a0
trim type numeric literal suffix
csmoe Sep 16, 2018
9d6c4f0
merge into/literal suggestion for DRY
csmoe Sep 17, 2018
2fb6585
add test for float/integer
csmoe Sep 17, 2018
e4e4039
libsyntax: fix casing in error message
Sep 17, 2018
82e1750
Add -Z dont-buffer-diagnostics, a way to force NLL to immediately emi…
pnkfelix Sep 15, 2018
79da7a0
libsyntax: add optional help message for deprecated features
Sep 17, 2018
ff61794
Remove REAMDE with now-out-of-date docs about docs.
frewsxcv Sep 18, 2018
993d022
OsStr: Document that it's not NUL terminated
cgwalters Sep 18, 2018
3cdebfb
Rollup merge of #53522 - phungleson:fix-impl-from-for-addr, r=TimNN
GuillaumeGomez Sep 18, 2018
6aed133
Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, r=Q…
GuillaumeGomez Sep 18, 2018
108be3c
Rollup merge of #54205 - GuillaumeGomez:treat-err-as-bug, r=QuietMisd…
GuillaumeGomez Sep 18, 2018
cdd9034
Rollup merge of #54225 - pnkfelix:issue-53675-add-test-called-panic, …
GuillaumeGomez Sep 18, 2018
22d3812
Rollup merge of #54232 - pnkfelix:add-way-to-disable-diagnostic-buffe…
GuillaumeGomez Sep 18, 2018
5f1a123
Rollup merge of #54273 - csmoe:lint_ty_lit, r=estebank
GuillaumeGomez Sep 18, 2018
50b9694
Rollup merge of #54299 - snaedis:issue-54246, r=varkor
GuillaumeGomez Sep 18, 2018
6a4e7bb
Rollup merge of #54311 - frewsxcv:frewsxcv-readme, r=GuillaumeGomez
GuillaumeGomez Sep 18, 2018
85d214e
Rollup merge of #54313 - cgwalters:osstr-ref-cstr, r=joshtriplett
GuillaumeGomez Sep 18, 2018
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
Prev Previous commit
Next Next commit
add test for float/integer
  • Loading branch information
csmoe committed Sep 17, 2018
commit 2fb6585f33bf1af3b6b5143347eb534cebd257e4
7 changes: 6 additions & 1 deletion src/test/ui/mismatched_types/numeric-literal-cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
// except according to those terms.

fn foo(_: u16) {}
fn foo1(_: f64) {}
fn foo2(_: i32) {}

fn main() {
foo(8u8);
foo(1u8);
foo1(2f32);
foo2(3i16);
}

28 changes: 24 additions & 4 deletions src/test/ui/mismatched_types/numeric-literal-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:13:9
--> $DIR/numeric-literal-cast.rs:16:9
|
LL | foo(8u8);
LL | foo(1u8);
| ^^^ expected u16, found u8
help: change the type of the numeric literal from `u8` to `u16`
|
LL | foo(8u16);
LL | foo(1u16);
| ^^^^

error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:17:10
|
LL | foo1(2f32);
| ^^^^ expected f64, found f32
help: change the type of the numeric literal from `f32` to `f64`
|
LL | foo1(2f64);
| ^^^^

error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:18:10
|
LL | foo2(3i16);
| ^^^^ expected i32, found i16
help: change the type of the numeric literal from `i16` to `i32`
|
LL | foo2(3i32);
| ^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0308`.