{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreicdnwusxcrwndtjc2qm2ai4kk75wfw6gwidhcx4hhmuh6uomfgg4u",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mifvfcquptd2"
  },
  "path": "/t/yet-another-half-baked-idea-for-working-around-the-orphan-rule/24121#post_6",
  "publishedAt": "2026-03-31T21:50:58.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "burakumin:\n\n>\n>     fn main() {\n>         let path = get_path(); // Assume this is a unix_path::Path\n>         let path = path as unix_path::Path\\WithArg; // no-op\n>         rustix::fs::open(path, O_RDONLY, M_IGNORED);\n>     }\n>\n>\n> I suspect that requiring `path as unix_path::Path\\WithArg` still constitutes \"ceremony\" from your perspective\n\nYeah. Don't get me wrong, this would be an _improvement_ over what I have to write now: I wouldn't have to repeat a chain of non-obvious conversions at every callsite! But it is still obscuring the actual logic at this level with conversions, and it's still something that has to be done at every callsite.\n\nBut if you could make _this_ work, that would be good enough for me\n\n\n    // once in the crate\n    facet WithArg for unix_path::Path;\n    impl rustix::path::Arg for Path\\WithArg { /* ... */ }\n\n    // anywhere the `facet WithArg` declaration is visible\n    fn main() {\n        rustix::fs::open(get_path().into(), O_RDONLY, M_IGNORED);\n    }\n\n\nIt's still something I have to do at each callsite, but it's much shorter and -- _because_ it doesn't involve naming `Path\\WithArg` -- much less distracting from the actual logic.",
  "title": "Yet another half-baked idea for working around the orphan rule"
}