Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Triage test failures from running rustc test suite with THIR unsafeck #10

Closed
LeSeulArtichaut opened this issue Aug 3, 2021 · 6 comments

Comments

@LeSeulArtichaut
Copy link
Contributor

#87710 yielded a list of 29 failing tests when ran with -Z thir-unsafeck on by default. Some of those will be small differences in the order or the span of errors, some will be genuine bugs (there seems to be a cycle issue in there). We need to triage this list and open issues to track bugs as needed.

@syvb
Copy link

syvb commented Aug 3, 2021

I've looked through this list before, and I think all of them were either known differences between the two or rust-lang/rust#87414 (that's the cycle issue).

@LeSeulArtichaut
Copy link
Contributor Author

Oh, I assumed it was a new cycle issue because I fixed rust-lang/rust#87414, but the fix hasn't landed yet 🤦

@LeSeulArtichaut
Copy link
Contributor Author

rust-lang/rust#87414 didn't involve cycles with is_freeze_raw though... I think this might be a new bug.

error[E0391]: cycle detected when computing type of `main::F::{opaque#0}`
  --> /checkout/src/test/ui/generator/layout-error.rs:24:14
   |
LL |     type F = impl Future;
   |              ^^^^^^^^^^^
   |
note: ...which requires borrow-checking `main`...
  --> /checkout/src/test/ui/generator/layout-error.rs:19:1
   |
LL | fn main() {
   | ^^^^^^^^^
note: ...which requires processing `main`...
  --> /checkout/src/test/ui/generator/layout-error.rs:19:1
   |
LL | fn main() {
   | ^^^^^^^^^
note: ...which requires processing MIR for `main`...
  --> /checkout/src/test/ui/generator/layout-error.rs:19:1
   |
LL | fn main() {
   | ^^^^^^^^^
note: ...which requires building MIR for `main`...
  --> /checkout/src/test/ui/generator/layout-error.rs:19:1
   |
LL | fn main() {
   | ^^^^^^^^^
note: ...which requires unsafety-checking `main`...
  --> /checkout/src/test/ui/generator/layout-error.rs:27:17
   |
LL |     Task::spawn(&POOL, || cb());
   |                 ^^^^^
   = note: ...which requires computing whether `Task<impl std::future::Future>` is freeze...
   = note: ...which requires evaluating trait selection obligation `Task<impl std::future::Future>: std::marker::Freeze`...
   = note: ...which again requires computing type of `main::F::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
  --> /checkout/src/test/ui/generator/layout-error.rs:6:1
   |
LL | / #![feature(type_alias_impl_trait)]
LL | | use std::future::Future;
LL | |
LL | | pub struct Task<F: Future>(F);
...  |
LL | |     Task::spawn(&POOL, || cb());
LL | | }
   | |_^

I need to look at this after a good night of sleep 😅

@syvb
Copy link

syvb commented Aug 3, 2021

Triaged all of them, it seems like the cycle error involving freeze is the only previously unknown issue:

  • [ui] ui/async-await/async-unsafe-fn-call-in-safe.rs#mir
    • thir-unsafeck deduplicates errors once for invoking the same unsafety multiple times
  • [ui] ui/binding/issue-53114-safety-checks.rs
    • errors are ordered differently, different spans, thir-unsafeck has 1 extra error that I think get deduplicated?
  • [ui] ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs#mir
    • thir-unsafeck deduplicates errors once for invoking the same unsafety multiple times
  • [ui] ui/generator/issue-45729-unsafe-in-generator.rs#mir
    • different span
  • [ui] ui/generator/layout-error.rs
    • cycle error involving freeze
  • [ui] ui/impl-trait/auto-trait-leak.rs
    • had query loop before, and has a slightly different query loop after
  • [ui] ui/impl-trait/closure-in-impl-trait-arg.rs
  • [ui] ui/impl-trait/closure-in-impl-trait.rs
  • [ui] ui/impl-trait/recursive-impl-trait-type-indirect.rs
    • cycle error involving freeze
  • [ui] ui/impl-trait/unsafety-checking-cycle.rs
    • cycle error involving freeze
  • [ui] ui/issues/issue-16538.rs#mir
    • reordering
  • [ui] ui/issues/issue-28324.rs#mir
    • different span
  • [ui] ui/pattern/usefulness/issue-57472.rs
  • [ui] ui/safe-extern-statics-mut.rs#mir
    • different spans
  • [ui] ui/safe-extern-statics.rs#mir
    • different spans
  • [ui] ui/span/lint-unused-unsafe.rs#mir
    • better error messages
  • [ui] ui/static/static-mut-foreign-requires-unsafe.rs
    • different spans
  • [ui] ui/static/static-mut-requires-unsafe.rs#mir
    • different spans
  • [ui] ui/thread-local-static.rs
    • reordering errors
  • [ui] ui/traits/safety-fn-body.rs#mir
    • different span
  • [ui] ui/type-alias-impl-traiissue-52843-closure-constrain.rs
    • cycle error involving freeze
  • [ui] ui/union/union-unsafe.rs#mir
  • [ui] ui/unsafe/issue-45087-unreachable-unsafe.rs#mir
    • different spans
  • [ui] ui/unsafe/ranged_ints2_const.rs#mirunsafeck
    • different error ordering
  • [ui] ui/unsafe/ranged_ints3_const.rs#mirunsafeck
    • different error ordering
  • [ui] ui/unsafe/rfc-2585-unsafe_op_in_unsafe_frs#mir
    • different spans
  • [ui] ui/unsafe/union.rs#mir
  • [ui] ui/unsafe/union_destructure.rs#mir
  • [ui] ui/unsafe/unsafe-fn-assign-deref-ptr.rs#mir
    • different spans

@syvb
Copy link

syvb commented Aug 3, 2021

Created an issue for the freezing loop: rust-lang/rust#87713

@LeSeulArtichaut
Copy link
Contributor Author

Thank you very much for the detailed triage @Smittyvb!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants