Statement about impls in non-generic orphan rule diagnostic is incorrect and badly worded
Los mantenedores suelen responder en 1 día
@shamnad-sherief ya está trabajando en esto.
Desde el 2/12/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
Línea de trabajo
Busca en los diagnósticos de rustc la redacción de E0117 que aparece en el issue y lee el código que selecciona el diagnóstico para traits no genéricos. Compara su redacción con el diagnóstico de la regla de orphan genérica y con el ejemplo del issue. Se considera terminado cuando el mensaje para traits no genéricos ya no afirma algo incorrecto, mientras sigue explicando la restricción y remitiendo a las reglas de orphan.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Code
struct Local;
impl Clone for &'static [Local] {
fn clone(&self) -> Self {
todo!()
}
}
Current output
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> src/main.rs:2:1
|
2 | impl Clone for &'static [Local] {
| ^^^^^^^^^^^^^^^----------------
| |
| this is not defined in the current crate because slices are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
(counterexample: impl From<LocalType> for i32 impls a trait defined in core for a type defined in core, but is legal)
Desired output
error[E0117]: non-generic traits defined outside the current crate can only be implemented for local types
--> src/main.rs:2:1
|
2 | impl Clone for &'static [Local] {
| ^^^^^^^^^^^^^^^----------------
| |
| this is not defined in the current crate because slices are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
Rationale and extra context
Note that this message is special for non-generic traits, but makes a general statement that is incorrect for generic traits. See also #166793, which complains about the generic case not having a special message.
Other cases
The "arbitrary types" wording is odd and not used for other types, e.g.
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
--> src/main.rs:1:1
|
1 | impl Copy for std::ops::Range<i32> {}
the other problem of the statement in the error being incorrect applies here as well.
Rust Version
rustc 1.102.0-nightly (c82ce1563 2026-11-27)
binary: rustc
commit-hash: c82ce15637153c025d29abbaff6035a177361788
commit-date: 2026-11-27
host: x86_64-unknown-linux-gnu
release: 1.102.0-nightly
LLVM version: 23.1.6
Anything else?
No response
- Lenguaje dominante
- Rust
- Estrellas
- 123k
- Forks
- 16.6k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 515
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/rust
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Tracking issue for release notes of #161857: emit fake reads for indexing after every bounds-checkAbiertorelnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-lang T-types
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
A-diagnostics A-dyn-trait A-macros A-suggestion-diagnostics D-invalid-suggestion T-compiler
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
rust-lang/rust#166979 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
remote-test-server truncates auxiliary dylib filenamesPosiblemente ocupada @shuvakant6623 la tomó hace 2 días. AbiertoA-cross A-test-infra A-testsuite C-bug T-bootstrap
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
rust-lang/rust#166910 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
O-musl relnotes relnotes-needs-review relnotes-tracking-issue T-compiler
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de rust-lang/rust
Issues similares
-
marketing
Dificultad 1/5 1-3 horas Aptitud para principiantes 95/100
Los mantenedores suelen responder en 1 día
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothAbiertoarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Apich-Organization/rssn#383 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Los mantenedores suelen responder en 1 día
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
nledford/Ladderback#2028 ·
Los mantenedores suelen responder en 1 día