a06f331eb8
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
29 lines
657 B
Go
29 lines
657 B
Go
package resolver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// A `Type::method()` call resolves to a method whose impl type carries
|
|
// generic/lifetime args (Candidate<'a>), via the base-name owner alias.
|
|
func TestRustScope_GenericOwnerAlias(t *testing.T) {
|
|
g := buildRustGraph(t, map[string]string{
|
|
"lib.rs": `
|
|
struct Candidate<'a> { x: &'a str }
|
|
|
|
impl<'a> Candidate<'a> {
|
|
fn new(s: &'a str) -> Candidate<'a> { Candidate { x: s } }
|
|
}
|
|
|
|
fn make() {
|
|
let _c = Candidate::new("x");
|
|
}
|
|
`,
|
|
})
|
|
ResolveRustScopeCalls(g)
|
|
targets := callTargetsFromRust(g, "lib.rs::make")
|
|
require.Contains(t, targets, "lib.rs::Candidate<'a>.new")
|
|
}
|