]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / issue-82126-mismatched-subst-and-hir.rs
1 // Regression test for #82126. Checks that mismatched lifetimes and types are
2 // properly handled.
3
4 // edition:2018
5
6 use std::sync::Mutex;
7
8 struct MarketMultiplier {}
9
10 impl MarketMultiplier {
11     fn buy(&mut self) -> &mut usize {
12         todo!()
13     }
14 }
15
16 async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
17     //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
18     //~^^ ERROR this struct takes 1 generic argument but 0 generic arguments were supplied
19     LockedMarket(generator.lock().unwrap().buy())
20 }
21
22 struct LockedMarket<T>(T);
23
24 fn main() {}