about summary refs log tree commit diff
path: root/src/test/ui/impl-trait/issues
AgeCommit message (Collapse)AuthorLines
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-135/+56
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-11Revert "Auto merge of #92306 - Aaron1011:opaque-type-op, r=oli-obk"Oli Scherer-20/+8
This reverts commit 1f0a96862ac9d4c6ca3e4bb500c8b9eac4d83049, reversing changes made to bf242bb1199e25ca2274df5c4114e0c9436b74e9.
2022-02-11Revert "Fix regression from lazy opaque types"Oli Scherer-17/+2
This reverts commit 239f1e716dcb1e145b5df5f9439524c817d123b2.
2022-02-09Auto merge of #92306 - Aaron1011:opaque-type-op, r=oli-obkbors-8/+20
Improve opaque type higher-ranked region error message under NLL Currently, any higher-ranked region errors involving opaque types fall back to a generic "higher-ranked subtype error" message when run under NLL. This PR adds better error message handling for this case, giving us the same kinds of error messages that we currently get without NLL: ``` error: implementation of `MyTrait` is not general enough --> $DIR/opaque-hrtb.rs:12:13 | LL | fn foo() -> impl for<'a> MyTrait<&'a str> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `MyTrait` is not general enough | = note: `impl MyTrait<&'2 str>` must implement `MyTrait<&'1 str>`, for any lifetime `'1`... = note: ...but it actually implements `MyTrait<&'2 str>`, for some specific lifetime `'2` error: aborting due to previous error ``` To accomplish this, several different refactoring needed to be made: * We now have a dedicated `InstantiateOpaqueType` struct which implements `TypeOp`. This is used to invoke `instantiate_opaque_types` during MIR type checking. * `TypeOp` is refactored to pass around a `MirBorrowckCtxt`, which is needed to report opaque type region errors. * We no longer assume that all `TypeOp`s correspond to canonicalized queries. This allows us to properly handle opaque type instantiation (which does not occur in a query) as a `TypeOp`. A new `ErrorInfo` associated type is used to determine what additional information is used during higher-ranked region error handling. * The body of `try_extract_error_from_fulfill_cx` has been moved out to a new function `try_extract_error_from_region_constraints`. This allows us to re-use the same error reporting code between canonicalized queries (which can extract region constraints directly from a fresh `InferCtxt`) and opaque type handling (which needs to take region constraints from the pre-existing `InferCtxt` that we use throughout MIR borrow checking).
2022-02-08Improve opaque type higher-ranked region error message under NLLAaron Hill-8/+20
Currently, any higher-ranked region errors involving opaque types fall back to a generic "higher-ranked subtype error" message when run under NLL. This PR adds better error message handling for this case, giving us the same kinds of error messages that we currently get without NLL: ``` error: implementation of `MyTrait` is not general enough --> $DIR/opaque-hrtb.rs:12:13 | LL | fn foo() -> impl for<'a> MyTrait<&'a str> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `MyTrait` is not general enough | = note: `impl MyTrait<&'2 str>` must implement `MyTrait<&'1 str>`, for any lifetime `'1`... = note: ...but it actually implements `MyTrait<&'2 str>`, for some specific lifetime `'2` error: aborting due to previous error ``` To accomplish this, several different refactoring needed to be made: * We now have a dedicated `InstantiateOpaqueType` struct which implements `TypeOp`. This is used to invoke `instantiate_opaque_types` during MIR type checking. * `TypeOp` is refactored to pass around a `MirBorrowckCtxt`, which is needed to report opaque type region errors. * We no longer assume that all `TypeOp`s correspond to canonicalized queries. This allows us to properly handle opaque type instantiation (which does not occur in a query) as a `TypeOp`. A new `ErrorInfo` associated type is used to determine what additional information is used during higher-ranked region error handling. * The body of `try_extract_error_from_fulfill_cx` has been moved out to a new function `try_extract_error_from_region_constraints`. This allows us to re-use the same error reporting code between canonicalized queries (which can extract region constraints directly from a fresh `InferCtxt`) and opaque type handling (which needs to take region constraints from the pre-existing `InferCtxt` that we use throughout MIR borrow checking).
2022-02-08Fix regression from lazy opaque typesOli Scherer-2/+17
2022-02-02Prevent two opaque types in their defining scopes from being defined via the ↵Oli Scherer-3/+59
other
2022-02-02Ensure we error in case of non-higher-kinded lifetimesOli Scherer-1/+48
2022-02-02Avoid an ICE in the presence of HKLOli Scherer-0/+15
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-61/+22
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2021-12-15update testslcnr-1/+6
2021-11-26Perform Sync check on static items in wf-check instead of during const checksOli Scherer-2/+2
2021-11-23Fix printing unit return ty, don't elaborate FnOnce unless we see itMichael Goulet-1/+1
2021-11-23Update test outputsMichael Goulet-2/+2
2021-11-18Print output ty for opaque future tyMichael Goulet-2/+2
2021-11-08Add a note about feature(explicit_generic_args_with_impl_trait) to the ↵Jakub Kądziołka-0/+6
relevant error message
2021-08-30Update test output for stable Rust 2021.Mara Bos-1/+1
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-1/+1
2021-07-27Remove min_tait and full_tait stderr dangling filesSantiago Pastorino-76/+0
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-12/+42
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-27/+5
2021-07-22Add regression tests for the impl_trait_in_bindings ICEsAlex Macleod-0/+221
2021-07-19Improve impl trait disallowed context error textSantiago Pastorino-4/+4
2021-07-18Remove impl_trait_in_bindings feature flagSantiago Pastorino-56/+37
2021-07-17Remove OpaqueTyOrigin::BindingSantiago Pastorino-46/+0
2021-06-29Bless UI testsFabian Wolff-0/+2
2021-05-16Add tracking issueJonas Schievink-0/+3
2021-05-16Allow `async {}` expressions in const contextsJonas Schievink-6/+15
2021-04-06forbid `impl Trait` in generic param defaultsSNCPlay42-0/+27
2021-03-16fix expected/found order on impl trait projection mismatchSNCPlay42-8/+8
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-7/+76
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2020-11-16Add two regression testsAlex Macleod-0/+90
For #78721 and #78722
2020-10-18Add test for issue-70877Yuki Okushi-0/+53
2020-10-09Add a regression test for issue-65581Yuki Okushi-0/+33
2020-09-02pretty: trim paths of unique symbolsDan Aloni-4/+4
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-06-15review commentsEsteban Küber-2/+2
2020-06-15Expand "recursive opaque type" diagnosticEsteban Küber-10/+18
Fix #70968, partially address #66523.
2020-02-28keep predicate order and tweak outputEsteban Küber-3/+5
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-2/+3
2020-01-08Unify output of "variant not found" errorsEsteban Küber-2/+2
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-175/+36
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-06nested_impl_trait -> errorMazdak Farrokhzad-175/+36
2019-11-04Use check-pass in ui tests where appropriateTomasz Miąsko-5/+5
2019-10-26Add detailed explaination for E0666Sydney Acksman-0/+1
2019-10-24Changed APIT with explicit generic args span to specific arg spansSydney Acksman-4/+6
2019-10-20Improve error message for APIT with explicit generic parametersvarkor-4/+4
This is disallowed with type or const generics.
2019-09-09Auto merge of #64237 - estebank:tweak-method-not-found, r=Centrilbors-1/+1
Give method not found a primary span label
2019-09-08Give method not found a primary span labelEsteban Küber-1/+1