]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/issue-89275.rs
fn-trait-closure test now pass on new solver
[rust.git] / tests / ui / typeck / issue-89275.rs
1 #![recursion_limit = "5"] // To reduce noise
2
3 //expect mutability error when ambiguous traits are in scope
4 //and not an overflow error on the span in the main function.
5
6 struct Ratio<T>(T);
7
8 pub trait Pow {
9     fn pow(self) -> Self;
10 }
11
12 impl<'a, T> Pow for &'a Ratio<T>
13 where
14     &'a T: Pow,
15 {
16     fn pow(self) -> Self {
17         self
18     }
19 }
20
21 fn downcast<'a, W: ?Sized>() -> &'a W {
22     todo!()
23 }
24
25 struct Other;
26
27 fn main() {
28     let other: &mut Other = downcast();//~ERROR 28:29: 28:39: mismatched types [E0308]
29 }