Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engine: references to const items in traits not imported properly #840

Open
paulmure opened this issue Aug 12, 2024 · 0 comments
Open

Engine: references to const items in traits not imported properly #840

paulmure opened this issue Aug 12, 2024 · 0 comments

Comments

@paulmure
Copy link
Contributor

Consider this code:

trait Foo {
    const BAR: u64;
}

fn use_foo<T: Foo>() -> u64 {
    T::BAR
}

The reference to T::BAR becomes a GlobalVar pointing to FOO::BAR like this:

[
  "GlobalVar",
  [
    "Concrete",
    {
      "def_id": {
        "krate": "scratch",
        "path": [
          {
            "data": ["TypeNs", "Foo"],
            "disambiguator": 0
          },
          {
            "data": ["ValueNs", "BAR"],
            "disambiguator": 0
          }
        ]
      },
      "kind": ["AssociatedItem", ["Value"]]
    }
  ]
]

However, the reference to the type variable T is not imported.

@paulmure paulmure changed the title references to const items in traits not imported properly Engine: references to const items in traits not imported properly Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

No branches or pull requests

1 participant