-
-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Description
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 .
Metadata
Metadata
Assignees
Labels
No labels