]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/coerce-reborrow-imm-ptr-rcvr.rs
Rollup merge of #100112 - RalfJung:assert_send_and_sync, r=m-ou-se
[rust.git] / src / test / ui / coercion / coerce-reborrow-imm-ptr-rcvr.rs
1 // run-pass
2
3 struct SpeechMaker {
4     speeches: usize
5 }
6
7 impl SpeechMaker {
8     pub fn how_many(&self) -> usize { self.speeches }
9 }
10
11 fn foo(speaker: &SpeechMaker) -> usize {
12     speaker.how_many() + 33
13 }
14
15 pub fn main() {
16     let lincoln = SpeechMaker {speeches: 22};
17     assert_eq!(foo(&lincoln), 55);
18 }