about summary refs log tree commit diff
path: root/src/liballoc_jemalloc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-07 22:48:16 +0000
committerbors <bors@rust-lang.org>2018-01-07 22:48:16 +0000
commita29461f322974cd6ff2e7bf058588db2adf35228 (patch)
treebcc9cf06aeb27646b551c59dd66520788aab4032 /src/liballoc_jemalloc
parentee220daca345302c3277befee2732b6b2a5a711c (diff)
parentf7aed3eb27888af72703da15a6b93e51e020f5fd (diff)
downloadrust-a29461f322974cd6ff2e7bf058588db2adf35228.tar.gz
rust-a29461f322974cd6ff2e7bf058588db2adf35228.zip
Auto merge of #47171 - estebank:numeric-literal-suggestion, r=nikomatsakis
Provide suggestion when trying to use method on numeric literal

New output:

```
error[E0688]: can't call method `powi` on ambiguous numeric type `{float}`
  --> $DIR/method-on-ambiguous-numeric-type.rs:12:17
   |
12 |     let x = 2.0.powi(2);
   |                 ^^^^
help: you must specify a concrete type for this numeric value, like `f32`
   |
12 |     let x = 2.0_f32.powi(2);
   |             ^^^^^^^
```

Previous output:

```
error[E0599]: no method named `powi` found for type `{float}` in the current scope
  --> src/main.rs:12:17
   |
12 |     let x = 2.0.powi(2);
   |                 ^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
   |
11 | use core::num::Float;
   |
```

Fix #40985.
Diffstat (limited to 'src/liballoc_jemalloc')
0 files changed, 0 insertions, 0 deletions