rust icon indicating copy to clipboard operation
rust copied to clipboard

stabilize `-Znext-solver=coherence`

Open lcnr opened this issue 1 year ago • 118 comments
trafficstars

r? @compiler-errors


This PR stabilizes the use of the next generation trait solver in coherence checking by enabling -Znext-solver=coherence by default. More specifically its use in the implicit negative overlap check. The tracking issue for this is https://github.com/rust-lang/rust/issues/114862.

Background

The next generation trait solver

The new solver lives in rustc_trait_selection::solve and is intended to replace the existing evaluate, fulfill, and project implementation. It also has a wider impact on the rest of the type system, for example by changing our approach to handling associated types.

For a more detailed explanation of the new trait solver, see the rustc-dev-guide. This does not stabilize the current behavior of the new trait solver, only the behavior impacting the implicit negative overlap check. There are many areas in the new solver which are not yet finalized. We are confident that their final design will not conflict with the user-facing behavior observable via coherence. More on that further down.

Please check out the chapter summarizing the most significant changes between the existing and new implementations.

Coherence and the implicit negative overlap check

Coherence checking detects any overlapping impls. Overlapping trait impls always error while overlapping inherent impls result in an error if they have methods with the same name. Coherence also results in an error if any other impls could exist, even if they are currently unknown. This affects impls which may get added to upstream crates in a backwards compatible way and impls from downstream crates.

Coherence failing to detect overlap is generally considered to be unsound, even if it is difficult to actually get runtime UB this way. It is quite easy to get ICEs due to bugs in coherence.

It currently consists of two checks:

The orphan check validates that impls do not overlap with other impls we do not know about: either because they may be defined in a sibling crate, or because an upstream crate is allowed to add it without being considered a breaking change.

The overlap check validates that impls do not overlap with other impls we know about. This is done as follows:

  • Instantiate the generic parameters of both impls with inference variables
  • Equate the TraitRefs of both impls. If it fails there is no overlap.
  • implicit negative: Check whether any of the instantiated where-bounds of one of the impls definitely do not hold when using the constraints from the previous step. If a where-bound does not hold, there is no overlap.
  • explicit negative (still unstable, ignored going forward): Check whether the any negated where-bounds can be proven, e.g. a &mut u32: Clone bound definitely does not hold as an explicit impl<T> !Clone for &mut T exists.

The overlap check has to prove that unifying the impls does not succeed. This means that incorrectly getting a type error during coherence is unsound as it would allow impls to overlap: coherence has to be complete.

Completeness means that we never incorrectly error. This means that during coherence we must only add inference constraints if they are definitely necessary. During ordinary type checking this does not hold, so the trait solver has to behave differently, depending on whether we're in coherence or not.

The implicit negative check only considers goals to "definitely not hold" if they could not be implemented downstream, by a sibling, or upstream in a backwards compatible way. If the goal is is "unknowable" as it may get added in another crate, we add an ambiguous candidate: source.

Motivation

Replacing the existing solver in coherence fixes soundness bugs by removing sources of incompleteness in the type system. The new solver separately strengthens coherence, resulting in more impls being disjoint and passing the coherence check. The concrete changes will be elaborated further down. We believe the stabilization to reduce the likelihood of future bugs in coherence as the new implementation is easier to understand and reason about.

It allows us to remove the support for coherence and implicit-negative reasoning in the old solver, allowing us to remove some code and simplifying the old trait solver. We will only remove the old solver support once this stabilization has reached stable to make sure we're able to quickly revert in case any unexpected issues are detected before then.

Stabilizing the use of the next-generation trait solver expresses our confidence that its current behavior is intended and our work towards enabling its use everywhere will not require any breaking changes to the areas used by coherence checking. We are also confident that we will be able to replace the existing solver everywhere, as maintaining two separate systems adds a significant maintainance burden.

User-facing impact and reasoning

Breakage due to improved handling of associated types

The new solver fixes multiple issues related to associated types. As these issues caused coherence to consider more types distinct, fixing them results in more overlap errors. This is therefore a breaking change.

Structurally relating aliases containing bound vars

Fixes https://github.com/rust-lang/rust/issues/102048. In the existing solver relating ambiguous projections containing bound variables is structural. This is incomplete and allows overlapping impls. These was mostly not exploitable as the same issue also caused impls to not apply when trying to use them. The new solver defers alias-relating to a nested goal, fixing this issue:

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
trait Trait {}

trait Project {
    type Assoc<'a>;
}

impl Project for u32 {
    type Assoc<'a> = &'a u32;
}

// Eagerly normalizing `<?infer as Project>::Assoc<'a>` is ambiguous,
// so the old solver ended up structurally relating
//
//     (?infer, for<'a> fn(<?infer as Project>::Assoc<'a>))
//
// with 
//
//     ((u32, fn(&'a u32)))
//
// Equating `&'a u32` with `<u32 as Project>::Assoc<'a>` failed, even
// though these types are equal modulo normalization.
impl<T: Project> Trait for (T, for<'a> fn(<T as Project>::Assoc<'a>)) {}

