-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Not all version of rustc emit rust_eh_personality. Make it optional. - Closes #11.
- Loading branch information
Showing
2 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,13 +72,22 @@ fn symbols() -> anyhow::Result<()> { | |
if symbol.is_empty() { | ||
continue; | ||
} | ||
expected_symbols.push(symbol); | ||
if symbol.chars().nth(0) == Some('?') { | ||
expected_symbols.push((&symbol[1..], true)); | ||
} else { | ||
expected_symbols.push((symbol, true)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nwalfield
Author
Collaborator
|
||
} | ||
} | ||
expected_symbols.sort(); | ||
|
||
eprintln!("Expected {} symbols:", expected_symbols.len()); | ||
for symbol in expected_symbols.iter() { | ||
eprintln!(" {}", symbol); | ||
for (symbol, optional) in expected_symbols.iter() { | ||
eprint!(" {}", symbol); | ||
if *optional { | ||
eprint!(" (optional)"); | ||
} else { | ||
eprint!(""); | ||
} | ||
} | ||
|
||
let mut i = 0; | ||
|
@@ -91,26 +100,28 @@ fn symbols() -> anyhow::Result<()> { | |
|
||
if i < symbols.len() | ||
&& j < expected_symbols.len() | ||
&& symbols[i] == expected_symbols[j] | ||
&& symbols[i] == expected_symbols[j].0 | ||
{ | ||
i += 1; | ||
j += 1; | ||
} else if (i < symbols.len() | ||
&& j < expected_symbols.len() | ||
&& symbols[i] < expected_symbols[j]) | ||
&& symbols[i] < expected_symbols[j].0) | ||
|| j == expected_symbols.len() | ||
{ | ||
eprintln!("Found unexpected symbol {}", symbols[i]); | ||
i += 1; | ||
bad = true; | ||
} else if (i < symbols.len() | ||
&& j < expected_symbols.len() | ||
&& symbols[i] > expected_symbols[j]) | ||
&& symbols[i] > expected_symbols[j].0) | ||
|| i == symbols.len() | ||
{ | ||
eprintln!("Missing expected symbol {}", expected_symbols[j]); | ||
if ! expected_symbols[j].1 { | ||
eprintln!("Missing expected symbol {}", expected_symbols[j].0); | ||
bad = true; | ||
} | ||
j += 1; | ||
bad = true; | ||
} else { | ||
unreachable!(); | ||
} | ||
|
both branches push true for the 2nd item