Fix error output for module operations on types.#11623
Fix error output for module operations on types.#11623geoffhill-zz wants to merge 1 commit intorust-lang:masterfrom geoffhill-zz:issue10551
Conversation
Replace the error messages (shown when a non-module type is used as a module) with internal debug messages. This is in line with the nearby error behavior.
|
I don't think that this closes #10551. That bug is about the odd error message (T in fact is in scope, it's just a struct) I agree that |
|
Technically we do want to allow this in the future, but resolve currently just doesn't do it. |
|
So this test should actually compile? Or, is the intent to give a better error message with a suggestion? |
|
The intent is to give a better error message, in the test the name |
|
Closing due to inactivity, but feel free to reopen with a rebase! |
|
I ran into this error and was similarly puzzled. I think the best error to report would be "fn whatever" is not part of trait A, but I'm not sure if this would require unreasonably difficult changes to the name resolution? |
Fix ice in `redundant_locals` Fixes rust-lang#11619 Rebinding over macro like the code below, idents will be different (`x#4` and `x#0` in that case). ```rust fn reassign_in_macro() { let x = 10; macro_rules! mac { ($i:ident) => { let mut x = x; } } mac!(y); } ``` It causes unwrapping `None`. https://github.com/rust-lang/rust-clippy/blob/9554e477c29e6ddca9e5cdce71524341ef9d48e8/clippy_lints/src/redundant_locals.rs#L88-L98 changelog: ICE: [`redundant_locals`]: No longer lints rebinding over macro
Replace the error messages (shown when a non-module type is used as a
module) with internal debug messages. This is in line with the nearby
error behavior.
Closes #10551.