File tree Expand file tree Collapse file tree 3 files changed +6
-57
lines changed Expand file tree Collapse file tree 3 files changed +6
-57
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ toml = "0.4"
2828unicode-normalization = " 0.1"
2929pulldown-cmark = " 0.0.15"
3030url = " 1.5.0"
31+ if_chain = " 0.1"
3132
3233[features ]
3334debugging = []
Original file line number Diff line number Diff line change 1111#![ feature( inclusive_range_syntax, range_contains) ]
1212#![ allow( unknown_lints, indexing_slicing, shadow_reuse, missing_docs_in_private_items) ]
1313
14+ #![ recursion_limit="256" ]
15+
1416#[ macro_use]
1517extern crate rustc;
1618extern crate rustc_typeck;
@@ -54,6 +56,9 @@ extern crate itertools;
5456extern crate pulldown_cmark;
5557extern crate url;
5658
59+ #[ macro_use]
60+ extern crate if_chain;
61+
5762macro_rules! declare_restriction_lint {
5863 { pub $name: tt, $description: tt } => {
5964 declare_lint! { pub $name, Allow , $description }
Original file line number Diff line number Diff line change @@ -37,63 +37,6 @@ pub use self::hir_utils::{SpanlessEq, SpanlessHash};
3737
3838pub type MethodArgs = HirVec < P < Expr > > ;
3939
40- /// Produce a nested chain of if-lets and ifs from the patterns:
41- ///
42- /// ```rust,ignore
43- /// if_let_chain! {[
44- /// let Some(y) = x,
45- /// y.len() == 2,
46- /// let Some(z) = y,
47- /// ], {
48- /// block
49- /// }}
50- /// ```
51- ///
52- /// becomes
53- ///
54- /// ```rust,ignore
55- /// if let Some(y) = x {
56- /// if y.len() == 2 {
57- /// if let Some(z) = y {
58- /// block
59- /// }
60- /// }
61- /// }
62- /// ```
63- #[ macro_export]
64- macro_rules! if_let_chain {
65- ( [ let $pat: pat = $expr: expr, $( $tt: tt) +] , $block: block) => {
66- if let $pat = $expr {
67- if_let_chain!{ [ $( $tt) +] , $block }
68- }
69- } ;
70- ( [ let $pat: pat = $expr: expr] , $block: block) => {
71- if let $pat = $expr {
72- $block
73- }
74- } ;
75- ( [ let $pat: pat = $expr: expr, ] , $block: block) => {
76- if let $pat = $expr {
77- $block
78- }
79- } ;
80- ( [ $expr: expr, $( $tt: tt) +] , $block: block) => {
81- if $expr {
82- if_let_chain!{ [ $( $tt) +] , $block }
83- }
84- } ;
85- ( [ $expr: expr] , $block: block) => {
86- if $expr {
87- $block
88- }
89- } ;
90- ( [ $expr: expr, ] , $block: block) => {
91- if $expr {
92- $block
93- }
94- } ;
95- }
96-
9740pub mod higher;
9841
9942/// Returns true if the two spans come from differing expansions (i.e. one is
You can’t perform that action at this time.
0 commit comments