about summary refs log tree commit diff
path: root/src/test/ui/try-block
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-757/+0
2022-11-23Suggest `.clone()` or `ref binding` on E0382Esteban Küber-0/+4
2022-08-18Reword "Required because of the requirements on the impl of ..."Andy Wang-1/+1
2022-07-19Mention first and last macro in backtraceMichael Goulet-1/+1
2022-07-07Review comments: wordingEsteban Küber-2/+2
2022-07-07Tweak wording and spansEsteban Küber-3/+3
2022-07-07On partial uninit error point at where we need initEsteban Küber-3/+9
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-06-16 fix one more case of trailing spaceklensy-3/+3
2022-06-16diagnostics: fix trailing spaceklensy-5/+5
2022-04-04Mention implementers of unsatisfied traitEsteban Kuber-2/+1
When encountering an unsatisfied trait bound, if there are no other suggestions, mention all the types that *do* implement that trait: ``` error[E0277]: the trait bound `f32: Foo` is not satisfied --> $DIR/impl_wf.rs:22:6 | LL | impl Baz<f32> for f32 { } | ^^^^^^^^ the trait `Foo` is not implemented for `f32` | = help: the following other types implement trait `Foo`: Option<T> i32 str note: required by a bound in `Baz` --> $DIR/impl_wf.rs:18:31 | LL | trait Baz<U: ?Sized> where U: Foo { } | ^^^ required by this bound in `Baz` ``` Mention implementers of traits in `ImplObligation`s. Do not mention other `impl`s for closures, ranges and `?`.
2021-11-28Rollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillotMatthias Krüger-0/+2
Fix a format_args span to be expansion I found this while exploring solutions for rust-lang/rust-clippy#7843. r? `@m-ou-se`
2021-11-20Do not mention associated items when they introduce an obligationEsteban Kuber-20/+0
2021-11-18Move some tests to more reasonable directoriesCaio-0/+11
2021-11-06Move some tests to more reasonable directoriesCaio-0/+18
2021-10-29Fix a format_args span to be expansionCameron Steffen-0/+2
2021-10-15Bless testsCameron Steffen-1/+1
2021-09-09Use more accurate spans for "unused delimiter" lintEsteban Kuber-5/+33
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-07-19Various diagnostics clean ups/tweaksEsteban Küber-4/+20
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2021-05-18Auto merge of #84767 - scottmcm:try_trait_actual, r=lcnrbors-26/+23
Implement the new desugaring from `try_trait_v2` ~~Currently blocked on https://github.com/rust-lang/rust/issues/84782, which has a PR in https://github.com/rust-lang/rust/pull/84811~~ Rebased atop that fix. `try_trait_v2` tracking issue: https://github.com/rust-lang/rust/issues/84277 Unfortunately this is already touching a ton of things, so if you have suggestions for good ways to split it up, I'd be happy to hear them. (The combination between the use in the library, the compiler changes, the corresponding diagnostic differences, even MIR tests mean that I don't really have a great plan for it other than trying to have decently-readable commits. r? `@ghost` ~~(This probably shouldn't go in during the last week before the fork anyway.)~~ Fork happened.
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-06Better rustc_on_unimplemented, and UI test fixesScott McMurray-26/+23
2021-03-06Move some tests to more suitable subdirsYuki Okushi-0/+75
2021-02-17try-back-block-type test: Use TryFromSliceError for From testIan Jackson-8/+4
Using `i32` is rather fragile because it has many implementations - and indeed I'm about to add one. TryFromSliceError is nice because it doesn't seem likely to grow new conversions. We still have one conversion, from Infallible. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-02-06path trimming: ignore type aliasesDan Aloni-2/+2
2020-12-31Consistently call editions "Rust 20xx" in messages.Mara Bos-1/+1
2020-10-06Fix tests from rebaseMatthew Jasper-7/+15
2020-10-06Separate bounds and predicates for associated/opaque typesMatthew Jasper-1/+1
2020-10-03Run attributes check at crate levelGuillaume Gomez-2/+2
2020-09-07Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkovDylan DPC-0/+12
Allow try blocks as the argument to return expressions Fixes #76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
2020-09-02Allow try blocks as the argument to return expressionsScott McMurray-0/+12
Fixes 76271
2020-09-02pretty: trim paths of unique symbolsDan Aloni-23/+23
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-08-11Rollup merge of #75359 - lcnr:unused-delims-trim, r=oli-obkYuki Okushi-1/+1
unused_delims: trim expr improves rustfix output.
2020-08-10Add missing primary labelEsteban Küber-1/+1
2020-08-10unused_delims: trim exprBastian Kauschke-1/+1
2020-07-02Audit uses of `span_suggestion_short`Yuki Okushi-7/+37
2020-04-14allow try as scrutinee, e.g. `match try ...`Bastian Kauschke-15/+85
2020-04-11rustc: Add a warning count upon completionRoccoDev-0/+2
2020-03-22Normalize wording of privacy access labelsEsteban Küber-1/+5
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-1/+1
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-1/+1
2020-01-24Normalise notes with the/isvarkor-1/+1
2019-11-23Rework raw ident suggestionsEsteban Küber-5/+0
Use heuristics to determine whethersuggesting raw identifiers is appropriate. Account for raw identifiers when printing a path in a `use` suggestion.
2019-11-18Surround types with backticks in type errorsEsteban Küber-4/+4
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-12/+0
2019-11-18review comments: tweak prefix stringsEsteban Küber-4/+4
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-2/+2
2019-11-10Make error and warning annotations mandatory in UI testsTomasz Miąsko-3/+3
This change makes error and warning annotations mandatory in UI tests. The only exception are tests that use error patterns to match compiler output and don't have any annotations.
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+1
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-13Update ui testsGuillaume Gomez-0/+1