You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
impl i for int {
fn val() -> str { "wut" }
}
fn main() {
let j = @{
val: 10
};
// This autoderefs
assert j.val == 10;
let i = @10;
// This does not
assert i.val() == "wut";
}
../src/test/run-pass/method-autoderef.rs:12:11: 12:16 error: attempted access of field val on type @int, but no public field or method with that name was found
../src/test/run-pass/method-autoderef.rs:12 assert i.val() == "wut";
The text was updated successfully, but these errors were encountered:
I've been thinking about this for a while, actually. The reason is clear: it's nice to make impls over types like @T, and if we always auto-deref'd prior to scanning for impl matches, that wouldn't work. I don't know if the right behavior is to scan for matches with the original type, then auto-deref, then scan again, or what. It's an annoying problem.
I don't think we should discourage people from looking into Kani so I'm changing the words here. I also changed the reference to point to bolero instead of proptest.
Kobzol
pushed a commit
to Kobzol/rust
that referenced
this issue
Jan 21, 2025
Field access does.
The text was updated successfully, but these errors were encountered: