Repository: rust
Issue: Elide duplicate path information when types are reused in a compiler error
Labels: A-diagnostics,T-compiler

Suppose we have a very complex error message, with nested types / traits.

For example, I encountered

```
the trait bound `ChainSystem<FunctionSystem<(), Result<C, NoWheelSelection>, (bevy::prelude::Query<'_, '_, &leafwing_input_manager::action_state::ActionState<PlayerAction>, bevy::prelude::With<PlayerCharacter>>, bevy::prelude::Query<'_, '_, (&WheelMenuCenter<C>, &geometry::coordinates::WindowPos, &bevy::prelude::Children)>, bevy::prelude::Query<'_, '_, &geometry::coordinates::WindowPos, bevy::prelude::With<ui::cursor::Cursor>>, bevy::prelude::Query<'_, '_, &mut WheelMenuWedge<C>>), (), for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n> fn(bevy::prelude::Query<'a, 'b, &'c leafwing_input_manager::action_state::ActionState<PlayerAction>, bevy::prelude::With<PlayerCharacter>>, bevy::prelude::Query<'d, 'e, (&'f WheelMenuCenter<C>, &'g geometry::coordinates::WindowPos, &'h bevy::prelude::Children)>, bevy::prelude::Query<'i, 'j, &'k geometry::coordinates::WindowPos, bevy::prelude::With<ui::cursor::Cursor>>, bevy::prelude::Query<'l, 'm, &'n mut WheelMenuWedge<C>>) -> Result<C, NoWheelSelection> {select_from_wheel_menu::<C>}>, <H as bevy::prelude::IntoSystem<Result<C, NoWheelSelection>, Out, Params>>::System>: bevy::prelude::IntoSystem<(), (), _>` is not satisfied
the following other types implement trait `IntoSystemDescriptor<Params>`:
  ConditionalSystemDescriptor
  ExclusiveSystemCoerced
  ExclusiveSystemDescriptor
  ExclusiveSystemFn<F>
  ParallelSystemDescriptor
  SystemDescriptor
  std::boxed::Box<(dyn bevy::prelude::System<Out = (), In = ()> + 'static)>
required for `ChainSystem<FunctionSystem<(), Result<C, NoWheelSelection>, (bevy::prelude::Query<'_, '_, &leafwing_input_manager::action_state::ActionState<PlayerAction>, bevy::prelude::With<PlayerCharacter>>, bevy::prelude::Query<'_, '_, (&WheelMenuCenter<C>, &geometry::coordinates::WindowPos, &bevy::prelude::Children)>, bevy::prelude::Query<'_, '_, &geometry::coordinates::WindowPos, bevy::prelude::With<ui::cursor::Cursor>>, bevy::prelude::Query<'_, '_, &mut WheelMenuWedge<C>>), (), for<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n> fn(bevy::prelude::Query<'a, 'b, &'c leafwing_input_manager::action_state::ActionState<PlayerAction>, bevy::prelude::With<PlayerCharacter>>, bevy::prelude::Query<'d, 'e, (&'f WheelMenuCenter<C>, &'g geometry::coordinates::WindowPos, &'h bevy::prelude::Children)>, bevy::prelude::Query<'i, 'j, &'k geometry::coordinates::WindowPos, bevy::prelude::With<ui::cursor::Cursor>>, bevy::prelude::Query<'l, 'm, &'n mut WheelMenuWedge<C>>) -> Result<C, NoWheelSelection> {select_from_wheel_menu::<C>}>, <H as bevy::prelude::IntoSystem<Result<C, NoWheelSelection>, Out, Params>>::System>` to implement `IntoSystemDescriptor<_>`
```
today.

Rather than repeating the path (and lifetimes?) for each copy of the type, we could use the shortname in the body of the error message, and then expand the full type below.

This would make it significantly easier to read / parse challenging error messages, as the noise would be moved out of the error message body (without losing the full information needed in case the exact path is relevant).