Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Positive coverage: is_local_parameter / local rigid type

local rigid type
LineCoverageSource
3083(if decls.is_local_adt_id(a))
──────── ("local rigid type")
3108(is_local_parameter(decls, env, _assumptions, RigidTy { name: RigidName::AdtId(a), parameters: _ }) => Constraints::none(env))

8 tests exercised this rule:


Source location: tests/coherence_orphan.rs:84

#[test]
fn mirror_FooStruct() {
    FormalityTest::new(crates![crate core {
        trait CoreTrait {}

        trait Mirror {
            type Assoc : [];
        }

        impl<T> Mirror for T {
            type Assoc = T;
        }
    },
    crate foo {
        struct FooStruct {}
        impl CoreTrait for <FooStruct as Mirror>::Assoc {}
    }])
    .skip_execute()
    .ok()
}
Proof tree

Source location: tests/coherence_orphan.rs:98

#[test]
fn covered_VecT() {
    FormalityTest::new(crates![crate core {
        trait CoreTrait<T> {}
        struct Vec<T> {}
    },
    crate foo {
        struct FooStruct {}
        impl<T> CoreTrait<FooStruct> for Vec<T> {}
    }])
    .skip_execute()
    .ok()
}
Proof tree

Source location: tests/coherence_orphan.rs:196

#[test]
fn CoreTraitLocal_for_AliasToKnown_in_Foo() {
    // TODO: see comment in `orphan_check` from prev commit
    FormalityTest::new(crates![crate core {
        trait CoreTrait<T> {}

        trait Unit {
            type Assoc : [];
        }

        impl<T> Unit for T {
            type Assoc = ();
        }
    },
    crate foo {
        struct FooStruct {}
        impl CoreTrait<FooStruct> for <() as Unit>::Assoc {}
    }])
    .skip_execute()
    .ok()
}
Proof tree

Source location: tests/drop.rs:20

#[test]
fn drop_impl_simple_struct() {
    FormalityTest::new(crates![
        crate Foo {
            struct MyStruct {
                value: u32,
            }

            impl Drop for MyStruct {}
        }
    ])
    .skip_execute()
    .ok()
}
Proof tree
… (200 of 1058 nodes shown)

Source location: tests/drop.rs:38

#[test]
fn drop_impl_generic_struct() {
    FormalityTest::new(crates![
        crate Foo {
            trait Clone {}

            struct MyStruct<T> where T: Clone {
                value: T,
            }

            impl<T> Drop for MyStruct<T> where T: Clone {}
        }
    ])
    .skip_execute()
    .ok()
}
Proof tree
… (200 of 1108 nodes shown)

Source location: tests/drop.rs:54

#[test]
fn drop_impl_generic_no_where_clauses() {
    FormalityTest::new(crates![
        crate Foo {
            struct Wrapper<T> {
                value: T,
            }

            impl<T> Drop for Wrapper<T> {}
        }
    ])
    .skip_execute()
    .ok()
}
Proof tree
… (200 of 1074 nodes shown)

Source location: tests/drop.rs:78

#[test]
fn drop_impl_subset_where_clauses() {
    FormalityTest::new(crates![
        crate Foo {
            trait Clone {}
            trait Debug {}

            struct MyStruct<T> where T: Clone, T: Debug {
                value: T,
            }

            // Impl has no where-clauses — but the struct requires them.
            impl<T> Drop for MyStruct<T> {}
        }
    ])
    .skip_execute()
    .ok()
}
Proof tree
… (200 of 1096 nodes shown)

Source location: tests/field_projections.rs:17

fn test(ptr: Ptr) -> () {
    let x: () = *ptr;
}
Proof tree
… (200 of 1149 nodes shown)