File tree 1 file changed +10
-1
lines changed
src/librustc_trait_selection/traits
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,15 @@ fn orphan_check_trait_ref<'tcx>(
438
438
///
439
439
/// This is just `ty` itself unless `ty` is `#[fundamental]`,
440
440
/// in which case we recursively look into this type.
441
+ ///
442
+ /// If `ty` is local itself, this method returns an empty `Vec`.
443
+ ///
444
+ /// # Examples
445
+ ///
446
+ /// - `u32` is not local, so this returns `[u32]`.
447
+ /// - for `Foo<u32>`, where `Foo` is a local type, this returns `[]`.
448
+ /// - `&mut u32` returns `[u32]`, as `&mut` is a fundamental type, similar to `Box`.
449
+ /// - `Box<Foo<u32>>` returns `[]`, as `Box` is a fundamental type and `Foo` is local.
441
450
fn contained_non_local_types ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , in_crate : InCrate ) -> Vec < Ty < ' tcx > > {
442
451
if ty_is_local_constructor ( ty, in_crate) {
443
452
Vec :: new ( )
@@ -493,7 +502,7 @@ fn def_id_is_local(def_id: DefId, in_crate: InCrate) -> bool {
493
502
}
494
503
495
504
fn ty_is_local_constructor ( ty : Ty < ' _ > , in_crate : InCrate ) -> bool {
496
- debug ! ( "ty_is_non_local_constructor ({:?})" , ty) ;
505
+ debug ! ( "ty_is_local_constructor ({:?})" , ty) ;
497
506
498
507
match ty. kind {
499
508
ty:: Bool
You can’t perform that action at this time.
0 commit comments