pub fn snippet_with_context(
    cx: &LateContext<'_>,
    span: Span,
    outer: SyntaxContext,
    default: &'a str,
    applicability: &mut Applicability,
) -> Cow<'a, str> {
    let outer_span = hygiene::walk_chain(span, outer);
    let span = if outer_span.ctxt() == outer {
        outer_span
    } else {
        // The span is from a macro argument, and the outer context is the macro using the argument
        if *applicability != Applicability::Unspecified {
            *applicability = Applicability::MaybeIncorrect;
        }
        // TODO: get the argument span.
        span
    };

    snippet_with_applicability(cx, span, default, applicability)
}
/// Same as `snippet_with_applicability`, but first walks the span up to the given context. This
/// will result in the macro call, rather then the expansion, if the span is from a child context.
/// If the span is not from a child context, it will be used directly instead.
///
/// e.g. Given the expression `&vec![]`, getting a snippet from the span for `vec![]` as a HIR node
/// would result in `box []`. If given the context of the address of expression, this function will
/// correctly get a snippet of `vec![]`.
Same as `snippet_with_applicability`, but first walks the span up to the given context. This
will result in the macro call, rather then the expansion, if the span is from a child context.
If the span is not from a child context, it will be used directly instead.


Same as ` snippet_with_applicability ` but first walks the span up to the given context . This will result in the macro call rather then the expansion if the span is from a child context . If the span is not from a child context it will be used directly instead .
pub fn snippet_with_context(
    cx: &LateContext<'_>,
    span: Span,
    outer: SyntaxContext,
    default: &'a str,
    applicability: &mut Applicability,
) -> Cow<'a, str> {
    let outer_span = hygiene::walk_chain(span, outer);
    let span = if outer_span.ctxt() == outer {
        outer_span
    } else {
        // The span is from a macro argument, and the outer context is the macro using the argument
        if *applicability != Applicability::Unspecified {
            *applicability = Applicability::MaybeIncorrect;
        }
        // TODO: get the argument span.
        span
    };
    snippet_with_applicability(cx, span, default, applicability)
}
pub fn snippet_with_context ( cx : & LateContext < ' _ > , span : Span , outer : SyntaxContext , default : & ' a str , applicability : & mut Applicability , ) -> Cow < ' a , str > { let outer_span = hygiene :: walk_chain ( span , outer ) ; let span = if outer_span . ctxt ( ) == outer { outer_span } else { // The span is from a macro argument, and the outer context is the macro using the argument if * applicability != Applicability :: Unspecified { * applicability = Applicability :: MaybeIncorrect ; } // TODO: get the argument span. span } ; snippet_with_applicability ( cx , span , default , applicability ) }
Same as `snippet_with_applicability`, but first walks the span up to the given context.
Same as ` snippet_with_applicability ` but first walks the span up to the given context .
cx
&LateContext<'_>
span
Span
outer
SyntaxContext
default
&'a str
applicability
&mut Applicability
cx
&LateContext<'_>
span
Span
outer
SyntaxContext
default
&'a str
applicability
&mut Applicability