Skip to content

Commit 7bb082d

Browse files
committedFeb 6, 2019
libsyntax => 2018
1 parent 2596bc1 commit 7bb082d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+617
-574
lines changed
 

‎src/libsyntax/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
authors = ["The Rust Project Developers"]
33
name = "syntax"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "syntax"

‎src/libsyntax/ast.rs

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
// The Rust abstract syntax tree.
22

3-
pub use self::GenericArgs::*;
4-
pub use self::UnsafeSource::*;
5-
pub use symbol::{Ident, Symbol as Name};
6-
pub use util::parser::ExprPrecedence;
7-
8-
use ext::hygiene::{Mark, SyntaxContext};
9-
use print::pprust;
10-
use ptr::P;
3+
pub use GenericArgs::*;
4+
pub use UnsafeSource::*;
5+
pub use crate::symbol::{Ident, Symbol as Name};
6+
pub use crate::util::parser::ExprPrecedence;
7+
8+
use crate::ext::hygiene::{Mark, SyntaxContext};
9+
use crate::print::pprust;
10+
use crate::ptr::P;
11+
use crate::source_map::{dummy_spanned, respan, Spanned};
12+
use crate::symbol::{keywords, Symbol};
13+
use crate::tokenstream::TokenStream;
14+
use crate::ThinVec;
15+
1116
use rustc_data_structures::indexed_vec::Idx;
1217
#[cfg(target_arch = "x86_64")]
1318
use rustc_data_structures::static_assert;
1419
use rustc_target::spec::abi::Abi;
15-
use source_map::{dummy_spanned, respan, Spanned};
16-
use symbol::{keywords, Symbol};
1720
use syntax_pos::{Span, DUMMY_SP};
18-
use tokenstream::TokenStream;
19-
use ThinVec;
2021

2122
use rustc_data_structures::fx::FxHashSet;
2223
use rustc_data_structures::sync::Lrc;
@@ -31,7 +32,7 @@ pub struct Label {
3132
}
3233

3334
impl fmt::Debug for Label {
34-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
35+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3536
write!(f, "label({:?})", self.ident)
3637
}
3738
}
@@ -43,7 +44,7 @@ pub struct Lifetime {
4344
}
4445

4546
impl fmt::Debug for Lifetime {
46-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
47+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4748
write!(
4849
f,
4950
"lifetime({}: {})",
@@ -74,13 +75,13 @@ impl<'a> PartialEq<&'a str> for Path {
7475
}
7576

7677
impl fmt::Debug for Path {
77-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
78+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7879
write!(f, "path({})", pprust::path_to_string(self))
7980
}
8081
}
8182

8283
impl fmt::Display for Path {
83-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
84+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8485
write!(f, "{}", pprust::path_to_string(self))
8586
}
8687
}
@@ -219,6 +220,7 @@ impl ParenthesizedArgs {
219220
// hack to ensure that we don't try to access the private parts of `NodeId` in this module
220221
mod node_id_inner {
221222
use rustc_data_structures::indexed_vec::Idx;
223+
use rustc_data_structures::newtype_index;
222224
newtype_index! {
223225
pub struct NodeId {
224226
ENCODABLE = custom
@@ -227,7 +229,7 @@ mod node_id_inner {
227229
}
228230
}
229231

230-
pub use self::node_id_inner::NodeId;
232+
pub use node_id_inner::NodeId;
231233

232234
impl NodeId {
233235
pub fn placeholder_from_mark(mark: Mark) -> Self {
@@ -240,7 +242,7 @@ impl NodeId {
240242
}
241243

242244
impl fmt::Display for NodeId {
243-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
245+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
244246
fmt::Display::fmt(&self.as_u32(), f)
245247
}
246248
}
@@ -478,7 +480,7 @@ pub struct Pat {
478480
}
479481

480482
impl fmt::Debug for Pat {
481-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
483+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
482484
write!(f, "pat({}: {})", self.id, pprust::pat_to_string(self))
483485
}
484486
}
@@ -676,7 +678,7 @@ pub enum BinOpKind {
676678

677679
impl BinOpKind {
678680
pub fn to_string(&self) -> &'static str {
679-
use self::BinOpKind::*;
681+
use BinOpKind::*;
680682
match *self {
681683
Add => "+",
682684
Sub => "-",
@@ -713,7 +715,7 @@ impl BinOpKind {
713715
}
714716

715717
pub fn is_comparison(&self) -> bool {
716-
use self::BinOpKind::*;
718+
use BinOpKind::*;
717719
match *self {
718720
Eq | Lt | Le | Ne | Gt | Ge => true,
719721
And | Or | Add | Sub | Mul | Div | Rem | BitXor | BitAnd | BitOr | Shl | Shr => false,
@@ -792,7 +794,7 @@ impl Stmt {
792794
}
793795

794796
impl fmt::Debug for Stmt {
795-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
797+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
796798
write!(
797799
f,
798800
"stmt({}: {})",
@@ -1030,7 +1032,7 @@ impl Expr {
10301032
}
10311033

10321034
impl fmt::Debug for Expr {
1033-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1035+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
10341036
write!(f, "expr({}: {})", self.id, pprust::expr_to_string(self))
10351037
}
10361038
}
@@ -1438,13 +1440,13 @@ pub enum IntTy {
14381440
}
14391441

14401442
impl fmt::Debug for IntTy {
1441-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1443+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14421444
fmt::Display::fmt(self, f)
14431445
}
14441446
}
14451447

14461448
impl fmt::Display for IntTy {
1447-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1449+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14481450
write!(f, "{}", self.ty_to_string())
14491451
}
14501452
}
@@ -1519,13 +1521,13 @@ impl UintTy {
15191521
}
15201522

15211523
impl fmt::Debug for UintTy {
1522-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1524+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15231525
fmt::Display::fmt(self, f)
15241526
}
15251527
}
15261528

15271529
impl fmt::Display for UintTy {
1528-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1530+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15291531
write!(f, "{}", self.ty_to_string())
15301532
}
15311533
}
@@ -1547,7 +1549,7 @@ pub struct Ty {
15471549
}
15481550

15491551
impl fmt::Debug for Ty {
1550-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1552+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15511553
write!(f, "type({})", pprust::ty_to_string(self))
15521554
}
15531555
}
@@ -1832,7 +1834,7 @@ pub enum Defaultness {
18321834
}
18331835

18341836
impl fmt::Display for Unsafety {
1835-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1837+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18361838
fmt::Display::fmt(
18371839
match *self {
18381840
Unsafety::Normal => "normal",
@@ -1852,7 +1854,7 @@ pub enum ImplPolarity {
18521854
}
18531855

18541856
impl fmt::Debug for ImplPolarity {
1855-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1857+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18561858
match *self {
18571859
ImplPolarity::Positive => "positive".fmt(f),
18581860
ImplPolarity::Negative => "negative".fmt(f),

0 commit comments

Comments
 (0)