You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my tests started suddenly failing because CI pulled in the latest version of trybuild. I tracked this down to commit c74de40 "Use 2015 as the default edition if not found in Cargo.toml".
It's somewhat unfortunate that this (technically breaking!) change wasn't listed in the changelog, but this shouldn't affect anyone in the first place because cargo warns when no edition is specified and it defaults to Rust 2015.
Indeed, the underlying issue is in how the following Cargo.toml file will get parsed (full file from my repo):
[package]
name = "test-suite"version = "0.0.0"publish = false# note: no edition key here, I am setting this separately per test
[[test]]
name = "ui-tests"path = "ui_tests.rs"edition = "2018"
[[test]]
name = "test-edition-2015"path = "tests/tests.rs"edition = "2015"
Cargo will use one of the edition keys in the [[test]] sections, while trybuild will only look in [package], not find anything, and silently default to 2015.
Ideally, trybuild would correctly grab the edition field corresponding to the test being ran. Alternatively, a small and easy solution would be to warn when the default fallback is being used.
The text was updated successfully, but these errors were encountered:
meithecatte
added a commit
to meithecatte/enumflags2
that referenced
this issue
Jun 4, 2024
Hi,
my tests started suddenly failing because CI pulled in the latest version of
trybuild
. I tracked this down to commit c74de40 "Use 2015 as the default edition if not found in Cargo.toml".It's somewhat unfortunate that this (technically breaking!) change wasn't listed in the changelog, but this shouldn't affect anyone in the first place because
cargo
warns when no edition is specified and it defaults to Rust 2015.Indeed, the underlying issue is in how the following
Cargo.toml
file will get parsed (full file from my repo):Cargo will use one of the
edition
keys in the[[test]]
sections, whiletrybuild
will only look in[package]
, not find anything, and silently default to 2015.Ideally,
trybuild
would correctly grab theedition
field corresponding to the test being ran. Alternatively, a small and easy solution would be to warn when the default fallback is being used.The text was updated successfully, but these errors were encountered: