{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreieidjcdmwofxxcxxxddiovhanambpbyfyigz62ah4f4h6qqwvjxue",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3moq5s5hstsy2"
  },
  "path": "/t/code-compiles-on-playground-but-fails-when-passed-via-stdin-to-rustc/24393#post_16",
  "publishedAt": "2026-06-20T15:15:05.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "Idea: rustc & cargo should warn on unspecified edition",
    "tools and infrastructure",
    "that was 5 years ago",
    "cargo/src/cargo/core/compiler/mod.rs at master · rust-lang/cargo · GitHub",
    "github.com/rust-lang/cargo",
    "fix(rustc): Always pass --edition to rustc (#13499)",
    "epage",
    "+299\n-288",
    ""
  ],
  "textContent": "ekuber:\n\n> Would someone have the energy to write the MCP for merging this change?\n\nThere exists some prior discussion with similar ideas by the way:\n\nIdea: rustc & cargo should warn on unspecified edition tools and infrastructure\n\n> A moderately common source of beginner confusion is that they encounter unexpected behavior due to not specifying a language edition, and getting the default 2015 edition. This can be either due to calling rustc instead of cargo and not specifying any options, or writing a Cargo.toml from scratch (that is, not using cargo new) without remembering to include the edition field. Users in this position encounter various surprising behaviors, such as needing extern crate to use dependencies, and not…\n\n* * *\n\nkpreid:\n\n> It does. It used to be conditional, but that was 5 years ago.\n>\n> cargo/src/cargo/core/compiler/mod.rs at master · rust-lang/cargo · GitHub\n\nJudging by the PR linked from the abovementioned discussion\n\ngithub.com/rust-lang/cargo\n\n####  fix(rustc): Always pass --edition to rustc (#13499)\n\n`master` ← `epage:always-edition`\n\nopened 09:38PM - 28 Feb 24 UTC\n\n\n\n            epage\n          \n\n\n+299\n-288\n\n\nOn [Internals](https://internals.rust-lang.org/t/idea-rustc-cargo-should-warn-on…-unspecified-edition/20309), the idea came up for warning on unset Edition. I am working on the cargo warning but if rustc ever wants to do so, they'd be blocked on cargo ensuring `--edition` is always set. Hence this change.\n\nit sounds the relevant change is more like ~2 years ago? (And explicitly for the purpose of enabling what this thread now suggests.\n\nIn other words, the _coordination with cargo_ already happened",
  "title": "Code compiles on playground but fails when passed via stdin to rustc"
}