-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"can't qualify macro invocation with pub
" error can fire without any macro invocations
#63255
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
Comments
pub
" when existential type is used
I don't think it is worth having special cased diagnostics for |
@Centril true, it wasn't stabilized anyway. But I think it's good to have this issue here to help people googling an error. |
The same issue occurs when using pub auto unsafe trait SingleCoreSend {}
Note that this happens even when the feature is turned off. |
Also seen with functions and a simple typo:
Error:
I'm not sure how the parser gets the idea that a macro was coming there... |
pub
" when existential type is usedpub
" error can fire without any macro invocations
Just as another practical example, I wrote (having a C++ brain hiccup) |
But the error goes well beyond A missing pub mod DEFAULT_BBOX {
pub mod _northEast {
pub lat: f64 = 48.82099347817258;
pub lng: f64 = 9.299583435058596;
} error: can't qualify macro invocation with `pub`
--> src/constants/Map.rs:11:5
|
11 | pub lat: f64 = 48.82099347817258;
| ^^^
|
= help: try adjusting the macro to put `pub` inside the invocation The problem of course, is that the correct code is: pub const lat: f64 = ... $ rustc -V macOS 10.14.6 |
Today you get: error: visibility `pub` is not followed by an item
--> src/lib.rs:1:1
|
1 | pub existential type T: MotorCtrl;
| ^^^ the visibility
|
= help: you likely meant to define an item, e.g., `pub fn foo() {}`
error: expected item, found `existential`
--> src/lib.rs:1:5
|
1 | pub existential type T: MotorCtrl;
| ^^^^^^^^^^^ expected item ...which seems good enough. |
With #63180 in effect, code using
existential type
produces confusing error:The actual fix is to change
pub existential type T: MotorCtrl;
topub type T = impl MotorCtrl;
and to enabletype_alias_impl_trait
feature, instead ofexistential_type
.The text was updated successfully, but these errors were encountered: