| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2020-09-29 | Say "doesn't" instead of "wouldn't" in convert message | Camelid | -132/+132 | |
| 2020-09-29 | Add article after "to" | Camelid | -227/+227 | |
| Also added missing backtick in "you can cast" message. | ||||
| 2020-09-27 | Use correct article in help message for conversion or cast | Camelid | -119/+119 | |
| Before it always used `an`; now it uses the correct article for the type. | ||||
| 2020-06-16 | fixup! Note numeric literals that can never fit in an expected type | Ayaz Hafiz | -125/+25 | |
| 2020-06-16 | fixup! Note numeric literals that can never fit in an expected type | Ayaz Hafiz | -1/+416 | |
| 2020-06-13 | fixup! Note numeric literals that can never fit in an expected type | Ayaz Hafiz | -5/+5 | |
| 2020-06-13 | Note numeric literals that can never fit in an expected type | Ayaz Hafiz | -0/+96 | |
| re https://github.com/rust-lang/rust/pull/72380#discussion_r438289385 Given the toy code ```rust fn is_positive(n: usize) { n > -1_isize; } ``` We currently get a type mismatch error like the following: ``` error[E0308]: mismatched types --> src/main.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | 2 | n > (-1_isize).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` But clearly, `-1` can never fit into a `usize`, so the suggestion will always panic. A more useful message would tell the user that the value can never fit in the expected type: ``` error[E0308]: mismatched types --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | note: `-1_isize` can never fit into `usize` --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ ``` Which is what this commit implements. I only added this check for negative literals because - Currently we can only perform such a check for literals (constant value propagation is outside the scope of the typechecker at this point) - A lint error for out-of-range numeric literals is already emitted IMO it makes more sense to put this check in librustc_lint, but as far as I can tell the typecheck pass happens before the lint pass, so I've added it here. r? @estebank | ||||
| 2020-06-11 | fixup! Provide suggestion to convert numeric op LHS rather than unwrapping RHS | Ayaz Hafiz | -138/+463 | |
| 2020-06-11 | Provide suggestion to convert numeric op LHS rather than unwrapping RHS | Ayaz Hafiz | -0/+1700 | |
| Given a code ```rust fn foo(x: u8, y: u32) -> bool { x > y } fn main() {} ``` it could be more helpful to provide a suggestion to do "u32::from(x)" rather than "y.try_into().unwrap()", since the latter may panic. We do this by passing the LHS of a binary expression up the stack into the coercion checker. Closes #73145 | ||||
| 2020-05-20 | refactor check_for_cast | Bastian Kauschke | -0/+10 | |
| 2020-04-28 | Fix numeric-cast tests for new `into` suggestion | Samrat Man Singh | -63/+43 | |
| Remove `integer-into.rs` since the numeric-cast tests already cover these cases. | ||||
| 2020-04-12 | Add blessed tests after compiler message fix | Yashhwanth Ram | -28/+20 | |
| 2019-11-21 | Point at type in `let` assignment on type errors | Esteban Küber | -7/+21 | |
| 2019-11-18 | Surround types with backticks in type errors | Esteban Küber | -278/+278 | |
| 2019-10-24 | Increase spacing for suggestions in diagnostics | Esteban Küber | -0/+236 | |
| Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages. | ||||
| 2019-06-19 | fix indentation | Cedric | -1/+1 | |
| 2019-06-19 | provide variant definition on tuple struct unknow field error | Cedric | -1/+4 | |
| 2019-06-19 | adt hint pointing to adt span | Cedric | -4/+3 | |
| 2019-06-17 | suggest tuple struct syntax | Cedric | -3/+4 | |
| 2019-05-03 | Reword casting message | Esteban Küber | -83/+83 | |
| 2019-04-29 | Account for const fns to avoid incorrect suggestions | Esteban Küber | -0/+59 | |
| 2019-04-29 | Add test | Esteban Küber | -0/+21 | |
| 2019-04-29 | Suggest try_into when possible | Esteban Küber | -359/+2963 | |
| 2019-04-18 | hide `--explain` hint if error has no extended info | Andy Russell | -1/+1 | |
| 2019-03-16 | use the identifier span for missing struct field | Andy Russell | -1/+1 | |
| 2018-12-25 | Remove licenses | Mark Rousskov | -170/+139 | |
| 2018-08-14 | Merged migrated compile-fail tests and ui tests. Fixes #46841. | David Wood | -0/+1307 | |
