aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util/rust-canonical-path.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/util/rust-canonical-path.h')
-rw-r--r--gcc/rust/util/rust-canonical-path.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/rust/util/rust-canonical-path.h b/gcc/rust/util/rust-canonical-path.h
index 969ac7f..33fead9 100644
--- a/gcc/rust/util/rust-canonical-path.h
+++ b/gcc/rust/util/rust-canonical-path.h
@@ -46,7 +46,9 @@ namespace Resolver {
class CanonicalPath
{
public:
- CanonicalPath (const CanonicalPath &other) : segs (other.segs) {}
+ CanonicalPath (const CanonicalPath &other)
+ : segs (other.segs), crate_num (other.crate_num)
+ {}
CanonicalPath &operator= (const CanonicalPath &other)
{
@@ -66,14 +68,18 @@ public:
trait_impl_projection_seg (NodeId id, const CanonicalPath &trait_seg,
const CanonicalPath &impl_type_seg)
{
- return CanonicalPath::new_seg (id, "<" + impl_type_seg.get () + " as "
+ // https://doc.rust-lang.org/reference/paths.html#canonical-paths
+ // should be "<X>"?
+ return CanonicalPath::new_seg (id, "<impl " + impl_type_seg.get () + " as "
+ trait_seg.get () + ">");
}
static CanonicalPath inherent_impl_seg (NodeId id,
const CanonicalPath &impl_type_seg)
{
- return CanonicalPath::new_seg (id, "<" + impl_type_seg.get () + ">");
+ // https://doc.rust-lang.org/reference/paths.html#canonical-paths
+ // should be "<X as Y>"?
+ return CanonicalPath::new_seg (id, "<impl " + impl_type_seg.get () + ">");
}
std::string get () const