]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/retslot-cast.rs
Rollup merge of #103645 - weihanglo:update-cargo, r=weihanglo
[rust.git] / src / test / ui / coercion / retslot-cast.rs
1 #![allow(warnings)]
2
3 pub fn fail(x: Option<&(Iterator<Item=()>+Send)>)
4             -> Option<&Iterator<Item=()>> {
5     // This call used to trigger an LLVM assertion because the return
6     // slot had type "Option<&Iterator>"* instead of
7     // "Option<&(Iterator+Send)>"* -- but this now yields a
8     // compilation error and I'm not sure how to create a comparable
9     // test. To ensure that this PARTICULAR failure doesn't occur
10     // again, though, I've left this test here, so if this ever starts
11     // to compile again, we can adjust the test appropriately (clearly
12     // it should never ICE...). -nmatsakis
13     inner(x) //~ ERROR mismatched types
14 }
15
16 pub fn inner(x: Option<&(Iterator<Item=()>+Send)>)
17              -> Option<&(Iterator<Item=()>+Send)> {
18     x
19 }
20
21
22 fn main() {}