impl<'a> Trait for (u32, fn(&'a u32)) {}
//[next]~^ ERROR conflicting implementations of trait `Trait` for type `(u32, for<'a> fn(&'a u32))`

A crater run did not discover any breakage due to this change.

Unknowable candidates for higher ranked trait goals

This avoids an unsoundness by attempting to normalize in trait_ref_is_knowable, fixing https://github.com/rust-lang/rust/issues/114061. This is a side-effect of supporting lazy normalization, as that forces us to attempt to normalize when checking whether a TraitRef is knowable: source.

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
trait IsUnit {}
impl IsUnit for () {}


pub trait WithAssoc<'a> {
    type Assoc;
}

// We considered `for<'a> <T as WithAssoc<'a>>::Assoc: IsUnit`
// to be knowable, even though the projection is ambiguous.
pub trait Trait {}
impl<T> Trait for T
where
    T: 'static,
    for<'a> T: WithAssoc<'a>,
    for<'a> <T as WithAssoc<'a>>::Assoc: IsUnit,
{
}
impl<T> Trait for Box<T> {}
//[next]~^ ERROR conflicting implementations of trait `Trait`

The two impls of Trait overlap given the following downstream crate:

use dep::*;
struct Local;
impl WithAssoc<'_> for Box<Local> {
    type Assoc = ();
}

There a similar coherence unsoundness caused by our handling of aliases which is fixed separately in https://github.com/rust-lang/rust/pull/117164.

This change breaks the derive-visitor crate. I have opened an issue in that repo: nikis05/derive-visitor#16.

Evaluating goals to a fixpoint and applying inference constraints

In the old implementation of the implicit-negative check, each obligation is checked separately without applying its inference constraints. The new solver instead uses a FulfillmentCtxt for this, which evaluates all obligations in a loop until there's no further inference progress.

This is necessary for backwards compatibility as we do not eagerly normalize with the new solver, resulting in constraints from normalization to only get applied by evaluating a separate obligation. This also allows more code to compile:

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
trait Mirror {
    type Assoc;
}
impl<T> Mirror for T {
    type Assoc = T;
}

trait Foo {}
trait Bar {}

// The self type starts out as `?0` but is constrained to `()`
// due to the where-clause below. Because `(): Bar` is known to
// not hold, we can prove the impls disjoint.
impl<T> Foo for T where (): Mirror<Assoc = T> {}
//[current]~^ ERROR conflicting implementations of trait `Foo` for type `()`
impl<T> Foo for T where T: Bar {}

fn main() {}

The old solver does not run nested goals to a fixpoint in evaluation. The new solver does do so, strengthening inference and improving the overlap check:

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
trait Foo {}
impl<T> Foo for (u8, T, T) {}
trait NotU8 {}
trait Bar {}
impl<T, U: NotU8> Bar for (T, T, U) {}

trait NeedsFixpoint {}
impl<T: Foo + Bar> NeedsFixpoint for T {}
impl NeedsFixpoint for (u8, u8, u8) {}

trait Overlap {}
impl<T: NeedsFixpoint> Overlap for T {}
impl<T, U: NotU8, V> Overlap for (T, U, V) {}
//[current]~^ ERROR conflicting implementations of trait `Foo`

Breakage due to removal of incomplete candidate preference

Fixes #107887. In the old solver we incompletely prefer the builtin trait object impl over user defined impls. This can break inference guidance, inferring ?x in dyn Trait<u32>: Trait<?x> to u32, even if an explicit impl of Trait<u64> also exists.

This caused coherence to incorrectly allow overlapping impls, resulting in ICEs and a theoretical unsoundness. See https://github.com/rust-lang/rust/issues/107887#issuecomment-1997261676. This compiles on stable but results in an overlap error with -Znext-solver=coherence:

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
struct W<T: ?Sized>(*const T);

trait Trait<T: ?Sized> {
    type Assoc;
}

// This would trigger the check for overlap between automatic and custom impl.
// They actually don't overlap so an impl like this should remain possible
// forever.
//
// impl Trait<u64> for dyn Trait<u32> {}
trait Indirect {}
impl Indirect for dyn Trait<u32, Assoc = ()> {}
impl<T: Indirect + ?Sized> Trait<u64> for T {
    type Assoc = ();
}

// Incomplete impl where `dyn Trait<u32>: Trait<_>` does not hold, but
// `dyn Trait<u32>: Trait<u64>` does.
trait EvaluateHack<U: ?Sized> {}
impl<T: ?Sized, U: ?Sized> EvaluateHack<W<U>> for T
where
    T: Trait<U, Assoc = ()>, // incompletely constrains `_` to `u32`
    U: IsU64,
    T: Trait<U, Assoc = ()>, // incompletely constrains `_` to `u32`
{
}

