about summary refs log tree commit diff
path: root/src/test/ui/self
AgeCommit message (Collapse)AuthorLines
2020-03-23Update testsJohn Kåre Alsaker-16/+76
2020-03-12update testsMark Mansi-57/+57
2020-02-28Account for arbitrary self types in E0599Esteban Küber-5/+3
2020-02-28Tweak wordingEsteban Küber-1/+1
2020-02-28Mention the full path of the implementing traitEsteban Küber-1/+1
2020-02-28On single local candidate, use span labelEsteban Küber-3/+3
2020-02-27Revert "Backport only: avoid ICE on bad placeholder type"Esteban Küber-16/+2
This reverts commit 1cb555a1dc809a8d310354678ef9c43f01e41ad4.
2020-02-27Rollup merge of #69324 - estebank:ice-break-backport-bad-placeholder-type, ↵Yuki Okushi-2/+16
r=Centril Backport only: avoid ICE on bad placeholder type #69148 has a proper fix, but it is too big to backport. This change avoids the ICE by actually emitting an appropriate error. The output will be duplicated in some cases, but that's better than the avoidable ICE. r? @Centril
2020-02-22update some testsMark Mansi-57/+57
2020-02-20Backport only: avoid ICE on bad placeholder typeEsteban Küber-2/+16
#69148 has a proper fix, but it is too big to backport. This change avoids the ICE by actually emitting an appropriate error. The output will be duplicated in some cases, but that's better than the avoidable ICE.
2020-02-14Update testsMatthew Jasper-202/+5
2020-02-09--bless --compare-mode=nllMatthias Prechtl-1/+1
2020-02-02Use more appropriate spans on object unsafe traits and provide structured ↵Esteban Küber-7/+12
suggestions when possible
2020-02-02Wording changes to object unsafe trait errorsEsteban Küber-3/+13
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
2020-02-02compiletest: error if `compile-fail` header in ui test.Tyler Lanphear-15/+11
2020-01-08Unify output of "variant not found" errorsEsteban Küber-4/+4
2020-01-04Rollup merge of #66913 - VirrageS:help-self, r=varkor,CentrilMazdak Farrokhzad-0/+65
Suggest calling method when first argument is `self` Closes: #66782 I've explored different approaches for this MR but I think the most straightforward is the best one. I've tried to find out if the methods for given type exist (to maybe have a better suggestion), but we don't collect them anywhere and collecting them is quite problematic. Moreover, collecting all the methods would require rewriting big part of the code and also could potentially include performance degradation, which I don't think is necessary for this simple case.
2020-01-03Rollup merge of #67595 - ohadravid:impl-trait-does-not-live-long-enough, ↵Yuki Okushi-3/+3
r=estebank Suggest adding a lifetime constraint for opaque type Fixes #67577, where code like this: ``` struct List { data: Vec<String>, } impl List { fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> { self.data.iter().filter(|s| s.starts_with(prefix)).map(|s| s.as_ref()) } } ``` will show this error: ``` Compiling playground v0.0.1 (/playground) error[E0597]: `prefix` does not live long enough --> src/lib.rs:6:47 | 5 | fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> { | -- lifetime `'a` defined here --------------------------- opaque type requires that `prefix` is borrowed for `'a` ... ``` but without suggesting the lovely `help: you can add a constraint..`. r? @estebank
2019-12-31Change wording for lifetime suggestion for opaque types from `constraint` to ↵Ohad Ravid-3/+3
`bound`
2019-12-29Account for all item kinds when collecting and gateing `_` in item defsEsteban Küber-2/+2
2019-12-29Suggest type param when encountering `_` in fn defsEsteban Küber-2/+12
When encountering `_` type placeholder in fn arguments and return type, suggest using generic type parameters. Expand what counts as an inferable return type to slice, array and tuples of `_`.
2019-12-23Extend suggestion span to whole method callJanusz Marcinkiewicz-3/+9
2019-12-23Add arguments to suggestion method callJanusz Marcinkiewicz-3/+3
2019-12-23Add more detailed suggestionJanusz Marcinkiewicz-10/+19
2019-12-23Suggest calling method when first argument is `self`Janusz Marcinkiewicz-0/+50
2019-12-13parser: recover on `&'lifetime mut $pat`.Mazdak Farrokhzad-1/+1
2019-11-29remove get_named_spanMark Mansi-50/+28
2019-11-29improve lifetime errors with implicit trait object lifetimesMark Mansi-77/+78
2019-11-26Stabilize nested self receiversTaylor Cramer-288/+166
Previously, only Self, &Self, &mut Self, Arc<Self>, Rc<Self>, and Box<Self> were available as stable method receivers. This commit stabilizes nested uses of all the above types. However, nested receivers remain non-object-safe.
2019-11-21Rollup merge of #65730 - csmoe:return-lifetime, r=nikomatsakisMazdak Farrokhzad-4/+0
Suggest to add lifetime constraint at explicit ouput of functions Closes #62097
2019-11-13update suggestion ui testcsmoe-4/+0
2019-11-07Update ui testsGuillaume Gomez-0/+12
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-8/+8
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+3
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-23Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakisbors-2/+45
Object safe for dispatch cc #43561
2019-10-22RFC 2027: "first draft" of implementationMathias Blikstad-2/+45
These are a squashed series of commits.
2019-10-21Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJungMazdak Farrokhzad-1/+10
Change untagged_unions to not allow union fields with drop This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass. Change untagged_unions to not allow union fields with drop Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar). The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature. Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-11Remove most uses of `allow(unions_with_drop_fields)` in testsSimon Sapin-1/+10
2019-10-11Print lifetimes with backticksYuki Okushi-2/+2
2019-10-03Rollup merge of #65057 - mathstuf:fix-warning-typo, r=CentrilTyler Mandry-1/+1
typo: fix typo in E0392 See #64931. --- Cc: @Centril @estebank
2019-10-03typo: fix typo in E0392Ben Boeckel-1/+1
See #64931.
2019-10-03Auto merge of #64999 - nikomatsakis:issue-60424-async-return-inference, ↵bors-447/+443
r=cramertj extract expected return type for async fn generators Fixes #60424 cc @Centril, I know you've been eager to see this fixed. r? @cramertj
2019-10-03./x.py test --bless --compare-mode=nllNiko Matsakis-288/+258
2019-10-02review commentEsteban Küber-1/+1
2019-10-02WIP fix testsNiko Matsakis-159/+185
2019-09-30Reword E0392 slightlyEsteban Küber-1/+1
Make it clearer that a type or lifetime argument not being used can be fixed by referencing it in a struct's fields, not just using `PhathomData`.
2019-09-28Auto merge of #64455 - GuillaumeGomez:long-error-explanation-E0531, r=Centrilbors-2/+4
Add Long error explanation for E0531 Part of #61137.
2019-09-25update ui testsGuillaume Gomez-2/+4
2019-09-15resolve: Remove `!` from "cannot find" diagnostics for macrosVadim Petrochenkov-2/+2
2019-09-08Give method not found a primary span labelEsteban Küber-2/+2