Next-generation trait solver has different compilation failure error output

Abierto
#165,977 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
compilers

Línea de trabajo

The payload compares two rustc diagnostic outputs for the same Send/Sync failure in tests/compile_fail/diff_send.rs (git2-rs), involving src/diff.rs and src/repo.rs. The compiler code that builds these errors is not named, so the first step is to reproduce the difference by running the same file on stable and with the new solver. Done means the new-solver stderr reports the same notes as stable, which is a compiler-internals change and not a first-timer task.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

A-diagnostics T-compiler T-types WG-trait-system-refactor

when using trybuild to check the stderr output for compilation failures, the new solver seems to report less - https://github.com/rust-lang/git2-rs/actions/runs/43620785786/job/132525764327 / rust-lang/git2-rs#1342

On stable
error[E0277]: `*mut libgit2_sys::git_diff` cannot be sent between threads safely
  --> tests/compile_fail/diff_send.rs:27:17
   |
27 |         s.spawn(move || theirs.stats().unwrap().insertions());
   |           ----- -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |           |     |
   |           |     `*mut libgit2_sys::git_diff` cannot be sent between threads safely
   |           |     within this `{closure@$DIR/tests/compile_fail/diff_send.rs:27:17: 27:24}`
   |           required by a bound introduced by this call
   |
   = help: within `{closure@$DIR/tests/compile_fail/diff_send.rs:27:17: 27:24}`, the trait `Send` is not implemented for `*mut libgit2_sys::git_diff`
note: required because it appears within the type `Diff<'_>`
  --> src/diff.rs
   |
   | pub struct Diff<'repo> {
   |            ^^^^
note: required because `theirs` is used within this closure
  --> tests/compile_fail/diff_send.rs:27:25
   |
27 |         s.spawn(move || theirs.stats().unwrap().insertions());
   |                         ^^^^^^
note: required by a bound in `Scope::<'scope, 'env>::spawn`
  --> $RUST/std/src/thread/scoped.rs

error[E0277]: `*mut libgit2_sys::git_repository` cannot be shared between threads safely
  --> tests/compile_fail/diff_send.rs:27:17
   |
27 |         s.spawn(move || theirs.stats().unwrap().insertions());
   |           ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut libgit2_sys::git_repository` cannot be shared between threads safely
   |           |
   |           required by a bound introduced by this call
   |
   = help: within `git2::Repository`, the trait `Sync` is not implemented for `*mut libgit2_sys::git_repository`
note: required because it appears within the type `git2::Repository`
  --> src/repo.rs
   |
   | pub struct Repository {
   |            ^^^^^^^^^^
   = note: required for `&git2::Repository` to implement `Send`
note: required because it appears within the type `PhantomData<&git2::Repository>`
  --> $RUST/core/src/marker.rs
note: required because it appears within the type `Diff<'_>`
  --> src/diff.rs
   |
   | pub struct Diff<'repo> {
   |            ^^^^
note: required because `theirs` is used within this closure
  --> tests/compile_fail/diff_send.rs:27:25
   |
27 |         s.spawn(move || theirs.stats().unwrap().insertions());
   |                         ^^^^^^
note: required by a bound in `Scope::<'scope, 'env>::spawn`
  --> $RUST/std/src/thread/scoped.rs
On nightly/with new solver
error[E0277]: `*mut libgit2_sys::git_diff` cannot be sent between threads safely
  --> tests/compile_fail/diff_send.rs:27:17
   |
27 |         s.spawn(move || theirs.stats().unwrap().insertions());
   |           ----- -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |           |     |
   |           |     `*mut libgit2_sys::git_diff` cannot be sent between threads safely
   |           |     within this `{closure@$DIR/tests/compile_fail/diff_send.rs:27:17: 27:24}`
   |           required by a bound introduced by this call
   |
   = help: within `{closure@$DIR/tests/compile_fail/diff_send.rs:27:17: 27:24}`, the trait `Send` is not implemented for `*mut libgit2_sys::git_diff`
note: required because it appears within the type `Diff<'_>`
  --> src/diff.rs
   |
   | pub struct Diff<'repo> {
   |            ^^^^
note: required because `theirs` is used within this closure
  --> tests/compile_fail/diff_send.rs:27:25
   |
27 |         s.spawn(move || theirs.stats().unwrap().insertions());
   |                         ^^^^^^
note: required by a bound in `Scope::<'scope, 'env>::spawn`
  --> $RUST/std/src/thread/scoped.rs
Lenguaje dominante
Rust
Estrellas
122k
Forks
16.7k
Merge medio
2 d 16 h
PR fusionados (30 d)
515

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rust-lang/rust

Todos los issues de rust-lang/rust

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.