-
Here's some code with generic associated types and `impl Trait`:
```rust
#![feature(generic_associated_types)]
use std::future::{Future, ready, Ready};
pub trait Example {
type Value wh…
-
[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d5065282aa7936f6a91feb87c5b67f28)
```rust
trait WithAssoc {
type Assoc;
}
struct ImplsAssoc,
}
imp…
-
Playing around with generic associated types, I encountered what looks like a compiler bug:
```rust
trait Monad {
type M;
fn bind Self::M>(m: Self::M, f: F) -> Self::M;
fn unit(x:…
-
A bit of context before you read this: oxc-project/oxc#4112
I'm working on the AST template macro, My current approach is something like this:
a. use `oxc_ast_codegen` to generate a visitor with…
rzvxa updated
2 months ago
-
I tried this code:
```rust
#![feature(generic_associated_types)]
trait StreamingIterator {
type Item (usize, Option);
// Uncommenting makes `StreamingIterator` not object safe
// …
-
I tried this code:
```rust
pub trait Foo {
type Assoc;
}
pub trait Bar {
}
pub struct FooBar {}
impl Bar for FooBar
{
}
pub struct Baz {}
```
I expected to see thi…
-
The `generic_associated_types` is not only no longer marked *incomplete* but has in fact been stabilized and is no longer necessary to specify.
Please also consider updating the README accordingly.
…
-
* **Request Type**: Feature Request
* **Mock-up repro** ([more detailed mock-up here](https://pastebin.com/ErSCLTF4)):
```py
import abc
import typing
# Define two base types `ABase…
-
```rust
trait Trait {
fn fun();
}
fn takes_static_fn(_: impl Fn() + 'static) {}
fn test() {
// these work
takes_static_fn(|| T::fun());
takes_static_fn(T::fun as fn());
…
-
https://rust-lang.github.io/rfcs/1598-generic_associated_types.html