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

Macro detailed_trace expects a bevy_utils module in scope when bevy reexport that module as utils #15615

Closed
urben1680 opened this issue Oct 3, 2024 · 0 comments · Fixed by #15912
Assignees
Labels
A-Utils Utility functions and types C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@urben1680
Copy link
Contributor

urben1680 commented Oct 3, 2024

Bevy version

bevy 0.14.2

What you did

use bevy::utils::detailed_trace;
detailed_trace!("foo");

What went wrong

error[E0433]: failed to resolve: use of undeclared crate or module `bevy_utils`
   --> src\lib.rs:124:5
    |
124 |     detailed_trace!("foo");
    |     ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `bevy_utils`
    |
    = note: this error originates in the macro `detailed_trace` (in Nightly builds, run with -Z macro-backtrace for more info)

Additional information

It works if the module is brought into the scope under an alias:

use bevy::utils as bevy_utils;
use bevy_utils::detailed_trace;
detailed_trace!("foo");
@urben1680 urben1680 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Oct 3, 2024
@LiamGallagher737 LiamGallagher737 added A-Utils Utility functions and types and removed S-Needs-Triage This issue needs to be labelled labels Oct 7, 2024
@BenjaminBrienen BenjaminBrienen added S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Oct 13, 2024
@BenjaminBrienen BenjaminBrienen self-assigned this Oct 13, 2024
@BenjaminBrienen BenjaminBrienen added D-Trivial Nice and easy! A great choice to get started with Bevy and removed D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Oct 14, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 15, 2024
# Objective

Fixes #15615

## Solution

`$crate` is a cool keyword metavariable

## Testing

Created a test crate and used the macro

## Showcase

![image](https://github.com/user-attachments/assets/f0567224-126d-44e4-8905-26103da4ba14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Utils Utility functions and types C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants