-
Notifications
You must be signed in to change notification settings - Fork 41
Conversation
009aa8b
to
c50f38d
Compare
Somehow could we have a regression test? |
hm, which direction of regression? i looked into adding an example testcase using in the other direction i'm not so sure, i.e. how would we test that we're not creating regressions with this for other code, without knowing properly what the other code now regressing looks like; we don't know what we haven't thought of, i guess. |
ah, and also we'd need the async-trait crate when building |
So, you expect this PR to fix #271, right? |
this should work after #291 is merged. |
The `#[async_trait]` attribute/crate does a transformation to all async methods, which as far as i can tell removes the `&self` lifetime, so our logic to offset by 1 if `has_self == true` for both compared types has an off-by-one-error here. This didn't error out earlier, since `get_region_from_params` uses `Vec::get`, so "this index is out of bounds" is just as `None` as "this generic param is not of kind lifetime". Also this is more a workaround than a fix. I'm not sure if we can do something cleverer than "check if the last lifetim's name is `'async_trait`".
update: i keep getting different results for |
alright, found one that (at least locally) doesn't show the nondeterministic behavior. |
This uses `#[async_trait]`, so this test failing might indicate something in that direction being wrong. Of course since it's a full package being tested, it's not really accurate to just this issue, but it's something.
Thanks! @bors r+ |
📌 Commit 75875d4 has been approved by |
☀️ Test successful - checks-actions |
The
#[async_trait]
attribute/crate does a transformation to all asyncmethods, which as far as i can tell removes the
&self
lifetime, so ourlogic to offset by 1 if
has_self == true
for both compared types hasan off-by-one-error here. This didn't error out earlier, since
get_region_from_params
usesVec::get
, so "this index is out ofbounds" is just as
None
as "this generic param is not of kindlifetime".
Also this is more a workaround than a fix. I'm not sure if we can do
something cleverer than "check if the last lifetim's name is
'async_trait
".