Add the dyn keyword before trait objects;

This commit is contained in:
Benjamin Bouvier
2019-06-06 10:11:41 +02:00
parent eee824b6bd
commit d7d48d5cc6
77 changed files with 274 additions and 247 deletions

View File

@@ -19,12 +19,12 @@ pub enum IsaSpec {
/// The parsed file does contain `isa` commands.
/// Each `isa` command is used to configure a `TargetIsa` trait object.
Some(Vec<Box<TargetIsa>>),
Some(Vec<Box<dyn TargetIsa>>),
}
impl IsaSpec {
/// If the `IsaSpec` contains exactly 1 `TargetIsa` we return a reference to it
pub fn unique_isa(&self) -> Option<&TargetIsa> {
pub fn unique_isa(&self) -> Option<&dyn TargetIsa> {
if let IsaSpec::Some(ref isa_vec) = *self {
if isa_vec.len() == 1 {
return Some(&*isa_vec[0]);
@@ -35,7 +35,11 @@ impl IsaSpec {
}
/// Parse an iterator of command line options and apply them to `config`.
pub fn parse_options<'a, I>(iter: I, config: &mut Configurable, loc: Location) -> ParseResult<()>
pub fn parse_options<'a, I>(
iter: I,
config: &mut dyn Configurable,
loc: Location,
) -> ParseResult<()>
where
I: Iterator<Item = &'a str>,
{