Rustfmt removes trailing `::self` unconditionally
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #7144 de @tayfuryldz — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
Línea de trabajo
Start by running the supplied Rust example through rustfmt and compare the parsed use tree before and after formatting. Investigate the handling of trailing ::self in imports and add a regression test for this reproduction. Done means formatting preserves the import's behavior and the example still fails to compile as it did before formatting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Related: https://github.com/rust-lang/rustfmt/issues/3568
For the following
mod a {
pub mod b {}
pub fn b() {}
}
fn b() {}
use a::b::self;
which compiles successfully.
Rustfmt will format it into
mod a {
pub mod b {}
pub fn b() {}
}
fn b() {}
use a::b;
which compiles with fail
error[E0255]: the name `b` is defined multiple times
--> src/lib.rs:9:5
|
7 | fn b() {}
| ------ previous definition of the value `b` here
8 |
9 | use a::b;
| ^^^^ `b` reimported here
|
= note: `b` must be defined only once in the value namespace of this module
help: you can use `as` to change the binding name of the import
|
9 | use a::b as other_b;
| ++++++++++
Version: rustfmt 1.10.0-nightly (d453bdd8f0 2026-08-14)
- Lenguaje dominante
- Rust
- Estrellas
- 7.1k
- Forks
- 1.2k
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-lang/rustfmt
-
A-config C-bug SO-print-config
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
A-Unicode C-bug P-low
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rust-lang/rustfmt#7210 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
A-imports C-bug E-hard I-non-idempotency X-impacts-stable-default-format
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rust-lang/rustfmt#7173 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
A-comments C-bug only-with-option UO-indent_style
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Fix `first_line_width` to be tab-awareQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. AbiertoA-tabs A-whitespace C-bug SO-hard_tabs
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de rust-lang/rustfmt
Issues similares
-
Thai project names become 'project', 'project-2'… (slug keeps ASCII only)Posiblemente ocupada @mastel2 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
storytold/craft-anything#2538 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
compiler-explorer/compiler-explorer#9738 ·
Los mantenedores suelen responder en 2 días
-
area: runtime enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
hffgzktbcc-blip/ounce-core#663 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
zellij-org/zellij#6026 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tamatebako/tebako#1155 ·
Los mantenedores suelen responder en 1 día