Error codes

E0250: ? on a value that is not T!, T? or a list of them

In a terminal: auk explain E0250 prints this page.

On this page

? unwraps a value that may be an error or missing, passing the bad case up. This value is a plain type that can't fail, so there is nothing for ? to do.

Wrong#

auk
fn main() {
  let n = "abc".len()?
  print(n)
}

Fixed#

auk
fn main() {
  let n = "abc".len()
  print(n)
}

Common causes#

  • ? added by habit to a call that can't fail: remove it.
  • A function whose return type changed from T! to T, leaving ? at its call sites.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page