mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Don't suggest using use<> syntax to capture APITs
This commit is contained in:
parent
6afe1352d9
commit
f3fb727b08
@ -194,10 +194,15 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for VisitOpaqueTypes<'tcx> {
|
||||
.chain(others)
|
||||
.map(|def_id| self.tcx.item_name(def_id).to_string())
|
||||
.collect();
|
||||
Some((
|
||||
format!(" use<{}>", generics.join(", ")),
|
||||
opaque_span.with_lo(opaque_span.lo() + BytePos(4)).shrink_to_lo(),
|
||||
))
|
||||
// Make sure that we're not trying to name any APITs
|
||||
if generics.iter().all(|name| !name.starts_with("impl ")) {
|
||||
Some((
|
||||
format!(" use<{}>", generics.join(", ")),
|
||||
opaque_span.with_lo(opaque_span.lo() + BytePos(4)).shrink_to_lo(),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user