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

Fix beta build warnings / errors. #1603

Merged
merged 1 commit into from
Jul 27, 2019
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/codegen/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl fmt::Display for Error {
}

impl error::Error for Error {
fn cause(&self) -> Option<&error::Error> {
fn cause(&self) -> Option<&dyn error::Error> {
None
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ impl CodeGenerator for Type {
.all(|c| match c {
// These are the only characters allowed in simple
// paths, eg `good::dogs::Bront`.
'A'...'Z' | 'a'...'z' | '0'...'9' | ':' | '_' | ' ' => true,
'A'..='Z' | 'a'..='z' | '0'..='9' | ':' | '_' | ' ' => true,
_ => false,
}) &&
outer_params.is_empty() &&
Expand Down
2 changes: 1 addition & 1 deletion src/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
}

/// Get the user-provided callbacks by reference, if any.
pub fn parse_callbacks(&self) -> Option<&ParseCallbacks> {
pub fn parse_callbacks(&self) -> Option<&dyn ParseCallbacks> {
self.options().parse_callbacks.as_ref().map(|t| &**t)
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ impl Builder {
/// [`ParseCallbacks`](./callbacks/trait.ParseCallbacks.html) documentation.
pub fn parse_callbacks(
mut self,
cb: Box<callbacks::ParseCallbacks>,
cb: Box<dyn callbacks::ParseCallbacks>,
) -> Self {
self.options.parse_callbacks = Some(cb);
self
Expand Down Expand Up @@ -1500,7 +1500,7 @@ struct BindgenOptions {

/// A user-provided visitor to allow customizing different kinds of
/// situations.
parse_callbacks: Option<Box<callbacks::ParseCallbacks>>,
parse_callbacks: Option<Box<dyn callbacks::ParseCallbacks>>,

/// Which kind of items should we generate? By default, we'll generate all
/// of them.
Expand Down Expand Up @@ -1853,7 +1853,7 @@ impl Bindings {
/// Convert these bindings into source text (with raw lines prepended).
pub fn to_string(&self) -> String {
let mut bytes = vec![];
self.write(Box::new(&mut bytes) as Box<Write>)
self.write(Box::new(&mut bytes) as Box<dyn Write>)
.expect("writing to a vec cannot fail");
String::from_utf8(bytes)
.expect("we should only write bindings that are valid utf-8")
Expand All @@ -1871,7 +1871,7 @@ impl Bindings {
}

/// Write these bindings as source text to the given `Write`able.
pub fn write<'a>(&self, mut writer: Box<Write + 'a>) -> io::Result<()> {
pub fn write<'a>(&self, mut writer: Box<dyn Write + 'a>) -> io::Result<()> {
writer.write(
"/* automatically generated by rust-bindgen */\n\n".as_bytes(),
)?;
Expand Down
6 changes: 3 additions & 3 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::str::FromStr;
/// Construct a new [`Builder`](./struct.Builder.html) from command line flags.
pub fn builder_from_flags<I>(
args: I,
) -> Result<(Builder, Box<io::Write>, bool), io::Error>
) -> Result<(Builder, Box<dyn io::Write>, bool), io::Error>
where
I: Iterator<Item = String>,
{
Expand Down Expand Up @@ -600,9 +600,9 @@ where

let output = if let Some(path) = matches.value_of("output") {
let file = File::create(path)?;
Box::new(io::BufWriter::new(file)) as Box<io::Write>
Box::new(io::BufWriter::new(file)) as Box<dyn io::Write>
} else {
Box::new(io::BufWriter::new(io::stdout())) as Box<io::Write>
Box::new(io::BufWriter::new(io::stdout())) as Box<dyn io::Write>
};

if matches.is_present("dump-preprocessed-input") {
Expand Down