]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/issue-47722.rs
New upstream version 1.29.0+dfsg1
[rustc.git] / src / test / run-pass / issue-47722.rs
CommitLineData
2c00a5a8 1// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
223e47cc
LB
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
2c00a5a8
XL
10//
11// Tests that automatic coercions from &mut T to *mut T
12// allow borrows of T to expire immediately - essentially, that
13// they work identically to 'foo as *mut T'
14#![feature(nll)]
223e47cc 15
2c00a5a8
XL
16struct SelfReference {
17 self_reference: *mut SelfReference,
18}
3157f602 19
2c00a5a8
XL
20impl SelfReference {
21 fn set_self_ref(&mut self) {
22 self.self_reference = self;
3157f602 23 }
a7813a04
XL
24}
25
5bcae85e 26fn main() {}