Skip to content

Commit 0d7c167

Browse files
authored
Merge pull request #180 from phansch/add_edition_support
Add support for upstream's 'edition' flag
2 parents 1ccbcfe + 41ec893 commit 0d7c167

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/header.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ impl TestProps {
297297
.map(|s| s.to_owned()));
298298
}
299299

300+
if let Some(edition) = config.parse_edition(ln) {
301+
self.compile_flags.push(format!("--edition={}", edition));
302+
}
303+
300304
if let Some(r) = config.parse_revisions(ln) {
301305
self.revisions.extend(r);
302306
}
@@ -609,6 +613,10 @@ impl Config {
609613
fn parse_rustfix_only_machine_applicable(&self, line: &str) -> bool {
610614
self.parse_name_directive(line, "rustfix-only-machine-applicable")
611615
}
616+
617+
fn parse_edition(&self, line: &str) -> Option<String> {
618+
self.parse_name_value_directive(line, "edition")
619+
}
612620
}
613621

614622
pub fn lldb_version_to_int(version_string: &str) -> isize {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// edition:2018
2+
// compile-pass
3+
4+
pub struct Foo;
5+
impl Foo {
6+
pub async fn foo(&mut self) {
7+
}
8+
}
9+
10+
fn main() {}

0 commit comments

Comments
 (0)