about summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-106/+33
available
2022-12-13Rollup merge of #105332 - estebank:iterator-chains, r=oli-obkMatthias Krüger-42/+48
Point out the type of associated types in every method call of iterator chains Partially address #105184 by pointing out the type of associated types in every method call of iterator chains: ``` note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@src/test/ui/iterators/invalid-iterator-chain.rs:12:18: 12:21]>` --> src/test/ui/iterators/invalid-iterator-chain.rs:12:14 | 10 | vec![0, 1] | ---------- this expression has type `Vec<{integer}>` 11 | .iter() | ------ associated type `std::iter::Iterator::Item` is `&{integer}` here 12 | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here ``` We also reduce the number of impls we mention when any of the candidates is an "exact match". This benefits the output of cases with numerics greatly. Outstanding work would be to provide a structured suggestion for appropriate changes, like in this case detecting the spurious `;` in the closure.
2022-12-11Point at method call when it is the source of the bound errorEsteban Küber-42/+23
2022-12-11Move testsCaio-883/+0
2022-12-11Use `with_forced_trimmed_paths`Esteban Küber-4/+4
2022-12-11Only point at methods that might be relevantEsteban Küber-2/+2
2022-12-11Remove mention of "assoc type" in label as it is already in the `note` messageEsteban Küber-4/+4
2022-12-11Account for method call chains split across multiple bindingsEsteban Küber-10/+13
2022-12-11Mention only assoc types changesEsteban Küber-5/+5
2022-12-11Provide associated type information in method chainsMichael Goulet-0/+22
When encountering an unmet obligation that affects a method chain, like in iterator chains where one of the links has the wrong associated type, we point at every method call and mention their evaluated associated type at that point to give context to the user of where expectations diverged from the code as written. ``` note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/invalid-iterator-chain.rs:12:18: 12:21]>` --> $DIR/invalid-iterator-chain.rs:12:14 | LL | vec![0, 1] | ---------- this expression has type `Vec<{integer}>` LL | .iter() | ------ associated type `std::iter::Iterator::Item` is `&{integer}` here LL | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here ```
2022-12-10Introduce `with_forced_trimmed_paths`Esteban Küber-6/+6
2022-12-10Rollup merge of #105192 - estebank:point-at-lhs-on-binop, r=fee1-deadMatthias Krüger-1/+3
Point at LHS on binop type err if relevant
2022-12-08Point at LHS on binop type err if relevantEsteban Küber-1/+3
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-6/+6
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-06Rollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errorsMatthias Krüger-0/+130
Avoid ICE by accounting for missing type Fix #105330
2022-12-05Avoid ICE by accounting for missing typeEsteban Küber-0/+130
Fix #105330
2022-12-05Tweak "the following other types implement trait"Esteban Küber-8/+3
When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types. fix fmt
2022-12-03Rollup merge of #105164 - compiler-errors:revert-import-filter, r=estebankMatthias Krüger-6/+15
Restore `use` suggestion for `dyn` method call requiring `Sized` Add the suggestion back that I accidentally removed in 88f2140d8736329610a4c0bd8000e164c9170537 because I didn't understand that suggestion was actually useful... Fixes #105159
2022-12-02Revert 88f2140Michael Goulet-6/+15
2022-11-28fix testEsteban Küber-1/+1
2022-11-28Further tweak the type shortening logicEsteban Küber-5/+5
2022-11-28Detect long types in E0308 and write them to diskEsteban Küber-5/+5
On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-11-28Change multiline span ASCII art visual orderEsteban Küber-3/+3
2022-11-24Rollup merge of #103908 - estebank:consider-cloning, r=compiler-errorsMatthias Krüger-0/+9
Suggest `.clone()` or `ref binding` on E0382
2022-11-24Auto merge of #104610 - ouz-a:revert-overflow, r=compiler-errorsbors-2/+9
Reverts check done by #100757 As my `fix` caused more issues than it resolved it's better to revert it. ( #103274 #104322 https://github.com/rust-lang/rust/issues/104606) r? `@compiler-errors` Reopens #95134
2022-11-23Tweak output in for loopsEsteban Küber-8/+0
Do not suggest `.clone()` as we already suggest borrowing the iterated value.
2022-11-23Suggest `.clone()` or `ref binding` on E0382Esteban Küber-0/+17
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-10/+8
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-10/+8
2022-11-20Move testsCaio-238/+0
2022-11-19fix test errouz-a-3/+4
2022-11-19re-add test and blessouz-a-1/+1
2022-11-19revert-overflowouz-a-1/+7
2022-11-19Rollup merge of #104469 - estebank:long-types, r=oli-obkMatthias Krüger-21/+26
Make "long type" printing type aware and trim types in E0275 Instead of simple string cutting, use a custom printer to hide parts of long printed types. On E0275, check for type length before printing.
2022-11-18Only use `...` instead of `_` for type elisionEsteban Küber-2/+2
`_` might confuse people into believing that the type isn't known, while `...` is not used anywhere else for types and is not valid syntax, making it more likely to convey the right understanding.
2022-11-18On E0275 do not print out the full type in the msgEsteban Küber-3/+3
When printing requirement overflow errors, do not print out the full type name when it is longer than 50 characters long.
2022-11-18On overflow errors, do not print out long typesEsteban Küber-14/+20
2022-11-18Make "long type" printing type awareEsteban Küber-4/+3
Instead of simple string cutting, use a custom printer to hide parts of long printed types.
2022-11-18rename `is_tainted_by_errors` Boxy-2/+1
2022-11-16Rollup merge of #104317 - RalfJung:ctfe-error-reporting, r=oli-obkMatthias Krüger-17/+16
cleanup and dedupe CTFE and Miri error reporting It looks like most of the time, this error raised from const_prop_lint is just redundant -- it duplicates the error reported when evaluating the const-eval query. This lets us make `ConstEvalErr` private to the const_eval module which I think is a good step. The Miri change mostly replaces a `match` by `if let`, and dedupes the "this error is impossible in Miri" checks. r? ``@oli-obk`` Fixes https://github.com/rust-lang/rust/issues/75461
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-17/+16
2022-11-16Rollup merge of #104419 - Ayush1325:test-issue-30490, r=lcnrMatthias Krüger-1/+1
Fix test/ui/issues/issue-30490.rs Since the empty main is used for `not(unix)`, all the targets that will use this empty main will also need `allow(unused_imports)`. Originally part of https://github.com/rust-lang/rust/pull/100316 Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-15Rollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebankMatthias Krüger-0/+6
Show note where the macro failed to match When feeding the wrong tokens, it used to fail with a very generic error that wasn't very helpful. This change tries to help by noting where specifically the matching went wrong. ```rust macro_rules! uwu { (a a a b) => {}; } uwu! { a a a c } ``` ```diff error: no rules expected the token `c` --> macros.rs:5:14 | 1 | macro_rules! uwu { | ---------------- when calling this macro ... 4 | uwu! { a a a c } | ^ no rules expected this token in macro call | +note: while trying to match `b` + --> macros.rs:2:12 + | +2 | (a a a b) => {}; + | ^ ```
2022-11-14Show a note where a macro failed to matchNilstrieb-0/+6
This shows a small note on what the macro matcher was currently processing to aid with "no rules expected the token X" errors.
2022-11-14Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwcoMatthias Krüger-4/+4
Don't print full paths in overlap errors We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message. r? diagnostics
2022-11-14Fix test/ui/issues/issue-30490.rsAyush Singh-1/+1
Since the empty main is used for `not(unix)`, all the targets that will use this empty main will also need `allow(unused_imports)`. Originally part of https://github.com/rust-lang/rust/pull/100316 Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-12Move testsCaio-450/+0
2022-11-12Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebankDylan DPC-4/+1
Unhide unknown spans r? ```@estebank```
2022-11-12Rollup merge of #102049 - fee1-dead-contrib:derive_const, r=oli-obkDylan DPC-2/+12
Add the `#[derive_const]` attribute Closes #102371. This is a minimal patchset for the attribute to work. There are no restrictions on what traits this attribute applies to. r? `````@oli-obk`````
2022-11-11Print all labels, even if they have no span. Fall back to main item's span.Oli Scherer-4/+1