]> git.lizzy.rs Git - rust.git/commit
Handle impl Trait more correctly
authorFlorian Diebold <flodiebold@gmail.com>
Sun, 15 Dec 2019 17:56:38 +0000 (18:56 +0100)
committerFlorian Diebold <flodiebold@gmail.com>
Sun, 15 Dec 2019 17:56:38 +0000 (18:56 +0100)
commit6e1c2d0df89a390be33c81b6e03a5ad352763593
treef3ba344e185e17e6e62ce650462fd63af9eddd26
parentac961b261458bfeb23f7d4e896d5f957b0854a3a
Handle impl Trait more correctly

When calling a function, argument-position impl Trait is transparent; same for
return-position impl Trait when inside the function. So in these cases, we need
to represent that type not by `Ty::Opaque`, but by a type variable that can be
unified with whatever flows into there.
crates/ra_hir_ty/src/infer.rs
crates/ra_hir_ty/src/infer/expr.rs
crates/ra_hir_ty/src/tests/traits.rs