Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! A realistic `#[cgp_auto_dispatch]` example: dispatching over a `Shape` enum of
//! `Circle`/`Rectangle`, with one immutable method (`area`, `&self`) and one
//! mutating method (`scale`, `&mut self`). Exercises that a single enum can carry
//! several auto-dispatched capabilities at once.
//! several auto-dispatched operations at once.
//!
//! See cgp-knowledge-base/cgp/reference/macros/cgp_auto_dispatch.md and
//! cgp-knowledge-base/cgp/concepts/dispatching.md.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! `HasField` getters on the original struct and no `HasFields` representation
//! impls, which `#[derive(HasField)]` and `#[derive(HasFields)]` supply.
//!
//! Two capabilities come from field-crate blanket impls over the generated
//! Two operations come from field-crate blanket impls over the generated
//! `UpdateField`, rather than from the derive, and this file exercises both in
//! opposite directions: `BuildField` sets an absent field (`IsNothing` to
//! `IsPresent`) and `TakeField` removes a present one (`IsPresent` back to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! `greet` reads a `&Name` field implicitly, but `Name` is bound only where the
//! impl needs it, so the trait stays parameter-free (`Greet`) while the impl
//! carries `Name: Display`. A second `#[cgp_fn]` (`test_greet`) then imports the
//! `Greet` capability with `#[uses(...)]` and drives the runtime assertion.
//! `Greet` trait with `#[uses(...)]` and drives the runtime assertion.
//!
//! See cgp-knowledge-base/cgp/reference/macros/cgp_fn.md.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! `#[uses(...)]` on a `#[cgp_fn]` imports a `Self` trait bound, read like a
//! `use` statement, so the function body can call another capability. Here
//! `use` statement, so the function body can call another trait's method. Here
//! `scaled_rectangle_area` declares `#[uses(RectangleArea)]` and calls
//! `self.rectangle_area()`; the import lands as `Self: RectangleArea` in the
//! generated impl's `where` clause — an impl-side dependency the consumer trait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! `#[uses(...)]` on a `#[cgp_impl]` provider imports a `Self` trait bound, read
//! like a `use` statement, so the provider body can call another capability. Here
//! like a `use` statement, so the provider body can call another trait's method. Here
//! `RectangleAreaCalculator` declares `#[uses(RectangleArea)]` and calls
//! `self.rectangle_area()`; the import becomes an impl-side dependency
//! (`Self: RectangleArea`) that the `CanCalculateArea` consumer trait does not
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/cgp-tests/tests/impl_side_dependencies/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! scope so that the type-level wiring of one test never leaks into another.

// `#[uses(...)]` on `#[cgp_fn]`: imports a `Self` trait bound so the function can
// call another capability. This concept owns the snapshot showing how `#[uses]`
// call another trait's method. This concept owns the snapshot showing how `#[uses]`
// lands on the generated impl's `where` clause.
pub mod fn_uses;

Expand All @@ -18,7 +18,7 @@ pub mod fn_uses_associated_type;
pub mod fn_extend;

// `#[uses(...)]` on a `#[cgp_impl]` provider: imports a `Self` trait bound so the
// provider can call another capability. The provider is written plainly.
// provider can call another trait's method. The provider is written plainly.
pub mod impl_uses;

// `#[uses(...)]` with an associated-type-equality bound on a `#[cgp_impl]`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Entrypoint for the `impl_side_dependencies` concept.
//!
//! Covers the capabilities a provider or `#[cgp_fn]` function requires but the
//! Covers the traits a provider or `#[cgp_fn]` function requires but the
//! consumer trait does not itself expose — CGP's form of dependency injection.
//! These impl-side dependencies are declared with `#[uses(...)]` (import `Self`
//! trait bounds, read like a `use` statement) and `#[extend(...)]` (add a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! One `#[cgp_fn]` capability calling another through a `where Self: …` bound.
//! One `#[cgp_fn]` trait calling another through a `where Self: …` bound.
//!
//! `scaled_rectangle_area` depends on `RectangleArea` (an impl-side dependency
//! stated as an explicit `where` clause) and calls `self.rectangle_area()`. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Both snapshots belong to this concept, which owns `cgp_namespace!`. `App` then
//! joins the header-only inheriting namespace and wires the inherited error type
//! and raiser components under their full `@cgp.core.error.*` paths, and the
//! `CheckApp` bundle asserts each wired capability resolves, confirming the
//! `CheckApp` bundle asserts each wired component resolves, confirming the
//! braceless definition is a usable namespace and not just a parse. That
//! `delegate_components!` is written plainly, since its `namespace` form is
//! pinned in `prefix_default_namespace`.
Expand Down
Loading