]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/two-phase-multiple-activations.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / borrowck / two-phase-multiple-activations.rs
1 // compile-flags: -Z borrowck=mir
2
3 // run-pass
4
5 use std::io::Result;
6
7 struct Foo {}
8
9 pub trait FakeRead {
10     fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>;
11 }
12
13 impl FakeRead for Foo {
14     fn read_to_end(&mut self, _buf: &mut Vec<u8>) -> Result<usize> {
15         Ok(4)
16     }
17 }
18
19 fn main() {
20     let mut a = Foo {};
21     let mut v = Vec::new();
22     a.read_to_end(&mut v).unwrap();
23 }