Skip to content

Didyoumean #12979

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
wants to merge 10 commits into from
Closed

Didyoumean #12979

wants to merge 10 commits into from

Conversation

dobkeratops
Copy link

additonal note to error messages when a symbol isn't found - if the symbol exists in other paths, up to 5 suggestions are given, showing their full global path, prioritized by the number of segments matched.

Especially intended to educate&assist newcommers with the module system , which behaves in an unexpected way to users of most other languages.

(added "fn show_suggestions_from_other_scopes(), "find_suggestions_from_other_scopes()" which dont affect the compiler state.)

@alexcrichton
Copy link
Member

A few things which should be addressed before review:

  • Looks like there's some travis failures
  • Could you squash the commits?
  • A glance at the style indicates that it's deviating from the surrounding code. Please take a look at the existing code and follow the same style.
  • This change will need tests.
  • It would be nice to have some examples in the PR description.

@kud1ing
Copy link

kud1ing commented Mar 28, 2014

Usability experts advice to "not blame the user". Do you see a way to formulate the messages without using "you"?

@dobkeratops
Copy link
Author

perhaps..
"Potential definitions:-"
"should this be :-"
"Similar candidates:-"
verbose but literal,
"Other items with the same identifier:-"

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with comments addressed!

@dobkeratops
Copy link
Author

It might be better if i can find a less invasive way of doing this - currently I changed a structure to pass an intermediate, if I can do it without that I can actively maintain this feature and submit it when you're happy with it. i need to find how to get 'the current crate' for the module being resolved.

I did find it useful... and i'm sure all the newcomers bewildered by the module system will benefit... its one of many approaches to help adressing the one thing that''s keeping me in C++, the powerful navigation available in IDEs

flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 9, 2025
Convert the ICE reported in rust-lang#12979 into a false negative.
We prefer a false negative to a ICE (because the ICE could
still affect the user even when not activating the lint).
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 9, 2025
This PR just makes sure that we exit the function before getting an ICE
and adds a regression test. Related to rust-lang#12979. We would need to keep
researching the issue, but as the ICEing code isn't that complicated,
getting a hotfix into nightly is urgent.

changelog:[`borrow_interior_mutable_const`] Fix ICE rust-lang#12979
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

Successfully merging this pull request may close these issues.

3 participants