File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/librustc_trait_selection/traits Expand file tree Collapse file tree 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>(
438438///
439439/// This is just `ty` itself unless `ty` is `#[fundamental]`,
440440/// 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.
441450fn contained_non_local_types ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , in_crate : InCrate ) -> Vec < Ty < ' tcx > > {
442451 if ty_is_local_constructor ( ty, in_crate) {
443452 Vec :: new ( )
@@ -493,7 +502,7 @@ fn def_id_is_local(def_id: DefId, in_crate: InCrate) -> bool {
493502}
494503
495504fn 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) ;
497506
498507 match ty. kind {
499508 ty:: Bool
You can’t perform that action at this time.
0 commit comments