-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Implement range support in //@ edition
#146166
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
a19047a
to
714f2ca
Compare
r? fmease |
Some changes occurred in src/tools/compiletest cc @jieyouxu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial pass. I still need to think about the implication of this a bit.
) -> Option<EditionRange> { | ||
let raw = config.parse_name_value_directive(line, "edition", testfile, line_number)?; | ||
|
||
if let Some((greter_equal_than, lower_than)) = raw.split_once("..") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (typo): greater
) -> Option<EditionRange> { | ||
let raw = config.parse_name_value_directive(line, "edition", testfile, line_number)?; | ||
|
||
if let Some((greter_equal_than, lower_than)) = raw.split_once("..") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can you just call these lower_bound
and upper_bound
?
And also leave a quick comment here
// Edition range is half-open: `[lower_bound, upper_bound)`
(None, Some(_)) => panic!("..edition is not a supported range in //@ edition"), | ||
(None, None) => panic!("'..' is not a supported range in //@ edition"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can you please use fatal!()
, and include the test file path + line number, so the user can have some idea of where this failed?
enum EditionRange { | ||
Exact(Edition), | ||
GreaterEqualThan(Edition), | ||
Range { greater_equal_than: Edition, lower_than: Edition }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Range { lower_bound: Edition, upper_bound: Edition }
enum EditionRange { | ||
Exact(Edition), | ||
GreaterEqualThan(Edition), | ||
Range { greater_equal_than: Edition, lower_than: Edition }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can you add a doc comment for this as
/// Half-open range: `[lower_bound, upper_bound)`
@jieyouxu this is ready for another review I think 🎉 |
First step to solve #145364