trait IsU64 {}
impl IsU64 for u64 {}

trait Overlap<U: ?Sized> {
    type Assoc: Default;
}
impl<T: ?Sized + EvaluateHack<W<U>>, U: ?Sized> Overlap<U> for T {
    type Assoc = Box<u32>;
}
impl<U: ?Sized> Overlap<U> for dyn Trait<u32, Assoc = ()> {
//[next]~^ ERROR conflicting implementations of trait `Overlap<_>`
    type Assoc = usize;
}

Considering region outlives bounds in the leak_check

For details on the leak_check, see the FCP proposal in #119820.[^leak_check]

[^leak_check]: which should get moved to the dev-guide once that PR lands :3

In both coherence and during candidate selection, the leak_check relies on the region constraints added in evaluate. It therefore currently does not register outlives obligations: source. This was likely done as a performance optimization without considering its impact on the leak_check. This is the case as in the old solver, evaluatation and fulfillment are split, with evaluation being responsible for candidate selection and fulfillment actually registering all the constraints.

This split does not exist with the new solver. The leak_check can therefore eagerly detect errors caused by region outlives obligations. This improves both coherence itself and candidate selection:

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
trait LeakErr<'a, 'b> {}
// Using this impl adds an `'b: 'a` bound which results
// in a higher-ranked region error. This bound has been
// previously ignored but is now considered.
impl<'a, 'b: 'a> LeakErr<'a, 'b> for () {}

trait NoOverlapDir<'a> {}
impl<'a, T: for<'b> LeakErr<'a, 'b>> NoOverlapDir<'a> for T {}
impl<'a> NoOverlapDir<'a> for () {}
//[current]~^ ERROR conflicting implementations of trait `NoOverlapDir<'_>`

// --------------------------------------

// necessary to avoid coherence unknowable candidates
struct W<T>(T); 

trait GuidesSelection<'a, U> {}
impl<'a, T: for<'b> LeakErr<'a, 'b>> GuidesSelection<'a, W<u32>> for T {}
impl<'a, T> GuidesSelection<'a, W<u8>> for T {}

trait NotImplementedByU8 {}
trait NoOverlapInd<'a, U> {}
impl<'a, T: GuidesSelection<'a, W<U>>, U> NoOverlapInd<'a, U> for T {}
impl<'a, U: NotImplementedByU8> NoOverlapInd<'a, U> for () {}
//[current]~^ conflicting implementations of trait `NoOverlapInd<'_, _>`

Removal of fn match_fresh_trait_refs

The old solver tries to eagerly detect unbounded recursion, forcing the affected goals to be ambiguous. This check is only an approximation and has not been added to the new solver.

The check is not necessary in the new solver and it would be problematic for caching. As it depends on all goals currently on the stack, using a global cache entry would have to always make sure that doing so does not circumvent this check.

This changes some goals to error - or succeed - instead of failing with ambiguity. This allows more code to compile:

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence

// Need to use this local wrapper for the impls to be fully
// knowable as unknowable candidate result in ambiguity.
struct Local<T>(T);

trait Trait<U> {}
// This impl does not hold, but is ambiguous in the old
// solver due to its overflow approximation.
impl<U> Trait<U> for Local<u32> where Local<u16>: Trait<U> {}
// This impl holds.
impl Trait<Local<()>> for Local<u8> {}

// In the old solver, `Local<?t>: Trait<Local<?u>>` is ambiguous,
// resulting in `Local<?u>: NoImpl`, also being ambiguous.
//
// In the new solver the first impl does not apply, constraining
// `?u` to `Local<()>`, causing `Local<()>: NoImpl` to error.
trait Indirect<T> {}
impl<T, U> Indirect<U> for T
where
    T: Trait<U>,
    U: NoImpl
{}

// Not implemented for `Local<()>`
trait NoImpl {}
impl NoImpl for Local<u8> {}
impl NoImpl for Local<u16> {}

// `Local<?t>: Indirect<Local<?u>>` cannot hold, so
// these impls do not overlap.
trait NoOverlap<U> {}
impl<T: Indirect<U>, U> NoOverlap<U> for T {}
impl<T, U> NoOverlap<Local<U>> for Local<T> {}
//~^ ERROR conflicting implementations of trait `NoOverlap<Local<_>>`

Non-fatal overflow

The old solver immediately emits a fatal error when hitting the recursion limit. The new solver instead returns overflow. This both allows more code to compile and is results in performance and potential future compatability issues.

Non-fatal overflow is generally desirable. With fatal overflow, changing the order in which we evaluate nested goals easily causes breakage if we have goal which errors and one which overflows. It is also required to prevent breakage due to the removal of fn match_fresh_trait_refs, e.g. in typenum.

Enabling more code to compile

