This is similar to capturing variables in functions:

```rust
fn foo() {
    let a = 2;
    fn bar() { println!("{}", a); }
}
```

```
foo.rs:3:31: 3:32 error: can't capture dynamic environment in a fn item; use the || { ... } closure form instead
foo.rs:3     fn bar() { println!("{}", a); }
                                       ^
```

The true answer is that yes, `Z` is a missing type parameter, but that's not a great error message because it looks like there is a type parameter in scope. I think it's great that we no longer ICE on this case, but to close the issue I think the error message needs to improve.

I would expect the error message to look something like:

```
foo.rs:3:31: 3:32 error: can't use type parameters from the outer function
foo.rs:3     enum E { V(Z) }
```