Engine: name clash for items within trait methods
In the folllwing snippet, the items A_STRUCT and a_fn yields name clashes.
struct A;
struct B;
impl Clone for A {
fn clone(&self) -> Self {
struct A_STRUCT;
fn a_fn(){};
A
}
}
impl Clone for B {
fn clone(&self) -> Self {
struct A_STRUCT;
fn a_fn(){};
B
}
}
This was not fixed by #1199
@W95Psp you marked this as high. Is it something you intend to work on this week?
@W95Psp please update
Found this in tls_codec
This issue doesn't reproduce on main.
The original example hits another unrelated problem though: the fact one cannot impl Clone manually.
The original example is as follows:
struct A;
struct B;
trait Foo {
fn foo(self) -> Self;
}
impl Foo for A {
fn foo(self) -> Self {
struct A_STRUCT;
fn a_fn(){};
A
}
}
impl Foo for B {
fn foo(self) -> Self {
struct A_STRUCT;
fn a_fn(){};
B
}
}
Open this code snippet in the playground
This produces no ambiguous name.
However @maximebuyse you say you found something similar in tls_codec?
It's likely not exactly the same thing, can you open an issue with a reproducer and close this one when done?
However @maximebuyse you say you found something similar in
tls_codec? It's likely not exactly the same thing, can you open an issue with a reproducer and close this one when done?
I need to work on tls_codec again to see if this is still an issue (it's not easy to quickly look for just this issue), so I think we can close, and we'll open a new issue if we have the problem again.
Sounds good, let's close then!