Skip to content

check wf before const-evaluating - #160237

Draft
zedddie wants to merge 1 commit into
rust-lang:mainfrom
zedddie:wf-before-const-eval
Draft

check wf before const-evaluating#160237
zedddie wants to merge 1 commit into
rust-lang:mainfrom
zedddie:wf-before-const-eval

Conversation

@zedddie

@zedddie zedddie commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

(todo: better pr description)
I am not sure whether this is the way it should be done or not, and if it is I will need to rewrite few comments.

This also changed some coherence related stuff with consts (dont know if its an improvement or regression though), ci will fail on them

Fixes #154805
seems to also fix #156780

r? BoxyUwU

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 30, 2026
@rustbot

rustbot commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/const-generics/generic_const_exprs/issue-73899.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-generics/generic_const_exprs/issue-73899.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/const-generics/generic_const_exprs/issue-73899/a" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0119]: conflicting implementations of trait `FooImpl<{ 0u8 == 0u8 }>` for type `[(); 0]`
##[error]  --> /checkout/tests/ui/const-generics/generic_const_exprs/issue-73899.rs:13:1
   |
LL | impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
   | ---------------------------------------- first implementation here
LL |
LL | impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `[(); 0]`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0119`.
------------------------------------------

---- [ui] tests/ui/const-generics/generic_const_exprs/issue-73899.rs stdout end ----
---- [ui] tests/ui/const-generics/overlapping_impls.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-generics/overlapping_impls.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/const-generics/overlapping_impls" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0119]: conflicting implementations of trait `Bar` for type `Foo2<{ Protocol::Variant1 }, _>`
##[error]  --> /checkout/tests/ui/const-generics/overlapping_impls.rs:35:1
   |
LL | impl<T> Bar for Foo2<{ Protocol::Variant1 }, T> {}
   | ----------------------------------------------- first implementation here
LL | impl<T> Bar for Foo2<{ Protocol::Variant2 }, T> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Foo2<{ Protocol::Variant1 }, _>`

error[E0592]: duplicate definitions with name `foo`
##[error]  --> /checkout/tests/ui/const-generics/overlapping_impls.rs:14:5
   |
LL |     pub fn foo() {}

@zedddie

zedddie commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

seem to regress coherence only withgeneric_const_exprs 🤔, both work if gca is used instead

generic_const_exprs/issue-73899.rs is confusing though, it is run-pass but actually I wouldn't expect this to compile, but it does, and with gca it doesn't. accidentally altered it when tried to use gca, the way it is originally written is correct to pass 🤧

@BoxyUwU BoxyUwU mentioned this pull request Aug 6, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: invalid float op: AddWithOverflow [ICE]: primitive read not possible for type

4 participants