Merge pull request #21057 from hvitved/rust/fix-bad-join

Rust: Fix bad join
This commit is contained in:
Tom Hvitved
2025-12-17 15:34:45 +01:00
committed by GitHub
2 changed files with 15 additions and 2 deletions

View File

@@ -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].
*

View File

@@ -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
}
}