In the below example, the old solver first tried to prove an overflowing goal, resulting in a fatal error. The new solver instead returns ambiguity due to overflow for that goal, causing the implicit negative overlap check to succeed as Box<u32>: NotImplemented does not hold.

// revisions: current next
//[next] compile-flags: -Znext-solver=coherence
//[current] ERROR overflow evaluating the requirement

trait Indirect<T> {}
impl<T: Overflow<()>> Indirect<T> for () {}

trait Overflow<U> {}
impl<T, U> Overflow<U> for Box<T>
where
    U: Indirect<Box<Box<T>>>,
{}

trait NotImplemented {}

trait Trait<U> {}
impl<T, U> Trait<U> for T
where
    // T: NotImplemented, // causes old solver to succeed
    U: Indirect<T>,
    T: NotImplemented,
{}

impl Trait<()> for Box<u32> {}

Avoiding hangs with non-fatal overflow

Simply returning ambiguity when reaching the recursion limit can very easily result in hangs, e.g.

trait Recur {}
impl<T, U> Recur for ((T, U), (U, T))
where
    (T, U): Recur,
    (U, T): Recur,
{}

trait NotImplemented {}
impl<T: NotImplemented> Recur for T {}

This can happen quite frequently as it's easy to have exponential blowup due to multiple nested goals at each step. As the trait solver is depth-first, this immediately caused a fatal overflow error in the old solver. In the new solver we have to handle the whole proof tree instead, which can very easily hang.

To avoid this we restrict the recursion depth after hitting the recursion limit for the first time. We also ignore all inference constraints from goals resulting in overflow. This is mostly backwards compatible as any overflow in the old solver resulted in a fatal error.

sidenote about normalization

We return ambiguous nested goals of NormalizesTo goals to the caller and ignore their impact when computing the Certainty of the current goal. See the normalization chapter for more details.This means we apply constraints resulting from other nested goals and from equating the impl header when normalizing, even if a nested goal results in overflow. This is necessary to avoid breaking the following example:

trait Trait {
    type Assoc;
}

struct W<T: ?Sized>(*mut T);
impl<T: ?Sized> Trait for W<W<T>>
where
    W<T>: Trait,
{
    type Assoc = ();
}

// `W<?t>: Trait<Assoc = u32>` does not hold as
// `Assoc` gets normalized to `()`. However, proving
// the where-bounds of the impl results in overflow.
//
// For this to continue to compile we must not discard
// constraints from normalizing associated types.
trait NoOverlap {}
impl<T: Trait<Assoc = u32>> NoOverlap for T {}
impl<T: ?Sized> NoOverlap for W<T> {}

Future compatability concerns

Non-fatal overflow results in some unfortunate future compatability concerns. Changing the approach to avoid more hangs by more strongly penalizing overflow can cause breakage as we either drop constraints or ignore candidates necessary to successfully compile. Weakening the overflow penalities instead allows more code to compile and strengthens inference while potentially causing more code to hang.

While the current approach is not perfect, we believe it to be good enough. We believe it to apply the necessary inference constraints to avoid breakage and expect there to not be any desirable patterns broken by our current penalities. Similarly we believe the current constraints to avoid most accidental hangs. Ignoring constraints of overflowing goals is especially useful, as it may allow major future optimizations to our overflow handling. See this summary and the linked documents in case you want to know more.

changes to performance

In general, trait solving during coherence checking is not significant for performance. Enabling the next-generation trait solver in coherence does not impact our compile time benchmarks. We are still unable to compile the benchmark suite when fully enabling the new trait solver.

There are rare cases where the new solver has significantly worse performance due to non-fatal overflow, its reliance on fixpoint algorithms and the removal of the fn match_fresh_trait_refs approximation. We encountered such issues in typenum and believe it should be pretty much as bad as it can get.

Due to an improved structure and far better caching, we believe that there is a lot of room for improvement and that the new solver will outperform the existing implementation in nearly all cases, sometimes significantly. We have not yet spent any time micro-optimizing the implementation and have many unimplemented major improvements, such as fast-paths for trivial goals.

TODO: get some rough results here and put them in a table

Unstable features

Unsupported unstable features

The new solver currently does not support all unstable features, most notably #![feature(generic_const_exprs)], #![feature(associated_const_equality)] and #![feature(adt_const_params)] are not yet fully supported in the new solver. We are confident that supporting them is possible, but did not consider this to be a priority. This stabilization introduces new ICE when using these features in impl headers.

fixes to #![feature(specialization)]

  • fixes #105782
  • fixes #118987

fixes to #![feature(type_alias_impl_trait)]

  • fixes #119272
  • https://github.com/rust-lang/rust/issues/105787#issuecomment-1750112388
  • fixes #124207

This does not stabilize the whole solver

While this stabilizes the use of the new solver in coherence checking, there are many parts of the solver which will remain fully unstable. We may still adapt these areas while working towards stabilizing the new solver everywhere. We are confident that we are able to do so without negatively impacting coherence.

