diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-07-27 01:33:01 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-07-27 18:56:16 +0300 |
| commit | 9be35f82c1abf2ecbab489bca9eca138ea648312 (patch) | |
| tree | 69888506e34af447d9748c0d542de3ba1dd76210 /src/test/ui/nested-class.rs | |
| parent | ca9faa52f5ada0054b1fa27d97aedf448afb059b (diff) | |
tests: Move run-pass tests without naming conflicts to ui
Diffstat (limited to 'src/test/ui/nested-class.rs')
| -rw-r--r-- | src/test/ui/nested-class.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/nested-class.rs b/src/test/ui/nested-class.rs new file mode 100644 index 00000000000..303273618e1 --- /dev/null +++ b/src/test/ui/nested-class.rs @@ -0,0 +1,25 @@ +// run-pass + +#![allow(non_camel_case_types)] + +pub fn main() { + struct b { + i: isize, + } + + impl b { + fn do_stuff(&self) -> isize { return 37; } + } + + fn b(i:isize) -> b { + b { + i: i + } + } + + // fn b(x:isize) -> isize { panic!(); } + + let z = b(42); + assert_eq!(z.i, 42); + assert_eq!(z.do_stuff(), 37); +} |
