Skip to content
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

program error: use unambigious globs #6590

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

buffalojoec
Copy link
Contributor

Problem

When annotating an error enum with [spl_program_error], the generated
trait implementations are using solana_program directly, which might cause
conflicts with the program_error crate's version of solana_program and
the program's version.

error[E0659]: `solana_program` is ambiguous
 --> /Users/joesol/.cargo/git/checkouts/address-lookup-table-b4ff4f65bda84997/11a0b41/program/src/error.rs:5:1
  |
5 | #[spl_program_error]
  | ^^^^^^^^^^^^^^^^^^^^ ambiguous name
  |
  = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
  = note: `solana_program` could refer to a crate passed with `--extern`
  = help: use `::solana_program` to refer to this crate unambiguously

Summary of Changes

Use unambiguous imports to let the Rust compiler decide which version to use!

@buffalojoec buffalojoec force-pushed the program-error-unambiguous-blob branch from af399f3 to c3eaa18 Compare April 17, 2024 16:14
@buffalojoec buffalojoec marked this pull request as ready for review April 17, 2024 16:29
@buffalojoec buffalojoec requested a review from joncinque April 17, 2024 16:29
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.

2 participants