rust-lang / rust-lang/rust-playground
Automatically adding use imports should always go below inner attributes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 267
- Avg merge
- 3h 2m
- Merged PRs (30d)
- 6
Description
If in the playground you use a type that is not in scope, the compiler helpfully outputs some options to use:

However, if you click on one of those (and you happen to be using some inner attributes such as #[no_std] or a #[feature(...)] then that use statement is still added before that attribute and the compiler complains about it the next time you build/run.
It would be great if the use statement was added after the attribute.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the playground handles compiler suggestions when an out-of-scope type is selected. Reproduce the issue with an inner attribute such as #[no_std] or #[feature(...)], then verify that the generated use statement is placed after the attribute and the playground builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100