Repository navigation
Conversation
moq-net re-exports moq-pattern's Pattern and Patterns and moq-clock's Instant, and names them in scope, allowed, Grant, and with_deadline. The census refused all of them as foreign types. A re-exported item now exports at its re-export path, and a signature naming it resolves to that export. A re-exported module of another crate stays refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn
Collaborator
Author
|
Closing: the maintainer chose option B. moq-pattern and moq-clock become their own exports, and moq-net's signatures name their types across crates, instead of exporting them at moq-net's re-export path. That work continues under quest/m1/ffi-export.md's "Several crates" bullet. (written by Opus 5.5) |
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.
Stacked on kixelated/rust2#71 (the moq pin bump), for quest/m1/ffi-export.md's "Several crates" bullet.
Problem
"Foreign type" is the census's largest refusal on moq-net. moq-net re-exports moq-pattern's
Pattern,Patterns,InvalidPattern,Segment, andSpecificity, and moq-clock'sInstant, and names them in its API:origin::Producer::scopeandallowed,auth::Grant's fields,stats::Config::exclude,server::Handshake::with_deadline,frame::Frame::arrived. The exporter refused every re-export of another crate's item, and so every signature naming one. moq-ffi usesscopeandGranttoday.Approach
foreign typerefusal otherwise.pub use kio;,pub use bytes;) stays refused, now asre-export of another crate's module: its API is that crate's own export.depfixture crate whose record and object the api fixture re-exports and names. The C transcript drives them and must match the native one. The reject fixture refusespub use dep;.moq/moq.cnow scopes an origin with moq-pattern's patterns, sorootandabsoluteshow a real root.moq-net census at the pinned revision:
foreign typerefusalsexcludeentriesThe new excludes are the moq-pattern and moq-clock methods that do not map (
Pattern::new's generic,Patterns::iter,Instant::from_std, ...).Decisions needed
moq_pattern/moq_patterns, and moq-clock'sInstantismoq_time_instant, all through moq-net's export.ffi.tomland census, and moq-net's re-exports name their types. This needs the several-crates machinery first (IR shared between rustc invocations, one glue crate), which is an L on its own. Until then, these refusals stay.Impact
re-export of another crate's itemrefusal is nowre-export of another crate's module, for modules only. Documented inffi/README.md.Checks
just check,just test: pass.just ffi moqandjust ffi censusat the pinned moq: pass.Alternatives
Follow-ups
pub use bytes::Bytes, would also export it as an object. No moq crate does this; if one does, its methods fail loud in the census.(written by Opus 5.5)
🤖 Generated with Claude Code
https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn