]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/indexing-requires-a-uint.stderr
Rollup merge of #98640 - cuviper:stable-rust-analyzer, r=Mark-Simulacrum
[rust.git] / src / test / ui / indexing-requires-a-uint.stderr
index a9adff4faded9e5f4913e204002ae3e218202ab4..0a24855a6a79c96e648876a955934215533451bb 100644 (file)
@@ -21,6 +21,10 @@ note: function defined here
    |
 LL |     fn bar<T>(_: T) {}
    |        ^^^    ----
+help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
+   |
+LL |     bar::<isize>(i.try_into().unwrap());  // i should not be re-coerced back to an isize
+   |                   ++++++++++++++++++++
 
 error: aborting due to 2 previous errors