goals with a non-empty ParamEnv

Coherence always uses an empty environment. We therefore do not depend on the behavior of AliasBound and ParamEnv candidates. We only stabilizes the behavior of user-defined and builtin implementations of traits. There are still many open questions there.

opaque types in the defining scope

The handling of opaque types - impl Trait - in both the new and old solver is still not fully figured out. Luckily this can be ignored for now. While opaque types are reachable during coherence checking by using impl_trait_in_associated_types, the behavior during coherence is separate and self-contained. The old and new solver fully agree here.

normalization is hard

This stabilizes that we equate associated types involving bound variables using deferred-alias-equality. We also stop eagerly normalizing in coherence, which should not have any user-facing impact.

We do not stabilize the normalization behavior outside of coherence, e.g. we currently deeply normalize all types during writeback with the new solver. This may change going forward

how to replace select from the old solver

We sometimes depend on getting a single impl for a given trait bound, e.g. when resolving a concrete method for codegen/CTFE. We do not depend on this during coherence, so the exact approach here can still be freely changed going forward.

Acknowledgements

This work would not have been possible without @compiler-errors. He implemented large chunks of the solver himself but also and did a lot of testing and experimentation, eagerly discovering multiple issues which had a significant impact on our approach. @BoxyUwU has also done some amazing work on the solver. Thank you for the endless hours of discussion resulting in the current approach. Especially the way aliases are handled has gone through multiple revisions to get to its current state.

There were also many contributions from - and discussions with - other members of the community and the rest of @rust-lang/types. This solver builds upon previous improvements to the compiler, as well as lessons learned from chalk and a-mir-formality. Getting to this point would not have been possible without that and I am incredibly thankful to everyone involved. See the list of relevant PRs.

lcnr avatar Mar 01 '24 12:03 lcnr

@bors try @rust-timer queue

lcnr avatar Mar 01 '24 12:03 lcnr

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-timer avatar Mar 01 '24 12:03 rust-timer

:hourglass: Trying commit 936fb93255f3515480825c0eaab183c5f7295549 with merge 58934922881506be0b62a14f5b51960997938eea...

bors avatar Mar 01 '24 12:03 bors

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#12 writing image sha256:9f346fc01879c7abd219fc127c90ea11af9c6a731083ddf54711c37eb8a8d7d9 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.1s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Fri Mar  1 12:06:12 UTC 2024
  network time: Fri, 01 Mar 2024 12:06:12 GMT
  network time: Fri, 01 Mar 2024 12:06:12 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
   Compiling rustc_baked_icu_data v0.0.0 (/checkout/compiler/rustc_baked_icu_data)
   Compiling rustc_error_messages v0.0.0 (/checkout/compiler/rustc_error_messages)
   Compiling gsgdt v0.1.2
   Compiling rustc_next_trait_solver v0.0.0 (/checkout/compiler/rustc_next_trait_solver)
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: missing value for assoc item in impl
  --> compiler/rustc_ast/src/ast_traits.rs:21:5
   |
21 |     type Target;
21 |     type Target;
   |     ^^^^^^^^^^^
   |
