Generalize reference-to-reference check to cover all positions

Checking this in check_type_ref allows it to apply anywhere that a
reference is written, such as return position which was not covered by
the previous logic.
diff --git a/syntax/check.rs b/syntax/check.rs
index a90db49..3e121b5 100644
--- a/syntax/check.rs
+++ b/syntax/check.rs
@@ -151,6 +151,10 @@
 
     match ty.inner {
         Type::Fn(_) | Type::Void(_) => {}
+        Type::Ref(_) => {
+            cx.error(ty, "C++ does not allow references to references");
+            return;
+        }
         _ => return,
     }
 
@@ -230,11 +234,6 @@
                 );
             }
         }
-        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 {
diff --git a/tests/ui/reference_to_reference.stderr b/tests/ui/reference_to_reference.stderr
index 5b3eadc..d4069c1 100644
--- a/tests/ui/reference_to_reference.stderr
+++ b/tests/ui/reference_to_reference.stderr
@@ -1,11 +1,11 @@
-error: Passing a reference to a reference is not supported
- --> $DIR/reference_to_reference.rs:5:20
+error: C++ does not allow references to references
+ --> $DIR/reference_to_reference.rs:5:23
   |
 5 |         fn repro_c(t: &&ThingC);
-  |                    ^^^^^^^^^^^
+  |                       ^^^^^^^^
 
-error: Passing a reference to a reference is not supported
- --> $DIR/reference_to_reference.rs:9:20
+error: C++ does not allow references to references
+ --> $DIR/reference_to_reference.rs:9:23
   |
 9 |         fn repro_r(t: &&ThingR);
-  |                    ^^^^^^^^^^^
+  |                       ^^^^^^^^