Closed paulmure closed 3 weeks ago
Hi, what you say here is that you want the information "what is the trait being used" rather than "what impl block is being used"? That's what I understand from the examples you give.
The scratch::Impl#0
is not a useless marker, it is where the impl is actually defined.
Maybe what we need here is to store both trait and impl info in the AST, wdyt?
Hi, what you say here is that you want the information "what is the trait being used" rather than "what impl block is being used"? That's what I understand from the examples you give.
The
scratch::Impl#0
is not a useless marker, it is where the impl is actually defined.Maybe what we need here is to store both trait and impl info in the AST, wdyt?
I see, my misunderstanding then, thanks for pointing that out. Yes, I think we need both information about what impl
block is used as well as the trait goal
.
I will update the PR then. Since we will preserve both information, I should be able to make the old tests pass.
This may be already fixed. Please check and close, or describe what's not working.
Consider this example:
One of the trait bounds in the call to
call_foo
in the functionuse_bar
is the fact thatBar
implementsFoo
.This information is exported as an
ImplExpr::Concrete
. The exported json looks something like this:The information about what type was used to implement what trait is stored in the
trait
field, whereas theimpl
field stores some useless marker.The importer incorrectly imports the
impl
field as the final trait goal. Resulting in a junkimpl_expr
like this: