mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Merge pull request #21057 from hvitved/rust/fix-bad-join
Rust: Fix bad join
This commit is contained in:
@@ -250,6 +250,19 @@ class IndexTrait extends Trait {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The [`IndexMut` trait][1].
|
||||
*
|
||||
* [1]: https://doc.rust-lang.org/std/ops/trait.IndexMut.html
|
||||
*/
|
||||
class IndexMutTrait extends Trait {
|
||||
pragma[nomagic]
|
||||
IndexMutTrait() { this.getCanonicalPath() = "core::ops::index::IndexMut" }
|
||||
|
||||
/** Gets the `index_mut` function. */
|
||||
Function getIndexMutFunction() { result = this.(TraitItemNode).getAssocItem("index_mut") }
|
||||
}
|
||||
|
||||
/**
|
||||
* The [`Box` struct][1].
|
||||
*
|
||||
|
||||
@@ -1839,8 +1839,8 @@ private module MethodResolution {
|
||||
|
||||
override Trait getTrait() {
|
||||
if this.isInMutableContext()
|
||||
then result.getCanonicalPath() = "core::ops::index::IndexMut"
|
||||
else result.getCanonicalPath() = "core::ops::index::Index"
|
||||
then result instanceof IndexMutTrait
|
||||
else result instanceof IndexTrait
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user