Function rustc_resolve::reduce_impl_span_to_impl_keyword[][src]

fn reduce_impl_span_to_impl_keyword(cm: &CodeMap, impl_span: Span) -> Span
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Adjust the impl span so that just the impl keyword is taken by removing everything after < ("impl<T> Iterator for A<T> {}" -> "impl") and everything after the first whitespace ("impl Iterator for A" -> "impl")

Attention: The method used is very fragile since it essentially duplicates the work of the parser. If you need to use this function or something similar, please consider updating the codemap functions and this function to something more robust.