mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
22 lines
377 B
Rust
22 lines
377 B
Rust
//@ known-bug: #150263
|
|
//@ compile-flags: --crate-type lib -C opt-level=3
|
|
|
|
pub trait Scope {
|
|
type Timestamp;
|
|
}
|
|
impl<G> Scope for G {
|
|
type Timestamp = ();
|
|
}
|
|
|
|
pub fn create<G: Scope>() {
|
|
enter::<G>();
|
|
}
|
|
|
|
fn enter<G>() {
|
|
unary::<G>(|_: <G as Scope>::Timestamp| {});
|
|
}
|
|
|
|
fn unary<G: Scope>(constructor: impl FnOnce(G::Timestamp)) {
|
|
constructor(None.unwrap());
|
|
}
|