mirror of
https://github.com/github/codeql.git
synced 2026-02-12 05:01:06 +01:00
Rust: Add type inference test for associated type acces on a type parameter of an impl block
This commit is contained in:
@@ -260,6 +260,16 @@ mod type_param_access_associated_type {
|
||||
)
|
||||
}
|
||||
|
||||
// Associated type accessed on a type parameter of an impl block
|
||||
impl<TI> Wrapper<TI>
|
||||
where
|
||||
TI: GetSet,
|
||||
{
|
||||
fn extract(&self) -> TI::Output {
|
||||
self.0.get() // $ fieldof=Wrapper target=GetSet::get
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test() {
|
||||
let _o1 = tp_with_as(S); // $ target=tp_with_as MISSING: type=_o1:S3
|
||||
let _o2 = tp_without_as(S); // $ target=tp_without_as MISSING: type=_o2:S3
|
||||
@@ -267,6 +277,9 @@ mod type_param_access_associated_type {
|
||||
_o3, // $ MISSING: type=_o3:S3
|
||||
_o4, // $ MISSING: type=_o4:bool
|
||||
) = tp_assoc_from_supertrait(S); // $ target=tp_assoc_from_supertrait
|
||||
|
||||
let w = Wrapper(S);
|
||||
let _extracted = w.extract(); // $ target=extract MISSING: type=_extracted:S3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user