Skip to content

Claude/rust active logic demos masd4#154239

Closed
eelstork wants to merge 17 commits intorust-lang:mainfrom
eelstork:claude/rust-active-logic-demos-masd4
Closed

Claude/rust active logic demos masd4#154239
eelstork wants to merge 17 commits intorust-lang:mainfrom
eelstork:claude/rust-active-logic-demos-masd4

Conversation

@eelstork
Copy link
Copy Markdown

No description provided.

eelstork and others added 17 commits March 22, 2026 09:41
This adds a new `Decisive` trait to `core::ops` that enables custom types
to use `&&` and `||` operators with proper short-circuit evaluation.
Types implementing `Decisive + BitAnd` can use `&&`, and types implementing
`Decisive + BitOr` can use `||`.

The Decisive trait has two methods:
- `is_true(&self) -> bool`: controls || short-circuiting
- `is_false(&self) -> bool`: controls && short-circuiting

This enables behavior trees and three-valued logic systems to be expressed
naturally in Rust, matching the approach described in the paper
"Implementing Behavior Trees using Three-Valued Logic" (arXiv:2011.03835).

Changes:
- library/core/src/ops/decisive.rs: New Decisive trait with bool impl
- compiler/rustc_span/src/symbol.rs: Register decisive symbols
- compiler/rustc_hir/src/lang_items.rs: Register Decisive lang item
- compiler/rustc_hir_typeck/src/op.rs: Type checking for non-bool &&/||
- compiler/rustc_middle/src/thir.rs: Add OverloadedLogicalOp to THIR
- compiler/rustc_mir_build/: MIR lowering with short-circuit desugaring
- tests/ui/traits/decisive-trait.rs: Comprehensive test

https://claude.ai/code/session_01UdHGekBLaGK9SSDq9Yqh1u
Builds stage1 compiler with download-ci-llvm, runs the
decisive trait UI tests, and checks the rust-al-demos crate.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
Build the stage1 compiler only when a v* tag is pushed,
avoiding expensive builds on every commit.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
Minor version bump for the Decisive trait addition, which enables
overloadable && and || operators via short-circuit evaluation.
Suffix distinguishes this fork from upstream Rust releases.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
The upstream ci.yml runs the full rust-lang/rust build matrix which
requires bors, sccache/S3, and dedicated runners. On this fork it
just burns CI minutes and gets cancelled after ~6 min.

Removed the pull_request trigger from ci.yml and added one to
decisive-ci.yml so PRs get the lightweight stage1 build + test
instead.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
This workflow is for the compiler fork only — build stage1 and run
the decisive trait UI tests. The demos repo doesn't exist yet and
shouldn't be tested here.

Also simplified paths by removing the unnecessary `path: rust`
checkout indirection.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
The deprecated `changelog-seen` field was removed from bootstrap.
Replace `config.toml` with `bootstrap.toml` and use
`change-id = 153143` (current latest).

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
Bootstrap runs `git rev-parse HEAD^1` to detect submodule changes,
which fails on a shallow clone (depth=1). Set fetch-depth: 2 and
submodules: recursive so the parent commit and submodule checkouts
are available.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
CI LLVM downloads fail with 404 on forks since the pre-built
artifacts are keyed to upstream commits. Switch to building LLVM
from source and cache the built LLVM alongside stage0.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
Every green build now produces a rustc-decisive tarball (uploaded as
GitHub Actions artifact, 90-day retention). Tagged builds (v*) also
create a GitHub Release with install instructions.

https://claude.ai/code/session_01JWiQ9rhpzDZxVdAUcvZjxF
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 23, 2026

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred in coverage instrumentation.

cc @Zalathar

Some changes occurred in rustc_ty_utils::consts.rs

cc @BoxyUwU

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 23, 2026

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

@rustbot rustbot added A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue. labels Mar 23, 2026
@reddevilmidzy
Copy link
Copy Markdown
Member

Please do this kind of thing in the fork repository.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2026
@jieyouxu
Copy link
Copy Markdown
Member

jieyouxu commented Mar 23, 2026

Hi. This is the moderation team of the Rust project. We are assuming that this PR was intended for a fork or elsewhere and not actually intended for rust-lang/rust.

If you did mean to submit this against rust-lang/rust, then please know that vibecoded contributions are not acceptable.

@rust-lang rust-lang locked as off-topic and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants