diff --git a/filetests/isa/riscv/verify-encoding.cton b/filetests/isa/riscv/verify-encoding.cton
new file mode 100644
index 0000000000..73d28c842a
--- /dev/null
+++ b/filetests/isa/riscv/verify-encoding.cton
@@ -0,0 +1,21 @@
+test verifier
+isa riscv
+
+function RV32I(i32 link [%x1]) -> i32 link [%x1] {
+ fn0 = function foo()
+
+ebb0(v9999: i32):
+ ; iconst.i32 needs legalizing, so it should throw a
+ [R#0,-] v1 = iconst.i32 1 ; error: Instruction failed to re-encode
+ return v9999
+}
+
+function RV32I(i32 link [%x1]) -> i32 link [%x1] {
+ fn0 = function foo()
+
+ebb0(v9999: i32):
+ v1 = iconst.i32 1
+ v2 = iconst.i32 2
+ [R#0,-] v3 = iadd v1, v2 ; error: Instruction re-encoding
+ return v9999
+}
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs
index e4ba8a0667..d8b6af4d0b 100644
--- a/lib/cretonne/src/context.rs
+++ b/lib/cretonne/src/context.rs
@@ -53,8 +53,8 @@ impl Context {
///
/// The `TargetIsa` argument is currently unused, but the verifier will soon be able to also
/// check ISA-dependent constraints.
- pub fn verify<'a, ISA: Into