Implement dyn Trait syntax

This commit is contained in:
Vadim Petrochenkov
2017-10-10 17:33:19 +03:00
parent 3037965b5b
commit e6115af4bd
17 changed files with 149 additions and 41 deletions

View File

@@ -1419,7 +1419,7 @@ pub enum TyKind {
Path(Option<QSelf>, Path),
/// A trait object type `Bound1 + Bound2 + Bound3`
/// where `Bound` is a trait or a lifetime.
TraitObject(TyParamBounds),
TraitObject(TyParamBounds, TraitObjectSyntax),
/// An `impl Bound1 + Bound2 + Bound3` type
/// where `Bound` is a trait or a lifetime.
ImplTrait(TyParamBounds),
@@ -1438,6 +1438,13 @@ pub enum TyKind {
Err,
}
/// Syntax used to declare a trait object.
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum TraitObjectSyntax {
Dyn,
None,
}
/// Inline assembly dialect.
///
/// E.g. `"intel"` as in `asm!("mov eax, 2" : "={eax}"(result) : : : "intel")``