]> gcc.gnu.org Git - gcc.git/commit
resolver: Disambiguate generic args
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Jul 2022 16:53:05 +0000 (18:53 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 18 Jul 2022 15:24:13 +0000 (17:24 +0200)
commitd82201be88ce09c92db709573171c869d94b55fd
treefc9fb4feb468bbbbca8265420e2b2f67ef1fe5be
parent6920d2294b3c6f106478fd3decaa511faf3cac84
resolver: Disambiguate generic args

This removes all the hacks previously introduced to resolve ambiguous
generic args as types, and adds proper disambiguation.

The algorithm is as follows:

is that name referring to a type?
-> disambiguate to a type
is that name referring to a value?
-> disambiguate to a const value
else
-> disambiguate to type

Since types are the default expected behavior, this allows us to report
type errors properly during typechecking.
gcc/rust/expand/rust-attribute-visitor.cc
gcc/rust/hir/rust-ast-lower-base.cc
gcc/rust/hir/rust-ast-lower-type.h
gcc/rust/resolve/rust-ast-resolve-expr.cc
gcc/rust/resolve/rust-ast-resolve-type.cc
gcc/rust/resolve/rust-ast-resolve-type.h
gcc/testsuite/rust/compile/const_generics_5.rs [new file with mode: 0644]
This page took 0.065441 seconds and 6 git commands to generate.