-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't assert for different instance on impl trait alias
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 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
17 changes: 17 additions & 0 deletions
17
src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.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,17 @@ | ||
// check-pass | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
type T = impl Sized; | ||
// The concrete type referred by impl-trait-type-alias(`T`) is guaranteed | ||
// to be the same as where it occurs, whereas `impl Trait`'s instance is location sensitive; | ||
// so difference assertion should not be declared on impl-trait-type-alias's instances. | ||
// for details, check RFC-2515: | ||
// https://github.com/rust-lang/rfcs/blob/master/text/2515-type_alias_impl_trait.md | ||
|
||
fn take(_: fn() -> T) {} | ||
|
||
fn main() { | ||
take(|| {}); | ||
take(|| {}); | ||
} |