Skip to content

Change non-fatal errors to warnings #1833

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

Merged
merged 1 commit into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ impl ClangToken {
// expressions, so we strip them down here.
CXToken_Comment => return None,
_ => {
error!("Found unexpected token kind: {:?}", self);
warn!("Found unexpected token kind: {:?}", self);
return None;
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl CodeGenerator for Item {
// TODO(emilio, #453): Figure out what to do when this happens
// legitimately, we could track the opaque stuff and disable the
// assertion there I guess.
error!("Found non-whitelisted item in code generation: {:?}", self);
warn!("Found non-whitelisted item in code generation: {:?}", self);
}

result.set_seen(self.id());
Expand Down Expand Up @@ -3938,7 +3938,7 @@ pub(crate) fn codegen(
"Your dot file was generated successfully into: {}",
path
),
Err(e) => error!("{}", e),
Err(e) => warn!("{}", e),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/struct_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<'a> StructLayoutTracker<'a> {
);

if layout.size < self.latest_offset {
error!(
warn!(
"Calculated wrong layout for {}, too more {} bytes",
self.name,
self.latest_offset - layout.size
Expand Down
6 changes: 3 additions & 3 deletions src/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2400,15 +2400,15 @@ If you encounter an error missing from this list, please file an issue or a PR!"
self.codegen_items = Some(codegen_items);

for item in self.options().whitelisted_functions.unmatched_items() {
error!("unused option: --whitelist-function {}", item);
warn!("unused option: --whitelist-function {}", item);
}

for item in self.options().whitelisted_vars.unmatched_items() {
error!("unused option: --whitelist-var {}", item);
warn!("unused option: --whitelist-var {}", item);
}

for item in self.options().whitelisted_types.unmatched_items() {
error!("unused option: --whitelist-type {}", item);
warn!("unused option: --whitelist-type {}", item);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ impl ClangItemParser for Item {
// ignore toplevel operator overloads
let spelling = cursor.spelling();
if !spelling.starts_with("operator") {
error!(
warn!(
"Unhandled cursor kind {:?}: {:?}",
cursor.kind(),
cursor
Expand Down
4 changes: 2 additions & 2 deletions src/ir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ impl Type {
let inner_type = match inner {
Ok(inner) => inner,
Err(..) => {
error!(
warn!(
"Failed to parse template alias \
{:?}",
location
Expand Down Expand Up @@ -1196,7 +1196,7 @@ impl Type {
return Err(ParseError::Continue);
}
_ => {
error!(
warn!(
"unsupported type: kind = {:?}; ty = {:?}; at {:?}",
ty.kind(),
ty,
Expand Down
2 changes: 1 addition & 1 deletion src/regex_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl RegexSet {
self.set = match RxSet::new(items) {
Ok(x) => Some(x),
Err(e) => {
error!("Invalid regex in {:?}: {:?}", self.items, e);
warn!("Invalid regex in {:?}: {:?}", self.items, e);
None
}
}
Expand Down