diff options
| author | petrochenkov <vadim.petrochenkov@gmail.com> | 2017-09-30 16:42:22 +0300 |
|---|---|---|
| committer | petrochenkov <vadim.petrochenkov@gmail.com> | 2017-09-30 17:41:00 +0300 |
| commit | 8037c28a4a6f238ba63fcbf306f61d4c30ce6a8a (patch) | |
| tree | 38cb3a6699863b3c981ef1abe78ba6ac7e0d6f01 /src/test/compile-fail | |
| parent | 4491ea5a3f21b63e7d0f39d9294308673a6e9715 (diff) | |
| download | rust-8037c28a4a6f238ba63fcbf306f61d4c30ce6a8a.tar.gz rust-8037c28a4a6f238ba63fcbf306f61d4c30ce6a8a.zip | |
Do not require semantic types for all syntactic types when there are type errors
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/type-path-err-node-types.rs | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/test/compile-fail/type-path-err-node-types.rs b/src/test/compile-fail/type-path-err-node-types.rs index 8f26777b441..7ef099d0410 100644 --- a/src/test/compile-fail/type-path-err-node-types.rs +++ b/src/test/compile-fail/type-path-err-node-types.rs @@ -8,10 +8,29 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Type arguments of unresolved types should have their types recorded +// Type arguments in unresolved entities (reporting errors before type checking) +// should have their types recorded. -fn main() { +trait Tr<T> {} + +fn local_type() { let _: Nonexistent<u8, Assoc = u16>; //~ ERROR cannot find type `Nonexistent` in this scope +} - let _ = |a, b: _| -> _ { 0 }; +fn ufcs_trait() { + <u8 as Tr<u8>>::nonexistent(); //~ ERROR cannot find method or associated constant `nonexistent` } + +fn ufcs_item() { + NonExistent::Assoc::<u8>; //~ ERROR undeclared type or module `NonExistent` +} + +fn method() { + nonexistent.nonexistent::<u8>(); //~ ERROR cannot find value `nonexistent` +} + +fn closure() { + let _ = |a, b: _| -> _ { 0 }; // OK +} + +fn main() {} |
