aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-07-19 18:08:42 +0100
committerPhilip Herron <philip.herron@embecosm.com>2021-07-19 19:38:29 +0100
commitf82bf003cebb8a296312d32882db03e52945dac3 (patch)
treecd1cc3c779ea8c5e3ea9ff8b113306768e60ea3d /gcc
parent4a966c3b7f22c2d31306de6f93f1cc5aebe81b8b (diff)
downloadgcc-f82bf003cebb8a296312d32882db03e52945dac3.zip
gcc-f82bf003cebb8a296312d32882db03e52945dac3.tar.gz
gcc-f82bf003cebb8a296312d32882db03e52945dac3.tar.bz2
Add comment to can_eq
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-tyty.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index e8db032..680e43f 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -156,7 +156,15 @@ public:
virtual BaseType *unify (BaseType *other) = 0;
// similar to unify but does not actually perform type unification but
- // determines whether they are compatible
+ // determines whether they are compatible. Consider the following
+ //
+ // fn foo<T>() -> T { ... }
+ // fn foo() -> i32 { ... }
+ //
+ // when the function has been substituted they can be considered equal.
+ //
+ // It can also be used to optional emit errors for trait item compatibility
+ // checks
virtual bool can_eq (const BaseType *other, bool emit_errors) const = 0;
// Check value equality between two ty. Type inference rules are ignored. Two