[refactor] Simplify handling of trait bounds and aliases #1160
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
All the cleanups from #1153 separated in nicely documented, individually reviewable commits.
This includes a simplification of
where T: IsA<Foo>into specifying the trait bound directly when the type parameter is defined:func<T: IsA<Foo>>.As requested by @GuillaumeGomez the "fix" for
clippy::use_selfis in here too, but in hindsight I'm not too sure how useful it is. This is what it does:Fof the function andFof theunsafe extern "C" fnstill mean the same thing, though they are now textually different. The the nestedunsafe extern "C" fncannot reference type parameters (Selfis a type parameter!) of the surrounding context, which is why it still carriesDeviceinstead ofSelf.A bit further don this code-block the pointer of
changed_trampoline::<F>is taken, to pass type parameterFof the surrounding function into the nested one (hence they reference the same type).