forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#117396 - oli-obk:privacy_visitor_types, r=c…
…ompiler-errors Don't treat closures/coroutine types as part of the public API Fixes a regression from rust-lang#117076 r? `@compiler-errors`
- Loading branch information
Showing
3 changed files
with
56 additions
and
28 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
44 changes: 44 additions & 0 deletions
44
tests/ui/type-alias-impl-trait/nested_impl_trait_in_assoc_ty.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,44 @@ | ||
//! This test checks that we do not walk types in async blocks for | ||
//! determining the opaque types that appear in a signature. async blocks, | ||
//! all other coroutines and closures are always private and not part of | ||
//! a signature. They become part of a signature via `dyn Trait` or `impl Trait`, | ||
//! which is something that we process abstractly without looking at its hidden | ||
//! types. | ||
// edition: 2021 | ||
// check-pass | ||
|
||
#![feature(impl_trait_in_assoc_type)] | ||
|
||
use std::future::Future; | ||
|
||
pub struct MemtableLocalStateStore { | ||
mem_table: MemTable, | ||
} | ||
|
||
impl LocalStateStore for MemtableLocalStateStore { | ||
type IterStream<'a> = impl Sized + 'a where Self: 'a; | ||
|
||
fn iter(&self) -> impl Future<Output = Self::IterStream<'_>> + '_ { | ||
async move { merge_stream(self.mem_table.iter()) } | ||
} | ||
} | ||
|
||
trait LocalStateStore { | ||
type IterStream<'a> | ||
where | ||
Self: 'a; | ||
|
||
fn iter(&self) -> impl Future<Output = Self::IterStream<'_>> + '_; | ||
} | ||
|
||
struct MemTable; | ||
|
||
impl MemTable { | ||
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a ()> { | ||
std::iter::empty() | ||
} | ||
} | ||
|
||
pub(crate) async fn merge_stream<'a>(mem_table_iter: impl Iterator<Item = &'a ()>) {} | ||
|
||
fn main() {} |