mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-27 12:48:20 +00:00

Use `splice` to avoid shifting the other items twice. Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
45 lines
778 B
Rust
45 lines
778 B
Rust
//@ pretty-compare-only
|
|
//@ pretty-mode:hir
|
|
//@ pp-exact:pin-ergonomics-hir.pp
|
|
|
|
#![feature(pin_ergonomics)]
|
|
#![allow(dead_code, incomplete_features)]
|
|
#[attr = MacroUse {arguments: UseAll}]
|
|
extern crate std;
|
|
#[prelude_import]
|
|
use ::std::prelude::rust_2015::*;
|
|
|
|
use std::pin::Pin;
|
|
|
|
struct Foo;
|
|
|
|
impl Foo {
|
|
fn baz(&mut self) { }
|
|
|
|
fn baz_const(&self) { }
|
|
|
|
fn baz_lt<'a>(&mut self) { }
|
|
|
|
fn baz_const_lt(&self) { }
|
|
}
|
|
|
|
fn foo(_: Pin<&'_ mut Foo>) { }
|
|
fn foo_lt<'a>(_: Pin<&'a mut Foo>) { }
|
|
|
|
fn foo_const(_: Pin<&'_ Foo>) { }
|
|
fn foo_const_lt(_: Pin<&'_ Foo>) { }
|
|
|
|
fn bar() {
|
|
let mut x: Pin<&mut _> = &pin mut Foo;
|
|
foo(x.as_mut());
|
|
foo(x.as_mut());
|
|
foo_const(x);
|
|
|
|
let x: Pin<&_> = &pin const Foo;
|
|
|
|
foo_const(x);
|
|
foo_const(x);
|
|
}
|
|
|
|
fn main() { }
|