about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-04-08 11:47:48 +0000
committerbors <bors@rust-lang.org>2017-04-08 11:47:48 +0000
commitfe39e94d6cd6eba00b3aadf323b3f4d029aad7eb (patch)
treef042bd71f6f987365c4583a254f0a008cd70f4dd /src/rustllvm/PassWrapper.cpp
parent4cadff61ef395f3937d950e35304969ced2ea0b0 (diff)
parent8c31412c2f84c7d76602b2598c5c1352da61d022 (diff)
downloadrust-fe39e94d6cd6eba00b3aadf323b3f4d029aad7eb.tar.gz
rust-fe39e94d6cd6eba00b3aadf323b3f4d029aad7eb.zip
Auto merge of #40887 - estebank:ty-placeholder, r=petrochenkov
Introduce `TyErr` independent from `TyInfer`

Add a `TyErr` type to represent unknown types in places where
parse errors have happened, while still able to build the AST.

Initially only used to represent incorrectly written fn arguments and
avoid "expected X parameters, found Y" errors when called with the
appropriate amount of parameters. We cannot use `TyInfer` for this as
`_` is not allowed as a valid argument type.

Example output:

```rust
error: expected one of `:` or `@`, found `,`
  --> file.rs:12:9
   |
12 | fn bar(x, y: usize) {}
   |         ^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> file.rs:19:9
   |
12 | fn bar(x, y) {}
   | --------------- defined here
...
19 |     bar(1, 2, 3);
   |         ^^^^^^^ expected 2 parameters
```

Fix #34264.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions