Skip to content

"can't qualify macro invocation with pub" error can fire without any macro invocations #63255

Description

@little-arhat

With #63180 in effect, code using existential type produces confusing error:

error: can't qualify macro invocation with `pub`
 --> src/mixer.rs:6:1
  |
6 | pub existential type T: MotorCtrl;
  | ^^^
  |
  = help: try adjusting the macro to put `pub` inside the invocation

The actual fix is to change

pub existential type T: MotorCtrl; to pub type T = impl MotorCtrl; and to enable type_alias_impl_trait feature, instead of existential_type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions