diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/BlanketImplementation.qll b/rust/ql/lib/codeql/rust/internal/typeinference/BlanketImplementation.qll index 1d2eda61ddb4..fee912dc8bc3 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/BlanketImplementation.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/BlanketImplementation.qll @@ -117,8 +117,6 @@ module SatisfiesBlanketConstraint< predicate relevantConstraint(ArgumentTypeAndBlanketOffset ato, Type constraint) { relevantConstraint(ato, _, constraint.(TraitType).getTrait()) } - - predicate useUniversalConditions() { none() } } private module SatisfiesBlanketConstraint = diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll index 9ad964854cf5..c4a76ad68025 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll @@ -2193,8 +2193,6 @@ private module MethodResolution { exists(mc) and constraint.(TraitType).getTrait() instanceof DerefTrait } - - predicate useUniversalConditions() { none() } } private module MethodCallSatisfiesDerefConstraint = @@ -3566,8 +3564,6 @@ private module AwaitSatisfiesConstraintInput implements SatisfiesConstraintInput exists(term) and constraint.(TraitType).getTrait() instanceof FutureTrait } - - predicate useUniversalConditions() { none() } } pragma[nomagic] @@ -3764,8 +3760,6 @@ private module ForIterableSatisfiesConstraintInput implements t instanceof IntoIteratorTrait ) } - - predicate useUniversalConditions() { none() } } pragma[nomagic] @@ -3817,8 +3811,6 @@ private module InvokedClosureSatisfiesConstraintInput implements exists(term) and constraint.(TraitType).getTrait() instanceof FnOnceTrait } - - predicate useUniversalConditions() { none() } } /** Gets the type of `ce` when viewed as an implementation of `FnOnce`. */ diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index a7efa447647a..5134b26b04eb 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -438,7 +438,7 @@ mod method_non_parametric_trait_impl { let thing = MyThing { a: S1 }; let i = thing.convert_to(); // $ type=i:S1 target=T::convert_to - let j = convert_to(thing); // $ type=j:S1 target=convert_to + let j = convert_to(thing); // $ target=convert_to $ MISSING: type=j:S1 -- the blanket implementation `impl> ConvertTo for T` is currently not included in the constraint analysis } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 197ce9ae47fb..c5f797efd2f1 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -7151,8 +7151,6 @@ inferType | main.rs:440:17:440:21 | thing | | main.rs:224:5:227:5 | MyThing | | main.rs:440:17:440:21 | thing | A | main.rs:235:5:236:14 | S1 | | main.rs:440:17:440:34 | thing.convert_to() | | main.rs:235:5:236:14 | S1 | -| main.rs:441:13:441:13 | j | | main.rs:235:5:236:14 | S1 | -| main.rs:441:17:441:33 | convert_to(...) | | main.rs:235:5:236:14 | S1 | | main.rs:441:28:441:32 | thing | | main.rs:224:5:227:5 | MyThing | | main.rs:441:28:441:32 | thing | A | main.rs:235:5:236:14 | S1 | | main.rs:450:26:450:29 | SelfParam | | main.rs:449:5:453:5 | Self [trait OverlappingTrait] | diff --git a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll index 05a8d31ef879..0f91cdad459f 100644 --- a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll +++ b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll @@ -849,7 +849,7 @@ module Make1 Input1> { * checked. Hence using these represent a trade-off between too many * constraints and too few constraints being satisfied. */ - default predicate useUniversalConditions() { any() } + default predicate useUniversalConditions() { none() } } module SatisfiesConstraint<