[−][src]Function rustc_resolve::reduce_impl_span_to_impl_keyword
fn reduce_impl_span_to_impl_keyword(cm: &SourceMap, 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 source_map functions and this function to something more robust.