ast: Add span to Extern
This commit is contained in:
parent
5018181c79
commit
18ca2946e0
10 changed files with 32 additions and 19 deletions
|
@ -2667,13 +2667,16 @@ impl Item {
|
|||
#[derive(Clone, Copy, Encodable, Decodable, Debug)]
|
||||
pub enum Extern {
|
||||
None,
|
||||
Implicit,
|
||||
Explicit(StrLit),
|
||||
Implicit(Span),
|
||||
Explicit(StrLit, Span),
|
||||
}
|
||||
|
||||
impl Extern {
|
||||
pub fn from_abi(abi: Option<StrLit>) -> Extern {
|
||||
abi.map_or(Extern::Implicit, Extern::Explicit)
|
||||
pub fn from_abi(abi: Option<StrLit>, span: Span) -> Extern {
|
||||
match abi {
|
||||
Some(name) => Extern::Explicit(name, span),
|
||||
None => Extern::Implicit(span),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue