forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit a1e274f)
- Loading branch information
Showing
11 changed files
with
128 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
tests/ui/impl-trait/equality-in-canonical-query.clone.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error: internal compiler error: no errors encountered even though `delay_span_bug` issued | ||
|
||
error: internal compiler error: {OpaqueTypeKey { def_id: DefId(rpit::{opaque#0}), args: [] }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: no-location (#0), ty: Alias(Opaque, AliasTy { args: [], def_id: DefId(foo::{opaque#0}) }) } }} | ||
| | ||
= | ||
|
||
|
||
error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ProvePredicate { predicate: Binder { value: ProjectionPredicate(AliasTy { args: [FnDef(DefId(rpit), []), ()], def_id: DefId(ops::function::FnOnce::Output) }, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(foo::{opaque#0}) }))), bound_vars: [] } } } | ||
--> $DIR/equality-in-canonical-query.rs:19:5 | ||
| | ||
LL | same_output(foo, rpit); | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
--> $DIR/equality-in-canonical-query.rs:19:5 | ||
| | ||
LL | same_output(foo, rpit); | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
query stack during panic: | ||
end of query stack | ||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// issue: #116877 | ||
// revisions: sized clone | ||
//[sized] check-pass | ||
|
||
//[clone] known-bug: #108498 | ||
//[clone] failure-status: 101 | ||
//[clone] normalize-stderr-test: "DefId\(.*?\]::" -> "DefId(" | ||
//[clone] normalize-stderr-test: "(?m)note: .*$" -> "" | ||
//[clone] normalize-stderr-test: "(?m)^ *\d+: .*\n" -> "" | ||
//[clone] normalize-stderr-test: "(?m)^ *at .*\n" -> "" | ||
|
||
#[cfg(sized)] fn rpit() -> impl Sized {} | ||
#[cfg(clone)] fn rpit() -> impl Clone {} | ||
|
||
fn same_output<Out>(_: impl Fn() -> Out, _: impl Fn() -> Out) {} | ||
|
||
pub fn foo() -> impl Sized { | ||
same_output(rpit, foo); | ||
same_output(foo, rpit); | ||
rpit() | ||
} | ||
|
||
fn main () {} |
29 changes: 29 additions & 0 deletions
29
tests/ui/type-alias-impl-trait/rpit_tait_equality_in_canonical_query.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error: internal compiler error: no errors encountered even though `delay_span_bug` issued | ||
|
||
error: internal compiler error: {OpaqueTypeKey { def_id: DefId(get_rpit::{opaque#0}), args: [] }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: no-location (#0), ty: Alias(Opaque, AliasTy { args: [], def_id: DefId(Opaque::{opaque#0}) }) } }} | ||
| | ||
= | ||
|
||
|
||
error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ProvePredicate { predicate: Binder { value: ProjectionPredicate(AliasTy { args: [FnDef(DefId(get_rpit), []), ()], def_id: DefId(ops::function::FnOnce::Output) }, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(Opaque::{opaque#0}) }))), bound_vars: [] } } } | ||
--> $DIR/rpit_tait_equality_in_canonical_query.rs:28:5 | ||
| | ||
LL | query(get_rpit); | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
|
||
--> $DIR/rpit_tait_equality_in_canonical_query.rs:28:5 | ||
| | ||
LL | query(get_rpit); | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
query stack during panic: | ||
end of query stack | ||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/ui/type-alias-impl-trait/rpit_tait_equality_in_canonical_query_2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// The canonical query `Projection(<get_rpit as FnOnce>::Output = Opaque)` | ||
// is the *only* site that defines `Opaque` in MIR typeck. | ||
// | ||
// check-pass | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
type Opaque = impl Sized; | ||
|
||
fn get_rpit() -> impl Sized {} | ||
|
||
fn query(_: impl FnOnce() -> Opaque) {} | ||
|
||
fn test(_: Opaque) { | ||
query(get_rpit); | ||
} | ||
|
||
fn main() {} |