Repository navigation
test: move the observe() compile-fail case to a doctest - #489
Merged
Merged
Conversation
The trybuild suite also runs without the observable feature (alloc,linkable-json,migratable), where ObservableRegistrarExt does not exist, so the contract-verbs case failed to resolve its import. Cover observe() with a compile_fail doctest on the method instead, which only builds when the feature is on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGkDJ9Sps6DnUDtpdbs6kD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the red Build & Test on #487 after #488 was merged.
#488 added
tests/compile-fail/typed_key_contract_verbs_on_name.rs, which also checked.observe(). Thecompile_failtrybuild suite runs under several feature sets. One of them,alloc,linkable-json,migratable, does not enableobservable, soObservableRegistrarExtdoesn't exist there. The import failed to resolve and the expected output didn't match (CI job 132972249694).observe()case is removed from the trybuild file, and its.stderris regenerated for the remaining five contract verbs (linked_to,linked_from,linked_to_with,publish,subscribe).observe()on anUndeclaredregistrar is now covered by acompile_fail,E0277doctest onObservableRegistrarExt::observe, which only builds withobservable. I checked that the same snippet with aDeclaredregistrar compiles, so the doctest fails because of the schema state and not some other error.Related Issue
Validation
cargo test -p aimdb-data-contracts --test compile_failwith the full feature set: passescargo test -p aimdb-data-contracts --no-default-features --features alloc,linkable-json,migratable --test compile_fail(the failing CI configuration): passescargo test -p aimdb-data-contracts --features <full> --doc observ: passesChecklist
make check): the affected suite passes locally; awaiting CI.Generated by Claude Code