Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 2.4.1.J Deref and DerefMut not working as said #126

Open
fubupc opened this issue Jul 23, 2024 · 0 comments
Open

Exercise 2.4.1.J Deref and DerefMut not working as said #126

fubupc opened this issue Jul 23, 2024 · 0 comments

Comments

@fubupc
Copy link

fubupc commented Jul 23, 2024

The question states:

Replacing the implementation of deref with self.as_ref() results in a stack overflow when running an unoptimized version. Why? (Hint: deref coercion)

But actually self.as_ref() does not cause stack overflow: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9ce74e7edda0542dbf20c04f521b2879.

Not sure if I misunderstand something here.

PS: I cannot give a link to above quote directly because the book's website is broken: https://teach-rs.trifectatech.org/full .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant