Skip to content

Commit 84ea6bf

Browse files
authored
Fix beta build warnings / errors. (#1603)
Fixes #1598
1 parent 37e3d65 commit 84ea6bf

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/codegen/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl fmt::Display for Error {
2020
}
2121

2222
impl error::Error for Error {
23-
fn cause(&self) -> Option<&error::Error> {
23+
fn cause(&self) -> Option<&dyn error::Error> {
2424
None
2525
}
2626

src/codegen/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ impl CodeGenerator for Type {
742742
.all(|c| match c {
743743
// These are the only characters allowed in simple
744744
// paths, eg `good::dogs::Bront`.
745-
'A'...'Z' | 'a'...'z' | '0'...'9' | ':' | '_' | ' ' => true,
745+
'A'..='Z' | 'a'..='z' | '0'..='9' | ':' | '_' | ' ' => true,
746746
_ => false,
747747
}) &&
748748
outer_params.is_empty() &&

src/ir/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
661661
}
662662

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

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ impl Builder {
11461146
/// [`ParseCallbacks`](./callbacks/trait.ParseCallbacks.html) documentation.
11471147
pub fn parse_callbacks(
11481148
mut self,
1149-
cb: Box<callbacks::ParseCallbacks>,
1149+
cb: Box<dyn callbacks::ParseCallbacks>,
11501150
) -> Self {
11511151
self.options.parse_callbacks = Some(cb);
11521152
self
@@ -1500,7 +1500,7 @@ struct BindgenOptions {
15001500

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

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

18731873
/// Write these bindings as source text to the given `Write`able.
1874-
pub fn write<'a>(&self, mut writer: Box<Write + 'a>) -> io::Result<()> {
1874+
pub fn write<'a>(&self, mut writer: Box<dyn Write + 'a>) -> io::Result<()> {
18751875
writer.write(
18761876
"/* automatically generated by rust-bindgen */\n\n".as_bytes(),
18771877
)?;

src/options.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::str::FromStr;
88
/// Construct a new [`Builder`](./struct.Builder.html) from command line flags.
99
pub fn builder_from_flags<I>(
1010
args: I,
11-
) -> Result<(Builder, Box<io::Write>, bool), io::Error>
11+
) -> Result<(Builder, Box<dyn io::Write>, bool), io::Error>
1212
where
1313
I: Iterator<Item = String>,
1414
{
@@ -600,9 +600,9 @@ where
600600

601601
let output = if let Some(path) = matches.value_of("output") {
602602
let file = File::create(path)?;
603-
Box::new(io::BufWriter::new(file)) as Box<io::Write>
603+
Box::new(io::BufWriter::new(file)) as Box<dyn io::Write>
604604
} else {
605-
Box::new(io::BufWriter::new(io::stdout())) as Box<io::Write>
605+
Box::new(io::BufWriter::new(io::stdout())) as Box<dyn io::Write>
606606
};
607607

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

0 commit comments

Comments
 (0)