Add a compiletest header for edition#51800
Conversation
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
nikomatsakis
left a comment
There was a problem hiding this comment.
I think it'd be better only to supply the --edition argument if edition:foo appears in the test. Otherwise, looks great!
Also, I am not sure whether -Zunstable-options are needed or not =)
src/tools/compiletest/src/header.rs
Outdated
There was a problem hiding this comment.
maybe we should just permit you to write anything here?
src/tools/compiletest/src/header.rs
Outdated
There was a problem hiding this comment.
also, maybe line.trim()? I don't think we'll have edition names w/ internal whitespace =)
src/tools/compiletest/src/runtest.rs
Outdated
There was a problem hiding this comment.
I would prefer more like
if let Some(e) = self.props.editions {
rustc.arg(&format!("--edition={}", e))
}this way we can test the compiler's default behavior
src/tools/compiletest/src/runtest.rs
Outdated
src/tools/compiletest/src/runtest.rs
Outdated
There was a problem hiding this comment.
...and here. Maybe we want some helper method to make that nicer.
There was a problem hiding this comment.
I just made this behave as if the user passed compile-flags: --edition=2018 instead.
eb4aba6 to
75d33cf
Compare
|
@nikomatsakis Ok so...
EDIT: I also squashed everything since the commit history was getting messy. |
| } | ||
|
|
||
| if let Some(edition) = config.parse_edition(ln) { | ||
| self.compile_flags.push(format!("--edition={}", edition)); |
There was a problem hiding this comment.
ah, simple. seems good enough for now.
|
@bors r+ |
|
📌 Commit 75d33cf has been approved by |
…nikomatsakis Add a compiletest header for edition r? @nikomatsakis Are the `-Zunstable-options` options needed in these tests? It looks like they aren't. If not, I can remove them.
Rollup of 7 pull requests Successful merges: - #49987 (Add str::split_ascii_whitespace.) - #50342 (Document round-off error in `.mod_euc()`-method, see issue #50179) - #51658 (Only do sanity check with debug assertions on) - #51799 (Lower case some feature gate error messages) - #51800 (Add a compiletest header for edition) - #51824 (Fix the error reference for LocalKey::try_with) - #51842 (Document that Layout::from_size_align does not allow align=0) Failed merges: r? @ghost
r? @nikomatsakis
Are the
-Zunstable-optionsoptions needed in these tests? It looks like they aren't. If not, I can remove them.