| commit | 2bd1312f2f1b942c671b20769c9f247b35cc1ef1 | [log] [tgz] |
|---|---|---|
| author | Joel Galenson <jgalenson@google.com> | Tue Apr 28 10:05:40 2020 -0700 |
| committer | Joel Galenson <jgalenson@google.com> | Tue Apr 28 10:14:41 2020 -0700 |
| tree | 99926bcd47e393e3e0c322be510547cf5fdf8d36 | |
| parent | a53c90f08a56fdf6d9da202282ac9bd370129c63 [diff] [blame] |
Disallow passing a reference to a reference.
diff --git a/syntax/check.rs b/syntax/check.rs index 0c75de8..a90db49 100644 --- a/syntax/check.rs +++ b/syntax/check.rs
@@ -230,6 +230,11 @@ ); } } + if let Type::Ref(ity) = &arg.ty { + if let Type::Ref(_) = &ity.inner { + cx.error(arg, "Passing a reference to a reference is not supported"); + } + } } if let Some(ty) = &efn.ret {