summary refs log tree commit diff
path: root/src/test/ui/unsized
AgeCommit message (Collapse)AuthorLines
2022-06-16diagnostics: fix trailing spaceklensy-35/+35
2022-06-06Update src/test/ui/unsized/issue-97732.rsChase Wilson-3/+8
Co-authored-by: Eduard-Mihai Burtescu <edy.burt@gmail.com>
2022-06-04Added test for #97732Chase Wilson-0/+23
2022-05-20Move testsCaio-0/+108
2022-05-06Resolve vars in note_type_errJack Huey-3/+6
2022-04-05Rollup merge of #95603 - compiler-errors:dyn-return, r=oli-obkDylan DPC-0/+111
Fix late-bound ICE in `dyn` return type suggestion This fixes the root-cause of the attached issues -- the root problem is that we're using the return type from a signature with late-bound instead of early-bound regions. The change on line 1087 (`let Some(liberated_sig) = typeck_results.liberated_fn_sigs().get(fn_hir_id) else { return false; };`) makes sure we're grabbing the _right_ return type for this suggestion to check the `dyn` predicates with. Fixes #91801 Fixes #91803 This fix also includes some drive-by changes, specifically: 1. Don't suggest boxing when we have `-> dyn Trait` and are already returning `Box<T>` where `T: Trait` (before we always boxed the value). 2. Suggestion applies even when the return type is a type alias (e.g. `type Foo = dyn Trait`). This does cause the suggestion to expand to the aliased type, but I think it's still beneficial. 3. Split up the multipart suggestion because there's a 6-line max in the printed output... I am open to splitting out the above changes, if we just want to fix the ICE first. cc: ```@terrarier2111``` and #92289
2022-04-02Suggest borrowing when trying to coerce unsized type into dyn TraitMichael Goulet-0/+16
2022-04-02Fix late-bound ICE in unsized return suggestionMichael Goulet-0/+111
2021-12-25bless ui testDeadbeef-1/+16
2021-11-20Point at source of trait bound obligations in more placesEsteban Kuber-0/+9
Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). Address part of #89418.
2021-11-18Move some tests to more reasonable directoriesCaio-0/+79
2021-11-14Move some tests to more reasonable directoriesCaio-0/+9
2021-11-06Move some tests to more reasonable directoriesCaio-0/+22
2021-10-30stabilize `relaxed_struct_unsize`lcnr-1/+0
2021-10-19Revert "Rollup merge of #86011 - tlyu:correct-sized-bound-spans, r=estebank"Yuki Okushi-4/+4
This reverts commit 36a1076d24697621a3bb67ef654b4eb79647aa54, reversing changes made to e1e9319d93aea755c444c8f8ff863b0936d7a4b6.
2021-10-08update ui test expectationsTaylor Yu-4/+4
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-8/+7
2021-09-16Point at call span that introduced obligation for the argEsteban Kuber-5/+15
2021-09-16Point at argument instead of call for their obligationsEsteban Kuber-34/+3
When an obligation is introduced by a specific `fn` argument, point at the argument instead of the `fn` call if the obligation fails to be fulfilled.
2021-08-26add unsized coercion testlcnr-0/+24
2021-08-16Use note to point at bound introducing requirementEsteban Küber-38/+66
2021-08-11Modify structured suggestion outputEsteban Küber-133/+169
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-07-30Do not discard `?Sized` type params and suggest their removalEsteban Küber-1/+146
2021-07-03Remove the deprecated `core::raw` and `std::raw` module.Charles Lew-14/+11
2021-04-19fix suggestion for unsized function parameterslcnr-0/+814
2021-04-06Point at `impl` and type defs introducing requirements on E0277Esteban Küber-5/+25
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-3/+1
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-03-31give full path of constraint in suggest_constraining_type_paramhi-rustin-11/+11
revert file bless with nll mode
2021-02-06Rollup merge of #81738 - camelid:misc-small-diag-cleanup, r=lcnrJonas Schievink-4/+4
Miscellaneous small diagnostics cleanup
2021-02-03Miscellaneous small diagnostics cleanupCamelid-4/+4
2021-02-04add `relaxed_struct_unsize` feature gateBastian Kauschke-0/+1
2021-02-04relax adt unsizing requirementsBastian Kauschke-0/+11
2020-10-18Use smaller example for issue-71659Yuki Okushi-77/+15
2020-10-18Add test for issue-75707Yuki Okushi-0/+29
2020-10-18Add test for issue-71659Yuki Okushi-0/+103
2020-09-02pretty: trim paths of unique symbolsDan Aloni-35/+35
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-07-25Use the proper span when WF-checking an impl self typeAaron Hill-2/+2
2020-07-14Reword messageEsteban Küber-20/+20
2020-07-14Remove redundant explanatory `note` for type parametersEsteban Küber-12/+0
2020-07-14Remove `Sized` `on_unimplemented` noteEsteban Küber-31/+0
2020-07-14Suggest boxing or borrowing unsized fieldsEsteban Küber-20/+200
2020-06-16Provide `help` when `T: ?Sized` can't be suggestedEsteban Küber-0/+28
2020-06-15Account for derived obligations to suggest `?Sized` boundEsteban Küber-0/+4
Fix #27964.
2020-04-24Add regression test for #26376Wesley Wiser-0/+25
2020-04-18Do not emit note for projected derived obligationsEsteban Küber-1/+0
2020-04-18Maintain chain of derived obligationsEsteban Küber-0/+4
When evaluating the derived obligations from super traits, maintain a reference to the original obligation in order to give more actionable context in the output.
2020-04-08Small tweaks to required bound spanEsteban Küber-6/+6
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-4/+4
Keep more information about trait binding failures.
2020-02-02Account for `?Sized` type parameter boundsEsteban Küber-18/+18
2019-11-24Fix pointing at arg for fulfillment errors in function callsJanusz Marcinkiewicz-0/+63