note: delayed at compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs:208:38
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
         3: <rustc_infer::infer::InferCtxt>::probe::<core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>, <rustc_trait_selection::solve::eval_ctxt::probe::ProbeCtxt<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::probe_trait_candidate::{closure#0}, core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>>>::enter<<rustc_trait_selection::solve::eval_ctxt::probe::TraitProbeCtxt<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::probe_trait_candidate::{closure#0}>>::enter<<rustc_middle::ty::predicate::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate::{closure#0}>::{closure#0}>::{closure#0}>
         4: <rustc_middle::ty::predicate::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate
         5: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_non_blanket_impl_candidates::<rustc_middle::ty::predicate::NormalizesTo>::{closure#0}
         6: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_and_evaluate_candidates::<rustc_middle::ty::predicate::NormalizesTo>
         7: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_normalizes_to_goal::{closure#0}
         8: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_goal
         9: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::enter_canonical::<core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>, <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}::{closure#0}>
        10: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        11: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::DepsType>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}, (rustc_trait_selection::solve::search_graph::StackEntry, core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>)>
        12: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        13: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        14: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
        15: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::ty::Ty, rustc_middle::traits::query::NoSolution, <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::commit_if_ok<rustc_middle::ty::Ty, <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_ty_recur::{closure#0}::{closure#0}>::{closure#0}>
        16: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_ty_recur
        18: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_goal
        18: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_goal
        19: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::enter_canonical::<core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>, <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}::{closure#0}>
        20: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        21: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::DepsType>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}, (rustc_trait_selection::solve::search_graph::StackEntry, core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>)>
        22: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        23: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        24: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
        26: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_and_evaluate_candidates::<rustc_middle::ty::predicate::TraitPredicate>
        27: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_trait_goal
        28: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_goal
        28: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::compute_goal
        29: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::enter_canonical::<core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>, <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}::{closure#0}>
        30: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        31: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::DepsType>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}, (rustc_trait_selection::solve::search_graph::StackEntry, core::result::Result<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::traits::solve::Response>, rustc_middle::traits::query::NoSolution>)>
        32: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        33: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        34: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::enter_root::<core::result::Result<(bool, rustc_middle::traits::solve::Certainty), rustc_middle::traits::query::NoSolution>, <rustc_infer::infer::InferCtxt as rustc_trait_selection::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal::{closure#0}>
        35: <rustc_infer::infer::InferCtxt as rustc_trait_selection::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal
        36: <rustc_trait_selection::solve::fulfill::FulfillmentCtxt as rustc_infer::traits::engine::TraitEngine>::select_where_possible
        38: rustc_trait_selection::traits::coherence::overlapping_impls
        38: rustc_trait_selection::traits::coherence::overlapping_impls
        39: <rustc_middle::traits::specialization_graph::Children as rustc_trait_selection::traits::specialize::specialization_graph::ChildrenExt>::insert
        40: <rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
        41: rustc_trait_selection::traits::specialize::specialization_graph_provider
        42: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        43: <rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        44: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        45: rustc_query_impl::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
        47: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        48: <rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        48: <rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        49: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        51: <rustc_session::session::Session>::time::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_hir_analysis::check_crate::{closure#2}>
        52: rustc_hir_analysis::check_crate
        53: rustc_interface::passes::analysis
        54: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
---
   |     ^^^^^^^^^^^

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

warning: the ICE couldn't be written to `/checkout/rustc-ice-2024-03-01T12_11_59-13344.txt`: Read-only file system (os error 30)
note: rustc 1.78.0-nightly (fb5607058 2024-03-01) running on x86_64-unknown-linux-gnu


note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on -Z unstable-options -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -Z unstable-options -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked
note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

rust-log-analyzer avatar Mar 01 '24 12:03 rust-log-analyzer

The job dist-x86_64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_next_trait_solver test:false 0.378
[RUSTC-TIMING] rustc_type_ir test:false 3.529
[RUSTC-TIMING] tracing_subscriber test:false 12.287
[RUSTC-TIMING] serde_json test:false 5.222
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: missing value for assoc item in impl
  --> compiler/rustc_ast/src/ast_traits.rs:21:5
   |
21 |     type Target;
21 |     type Target;
   |     ^^^^^^^^^^^
   |
note: delayed at compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs:208:38
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_errors::DiagCtxt>::span_delayed_bug::<rustc_span::span_encoding::Span, &str>
         4: <rustc_middle::ty::predicate::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate
         5: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_non_blanket_impl_candidates::<rustc_middle::ty::predicate::NormalizesTo>::{closure#0}
         6: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
         7: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
         8: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
         9: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
        10: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::commit_if_ok::<rustc_middle::ty::Ty, <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_ty_recur::{closure#0}::{closure#0}>
        11: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_ty_recur
        12: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_term
        13: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        14: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        15: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        16: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
        18: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_and_evaluate_candidates::<rustc_middle::ty::predicate::TraitPredicate>
        18: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_and_evaluate_candidates::<rustc_middle::ty::predicate::TraitPredicate>
        19: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        20: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        21: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        22: <rustc_infer::infer::InferCtxt as rustc_trait_selection::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal
        23: <rustc_trait_selection::solve::fulfill::FulfillmentCtxt as rustc_infer::traits::engine::TraitEngine>::select_where_possible
        25: rustc_trait_selection::traits::coherence::overlapping_impls
        25: rustc_trait_selection::traits::coherence::overlapping_impls
        26: <rustc_middle::traits::specialization_graph::Children as rustc_trait_selection::traits::specialize::specialization_graph::ChildrenExt>::insert
        27: <rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
        28: rustc_trait_selection::traits::specialize::specialization_graph_provider
        29: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        31: rustc_query_impl::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
        33: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        33: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        34: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        36: rustc_hir_analysis::check_crate
        37: rustc_interface::passes::analysis
        38: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        39: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        39: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        40: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        41: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#3}>
        42: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        43: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        44: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        45: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/58934922881506be0b62a14f5b51960997938eea/library/alloc/src/boxed.rs:2016:9
        46: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
        47: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/58934922881506be0b62a14f5b51960997938eea/library/std/src/sys/pal/unix/thread.rs:108:17
        48: start_thread
        49: clone
        49: clone
  --> compiler/rustc_ast/src/ast_traits.rs:21:5
   |
21 |     type Target;
   |     ^^^^^^^^^^^

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

warning: the ICE couldn't be written to `/checkout/rustc-ice-2024-03-01T12_21_00-48386.txt`: Read-only file system (os error 30)
note: rustc 1.78.0-nightly (589349228 2024-03-01) running on x86_64-unknown-linux-gnu


note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -Z unstable-options -C linker=clang -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -Z unstable-options -C prefer-dynamic -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C link-arg=-fuse-ld=lld -Z dylib-lto -C lto=thin -C embed-bitcode=yes -C link-args=-Wl,--icf=all -C profile-generate=/tmp/tmp-multistage/opt-artifacts/rustc-pgo -C llvm-args=-vp-counters-per-site=4 -C llvm-args=-static-func-strip-dirname-prefix=2 -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked
note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
---
Caused by:
    Command RUST_BACKTRACE=full python3 /checkout/x.py build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std --rust-profile-generate /tmp/tmp-multistage/opt-artifacts/rustc-pgo --set llvm.thin-lto=false --set llvm.link-shared=true [at /checkout/obj] has failed with exit code Some(1)

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
             at /rust/deps/anyhow-1.0.79/src/error.rs:83:36
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/exec.rs:78:17
   2: <opt_dist::exec::Bootstrap>::run
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/exec.rs:179:9
   3: opt_dist::execute_pipeline::{closure#1}::{closure#0}
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/main.rs:210:13
   4: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}::{closure#0}, ()>
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/timer.rs:111:22
   5: opt_dist::execute_pipeline::{closure#1}
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/main.rs:199:9
   6: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/timer.rs:111:22
   7: opt_dist::execute_pipeline
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/main.rs:196:29
             at /rustc/58934922881506be0b62a14f5b51960997938eea/src/tools/opt-dist/src/main.rs:385:18
   9: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/core/src/ops/function.rs:250:5
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/sys_common/backtrace.rs:155:18
  11: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/rt.rs:166:18
  12: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
  13: std::panicking::try::do_call
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/panicking.rs:554:40
  14: std::panicking::try
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/panicking.rs:518:19

rust-log-analyzer avatar Mar 01 '24 12:03 rust-log-analyzer

:broken_heart: Test failed - checks-actions

bors avatar Mar 01 '24 12:03 bors

rebased on top of #121853 :sweat_smile:

@bors try @rust-timer queue

lcnr avatar Mar 01 '24 14:03 lcnr

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-timer avatar Mar 01 '24 14:03 rust-timer

:hourglass: Trying commit f899a5686cae44c23a380ce46028be78a6e198f4 with merge bfe97fcae016881ad333f0ff8cea2cadb9cf136c...

bors avatar Mar 01 '24 14:03 bors

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#12 writing image sha256:2e99388e14774e61719cb331d234fbec923536d89de9ff96d70244e2a5f0b3e0 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.2s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Fri Mar  1 14:16:58 UTC 2024
  network time: Fri, 01 Mar 2024 14:16:59 GMT
  network time: Fri, 01 Mar 2024 14:16:59 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
##[endgroup]
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
    Finished release [optimized] target(s) in 1.23s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --no-default-features --mini-tests --std-tests`
Using system GCC
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
..................................F

failures:

---- tests::test_unstable_options_tracking_hash stdout ----
thread 'tests::test_unstable_options_tracking_hash' panicked at compiler/rustc_interface/src/tests.rs:784:5:
assertion `left != right` failed
  left: Some(NextSolverConfig { coherence: true, globally: false, dump_tree: Never })
 right: Some(NextSolverConfig { coherence: true, globally: false, dump_tree: Never })


failures:
    tests::test_unstable_options_tracking_hash

rust-log-analyzer avatar Mar 01 '24 15:03 rust-log-analyzer

:sunny: Try build successful - checks-actions Build commit: bfe97fcae016881ad333f0ff8cea2cadb9cf136c (bfe97fcae016881ad333f0ff8cea2cadb9cf136c)

bors avatar Mar 01 '24 15:03 bors

Queued bfe97fcae016881ad333f0ff8cea2cadb9cf136c with parent b0696a5160711c068cb1f01b7437db7990d15750, future comparison URL. There is currently 1 preceding artifact in the queue. It will probably take at least ~1.5 hours until the benchmark run finishes.

rust-timer avatar Mar 01 '24 15:03 rust-timer

Finished benchmarking commit (bfe97fcae016881ad333f0ff8cea2cadb9cf136c): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never @rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.3%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.2% [-5.1%, -0.3%] 9
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 3
All ❌✅ (primary) -2.2% [-5.1%, 0.3%] 13

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.9% [1.9%, 1.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-2.1%, -1.6%] 2
Improvements ✅
(secondary)
-1.7% [-1.9%, -1.5%] 2
All ❌✅ (primary) -0.6% [-2.1%, 1.9%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.3% [-4.3%, -2.6%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.3% [-4.3%, -2.6%] 7

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 651.828s -> 651.877s (0.01%) Artifact size: 311.10 MiB -> 311.62 MiB (0.17%)

rust-timer avatar Mar 01 '24 19:03 rust-timer

I'm somewhat worried because we still have a bunch of ICEs related to next-solver=coherence

https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AI-ICE+%22%3Dcoherence%22++%22solver%22+

matthiaskrgr avatar Mar 01 '24 20:03 matthiaskrgr

@matthiaskrgr: Almost all of those are related to consts, and I'm not particularly concerned with users hitting these in production. None of them, as far as I am aware, are of the "pass -> ICE", so @lcnr and I will fix them in due time.

compiler-errors avatar Mar 01 '24 20:03 compiler-errors

@craterbot check

lcnr avatar Mar 04 '24 09:03 lcnr

:ok_hand: Experiment pr-121848 created and queued. :robot: Automatically detected try build bfe97fcae016881ad333f0ff8cea2cadb9cf136c :mag: You can check out the queue and this experiment's details.

:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

craterbot avatar Mar 04 '24 09:03 craterbot

:construction: Experiment pr-121848 is now running

:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

craterbot avatar Mar 12 '24 01:03 craterbot

:tada: Experiment pr-121848 is completed! :bar_chart: 6 regressed and 1 fixed (423303 total) :newspaper: Open the full report.

:warning: If you notice any spurious failure please add them to the blacklist! :information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

craterbot avatar Mar 13 '24 14:03 craterbot

one ICE as associated_const_equality is not yet supported in the new solver

one failure due to https://github.com/rust-lang/rust/issues/114061 and a few due to paperclip-core-0.6.2, have to look into that

lcnr avatar Mar 14 '24 12:03 lcnr

I am unable to reproduce the paperclip-core regression :/

@bors try

lcnr avatar Mar 14 '24 19:03 lcnr

:hourglass: Trying commit 0b397c23d037b3b23e7d1809b6ddf10bfdce0326 with merge 72eda894eb3548c7ba774079ce0afab42958d4ee...

bors avatar Mar 14 '24 20:03 bors

:sunny: Try build successful - checks-actions Build commit: 72eda894eb3548c7ba774079ce0afab42958d4ee (72eda894eb3548c7ba774079ce0afab42958d4ee)

bors avatar Mar 14 '24 21:03 bors

rebased over #122687 which fixes the regression in paperclip-core.

@bors try

lcnr avatar Mar 21 '24 09:03 lcnr

:hourglass: Trying commit fc22045d030bd043262cbac5d522716bb9eca77a with merge 5685c45d7eb3740feadf28c8bb5caa0a2885b5db...

bors avatar Mar 21 '24 09:03 bors

latest regressions: https://github.com/rust-lang/rust/issues/122861 https://github.com/rust-lang/rust/issues/121006

matthiaskrgr avatar Mar 22 '24 09:03 matthiaskrgr

While I don't expect this to be the case, https://github.com/rust-lang/rust/pull/122687 may also result in some unexpected breakage, so lets make sure it doesn't by rerunning crater completely instead of only for the affected crates.

@craterbot check

Regardless, I don't expect any new regressions here. I looked at the new issues provided by @matthiaskrgr (thank you for finding them!) and believe both to not require any major changes to the new solver. With this:

cc @rust-lang/lang @rust-lang/compiler @rust-lang/compiler-contributors. The FCP is limited to T-types but I very much appreciate any feedback, questions, or issues here.

@rfcbot fcp merge

lcnr avatar Mar 22 '24 12:03 lcnr

Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members:

  • [x] @BoxyUwU
  • [x] @aliemjay
  • [x] @compiler-errors
  • [x] @jackh726
  • [x] @lcnr
  • [x] @nikomatsakis
  • [x] @oli-obk
  • [x] @spastorino

Concerns:

  • ~~full-team signoff~~ resolved by https://github.com/rust-lang/rust/pull/121848#issuecomment-2039751879
  • ~~I would like us to change normalizes-to to be 0 to inf steps of normalization rather than one step norm as it is rn before we stabilize this. i.e. solve rust-lang/trait-system-refactor-initiative#103 by making NormalizesTo normalize the alias until it is rigid instead of just inferring the term to be what is written syntactically in the resolved impl. mostly just to be completely certain that it wont break anything to do, and it should be relatively simple to make this change so hopefully wont block this for long~~ resolved by https://github.com/rust-lang/rust/pull/121848#issuecomment-2039789847

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

rfcbot avatar Mar 22 '24 12:03 rfcbot

:ok_hand: Experiment pr-121848-1 created and queued. :robot: Automatically detected try build 72eda894eb3548c7ba774079ce0afab42958d4ee :warning: Try build based on commit 0b397c23d037b3b23e7d1809b6ddf10bfdce0326, but latest commit is 876e8b09f91dd4d1222e82ecfa18dc91ad810bca. Did you forget to make a new try build? :mag: You can check out the queue and this experiment's details.

:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

craterbot avatar Mar 22 '24 12:03 craterbot

given the impact of this change I think it's important to have the whole team on-board here.

@rfcbot concern full-team signoff

lcnr avatar Mar 22 '24 15:03 lcnr