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