Skip to content

Commit 1c689d0

Browse files
authored
Merge pull request #21179 from hvitved/rust/fix-bad-join
Rust: Fix bad join
2 parents 7c95fef + 767acb8 commit 1c689d0

File tree

1 file changed

+7
-0
lines changed
  • rust/ql/lib/codeql/rust/internal/typeinference

1 file changed

+7
-0
lines changed

rust/ql/lib/codeql/rust/internal/typeinference/Type.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ abstract class Type extends TType {
9696
class TupleType extends StructType {
9797
private int arity;
9898

99+
pragma[nomagic]
99100
TupleType() { arity = this.getTypeItem().(Builtins::TupleType).getArity() }
100101

101102
/** Gets the arity of this tuple type. */
@@ -203,6 +204,7 @@ class TraitType extends Type, TTrait {
203204
* Array types like `[i64; 5]` are modeled as normal generic types.
204205
*/
205206
class ArrayType extends StructType {
207+
pragma[nomagic]
206208
ArrayType() { this.getTypeItem() instanceof Builtins::ArrayType }
207209

208210
override string toString() { result = "[;]" }
@@ -216,12 +218,14 @@ TypeParamTypeParameter getArrayTypeParameter() {
216218
abstract class RefType extends StructType { }
217219

218220
class RefMutType extends RefType {
221+
pragma[nomagic]
219222
RefMutType() { this.getTypeItem() instanceof Builtins::RefMutType }
220223

221224
override string toString() { result = "&mut" }
222225
}
223226

224227
class RefSharedType extends RefType {
228+
pragma[nomagic]
225229
RefSharedType() { this.getTypeItem() instanceof Builtins::RefSharedType }
226230

227231
override string toString() { result = "&" }
@@ -312,6 +316,7 @@ class ImplTraitReturnType extends ImplTraitType {
312316
* with a single type argument.
313317
*/
314318
class SliceType extends StructType {
319+
pragma[nomagic]
315320
SliceType() { this.getTypeItem() instanceof Builtins::SliceType }
316321

317322
override string toString() { result = "[]" }
@@ -338,12 +343,14 @@ TypeParamTypeParameter getPtrTypeParameter() {
338343
}
339344

340345
class PtrMutType extends PtrType {
346+
pragma[nomagic]
341347
PtrMutType() { this.getTypeItem() instanceof Builtins::PtrMutType }
342348

343349
override string toString() { result = "*mut" }
344350
}
345351

346352
class PtrConstType extends PtrType {
353+
pragma[nomagic]
347354
PtrConstType() { this.getTypeItem() instanceof Builtins::PtrConstType }
348355

349356
override string toString() { result = "*const" }

0 commit comments

Comments
 (0)