Skip to content

Rollup of 7 pull requests #117415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
745c600
Talk about `gen fn` in diagnostics about `gen fn`
oli-obk Oct 30, 2023
bc926f7
Add a custom panic message for resuming `gen` blocks after they panicked
oli-obk Oct 30, 2023
972ee01
Add regression test
oli-obk Oct 30, 2023
8d03e13
Don't treat closures/coroutines as part of the public API
oli-obk Oct 30, 2023
251021c
Merge two equal match arms
oli-obk Oct 30, 2023
43ff2a7
Some manual rustfmt as rustfmt is broken on this file
oli-obk Oct 30, 2023
d5e836c
Correctly handle nested or-patterns in column-wise analyses
Nadrieril Oct 30, 2023
ff3a818
Poison check_well_formed if method receivers are invalid to prevent t…
oli-obk Oct 30, 2023
224ddf8
Only run panic tests on targets that can unwind
oli-obk Oct 30, 2023
162443b
Detect when trait is implemented for type and suggest importing it
estebank Oct 17, 2023
455cf5a
Improve some diagnostics around `?Trait` bounds
oli-obk Oct 30, 2023
c91f60e
Don't super-fold types when we hit the recursion limit
compiler-errors Oct 30, 2023
c299595
Rollup merge of #116862 - estebank:issue-57457, r=oli-obk
matthiaskrgr Oct 30, 2023
86259e7
Rollup merge of #117389 - oli-obk:gen_fn, r=compiler-errors
matthiaskrgr Oct 30, 2023
e648f47
Rollup merge of #117396 - oli-obk:privacy_visitor_types, r=compiler-e…
matthiaskrgr Oct 30, 2023
342483c
Rollup merge of #117398 - Nadrieril:fix-117378, r=compiler-errors
matthiaskrgr Oct 30, 2023
24c6b6c
Rollup merge of #117403 - oli-obk:the_gift_that_keeps_on_giving_11684…
matthiaskrgr Oct 30, 2023
3e95c6a
Rollup merge of #117411 - oli-obk:query_merge_immobile_game, r=compil…
matthiaskrgr Oct 30, 2023
c5aec96
Rollup merge of #117414 - compiler-errors:tait-forevert, r=oli-obk
matthiaskrgr Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add regression test
  • Loading branch information
oli-obk committed Oct 30, 2023
commit 972ee01b69378280b4911caaae0bd95ea8d790c3
37 changes: 37 additions & 0 deletions tests/ui/type-alias-impl-trait/nested_impl_trait_in_assoc_ty.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// edition: 2021

#![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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0792]: non-defining opaque type use in defining scope
--> $DIR/nested_impl_trait_in_assoc_ty.rs:15:9
|
LL | async move { merge_stream(self.mem_table.iter()) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument `'_` is not a generic parameter
|
note: for this opaque type
--> $DIR/nested_impl_trait_in_assoc_ty.rs:35:1
|
LL | pub(crate) async fn merge_stream<'a>(mem_table_iter: impl Iterator<Item = &'a ()>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0792`.