about summary refs log tree commit diff
path: root/src/test/ui/chalkify
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-802/+0
2023-01-10remove E0280 and ICE insteadbowlerman-44/+43
2023-01-06Report WF error for new solver tooMichael Goulet-4/+4
2023-01-04Update tests, etcMichael Goulet-29/+29
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-6/+0
available
2022-11-26Pretty-print generators with their `generator_kind`Arpad Borsos-11/+11
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-12/+27
Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.
2022-11-13Make rustc build with new chalkMichael Goulet-110/+17
2022-11-10bless a chalk testMichael Goulet-0/+4
2022-11-05Bless chalk testsMichael Goulet-12/+42
2022-11-05Adjust diagnostics, bless testsMichael Goulet-15/+73
2022-08-21Adjust messages, address some nitsMichael Goulet-2/+2
2022-08-21Point at struct field if possibleMichael Goulet-5/+5
2022-08-21Skip mentioning lang itemMichael Goulet-8/+3
2022-08-21Account for relative pathsMichael Goulet-3/+8
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-1/+1
2022-06-29Make RPIT and TAIT work exactly the sameOli Scherer-6/+3
2022-06-26compiletest: add issue number param to `known-bug`David Knaack-1/+1
2022-05-27libcore: Add `iter::from_generator` which is like `iter::from_fn`, but for ↵Vadim Petrochenkov-4/+4
coroutines instead of functions
2022-04-04Dedup logic and improve output for other types that impl traitEsteban Kuber-6/+6
2022-04-04Mention implementers of unsatisfied traitEsteban Kuber-10/+5
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 `?`.
2022-03-30Restore `impl Future<Output = Type>` to async blocksMichael Goulet-1/+1
2022-03-30Auto merge of #94081 - oli-obk:lazy_tait_take_two, r=nikomatsakisbors-3/+6
Lazy type-alias-impl-trait take two ### user visible change 1: RPIT inference from recursive call sites Lazy TAIT has an insta-stable change. The following snippet now compiles, because opaque types can now have their hidden type set from wherever the opaque type is mentioned. ```rust fn bar(b: bool) -> impl std::fmt::Debug { if b { return 42 } let x: u32 = bar(false); // this errors on stable 99 } ``` The return type of `bar` stays opaque, you can't do `bar(false) + 42`, you need to actually mention the hidden type. ### user visible change 2: divergence between RPIT and TAIT in return statements Note that `return` statements and the trailing return expression are special with RPIT (but not TAIT). So ```rust #![feature(type_alias_impl_trait)] type Foo = impl std::fmt::Debug; fn foo(b: bool) -> Foo { if b { return vec![42]; } std::iter::empty().collect() //~ ERROR `Foo` cannot be built from an iterator } fn bar(b: bool) -> impl std::fmt::Debug { if b { return vec![42] } std::iter::empty().collect() // Works, magic (accidentally stabilized, not intended) } ``` But when we are working with the return value of a recursive call, the behavior of RPIT and TAIT is the same: ```rust type Foo = impl std::fmt::Debug; fn foo(b: bool) -> Foo { if b { return vec![]; } let mut x = foo(false); x = std::iter::empty().collect(); //~ ERROR `Foo` cannot be built from an iterator vec![] } fn bar(b: bool) -> impl std::fmt::Debug { if b { return vec![]; } let mut x = bar(false); x = std::iter::empty().collect(); //~ ERROR `impl Debug` cannot be built from an iterator vec![] } ``` ### user visible change 3: TAIT does not merge types across branches In contrast to RPIT, TAIT does not merge types across branches, so the following does not compile. ```rust type Foo = impl std::fmt::Debug; fn foo(b: bool) -> Foo { if b { vec![42_i32] } else { std::iter::empty().collect() //~^ ERROR `Foo` cannot be built from an iterator over elements of type `_` } } ``` It is easy to support, but we should make an explicit decision to include the additional complexity in the implementation (it's not much, see a721052457cf513487fb4266e3ade65c29b272d2 which needs to be reverted to enable this). ### PR formalities previous attempt: #92007 This PR also includes #92306 and #93783, as they were reverted along with #92007 in #93893 fixes #93411 fixes #88236 fixes #89312 fixes #87340 fixes #86800 fixes #86719 fixes #84073 fixes #83919 fixes #82139 fixes #77987 fixes #74282 fixes #67830 fixes #62742 fixes #54895
2022-03-28Suggest function borrow ignoring needs_noteMichael Goulet-0/+4
`needs_note` is false if we've already suggested why the type is Copy... but that has nothing to do with the diagnostic.
2022-03-28rebase falloutOli Scherer-1/+1
2022-03-28Bless ui testsOli Scherer-1/+10
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-7/+1
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-22remove [async output] from impl FutureMichael Goulet-1/+1
2022-02-22chalk: add known-bug test that was previously ICEing.Dario Nieuwenhuis-0/+48
2022-02-14further update `fuzzy_match_tys`lcnr-0/+12
2022-02-14fuzzify `fuzzy_match_tys`lcnr-6/+0
2022-02-12Update chalk testsMatthew Jasper-4/+8
2021-12-11Tweak assoc type obligation spansEsteban Kuber-2/+2
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
2021-11-20Point at source of trait bound obligations in more placesEsteban Kuber-3/+3
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-08impl Copy/Clone for arrays in std, not in compilerbstrie-2/+3
2021-09-16Point at call span that introduced obligation for the argEsteban Kuber-1/+3
2021-08-16Use note to point at bound introducing requirementEsteban Küber-21/+38
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-3/+5
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2020-10-30Fix various Chalk lowering bugsMatthew Jasper-0/+33
- Add more well-known traits - Use the correct binders when lowering trait objects - Use correct substs when lowering trait objects - Use the correct binders for opaque_ty_data - Lower negative impls with the correct polarity - Supply associated type values - Use `predicates_defined_on` for where clauses
2020-10-06Separate bounds and predicates for associated/opaque typesMatthew Jasper-26/+47
2020-09-09Remove def_id field from ParamEnvBram van den Heuvel-2/+2
2020-09-04Bless changed test outputJack Huey-1/+1
2020-09-04Upgrade chalk to 0.21Jack Huey-6/+14
2020-09-02pretty: trim paths of unique symbolsDan Aloni-3/+3
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-14Remove `Sized` `on_unimplemented` noteEsteban Küber-1/+0
2020-06-24Update ChalkJack Huey-38/+85
2020-06-19Nits and change skip_binder to no_bound_vars for fndefJack Huey-0/+15
2020-06-19Test error order is non-deterministicJack Huey-12/+5
2020-06-19Implement fn_def_datumJack Huey-21/+42
2020-05-07Reintegrate chalk using chalk-solveJack Huey-0/+579