Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should ./miri run set a default edition? #2999

Closed
RalfJung opened this issue Jul 31, 2023 · 4 comments · Fixed by #3221
Closed

Should ./miri run set a default edition? #2999

RalfJung opened this issue Jul 31, 2023 · 4 comments · Fixed by #3221

Comments

@RalfJung
Copy link
Member

./miri run fails on a bunch of our test files since they require a newer edition. Maybe we should add --edition 2021 or so to the flags (matching the edition used for our tests)? This does mean users cannot set an edition themselves any more, but that should rarely be required. (And we could also inhibit this flag if we see a user-passed --edition.)

@saethlin
Copy link
Member

Having to specify the latest edition is really annoying; we should probably default to the latest. That's what the playground and godbolt do.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 31, 2023

We could do that at the miri level if we wanted to. We don't have to follow rustc's CLI exactly

@RalfJung
Copy link
Member Author

I think I'd rather keep the miri binary matching rustc.

@RalfJung
Copy link
Member Author

RalfJung commented Dec 8, 2023

With the changes in rust-lang/rust#118692, more files will stop working with the 2015 edition.

I think we can just start with a single heuristic: if we don't find --edition in the flags, we add --edition 2021.

I wish rustc would just use the last flag when there are multiple --edition; currently it errors which makes this rather non-compositional...

@bors bors closed this as completed in 99cd324 Dec 18, 2023
RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 26, 2023
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants