summary refs log tree commit diff
path: root/src/test/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
2020-09-30Auto merge of #77069 - sexxi-goose:closure_print_2, r=nikomatsakisbors-5/+5
pretty.rs: Update Closure and Generator print More detailed outline: https://github.com/rust-lang/project-rfc-2229/pull/17 Closes: https://github.com/rust-lang/project-rfc-2229/issues/11 r? `@nikomatsakis` cc `@eddyb` `@davidtwco` `@estebank`
2020-09-28pretty.rs: Update Closure and Generator printAman Arora-5/+5
Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com> Co-authored-by: Logan Mosier <logmosier@gmail.com>
2020-09-26Call `type_of` for opaque types later in compilationMatthew Jasper-39/+72
This ensures that various wf checks have already been done before we typeck item bodies.
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-3/+3
2020-09-11Make suggestion more completeEsteban Küber-3/+9
2020-09-11Make suggestion have a more targetted underlineEsteban Küber-1/+1
2020-09-11Use structured suggestion for `impl T` to `Box<dyn T>`Esteban Küber-1/+4
2020-09-09Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasperTyler Mandry-4/+4
Improve unresolved use error message "use of undeclared type or module `foo`" doesn't mention that it could be a crate. This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate. I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case.
2020-09-08make `ConstEvaluatable` more strictBastian Kauschke-2/+1
2020-09-02pretty: trim paths of unique symbolsDan Aloni-122/+122
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-09-01Clarify message about unresolved useKornel-4/+4
2020-07-27mv std libs to library/mark-1/+1
2020-07-26Add test for issue-72911Yuki Okushi-0/+56
2020-07-22Further tweak wording of E0759 and introduce E0767Esteban Küber-67/+55
2020-07-14Remove `Sized` `on_unimplemented` noteEsteban Küber-2/+0
2020-06-24Rollup merge of #73646 - JohnTitor:add-tests, r=Dylan-DPCDylan DPC-0/+16
Add some regression tests Closes #44861 Closes #51506 Closes #59435 Closes #69840
2020-06-23Add test for issue-69840Yuki Okushi-0/+16
2020-06-23Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikomatsakisManish Goregaokar-9/+56
Account for multiple impl/dyn Trait in return type when suggesting `'_` Make `impl` and `dyn` Trait lifetime suggestions a bit more resilient. Follow up to #72804. r? @nikomatsakis
2020-06-19Rollup merge of #71420 - RalfJung:specialization-incomplete, r=matthewjasperManish Goregaokar-5/+34
Specialization is unsound As discussed in https://github.com/rust-lang/rust/issues/31844#issuecomment-617013949, it might be a good idea to warn users of specialization that the feature they are using is unsound. I also expanded the "incomplete feature" warning to link the user to the tracking issue.
2020-06-19Account for multiple impl/dyn Trait in return type when suggesting `'_`Esteban Küber-9/+56
2020-06-19Rollup merge of #73382 - Aaron1011:fix/self-receiver-candidates, r=petrochenkovManish Goregaokar-18/+0
Only display other method receiver candidates if they actually apply Previously, we would suggest `Box<Self>` as a valid receiver, even if method resolution only succeeded due to an autoderef (e.g. to `&self`)
2020-06-18Rollup merge of #72804 - estebank:opaque-missing-lts-in-fn-2, r=nikomatsakisManish Goregaokar-42/+222
Further tweak lifetime errors involving `dyn Trait` and `impl Trait` in return position * Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static` instead of `Trait + 'static + '_` * When `'static` is explicit, also suggest constraining argument with it * Reduce verbosity of suggestion message and mention lifetime in label * Tweak output for overlapping required/captured spans * Give these errors an error code Follow up to #72543. r? @nikomatsakis
2020-06-16warn against 'specialization' featureRalf Jung-5/+34
2020-06-15Only display other method receiver candidates if they actually applyAaron Hill-18/+0
Previously, we would suggest `Box<Self>` as a valid receiver, even if method resolution only succeeded due to an autoderef (e.g. to `&self`)
2020-06-15review commentsEsteban Küber-25/+25
2020-06-15Expand "recursive opaque type" diagnosticEsteban Küber-99/+179
Fix #70968, partially address #66523.
2020-06-15Change E0758 to E0759 to avoid conflict with #72912Esteban Küber-13/+13
2020-06-15small tweaksEsteban Küber-5/+5
2020-06-15Register new eror codeEsteban Küber-1/+2
2020-06-15Use note for requirement source spanEsteban Küber-24/+48
2020-06-15review comments: wordingEsteban Küber-27/+27
2020-06-15Tweak wording and add error codeEsteban Küber-32/+32
2020-06-15Tweak output for overlapping required/captured spansEsteban Küber-24/+4
2020-06-15Move overlapping span to a noteEsteban Küber-17/+27
2020-06-15Reduce verbosity of suggestion message and mention lifetime in labelEsteban Küber-22/+24
2020-06-15When `'static` is explicit, suggest constraining argument with itEsteban Küber-32/+45
2020-06-15Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static` return ↵Esteban Küber-13/+163
types
2020-06-11Forbid lifetime elision in let position impl TraitMatthew Jasper-20/+26
This is consistent with types.
2020-06-11Stop special casing top level TAITMatthew Jasper-34/+37
2020-06-10Rollup merge of #73005 - Aaron1011:fix/error-overflow, r=estebankDylan DPC-181/+9
Don't create impl candidates when obligation contains errors Fixes #72839 In PR #72621, trait selection was modified to no longer bail out early when an error type was encountered. This allowed us treat `ty::Error` as `Sized`, causing us to avoid emitting a spurious "not sized" error after a type error had already occured. However, this means that we may now try to match an impl candidate against the error type. Since the error type will unify with almost anything, this can cause us to infinitely recurse (eventually triggering an overflow) when trying to verify certain `where` clauses. This commit causes us to skip generating any impl candidates when an error type is involved.
2020-06-05Rollup merge of #72260 - csmoe:issue-69276, r=estebankDylan DPC-2/+3
Spell out `Self` in async function return Closes #69276 r? @tmandry
2020-06-04Treat selection error as ambiguous when error type is presentAaron Hill-181/+9
2020-06-04resolve error code e0760csmoe-2/+2
2020-05-31Add descriptions for all queriesMatthew Jasper-21/+21
2020-05-30Tweak wording and spans of `'static` `dyn Trait`/`impl Trait` requirementsEsteban Küber-45/+25
2020-05-30Tweak type parameter errors to reduce verbosityEsteban Küber-14/+2
2020-05-30review comment: tweak wording and account for span overlapEsteban Küber-5/+5
2020-05-30Account for returned `dyn Trait` evaluating to `'static` lifetimeEsteban Küber-15/+15
Provide a suggestion for `dyn Trait + '_` when possible.
2020-05-27Add test for #68532Yuki Okushi-0/+13
2020-05-27Add test for #56445Yuki Okushi-0/+26