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

provide more information when bindgen fails #16880

Merged
merged 1 commit into from May 16, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

provide more information when bindgen fails

Providing the flags we passed into clang can be informative for
double-checking that we set everything up correctly.
  • Loading branch information
froydnj committed May 15, 2017
commit 22db4b482347338faf59ea4cb0aeab57324fd6a4
@@ -250,7 +250,14 @@ mod bindings {
return;
}
}
let mut result = builder.generate().expect("Unable to generate bindings").to_string();
let command_line_opts = builder.command_line_flags();
let result = builder.generate();
let mut result = match result {
Ok(bindings) => bindings.to_string(),
Err(_) => {
panic!("Failed to generate bindings, flags: {:?}", command_line_opts);
},
};
for fixup in fixups.iter() {
result = Regex::new(&format!(r"\b{}\b", fixup.pat)).unwrap().replace_all(&result, fixup.rep.as_str())
.into_owned().into();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.