summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-07-27 13:56:01 +0200
committerGitHub <noreply@github.com>2019-07-27 13:56:01 +0200
commit84ea6bfc719d136bdf6d5725fec73b6ede9b3922 (patch)
tree5037bea26c67b5a968e261886aea4dae84710045
parent37e3d658b1b2030e1f805cedcf7301e8ee461e09 (diff)
Fix beta build warnings / errors. (#1603)
Fixes #1598
-rw-r--r--src/codegen/error.rs2
-rw-r--r--src/codegen/mod.rs2
-rw-r--r--src/ir/context.rs2
-rw-r--r--src/lib.rs8
-rw-r--r--src/options.rs6
5 files changed, 10 insertions, 10 deletions
diff --git a/src/codegen/error.rs b/src/codegen/error.rs
index ccb76c5b..8bf00e54 100644
--- a/src/codegen/error.rs
+++ b/src/codegen/error.rs
@@ -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
}
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index e026a3c7..8e1eded2 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -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() &&
diff --git a/src/ir/context.rs b/src/ir/context.rs
index 25c37874..6c981036 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -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)
}
diff --git a/src/lib.rs b/src/lib.rs
index 39fa3182..b59c9271 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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
@@ -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.
@@ -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")
@@ -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(),
)?;
diff --git a/src/options.rs b/src/options.rs
index 43ad2edc..d15cba81 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -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>,
{
@@ -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") {