Skip to content

Don't Auto-Import the BorrowMut Trait #13826

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

Closed
joeyame opened this issue Dec 23, 2022 · 1 comment
Closed

Don't Auto-Import the BorrowMut Trait #13826

joeyame opened this issue Dec 23, 2022 · 1 comment

Comments

@joeyame
Copy link

joeyame commented Dec 23, 2022

See rust-lang/rust#39232

This is a huge roadblock to newcomers and intermediate people who end up having to work with Rc. It has wasted countless hours of mine as I research how to access X from Rc<RefCell> and every time I used the .borrow_mut() function, as all the guides said, the returned object was just another Rc<RefCell>.

I can't express how infuriating this has been in my Rust journey.

Today I stumbled across this issue again, and after over an hour of trying to debug I stumbled upon the issue linked at the top of this text. Sure enough, BorrowMut was there. I never added it, and I'm not sure what triggered it. Now that I know about this I'll be more mindful in the future, but it is incredibly difficult for inexperienced people to debug this. What do you search?

I've encountered the same problem on multiple occasions and only now do I know what is causing it.

I think if someone needs the BorrowMut trait, they are experienced enough to write their own import. If someone doesn't need it, they might never notice it pop up, and what a huge turn-off that is for someone trying out a new language.

@flodiebold
Copy link
Member

Duplicate of #13786

@flodiebold flodiebold marked this as a duplicate of #13786 Dec 23, 2022
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

2 participants