about summary refs log tree commit diff
path: root/src/test/ui/repeat_count.stderr
AgeCommit message (Collapse)AuthorLines
2022-04-28Add new repeat expr test.Oli Scherer-69/+0
Also add repeat expr test folder and move all related tests to it
2021-09-13Auto merge of #87915 - estebank:fancy-spans, r=oli-obkbors-1/+1
Use smaller spans for some structured suggestions Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts
2021-09-01Stop sorting bodies by span.Camille GILLOT-6/+6
The definition order is already close to the span order, and only differs in corner cases.
2021-08-12Use smaller spans for some structured suggestionsEsteban Kuber-1/+1
Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts * E0212
2021-08-11Modify structured suggestion outputEsteban Küber-1/+1
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-01-07Use correct span for structured suggestionEsteban Küber-1/+1
On structured suggestion for `let` -> `const` and `const` -> `let`, use a proper `Span` and update tests to check the correct application. Follow up to #80012.
2021-01-07bless testsDaiki Ihara-0/+2
2020-09-02pretty: trim paths of unique symbolsDan Aloni-1/+1
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-06-16fixup! Note numeric literals that can never fit in an expected typeAyaz Hafiz-10/+2
2020-06-13fixup! Note numeric literals that can never fit in an expected typeAyaz Hafiz-2/+2
2020-06-13Note numeric literals that can never fit in an expected typeAyaz Hafiz-0/+12
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-05-20refactor check_for_castBastian Kauschke-2/+13
2020-05-20fix is_const_contextBastian Kauschke-10/+0
2020-03-23Evaluate repeat expression lengths as late as possibleOliver Scherer-6/+6
2019-11-18Surround types with backticks in type errorsEsteban Küber-7/+7
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-19/+7
2019-11-18review comments: tweak prefix stringsEsteban Küber-2/+2
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-3/+3
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+2
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-05-03Reword casting messageEsteban Küber-2/+2
2019-04-29Suggest try_into when possibleEsteban Küber-0/+8
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+1
2018-12-31Improve type mismatch error messagesYuning Zhang-1/+1
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-25Remove licensesMark Rousskov-8/+8
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+64