summaryrefslogtreecommitdiffstats
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/error-codes
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0001.rs10
-rw-r--r--src/test/ui/error-codes/E0001.stderr14
-rw-r--r--src/test/ui/error-codes/E0004-2.rs5
-rw-r--r--src/test/ui/error-codes/E0004-2.stderr28
-rw-r--r--src/test/ui/error-codes/E0004.rs12
-rw-r--r--src/test/ui/error-codes/E0004.stderr23
-rw-r--r--src/test/ui/error-codes/E0005.rs4
-rw-r--r--src/test/ui/error-codes/E0005.stderr29
-rw-r--r--src/test/ui/error-codes/E0010-teach.rs8
-rw-r--r--src/test/ui/error-codes/E0010-teach.stderr11
-rw-r--r--src/test/ui/error-codes/E0010.rs6
-rw-r--r--src/test/ui/error-codes/E0010.stderr9
-rw-r--r--src/test/ui/error-codes/E0017.rs14
-rw-r--r--src/test/ui/error-codes/E0017.stderr72
-rw-r--r--src/test/ui/error-codes/E0023.rs17
-rw-r--r--src/test/ui/error-codes/E0023.stderr63
-rw-r--r--src/test/ui/error-codes/E0025.rs10
-rw-r--r--src/test/ui/error-codes/E0025.stderr11
-rw-r--r--src/test/ui/error-codes/E0026-teach.rs14
-rw-r--r--src/test/ui/error-codes/E0026-teach.stderr13
-rw-r--r--src/test/ui/error-codes/E0026.rs12
-rw-r--r--src/test/ui/error-codes/E0026.stderr9
-rw-r--r--src/test/ui/error-codes/E0027.rs24
-rw-r--r--src/test/ui/error-codes/E0027.stderr63
-rw-r--r--src/test/ui/error-codes/E0029-teach.rs11
-rw-r--r--src/test/ui/error-codes/E0029-teach.stderr14
-rw-r--r--src/test/ui/error-codes/E0029.rs9
-rw-r--r--src/test/ui/error-codes/E0029.stderr12
-rw-r--r--src/test/ui/error-codes/E0030-teach.rs9
-rw-r--r--src/test/ui/error-codes/E0030-teach.stderr17
-rw-r--r--src/test/ui/error-codes/E0030.rs7
-rw-r--r--src/test/ui/error-codes/E0030.stderr15
-rw-r--r--src/test/ui/error-codes/E0033-teach.rs14
-rw-r--r--src/test/ui/error-codes/E0033-teach.stderr42
-rw-r--r--src/test/ui/error-codes/E0033.rs12
-rw-r--r--src/test/ui/error-codes/E0033.stderr38
-rw-r--r--src/test/ui/error-codes/E0034.rs21
-rw-r--r--src/test/ui/error-codes/E0034.stderr28
-rw-r--r--src/test/ui/error-codes/E0038.rs11
-rw-r--r--src/test/ui/error-codes/E0038.stderr18
-rw-r--r--src/test/ui/error-codes/E0040.fixed18
-rw-r--r--src/test/ui/error-codes/E0040.rs18
-rw-r--r--src/test/ui/error-codes/E0040.stderr12
-rw-r--r--src/test/ui/error-codes/E0044.rs8
-rw-r--r--src/test/ui/error-codes/E0044.stderr11
-rw-r--r--src/test/ui/error-codes/E0045.rs4
-rw-r--r--src/test/ui/error-codes/E0045.stderr9
-rw-r--r--src/test/ui/error-codes/E0049.rs22
-rw-r--r--src/test/ui/error-codes/E0049.stderr23
-rw-r--r--src/test/ui/error-codes/E0050.rs16
-rw-r--r--src/test/ui/error-codes/E0050.stderr30
-rw-r--r--src/test/ui/error-codes/E0054.rs4
-rw-r--r--src/test/ui/error-codes/E0054.stderr9
-rw-r--r--src/test/ui/error-codes/E0055.rs13
-rw-r--r--src/test/ui/error-codes/E0055.stderr11
-rw-r--r--src/test/ui/error-codes/E0057.rs6
-rw-r--r--src/test/ui/error-codes/E0057.stderr35
-rw-r--r--src/test/ui/error-codes/E0059.rs6
-rw-r--r--src/test/ui/error-codes/E0059.stderr9
-rw-r--r--src/test/ui/error-codes/E0060.rs8
-rw-r--r--src/test/ui/error-codes/E0060.stderr19
-rw-r--r--src/test/ui/error-codes/E0061.rs11
-rw-r--r--src/test/ui/error-codes/E0061.stderr35
-rw-r--r--src/test/ui/error-codes/E0062.rs11
-rw-r--r--src/test/ui/error-codes/E0062.stderr11
-rw-r--r--src/test/ui/error-codes/E0063.rs38
-rw-r--r--src/test/ui/error-codes/E0063.stderr27
-rw-r--r--src/test/ui/error-codes/E0067.rs6
-rw-r--r--src/test/ui/error-codes/E0067.stderr20
-rw-r--r--src/test/ui/error-codes/E0069.rs7
-rw-r--r--src/test/ui/error-codes/E0069.stderr11
-rw-r--r--src/test/ui/error-codes/E0070.rs12
-rw-r--r--src/test/ui/error-codes/E0070.stderr27
-rw-r--r--src/test/ui/error-codes/E0071.rs7
-rw-r--r--src/test/ui/error-codes/E0071.stderr9
-rw-r--r--src/test/ui/error-codes/E0075.rs7
-rw-r--r--src/test/ui/error-codes/E0075.stderr9
-rw-r--r--src/test/ui/error-codes/E0076.rs8
-rw-r--r--src/test/ui/error-codes/E0076.stderr9
-rw-r--r--src/test/ui/error-codes/E0077.rs7
-rw-r--r--src/test/ui/error-codes/E0077.stderr9
-rw-r--r--src/test/ui/error-codes/E0080.rs8
-rw-r--r--src/test/ui/error-codes/E0080.stderr15
-rw-r--r--src/test/ui/error-codes/E0081.rs31
-rw-r--r--src/test/ui/error-codes/E0081.stderr42
-rw-r--r--src/test/ui/error-codes/E0084.rs5
-rw-r--r--src/test/ui/error-codes/E0084.stderr11
-rw-r--r--src/test/ui/error-codes/E0091.rs5
-rw-r--r--src/test/ui/error-codes/E0091.stderr15
-rw-r--r--src/test/ui/error-codes/E0092.rs7
-rw-r--r--src/test/ui/error-codes/E0092.stderr9
-rw-r--r--src/test/ui/error-codes/E0093.rs8
-rw-r--r--src/test/ui/error-codes/E0093.stderr9
-rw-r--r--src/test/ui/error-codes/E0094.rs7
-rw-r--r--src/test/ui/error-codes/E0094.stderr9
-rw-r--r--src/test/ui/error-codes/E0106.rs26
-rw-r--r--src/test/ui/error-codes/E0106.stderr66
-rw-r--r--src/test/ui/error-codes/E0107.rs60
-rw-r--r--src/test/ui/error-codes/E0107.stderr149
-rw-r--r--src/test/ui/error-codes/E0109.rs4
-rw-r--r--src/test/ui/error-codes/E0109.stderr17
-rw-r--r--src/test/ui/error-codes/E0110.rs3
-rw-r--r--src/test/ui/error-codes/E0110.stderr17
-rw-r--r--src/test/ui/error-codes/E0116.rs5
-rw-r--r--src/test/ui/error-codes/E0116.stderr11
-rw-r--r--src/test/ui/error-codes/E0117.rs4
-rw-r--r--src/test/ui/error-codes/E0117.stderr21
-rw-r--r--src/test/ui/error-codes/E0118.rs7
-rw-r--r--src/test/ui/error-codes/E0118.stderr11
-rw-r--r--src/test/ui/error-codes/E0119.rs18
-rw-r--r--src/test/ui/error-codes/E0119.stderr12
-rw-r--r--src/test/ui/error-codes/E0120.rs8
-rw-r--r--src/test/ui/error-codes/E0120.stderr9
-rw-r--r--src/test/ui/error-codes/E0121.rs5
-rw-r--r--src/test/ui/error-codes/E0121.stderr21
-rw-r--r--src/test/ui/error-codes/E0124.rs8
-rw-r--r--src/test/ui/error-codes/E0124.stderr11
-rw-r--r--src/test/ui/error-codes/E0128.rs7
-rw-r--r--src/test/ui/error-codes/E0128.stderr9
-rw-r--r--src/test/ui/error-codes/E0130.rs6
-rw-r--r--src/test/ui/error-codes/E0130.stderr9
-rw-r--r--src/test/ui/error-codes/E0131.rs3
-rw-r--r--src/test/ui/error-codes/E0131.stderr9
-rw-r--r--src/test/ui/error-codes/E0132.rs7
-rw-r--r--src/test/ui/error-codes/E0132.stderr9
-rw-r--r--src/test/ui/error-codes/E0133.mir.stderr11
-rw-r--r--src/test/ui/error-codes/E0133.rs9
-rw-r--r--src/test/ui/error-codes/E0133.thir.stderr11
-rw-r--r--src/test/ui/error-codes/E0138.rs8
-rw-r--r--src/test/ui/error-codes/E0138.stderr12
-rw-r--r--src/test/ui/error-codes/E0152.rs8
-rw-r--r--src/test/ui/error-codes/E0152.stderr13
-rw-r--r--src/test/ui/error-codes/E0161.base.stderr9
-rw-r--r--src/test/ui/error-codes/E0161.rs20
-rw-r--r--src/test/ui/error-codes/E0164.rs14
-rw-r--r--src/test/ui/error-codes/E0164.stderr9
-rw-r--r--src/test/ui/error-codes/E0184.rs10
-rw-r--r--src/test/ui/error-codes/E0184.stderr11
-rw-r--r--src/test/ui/error-codes/E0185.rs15
-rw-r--r--src/test/ui/error-codes/E0185.stderr12
-rw-r--r--src/test/ui/error-codes/E0186.rs13
-rw-r--r--src/test/ui/error-codes/E0186.stderr12
-rw-r--r--src/test/ui/error-codes/E0191.rs7
-rw-r--r--src/test/ui/error-codes/E0191.stderr12
-rw-r--r--src/test/ui/error-codes/E0194.rs8
-rw-r--r--src/test/ui/error-codes/E0194.stderr12
-rw-r--r--src/test/ui/error-codes/E0195.rs15
-rw-r--r--src/test/ui/error-codes/E0195.stderr12
-rw-r--r--src/test/ui/error-codes/E0197.rs6
-rw-r--r--src/test/ui/error-codes/E0197.stderr11
-rw-r--r--src/test/ui/error-codes/E0198.rs8
-rw-r--r--src/test/ui/error-codes/E0198.stderr12
-rw-r--r--src/test/ui/error-codes/E0199.rs9
-rw-r--r--src/test/ui/error-codes/E0199.stderr9
-rw-r--r--src/test/ui/error-codes/E0200.rs8
-rw-r--r--src/test/ui/error-codes/E0200.stderr9
-rw-r--r--src/test/ui/error-codes/E0201.rs22
-rw-r--r--src/test/ui/error-codes/E0201.stderr28
-rw-r--r--src/test/ui/error-codes/E0206.rs8
-rw-r--r--src/test/ui/error-codes/E0206.stderr9
-rw-r--r--src/test/ui/error-codes/E0207.rs10
-rw-r--r--src/test/ui/error-codes/E0207.stderr9
-rw-r--r--src/test/ui/error-codes/E0214.rs4
-rw-r--r--src/test/ui/error-codes/E0214.stderr14
-rw-r--r--src/test/ui/error-codes/E0220.rs8
-rw-r--r--src/test/ui/error-codes/E0220.stderr19
-rw-r--r--src/test/ui/error-codes/E0221.rs27
-rw-r--r--src/test/ui/error-codes/E0221.stderr39
-rw-r--r--src/test/ui/error-codes/E0223.rs6
-rw-r--r--src/test/ui/error-codes/E0223.stderr9
-rw-r--r--src/test/ui/error-codes/E0225.rs10
-rw-r--r--src/test/ui/error-codes/E0225.stderr31
-rw-r--r--src/test/ui/error-codes/E0227.rs12
-rw-r--r--src/test/ui/error-codes/E0227.stderr9
-rw-r--r--src/test/ui/error-codes/E0229.rs17
-rw-r--r--src/test/ui/error-codes/E0229.stderr9
-rw-r--r--src/test/ui/error-codes/E0252.rs15
-rw-r--r--src/test/ui/error-codes/E0252.stderr17
-rw-r--r--src/test/ui/error-codes/E0253.rs10
-rw-r--r--src/test/ui/error-codes/E0253.stderr9
-rw-r--r--src/test/ui/error-codes/E0254.rs14
-rw-r--r--src/test/ui/error-codes/E0254.stderr18
-rw-r--r--src/test/ui/error-codes/E0255.rs9
-rw-r--r--src/test/ui/error-codes/E0255.stderr18
-rw-r--r--src/test/ui/error-codes/E0259.rs8
-rw-r--r--src/test/ui/error-codes/E0259.stderr18
-rw-r--r--src/test/ui/error-codes/E0260.rs10
-rw-r--r--src/test/ui/error-codes/E0260.stderr18
-rw-r--r--src/test/ui/error-codes/E0261.rs9
-rw-r--r--src/test/ui/error-codes/E0261.stderr19
-rw-r--r--src/test/ui/error-codes/E0262.rs4
-rw-r--r--src/test/ui/error-codes/E0262.stderr9
-rw-r--r--src/test/ui/error-codes/E0263.rs5
-rw-r--r--src/test/ui/error-codes/E0263.stderr11
-rw-r--r--src/test/ui/error-codes/E0264.rs8
-rw-r--r--src/test/ui/error-codes/E0264.stderr9
-rw-r--r--src/test/ui/error-codes/E0267.rs3
-rw-r--r--src/test/ui/error-codes/E0267.stderr11
-rw-r--r--src/test/ui/error-codes/E0268.rs3
-rw-r--r--src/test/ui/error-codes/E0268.stderr9
-rw-r--r--src/test/ui/error-codes/E0271.rs11
-rw-r--r--src/test/ui/error-codes/E0271.stderr20
-rw-r--r--src/test/ui/error-codes/E0275.rs8
-rw-r--r--src/test/ui/error-codes/E0275.stderr18
-rw-r--r--src/test/ui/error-codes/E0276.rs10
-rw-r--r--src/test/ui/error-codes/E0276.stderr12
-rw-r--r--src/test/ui/error-codes/E0277-2.rs18
-rw-r--r--src/test/ui/error-codes/E0277-2.stderr31
-rw-r--r--src/test/ui/error-codes/E0277-3.rs8
-rw-r--r--src/test/ui/error-codes/E0277-3.stderr22
-rw-r--r--src/test/ui/error-codes/E0277.rs17
-rw-r--r--src/test/ui/error-codes/E0277.stderr31
-rw-r--r--src/test/ui/error-codes/E0282.rs3
-rw-r--r--src/test/ui/error-codes/E0282.stderr14
-rw-r--r--src/test/ui/error-codes/E0283.rs37
-rw-r--r--src/test/ui/error-codes/E0283.stderr37
-rw-r--r--src/test/ui/error-codes/E0297.rs6
-rw-r--r--src/test/ui/error-codes/E0297.stderr19
-rw-r--r--src/test/ui/error-codes/E0308-2.rs12
-rw-r--r--src/test/ui/error-codes/E0308-2.stderr18
-rw-r--r--src/test/ui/error-codes/E0308-4.rs7
-rw-r--r--src/test/ui/error-codes/E0308-4.stderr13
-rw-r--r--src/test/ui/error-codes/E0308.rs8
-rw-r--r--src/test/ui/error-codes/E0308.stderr12
-rw-r--r--src/test/ui/error-codes/E0328.rs10
-rw-r--r--src/test/ui/error-codes/E0328.stderr9
-rw-r--r--src/test/ui/error-codes/E0365.rs8
-rw-r--r--src/test/ui/error-codes/E0365.stderr11
-rw-r--r--src/test/ui/error-codes/E0370.rs10
-rw-r--r--src/test/ui/error-codes/E0370.stderr11
-rw-r--r--src/test/ui/error-codes/E0374.rs11
-rw-r--r--src/test/ui/error-codes/E0374.stderr9
-rw-r--r--src/test/ui/error-codes/E0375.rs13
-rw-r--r--src/test/ui/error-codes/E0375.stderr12
-rw-r--r--src/test/ui/error-codes/E0376.rs10
-rw-r--r--src/test/ui/error-codes/E0376.stderr9
-rw-r--r--src/test/ui/error-codes/E0388.rs13
-rw-r--r--src/test/ui/error-codes/E0388.stderr66
-rw-r--r--src/test/ui/error-codes/E0389.rs10
-rw-r--r--src/test/ui/error-codes/E0389.stderr11
-rw-r--r--src/test/ui/error-codes/E0390.rs10
-rw-r--r--src/test/ui/error-codes/E0390.stderr19
-rw-r--r--src/test/ui/error-codes/E0392.rs4
-rw-r--r--src/test/ui/error-codes/E0392.stderr12
-rw-r--r--src/test/ui/error-codes/E0393.rs7
-rw-r--r--src/test/ui/error-codes/E0393.stderr14
-rw-r--r--src/test/ui/error-codes/E0396-fixed.rs9
-rw-r--r--src/test/ui/error-codes/E0396-fixed.stderr9
-rw-r--r--src/test/ui/error-codes/E0396.rs18
-rw-r--r--src/test/ui/error-codes/E0396.stderr30
-rw-r--r--src/test/ui/error-codes/E0401.rs30
-rw-r--r--src/test/ui/error-codes/E0401.stderr49
-rw-r--r--src/test/ui/error-codes/E0403.rs4
-rw-r--r--src/test/ui/error-codes/E0403.stderr11
-rw-r--r--src/test/ui/error-codes/E0404.rs8
-rw-r--r--src/test/ui/error-codes/E0404.stderr15
-rw-r--r--src/test/ui/error-codes/E0405.rs6
-rw-r--r--src/test/ui/error-codes/E0405.stderr9
-rw-r--r--src/test/ui/error-codes/E0407.rs14
-rw-r--r--src/test/ui/error-codes/E0407.stderr12
-rw-r--r--src/test/ui/error-codes/E0408.rs8
-rw-r--r--src/test/ui/error-codes/E0408.stderr11
-rw-r--r--src/test/ui/error-codes/E0411.rs3
-rw-r--r--src/test/ui/error-codes/E0411.stderr11
-rw-r--r--src/test/ui/error-codes/E0412.rs4
-rw-r--r--src/test/ui/error-codes/E0412.stderr9
-rw-r--r--src/test/ui/error-codes/E0415.rs4
-rw-r--r--src/test/ui/error-codes/E0415.stderr9
-rw-r--r--src/test/ui/error-codes/E0416.rs5
-rw-r--r--src/test/ui/error-codes/E0416.stderr9
-rw-r--r--src/test/ui/error-codes/E0423.rs22
-rw-r--r--src/test/ui/error-codes/E0423.stderr63
-rw-r--r--src/test/ui/error-codes/E0424.rs21
-rw-r--r--src/test/ui/error-codes/E0424.stderr50
-rw-r--r--src/test/ui/error-codes/E0425.rs8
-rw-r--r--src/test/ui/error-codes/E0425.stderr9
-rw-r--r--src/test/ui/error-codes/E0426.rs6
-rw-r--r--src/test/ui/error-codes/E0426.stderr9
-rw-r--r--src/test/ui/error-codes/E0428.rs5
-rw-r--r--src/test/ui/error-codes/E0428.stderr13
-rw-r--r--src/test/ui/error-codes/E0429.rs4
-rw-r--r--src/test/ui/error-codes/E0429.stderr19
-rw-r--r--src/test/ui/error-codes/E0430.rs5
-rw-r--r--src/test/ui/error-codes/E0430.stderr22
-rw-r--r--src/test/ui/error-codes/E0431.rs4
-rw-r--r--src/test/ui/error-codes/E0431.stderr9
-rw-r--r--src/test/ui/error-codes/E0432.rs4
-rw-r--r--src/test/ui/error-codes/E0432.stderr11
-rw-r--r--src/test/ui/error-codes/E0433.rs3
-rw-r--r--src/test/ui/error-codes/E0433.stderr9
-rw-r--r--src/test/ui/error-codes/E0434.rs9
-rw-r--r--src/test/ui/error-codes/E0434.stderr11
-rw-r--r--src/test/ui/error-codes/E0435.fixed6
-rw-r--r--src/test/ui/error-codes/E0435.rs6
-rw-r--r--src/test/ui/error-codes/E0435.stderr11
-rw-r--r--src/test/ui/error-codes/E0437.rs8
-rw-r--r--src/test/ui/error-codes/E0437.stderr9
-rw-r--r--src/test/ui/error-codes/E0438.rs8
-rw-r--r--src/test/ui/error-codes/E0438.stderr9
-rw-r--r--src/test/ui/error-codes/E0445.rs12
-rw-r--r--src/test/ui/error-codes/E0445.stderr30
-rw-r--r--src/test/ui/error-codes/E0446.rs9
-rw-r--r--src/test/ui/error-codes/E0446.stderr12
-rw-r--r--src/test/ui/error-codes/E0449.rs14
-rw-r--r--src/test/ui/error-codes/E0449.stderr23
-rw-r--r--src/test/ui/error-codes/E0451.rs19
-rw-r--r--src/test/ui/error-codes/E0451.stderr15
-rw-r--r--src/test/ui/error-codes/E0452.rs6
-rw-r--r--src/test/ui/error-codes/E0452.stderr27
-rw-r--r--src/test/ui/error-codes/E0453.rs7
-rw-r--r--src/test/ui/error-codes/E0453.stderr21
-rw-r--r--src/test/ui/error-codes/E0454.rs5
-rw-r--r--src/test/ui/error-codes/E0454.stderr9
-rw-r--r--src/test/ui/error-codes/E0458.rs5
-rw-r--r--src/test/ui/error-codes/E0458.stderr16
-rw-r--r--src/test/ui/error-codes/E0459.rs4
-rw-r--r--src/test/ui/error-codes/E0459.stderr9
-rw-r--r--src/test/ui/error-codes/E0463.rs7
-rw-r--r--src/test/ui/error-codes/E0463.stderr9
-rw-r--r--src/test/ui/error-codes/E0464.rs15
-rw-r--r--src/test/ui/error-codes/E0464.stderr14
-rw-r--r--src/test/ui/error-codes/E0478.rs8
-rw-r--r--src/test/ui/error-codes/E0478.stderr20
-rw-r--r--src/test/ui/error-codes/E0492.rs10
-rw-r--r--src/test/ui/error-codes/E0492.stderr17
-rw-r--r--src/test/ui/error-codes/E0496.rs11
-rw-r--r--src/test/ui/error-codes/E0496.stderr11
-rw-r--r--src/test/ui/error-codes/E0499.rs10
-rw-r--r--src/test/ui/error-codes/E0499.stderr14
-rw-r--r--src/test/ui/error-codes/E0501.rs24
-rw-r--r--src/test/ui/error-codes/E0501.stderr31
-rw-r--r--src/test/ui/error-codes/E0502.rs12
-rw-r--r--src/test/ui/error-codes/E0502.stderr13
-rw-r--r--src/test/ui/error-codes/E0503.rs9
-rw-r--r--src/test/ui/error-codes/E0503.stderr13
-rw-r--r--src/test/ui/error-codes/E0504.rs15
-rw-r--r--src/test/ui/error-codes/E0504.stderr17
-rw-r--r--src/test/ui/error-codes/E0505.rs15
-rw-r--r--src/test/ui/error-codes/E0505.stderr13
-rw-r--r--src/test/ui/error-codes/E0506.rs11
-rw-r--r--src/test/ui/error-codes/E0506.stderr14
-rw-r--r--src/test/ui/error-codes/E0507.rs13
-rw-r--r--src/test/ui/error-codes/E0507.stderr18
-rw-r--r--src/test/ui/error-codes/E0508-fail.rs6
-rw-r--r--src/test/ui/error-codes/E0508-fail.stderr13
-rw-r--r--src/test/ui/error-codes/E0508.rs6
-rw-r--r--src/test/ui/error-codes/E0508.stderr13
-rw-r--r--src/test/ui/error-codes/E0509.rs18
-rw-r--r--src/test/ui/error-codes/E0509.stderr13
-rw-r--r--src/test/ui/error-codes/E0511.rs11
-rw-r--r--src/test/ui/error-codes/E0511.stderr9
-rw-r--r--src/test/ui/error-codes/E0512.rs5
-rw-r--r--src/test/ui/error-codes/E0512.stderr12
-rw-r--r--src/test/ui/error-codes/E0516.rs4
-rw-r--r--src/test/ui/error-codes/E0516.stderr14
-rw-r--r--src/test/ui/error-codes/E0517.rs15
-rw-r--r--src/test/ui/error-codes/E0517.stderr36
-rw-r--r--src/test/ui/error-codes/E0518.rs9
-rw-r--r--src/test/ui/error-codes/E0518.stderr20
-rw-r--r--src/test/ui/error-codes/E0520.rs22
-rw-r--r--src/test/ui/error-codes/E0520.stderr24
-rw-r--r--src/test/ui/error-codes/E0522.rs9
-rw-r--r--src/test/ui/error-codes/E0522.stderr9
-rw-r--r--src/test/ui/error-codes/E0527.rs9
-rw-r--r--src/test/ui/error-codes/E0527.stderr9
-rw-r--r--src/test/ui/error-codes/E0528.rs8
-rw-r--r--src/test/ui/error-codes/E0528.stderr9
-rw-r--r--src/test/ui/error-codes/E0529.rs8
-rw-r--r--src/test/ui/error-codes/E0529.stderr9
-rw-r--r--src/test/ui/error-codes/E0530.rs8
-rw-r--r--src/test/ui/error-codes/E0530.stderr12
-rw-r--r--src/test/ui/error-codes/E0532.rs14
-rw-r--r--src/test/ui/error-codes/E0532.stderr9
-rw-r--r--src/test/ui/error-codes/E0534.rs6
-rw-r--r--src/test/ui/error-codes/E0534.stderr9
-rw-r--r--src/test/ui/error-codes/E0559.rs8
-rw-r--r--src/test/ui/error-codes/E0559.stderr11
-rw-r--r--src/test/ui/error-codes/E0560.rs8
-rw-r--r--src/test/ui/error-codes/E0560.stderr11
-rw-r--r--src/test/ui/error-codes/E0565-1.rs5
-rw-r--r--src/test/ui/error-codes/E0565-1.stderr9
-rw-r--r--src/test/ui/error-codes/E0565-2.rs5
-rw-r--r--src/test/ui/error-codes/E0565-2.stderr9
-rw-r--r--src/test/ui/error-codes/E0565.rs5
-rw-r--r--src/test/ui/error-codes/E0565.stderr9
-rw-r--r--src/test/ui/error-codes/E0572.rs3
-rw-r--r--src/test/ui/error-codes/E0572.stderr9
-rw-r--r--src/test/ui/error-codes/E0582.rs42
-rw-r--r--src/test/ui/error-codes/E0582.stderr15
-rw-r--r--src/test/ui/error-codes/E0583.rs4
-rw-r--r--src/test/ui/error-codes/E0583.stderr11
-rw-r--r--src/test/ui/error-codes/E0585.rs4
-rw-r--r--src/test/ui/error-codes/E0585.stderr11
-rw-r--r--src/test/ui/error-codes/E0586.rs4
-rw-r--r--src/test/ui/error-codes/E0586.stderr11
-rw-r--r--src/test/ui/error-codes/E0594.rs5
-rw-r--r--src/test/ui/error-codes/E0594.stderr9
-rw-r--r--src/test/ui/error-codes/E0596.rs4
-rw-r--r--src/test/ui/error-codes/E0596.stderr11
-rw-r--r--src/test/ui/error-codes/E0597.rs12
-rw-r--r--src/test/ui/error-codes/E0597.stderr17
-rw-r--r--src/test/ui/error-codes/E0599.rs5
-rw-r--r--src/test/ui/error-codes/E0599.stderr12
-rw-r--r--src/test/ui/error-codes/E0600.rs3
-rw-r--r--src/test/ui/error-codes/E0600.stderr9
-rw-r--r--src/test/ui/error-codes/E0601.rs1
-rw-r--r--src/test/ui/error-codes/E0601.stderr9
-rw-r--r--src/test/ui/error-codes/E0602.rs6
-rw-r--r--src/test/ui/error-codes/E0602.stderr11
-rw-r--r--src/test/ui/error-codes/E0603.rs7
-rw-r--r--src/test/ui/error-codes/E0603.stderr15
-rw-r--r--src/test/ui/error-codes/E0604.rs3
-rw-r--r--src/test/ui/error-codes/E0604.stderr12
-rw-r--r--src/test/ui/error-codes/E0605.rs7
-rw-r--r--src/test/ui/error-codes/E0605.stderr21
-rw-r--r--src/test/ui/error-codes/E0606.rs3
-rw-r--r--src/test/ui/error-codes/E0606.stderr12
-rw-r--r--src/test/ui/error-codes/E0607.rs4
-rw-r--r--src/test/ui/error-codes/E0607.stderr9
-rw-r--r--src/test/ui/error-codes/E0608.rs3
-rw-r--r--src/test/ui/error-codes/E0608.stderr9
-rw-r--r--src/test/ui/error-codes/E0609.rs12
-rw-r--r--src/test/ui/error-codes/E0609.stderr17
-rw-r--r--src/test/ui/error-codes/E0610.rs4
-rw-r--r--src/test/ui/error-codes/E0610.stderr9
-rw-r--r--src/test/ui/error-codes/E0614.rs4
-rw-r--r--src/test/ui/error-codes/E0614.stderr9
-rw-r--r--src/test/ui/error-codes/E0615.rs12
-rw-r--r--src/test/ui/error-codes/E0615.stderr14
-rw-r--r--src/test/ui/error-codes/E0616.rs14
-rw-r--r--src/test/ui/error-codes/E0616.stderr9
-rw-r--r--src/test/ui/error-codes/E0617.rs26
-rw-r--r--src/test/ui/error-codes/E0617.stderr44
-rw-r--r--src/test/ui/error-codes/E0618.rs11
-rw-r--r--src/test/ui/error-codes/E0618.stderr30
-rw-r--r--src/test/ui/error-codes/E0620.rs3
-rw-r--r--src/test/ui/error-codes/E0620.stderr15
-rw-r--r--src/test/ui/error-codes/E0621-does-not-trigger-for-closures.rs16
-rw-r--r--src/test/ui/error-codes/E0621-does-not-trigger-for-closures.stderr11
-rw-r--r--src/test/ui/error-codes/E0622.rs6
-rw-r--r--src/test/ui/error-codes/E0622.stderr9
-rw-r--r--src/test/ui/error-codes/E0624.rs12
-rw-r--r--src/test/ui/error-codes/E0624.stderr12
-rw-r--r--src/test/ui/error-codes/E0637.rs17
-rw-r--r--src/test/ui/error-codes/E0637.stderr28
-rw-r--r--src/test/ui/error-codes/E0642.fixed20
-rw-r--r--src/test/ui/error-codes/E0642.rs20
-rw-r--r--src/test/ui/error-codes/E0642.stderr36
-rw-r--r--src/test/ui/error-codes/E0646.rs1
-rw-r--r--src/test/ui/error-codes/E0646.stderr9
-rw-r--r--src/test/ui/error-codes/E0647.rs9
-rw-r--r--src/test/ui/error-codes/E0647.stderr9
-rw-r--r--src/test/ui/error-codes/E0648.rs4
-rw-r--r--src/test/ui/error-codes/E0648.stderr9
-rw-r--r--src/test/ui/error-codes/E0657.rs26
-rw-r--r--src/test/ui/error-codes/E0657.stderr15
-rw-r--r--src/test/ui/error-codes/E0658.rs6
-rw-r--r--src/test/ui/error-codes/E0658.stderr12
-rw-r--r--src/test/ui/error-codes/E0659.rs16
-rw-r--r--src/test/ui/error-codes/E0659.stderr23
-rw-r--r--src/test/ui/error-codes/E0705.rs10
-rw-r--r--src/test/ui/error-codes/E0705.stderr9
-rw-r--r--src/test/ui/error-codes/E0718.rs7
-rw-r--r--src/test/ui/error-codes/E0718.stderr9
-rw-r--r--src/test/ui/error-codes/E0719.rs14
-rw-r--r--src/test/ui/error-codes/E0719.stderr19
-rw-r--r--src/test/ui/error-codes/E0730.rs8
-rw-r--r--src/test/ui/error-codes/E0730.stderr9
-rw-r--r--src/test/ui/error-codes/E0746.fixed18
-rw-r--r--src/test/ui/error-codes/E0746.rs18
-rw-r--r--src/test/ui/error-codes/E0746.stderr27
-rw-r--r--src/test/ui/error-codes/E0767.rs7
-rw-r--r--src/test/ui/error-codes/E0767.stderr14
-rw-r--r--src/test/ui/error-codes/E0771.rs8
-rw-r--r--src/test/ui/error-codes/E0771.stderr20
-rw-r--r--src/test/ui/error-codes/E0777.rs7
-rw-r--r--src/test/ui/error-codes/E0777.stderr21
-rw-r--r--src/test/ui/error-codes/E0778.rs8
-rw-r--r--src/test/ui/error-codes/E0778.stderr9
-rw-r--r--src/test/ui/error-codes/E0779.rs6
-rw-r--r--src/test/ui/error-codes/E0779.stderr9
-rw-r--r--src/test/ui/error-codes/E0790.rs53
-rw-r--r--src/test/ui/error-codes/E0790.stderr73
-rw-r--r--src/test/ui/error-codes/auxiliary/crateresolve1-1.rs5
-rw-r--r--src/test/ui/error-codes/auxiliary/crateresolve1-2.rs5
-rw-r--r--src/test/ui/error-codes/auxiliary/crateresolve1-3.rs5
-rw-r--r--src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs22
-rw-r--r--src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs25
-rw-r--r--src/test/ui/error-codes/e0119/complex-impl.rs11
-rw-r--r--src/test/ui/error-codes/e0119/complex-impl.stderr14
-rw-r--r--src/test/ui/error-codes/e0119/conflict-with-std.rs26
-rw-r--r--src/test/ui/error-codes/e0119/conflict-with-std.stderr32
-rw-r--r--src/test/ui/error-codes/e0119/issue-23563.rs29
-rw-r--r--src/test/ui/error-codes/e0119/issue-23563.stderr13
-rw-r--r--src/test/ui/error-codes/e0119/issue-27403.rs11
-rw-r--r--src/test/ui/error-codes/e0119/issue-27403.stderr13
-rw-r--r--src/test/ui/error-codes/e0119/issue-28981.rs7
-rw-r--r--src/test/ui/error-codes/e0119/issue-28981.stderr12
-rw-r--r--src/test/ui/error-codes/e0119/so-37347311.rs17
-rw-r--r--src/test/ui/error-codes/e0119/so-37347311.stderr12
-rw-r--r--src/test/ui/error-codes/ex-E0611.rs12
-rw-r--r--src/test/ui/error-codes/ex-E0611.stderr9
-rw-r--r--src/test/ui/error-codes/ex-E0612.rs6
-rw-r--r--src/test/ui/error-codes/ex-E0612.stderr9
504 files changed, 6949 insertions, 0 deletions
diff --git a/src/test/ui/error-codes/E0001.rs b/src/test/ui/error-codes/E0001.rs
new file mode 100644
index 000000000..2c95f02bf
--- /dev/null
+++ b/src/test/ui/error-codes/E0001.rs
@@ -0,0 +1,10 @@
+#![deny(unreachable_patterns)]
+
+fn main() {
+ let foo = Some(1);
+ match foo {
+ Some(_) => {/* ... */}
+ None => {/* ... */}
+ _ => {/* ... */} //~ ERROR unreachable pattern
+ }
+}
diff --git a/src/test/ui/error-codes/E0001.stderr b/src/test/ui/error-codes/E0001.stderr
new file mode 100644
index 000000000..577c49032
--- /dev/null
+++ b/src/test/ui/error-codes/E0001.stderr
@@ -0,0 +1,14 @@
+error: unreachable pattern
+ --> $DIR/E0001.rs:8:9
+ |
+LL | _ => {/* ... */}
+ | ^
+ |
+note: the lint level is defined here
+ --> $DIR/E0001.rs:1:9
+ |
+LL | #![deny(unreachable_patterns)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/error-codes/E0004-2.rs b/src/test/ui/error-codes/E0004-2.rs
new file mode 100644
index 000000000..c7612fd50
--- /dev/null
+++ b/src/test/ui/error-codes/E0004-2.rs
@@ -0,0 +1,5 @@
+fn main() {
+ let x = Some(1);
+
+ match x { } //~ ERROR E0004
+}
diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr
new file mode 100644
index 000000000..6f5bb4309
--- /dev/null
+++ b/src/test/ui/error-codes/E0004-2.stderr
@@ -0,0 +1,28 @@
+error[E0004]: non-exhaustive patterns: `None` and `Some(_)` not covered
+ --> $DIR/E0004-2.rs:4:11
+ |
+LL | match x { }
+ | ^ patterns `None` and `Some(_)` not covered
+ |
+note: `Option<i32>` defined here
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
+...
+LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | ^^^^ not covered
+ = note: the matched value is of type `Option<i32>`
+help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
+ |
+LL ~ match x {
+LL + None | Some(_) => todo!(),
+LL ~ }
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/src/test/ui/error-codes/E0004.rs b/src/test/ui/error-codes/E0004.rs
new file mode 100644
index 000000000..1ee9d2bad
--- /dev/null
+++ b/src/test/ui/error-codes/E0004.rs
@@ -0,0 +1,12 @@
+enum Terminator {
+ HastaLaVistaBaby,
+ TalkToMyHand,
+}
+
+fn main() {
+ let x = Terminator::HastaLaVistaBaby;
+
+ match x { //~ ERROR E0004
+ Terminator::TalkToMyHand => {}
+ }
+}
diff --git a/src/test/ui/error-codes/E0004.stderr b/src/test/ui/error-codes/E0004.stderr
new file mode 100644
index 000000000..8ba151d9e
--- /dev/null
+++ b/src/test/ui/error-codes/E0004.stderr
@@ -0,0 +1,23 @@
+error[E0004]: non-exhaustive patterns: `HastaLaVistaBaby` not covered
+ --> $DIR/E0004.rs:9:11
+ |
+LL | match x {
+ | ^ pattern `HastaLaVistaBaby` not covered
+ |
+note: `Terminator` defined here
+ --> $DIR/E0004.rs:2:5
+ |
+LL | enum Terminator {
+ | ----------
+LL | HastaLaVistaBaby,
+ | ^^^^^^^^^^^^^^^^ not covered
+ = note: the matched value is of type `Terminator`
+help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
+ |
+LL ~ Terminator::TalkToMyHand => {}
+LL + HastaLaVistaBaby => todo!()
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/src/test/ui/error-codes/E0005.rs b/src/test/ui/error-codes/E0005.rs
new file mode 100644
index 000000000..f4730697e
--- /dev/null
+++ b/src/test/ui/error-codes/E0005.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let x = Some(1);
+ let Some(y) = x; //~ ERROR E0005
+}
diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr
new file mode 100644
index 000000000..f01a77bd3
--- /dev/null
+++ b/src/test/ui/error-codes/E0005.stderr
@@ -0,0 +1,29 @@
+error[E0005]: refutable pattern in local binding: `None` not covered
+ --> $DIR/E0005.rs:3:9
+ |
+LL | let Some(y) = x;
+ | ^^^^^^^ pattern `None` not covered
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+note: `Option<i32>` defined here
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
+ = note: the matched value is of type `Option<i32>`
+help: you might want to use `if let` to ignore the variant that isn't matched
+ |
+LL | let y = if let Some(y) = x { y } else { todo!() };
+ | ++++++++++ ++++++++++++++++++++++
+help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+ |
+LL | let Some(y) = x else { todo!() };
+ | ++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0005`.
diff --git a/src/test/ui/error-codes/E0010-teach.rs b/src/test/ui/error-codes/E0010-teach.rs
new file mode 100644
index 000000000..fc5dffb37
--- /dev/null
+++ b/src/test/ui/error-codes/E0010-teach.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Z teach
+
+#![feature(box_syntax)]
+#![allow(warnings)]
+
+const CON : Box<i32> = box 0; //~ ERROR E0010
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0010-teach.stderr b/src/test/ui/error-codes/E0010-teach.stderr
new file mode 100644
index 000000000..33de9fd68
--- /dev/null
+++ b/src/test/ui/error-codes/E0010-teach.stderr
@@ -0,0 +1,11 @@
+error[E0010]: allocations are not allowed in constants
+ --> $DIR/E0010-teach.rs:6:24
+ |
+LL | const CON : Box<i32> = box 0;
+ | ^^^^^ allocation not allowed in constants
+ |
+ = note: The value of statics and constants must be known at compile time, and they live for the entire lifetime of a program. Creating a boxed value allocates memory on the heap at runtime, and therefore cannot be done at compile time.
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0010`.
diff --git a/src/test/ui/error-codes/E0010.rs b/src/test/ui/error-codes/E0010.rs
new file mode 100644
index 000000000..e62997640
--- /dev/null
+++ b/src/test/ui/error-codes/E0010.rs
@@ -0,0 +1,6 @@
+#![feature(box_syntax)]
+#![allow(warnings)]
+
+const CON : Box<i32> = box 0; //~ ERROR E0010
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0010.stderr b/src/test/ui/error-codes/E0010.stderr
new file mode 100644
index 000000000..0042333b9
--- /dev/null
+++ b/src/test/ui/error-codes/E0010.stderr
@@ -0,0 +1,9 @@
+error[E0010]: allocations are not allowed in constants
+ --> $DIR/E0010.rs:4:24
+ |
+LL | const CON : Box<i32> = box 0;
+ | ^^^^^ allocation not allowed in constants
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0010`.
diff --git a/src/test/ui/error-codes/E0017.rs b/src/test/ui/error-codes/E0017.rs
new file mode 100644
index 000000000..c211ad1a2
--- /dev/null
+++ b/src/test/ui/error-codes/E0017.rs
@@ -0,0 +1,14 @@
+static X: i32 = 1;
+const C: i32 = 2;
+static mut M: i32 = 3;
+
+const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
+ //~| WARN taking a mutable
+static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0658
+ //~| ERROR cannot borrow
+ //~| ERROR mutable references are not allowed
+
+static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
+ //~| WARN taking a mutable
+static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; //~ ERROR mutable references are not
+fn main() {}
diff --git a/src/test/ui/error-codes/E0017.stderr b/src/test/ui/error-codes/E0017.stderr
new file mode 100644
index 000000000..830e4db34
--- /dev/null
+++ b/src/test/ui/error-codes/E0017.stderr
@@ -0,0 +1,72 @@
+warning: taking a mutable reference to a `const` item
+ --> $DIR/E0017.rs:5:30
+ |
+LL | const CR: &'static mut i32 = &mut C;
+ | ^^^^^^
+ |
+ = note: `#[warn(const_item_mutation)]` on by default
+ = note: each usage of a `const` item creates a new temporary
+ = note: the mutable reference will refer to this temporary, not the original `const` item
+note: `const` item defined here
+ --> $DIR/E0017.rs:2:1
+ |
+LL | const C: i32 = 2;
+ | ^^^^^^^^^^^^
+
+error[E0764]: mutable references are not allowed in the final value of constants
+ --> $DIR/E0017.rs:5:30
+ |
+LL | const CR: &'static mut i32 = &mut C;
+ | ^^^^^^
+
+error[E0658]: mutation through a reference is not allowed in statics
+ --> $DIR/E0017.rs:7:39
+ |
+LL | static STATIC_REF: &'static mut i32 = &mut X;
+ | ^^^^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0764]: mutable references are not allowed in the final value of statics
+ --> $DIR/E0017.rs:7:39
+ |
+LL | static STATIC_REF: &'static mut i32 = &mut X;
+ | ^^^^^^
+
+error[E0596]: cannot borrow immutable static item `X` as mutable
+ --> $DIR/E0017.rs:7:39
+ |
+LL | static STATIC_REF: &'static mut i32 = &mut X;
+ | ^^^^^^ cannot borrow as mutable
+
+warning: taking a mutable reference to a `const` item
+ --> $DIR/E0017.rs:11:38
+ |
+LL | static CONST_REF: &'static mut i32 = &mut C;
+ | ^^^^^^
+ |
+ = note: each usage of a `const` item creates a new temporary
+ = note: the mutable reference will refer to this temporary, not the original `const` item
+note: `const` item defined here
+ --> $DIR/E0017.rs:2:1
+ |
+LL | const C: i32 = 2;
+ | ^^^^^^^^^^^^
+
+error[E0764]: mutable references are not allowed in the final value of statics
+ --> $DIR/E0017.rs:11:38
+ |
+LL | static CONST_REF: &'static mut i32 = &mut C;
+ | ^^^^^^
+
+error[E0764]: mutable references are not allowed in the final value of statics
+ --> $DIR/E0017.rs:13:52
+ |
+LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
+ | ^^^^^^
+
+error: aborting due to 6 previous errors; 2 warnings emitted
+
+Some errors have detailed explanations: E0596, E0658, E0764.
+For more information about an error, try `rustc --explain E0596`.
diff --git a/src/test/ui/error-codes/E0023.rs b/src/test/ui/error-codes/E0023.rs
new file mode 100644
index 000000000..7ac22bb71
--- /dev/null
+++ b/src/test/ui/error-codes/E0023.rs
@@ -0,0 +1,17 @@
+enum Fruit {
+ Apple(String, String),
+ Pear(u32),
+ Orange((String, String)),
+ Banana(()),
+}
+
+fn main() {
+ let x = Fruit::Apple(String::new(), String::new());
+ match x {
+ Fruit::Apple(a) => {}, //~ ERROR E0023
+ Fruit::Apple(a, b, c) => {}, //~ ERROR E0023
+ Fruit::Pear(1, 2) => {}, //~ ERROR E0023
+ Fruit::Orange(a, b) => {}, //~ ERROR E0023
+ Fruit::Banana() => {}, //~ ERROR E0023
+ }
+}
diff --git a/src/test/ui/error-codes/E0023.stderr b/src/test/ui/error-codes/E0023.stderr
new file mode 100644
index 000000000..3e321b037
--- /dev/null
+++ b/src/test/ui/error-codes/E0023.stderr
@@ -0,0 +1,63 @@
+error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
+ --> $DIR/E0023.rs:11:22
+ |
+LL | Apple(String, String),
+ | ------ ------ tuple variant has 2 fields
+...
+LL | Fruit::Apple(a) => {},
+ | ^ expected 2 fields, found 1
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | Fruit::Apple(a, _) => {},
+ | +++
+
+error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
+ --> $DIR/E0023.rs:12:22
+ |
+LL | Apple(String, String),
+ | ------ ------ tuple variant has 2 fields
+...
+LL | Fruit::Apple(a, b, c) => {},
+ | ^ ^ ^ expected 2 fields, found 3
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
+ --> $DIR/E0023.rs:13:21
+ |
+LL | Pear(u32),
+ | --- tuple variant has 1 field
+...
+LL | Fruit::Pear(1, 2) => {},
+ | ^ ^ expected 1 field, found 2
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
+ --> $DIR/E0023.rs:14:23
+ |
+LL | Orange((String, String)),
+ | ---------------- tuple variant has 1 field
+...
+LL | Fruit::Orange(a, b) => {},
+ | ^ ^ expected 1 field, found 2
+ |
+help: missing parentheses
+ |
+LL | Fruit::Orange((a, b)) => {},
+ | + +
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 1 field
+ --> $DIR/E0023.rs:15:9
+ |
+LL | Banana(()),
+ | -- tuple variant has 1 field
+...
+LL | Fruit::Banana() => {},
+ | ^^^^^^^^^^^^^^^ expected 1 field, found 0
+ |
+help: missing parentheses
+ |
+LL | Fruit::Banana(()) => {},
+ | + +
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0023`.
diff --git a/src/test/ui/error-codes/E0025.rs b/src/test/ui/error-codes/E0025.rs
new file mode 100644
index 000000000..549269a75
--- /dev/null
+++ b/src/test/ui/error-codes/E0025.rs
@@ -0,0 +1,10 @@
+struct Foo {
+ a: u8,
+ b: u8,
+}
+
+fn main() {
+ let x = Foo { a:1, b:2 };
+ let Foo { a: x, a: y, b: 0 } = x;
+ //~^ ERROR field `a` bound multiple times in the pattern
+}
diff --git a/src/test/ui/error-codes/E0025.stderr b/src/test/ui/error-codes/E0025.stderr
new file mode 100644
index 000000000..dfec6d027
--- /dev/null
+++ b/src/test/ui/error-codes/E0025.stderr
@@ -0,0 +1,11 @@
+error[E0025]: field `a` bound multiple times in the pattern
+ --> $DIR/E0025.rs:8:21
+ |
+LL | let Foo { a: x, a: y, b: 0 } = x;
+ | ---- ^^^^ multiple uses of `a` in pattern
+ | |
+ | first use of `a`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0025`.
diff --git a/src/test/ui/error-codes/E0026-teach.rs b/src/test/ui/error-codes/E0026-teach.rs
new file mode 100644
index 000000000..7c51004ff
--- /dev/null
+++ b/src/test/ui/error-codes/E0026-teach.rs
@@ -0,0 +1,14 @@
+// compile-flags: -Z teach
+
+struct Thing {
+ x: u32,
+ y: u32
+}
+
+fn main() {
+ let thing = Thing { x: 0, y: 0 };
+ match thing {
+ Thing { x, y, z } => {}
+ //~^ ERROR struct `Thing` does not have a field named `z` [E0026]
+ }
+}
diff --git a/src/test/ui/error-codes/E0026-teach.stderr b/src/test/ui/error-codes/E0026-teach.stderr
new file mode 100644
index 000000000..1a80edcbb
--- /dev/null
+++ b/src/test/ui/error-codes/E0026-teach.stderr
@@ -0,0 +1,13 @@
+error[E0026]: struct `Thing` does not have a field named `z`
+ --> $DIR/E0026-teach.rs:11:23
+ |
+LL | Thing { x, y, z } => {}
+ | ^ struct `Thing` does not have this field
+ |
+ = note: This error indicates that a struct pattern attempted to extract a non-existent field from a struct. Struct fields are identified by the name used before the colon : so struct patterns should resemble the declaration of the struct type being matched.
+
+ If you are using shorthand field patterns but want to refer to the struct field by a different name, you should rename it explicitly.
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0026`.
diff --git a/src/test/ui/error-codes/E0026.rs b/src/test/ui/error-codes/E0026.rs
new file mode 100644
index 000000000..0b1ea1c7b
--- /dev/null
+++ b/src/test/ui/error-codes/E0026.rs
@@ -0,0 +1,12 @@
+struct Thing {
+ x: u32,
+ y: u32
+}
+
+fn main() {
+ let thing = Thing { x: 0, y: 0 };
+ match thing {
+ Thing { x, y, z } => {}
+ //~^ ERROR struct `Thing` does not have a field named `z` [E0026]
+ }
+}
diff --git a/src/test/ui/error-codes/E0026.stderr b/src/test/ui/error-codes/E0026.stderr
new file mode 100644
index 000000000..031481812
--- /dev/null
+++ b/src/test/ui/error-codes/E0026.stderr
@@ -0,0 +1,9 @@
+error[E0026]: struct `Thing` does not have a field named `z`
+ --> $DIR/E0026.rs:9:23
+ |
+LL | Thing { x, y, z } => {}
+ | ^ struct `Thing` does not have this field
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0026`.
diff --git a/src/test/ui/error-codes/E0027.rs b/src/test/ui/error-codes/E0027.rs
new file mode 100644
index 000000000..e7eca1ce5
--- /dev/null
+++ b/src/test/ui/error-codes/E0027.rs
@@ -0,0 +1,24 @@
+struct Dog {
+ name: String,
+ age: u32,
+}
+
+
+fn main() {
+ let d = Dog { name: "Rusty".to_string(), age: 8 };
+
+ match d {
+ Dog { age: x } => {} //~ ERROR pattern does not mention field `name`
+ }
+ match d {
+ // trailing comma
+ Dog { name: x, } => {} //~ ERROR pattern does not mention field `age`
+ }
+ match d {
+ // trailing comma with weird whitespace
+ Dog { name: x , } => {} //~ ERROR pattern does not mention field `age`
+ }
+ match d {
+ Dog {} => {} //~ ERROR pattern does not mention fields `name`, `age`
+ }
+}
diff --git a/src/test/ui/error-codes/E0027.stderr b/src/test/ui/error-codes/E0027.stderr
new file mode 100644
index 000000000..9ae97e4a9
--- /dev/null
+++ b/src/test/ui/error-codes/E0027.stderr
@@ -0,0 +1,63 @@
+error[E0027]: pattern does not mention field `name`
+ --> $DIR/E0027.rs:11:9
+ |
+LL | Dog { age: x } => {}
+ | ^^^^^^^^^^^^^^ missing field `name`
+ |
+help: include the missing field in the pattern
+ |
+LL | Dog { age: x, name } => {}
+ | ~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | Dog { age: x, .. } => {}
+ | ~~~~~~
+
+error[E0027]: pattern does not mention field `age`
+ --> $DIR/E0027.rs:15:9
+ |
+LL | Dog { name: x, } => {}
+ | ^^^^^^^^^^^^^^^^ missing field `age`
+ |
+help: include the missing field in the pattern
+ |
+LL | Dog { name: x, age } => {}
+ | ~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | Dog { name: x, .. } => {}
+ | ~~~~~~
+
+error[E0027]: pattern does not mention field `age`
+ --> $DIR/E0027.rs:19:9
+ |
+LL | Dog { name: x , } => {}
+ | ^^^^^^^^^^^^^^^^^^ missing field `age`
+ |
+help: include the missing field in the pattern
+ |
+LL | Dog { name: x, age } => {}
+ | ~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | Dog { name: x, .. } => {}
+ | ~~~~~~
+
+error[E0027]: pattern does not mention fields `name`, `age`
+ --> $DIR/E0027.rs:22:9
+ |
+LL | Dog {} => {}
+ | ^^^^^^ missing fields `name`, `age`
+ |
+help: include the missing fields in the pattern
+ |
+LL | Dog { name, age } => {}
+ | ~~~~~~~~~~~~~
+help: if you don't care about these missing fields, you can explicitly ignore them
+ |
+LL | Dog { .. } => {}
+ | ~~~~~~
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0027`.
diff --git a/src/test/ui/error-codes/E0029-teach.rs b/src/test/ui/error-codes/E0029-teach.rs
new file mode 100644
index 000000000..3ff8cb348
--- /dev/null
+++ b/src/test/ui/error-codes/E0029-teach.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Z teach
+
+fn main() {
+ let s = "hoho";
+
+ match s {
+ "hello" ..= "world" => {}
+ //~^ ERROR only `char` and numeric types are allowed in range patterns
+ _ => {}
+ }
+}
diff --git a/src/test/ui/error-codes/E0029-teach.stderr b/src/test/ui/error-codes/E0029-teach.stderr
new file mode 100644
index 000000000..b89b2e7d1
--- /dev/null
+++ b/src/test/ui/error-codes/E0029-teach.stderr
@@ -0,0 +1,14 @@
+error[E0029]: only `char` and numeric types are allowed in range patterns
+ --> $DIR/E0029-teach.rs:7:9
+ |
+LL | "hello" ..= "world" => {}
+ | -------^^^^^-------
+ | | |
+ | | this is of type `&'static str` but it should be `char` or numeric
+ | this is of type `&'static str` but it should be `char` or numeric
+ |
+ = note: In a match expression, only numbers and characters can be matched against a range. This is because the compiler checks that the range is non-empty at compile-time, and is unable to evaluate arbitrary comparison functions. If you want to capture values of an orderable type between two end-points, you can use a guard.
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0029`.
diff --git a/src/test/ui/error-codes/E0029.rs b/src/test/ui/error-codes/E0029.rs
new file mode 100644
index 000000000..d9b53e113
--- /dev/null
+++ b/src/test/ui/error-codes/E0029.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let s = "hoho";
+
+ match s {
+ "hello" ..= "world" => {}
+ //~^ ERROR only `char` and numeric types are allowed in range patterns
+ _ => {}
+ }
+}
diff --git a/src/test/ui/error-codes/E0029.stderr b/src/test/ui/error-codes/E0029.stderr
new file mode 100644
index 000000000..f7250b39d
--- /dev/null
+++ b/src/test/ui/error-codes/E0029.stderr
@@ -0,0 +1,12 @@
+error[E0029]: only `char` and numeric types are allowed in range patterns
+ --> $DIR/E0029.rs:5:9
+ |
+LL | "hello" ..= "world" => {}
+ | -------^^^^^-------
+ | | |
+ | | this is of type `&'static str` but it should be `char` or numeric
+ | this is of type `&'static str` but it should be `char` or numeric
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0029`.
diff --git a/src/test/ui/error-codes/E0030-teach.rs b/src/test/ui/error-codes/E0030-teach.rs
new file mode 100644
index 000000000..8caa4f093
--- /dev/null
+++ b/src/test/ui/error-codes/E0030-teach.rs
@@ -0,0 +1,9 @@
+// compile-flags: -Z teach
+
+fn main() {
+ match 5u32 {
+ 1000 ..= 5 => {}
+ //~^ ERROR lower range bound must be less than or equal to upper
+ //~| ERROR lower range bound must be less than or equal to upper
+ }
+}
diff --git a/src/test/ui/error-codes/E0030-teach.stderr b/src/test/ui/error-codes/E0030-teach.stderr
new file mode 100644
index 000000000..800f66416
--- /dev/null
+++ b/src/test/ui/error-codes/E0030-teach.stderr
@@ -0,0 +1,17 @@
+error[E0030]: lower range bound must be less than or equal to upper
+ --> $DIR/E0030-teach.rs:5:9
+ |
+LL | 1000 ..= 5 => {}
+ | ^^^^ lower bound larger than upper bound
+ |
+ = note: When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range.
+
+error[E0030]: lower range bound must be less than or equal to upper
+ --> $DIR/E0030-teach.rs:5:9
+ |
+LL | 1000 ..= 5 => {}
+ | ^^^^ lower bound larger than upper bound
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0030`.
diff --git a/src/test/ui/error-codes/E0030.rs b/src/test/ui/error-codes/E0030.rs
new file mode 100644
index 000000000..a5d8f8726
--- /dev/null
+++ b/src/test/ui/error-codes/E0030.rs
@@ -0,0 +1,7 @@
+fn main() {
+ match 5u32 {
+ 1000 ..= 5 => {}
+ //~^ ERROR lower range bound must be less than or equal to upper
+ //~| ERROR lower range bound must be less than or equal to upper
+ }
+}
diff --git a/src/test/ui/error-codes/E0030.stderr b/src/test/ui/error-codes/E0030.stderr
new file mode 100644
index 000000000..8a6114024
--- /dev/null
+++ b/src/test/ui/error-codes/E0030.stderr
@@ -0,0 +1,15 @@
+error[E0030]: lower range bound must be less than or equal to upper
+ --> $DIR/E0030.rs:3:9
+ |
+LL | 1000 ..= 5 => {}
+ | ^^^^ lower bound larger than upper bound
+
+error[E0030]: lower range bound must be less than or equal to upper
+ --> $DIR/E0030.rs:3:9
+ |
+LL | 1000 ..= 5 => {}
+ | ^^^^ lower bound larger than upper bound
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0030`.
diff --git a/src/test/ui/error-codes/E0033-teach.rs b/src/test/ui/error-codes/E0033-teach.rs
new file mode 100644
index 000000000..194396513
--- /dev/null
+++ b/src/test/ui/error-codes/E0033-teach.rs
@@ -0,0 +1,14 @@
+// compile-flags: -Z teach
+
+trait SomeTrait {
+ fn foo(); //~ associated function `foo` has no `self` parameter
+}
+
+fn main() {
+ let trait_obj: &dyn SomeTrait = SomeTrait;
+ //~^ ERROR expected value, found trait `SomeTrait`
+ //~| ERROR E0038
+
+ let &invalid = trait_obj;
+ //~^ ERROR E0033
+}
diff --git a/src/test/ui/error-codes/E0033-teach.stderr b/src/test/ui/error-codes/E0033-teach.stderr
new file mode 100644
index 000000000..3b68abbb4
--- /dev/null
+++ b/src/test/ui/error-codes/E0033-teach.stderr
@@ -0,0 +1,42 @@
+error[E0423]: expected value, found trait `SomeTrait`
+ --> $DIR/E0033-teach.rs:8:37
+ |
+LL | let trait_obj: &dyn SomeTrait = SomeTrait;
+ | ^^^^^^^^^ not a value
+
+error[E0038]: the trait `SomeTrait` cannot be made into an object
+ --> $DIR/E0033-teach.rs:8:20
+ |
+LL | let trait_obj: &dyn SomeTrait = SomeTrait;
+ | ^^^^^^^^^^^^^^ `SomeTrait` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/E0033-teach.rs:4:8
+ |
+LL | trait SomeTrait {
+ | --------- this trait cannot be made into an object...
+LL | fn foo();
+ | ^^^ ...because associated function `foo` has no `self` parameter
+help: consider turning `foo` into a method by giving it a `&self` argument
+ |
+LL | fn foo(&self);
+ | +++++
+help: alternatively, consider constraining `foo` so it does not apply to trait objects
+ |
+LL | fn foo() where Self: Sized;
+ | +++++++++++++++++
+
+error[E0033]: type `&dyn SomeTrait` cannot be dereferenced
+ --> $DIR/E0033-teach.rs:12:9
+ |
+LL | let &invalid = trait_obj;
+ | ^^^^^^^^ type `&dyn SomeTrait` cannot be dereferenced
+ |
+ = note: This error indicates that a pointer to a trait type cannot be implicitly dereferenced by a pattern. Every trait defines a type, but because the size of trait implementors isn't fixed, this type has no compile-time size. Therefore, all accesses to trait types must be through pointers. If you encounter this error you should try to avoid dereferencing the pointer.
+
+ You can read more about trait objects in the Trait Objects section of the Reference: https://doc.rust-lang.org/reference/types.html#trait-objects
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0033, E0038, E0423.
+For more information about an error, try `rustc --explain E0033`.
diff --git a/src/test/ui/error-codes/E0033.rs b/src/test/ui/error-codes/E0033.rs
new file mode 100644
index 000000000..e5f0530f4
--- /dev/null
+++ b/src/test/ui/error-codes/E0033.rs
@@ -0,0 +1,12 @@
+trait SomeTrait {
+ fn foo(); //~ associated function `foo` has no `self` parameter
+}
+
+fn main() {
+ let trait_obj: &dyn SomeTrait = SomeTrait;
+ //~^ ERROR expected value, found trait `SomeTrait`
+ //~| ERROR E0038
+
+ let &invalid = trait_obj;
+ //~^ ERROR E0033
+}
diff --git a/src/test/ui/error-codes/E0033.stderr b/src/test/ui/error-codes/E0033.stderr
new file mode 100644
index 000000000..f06451078
--- /dev/null
+++ b/src/test/ui/error-codes/E0033.stderr
@@ -0,0 +1,38 @@
+error[E0423]: expected value, found trait `SomeTrait`
+ --> $DIR/E0033.rs:6:37
+ |
+LL | let trait_obj: &dyn SomeTrait = SomeTrait;
+ | ^^^^^^^^^ not a value
+
+error[E0038]: the trait `SomeTrait` cannot be made into an object
+ --> $DIR/E0033.rs:6:20
+ |
+LL | let trait_obj: &dyn SomeTrait = SomeTrait;
+ | ^^^^^^^^^^^^^^ `SomeTrait` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/E0033.rs:2:8
+ |
+LL | trait SomeTrait {
+ | --------- this trait cannot be made into an object...
+LL | fn foo();
+ | ^^^ ...because associated function `foo` has no `self` parameter
+help: consider turning `foo` into a method by giving it a `&self` argument
+ |
+LL | fn foo(&self);
+ | +++++
+help: alternatively, consider constraining `foo` so it does not apply to trait objects
+ |
+LL | fn foo() where Self: Sized;
+ | +++++++++++++++++
+
+error[E0033]: type `&dyn SomeTrait` cannot be dereferenced
+ --> $DIR/E0033.rs:10:9
+ |
+LL | let &invalid = trait_obj;
+ | ^^^^^^^^ type `&dyn SomeTrait` cannot be dereferenced
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0033, E0038, E0423.
+For more information about an error, try `rustc --explain E0033`.
diff --git a/src/test/ui/error-codes/E0034.rs b/src/test/ui/error-codes/E0034.rs
new file mode 100644
index 000000000..f962da115
--- /dev/null
+++ b/src/test/ui/error-codes/E0034.rs
@@ -0,0 +1,21 @@
+struct Test;
+
+trait Trait1 {
+ fn foo();
+}
+
+trait Trait2 {
+ fn foo();
+}
+
+impl Trait1 for Test {
+ fn foo() {}
+}
+
+impl Trait2 for Test {
+ fn foo() {}
+}
+
+fn main() {
+ Test::foo() //~ ERROR multiple applicable items in scope
+}
diff --git a/src/test/ui/error-codes/E0034.stderr b/src/test/ui/error-codes/E0034.stderr
new file mode 100644
index 000000000..e29621702
--- /dev/null
+++ b/src/test/ui/error-codes/E0034.stderr
@@ -0,0 +1,28 @@
+error[E0034]: multiple applicable items in scope
+ --> $DIR/E0034.rs:20:11
+ |
+LL | Test::foo()
+ | ^^^ multiple `foo` found
+ |
+note: candidate #1 is defined in an impl of the trait `Trait1` for the type `Test`
+ --> $DIR/E0034.rs:12:5
+ |
+LL | fn foo() {}
+ | ^^^^^^^^
+note: candidate #2 is defined in an impl of the trait `Trait2` for the type `Test`
+ --> $DIR/E0034.rs:16:5
+ |
+LL | fn foo() {}
+ | ^^^^^^^^
+help: disambiguate the associated function for candidate #1
+ |
+LL | <Test as Trait1>::foo()
+ | ~~~~~~~~~~~~~~~~~~
+help: disambiguate the associated function for candidate #2
+ |
+LL | <Test as Trait2>::foo()
+ | ~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0034`.
diff --git a/src/test/ui/error-codes/E0038.rs b/src/test/ui/error-codes/E0038.rs
new file mode 100644
index 000000000..9757e2ab1
--- /dev/null
+++ b/src/test/ui/error-codes/E0038.rs
@@ -0,0 +1,11 @@
+trait Trait {
+ fn foo(&self) -> Self;
+}
+
+fn call_foo(x: Box<dyn Trait>) {
+ //~^ ERROR E0038
+ let y = x.foo();
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0038.stderr b/src/test/ui/error-codes/E0038.stderr
new file mode 100644
index 000000000..3773d6f52
--- /dev/null
+++ b/src/test/ui/error-codes/E0038.stderr
@@ -0,0 +1,18 @@
+error[E0038]: the trait `Trait` cannot be made into an object
+ --> $DIR/E0038.rs:5:20
+ |
+LL | fn call_foo(x: Box<dyn Trait>) {
+ | ^^^^^^^^^ `Trait` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/E0038.rs:2:22
+ |
+LL | trait Trait {
+ | ----- this trait cannot be made into an object...
+LL | fn foo(&self) -> Self;
+ | ^^^^ ...because method `foo` references the `Self` type in its return type
+ = help: consider moving `foo` to another trait
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/error-codes/E0040.fixed b/src/test/ui/error-codes/E0040.fixed
new file mode 100644
index 000000000..139dc8f94
--- /dev/null
+++ b/src/test/ui/error-codes/E0040.fixed
@@ -0,0 +1,18 @@
+// run-rustfix
+struct Foo {
+ x: i32,
+}
+
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("kaboom");
+ }
+}
+
+fn main() {
+ let mut x = Foo { x: -7 };
+ x.x = 0;
+ println!("{}", x.x);
+ drop(x);
+ //~^ ERROR E0040
+}
diff --git a/src/test/ui/error-codes/E0040.rs b/src/test/ui/error-codes/E0040.rs
new file mode 100644
index 000000000..9ffc42d0c
--- /dev/null
+++ b/src/test/ui/error-codes/E0040.rs
@@ -0,0 +1,18 @@
+// run-rustfix
+struct Foo {
+ x: i32,
+}
+
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("kaboom");
+ }
+}
+
+fn main() {
+ let mut x = Foo { x: -7 };
+ x.x = 0;
+ println!("{}", x.x);
+ x.drop();
+ //~^ ERROR E0040
+}
diff --git a/src/test/ui/error-codes/E0040.stderr b/src/test/ui/error-codes/E0040.stderr
new file mode 100644
index 000000000..9fcda1a93
--- /dev/null
+++ b/src/test/ui/error-codes/E0040.stderr
@@ -0,0 +1,12 @@
+error[E0040]: explicit use of destructor method
+ --> $DIR/E0040.rs:16:7
+ |
+LL | x.drop();
+ | --^^^^--
+ | | |
+ | | explicit destructor calls not allowed
+ | help: consider using `drop` function: `drop(x)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0040`.
diff --git a/src/test/ui/error-codes/E0044.rs b/src/test/ui/error-codes/E0044.rs
new file mode 100644
index 000000000..d9cdaf83c
--- /dev/null
+++ b/src/test/ui/error-codes/E0044.rs
@@ -0,0 +1,8 @@
+extern "C" {
+ fn sqrt<T>(f: T) -> T;
+//~^ ERROR foreign items may not have type parameters [E0044]
+//~| HELP replace the type parameters with concrete types
+//~| NOTE can't have type parameters
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0044.stderr b/src/test/ui/error-codes/E0044.stderr
new file mode 100644
index 000000000..e889c167b
--- /dev/null
+++ b/src/test/ui/error-codes/E0044.stderr
@@ -0,0 +1,11 @@
+error[E0044]: foreign items may not have type parameters
+ --> $DIR/E0044.rs:2:5
+ |
+LL | fn sqrt<T>(f: T) -> T;
+ | ^^^^^^^^^^^^^^^^^^^^^^ can't have type parameters
+ |
+ = help: replace the type parameters with concrete types like `u32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0044`.
diff --git a/src/test/ui/error-codes/E0045.rs b/src/test/ui/error-codes/E0045.rs
new file mode 100644
index 000000000..fb3df56f7
--- /dev/null
+++ b/src/test/ui/error-codes/E0045.rs
@@ -0,0 +1,4 @@
+extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0045.stderr b/src/test/ui/error-codes/E0045.stderr
new file mode 100644
index 000000000..d163128bc
--- /dev/null
+++ b/src/test/ui/error-codes/E0045.stderr
@@ -0,0 +1,9 @@
+error[E0045]: C-variadic function must have C or cdecl calling convention
+ --> $DIR/E0045.rs:1:17
+ |
+LL | extern "Rust" { fn foo(x: u8, ...); }
+ | ^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0045`.
diff --git a/src/test/ui/error-codes/E0049.rs b/src/test/ui/error-codes/E0049.rs
new file mode 100644
index 000000000..3dd910019
--- /dev/null
+++ b/src/test/ui/error-codes/E0049.rs
@@ -0,0 +1,22 @@
+trait Foo {
+ fn foo<T: Default>(x: T) -> Self;
+}
+
+struct Bar;
+
+impl Foo for Bar {
+ fn foo(x: bool) -> Self { Bar } //~ ERROR E0049
+}
+
+trait Fuzz {
+ fn fuzz<A: Default, B>(x: A, y: B) -> Self;
+}
+
+struct Baz;
+
+impl Fuzz for Baz {
+ fn fuzz(x: bool, y: bool) -> Self { Baz } //~ ERROR E0049
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0049.stderr b/src/test/ui/error-codes/E0049.stderr
new file mode 100644
index 000000000..c0cd31faa
--- /dev/null
+++ b/src/test/ui/error-codes/E0049.stderr
@@ -0,0 +1,23 @@
+error[E0049]: method `foo` has 0 type parameters but its trait declaration has 1 type parameter
+ --> $DIR/E0049.rs:8:11
+ |
+LL | fn foo<T: Default>(x: T) -> Self;
+ | - expected 1 type parameter
+...
+LL | fn foo(x: bool) -> Self { Bar }
+ | ^ found 0 type parameters
+
+error[E0049]: method `fuzz` has 0 type parameters but its trait declaration has 2 type parameters
+ --> $DIR/E0049.rs:18:12
+ |
+LL | fn fuzz<A: Default, B>(x: A, y: B) -> Self;
+ | - -
+ | |
+ | expected 2 type parameters
+...
+LL | fn fuzz(x: bool, y: bool) -> Self { Baz }
+ | ^ found 0 type parameters
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0049`.
diff --git a/src/test/ui/error-codes/E0050.rs b/src/test/ui/error-codes/E0050.rs
new file mode 100644
index 000000000..98fb62785
--- /dev/null
+++ b/src/test/ui/error-codes/E0050.rs
@@ -0,0 +1,16 @@
+trait Foo {
+ fn foo(&self, x: u8) -> bool;
+ fn bar(&self, x: u8, y: u8, z: u8);
+ fn less(&self);
+}
+
+struct Bar;
+
+impl Foo for Bar {
+ fn foo(&self) -> bool { true } //~ ERROR E0050
+ fn bar(&self) { } //~ ERROR E0050
+ fn less(&self, x: u8, y: u8, z: u8) { } //~ ERROR E0050
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0050.stderr b/src/test/ui/error-codes/E0050.stderr
new file mode 100644
index 000000000..fe9ac5e8e
--- /dev/null
+++ b/src/test/ui/error-codes/E0050.stderr
@@ -0,0 +1,30 @@
+error[E0050]: method `foo` has 1 parameter but the declaration in trait `Foo::foo` has 2
+ --> $DIR/E0050.rs:10:12
+ |
+LL | fn foo(&self, x: u8) -> bool;
+ | ------------ trait requires 2 parameters
+...
+LL | fn foo(&self) -> bool { true }
+ | ^^^^^ expected 2 parameters, found 1
+
+error[E0050]: method `bar` has 1 parameter but the declaration in trait `Foo::bar` has 4
+ --> $DIR/E0050.rs:11:12
+ |
+LL | fn bar(&self, x: u8, y: u8, z: u8);
+ | -------------------------- trait requires 4 parameters
+...
+LL | fn bar(&self) { }
+ | ^^^^^ expected 4 parameters, found 1
+
+error[E0050]: method `less` has 4 parameters but the declaration in trait `Foo::less` has 1
+ --> $DIR/E0050.rs:12:13
+ |
+LL | fn less(&self);
+ | ----- trait requires 1 parameter
+...
+LL | fn less(&self, x: u8, y: u8, z: u8) { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 parameter, found 4
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0050`.
diff --git a/src/test/ui/error-codes/E0054.rs b/src/test/ui/error-codes/E0054.rs
new file mode 100644
index 000000000..55bda4ead
--- /dev/null
+++ b/src/test/ui/error-codes/E0054.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let x = 5;
+ let x_is_nonzero = x as bool; //~ ERROR E0054
+}
diff --git a/src/test/ui/error-codes/E0054.stderr b/src/test/ui/error-codes/E0054.stderr
new file mode 100644
index 000000000..6b1092760
--- /dev/null
+++ b/src/test/ui/error-codes/E0054.stderr
@@ -0,0 +1,9 @@
+error[E0054]: cannot cast as `bool`
+ --> $DIR/E0054.rs:3:24
+ |
+LL | let x_is_nonzero = x as bool;
+ | ^^^^^^^^^ help: compare with zero instead: `x != 0`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0054`.
diff --git a/src/test/ui/error-codes/E0055.rs b/src/test/ui/error-codes/E0055.rs
new file mode 100644
index 000000000..fd5804bbc
--- /dev/null
+++ b/src/test/ui/error-codes/E0055.rs
@@ -0,0 +1,13 @@
+#![recursion_limit="4"]
+struct Foo;
+
+impl Foo {
+ fn foo(&self) {}
+}
+
+fn main() {
+ let foo = Foo;
+ let ref_foo = &&&&&Foo;
+ ref_foo.foo();
+ //~^ ERROR E0055
+}
diff --git a/src/test/ui/error-codes/E0055.stderr b/src/test/ui/error-codes/E0055.stderr
new file mode 100644
index 000000000..a52c90962
--- /dev/null
+++ b/src/test/ui/error-codes/E0055.stderr
@@ -0,0 +1,11 @@
+error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
+ --> $DIR/E0055.rs:11:13
+ |
+LL | ref_foo.foo();
+ | ^^^ deref recursion limit reached
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`E0055`)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0055`.
diff --git a/src/test/ui/error-codes/E0057.rs b/src/test/ui/error-codes/E0057.rs
new file mode 100644
index 000000000..83f941f65
--- /dev/null
+++ b/src/test/ui/error-codes/E0057.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let f = |x| x * 3;
+ let a = f(); //~ ERROR E0057
+ let b = f(4);
+ let c = f(2, 3); //~ ERROR E0057
+}
diff --git a/src/test/ui/error-codes/E0057.stderr b/src/test/ui/error-codes/E0057.stderr
new file mode 100644
index 000000000..2307f52c9
--- /dev/null
+++ b/src/test/ui/error-codes/E0057.stderr
@@ -0,0 +1,35 @@
+error[E0057]: this function takes 1 argument but 0 arguments were supplied
+ --> $DIR/E0057.rs:3:13
+ |
+LL | let a = f();
+ | ^-- an argument is missing
+ |
+note: closure defined here
+ --> $DIR/E0057.rs:2:13
+ |
+LL | let f = |x| x * 3;
+ | ^^^
+help: provide the argument
+ |
+LL | let a = f(/* value */);
+ | ~~~~~~~~~~~~~~
+
+error[E0057]: this function takes 1 argument but 2 arguments were supplied
+ --> $DIR/E0057.rs:5:13
+ |
+LL | let c = f(2, 3);
+ | ^ - argument of type `{integer}` unexpected
+ |
+note: closure defined here
+ --> $DIR/E0057.rs:2:13
+ |
+LL | let f = |x| x * 3;
+ | ^^^
+help: remove the extra argument
+ |
+LL | let c = f(2);
+ | ~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0057`.
diff --git a/src/test/ui/error-codes/E0059.rs b/src/test/ui/error-codes/E0059.rs
new file mode 100644
index 000000000..f775089bf
--- /dev/null
+++ b/src/test/ui/error-codes/E0059.rs
@@ -0,0 +1,6 @@
+#![feature(unboxed_closures)]
+
+fn foo<F: Fn<i32>>(f: F) -> F::Output { f(3) } //~ ERROR E0059
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0059.stderr b/src/test/ui/error-codes/E0059.stderr
new file mode 100644
index 000000000..a1b8aeaed
--- /dev/null
+++ b/src/test/ui/error-codes/E0059.stderr
@@ -0,0 +1,9 @@
+error[E0059]: cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit
+ --> $DIR/E0059.rs:3:41
+ |
+LL | fn foo<F: Fn<i32>>(f: F) -> F::Output { f(3) }
+ | ^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0059`.
diff --git a/src/test/ui/error-codes/E0060.rs b/src/test/ui/error-codes/E0060.rs
new file mode 100644
index 000000000..7050a1dff
--- /dev/null
+++ b/src/test/ui/error-codes/E0060.rs
@@ -0,0 +1,8 @@
+extern "C" {
+ fn printf(_: *const u8, ...) -> u32;
+}
+
+fn main() {
+ unsafe { printf(); }
+ //~^ ERROR E0060
+}
diff --git a/src/test/ui/error-codes/E0060.stderr b/src/test/ui/error-codes/E0060.stderr
new file mode 100644
index 000000000..644fd5983
--- /dev/null
+++ b/src/test/ui/error-codes/E0060.stderr
@@ -0,0 +1,19 @@
+error[E0060]: this function takes at least 1 argument but 0 arguments were supplied
+ --> $DIR/E0060.rs:6:14
+ |
+LL | unsafe { printf(); }
+ | ^^^^^^-- an argument of type `*const u8` is missing
+ |
+note: function defined here
+ --> $DIR/E0060.rs:2:8
+ |
+LL | fn printf(_: *const u8, ...) -> u32;
+ | ^^^^^^
+help: provide the argument
+ |
+LL | unsafe { printf(/* *const u8 */); }
+ | ~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0060`.
diff --git a/src/test/ui/error-codes/E0061.rs b/src/test/ui/error-codes/E0061.rs
new file mode 100644
index 000000000..b6fae6c63
--- /dev/null
+++ b/src/test/ui/error-codes/E0061.rs
@@ -0,0 +1,11 @@
+fn f(a: u16, b: &str) {}
+
+fn f2(a: u16) {}
+
+fn main() {
+ f(0);
+ //~^ ERROR E0061
+
+ f2();
+ //~^ ERROR E0061
+}
diff --git a/src/test/ui/error-codes/E0061.stderr b/src/test/ui/error-codes/E0061.stderr
new file mode 100644
index 000000000..fa55db092
--- /dev/null
+++ b/src/test/ui/error-codes/E0061.stderr
@@ -0,0 +1,35 @@
+error[E0061]: this function takes 2 arguments but 1 argument was supplied
+ --> $DIR/E0061.rs:6:5
+ |
+LL | f(0);
+ | ^--- an argument of type `&str` is missing
+ |
+note: function defined here
+ --> $DIR/E0061.rs:1:4
+ |
+LL | fn f(a: u16, b: &str) {}
+ | ^ ------ -------
+help: provide the argument
+ |
+LL | f(0, /* &str */);
+ | ~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 1 argument but 0 arguments were supplied
+ --> $DIR/E0061.rs:9:5
+ |
+LL | f2();
+ | ^^-- an argument of type `u16` is missing
+ |
+note: function defined here
+ --> $DIR/E0061.rs:3:4
+ |
+LL | fn f2(a: u16) {}
+ | ^^ ------
+help: provide the argument
+ |
+LL | f2(/* u16 */);
+ | ~~~~~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/error-codes/E0062.rs b/src/test/ui/error-codes/E0062.rs
new file mode 100644
index 000000000..3b7f88750
--- /dev/null
+++ b/src/test/ui/error-codes/E0062.rs
@@ -0,0 +1,11 @@
+struct Foo {
+ x: i32
+}
+
+fn main() {
+ let x = Foo {
+ x: 0,
+ x: 0,
+ //~^ ERROR E0062
+ };
+}
diff --git a/src/test/ui/error-codes/E0062.stderr b/src/test/ui/error-codes/E0062.stderr
new file mode 100644
index 000000000..a3e140995
--- /dev/null
+++ b/src/test/ui/error-codes/E0062.stderr
@@ -0,0 +1,11 @@
+error[E0062]: field `x` specified more than once
+ --> $DIR/E0062.rs:8:9
+ |
+LL | x: 0,
+ | ---- first use of `x`
+LL | x: 0,
+ | ^ used more than once
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0062`.
diff --git a/src/test/ui/error-codes/E0063.rs b/src/test/ui/error-codes/E0063.rs
new file mode 100644
index 000000000..48c9c13f0
--- /dev/null
+++ b/src/test/ui/error-codes/E0063.rs
@@ -0,0 +1,38 @@
+struct SingleFoo {
+ x: i32
+}
+
+struct PluralFoo {
+ x: i32,
+ y: i32,
+ z: i32
+}
+
+struct TruncatedFoo {
+ a: i32,
+ b: i32,
+ x: i32,
+ y: i32,
+ z: i32
+}
+
+struct TruncatedPluralFoo {
+ a: i32,
+ b: i32,
+ c: i32,
+ x: i32,
+ y: i32,
+ z: i32
+}
+
+
+fn main() {
+ let w = SingleFoo { };
+ //~^ ERROR missing field `x` in initializer of `SingleFoo`
+ let x = PluralFoo {x: 1};
+ //~^ ERROR missing fields `y` and `z` in initializer of `PluralFoo`
+ let y = TruncatedFoo{x:1};
+ //~^ missing fields `a`, `b`, `y` and 1 other field in initializer of `TruncatedFoo`
+ let z = TruncatedPluralFoo{x:1};
+ //~^ ERROR missing fields `a`, `b`, `c` and 2 other fields in initializer of `TruncatedPluralFoo`
+}
diff --git a/src/test/ui/error-codes/E0063.stderr b/src/test/ui/error-codes/E0063.stderr
new file mode 100644
index 000000000..235e20402
--- /dev/null
+++ b/src/test/ui/error-codes/E0063.stderr
@@ -0,0 +1,27 @@
+error[E0063]: missing field `x` in initializer of `SingleFoo`
+ --> $DIR/E0063.rs:30:13
+ |
+LL | let w = SingleFoo { };
+ | ^^^^^^^^^ missing `x`
+
+error[E0063]: missing fields `y` and `z` in initializer of `PluralFoo`
+ --> $DIR/E0063.rs:32:13
+ |
+LL | let x = PluralFoo {x: 1};
+ | ^^^^^^^^^ missing `y` and `z`
+
+error[E0063]: missing fields `a`, `b`, `y` and 1 other field in initializer of `TruncatedFoo`
+ --> $DIR/E0063.rs:34:13
+ |
+LL | let y = TruncatedFoo{x:1};
+ | ^^^^^^^^^^^^ missing `a`, `b`, `y` and 1 other field
+
+error[E0063]: missing fields `a`, `b`, `c` and 2 other fields in initializer of `TruncatedPluralFoo`
+ --> $DIR/E0063.rs:36:13
+ |
+LL | let z = TruncatedPluralFoo{x:1};
+ | ^^^^^^^^^^^^^^^^^^ missing `a`, `b`, `c` and 2 other fields
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0063`.
diff --git a/src/test/ui/error-codes/E0067.rs b/src/test/ui/error-codes/E0067.rs
new file mode 100644
index 000000000..5925443dd
--- /dev/null
+++ b/src/test/ui/error-codes/E0067.rs
@@ -0,0 +1,6 @@
+use std::collections::LinkedList;
+
+fn main() {
+ LinkedList::new() += 1; //~ ERROR E0368
+ //~^ ERROR E0067
+}
diff --git a/src/test/ui/error-codes/E0067.stderr b/src/test/ui/error-codes/E0067.stderr
new file mode 100644
index 000000000..ec0358cb7
--- /dev/null
+++ b/src/test/ui/error-codes/E0067.stderr
@@ -0,0 +1,20 @@
+error[E0368]: binary assignment operation `+=` cannot be applied to type `LinkedList<_>`
+ --> $DIR/E0067.rs:4:5
+ |
+LL | LinkedList::new() += 1;
+ | -----------------^^^^^
+ | |
+ | cannot use `+=` on type `LinkedList<_>`
+
+error[E0067]: invalid left-hand side of assignment
+ --> $DIR/E0067.rs:4:23
+ |
+LL | LinkedList::new() += 1;
+ | ----------------- ^^
+ | |
+ | cannot assign to this expression
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0067, E0368.
+For more information about an error, try `rustc --explain E0067`.
diff --git a/src/test/ui/error-codes/E0069.rs b/src/test/ui/error-codes/E0069.rs
new file mode 100644
index 000000000..a4ba9fd8d
--- /dev/null
+++ b/src/test/ui/error-codes/E0069.rs
@@ -0,0 +1,7 @@
+fn foo() -> u8 {
+ return;
+ //~^ ERROR `return;` in a function whose return type is not `()`
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0069.stderr b/src/test/ui/error-codes/E0069.stderr
new file mode 100644
index 000000000..ff9bbe01d
--- /dev/null
+++ b/src/test/ui/error-codes/E0069.stderr
@@ -0,0 +1,11 @@
+error[E0069]: `return;` in a function whose return type is not `()`
+ --> $DIR/E0069.rs:2:5
+ |
+LL | fn foo() -> u8 {
+ | -- expected `u8` because of this return type
+LL | return;
+ | ^^^^^^ return type is not `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0069`.
diff --git a/src/test/ui/error-codes/E0070.rs b/src/test/ui/error-codes/E0070.rs
new file mode 100644
index 000000000..3aae0c9ff
--- /dev/null
+++ b/src/test/ui/error-codes/E0070.rs
@@ -0,0 +1,12 @@
+const SOME_CONST : i32 = 12;
+
+fn some_other_func() {}
+
+fn some_function() {
+ SOME_CONST = 14; //~ ERROR E0070
+ 1 = 3; //~ ERROR E0070
+ some_other_func() = 4; //~ ERROR E0070
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0070.stderr b/src/test/ui/error-codes/E0070.stderr
new file mode 100644
index 000000000..8868bc257
--- /dev/null
+++ b/src/test/ui/error-codes/E0070.stderr
@@ -0,0 +1,27 @@
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/E0070.rs:6:16
+ |
+LL | SOME_CONST = 14;
+ | ---------- ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/E0070.rs:7:7
+ |
+LL | 1 = 3;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/E0070.rs:8:23
+ |
+LL | some_other_func() = 4;
+ | ----------------- ^
+ | |
+ | cannot assign to this expression
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0070`.
diff --git a/src/test/ui/error-codes/E0071.rs b/src/test/ui/error-codes/E0071.rs
new file mode 100644
index 000000000..bd8469de7
--- /dev/null
+++ b/src/test/ui/error-codes/E0071.rs
@@ -0,0 +1,7 @@
+enum Foo {}
+type FooAlias = Foo;
+
+fn main() {
+ let u = FooAlias { value: 0 };
+ //~^ ERROR expected struct, variant or union type, found enum `Foo` [E0071]
+}
diff --git a/src/test/ui/error-codes/E0071.stderr b/src/test/ui/error-codes/E0071.stderr
new file mode 100644
index 000000000..ae312fc40
--- /dev/null
+++ b/src/test/ui/error-codes/E0071.stderr
@@ -0,0 +1,9 @@
+error[E0071]: expected struct, variant or union type, found enum `Foo`
+ --> $DIR/E0071.rs:5:13
+ |
+LL | let u = FooAlias { value: 0 };
+ | ^^^^^^^^ not a struct
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0071`.
diff --git a/src/test/ui/error-codes/E0075.rs b/src/test/ui/error-codes/E0075.rs
new file mode 100644
index 000000000..7feab0a8b
--- /dev/null
+++ b/src/test/ui/error-codes/E0075.rs
@@ -0,0 +1,7 @@
+#![feature(repr_simd)]
+
+#[repr(simd)]
+struct Bad; //~ ERROR E0075
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0075.stderr b/src/test/ui/error-codes/E0075.stderr
new file mode 100644
index 000000000..3f927726a
--- /dev/null
+++ b/src/test/ui/error-codes/E0075.stderr
@@ -0,0 +1,9 @@
+error[E0075]: SIMD vector cannot be empty
+ --> $DIR/E0075.rs:4:1
+ |
+LL | struct Bad;
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0075`.
diff --git a/src/test/ui/error-codes/E0076.rs b/src/test/ui/error-codes/E0076.rs
new file mode 100644
index 000000000..a27072eb7
--- /dev/null
+++ b/src/test/ui/error-codes/E0076.rs
@@ -0,0 +1,8 @@
+#![feature(repr_simd)]
+
+#[repr(simd)]
+struct Bad(u16, u32, u32);
+//~^ ERROR E0076
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0076.stderr b/src/test/ui/error-codes/E0076.stderr
new file mode 100644
index 000000000..7d4ff8798
--- /dev/null
+++ b/src/test/ui/error-codes/E0076.stderr
@@ -0,0 +1,9 @@
+error[E0076]: SIMD vector should be homogeneous
+ --> $DIR/E0076.rs:4:1
+ |
+LL | struct Bad(u16, u32, u32);
+ | ^^^^^^^^^^ SIMD elements must have the same type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0076`.
diff --git a/src/test/ui/error-codes/E0077.rs b/src/test/ui/error-codes/E0077.rs
new file mode 100644
index 000000000..fa2d5e24f
--- /dev/null
+++ b/src/test/ui/error-codes/E0077.rs
@@ -0,0 +1,7 @@
+#![feature(repr_simd)]
+
+#[repr(simd)]
+struct Bad(String); //~ ERROR E0077
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0077.stderr b/src/test/ui/error-codes/E0077.stderr
new file mode 100644
index 000000000..9a84b2ec4
--- /dev/null
+++ b/src/test/ui/error-codes/E0077.stderr
@@ -0,0 +1,9 @@
+error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type
+ --> $DIR/E0077.rs:4:1
+ |
+LL | struct Bad(String);
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0077`.
diff --git a/src/test/ui/error-codes/E0080.rs b/src/test/ui/error-codes/E0080.rs
new file mode 100644
index 000000000..ea3264b61
--- /dev/null
+++ b/src/test/ui/error-codes/E0080.rs
@@ -0,0 +1,8 @@
+enum Enum {
+ X = (1 << 500), //~ ERROR E0080
+ //~| attempt to shift left by `500_i32`, which would overflow
+ Y = (1 / 0) //~ ERROR E0080
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0080.stderr b/src/test/ui/error-codes/E0080.stderr
new file mode 100644
index 000000000..60ed9a435
--- /dev/null
+++ b/src/test/ui/error-codes/E0080.stderr
@@ -0,0 +1,15 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/E0080.rs:2:9
+ |
+LL | X = (1 << 500),
+ | ^^^^^^^^^^ attempt to shift left by `500_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/E0080.rs:4:9
+ |
+LL | Y = (1 / 0)
+ | ^^^^^^^ attempt to divide `1_isize` by zero
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/error-codes/E0081.rs b/src/test/ui/error-codes/E0081.rs
new file mode 100644
index 000000000..5aa6a7863
--- /dev/null
+++ b/src/test/ui/error-codes/E0081.rs
@@ -0,0 +1,31 @@
+enum Enum {
+ //~^ ERROR discriminant value `3` assigned more than once
+ P = 3,
+ //~^ NOTE first assignment of `3`
+ X = 3,
+ //~^ NOTE second assignment of `3`
+ Y = 5
+}
+
+#[repr(u8)]
+enum EnumOverflowRepr {
+ //~^ ERROR discriminant value `1` assigned more than once
+ P = 257,
+ //~^ NOTE first assignment of `1` (overflowed from `257`)
+ X = 513,
+ //~^ NOTE second assignment of `1` (overflowed from `513`)
+}
+
+#[repr(i8)]
+enum NegDisEnum {
+ //~^ ERROR discriminant value `-1` assigned more than once
+ First = -1,
+ //~^ NOTE first assignment of `-1`
+ Second = -2,
+ //~^ NOTE assigned discriminant for `Last` was incremented from this discriminant
+ Last,
+ //~^ NOTE second assignment of `-1`
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0081.stderr b/src/test/ui/error-codes/E0081.stderr
new file mode 100644
index 000000000..ff6113646
--- /dev/null
+++ b/src/test/ui/error-codes/E0081.stderr
@@ -0,0 +1,42 @@
+error[E0081]: discriminant value `3` assigned more than once
+ --> $DIR/E0081.rs:1:1
+ |
+LL | enum Enum {
+ | ^^^^^^^^^
+LL |
+LL | P = 3,
+ | - first assignment of `3`
+LL |
+LL | X = 3,
+ | - second assignment of `3`
+
+error[E0081]: discriminant value `1` assigned more than once
+ --> $DIR/E0081.rs:11:1
+ |
+LL | enum EnumOverflowRepr {
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | P = 257,
+ | --- first assignment of `1` (overflowed from `257`)
+LL |
+LL | X = 513,
+ | --- second assignment of `1` (overflowed from `513`)
+
+error[E0081]: discriminant value `-1` assigned more than once
+ --> $DIR/E0081.rs:20:1
+ |
+LL | enum NegDisEnum {
+ | ^^^^^^^^^^^^^^^
+LL |
+LL | First = -1,
+ | -- first assignment of `-1`
+LL |
+LL | Second = -2,
+ | ----------- assigned discriminant for `Last` was incremented from this discriminant
+LL |
+LL | Last,
+ | ---- second assignment of `-1`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0081`.
diff --git a/src/test/ui/error-codes/E0084.rs b/src/test/ui/error-codes/E0084.rs
new file mode 100644
index 000000000..a550e0412
--- /dev/null
+++ b/src/test/ui/error-codes/E0084.rs
@@ -0,0 +1,5 @@
+#[repr(i32)] //~ ERROR: E0084
+enum Foo {}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0084.stderr b/src/test/ui/error-codes/E0084.stderr
new file mode 100644
index 000000000..e1bda22b8
--- /dev/null
+++ b/src/test/ui/error-codes/E0084.stderr
@@ -0,0 +1,11 @@
+error[E0084]: unsupported representation for zero-variant enum
+ --> $DIR/E0084.rs:1:1
+ |
+LL | #[repr(i32)]
+ | ^^^^^^^^^^^^
+LL | enum Foo {}
+ | -------- zero-variant enum
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0084`.
diff --git a/src/test/ui/error-codes/E0091.rs b/src/test/ui/error-codes/E0091.rs
new file mode 100644
index 000000000..2427f5cfe
--- /dev/null
+++ b/src/test/ui/error-codes/E0091.rs
@@ -0,0 +1,5 @@
+type Foo<T> = u32; //~ ERROR E0091
+type Foo2<A, B> = Box<A>; //~ ERROR E0091
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0091.stderr b/src/test/ui/error-codes/E0091.stderr
new file mode 100644
index 000000000..a596b75e4
--- /dev/null
+++ b/src/test/ui/error-codes/E0091.stderr
@@ -0,0 +1,15 @@
+error[E0091]: type parameter `T` is unused
+ --> $DIR/E0091.rs:1:10
+ |
+LL | type Foo<T> = u32;
+ | ^ unused type parameter
+
+error[E0091]: type parameter `B` is unused
+ --> $DIR/E0091.rs:2:14
+ |
+LL | type Foo2<A, B> = Box<A>;
+ | ^ unused type parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0091`.
diff --git a/src/test/ui/error-codes/E0092.rs b/src/test/ui/error-codes/E0092.rs
new file mode 100644
index 000000000..ddaace98b
--- /dev/null
+++ b/src/test/ui/error-codes/E0092.rs
@@ -0,0 +1,7 @@
+#![feature(intrinsics)]
+extern "rust-intrinsic" {
+ fn atomic_foo(); //~ ERROR E0092
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0092.stderr b/src/test/ui/error-codes/E0092.stderr
new file mode 100644
index 000000000..2d590a8e1
--- /dev/null
+++ b/src/test/ui/error-codes/E0092.stderr
@@ -0,0 +1,9 @@
+error[E0092]: unrecognized atomic operation function: `foo`
+ --> $DIR/E0092.rs:3:5
+ |
+LL | fn atomic_foo();
+ | ^^^^^^^^^^^^^^^^ unrecognized atomic operation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0092`.
diff --git a/src/test/ui/error-codes/E0093.rs b/src/test/ui/error-codes/E0093.rs
new file mode 100644
index 000000000..a2f0b1ae4
--- /dev/null
+++ b/src/test/ui/error-codes/E0093.rs
@@ -0,0 +1,8 @@
+#![feature(intrinsics)]
+extern "rust-intrinsic" {
+ fn foo();
+ //~^ ERROR E0093
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0093.stderr b/src/test/ui/error-codes/E0093.stderr
new file mode 100644
index 000000000..cb0305593
--- /dev/null
+++ b/src/test/ui/error-codes/E0093.stderr
@@ -0,0 +1,9 @@
+error[E0093]: unrecognized intrinsic function: `foo`
+ --> $DIR/E0093.rs:3:5
+ |
+LL | fn foo();
+ | ^^^^^^^^^ unrecognized intrinsic
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0093`.
diff --git a/src/test/ui/error-codes/E0094.rs b/src/test/ui/error-codes/E0094.rs
new file mode 100644
index 000000000..0d58e5a28
--- /dev/null
+++ b/src/test/ui/error-codes/E0094.rs
@@ -0,0 +1,7 @@
+#![feature(intrinsics)]
+extern "rust-intrinsic" {
+ fn size_of<T, U>() -> usize; //~ ERROR E0094
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0094.stderr b/src/test/ui/error-codes/E0094.stderr
new file mode 100644
index 000000000..da97f3a01
--- /dev/null
+++ b/src/test/ui/error-codes/E0094.stderr
@@ -0,0 +1,9 @@
+error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1
+ --> $DIR/E0094.rs:3:15
+ |
+LL | fn size_of<T, U>() -> usize;
+ | ^^^^^^ expected 1 type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0094`.
diff --git a/src/test/ui/error-codes/E0106.rs b/src/test/ui/error-codes/E0106.rs
new file mode 100644
index 000000000..cc3438727
--- /dev/null
+++ b/src/test/ui/error-codes/E0106.rs
@@ -0,0 +1,26 @@
+struct Foo {
+ x: &bool,
+ //~^ ERROR E0106
+}
+enum Bar {
+ A(u8),
+ B(&bool),
+ //~^ ERROR E0106
+}
+type MyStr = &str;
+ //~^ ERROR E0106
+
+struct Baz<'a>(&'a str);
+struct Buzz<'a, 'b>(&'a str, &'b str);
+
+struct Quux {
+ baz: Baz,
+ //~^ ERROR E0106
+ //~| expected named lifetime parameter
+ buzz: Buzz,
+ //~^ ERROR E0106
+ //~| expected 2 lifetime parameters
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0106.stderr b/src/test/ui/error-codes/E0106.stderr
new file mode 100644
index 000000000..d11a24f77
--- /dev/null
+++ b/src/test/ui/error-codes/E0106.stderr
@@ -0,0 +1,66 @@
+error[E0106]: missing lifetime specifier
+ --> $DIR/E0106.rs:2:8
+ |
+LL | x: &bool,
+ | ^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+LL ~ struct Foo<'a> {
+LL ~ x: &'a bool,
+ |
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/E0106.rs:7:7
+ |
+LL | B(&bool),
+ | ^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+LL ~ enum Bar<'a> {
+LL | A(u8),
+LL ~ B(&'a bool),
+ |
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/E0106.rs:10:14
+ |
+LL | type MyStr = &str;
+ | ^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+LL | type MyStr<'a> = &'a str;
+ | ++++ ++
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/E0106.rs:17:10
+ |
+LL | baz: Baz,
+ | ^^^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+LL ~ struct Quux<'a> {
+LL ~ baz: Baz<'a>,
+ |
+
+error[E0106]: missing lifetime specifiers
+ --> $DIR/E0106.rs:20:11
+ |
+LL | buzz: Buzz,
+ | ^^^^ expected 2 lifetime parameters
+ |
+help: consider introducing a named lifetime parameter
+ |
+LL ~ struct Quux<'a> {
+LL | baz: Baz,
+LL |
+LL |
+LL ~ buzz: Buzz<'a, 'a>,
+ |
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/error-codes/E0107.rs b/src/test/ui/error-codes/E0107.rs
new file mode 100644
index 000000000..d369fc2a5
--- /dev/null
+++ b/src/test/ui/error-codes/E0107.rs
@@ -0,0 +1,60 @@
+struct Foo<'a>(&'a str);
+struct Buzz<'a, 'b>(&'a str, &'b str);
+struct Qux<'a, T>(&'a T);
+struct Quux<T>(T);
+
+enum Bar {
+ A,
+ B,
+ C,
+}
+
+struct Baz<'a, 'b, 'c> {
+ buzz: Buzz<'a>,
+ //~^ ERROR this struct takes 2 lifetime arguments
+ //~| HELP add missing lifetime argument
+
+ bar: Bar<'a>,
+ //~^ ERROR this enum takes 0 lifetime arguments
+ //~| HELP remove these generics
+
+ foo2: Foo<'a, 'b, 'c>,
+ //~^ ERROR this struct takes 1 lifetime argument
+ //~| HELP remove these lifetime arguments
+
+ qux1: Qux<'a, 'b, i32>,
+ //~^ ERROR this struct takes 1 lifetime argument
+ //~| HELP remove this lifetime argument
+
+ qux2: Qux<'a, i32, 'b>,
+ //~^ ERROR this struct takes 1 lifetime argument
+ //~| HELP remove this lifetime argument
+
+ qux3: Qux<'a, 'b, 'c, i32>,
+ //~^ ERROR this struct takes 1 lifetime argument
+ //~| HELP remove these lifetime arguments
+
+ qux4: Qux<'a, i32, 'b, 'c>,
+ //~^ ERROR this struct takes 1 lifetime argument
+ //~| HELP remove these lifetime arguments
+
+ qux5: Qux<'a, 'b, i32, 'c>,
+ //~^ ERROR this struct takes 1 lifetime argument
+ //~| HELP remove this lifetime argument
+
+ quux: Quux<'a, i32, 'b>,
+ //~^ ERROR this struct takes 0 lifetime arguments
+ //~| HELP remove this lifetime argument
+}
+
+pub trait T {
+ type A;
+ type B;
+}
+
+fn trait_bound_generic<I: T<u8, u16>>(_i: I) {
+ //~^ ERROR this trait takes 0 generic arguments
+ //~| HELP replace the generic bounds with the associated types
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr
new file mode 100644
index 000000000..5ca03b45d
--- /dev/null
+++ b/src/test/ui/error-codes/E0107.stderr
@@ -0,0 +1,149 @@
+error[E0107]: this struct takes 2 lifetime arguments but 1 lifetime argument was supplied
+ --> $DIR/E0107.rs:13:11
+ |
+LL | buzz: Buzz<'a>,
+ | ^^^^ -- supplied 1 lifetime argument
+ | |
+ | expected 2 lifetime arguments
+ |
+note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
+ --> $DIR/E0107.rs:2:8
+ |
+LL | struct Buzz<'a, 'b>(&'a str, &'b str);
+ | ^^^^ -- --
+help: add missing lifetime argument
+ |
+LL | buzz: Buzz<'a, 'a>,
+ | ++++
+
+error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
+ --> $DIR/E0107.rs:17:10
+ |
+LL | bar: Bar<'a>,
+ | ^^^---- help: remove these generics
+ | |
+ | expected 0 lifetime arguments
+ |
+note: enum defined here, with 0 lifetime parameters
+ --> $DIR/E0107.rs:6:6
+ |
+LL | enum Bar {
+ | ^^^
+
+error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+ --> $DIR/E0107.rs:21:11
+ |
+LL | foo2: Foo<'a, 'b, 'c>,
+ | ^^^ ------ help: remove these lifetime arguments
+ | |
+ | expected 1 lifetime argument
+ |
+note: struct defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/E0107.rs:1:8
+ |
+LL | struct Foo<'a>(&'a str);
+ | ^^^ --
+
+error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+ --> $DIR/E0107.rs:25:11
+ |
+LL | qux1: Qux<'a, 'b, i32>,
+ | ^^^ -- help: remove this lifetime argument
+ | |
+ | expected 1 lifetime argument
+ |
+note: struct defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/E0107.rs:3:8
+ |
+LL | struct Qux<'a, T>(&'a T);
+ | ^^^ --
+
+error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+ --> $DIR/E0107.rs:29:11
+ |
+LL | qux2: Qux<'a, i32, 'b>,
+ | ^^^ -- help: remove this lifetime argument
+ | |
+ | expected 1 lifetime argument
+ |
+note: struct defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/E0107.rs:3:8
+ |
+LL | struct Qux<'a, T>(&'a T);
+ | ^^^ --
+
+error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+ --> $DIR/E0107.rs:33:11
+ |
+LL | qux3: Qux<'a, 'b, 'c, i32>,
+ | ^^^ ------ help: remove these lifetime arguments
+ | |
+ | expected 1 lifetime argument
+ |
+note: struct defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/E0107.rs:3:8
+ |
+LL | struct Qux<'a, T>(&'a T);
+ | ^^^ --
+
+error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+ --> $DIR/E0107.rs:37:11
+ |
+LL | qux4: Qux<'a, i32, 'b, 'c>,
+ | ^^^ ------ help: remove these lifetime arguments
+ | |
+ | expected 1 lifetime argument
+ |
+note: struct defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/E0107.rs:3:8
+ |
+LL | struct Qux<'a, T>(&'a T);
+ | ^^^ --
+
+error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+ --> $DIR/E0107.rs:41:11
+ |
+LL | qux5: Qux<'a, 'b, i32, 'c>,
+ | ^^^ -- help: remove this lifetime argument
+ | |
+ | expected 1 lifetime argument
+ |
+note: struct defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/E0107.rs:3:8
+ |
+LL | struct Qux<'a, T>(&'a T);
+ | ^^^ --
+
+error[E0107]: this struct takes 0 lifetime arguments but 2 lifetime arguments were supplied
+ --> $DIR/E0107.rs:45:11
+ |
+LL | quux: Quux<'a, i32, 'b>,
+ | ^^^^ -- help: remove this lifetime argument
+ | |
+ | expected 0 lifetime arguments
+ |
+note: struct defined here, with 0 lifetime parameters
+ --> $DIR/E0107.rs:4:8
+ |
+LL | struct Quux<T>(T);
+ | ^^^^
+
+error[E0107]: this trait takes 0 generic arguments but 2 generic arguments were supplied
+ --> $DIR/E0107.rs:55:27
+ |
+LL | fn trait_bound_generic<I: T<u8, u16>>(_i: I) {
+ | ^ expected 0 generic arguments
+ |
+note: trait defined here, with 0 generic parameters
+ --> $DIR/E0107.rs:50:11
+ |
+LL | pub trait T {
+ | ^
+help: replace the generic bounds with the associated types
+ |
+LL | fn trait_bound_generic<I: T<A = u8, B = u16>>(_i: I) {
+ | ~~~~~~ ~~~~~~~
+
+error: aborting due to 10 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/error-codes/E0109.rs b/src/test/ui/error-codes/E0109.rs
new file mode 100644
index 000000000..2e3825649
--- /dev/null
+++ b/src/test/ui/error-codes/E0109.rs
@@ -0,0 +1,4 @@
+type X = u32<i32>; //~ ERROR E0109
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0109.stderr b/src/test/ui/error-codes/E0109.stderr
new file mode 100644
index 000000000..8f4cb86de
--- /dev/null
+++ b/src/test/ui/error-codes/E0109.stderr
@@ -0,0 +1,17 @@
+error[E0109]: type arguments are not allowed on builtin type `u32`
+ --> $DIR/E0109.rs:1:14
+ |
+LL | type X = u32<i32>;
+ | --- ^^^ type argument not allowed
+ | |
+ | not allowed on builtin type `u32`
+ |
+help: primitive type `u32` doesn't have generic parameters
+ |
+LL - type X = u32<i32>;
+LL + type X = u32;
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0109`.
diff --git a/src/test/ui/error-codes/E0110.rs b/src/test/ui/error-codes/E0110.rs
new file mode 100644
index 000000000..314c7f5af
--- /dev/null
+++ b/src/test/ui/error-codes/E0110.rs
@@ -0,0 +1,3 @@
+type X = u32<'static>; //~ ERROR E0109
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0110.stderr b/src/test/ui/error-codes/E0110.stderr
new file mode 100644
index 000000000..4ce2a0a41
--- /dev/null
+++ b/src/test/ui/error-codes/E0110.stderr
@@ -0,0 +1,17 @@
+error[E0109]: lifetime arguments are not allowed on builtin type `u32`
+ --> $DIR/E0110.rs:1:14
+ |
+LL | type X = u32<'static>;
+ | --- ^^^^^^^ lifetime argument not allowed
+ | |
+ | not allowed on builtin type `u32`
+ |
+help: primitive type `u32` doesn't have generic parameters
+ |
+LL - type X = u32<'static>;
+LL + type X = u32;
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0109`.
diff --git a/src/test/ui/error-codes/E0116.rs b/src/test/ui/error-codes/E0116.rs
new file mode 100644
index 000000000..898beb10b
--- /dev/null
+++ b/src/test/ui/error-codes/E0116.rs
@@ -0,0 +1,5 @@
+impl Vec<u8> {}
+//~^ ERROR E0116
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0116.stderr b/src/test/ui/error-codes/E0116.stderr
new file mode 100644
index 000000000..a5ceeb4a5
--- /dev/null
+++ b/src/test/ui/error-codes/E0116.stderr
@@ -0,0 +1,11 @@
+error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
+ --> $DIR/E0116.rs:1:1
+ |
+LL | impl Vec<u8> {}
+ | ^^^^^^^^^^^^^^^ impl for type defined outside of crate.
+ |
+ = note: define and implement a trait or new type instead
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0116`.
diff --git a/src/test/ui/error-codes/E0117.rs b/src/test/ui/error-codes/E0117.rs
new file mode 100644
index 000000000..22b486573
--- /dev/null
+++ b/src/test/ui/error-codes/E0117.rs
@@ -0,0 +1,4 @@
+impl Drop for u32 {} //~ ERROR E0117
+//~| ERROR the `Drop` trait may only be implemented for structs, enums, and unions
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0117.stderr b/src/test/ui/error-codes/E0117.stderr
new file mode 100644
index 000000000..76d9f5cc0
--- /dev/null
+++ b/src/test/ui/error-codes/E0117.stderr
@@ -0,0 +1,21 @@
+error[E0117]: only traits defined in the current crate can be implemented for primitive types
+ --> $DIR/E0117.rs:1:1
+ |
+LL | impl Drop for u32 {}
+ | ^^^^^^^^^^^^^^---
+ | | |
+ | | `u32` is not defined in the current crate
+ | impl doesn't use only types from inside the current crate
+ |
+ = note: define and implement a trait or new type instead
+
+error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions
+ --> $DIR/E0117.rs:1:15
+ |
+LL | impl Drop for u32 {}
+ | ^^^ must be a struct, enum, or union
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0117, E0120.
+For more information about an error, try `rustc --explain E0117`.
diff --git a/src/test/ui/error-codes/E0118.rs b/src/test/ui/error-codes/E0118.rs
new file mode 100644
index 000000000..a61ba7bbf
--- /dev/null
+++ b/src/test/ui/error-codes/E0118.rs
@@ -0,0 +1,7 @@
+impl<T> T { //~ ERROR E0118
+ fn get_state(&self) -> String {
+ String::new()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0118.stderr b/src/test/ui/error-codes/E0118.stderr
new file mode 100644
index 000000000..8c6fa7947
--- /dev/null
+++ b/src/test/ui/error-codes/E0118.stderr
@@ -0,0 +1,11 @@
+error[E0118]: no nominal type found for inherent implementation
+ --> $DIR/E0118.rs:1:9
+ |
+LL | impl<T> T {
+ | ^ impl requires a nominal type
+ |
+ = note: either implement a trait on it or create a newtype to wrap it instead
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0118`.
diff --git a/src/test/ui/error-codes/E0119.rs b/src/test/ui/error-codes/E0119.rs
new file mode 100644
index 000000000..7f89e5a1a
--- /dev/null
+++ b/src/test/ui/error-codes/E0119.rs
@@ -0,0 +1,18 @@
+trait MyTrait {
+ fn get(&self) -> usize;
+}
+
+impl<T> MyTrait for T {
+ fn get(&self) -> usize { 0 }
+}
+
+struct Foo {
+ value: usize
+}
+
+impl MyTrait for Foo { //~ ERROR E0119
+ fn get(&self) -> usize { self.value }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0119.stderr b/src/test/ui/error-codes/E0119.stderr
new file mode 100644
index 000000000..e08a2c7fc
--- /dev/null
+++ b/src/test/ui/error-codes/E0119.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `Foo`
+ --> $DIR/E0119.rs:13:1
+ |
+LL | impl<T> MyTrait for T {
+ | --------------------- first implementation here
+...
+LL | impl MyTrait for Foo {
+ | ^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/E0120.rs b/src/test/ui/error-codes/E0120.rs
new file mode 100644
index 000000000..a0a301a06
--- /dev/null
+++ b/src/test/ui/error-codes/E0120.rs
@@ -0,0 +1,8 @@
+trait MyTrait { fn foo() {} }
+
+impl Drop for dyn MyTrait {
+ //~^ ERROR E0120
+ fn drop(&mut self) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0120.stderr b/src/test/ui/error-codes/E0120.stderr
new file mode 100644
index 000000000..6c306455e
--- /dev/null
+++ b/src/test/ui/error-codes/E0120.stderr
@@ -0,0 +1,9 @@
+error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions
+ --> $DIR/E0120.rs:3:15
+ |
+LL | impl Drop for dyn MyTrait {
+ | ^^^^^^^^^^^ must be a struct, enum, or union
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0120`.
diff --git a/src/test/ui/error-codes/E0121.rs b/src/test/ui/error-codes/E0121.rs
new file mode 100644
index 000000000..98cd6d54c
--- /dev/null
+++ b/src/test/ui/error-codes/E0121.rs
@@ -0,0 +1,5 @@
+fn foo() -> _ { 5 } //~ ERROR E0121
+
+static BAR: _ = "test"; //~ ERROR E0121
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0121.stderr b/src/test/ui/error-codes/E0121.stderr
new file mode 100644
index 000000000..023d7e011
--- /dev/null
+++ b/src/test/ui/error-codes/E0121.stderr
@@ -0,0 +1,21 @@
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/E0121.rs:1:13
+ |
+LL | fn foo() -> _ { 5 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `i32`
+
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/E0121.rs:3:13
+ |
+LL | static BAR: _ = "test";
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `&str`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/src/test/ui/error-codes/E0124.rs b/src/test/ui/error-codes/E0124.rs
new file mode 100644
index 000000000..9d6a716a6
--- /dev/null
+++ b/src/test/ui/error-codes/E0124.rs
@@ -0,0 +1,8 @@
+struct Foo {
+ field1: i32,
+ field1: i32,
+ //~^ ERROR field `field1` is already declared [E0124]
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0124.stderr b/src/test/ui/error-codes/E0124.stderr
new file mode 100644
index 000000000..73819a89d
--- /dev/null
+++ b/src/test/ui/error-codes/E0124.stderr
@@ -0,0 +1,11 @@
+error[E0124]: field `field1` is already declared
+ --> $DIR/E0124.rs:3:5
+ |
+LL | field1: i32,
+ | ----------- `field1` first declared here
+LL | field1: i32,
+ | ^^^^^^^^^^^ field already declared
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0124`.
diff --git a/src/test/ui/error-codes/E0128.rs b/src/test/ui/error-codes/E0128.rs
new file mode 100644
index 000000000..f42c32b91
--- /dev/null
+++ b/src/test/ui/error-codes/E0128.rs
@@ -0,0 +1,7 @@
+struct Foo<T=U, U=()> { //~ ERROR E0128
+ field1: T,
+ field2: U,
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0128.stderr b/src/test/ui/error-codes/E0128.stderr
new file mode 100644
index 000000000..eb66d4693
--- /dev/null
+++ b/src/test/ui/error-codes/E0128.stderr
@@ -0,0 +1,9 @@
+error[E0128]: generic parameters with a default cannot use forward declared identifiers
+ --> $DIR/E0128.rs:1:14
+ |
+LL | struct Foo<T=U, U=()> {
+ | ^ defaulted generic parameters cannot be forward declared
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0128`.
diff --git a/src/test/ui/error-codes/E0130.rs b/src/test/ui/error-codes/E0130.rs
new file mode 100644
index 000000000..d52350789
--- /dev/null
+++ b/src/test/ui/error-codes/E0130.rs
@@ -0,0 +1,6 @@
+extern "C" {
+ fn foo((a, b): (u32, u32));
+//~^ ERROR E0130
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0130.stderr b/src/test/ui/error-codes/E0130.stderr
new file mode 100644
index 000000000..a45571f40
--- /dev/null
+++ b/src/test/ui/error-codes/E0130.stderr
@@ -0,0 +1,9 @@
+error[E0130]: patterns aren't allowed in foreign function declarations
+ --> $DIR/E0130.rs:2:12
+ |
+LL | fn foo((a, b): (u32, u32));
+ | ^^^^^^ pattern not allowed in foreign function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0130`.
diff --git a/src/test/ui/error-codes/E0131.rs b/src/test/ui/error-codes/E0131.rs
new file mode 100644
index 000000000..3ed739949
--- /dev/null
+++ b/src/test/ui/error-codes/E0131.rs
@@ -0,0 +1,3 @@
+fn main<T>() {
+ //~^ ERROR E0131
+}
diff --git a/src/test/ui/error-codes/E0131.stderr b/src/test/ui/error-codes/E0131.stderr
new file mode 100644
index 000000000..4467e19e9
--- /dev/null
+++ b/src/test/ui/error-codes/E0131.stderr
@@ -0,0 +1,9 @@
+error[E0131]: `main` function is not allowed to have generic parameters
+ --> $DIR/E0131.rs:1:8
+ |
+LL | fn main<T>() {
+ | ^^^ `main` cannot have generic parameters
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0131`.
diff --git a/src/test/ui/error-codes/E0132.rs b/src/test/ui/error-codes/E0132.rs
new file mode 100644
index 000000000..fb5e5d7b9
--- /dev/null
+++ b/src/test/ui/error-codes/E0132.rs
@@ -0,0 +1,7 @@
+#![feature(start)]
+
+#[start]
+fn f< T >() {} //~ ERROR E0132
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0132.stderr b/src/test/ui/error-codes/E0132.stderr
new file mode 100644
index 000000000..c21363756
--- /dev/null
+++ b/src/test/ui/error-codes/E0132.stderr
@@ -0,0 +1,9 @@
+error[E0132]: start function is not allowed to have type parameters
+ --> $DIR/E0132.rs:4:5
+ |
+LL | fn f< T >() {}
+ | ^^^^^ start function cannot have type parameters
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0132`.
diff --git a/src/test/ui/error-codes/E0133.mir.stderr b/src/test/ui/error-codes/E0133.mir.stderr
new file mode 100644
index 000000000..b11d5e2c2
--- /dev/null
+++ b/src/test/ui/error-codes/E0133.mir.stderr
@@ -0,0 +1,11 @@
+error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+ --> $DIR/E0133.rs:7:5
+ |
+LL | f();
+ | ^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/error-codes/E0133.rs b/src/test/ui/error-codes/E0133.rs
new file mode 100644
index 000000000..dee1475ba
--- /dev/null
+++ b/src/test/ui/error-codes/E0133.rs
@@ -0,0 +1,9 @@
+// revisions: mir thir
+// [thir]compile-flags: -Z thir-unsafeck
+
+unsafe fn f() { return; }
+
+fn main() {
+ f();
+ //~^ ERROR E0133
+}
diff --git a/src/test/ui/error-codes/E0133.thir.stderr b/src/test/ui/error-codes/E0133.thir.stderr
new file mode 100644
index 000000000..f1d7aba2a
--- /dev/null
+++ b/src/test/ui/error-codes/E0133.thir.stderr
@@ -0,0 +1,11 @@
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
+ --> $DIR/E0133.rs:7:5
+ |
+LL | f();
+ | ^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/error-codes/E0138.rs b/src/test/ui/error-codes/E0138.rs
new file mode 100644
index 000000000..6f3c36282
--- /dev/null
+++ b/src/test/ui/error-codes/E0138.rs
@@ -0,0 +1,8 @@
+#![feature(start)]
+
+#[start]
+fn foo(argc: isize, argv: *const *const u8) -> isize { 0 }
+
+#[start]
+fn f(argc: isize, argv: *const *const u8) -> isize { 0 }
+//~^ ERROR E0138
diff --git a/src/test/ui/error-codes/E0138.stderr b/src/test/ui/error-codes/E0138.stderr
new file mode 100644
index 000000000..fa8c39427
--- /dev/null
+++ b/src/test/ui/error-codes/E0138.stderr
@@ -0,0 +1,12 @@
+error[E0138]: multiple `start` functions
+ --> $DIR/E0138.rs:7:1
+ |
+LL | fn foo(argc: isize, argv: *const *const u8) -> isize { 0 }
+ | ---------------------------------------------------- previous `#[start]` function here
+...
+LL | fn f(argc: isize, argv: *const *const u8) -> isize { 0 }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ multiple `start` functions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0138`.
diff --git a/src/test/ui/error-codes/E0152.rs b/src/test/ui/error-codes/E0152.rs
new file mode 100644
index 000000000..ee8e5e6df
--- /dev/null
+++ b/src/test/ui/error-codes/E0152.rs
@@ -0,0 +1,8 @@
+// normalize-stderr-test "loaded from .*liballoc-.*.rlib" -> "loaded from SYSROOT/liballoc-*.rlib"
+#![feature(lang_items)]
+
+#[lang = "owned_box"]
+struct Foo<T>(T); //~ ERROR E0152
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0152.stderr b/src/test/ui/error-codes/E0152.stderr
new file mode 100644
index 000000000..29f7e4ad6
--- /dev/null
+++ b/src/test/ui/error-codes/E0152.stderr
@@ -0,0 +1,13 @@
+error[E0152]: found duplicate lang item `owned_box`
+ --> $DIR/E0152.rs:5:1
+ |
+LL | struct Foo<T>(T);
+ | ^^^^^^^^^^^^^
+ |
+ = note: the lang item is first defined in crate `alloc` (which `std` depends on)
+ = note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rlib
+ = note: second definition in the local crate (`E0152`)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0152`.
diff --git a/src/test/ui/error-codes/E0161.base.stderr b/src/test/ui/error-codes/E0161.base.stderr
new file mode 100644
index 000000000..15d98b657
--- /dev/null
+++ b/src/test/ui/error-codes/E0161.base.stderr
@@ -0,0 +1,9 @@
+error[E0161]: cannot move a value of type `dyn Bar`
+ --> $DIR/E0161.rs:16:5
+ |
+LL | x.f();
+ | ^^^^^ the size of `dyn Bar` cannot be statically determined
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0161.rs b/src/test/ui/error-codes/E0161.rs
new file mode 100644
index 000000000..c906e3c35
--- /dev/null
+++ b/src/test/ui/error-codes/E0161.rs
@@ -0,0 +1,20 @@
+// Check that E0161 is a hard error in all possible configurations that might
+// affect it.
+
+// revisions: base ul
+//[base] check-fail
+//[ul] check-pass
+
+#![allow(incomplete_features)]
+#![cfg_attr(ul, feature(unsized_locals))]
+
+trait Bar {
+ fn f(self);
+}
+
+fn foo(x: Box<dyn Bar>) {
+ x.f();
+ //[base]~^ ERROR E0161
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0164.rs b/src/test/ui/error-codes/E0164.rs
new file mode 100644
index 000000000..2d412f754
--- /dev/null
+++ b/src/test/ui/error-codes/E0164.rs
@@ -0,0 +1,14 @@
+enum Foo {}
+
+impl Foo {
+ const B: u8 = 0;
+}
+
+fn bar(foo: Foo) -> u32 {
+ match foo {
+ Foo::B(i) => i, //~ ERROR E0164
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0164.stderr b/src/test/ui/error-codes/E0164.stderr
new file mode 100644
index 000000000..0db89dfec
--- /dev/null
+++ b/src/test/ui/error-codes/E0164.stderr
@@ -0,0 +1,9 @@
+error[E0164]: expected tuple struct or tuple variant, found associated constant `Foo::B`
+ --> $DIR/E0164.rs:9:9
+ |
+LL | Foo::B(i) => i,
+ | ^^^^^^^^^ not a tuple variant or struct
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0164`.
diff --git a/src/test/ui/error-codes/E0184.rs b/src/test/ui/error-codes/E0184.rs
new file mode 100644
index 000000000..0c448e4ad
--- /dev/null
+++ b/src/test/ui/error-codes/E0184.rs
@@ -0,0 +1,10 @@
+#[derive(Copy)] //~ ERROR E0184
+struct Foo;
+
+impl Drop for Foo {
+ fn drop(&mut self) {
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0184.stderr b/src/test/ui/error-codes/E0184.stderr
new file mode 100644
index 000000000..bb3017b6e
--- /dev/null
+++ b/src/test/ui/error-codes/E0184.stderr
@@ -0,0 +1,11 @@
+error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
+ --> $DIR/E0184.rs:1:10
+ |
+LL | #[derive(Copy)]
+ | ^^^^ `Copy` not allowed on types with destructors
+ |
+ = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0184`.
diff --git a/src/test/ui/error-codes/E0185.rs b/src/test/ui/error-codes/E0185.rs
new file mode 100644
index 000000000..45eb8b0f2
--- /dev/null
+++ b/src/test/ui/error-codes/E0185.rs
@@ -0,0 +1,15 @@
+trait Foo {
+ fn foo();
+ //~^ NOTE trait method declared without `&self`
+}
+
+struct Bar;
+
+impl Foo for Bar {
+ fn foo(&self) {}
+ //~^ ERROR E0185
+ //~| NOTE `&self` used in impl
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0185.stderr b/src/test/ui/error-codes/E0185.stderr
new file mode 100644
index 000000000..8a99c0688
--- /dev/null
+++ b/src/test/ui/error-codes/E0185.stderr
@@ -0,0 +1,12 @@
+error[E0185]: method `foo` has a `&self` declaration in the impl, but not in the trait
+ --> $DIR/E0185.rs:9:5
+ |
+LL | fn foo();
+ | --------- trait method declared without `&self`
+...
+LL | fn foo(&self) {}
+ | ^^^^^^^^^^^^^ `&self` used in impl
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0185`.
diff --git a/src/test/ui/error-codes/E0186.rs b/src/test/ui/error-codes/E0186.rs
new file mode 100644
index 000000000..83ef78ef2
--- /dev/null
+++ b/src/test/ui/error-codes/E0186.rs
@@ -0,0 +1,13 @@
+trait Foo {
+ fn foo(&self); //~ `&self` used in trait
+}
+
+struct Bar;
+
+impl Foo for Bar {
+ fn foo() {} //~ ERROR E0186
+ //~^ expected `&self` in impl
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0186.stderr b/src/test/ui/error-codes/E0186.stderr
new file mode 100644
index 000000000..8971d61fc
--- /dev/null
+++ b/src/test/ui/error-codes/E0186.stderr
@@ -0,0 +1,12 @@
+error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl
+ --> $DIR/E0186.rs:8:5
+ |
+LL | fn foo(&self);
+ | -------------- `&self` used in trait
+...
+LL | fn foo() {}
+ | ^^^^^^^^ expected `&self` in impl
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0186`.
diff --git a/src/test/ui/error-codes/E0191.rs b/src/test/ui/error-codes/E0191.rs
new file mode 100644
index 000000000..22f739b9e
--- /dev/null
+++ b/src/test/ui/error-codes/E0191.rs
@@ -0,0 +1,7 @@
+trait Trait {
+ type Bar;
+}
+
+type Foo = dyn Trait; //~ ERROR E0191
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0191.stderr b/src/test/ui/error-codes/E0191.stderr
new file mode 100644
index 000000000..cf80c9c46
--- /dev/null
+++ b/src/test/ui/error-codes/E0191.stderr
@@ -0,0 +1,12 @@
+error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified
+ --> $DIR/E0191.rs:5:16
+ |
+LL | type Bar;
+ | -------- `Bar` defined here
+...
+LL | type Foo = dyn Trait;
+ | ^^^^^ help: specify the associated type: `Trait<Bar = Type>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0191`.
diff --git a/src/test/ui/error-codes/E0194.rs b/src/test/ui/error-codes/E0194.rs
new file mode 100644
index 000000000..8a43f38fc
--- /dev/null
+++ b/src/test/ui/error-codes/E0194.rs
@@ -0,0 +1,8 @@
+trait Foo<T> {
+ fn do_something(&self) -> T;
+ fn do_something_else<T: Clone>(&self, bar: T);
+ //~^ ERROR E0403
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0194.stderr b/src/test/ui/error-codes/E0194.stderr
new file mode 100644
index 000000000..f2c908eea
--- /dev/null
+++ b/src/test/ui/error-codes/E0194.stderr
@@ -0,0 +1,12 @@
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+ --> $DIR/E0194.rs:3:26
+ |
+LL | trait Foo<T> {
+ | - first use of `T`
+LL | fn do_something(&self) -> T;
+LL | fn do_something_else<T: Clone>(&self, bar: T);
+ | ^ already used
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0403`.
diff --git a/src/test/ui/error-codes/E0195.rs b/src/test/ui/error-codes/E0195.rs
new file mode 100644
index 000000000..f712ee42b
--- /dev/null
+++ b/src/test/ui/error-codes/E0195.rs
@@ -0,0 +1,15 @@
+trait Trait {
+ fn bar<'a,'b:'a>(x: &'a str, y: &'b str);
+ //~^ NOTE lifetimes in impl do not match this method in trait
+}
+
+struct Foo;
+
+impl Trait for Foo {
+ fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195
+ //~^ NOTE lifetimes do not match method in trait
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0195.stderr b/src/test/ui/error-codes/E0195.stderr
new file mode 100644
index 000000000..6eaa1750e
--- /dev/null
+++ b/src/test/ui/error-codes/E0195.stderr
@@ -0,0 +1,12 @@
+error[E0195]: lifetime parameters or bounds on method `bar` do not match the trait declaration
+ --> $DIR/E0195.rs:9:11
+ |
+LL | fn bar<'a,'b:'a>(x: &'a str, y: &'b str);
+ | ---------- lifetimes in impl do not match this method in trait
+...
+LL | fn bar<'a,'b>(x: &'a str, y: &'b str) {
+ | ^^^^^^^ lifetimes do not match method in trait
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0195`.
diff --git a/src/test/ui/error-codes/E0197.rs b/src/test/ui/error-codes/E0197.rs
new file mode 100644
index 000000000..4025a1f6c
--- /dev/null
+++ b/src/test/ui/error-codes/E0197.rs
@@ -0,0 +1,6 @@
+struct Foo;
+
+unsafe impl Foo { } //~ ERROR E0197
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0197.stderr b/src/test/ui/error-codes/E0197.stderr
new file mode 100644
index 000000000..35e104264
--- /dev/null
+++ b/src/test/ui/error-codes/E0197.stderr
@@ -0,0 +1,11 @@
+error[E0197]: inherent impls cannot be unsafe
+ --> $DIR/E0197.rs:3:13
+ |
+LL | unsafe impl Foo { }
+ | ------ ^^^ inherent impl for this type
+ | |
+ | unsafe because of this
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0197`.
diff --git a/src/test/ui/error-codes/E0198.rs b/src/test/ui/error-codes/E0198.rs
new file mode 100644
index 000000000..041bbe8fd
--- /dev/null
+++ b/src/test/ui/error-codes/E0198.rs
@@ -0,0 +1,8 @@
+#![feature(negative_impls)]
+
+struct Foo;
+
+unsafe impl !Send for Foo { } //~ ERROR E0198
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0198.stderr b/src/test/ui/error-codes/E0198.stderr
new file mode 100644
index 000000000..bb2efefb4
--- /dev/null
+++ b/src/test/ui/error-codes/E0198.stderr
@@ -0,0 +1,12 @@
+error[E0198]: negative impls cannot be unsafe
+ --> $DIR/E0198.rs:5:13
+ |
+LL | unsafe impl !Send for Foo { }
+ | ------ -^^^^
+ | | |
+ | | negative because of this
+ | unsafe because of this
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0198`.
diff --git a/src/test/ui/error-codes/E0199.rs b/src/test/ui/error-codes/E0199.rs
new file mode 100644
index 000000000..2421bf0a5
--- /dev/null
+++ b/src/test/ui/error-codes/E0199.rs
@@ -0,0 +1,9 @@
+#![feature(negative_impls)]
+
+struct Foo;
+
+trait Bar { }
+unsafe impl Bar for Foo { } //~ ERROR implementing the trait `Bar` is not unsafe [E0199]
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0199.stderr b/src/test/ui/error-codes/E0199.stderr
new file mode 100644
index 000000000..3632d26cd
--- /dev/null
+++ b/src/test/ui/error-codes/E0199.stderr
@@ -0,0 +1,9 @@
+error[E0199]: implementing the trait `Bar` is not unsafe
+ --> $DIR/E0199.rs:6:1
+ |
+LL | unsafe impl Bar for Foo { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0199`.
diff --git a/src/test/ui/error-codes/E0200.rs b/src/test/ui/error-codes/E0200.rs
new file mode 100644
index 000000000..24806a6cb
--- /dev/null
+++ b/src/test/ui/error-codes/E0200.rs
@@ -0,0 +1,8 @@
+struct Foo;
+
+unsafe trait Bar { }
+
+impl Bar for Foo { } //~ ERROR E0200
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0200.stderr b/src/test/ui/error-codes/E0200.stderr
new file mode 100644
index 000000000..677271aad
--- /dev/null
+++ b/src/test/ui/error-codes/E0200.stderr
@@ -0,0 +1,9 @@
+error[E0200]: the trait `Bar` requires an `unsafe impl` declaration
+ --> $DIR/E0200.rs:5:1
+ |
+LL | impl Bar for Foo { }
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0200`.
diff --git a/src/test/ui/error-codes/E0201.rs b/src/test/ui/error-codes/E0201.rs
new file mode 100644
index 000000000..adefd4bcd
--- /dev/null
+++ b/src/test/ui/error-codes/E0201.rs
@@ -0,0 +1,22 @@
+struct Foo(u8);
+
+impl Foo {
+ fn bar(&self) -> bool { self.0 > 5 }
+ fn bar() {} //~ ERROR E0201
+}
+
+trait Baz {
+ type Quux;
+ fn baz(&self) -> bool;
+}
+
+impl Baz for Foo {
+ type Quux = u32;
+
+ fn baz(&self) -> bool { true }
+ fn baz(&self) -> bool { self.0 > 5 } //~ ERROR E0201
+ type Quux = u32; //~ ERROR E0201
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0201.stderr b/src/test/ui/error-codes/E0201.stderr
new file mode 100644
index 000000000..94e068941
--- /dev/null
+++ b/src/test/ui/error-codes/E0201.stderr
@@ -0,0 +1,28 @@
+error[E0201]: duplicate definitions with name `bar`:
+ --> $DIR/E0201.rs:5:5
+ |
+LL | fn bar(&self) -> bool { self.0 > 5 }
+ | --------------------- previous definition of `bar` here
+LL | fn bar() {}
+ | ^^^^^^^^ duplicate definition
+
+error[E0201]: duplicate definitions with name `baz`:
+ --> $DIR/E0201.rs:17:5
+ |
+LL | fn baz(&self) -> bool { true }
+ | --------------------- previous definition of `baz` here
+LL | fn baz(&self) -> bool { self.0 > 5 }
+ | ^^^^^^^^^^^^^^^^^^^^^ duplicate definition
+
+error[E0201]: duplicate definitions with name `Quux`:
+ --> $DIR/E0201.rs:18:5
+ |
+LL | type Quux = u32;
+ | --------- previous definition of `Quux` here
+...
+LL | type Quux = u32;
+ | ^^^^^^^^^ duplicate definition
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0201`.
diff --git a/src/test/ui/error-codes/E0206.rs b/src/test/ui/error-codes/E0206.rs
new file mode 100644
index 000000000..0f3d427ce
--- /dev/null
+++ b/src/test/ui/error-codes/E0206.rs
@@ -0,0 +1,8 @@
+#[derive(Copy, Clone)]
+struct Bar;
+
+impl Copy for &'static mut Bar { }
+//~^ ERROR the trait `Copy` may not be implemented for this type
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0206.stderr b/src/test/ui/error-codes/E0206.stderr
new file mode 100644
index 000000000..57ae2647d
--- /dev/null
+++ b/src/test/ui/error-codes/E0206.stderr
@@ -0,0 +1,9 @@
+error[E0206]: the trait `Copy` may not be implemented for this type
+ --> $DIR/E0206.rs:4:15
+ |
+LL | impl Copy for &'static mut Bar { }
+ | ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0206`.
diff --git a/src/test/ui/error-codes/E0207.rs b/src/test/ui/error-codes/E0207.rs
new file mode 100644
index 000000000..7f5d4ab51
--- /dev/null
+++ b/src/test/ui/error-codes/E0207.rs
@@ -0,0 +1,10 @@
+struct Foo;
+
+impl<T: Default> Foo { //~ ERROR E0207
+ fn get(&self) -> T {
+ <T as Default>::default()
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0207.stderr b/src/test/ui/error-codes/E0207.stderr
new file mode 100644
index 000000000..5ef51ed86
--- /dev/null
+++ b/src/test/ui/error-codes/E0207.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/E0207.rs:3:6
+ |
+LL | impl<T: Default> Foo {
+ | ^ unconstrained type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/error-codes/E0214.rs b/src/test/ui/error-codes/E0214.rs
new file mode 100644
index 000000000..fd73189f9
--- /dev/null
+++ b/src/test/ui/error-codes/E0214.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let v: Vec(&str) = vec!["foo"];
+ //~^ ERROR E0214
+}
diff --git a/src/test/ui/error-codes/E0214.stderr b/src/test/ui/error-codes/E0214.stderr
new file mode 100644
index 000000000..e0179aac2
--- /dev/null
+++ b/src/test/ui/error-codes/E0214.stderr
@@ -0,0 +1,14 @@
+error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
+ --> $DIR/E0214.rs:2:12
+ |
+LL | let v: Vec(&str) = vec!["foo"];
+ | ^^^^^^^^^ only `Fn` traits may use parentheses
+ |
+help: use angle brackets instead
+ |
+LL | let v: Vec<&str> = vec!["foo"];
+ | ~ ~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0214`.
diff --git a/src/test/ui/error-codes/E0220.rs b/src/test/ui/error-codes/E0220.rs
new file mode 100644
index 000000000..e11a570df
--- /dev/null
+++ b/src/test/ui/error-codes/E0220.rs
@@ -0,0 +1,8 @@
+trait Trait {
+ type Bar;
+}
+
+type Foo = dyn Trait<F=i32>; //~ ERROR E0220
+ //~| ERROR E0191
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0220.stderr b/src/test/ui/error-codes/E0220.stderr
new file mode 100644
index 000000000..11763ce78
--- /dev/null
+++ b/src/test/ui/error-codes/E0220.stderr
@@ -0,0 +1,19 @@
+error[E0220]: associated type `F` not found for `Trait`
+ --> $DIR/E0220.rs:5:22
+ |
+LL | type Foo = dyn Trait<F=i32>;
+ | ^ associated type `F` not found
+
+error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified
+ --> $DIR/E0220.rs:5:16
+ |
+LL | type Bar;
+ | -------- `Bar` defined here
+...
+LL | type Foo = dyn Trait<F=i32>;
+ | ^^^^^^^^^^^^ help: specify the associated type: `Trait<F=i32, Bar = Type>`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0191, E0220.
+For more information about an error, try `rustc --explain E0191`.
diff --git a/src/test/ui/error-codes/E0221.rs b/src/test/ui/error-codes/E0221.rs
new file mode 100644
index 000000000..7c7e139a0
--- /dev/null
+++ b/src/test/ui/error-codes/E0221.rs
@@ -0,0 +1,27 @@
+trait T1 {}
+trait T2 {}
+
+trait Foo {
+ type A: T1;
+}
+
+trait Bar : Foo {
+ type A: T2;
+ fn do_something() {
+ let _: Self::A;
+ //~^ ERROR E0221
+ }
+}
+
+trait T3 {}
+
+trait My : std::str::FromStr {
+ type Err: T3;
+ fn test() {
+ let _: Self::Err;
+ //~^ ERROR E0221
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0221.stderr b/src/test/ui/error-codes/E0221.stderr
new file mode 100644
index 000000000..5414d77ad
--- /dev/null
+++ b/src/test/ui/error-codes/E0221.stderr
@@ -0,0 +1,39 @@
+error[E0221]: ambiguous associated type `A` in bounds of `Self`
+ --> $DIR/E0221.rs:11:16
+ |
+LL | type A: T1;
+ | ---------- ambiguous `A` from `Foo`
+...
+LL | type A: T2;
+ | ---------- ambiguous `A` from `Bar`
+LL | fn do_something() {
+LL | let _: Self::A;
+ | ^^^^^^^ ambiguous associated type `A`
+ |
+help: use fully qualified syntax to disambiguate
+ |
+LL | let _: <Self as Foo>::A;
+ | ~~~~~~~~~~~~~~~
+help: use fully qualified syntax to disambiguate
+ |
+LL | let _: <Self as Bar>::A;
+ | ~~~~~~~~~~~~~~~
+
+error[E0221]: ambiguous associated type `Err` in bounds of `Self`
+ --> $DIR/E0221.rs:21:16
+ |
+LL | type Err: T3;
+ | ------------ ambiguous `Err` from `My`
+LL | fn test() {
+LL | let _: Self::Err;
+ | ^^^^^^^^^ ambiguous associated type `Err`
+ |
+ = note: associated type `Self` could derive from `FromStr`
+help: use fully qualified syntax to disambiguate
+ |
+LL | let _: <Self as My>::Err;
+ | ~~~~~~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0221`.
diff --git a/src/test/ui/error-codes/E0223.rs b/src/test/ui/error-codes/E0223.rs
new file mode 100644
index 000000000..6031b682d
--- /dev/null
+++ b/src/test/ui/error-codes/E0223.rs
@@ -0,0 +1,6 @@
+trait MyTrait { type X; }
+
+fn main() {
+ let foo: MyTrait::X;
+ //~^ ERROR ambiguous associated type
+}
diff --git a/src/test/ui/error-codes/E0223.stderr b/src/test/ui/error-codes/E0223.stderr
new file mode 100644
index 000000000..726f39e11
--- /dev/null
+++ b/src/test/ui/error-codes/E0223.stderr
@@ -0,0 +1,9 @@
+error[E0223]: ambiguous associated type
+ --> $DIR/E0223.rs:4:14
+ |
+LL | let foo: MyTrait::X;
+ | ^^^^^^^^^^ help: use fully-qualified syntax: `<Type as MyTrait>::X`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0223`.
diff --git a/src/test/ui/error-codes/E0225.rs b/src/test/ui/error-codes/E0225.rs
new file mode 100644
index 000000000..b50f68e64
--- /dev/null
+++ b/src/test/ui/error-codes/E0225.rs
@@ -0,0 +1,10 @@
+#![feature(trait_alias)]
+
+trait Foo = std::io::Read + std::io::Write;
+
+fn main() {
+ let _: Box<dyn std::io::Read + std::io::Write>;
+ //~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
+ let _: Box<dyn Foo>;
+ //~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
+}
diff --git a/src/test/ui/error-codes/E0225.stderr b/src/test/ui/error-codes/E0225.stderr
new file mode 100644
index 000000000..a4b33a0b7
--- /dev/null
+++ b/src/test/ui/error-codes/E0225.stderr
@@ -0,0 +1,31 @@
+error[E0225]: only auto traits can be used as additional traits in a trait object
+ --> $DIR/E0225.rs:6:36
+ |
+LL | let _: Box<dyn std::io::Read + std::io::Write>;
+ | ------------- ^^^^^^^^^^^^^^ additional non-auto trait
+ | |
+ | first non-auto trait
+ |
+ = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: std::io::Read + std::io::Write {}`
+ = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
+
+error[E0225]: only auto traits can be used as additional traits in a trait object
+ --> $DIR/E0225.rs:8:20
+ |
+LL | trait Foo = std::io::Read + std::io::Write;
+ | ------------- -------------- additional non-auto trait
+ | |
+ | first non-auto trait
+...
+LL | let _: Box<dyn Foo>;
+ | ^^^
+ | |
+ | trait alias used in trait object type (additional use)
+ | trait alias used in trait object type (first use)
+ |
+ = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: std::io::Read + std::io::Write {}`
+ = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0225`.
diff --git a/src/test/ui/error-codes/E0227.rs b/src/test/ui/error-codes/E0227.rs
new file mode 100644
index 000000000..0f0a781d2
--- /dev/null
+++ b/src/test/ui/error-codes/E0227.rs
@@ -0,0 +1,12 @@
+trait Foo<'foo>: 'foo {}
+trait Bar<'bar>: 'bar {}
+
+trait FooBar<'foo, 'bar>: Foo<'foo> + Bar<'bar> {}
+
+struct Baz<'foo, 'bar> {
+ baz: dyn FooBar<'foo, 'bar>,
+ //~^ ERROR ambiguous lifetime bound, explicit lifetime bound required
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0227.stderr b/src/test/ui/error-codes/E0227.stderr
new file mode 100644
index 000000000..26de5b4c4
--- /dev/null
+++ b/src/test/ui/error-codes/E0227.stderr
@@ -0,0 +1,9 @@
+error[E0227]: ambiguous lifetime bound, explicit lifetime bound required
+ --> $DIR/E0227.rs:7:10
+ |
+LL | baz: dyn FooBar<'foo, 'bar>,
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0227`.
diff --git a/src/test/ui/error-codes/E0229.rs b/src/test/ui/error-codes/E0229.rs
new file mode 100644
index 000000000..4c1934107
--- /dev/null
+++ b/src/test/ui/error-codes/E0229.rs
@@ -0,0 +1,17 @@
+pub trait Foo {
+ type A;
+ fn boo(&self) -> <Self as Foo>::A;
+}
+
+struct Bar;
+
+impl Foo for isize {
+ type A = usize;
+ fn boo(&self) -> usize { 42 }
+}
+
+fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
+//~^ ERROR associated type bindings are not allowed here [E0229]
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0229.stderr b/src/test/ui/error-codes/E0229.stderr
new file mode 100644
index 000000000..46793314b
--- /dev/null
+++ b/src/test/ui/error-codes/E0229.stderr
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/E0229.rs:13:25
+ |
+LL | fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
+ | ^^^^^ associated type not allowed here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0229`.
diff --git a/src/test/ui/error-codes/E0252.rs b/src/test/ui/error-codes/E0252.rs
new file mode 100644
index 000000000..6b5163417
--- /dev/null
+++ b/src/test/ui/error-codes/E0252.rs
@@ -0,0 +1,15 @@
+#![allow(non_camel_case_types)]
+
+use foo::baz;
+use bar::baz; //~ ERROR E0252
+
+mod foo {
+ pub struct baz;
+}
+
+mod bar {
+ pub mod baz {}
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0252.stderr b/src/test/ui/error-codes/E0252.stderr
new file mode 100644
index 000000000..2722dfe5e
--- /dev/null
+++ b/src/test/ui/error-codes/E0252.stderr
@@ -0,0 +1,17 @@
+error[E0252]: the name `baz` is defined multiple times
+ --> $DIR/E0252.rs:4:5
+ |
+LL | use foo::baz;
+ | -------- previous import of the type `baz` here
+LL | use bar::baz;
+ | ^^^^^^^^ `baz` reimported here
+ |
+ = note: `baz` must be defined only once in the type namespace of this module
+help: you can use `as` to change the binding name of the import
+ |
+LL | use bar::baz as other_baz;
+ | ~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0252`.
diff --git a/src/test/ui/error-codes/E0253.rs b/src/test/ui/error-codes/E0253.rs
new file mode 100644
index 000000000..284b16da8
--- /dev/null
+++ b/src/test/ui/error-codes/E0253.rs
@@ -0,0 +1,10 @@
+mod foo {
+ pub trait MyTrait {
+ fn do_something();
+ }
+}
+
+use foo::MyTrait::do_something;
+ //~^ ERROR E0253
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0253.stderr b/src/test/ui/error-codes/E0253.stderr
new file mode 100644
index 000000000..8f21a0aab
--- /dev/null
+++ b/src/test/ui/error-codes/E0253.stderr
@@ -0,0 +1,9 @@
+error[E0253]: `do_something` is not directly importable
+ --> $DIR/E0253.rs:7:5
+ |
+LL | use foo::MyTrait::do_something;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0253`.
diff --git a/src/test/ui/error-codes/E0254.rs b/src/test/ui/error-codes/E0254.rs
new file mode 100644
index 000000000..e291268be
--- /dev/null
+++ b/src/test/ui/error-codes/E0254.rs
@@ -0,0 +1,14 @@
+#![allow(non_camel_case_types)]
+
+extern crate alloc;
+
+mod foo {
+ pub trait alloc {
+ fn do_something();
+ }
+}
+
+use foo::alloc;
+//~^ ERROR E0254
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0254.stderr b/src/test/ui/error-codes/E0254.stderr
new file mode 100644
index 000000000..b098f8e1a
--- /dev/null
+++ b/src/test/ui/error-codes/E0254.stderr
@@ -0,0 +1,18 @@
+error[E0254]: the name `alloc` is defined multiple times
+ --> $DIR/E0254.rs:11:5
+ |
+LL | extern crate alloc;
+ | ------------------- previous import of the extern crate `alloc` here
+...
+LL | use foo::alloc;
+ | ^^^^^^^^^^ `alloc` reimported here
+ |
+ = note: `alloc` must be defined only once in the type namespace of this module
+help: you can use `as` to change the binding name of the import
+ |
+LL | use foo::alloc as other_alloc;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0254`.
diff --git a/src/test/ui/error-codes/E0255.rs b/src/test/ui/error-codes/E0255.rs
new file mode 100644
index 000000000..d1c21eb79
--- /dev/null
+++ b/src/test/ui/error-codes/E0255.rs
@@ -0,0 +1,9 @@
+use bar::foo;
+
+fn foo() {} //~ ERROR E0255
+
+mod bar {
+ pub fn foo() {}
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0255.stderr b/src/test/ui/error-codes/E0255.stderr
new file mode 100644
index 000000000..352c5ba5b
--- /dev/null
+++ b/src/test/ui/error-codes/E0255.stderr
@@ -0,0 +1,18 @@
+error[E0255]: the name `foo` is defined multiple times
+ --> $DIR/E0255.rs:3:1
+ |
+LL | use bar::foo;
+ | -------- previous import of the value `foo` here
+LL |
+LL | fn foo() {}
+ | ^^^^^^^^ `foo` redefined here
+ |
+ = note: `foo` must be defined only once in the value namespace of this module
+help: you can use `as` to change the binding name of the import
+ |
+LL | use bar::foo as other_foo;
+ | ~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0255`.
diff --git a/src/test/ui/error-codes/E0259.rs b/src/test/ui/error-codes/E0259.rs
new file mode 100644
index 000000000..e7e94d586
--- /dev/null
+++ b/src/test/ui/error-codes/E0259.rs
@@ -0,0 +1,8 @@
+#![feature(rustc_private)]
+
+extern crate alloc;
+
+extern crate libc as alloc;
+//~^ ERROR E0259
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0259.stderr b/src/test/ui/error-codes/E0259.stderr
new file mode 100644
index 000000000..06cbc5b4f
--- /dev/null
+++ b/src/test/ui/error-codes/E0259.stderr
@@ -0,0 +1,18 @@
+error[E0259]: the name `alloc` is defined multiple times
+ --> $DIR/E0259.rs:5:1
+ |
+LL | extern crate alloc;
+ | ------------------- previous import of the extern crate `alloc` here
+LL |
+LL | extern crate libc as alloc;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `alloc` reimported here
+ |
+ = note: `alloc` must be defined only once in the type namespace of this module
+help: you can use `as` to change the binding name of the import
+ |
+LL | extern crate libc as other_alloc;
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0259`.
diff --git a/src/test/ui/error-codes/E0260.rs b/src/test/ui/error-codes/E0260.rs
new file mode 100644
index 000000000..f7eb220b0
--- /dev/null
+++ b/src/test/ui/error-codes/E0260.rs
@@ -0,0 +1,10 @@
+extern crate alloc;
+
+mod alloc {
+//~^ ERROR the name `alloc` is defined multiple times [E0260]
+ pub trait MyTrait {
+ fn do_something();
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0260.stderr b/src/test/ui/error-codes/E0260.stderr
new file mode 100644
index 000000000..2d3305bd1
--- /dev/null
+++ b/src/test/ui/error-codes/E0260.stderr
@@ -0,0 +1,18 @@
+error[E0260]: the name `alloc` is defined multiple times
+ --> $DIR/E0260.rs:3:1
+ |
+LL | extern crate alloc;
+ | ------------------- previous import of the extern crate `alloc` here
+LL |
+LL | mod alloc {
+ | ^^^^^^^^^ `alloc` redefined here
+ |
+ = note: `alloc` must be defined only once in the type namespace of this module
+help: you can use `as` to change the binding name of the import
+ |
+LL | extern crate alloc as other_alloc;
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0260`.
diff --git a/src/test/ui/error-codes/E0261.rs b/src/test/ui/error-codes/E0261.rs
new file mode 100644
index 000000000..f05e09aa0
--- /dev/null
+++ b/src/test/ui/error-codes/E0261.rs
@@ -0,0 +1,9 @@
+fn foo(x: &'a str) { } //~ ERROR E0261
+ //~| undeclared lifetime
+
+struct Foo {
+ x: &'a str, //~ ERROR E0261
+ //~| undeclared lifetime
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0261.stderr b/src/test/ui/error-codes/E0261.stderr
new file mode 100644
index 000000000..0eab2dc0e
--- /dev/null
+++ b/src/test/ui/error-codes/E0261.stderr
@@ -0,0 +1,19 @@
+error[E0261]: use of undeclared lifetime name `'a`
+ --> $DIR/E0261.rs:1:12
+ |
+LL | fn foo(x: &'a str) { }
+ | - ^^ undeclared lifetime
+ | |
+ | help: consider introducing lifetime `'a` here: `<'a>`
+
+error[E0261]: use of undeclared lifetime name `'a`
+ --> $DIR/E0261.rs:5:9
+ |
+LL | struct Foo {
+ | - help: consider introducing lifetime `'a` here: `<'a>`
+LL | x: &'a str,
+ | ^^ undeclared lifetime
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/src/test/ui/error-codes/E0262.rs b/src/test/ui/error-codes/E0262.rs
new file mode 100644
index 000000000..55264f138
--- /dev/null
+++ b/src/test/ui/error-codes/E0262.rs
@@ -0,0 +1,4 @@
+fn foo<'static>(x: &'static str) { } //~ ERROR E0262
+ //~| 'static is a reserved lifetime name
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0262.stderr b/src/test/ui/error-codes/E0262.stderr
new file mode 100644
index 000000000..ad90b7171
--- /dev/null
+++ b/src/test/ui/error-codes/E0262.stderr
@@ -0,0 +1,9 @@
+error[E0262]: invalid lifetime parameter name: `'static`
+ --> $DIR/E0262.rs:1:8
+ |
+LL | fn foo<'static>(x: &'static str) { }
+ | ^^^^^^^ 'static is a reserved lifetime name
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0262`.
diff --git a/src/test/ui/error-codes/E0263.rs b/src/test/ui/error-codes/E0263.rs
new file mode 100644
index 000000000..92917678e
--- /dev/null
+++ b/src/test/ui/error-codes/E0263.rs
@@ -0,0 +1,5 @@
+fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
+ //~^ ERROR E0403
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0263.stderr b/src/test/ui/error-codes/E0263.stderr
new file mode 100644
index 000000000..e3f9aea29
--- /dev/null
+++ b/src/test/ui/error-codes/E0263.stderr
@@ -0,0 +1,11 @@
+error[E0403]: the name `'a` is already used for a generic parameter in this item's generic parameters
+ --> $DIR/E0263.rs:1:16
+ |
+LL | fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
+ | -- ^^ already used
+ | |
+ | first use of `'a`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0403`.
diff --git a/src/test/ui/error-codes/E0264.rs b/src/test/ui/error-codes/E0264.rs
new file mode 100644
index 000000000..6adaf01fb
--- /dev/null
+++ b/src/test/ui/error-codes/E0264.rs
@@ -0,0 +1,8 @@
+#![feature(lang_items)]
+
+extern "C" {
+ #[lang = "cake"]
+ fn cake(); //~ ERROR E0264
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0264.stderr b/src/test/ui/error-codes/E0264.stderr
new file mode 100644
index 000000000..e8e35a12c
--- /dev/null
+++ b/src/test/ui/error-codes/E0264.stderr
@@ -0,0 +1,9 @@
+error[E0264]: unknown external lang item: `cake`
+ --> $DIR/E0264.rs:5:5
+ |
+LL | fn cake();
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0264`.
diff --git a/src/test/ui/error-codes/E0267.rs b/src/test/ui/error-codes/E0267.rs
new file mode 100644
index 000000000..45e875a0a
--- /dev/null
+++ b/src/test/ui/error-codes/E0267.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let w = || { break; }; //~ ERROR E0267
+}
diff --git a/src/test/ui/error-codes/E0267.stderr b/src/test/ui/error-codes/E0267.stderr
new file mode 100644
index 000000000..1f8657373
--- /dev/null
+++ b/src/test/ui/error-codes/E0267.stderr
@@ -0,0 +1,11 @@
+error[E0267]: `break` inside of a closure
+ --> $DIR/E0267.rs:2:18
+ |
+LL | let w = || { break; };
+ | -- ^^^^^ cannot `break` inside of a closure
+ | |
+ | enclosing closure
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0267`.
diff --git a/src/test/ui/error-codes/E0268.rs b/src/test/ui/error-codes/E0268.rs
new file mode 100644
index 000000000..742ba5441
--- /dev/null
+++ b/src/test/ui/error-codes/E0268.rs
@@ -0,0 +1,3 @@
+fn main() {
+ break; //~ ERROR E0268
+}
diff --git a/src/test/ui/error-codes/E0268.stderr b/src/test/ui/error-codes/E0268.stderr
new file mode 100644
index 000000000..c926f9e48
--- /dev/null
+++ b/src/test/ui/error-codes/E0268.stderr
@@ -0,0 +1,9 @@
+error[E0268]: `break` outside of a loop
+ --> $DIR/E0268.rs:2:5
+ |
+LL | break;
+ | ^^^^^ cannot `break` outside of a loop
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0268`.
diff --git a/src/test/ui/error-codes/E0271.rs b/src/test/ui/error-codes/E0271.rs
new file mode 100644
index 000000000..f27190754
--- /dev/null
+++ b/src/test/ui/error-codes/E0271.rs
@@ -0,0 +1,11 @@
+trait Trait { type AssociatedType; }
+
+fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
+ println!("in foo");
+}
+
+impl Trait for i8 { type AssociatedType = &'static str; }
+
+fn main() {
+ foo(3_i8); //~ ERROR E0271
+}
diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr
new file mode 100644
index 000000000..9c9c7237d
--- /dev/null
+++ b/src/test/ui/error-codes/E0271.stderr
@@ -0,0 +1,20 @@
+error[E0271]: type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
+ --> $DIR/E0271.rs:10:5
+ |
+LL | foo(3_i8);
+ | ^^^ type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
+ |
+note: expected this to be `u32`
+ --> $DIR/E0271.rs:7:43
+ |
+LL | impl Trait for i8 { type AssociatedType = &'static str; }
+ | ^^^^^^^^^^^^
+note: required by a bound in `foo`
+ --> $DIR/E0271.rs:3:32
+ |
+LL | fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/error-codes/E0275.rs b/src/test/ui/error-codes/E0275.rs
new file mode 100644
index 000000000..28a9676f0
--- /dev/null
+++ b/src/test/ui/error-codes/E0275.rs
@@ -0,0 +1,8 @@
+trait Foo {}
+
+struct Bar<T>(T);
+
+impl<T> Foo for T where Bar<T>: Foo {} //~ ERROR E0275
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0275.stderr b/src/test/ui/error-codes/E0275.stderr
new file mode 100644
index 000000000..dfffbb182
--- /dev/null
+++ b/src/test/ui/error-codes/E0275.stderr
@@ -0,0 +1,18 @@
+error[E0275]: overflow evaluating the requirement `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo`
+ --> $DIR/E0275.rs:5:33
+ |
+LL | impl<T> Foo for T where Bar<T>: Foo {}
+ | ^^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`E0275`)
+note: required because of the requirements on the impl of `Foo` for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/E0275.rs:5:9
+ |
+LL | impl<T> Foo for T where Bar<T>: Foo {}
+ | ^^^ ^
+ = note: 127 redundant requirements hidden
+ = note: required because of the requirements on the impl of `Foo` for `Bar<T>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/error-codes/E0276.rs b/src/test/ui/error-codes/E0276.rs
new file mode 100644
index 000000000..5e3d9f602
--- /dev/null
+++ b/src/test/ui/error-codes/E0276.rs
@@ -0,0 +1,10 @@
+trait Foo {
+ fn foo<T>(x: T);
+}
+
+impl Foo for bool {
+ fn foo<T>(x: T) where T: Copy {} //~ ERROR E0276
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0276.stderr b/src/test/ui/error-codes/E0276.stderr
new file mode 100644
index 000000000..1013f041b
--- /dev/null
+++ b/src/test/ui/error-codes/E0276.stderr
@@ -0,0 +1,12 @@
+error[E0276]: impl has stricter requirements than trait
+ --> $DIR/E0276.rs:6:30
+ |
+LL | fn foo<T>(x: T);
+ | ---------------- definition of `foo` from trait
+...
+LL | fn foo<T>(x: T) where T: Copy {}
+ | ^^^^ impl has extra requirement `T: Copy`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0276`.
diff --git a/src/test/ui/error-codes/E0277-2.rs b/src/test/ui/error-codes/E0277-2.rs
new file mode 100644
index 000000000..428518705
--- /dev/null
+++ b/src/test/ui/error-codes/E0277-2.rs
@@ -0,0 +1,18 @@
+struct Foo {
+ bar: Bar
+}
+
+struct Bar {
+ baz: Baz
+}
+
+struct Baz {
+ x: *const u8
+}
+
+fn is_send<T: Send>() { }
+
+fn main() {
+ is_send::<Foo>();
+ //~^ ERROR `*const u8` cannot be sent between threads safely
+}
diff --git a/src/test/ui/error-codes/E0277-2.stderr b/src/test/ui/error-codes/E0277-2.stderr
new file mode 100644
index 000000000..ca2cb8842
--- /dev/null
+++ b/src/test/ui/error-codes/E0277-2.stderr
@@ -0,0 +1,31 @@
+error[E0277]: `*const u8` cannot be sent between threads safely
+ --> $DIR/E0277-2.rs:16:5
+ |
+LL | is_send::<Foo>();
+ | ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
+ |
+ = help: within `Foo`, the trait `Send` is not implemented for `*const u8`
+note: required because it appears within the type `Baz`
+ --> $DIR/E0277-2.rs:9:8
+ |
+LL | struct Baz {
+ | ^^^
+note: required because it appears within the type `Bar`
+ --> $DIR/E0277-2.rs:5:8
+ |
+LL | struct Bar {
+ | ^^^
+note: required because it appears within the type `Foo`
+ --> $DIR/E0277-2.rs:1:8
+ |
+LL | struct Foo {
+ | ^^^
+note: required by a bound in `is_send`
+ --> $DIR/E0277-2.rs:13:15
+ |
+LL | fn is_send<T: Send>() { }
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/error-codes/E0277-3.rs b/src/test/ui/error-codes/E0277-3.rs
new file mode 100644
index 000000000..428be7961
--- /dev/null
+++ b/src/test/ui/error-codes/E0277-3.rs
@@ -0,0 +1,8 @@
+fn foo<T: PartialEq>(_: T) {}
+
+struct S;
+
+fn main() {
+ foo(S);
+ //~^ ERROR can't compare `S` with `S`
+}
diff --git a/src/test/ui/error-codes/E0277-3.stderr b/src/test/ui/error-codes/E0277-3.stderr
new file mode 100644
index 000000000..0127e1ccc
--- /dev/null
+++ b/src/test/ui/error-codes/E0277-3.stderr
@@ -0,0 +1,22 @@
+error[E0277]: can't compare `S` with `S`
+ --> $DIR/E0277-3.rs:6:9
+ |
+LL | foo(S);
+ | --- ^ no implementation for `S == S`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `PartialEq` is not implemented for `S`
+note: required by a bound in `foo`
+ --> $DIR/E0277-3.rs:1:11
+ |
+LL | fn foo<T: PartialEq>(_: T) {}
+ | ^^^^^^^^^ required by this bound in `foo`
+help: consider annotating `S` with `#[derive(PartialEq)]`
+ |
+LL | #[derive(PartialEq)]
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/error-codes/E0277.rs b/src/test/ui/error-codes/E0277.rs
new file mode 100644
index 000000000..f0de4e3de
--- /dev/null
+++ b/src/test/ui/error-codes/E0277.rs
@@ -0,0 +1,17 @@
+use std::path::Path;
+
+trait Foo {
+ fn bar(&self);
+}
+
+fn some_func<T: Foo>(foo: T) {
+ foo.bar();
+}
+
+fn f(p: Path) { }
+//~^ ERROR the size for values of type
+
+fn main() {
+ some_func(5i32);
+ //~^ ERROR the trait bound `i32: Foo` is not satisfied
+}
diff --git a/src/test/ui/error-codes/E0277.stderr b/src/test/ui/error-codes/E0277.stderr
new file mode 100644
index 000000000..2b4784d7e
--- /dev/null
+++ b/src/test/ui/error-codes/E0277.stderr
@@ -0,0 +1,31 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/E0277.rs:11:6
+ |
+LL | fn f(p: Path) { }
+ | ^ doesn't have a size known at compile-time
+ |
+ = help: within `Path`, the trait `Sized` is not implemented for `[u8]`
+ = note: required because it appears within the type `Path`
+ = help: unsized fn params are gated as an unstable feature
+help: function arguments must have a statically known size, borrowed types always have a known size
+ |
+LL | fn f(p: &Path) { }
+ | +
+
+error[E0277]: the trait bound `i32: Foo` is not satisfied
+ --> $DIR/E0277.rs:15:15
+ |
+LL | some_func(5i32);
+ | --------- ^^^^ the trait `Foo` is not implemented for `i32`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `some_func`
+ --> $DIR/E0277.rs:7:17
+ |
+LL | fn some_func<T: Foo>(foo: T) {
+ | ^^^ required by this bound in `some_func`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/error-codes/E0282.rs b/src/test/ui/error-codes/E0282.rs
new file mode 100644
index 000000000..9bd16abb7
--- /dev/null
+++ b/src/test/ui/error-codes/E0282.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let x = "hello".chars().rev().collect(); //~ ERROR E0282
+}
diff --git a/src/test/ui/error-codes/E0282.stderr b/src/test/ui/error-codes/E0282.stderr
new file mode 100644
index 000000000..d01aa3617
--- /dev/null
+++ b/src/test/ui/error-codes/E0282.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+ --> $DIR/E0282.rs:2:9
+ |
+LL | let x = "hello".chars().rev().collect();
+ | ^
+ |
+help: consider giving `x` an explicit type
+ |
+LL | let x: _ = "hello".chars().rev().collect();
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/error-codes/E0283.rs b/src/test/ui/error-codes/E0283.rs
new file mode 100644
index 000000000..0643af4b7
--- /dev/null
+++ b/src/test/ui/error-codes/E0283.rs
@@ -0,0 +1,37 @@
+trait Generator {
+ fn create() -> u32;
+}
+
+struct Impl;
+
+impl Generator for Impl {
+ fn create() -> u32 { 1 }
+}
+
+impl Impl {
+ fn new() -> Self {
+ Impl{}
+ }
+}
+
+impl Into<u32> for Impl {
+ fn into(self) -> u32 { 1 }
+}
+
+fn foo(bar: u32) {}
+
+struct AnotherImpl;
+
+impl Generator for AnotherImpl {
+ fn create() -> u32 { 2 }
+}
+
+fn main() {
+ let cont: u32 = Generator::create(); //~ ERROR E0790
+}
+
+fn buzz() {
+ let foo_impl = Impl::new();
+ let bar = foo_impl.into() * 1u32; //~ ERROR E0283
+ foo(bar);
+}
diff --git a/src/test/ui/error-codes/E0283.stderr b/src/test/ui/error-codes/E0283.stderr
new file mode 100644
index 000000000..90a28874e
--- /dev/null
+++ b/src/test/ui/error-codes/E0283.stderr
@@ -0,0 +1,37 @@
+error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
+ --> $DIR/E0283.rs:30:21
+ |
+LL | fn create() -> u32;
+ | ------------------- `Generator::create` defined here
+...
+LL | let cont: u32 = Generator::create();
+ | ^^^^^^^^^^^^^^^^^ cannot call associated function of trait
+ |
+help: use a fully-qualified path to a specific available implementation (2 found)
+ |
+LL | let cont: u32 = <::Impl as Generator>::create();
+ | ++++++++++ +
+
+error[E0283]: type annotations needed
+ --> $DIR/E0283.rs:35:24
+ |
+LL | let bar = foo_impl.into() * 1u32;
+ | ^^^^
+ |
+note: multiple `impl`s satisfying `Impl: Into<_>` found
+ --> $DIR/E0283.rs:17:1
+ |
+LL | impl Into<u32> for Impl {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ = note: and another `impl` found in the `core` crate:
+ - impl<T, U> Into<U> for T
+ where U: From<T>;
+help: try using a fully qualified path to specify the expected types
+ |
+LL | let bar = <Impl as Into<T>>::into(foo_impl) * 1u32;
+ | ++++++++++++++++++++++++ ~
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0283, E0790.
+For more information about an error, try `rustc --explain E0283`.
diff --git a/src/test/ui/error-codes/E0297.rs b/src/test/ui/error-codes/E0297.rs
new file mode 100644
index 000000000..27c7960d9
--- /dev/null
+++ b/src/test/ui/error-codes/E0297.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let xs : Vec<Option<i32>> = vec![Some(1), None];
+
+ for Some(x) in xs {}
+ //~^ ERROR E0005
+}
diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr
new file mode 100644
index 000000000..693b07923
--- /dev/null
+++ b/src/test/ui/error-codes/E0297.stderr
@@ -0,0 +1,19 @@
+error[E0005]: refutable pattern in `for` loop binding: `None` not covered
+ --> $DIR/E0297.rs:4:9
+ |
+LL | for Some(x) in xs {}
+ | ^^^^^^^ pattern `None` not covered
+ |
+note: `Option<i32>` defined here
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
+ = note: the matched value is of type `Option<i32>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0005`.
diff --git a/src/test/ui/error-codes/E0308-2.rs b/src/test/ui/error-codes/E0308-2.rs
new file mode 100644
index 000000000..157f992da
--- /dev/null
+++ b/src/test/ui/error-codes/E0308-2.rs
@@ -0,0 +1,12 @@
+trait DynEq {}
+
+impl<'a> PartialEq for &'a (dyn DynEq + 'static) {
+ fn eq(&self, _other: &Self) -> bool {
+ true
+ }
+}
+
+impl Eq for &dyn DynEq {} //~ ERROR E0308
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0308-2.stderr b/src/test/ui/error-codes/E0308-2.stderr
new file mode 100644
index 000000000..de54a4172
--- /dev/null
+++ b/src/test/ui/error-codes/E0308-2.stderr
@@ -0,0 +1,18 @@
+error[E0308]: mismatched types
+ --> $DIR/E0308-2.rs:9:6
+ |
+LL | impl Eq for &dyn DynEq {}
+ | ^^ lifetime mismatch
+ |
+ = note: expected trait `<&dyn DynEq as PartialEq>`
+ found trait `<&(dyn DynEq + 'static) as PartialEq>`
+note: the anonymous lifetime as defined here...
+ --> $DIR/E0308-2.rs:9:13
+ |
+LL | impl Eq for &dyn DynEq {}
+ | ^
+ = note: ...does not necessarily outlive the static lifetime
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/error-codes/E0308-4.rs b/src/test/ui/error-codes/E0308-4.rs
new file mode 100644
index 000000000..aaf7ef5bd
--- /dev/null
+++ b/src/test/ui/error-codes/E0308-4.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let x = 1u8;
+ match x {
+ 0u8..=3i8 => (), //~ ERROR E0308
+ _ => ()
+ }
+}
diff --git a/src/test/ui/error-codes/E0308-4.stderr b/src/test/ui/error-codes/E0308-4.stderr
new file mode 100644
index 000000000..39c067637
--- /dev/null
+++ b/src/test/ui/error-codes/E0308-4.stderr
@@ -0,0 +1,13 @@
+error[E0308]: mismatched types
+ --> $DIR/E0308-4.rs:4:15
+ |
+LL | match x {
+ | - this expression has type `u8`
+LL | 0u8..=3i8 => (),
+ | --- ^^^ expected `u8`, found `i8`
+ | |
+ | this is of type `u8`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/error-codes/E0308.rs b/src/test/ui/error-codes/E0308.rs
new file mode 100644
index 000000000..fa79bee57
--- /dev/null
+++ b/src/test/ui/error-codes/E0308.rs
@@ -0,0 +1,8 @@
+#![feature(intrinsics)]
+
+extern "rust-intrinsic" {
+ fn size_of<T>(); //~ ERROR E0308
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0308.stderr b/src/test/ui/error-codes/E0308.stderr
new file mode 100644
index 000000000..b71fb95e7
--- /dev/null
+++ b/src/test/ui/error-codes/E0308.stderr
@@ -0,0 +1,12 @@
+error[E0308]: intrinsic has wrong type
+ --> $DIR/E0308.rs:4:5
+ |
+LL | fn size_of<T>();
+ | ^^^^^^^^^^^^^^^^ expected `()`, found `usize`
+ |
+ = note: expected fn pointer `extern "rust-intrinsic" fn()`
+ found fn pointer `extern "rust-intrinsic" fn() -> usize`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/error-codes/E0328.rs b/src/test/ui/error-codes/E0328.rs
new file mode 100644
index 000000000..ef55f44dd
--- /dev/null
+++ b/src/test/ui/error-codes/E0328.rs
@@ -0,0 +1,10 @@
+#![feature(unsize)]
+
+use std::marker::Unsize;
+
+pub struct MyType;
+
+impl<T> Unsize<T> for MyType {}
+//~^ ERROR explicit impls for the `Unsize` trait are not permitted [E0328]
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0328.stderr b/src/test/ui/error-codes/E0328.stderr
new file mode 100644
index 000000000..70e6baf69
--- /dev/null
+++ b/src/test/ui/error-codes/E0328.stderr
@@ -0,0 +1,9 @@
+error[E0328]: explicit impls for the `Unsize` trait are not permitted
+ --> $DIR/E0328.rs:7:1
+ |
+LL | impl<T> Unsize<T> for MyType {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Unsize` not allowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0328`.
diff --git a/src/test/ui/error-codes/E0365.rs b/src/test/ui/error-codes/E0365.rs
new file mode 100644
index 000000000..464109247
--- /dev/null
+++ b/src/test/ui/error-codes/E0365.rs
@@ -0,0 +1,8 @@
+mod foo {
+ pub const X: u32 = 1;
+}
+
+pub use foo as foo2;
+//~^ ERROR `foo` is only public within the crate, and cannot be re-exported outside [E0365]
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0365.stderr b/src/test/ui/error-codes/E0365.stderr
new file mode 100644
index 000000000..5bfcf1394
--- /dev/null
+++ b/src/test/ui/error-codes/E0365.stderr
@@ -0,0 +1,11 @@
+error[E0365]: `foo` is only public within the crate, and cannot be re-exported outside
+ --> $DIR/E0365.rs:5:9
+ |
+LL | pub use foo as foo2;
+ | ^^^^^^^^^^^ re-export of crate public `foo`
+ |
+ = note: consider declaring type or module `foo` with `pub`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0365`.
diff --git a/src/test/ui/error-codes/E0370.rs b/src/test/ui/error-codes/E0370.rs
new file mode 100644
index 000000000..32a66b63b
--- /dev/null
+++ b/src/test/ui/error-codes/E0370.rs
@@ -0,0 +1,10 @@
+#![allow(dead_code)]
+
+#[deny(overflowing_literals)]
+#[repr(i64)]
+enum Foo {
+ X = 0x7fffffffffffffff,
+ Y, //~ ERROR E0370
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0370.stderr b/src/test/ui/error-codes/E0370.stderr
new file mode 100644
index 000000000..7fb622ee8
--- /dev/null
+++ b/src/test/ui/error-codes/E0370.stderr
@@ -0,0 +1,11 @@
+error[E0370]: enum discriminant overflowed
+ --> $DIR/E0370.rs:7:5
+ |
+LL | Y,
+ | ^ overflowed on value after 9223372036854775807
+ |
+ = note: explicitly set `Y = -9223372036854775808` if that is desired outcome
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0370`.
diff --git a/src/test/ui/error-codes/E0374.rs b/src/test/ui/error-codes/E0374.rs
new file mode 100644
index 000000000..41fcedc32
--- /dev/null
+++ b/src/test/ui/error-codes/E0374.rs
@@ -0,0 +1,11 @@
+#![feature(coerce_unsized)]
+use std::ops::CoerceUnsized;
+
+struct Foo<T: ?Sized> {
+ a: i32,
+}
+
+impl<T, U> CoerceUnsized<Foo<U>> for Foo<T> //~ ERROR E0374
+ where T: CoerceUnsized<U> {}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0374.stderr b/src/test/ui/error-codes/E0374.stderr
new file mode 100644
index 000000000..68e15e6f8
--- /dev/null
+++ b/src/test/ui/error-codes/E0374.stderr
@@ -0,0 +1,9 @@
+error[E0374]: the trait `CoerceUnsized` may only be implemented for a coercion between structures with one field being coerced, none found
+ --> $DIR/E0374.rs:8:1
+ |
+LL | impl<T, U> CoerceUnsized<Foo<U>> for Foo<T>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0374`.
diff --git a/src/test/ui/error-codes/E0375.rs b/src/test/ui/error-codes/E0375.rs
new file mode 100644
index 000000000..0c03a8761
--- /dev/null
+++ b/src/test/ui/error-codes/E0375.rs
@@ -0,0 +1,13 @@
+#![feature(coerce_unsized)]
+use std::ops::CoerceUnsized;
+
+struct Foo<T: ?Sized, U: ?Sized> {
+ a: i32,
+ b: T,
+ c: U,
+}
+
+impl<T, U> CoerceUnsized<Foo<U, T>> for Foo<T, U> {}
+//~^ ERROR E0375
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0375.stderr b/src/test/ui/error-codes/E0375.stderr
new file mode 100644
index 000000000..a68b3af5a
--- /dev/null
+++ b/src/test/ui/error-codes/E0375.stderr
@@ -0,0 +1,12 @@
+error[E0375]: implementing the trait `CoerceUnsized` requires multiple coercions
+ --> $DIR/E0375.rs:10:12
+ |
+LL | impl<T, U> CoerceUnsized<Foo<U, T>> for Foo<T, U> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ requires multiple coercions
+ |
+ = note: `CoerceUnsized` may only be implemented for a coercion between structures with one field being coerced
+ = note: currently, 2 fields need coercions: `b` (`T` to `U`), `c` (`U` to `T`)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0375`.
diff --git a/src/test/ui/error-codes/E0376.rs b/src/test/ui/error-codes/E0376.rs
new file mode 100644
index 000000000..f092eb02c
--- /dev/null
+++ b/src/test/ui/error-codes/E0376.rs
@@ -0,0 +1,10 @@
+#![feature(coerce_unsized)]
+use std::ops::CoerceUnsized;
+
+struct Foo<T: ?Sized> {
+ a: T,
+}
+
+impl<T, U> CoerceUnsized<U> for Foo<T> {} //~ ERROR E0376
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0376.stderr b/src/test/ui/error-codes/E0376.stderr
new file mode 100644
index 000000000..e91efb045
--- /dev/null
+++ b/src/test/ui/error-codes/E0376.stderr
@@ -0,0 +1,9 @@
+error[E0376]: the trait `CoerceUnsized` may only be implemented for a coercion between structures
+ --> $DIR/E0376.rs:8:1
+ |
+LL | impl<T, U> CoerceUnsized<U> for Foo<T> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0376`.
diff --git a/src/test/ui/error-codes/E0388.rs b/src/test/ui/error-codes/E0388.rs
new file mode 100644
index 000000000..6049d95f0
--- /dev/null
+++ b/src/test/ui/error-codes/E0388.rs
@@ -0,0 +1,13 @@
+static X: i32 = 1;
+const C: i32 = 2;
+
+const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
+ //~| WARN taking a mutable
+static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow
+ //~| ERROR E0658
+ //~| ERROR mutable references are not allowed
+
+static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
+ //~| WARN taking a mutable
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0388.stderr b/src/test/ui/error-codes/E0388.stderr
new file mode 100644
index 000000000..106efc19a
--- /dev/null
+++ b/src/test/ui/error-codes/E0388.stderr
@@ -0,0 +1,66 @@
+warning: taking a mutable reference to a `const` item
+ --> $DIR/E0388.rs:4:30
+ |
+LL | const CR: &'static mut i32 = &mut C;
+ | ^^^^^^
+ |
+ = note: `#[warn(const_item_mutation)]` on by default
+ = note: each usage of a `const` item creates a new temporary
+ = note: the mutable reference will refer to this temporary, not the original `const` item
+note: `const` item defined here
+ --> $DIR/E0388.rs:2:1
+ |
+LL | const C: i32 = 2;
+ | ^^^^^^^^^^^^
+
+error[E0764]: mutable references are not allowed in the final value of constants
+ --> $DIR/E0388.rs:4:30
+ |
+LL | const CR: &'static mut i32 = &mut C;
+ | ^^^^^^
+
+error[E0658]: mutation through a reference is not allowed in statics
+ --> $DIR/E0388.rs:6:39
+ |
+LL | static STATIC_REF: &'static mut i32 = &mut X;
+ | ^^^^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0764]: mutable references are not allowed in the final value of statics
+ --> $DIR/E0388.rs:6:39
+ |
+LL | static STATIC_REF: &'static mut i32 = &mut X;
+ | ^^^^^^
+
+error[E0596]: cannot borrow immutable static item `X` as mutable
+ --> $DIR/E0388.rs:6:39
+ |
+LL | static STATIC_REF: &'static mut i32 = &mut X;
+ | ^^^^^^ cannot borrow as mutable
+
+warning: taking a mutable reference to a `const` item
+ --> $DIR/E0388.rs:10:38
+ |
+LL | static CONST_REF: &'static mut i32 = &mut C;
+ | ^^^^^^
+ |
+ = note: each usage of a `const` item creates a new temporary
+ = note: the mutable reference will refer to this temporary, not the original `const` item
+note: `const` item defined here
+ --> $DIR/E0388.rs:2:1
+ |
+LL | const C: i32 = 2;
+ | ^^^^^^^^^^^^
+
+error[E0764]: mutable references are not allowed in the final value of statics
+ --> $DIR/E0388.rs:10:38
+ |
+LL | static CONST_REF: &'static mut i32 = &mut C;
+ | ^^^^^^
+
+error: aborting due to 5 previous errors; 2 warnings emitted
+
+Some errors have detailed explanations: E0596, E0658, E0764.
+For more information about an error, try `rustc --explain E0596`.
diff --git a/src/test/ui/error-codes/E0389.rs b/src/test/ui/error-codes/E0389.rs
new file mode 100644
index 000000000..41172b362
--- /dev/null
+++ b/src/test/ui/error-codes/E0389.rs
@@ -0,0 +1,10 @@
+struct FancyNum {
+ num: u8,
+}
+
+fn main() {
+ let mut fancy = FancyNum{ num: 5 };
+ let fancy_ref = &(&mut fancy);
+ fancy_ref.num = 6; //~ ERROR cannot assign to `fancy_ref.num`, which is behind a `&` reference
+ println!("{}", fancy_ref.num);
+}
diff --git a/src/test/ui/error-codes/E0389.stderr b/src/test/ui/error-codes/E0389.stderr
new file mode 100644
index 000000000..3d615bd93
--- /dev/null
+++ b/src/test/ui/error-codes/E0389.stderr
@@ -0,0 +1,11 @@
+error[E0594]: cannot assign to `fancy_ref.num`, which is behind a `&` reference
+ --> $DIR/E0389.rs:8:5
+ |
+LL | let fancy_ref = &(&mut fancy);
+ | ------------- help: consider changing this to be a mutable reference: `&mut (&mut fancy)`
+LL | fancy_ref.num = 6;
+ | ^^^^^^^^^^^^^^^^^ `fancy_ref` is a `&` reference, so the data it refers to cannot be written
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0594`.
diff --git a/src/test/ui/error-codes/E0390.rs b/src/test/ui/error-codes/E0390.rs
new file mode 100644
index 000000000..507483dec
--- /dev/null
+++ b/src/test/ui/error-codes/E0390.rs
@@ -0,0 +1,10 @@
+struct Foo {
+ x: i32
+}
+
+impl *mut Foo {} //~ ERROR E0390
+
+impl fn(Foo) {} //~ ERROR E0390
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0390.stderr b/src/test/ui/error-codes/E0390.stderr
new file mode 100644
index 000000000..0e5a9ca76
--- /dev/null
+++ b/src/test/ui/error-codes/E0390.stderr
@@ -0,0 +1,19 @@
+error[E0390]: cannot define inherent `impl` for primitive types
+ --> $DIR/E0390.rs:5:6
+ |
+LL | impl *mut Foo {}
+ | ^^^^^^^^
+ |
+ = help: consider using an extension trait instead
+
+error[E0390]: cannot define inherent `impl` for primitive types
+ --> $DIR/E0390.rs:7:6
+ |
+LL | impl fn(Foo) {}
+ | ^^^^^^^
+ |
+ = help: consider using an extension trait instead
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0390`.
diff --git a/src/test/ui/error-codes/E0392.rs b/src/test/ui/error-codes/E0392.rs
new file mode 100644
index 000000000..c98d900b6
--- /dev/null
+++ b/src/test/ui/error-codes/E0392.rs
@@ -0,0 +1,4 @@
+enum Foo<T> { Bar } //~ ERROR E0392
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0392.stderr b/src/test/ui/error-codes/E0392.stderr
new file mode 100644
index 000000000..622402999
--- /dev/null
+++ b/src/test/ui/error-codes/E0392.stderr
@@ -0,0 +1,12 @@
+error[E0392]: parameter `T` is never used
+ --> $DIR/E0392.rs:1:10
+ |
+LL | enum Foo<T> { Bar }
+ | ^ unused parameter
+ |
+ = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
+ = help: if you intended `T` to be a const parameter, use `const T: usize` instead
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/error-codes/E0393.rs b/src/test/ui/error-codes/E0393.rs
new file mode 100644
index 000000000..0c1a36980
--- /dev/null
+++ b/src/test/ui/error-codes/E0393.rs
@@ -0,0 +1,7 @@
+trait A<T=Self> {}
+
+fn together_we_will_rule_the_galaxy(son: &dyn A) {}
+//~^ ERROR E0393
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0393.stderr b/src/test/ui/error-codes/E0393.stderr
new file mode 100644
index 000000000..d9f70b729
--- /dev/null
+++ b/src/test/ui/error-codes/E0393.stderr
@@ -0,0 +1,14 @@
+error[E0393]: the type parameter `T` must be explicitly specified
+ --> $DIR/E0393.rs:3:47
+ |
+LL | trait A<T=Self> {}
+ | --------------- type parameter `T` must be specified for this
+LL |
+LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {}
+ | ^ help: set the type parameter to the desired type: `A<T>`
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0393`.
diff --git a/src/test/ui/error-codes/E0396-fixed.rs b/src/test/ui/error-codes/E0396-fixed.rs
new file mode 100644
index 000000000..fe20da1a8
--- /dev/null
+++ b/src/test/ui/error-codes/E0396-fixed.rs
@@ -0,0 +1,9 @@
+#![feature(const_mut_refs)]
+
+const REG_ADDR: *mut u8 = 0x5f3759df as *mut u8;
+
+const VALUE: u8 = unsafe { *REG_ADDR };
+//~^ ERROR evaluation of constant value failed
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0396-fixed.stderr b/src/test/ui/error-codes/E0396-fixed.stderr
new file mode 100644
index 000000000..2efbd6989
--- /dev/null
+++ b/src/test/ui/error-codes/E0396-fixed.stderr
@@ -0,0 +1,9 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/E0396-fixed.rs:5:28
+ |
+LL | const VALUE: u8 = unsafe { *REG_ADDR };
+ | ^^^^^^^^^ dereferencing pointer failed: 0x5f3759df[noalloc] is a dangling pointer (it has no provenance)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/error-codes/E0396.rs b/src/test/ui/error-codes/E0396.rs
new file mode 100644
index 000000000..4415b70e7
--- /dev/null
+++ b/src/test/ui/error-codes/E0396.rs
@@ -0,0 +1,18 @@
+const REG_ADDR: *mut u8 = 0x5f3759df as *mut u8;
+
+const VALUE: u8 = unsafe { *REG_ADDR };
+//~^ ERROR dereferencing raw mutable pointers in constants is unstable
+
+const unsafe fn unreachable() -> ! {
+ use std::convert::Infallible;
+
+ const INFALLIBLE: *mut Infallible = &[] as *const [Infallible] as *const _ as _;
+ match *INFALLIBLE {}
+ //~^ ERROR dereferencing raw mutable pointers in constant functions is unstable
+
+ const BAD: () = unsafe { match *INFALLIBLE {} };
+ //~^ ERROR dereferencing raw mutable pointers in constants is unstable
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0396.stderr b/src/test/ui/error-codes/E0396.stderr
new file mode 100644
index 000000000..8c87f4067
--- /dev/null
+++ b/src/test/ui/error-codes/E0396.stderr
@@ -0,0 +1,30 @@
+error[E0658]: dereferencing raw mutable pointers in constants is unstable
+ --> $DIR/E0396.rs:3:28
+ |
+LL | const VALUE: u8 = unsafe { *REG_ADDR };
+ | ^^^^^^^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+ --> $DIR/E0396.rs:10:11
+ |
+LL | match *INFALLIBLE {}
+ | ^^^^^^^^^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0658]: dereferencing raw mutable pointers in constants is unstable
+ --> $DIR/E0396.rs:13:36
+ |
+LL | const BAD: () = unsafe { match *INFALLIBLE {} };
+ | ^^^^^^^^^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/error-codes/E0401.rs b/src/test/ui/error-codes/E0401.rs
new file mode 100644
index 000000000..c30e5f471
--- /dev/null
+++ b/src/test/ui/error-codes/E0401.rs
@@ -0,0 +1,30 @@
+trait Baz<T> {}
+
+fn foo<T>(x: T) {
+ fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) { //~ ERROR E0401
+ }
+ fn baz<U,
+ V: Baz<U>,
+ W: Fn()>
+ (y: T) { //~ ERROR E0401
+ }
+ bfnr(x); //~ ERROR type annotations needed
+}
+
+
+struct A<T> {
+ inner: T,
+}
+
+impl<T> Iterator for A<T> {
+ type Item = u8;
+ fn next(&mut self) -> Option<u8> {
+ fn helper(sel: &Self) -> u8 { //~ ERROR E0401
+ unimplemented!();
+ }
+ Some(helper(self))
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0401.stderr b/src/test/ui/error-codes/E0401.stderr
new file mode 100644
index 000000000..81715621d
--- /dev/null
+++ b/src/test/ui/error-codes/E0401.stderr
@@ -0,0 +1,49 @@
+error[E0401]: can't use generic parameters from outer function
+ --> $DIR/E0401.rs:4:39
+ |
+LL | fn foo<T>(x: T) {
+ | - type parameter from outer function
+LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
+ | --------------------------- ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `bfnr<U, V: Baz<U>, W: Fn(), T>`
+
+error[E0401]: can't use generic parameters from outer function
+ --> $DIR/E0401.rs:9:16
+ |
+LL | fn foo<T>(x: T) {
+ | - type parameter from outer function
+...
+LL | fn baz<U,
+ | --- try adding a local generic parameter in this method instead
+...
+LL | (y: T) {
+ | ^ use of generic parameter from outer function
+
+error[E0401]: can't use generic parameters from outer function
+ --> $DIR/E0401.rs:22:25
+ |
+LL | impl<T> Iterator for A<T> {
+ | ---- `Self` type implicitly declared here, by this `impl`
+...
+LL | fn helper(sel: &Self) -> u8 {
+ | ^^^^
+ | |
+ | use of generic parameter from outer function
+ | use a type here instead
+
+error[E0282]: type annotations needed
+ --> $DIR/E0401.rs:11:5
+ |
+LL | bfnr(x);
+ | ^^^^ cannot infer type of the type parameter `U` declared on the function `bfnr`
+ |
+help: consider specifying the generic arguments
+ |
+LL | bfnr::<U, V, W>(x);
+ | +++++++++++
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0282, E0401.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/src/test/ui/error-codes/E0403.rs b/src/test/ui/error-codes/E0403.rs
new file mode 100644
index 000000000..8bccb631a
--- /dev/null
+++ b/src/test/ui/error-codes/E0403.rs
@@ -0,0 +1,4 @@
+fn foo<T, T>(s: T, u: T) {} //~ ERROR E0403
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0403.stderr b/src/test/ui/error-codes/E0403.stderr
new file mode 100644
index 000000000..d76a58a7c
--- /dev/null
+++ b/src/test/ui/error-codes/E0403.stderr
@@ -0,0 +1,11 @@
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+ --> $DIR/E0403.rs:1:11
+ |
+LL | fn foo<T, T>(s: T, u: T) {}
+ | - ^ already used
+ | |
+ | first use of `T`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0403`.
diff --git a/src/test/ui/error-codes/E0404.rs b/src/test/ui/error-codes/E0404.rs
new file mode 100644
index 000000000..b17333724
--- /dev/null
+++ b/src/test/ui/error-codes/E0404.rs
@@ -0,0 +1,8 @@
+struct Foo;
+struct Bar;
+
+impl Foo for Bar {} //~ ERROR E0404
+
+fn main() {}
+
+fn baz<T: Foo>(_: T) {} //~ ERROR E0404
diff --git a/src/test/ui/error-codes/E0404.stderr b/src/test/ui/error-codes/E0404.stderr
new file mode 100644
index 000000000..4ccb6c572
--- /dev/null
+++ b/src/test/ui/error-codes/E0404.stderr
@@ -0,0 +1,15 @@
+error[E0404]: expected trait, found struct `Foo`
+ --> $DIR/E0404.rs:4:6
+ |
+LL | impl Foo for Bar {}
+ | ^^^ not a trait
+
+error[E0404]: expected trait, found struct `Foo`
+ --> $DIR/E0404.rs:8:11
+ |
+LL | fn baz<T: Foo>(_: T) {}
+ | ^^^ not a trait
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0404`.
diff --git a/src/test/ui/error-codes/E0405.rs b/src/test/ui/error-codes/E0405.rs
new file mode 100644
index 000000000..f03c4e19b
--- /dev/null
+++ b/src/test/ui/error-codes/E0405.rs
@@ -0,0 +1,6 @@
+struct Foo;
+
+impl SomeTrait for Foo {} //~ ERROR E0405
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0405.stderr b/src/test/ui/error-codes/E0405.stderr
new file mode 100644
index 000000000..a22afe6f3
--- /dev/null
+++ b/src/test/ui/error-codes/E0405.stderr
@@ -0,0 +1,9 @@
+error[E0405]: cannot find trait `SomeTrait` in this scope
+ --> $DIR/E0405.rs:3:6
+ |
+LL | impl SomeTrait for Foo {}
+ | ^^^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0405`.
diff --git a/src/test/ui/error-codes/E0407.rs b/src/test/ui/error-codes/E0407.rs
new file mode 100644
index 000000000..962bd5741
--- /dev/null
+++ b/src/test/ui/error-codes/E0407.rs
@@ -0,0 +1,14 @@
+trait Foo {
+ fn a();
+}
+
+struct Bar;
+
+impl Foo for Bar {
+ fn a() {}
+ fn b() {}
+ //~^ ERROR E0407
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0407.stderr b/src/test/ui/error-codes/E0407.stderr
new file mode 100644
index 000000000..6f6d1ff6a
--- /dev/null
+++ b/src/test/ui/error-codes/E0407.stderr
@@ -0,0 +1,12 @@
+error[E0407]: method `b` is not a member of trait `Foo`
+ --> $DIR/E0407.rs:9:5
+ |
+LL | fn b() {}
+ | ^^^-^^^^^
+ | | |
+ | | help: there is an associated function with a similar name: `a`
+ | not a member of trait `Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0407`.
diff --git a/src/test/ui/error-codes/E0408.rs b/src/test/ui/error-codes/E0408.rs
new file mode 100644
index 000000000..e91a98f38
--- /dev/null
+++ b/src/test/ui/error-codes/E0408.rs
@@ -0,0 +1,8 @@
+fn main() {
+ let x = Some(0);
+
+ match x {
+ Some(y) | None => {} //~ ERROR variable `y` is not bound in all patterns
+ _ => ()
+ }
+}
diff --git a/src/test/ui/error-codes/E0408.stderr b/src/test/ui/error-codes/E0408.stderr
new file mode 100644
index 000000000..132a94322
--- /dev/null
+++ b/src/test/ui/error-codes/E0408.stderr
@@ -0,0 +1,11 @@
+error[E0408]: variable `y` is not bound in all patterns
+ --> $DIR/E0408.rs:5:19
+ |
+LL | Some(y) | None => {}
+ | - ^^^^ pattern doesn't bind `y`
+ | |
+ | variable not in all patterns
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0408`.
diff --git a/src/test/ui/error-codes/E0411.rs b/src/test/ui/error-codes/E0411.rs
new file mode 100644
index 000000000..872370f2a
--- /dev/null
+++ b/src/test/ui/error-codes/E0411.rs
@@ -0,0 +1,3 @@
+fn main() {
+ <Self>::foo; //~ ERROR E0411
+}
diff --git a/src/test/ui/error-codes/E0411.stderr b/src/test/ui/error-codes/E0411.stderr
new file mode 100644
index 000000000..4c99f9fcb
--- /dev/null
+++ b/src/test/ui/error-codes/E0411.stderr
@@ -0,0 +1,11 @@
+error[E0411]: cannot find type `Self` in this scope
+ --> $DIR/E0411.rs:2:6
+ |
+LL | fn main() {
+ | ---- `Self` not allowed in a function
+LL | <Self>::foo;
+ | ^^^^ `Self` is only available in impls, traits, and type definitions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0411`.
diff --git a/src/test/ui/error-codes/E0412.rs b/src/test/ui/error-codes/E0412.rs
new file mode 100644
index 000000000..5f922a50a
--- /dev/null
+++ b/src/test/ui/error-codes/E0412.rs
@@ -0,0 +1,4 @@
+impl Something {} //~ ERROR E0412
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0412.stderr b/src/test/ui/error-codes/E0412.stderr
new file mode 100644
index 000000000..7bdaa1807
--- /dev/null
+++ b/src/test/ui/error-codes/E0412.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Something` in this scope
+ --> $DIR/E0412.rs:1:6
+ |
+LL | impl Something {}
+ | ^^^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/error-codes/E0415.rs b/src/test/ui/error-codes/E0415.rs
new file mode 100644
index 000000000..6177ac35b
--- /dev/null
+++ b/src/test/ui/error-codes/E0415.rs
@@ -0,0 +1,4 @@
+fn foo(f: i32, f: i32) {} //~ ERROR E0415
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0415.stderr b/src/test/ui/error-codes/E0415.stderr
new file mode 100644
index 000000000..c2b8fdc7c
--- /dev/null
+++ b/src/test/ui/error-codes/E0415.stderr
@@ -0,0 +1,9 @@
+error[E0415]: identifier `f` is bound more than once in this parameter list
+ --> $DIR/E0415.rs:1:16
+ |
+LL | fn foo(f: i32, f: i32) {}
+ | ^ used as parameter more than once
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0415`.
diff --git a/src/test/ui/error-codes/E0416.rs b/src/test/ui/error-codes/E0416.rs
new file mode 100644
index 000000000..88eece07a
--- /dev/null
+++ b/src/test/ui/error-codes/E0416.rs
@@ -0,0 +1,5 @@
+fn main() {
+ match (1, 2) {
+ (x, x) => {} //~ ERROR E0416
+ }
+}
diff --git a/src/test/ui/error-codes/E0416.stderr b/src/test/ui/error-codes/E0416.stderr
new file mode 100644
index 000000000..78acac5c6
--- /dev/null
+++ b/src/test/ui/error-codes/E0416.stderr
@@ -0,0 +1,9 @@
+error[E0416]: identifier `x` is bound more than once in the same pattern
+ --> $DIR/E0416.rs:3:13
+ |
+LL | (x, x) => {}
+ | ^ used in a pattern more than once
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0416`.
diff --git a/src/test/ui/error-codes/E0423.rs b/src/test/ui/error-codes/E0423.rs
new file mode 100644
index 000000000..5080a5e05
--- /dev/null
+++ b/src/test/ui/error-codes/E0423.rs
@@ -0,0 +1,22 @@
+fn main () {
+ struct Foo { a: bool };
+
+ let f = Foo(); //~ ERROR E0423
+}
+
+fn bar() {
+ struct S { x: i32, y: i32 }
+ #[derive(PartialEq)]
+ struct T {}
+
+ if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
+ //~^ ERROR struct literals are not allowed here
+ if T {} == T {} { println!("Ok"); }
+ //~^ ERROR E0423
+ //~| ERROR expected expression, found `==`
+}
+
+fn foo() {
+ for _ in std::ops::Range { start: 0, end: 10 } {}
+ //~^ ERROR struct literals are not allowed here
+}
diff --git a/src/test/ui/error-codes/E0423.stderr b/src/test/ui/error-codes/E0423.stderr
new file mode 100644
index 000000000..8f2ef8c8e
--- /dev/null
+++ b/src/test/ui/error-codes/E0423.stderr
@@ -0,0 +1,63 @@
+error: struct literals are not allowed here
+ --> $DIR/E0423.rs:12:32
+ |
+LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
+ | ^^^^^^^^^^^^^^^^
+ |
+help: surround the struct literal with parentheses
+ |
+LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
+ | + +
+
+error: expected expression, found `==`
+ --> $DIR/E0423.rs:14:13
+ |
+LL | if T {} == T {} { println!("Ok"); }
+ | ^^ expected expression
+
+error: struct literals are not allowed here
+ --> $DIR/E0423.rs:20:14
+ |
+LL | for _ in std::ops::Range { start: 0, end: 10 } {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: surround the struct literal with parentheses
+ |
+LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
+ | + +
+
+error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
+ --> $DIR/E0423.rs:4:13
+ |
+LL | struct Foo { a: bool };
+ | ---------------------- `Foo` defined here
+LL |
+LL | let f = Foo();
+ | ^^^^^
+...
+LL | fn foo() {
+ | -------- similarly named function `foo` defined here
+ |
+help: use struct literal syntax instead
+ |
+LL | let f = Foo { a: val };
+ | ~~~~~~~~~~~~~~
+help: a function with a similar name exists
+ |
+LL | let f = foo();
+ | ~~~
+
+error[E0423]: expected value, found struct `T`
+ --> $DIR/E0423.rs:14:8
+ |
+LL | if T {} == T {} { println!("Ok"); }
+ | ^ not a value
+ |
+help: surround the struct literal with parentheses
+ |
+LL | if (T {}) == T {} { println!("Ok"); }
+ | + +
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0423`.
diff --git a/src/test/ui/error-codes/E0424.rs b/src/test/ui/error-codes/E0424.rs
new file mode 100644
index 000000000..6e531942c
--- /dev/null
+++ b/src/test/ui/error-codes/E0424.rs
@@ -0,0 +1,21 @@
+struct Foo;
+
+impl Foo {
+ fn bar(self) {}
+
+ fn foo() {
+ self.bar(); //~ ERROR E0424
+ }
+
+ fn baz(_: i32) {
+ self.bar(); //~ ERROR E0424
+ }
+
+ fn qux() {
+ let _ = || self.bar(); //~ ERROR E0424
+ }
+}
+
+fn main () {
+ let self = "self"; //~ ERROR E0424
+}
diff --git a/src/test/ui/error-codes/E0424.stderr b/src/test/ui/error-codes/E0424.stderr
new file mode 100644
index 000000000..d02da3e4e
--- /dev/null
+++ b/src/test/ui/error-codes/E0424.stderr
@@ -0,0 +1,50 @@
+error[E0424]: expected value, found module `self`
+ --> $DIR/E0424.rs:7:9
+ |
+LL | fn foo() {
+ | --- this function doesn't have a `self` parameter
+LL | self.bar();
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+ |
+help: add a `self` receiver parameter to make the associated `fn` a method
+ |
+LL | fn foo(&self) {
+ | +++++
+
+error[E0424]: expected value, found module `self`
+ --> $DIR/E0424.rs:11:9
+ |
+LL | fn baz(_: i32) {
+ | --- this function doesn't have a `self` parameter
+LL | self.bar();
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+ |
+help: add a `self` receiver parameter to make the associated `fn` a method
+ |
+LL | fn baz(&self, _: i32) {
+ | ++++++
+
+error[E0424]: expected value, found module `self`
+ --> $DIR/E0424.rs:15:20
+ |
+LL | fn qux() {
+ | --- this function doesn't have a `self` parameter
+LL | let _ = || self.bar();
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+ |
+help: add a `self` receiver parameter to make the associated `fn` a method
+ |
+LL | fn qux(&self) {
+ | +++++
+
+error[E0424]: expected unit struct, unit variant or constant, found module `self`
+ --> $DIR/E0424.rs:20:9
+ |
+LL | fn main () {
+ | ---- this function can't have a `self` parameter
+LL | let self = "self";
+ | ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0424`.
diff --git a/src/test/ui/error-codes/E0425.rs b/src/test/ui/error-codes/E0425.rs
new file mode 100644
index 000000000..ec234ae99
--- /dev/null
+++ b/src/test/ui/error-codes/E0425.rs
@@ -0,0 +1,8 @@
+trait Foo {
+ fn bar() {
+ elf; //~ ERROR E0425
+ }
+}
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0425.stderr b/src/test/ui/error-codes/E0425.stderr
new file mode 100644
index 000000000..9ef4608da
--- /dev/null
+++ b/src/test/ui/error-codes/E0425.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `elf` in this scope
+ --> $DIR/E0425.rs:3:9
+ |
+LL | elf;
+ | ^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/error-codes/E0426.rs b/src/test/ui/error-codes/E0426.rs
new file mode 100644
index 000000000..7a1dcde49
--- /dev/null
+++ b/src/test/ui/error-codes/E0426.rs
@@ -0,0 +1,6 @@
+fn main () {
+ loop {
+ break 'a;
+ //~^ ERROR E0426
+ }
+}
diff --git a/src/test/ui/error-codes/E0426.stderr b/src/test/ui/error-codes/E0426.stderr
new file mode 100644
index 000000000..035f2eb86
--- /dev/null
+++ b/src/test/ui/error-codes/E0426.stderr
@@ -0,0 +1,9 @@
+error[E0426]: use of undeclared label `'a`
+ --> $DIR/E0426.rs:3:15
+ |
+LL | break 'a;
+ | ^^ undeclared label `'a`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0426`.
diff --git a/src/test/ui/error-codes/E0428.rs b/src/test/ui/error-codes/E0428.rs
new file mode 100644
index 000000000..eb9594fb8
--- /dev/null
+++ b/src/test/ui/error-codes/E0428.rs
@@ -0,0 +1,5 @@
+struct Bar; //~ previous definition of the type `Bar` here
+struct Bar; //~ ERROR E0428
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0428.stderr b/src/test/ui/error-codes/E0428.stderr
new file mode 100644
index 000000000..205bcf342
--- /dev/null
+++ b/src/test/ui/error-codes/E0428.stderr
@@ -0,0 +1,13 @@
+error[E0428]: the name `Bar` is defined multiple times
+ --> $DIR/E0428.rs:2:1
+ |
+LL | struct Bar;
+ | ----------- previous definition of the type `Bar` here
+LL | struct Bar;
+ | ^^^^^^^^^^^ `Bar` redefined here
+ |
+ = note: `Bar` must be defined only once in the type namespace of this module
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0428`.
diff --git a/src/test/ui/error-codes/E0429.rs b/src/test/ui/error-codes/E0429.rs
new file mode 100644
index 000000000..e74b27a78
--- /dev/null
+++ b/src/test/ui/error-codes/E0429.rs
@@ -0,0 +1,4 @@
+use std::fmt::self; //~ ERROR E0429
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0429.stderr b/src/test/ui/error-codes/E0429.stderr
new file mode 100644
index 000000000..08b99232e
--- /dev/null
+++ b/src/test/ui/error-codes/E0429.stderr
@@ -0,0 +1,19 @@
+error[E0429]: `self` imports are only allowed within a { } list
+ --> $DIR/E0429.rs:1:13
+ |
+LL | use std::fmt::self;
+ | ^^^^^^
+ |
+help: consider importing the module directly
+ |
+LL - use std::fmt::self;
+LL + use std::fmt;
+ |
+help: alternatively, use the multi-path `use` syntax to import `self`
+ |
+LL | use std::fmt::{self};
+ | + +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0429`.
diff --git a/src/test/ui/error-codes/E0430.rs b/src/test/ui/error-codes/E0430.rs
new file mode 100644
index 000000000..ba2f671d6
--- /dev/null
+++ b/src/test/ui/error-codes/E0430.rs
@@ -0,0 +1,5 @@
+use std::fmt::{self, self}; //~ ERROR E0430
+ //~^ ERROR E0252
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0430.stderr b/src/test/ui/error-codes/E0430.stderr
new file mode 100644
index 000000000..69a0d6e11
--- /dev/null
+++ b/src/test/ui/error-codes/E0430.stderr
@@ -0,0 +1,22 @@
+error[E0430]: `self` import can only appear once in an import list
+ --> $DIR/E0430.rs:1:16
+ |
+LL | use std::fmt::{self, self};
+ | ^^^^ ---- another `self` import appears here
+ | |
+ | can only appear once in an import list
+
+error[E0252]: the name `fmt` is defined multiple times
+ --> $DIR/E0430.rs:1:22
+ |
+LL | use std::fmt::{self, self};
+ | ---- ^^^^ `fmt` reimported here
+ | |
+ | previous import of the module `fmt` here
+ |
+ = note: `fmt` must be defined only once in the type namespace of this module
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0252, E0430.
+For more information about an error, try `rustc --explain E0252`.
diff --git a/src/test/ui/error-codes/E0431.rs b/src/test/ui/error-codes/E0431.rs
new file mode 100644
index 000000000..2e2ccba17
--- /dev/null
+++ b/src/test/ui/error-codes/E0431.rs
@@ -0,0 +1,4 @@
+use {self}; //~ ERROR E0431
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0431.stderr b/src/test/ui/error-codes/E0431.stderr
new file mode 100644
index 000000000..adfd2d923
--- /dev/null
+++ b/src/test/ui/error-codes/E0431.stderr
@@ -0,0 +1,9 @@
+error[E0431]: `self` import can only appear in an import list with a non-empty prefix
+ --> $DIR/E0431.rs:1:6
+ |
+LL | use {self};
+ | ^^^^ can only appear in an import list with a non-empty prefix
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0431`.
diff --git a/src/test/ui/error-codes/E0432.rs b/src/test/ui/error-codes/E0432.rs
new file mode 100644
index 000000000..1fc95f945
--- /dev/null
+++ b/src/test/ui/error-codes/E0432.rs
@@ -0,0 +1,4 @@
+use something::Foo; //~ ERROR E0432
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0432.stderr b/src/test/ui/error-codes/E0432.stderr
new file mode 100644
index 000000000..ed9536f16
--- /dev/null
+++ b/src/test/ui/error-codes/E0432.stderr
@@ -0,0 +1,11 @@
+error[E0432]: unresolved import `something`
+ --> $DIR/E0432.rs:1:5
+ |
+LL | use something::Foo;
+ | ^^^^^^^^^ maybe a missing crate `something`?
+ |
+ = help: consider adding `extern crate something` to use the `something` crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0432`.
diff --git a/src/test/ui/error-codes/E0433.rs b/src/test/ui/error-codes/E0433.rs
new file mode 100644
index 000000000..d555e6542
--- /dev/null
+++ b/src/test/ui/error-codes/E0433.rs
@@ -0,0 +1,3 @@
+fn main () {
+ let map = NonExistingMap::new(); //~ ERROR E0433
+}
diff --git a/src/test/ui/error-codes/E0433.stderr b/src/test/ui/error-codes/E0433.stderr
new file mode 100644
index 000000000..265d8885c
--- /dev/null
+++ b/src/test/ui/error-codes/E0433.stderr
@@ -0,0 +1,9 @@
+error[E0433]: failed to resolve: use of undeclared type `NonExistingMap`
+ --> $DIR/E0433.rs:2:15
+ |
+LL | let map = NonExistingMap::new();
+ | ^^^^^^^^^^^^^^ use of undeclared type `NonExistingMap`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/src/test/ui/error-codes/E0434.rs b/src/test/ui/error-codes/E0434.rs
new file mode 100644
index 000000000..db7037ee1
--- /dev/null
+++ b/src/test/ui/error-codes/E0434.rs
@@ -0,0 +1,9 @@
+fn foo() {
+ let y = 5;
+ fn bar() -> u32 {
+ y //~ ERROR E0434
+ }
+}
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0434.stderr b/src/test/ui/error-codes/E0434.stderr
new file mode 100644
index 000000000..14508ccbc
--- /dev/null
+++ b/src/test/ui/error-codes/E0434.stderr
@@ -0,0 +1,11 @@
+error[E0434]: can't capture dynamic environment in a fn item
+ --> $DIR/E0434.rs:4:9
+ |
+LL | y
+ | ^
+ |
+ = help: use the `|| { ... }` closure form instead
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0434`.
diff --git a/src/test/ui/error-codes/E0435.fixed b/src/test/ui/error-codes/E0435.fixed
new file mode 100644
index 000000000..fdf896d2d
--- /dev/null
+++ b/src/test/ui/error-codes/E0435.fixed
@@ -0,0 +1,6 @@
+// run-rustfix
+fn main () {
+ #[allow(non_upper_case_globals)]
+ const foo: usize = 42;
+ let _: [u8; foo]; //~ ERROR E0435
+}
diff --git a/src/test/ui/error-codes/E0435.rs b/src/test/ui/error-codes/E0435.rs
new file mode 100644
index 000000000..d9354efb8
--- /dev/null
+++ b/src/test/ui/error-codes/E0435.rs
@@ -0,0 +1,6 @@
+// run-rustfix
+fn main () {
+ #[allow(non_upper_case_globals)]
+ let foo: usize = 42;
+ let _: [u8; foo]; //~ ERROR E0435
+}
diff --git a/src/test/ui/error-codes/E0435.stderr b/src/test/ui/error-codes/E0435.stderr
new file mode 100644
index 000000000..fc08fade9
--- /dev/null
+++ b/src/test/ui/error-codes/E0435.stderr
@@ -0,0 +1,11 @@
+error[E0435]: attempt to use a non-constant value in a constant
+ --> $DIR/E0435.rs:5:17
+ |
+LL | let foo: usize = 42;
+ | ------- help: consider using `const` instead of `let`: `const foo`
+LL | let _: [u8; foo];
+ | ^^^ non-constant value
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0435`.
diff --git a/src/test/ui/error-codes/E0437.rs b/src/test/ui/error-codes/E0437.rs
new file mode 100644
index 000000000..f8c15007d
--- /dev/null
+++ b/src/test/ui/error-codes/E0437.rs
@@ -0,0 +1,8 @@
+trait Foo {}
+
+impl Foo for i32 {
+ type Bar = bool; //~ ERROR E0437
+}
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0437.stderr b/src/test/ui/error-codes/E0437.stderr
new file mode 100644
index 000000000..217b16403
--- /dev/null
+++ b/src/test/ui/error-codes/E0437.stderr
@@ -0,0 +1,9 @@
+error[E0437]: type `Bar` is not a member of trait `Foo`
+ --> $DIR/E0437.rs:4:5
+ |
+LL | type Bar = bool;
+ | ^^^^^^^^^^^^^^^^ not a member of trait `Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0437`.
diff --git a/src/test/ui/error-codes/E0438.rs b/src/test/ui/error-codes/E0438.rs
new file mode 100644
index 000000000..02898b886
--- /dev/null
+++ b/src/test/ui/error-codes/E0438.rs
@@ -0,0 +1,8 @@
+trait Bar {}
+
+impl Bar for i32 {
+ const BAR: bool = true; //~ ERROR E0438
+}
+
+fn main () {
+}
diff --git a/src/test/ui/error-codes/E0438.stderr b/src/test/ui/error-codes/E0438.stderr
new file mode 100644
index 000000000..853f0c3c2
--- /dev/null
+++ b/src/test/ui/error-codes/E0438.stderr
@@ -0,0 +1,9 @@
+error[E0438]: const `BAR` is not a member of trait `Bar`
+ --> $DIR/E0438.rs:4:5
+ |
+LL | const BAR: bool = true;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `Bar`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0438`.
diff --git a/src/test/ui/error-codes/E0445.rs b/src/test/ui/error-codes/E0445.rs
new file mode 100644
index 000000000..a9a3aee25
--- /dev/null
+++ b/src/test/ui/error-codes/E0445.rs
@@ -0,0 +1,12 @@
+trait Foo {
+ fn dummy(&self) { }
+}
+
+pub trait Bar : Foo {}
+//~^ ERROR private trait `Foo` in public interface [E0445]
+pub struct Bar2<T: Foo>(pub T);
+//~^ ERROR private trait `Foo` in public interface [E0445]
+pub fn foo<T: Foo> (t: T) {}
+//~^ ERROR private trait `Foo` in public interface [E0445]
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0445.stderr b/src/test/ui/error-codes/E0445.stderr
new file mode 100644
index 000000000..23b7a3350
--- /dev/null
+++ b/src/test/ui/error-codes/E0445.stderr
@@ -0,0 +1,30 @@
+error[E0445]: private trait `Foo` in public interface
+ --> $DIR/E0445.rs:5:1
+ |
+LL | trait Foo {
+ | --------- `Foo` declared as private
+...
+LL | pub trait Bar : Foo {}
+ | ^^^^^^^^^^^^^^^^^^^ can't leak private trait
+
+error[E0445]: private trait `Foo` in public interface
+ --> $DIR/E0445.rs:7:1
+ |
+LL | trait Foo {
+ | --------- `Foo` declared as private
+...
+LL | pub struct Bar2<T: Foo>(pub T);
+ | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+
+error[E0445]: private trait `Foo` in public interface
+ --> $DIR/E0445.rs:9:1
+ |
+LL | trait Foo {
+ | --------- `Foo` declared as private
+...
+LL | pub fn foo<T: Foo> (t: T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0445`.
diff --git a/src/test/ui/error-codes/E0446.rs b/src/test/ui/error-codes/E0446.rs
new file mode 100644
index 000000000..f61c7e546
--- /dev/null
+++ b/src/test/ui/error-codes/E0446.rs
@@ -0,0 +1,9 @@
+mod foo {
+ struct Bar(u32);
+
+ pub fn bar() -> Bar { //~ ERROR E0446
+ Bar(0)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0446.stderr b/src/test/ui/error-codes/E0446.stderr
new file mode 100644
index 000000000..b6a195c40
--- /dev/null
+++ b/src/test/ui/error-codes/E0446.stderr
@@ -0,0 +1,12 @@
+error[E0446]: private type `Bar` in public interface
+ --> $DIR/E0446.rs:4:5
+ |
+LL | struct Bar(u32);
+ | ---------- `Bar` declared as private
+LL |
+LL | pub fn bar() -> Bar {
+ | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0446`.
diff --git a/src/test/ui/error-codes/E0449.rs b/src/test/ui/error-codes/E0449.rs
new file mode 100644
index 000000000..eba0d479e
--- /dev/null
+++ b/src/test/ui/error-codes/E0449.rs
@@ -0,0 +1,14 @@
+struct Bar;
+
+trait Foo {
+ fn foo();
+}
+
+pub impl Bar {} //~ ERROR E0449
+
+pub impl Foo for Bar { //~ ERROR E0449
+ pub fn foo() {} //~ ERROR E0449
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0449.stderr b/src/test/ui/error-codes/E0449.stderr
new file mode 100644
index 000000000..8221a5e0a
--- /dev/null
+++ b/src/test/ui/error-codes/E0449.stderr
@@ -0,0 +1,23 @@
+error[E0449]: unnecessary visibility qualifier
+ --> $DIR/E0449.rs:7:1
+ |
+LL | pub impl Bar {}
+ | ^^^ `pub` not permitted here because it's implied
+ |
+ = note: place qualifiers on individual impl items instead
+
+error[E0449]: unnecessary visibility qualifier
+ --> $DIR/E0449.rs:9:1
+ |
+LL | pub impl Foo for Bar {
+ | ^^^ `pub` not permitted here because it's implied
+
+error[E0449]: unnecessary visibility qualifier
+ --> $DIR/E0449.rs:10:5
+ |
+LL | pub fn foo() {}
+ | ^^^ `pub` not permitted here because it's implied
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0449`.
diff --git a/src/test/ui/error-codes/E0451.rs b/src/test/ui/error-codes/E0451.rs
new file mode 100644
index 000000000..aa8f051af
--- /dev/null
+++ b/src/test/ui/error-codes/E0451.rs
@@ -0,0 +1,19 @@
+mod bar {
+ pub struct Foo {
+ pub a: isize,
+ b: isize,
+ }
+
+ pub struct FooTuple (
+ pub isize,
+ isize,
+ );
+}
+
+fn pat_match(foo: bar::Foo) {
+ let bar::Foo{a, b} = foo; //~ ERROR E0451
+}
+
+fn main() {
+ let f = bar::Foo{ a: 0, b: 0 }; //~ ERROR E0451
+}
diff --git a/src/test/ui/error-codes/E0451.stderr b/src/test/ui/error-codes/E0451.stderr
new file mode 100644
index 000000000..419cf117e
--- /dev/null
+++ b/src/test/ui/error-codes/E0451.stderr
@@ -0,0 +1,15 @@
+error[E0451]: field `b` of struct `Foo` is private
+ --> $DIR/E0451.rs:14:21
+ |
+LL | let bar::Foo{a, b} = foo;
+ | ^ private field
+
+error[E0451]: field `b` of struct `Foo` is private
+ --> $DIR/E0451.rs:18:29
+ |
+LL | let f = bar::Foo{ a: 0, b: 0 };
+ | ^^^^ private field
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0451`.
diff --git a/src/test/ui/error-codes/E0452.rs b/src/test/ui/error-codes/E0452.rs
new file mode 100644
index 000000000..5066cd99b
--- /dev/null
+++ b/src/test/ui/error-codes/E0452.rs
@@ -0,0 +1,6 @@
+#![allow(foo = "")] //~ ERROR E0452
+ //~| ERROR E0452
+ //~| ERROR E0452
+ //~| ERROR E0452
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0452.stderr b/src/test/ui/error-codes/E0452.stderr
new file mode 100644
index 000000000..f67b740ff
--- /dev/null
+++ b/src/test/ui/error-codes/E0452.stderr
@@ -0,0 +1,27 @@
+error[E0452]: malformed lint attribute input
+ --> $DIR/E0452.rs:1:10
+ |
+LL | #![allow(foo = "")]
+ | ^^^^^^^^ bad attribute argument
+
+error[E0452]: malformed lint attribute input
+ --> $DIR/E0452.rs:1:10
+ |
+LL | #![allow(foo = "")]
+ | ^^^^^^^^ bad attribute argument
+
+error[E0452]: malformed lint attribute input
+ --> $DIR/E0452.rs:1:10
+ |
+LL | #![allow(foo = "")]
+ | ^^^^^^^^ bad attribute argument
+
+error[E0452]: malformed lint attribute input
+ --> $DIR/E0452.rs:1:10
+ |
+LL | #![allow(foo = "")]
+ | ^^^^^^^^ bad attribute argument
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0452`.
diff --git a/src/test/ui/error-codes/E0453.rs b/src/test/ui/error-codes/E0453.rs
new file mode 100644
index 000000000..ca9573c5b
--- /dev/null
+++ b/src/test/ui/error-codes/E0453.rs
@@ -0,0 +1,7 @@
+#![forbid(non_snake_case)]
+
+#[allow(non_snake_case)]
+//~^ ERROR allow(non_snake_case) incompatible
+//~| ERROR allow(non_snake_case) incompatible
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0453.stderr b/src/test/ui/error-codes/E0453.stderr
new file mode 100644
index 000000000..f982ed26f
--- /dev/null
+++ b/src/test/ui/error-codes/E0453.stderr
@@ -0,0 +1,21 @@
+error[E0453]: allow(non_snake_case) incompatible with previous forbid
+ --> $DIR/E0453.rs:3:9
+ |
+LL | #![forbid(non_snake_case)]
+ | -------------- `forbid` level set here
+LL |
+LL | #[allow(non_snake_case)]
+ | ^^^^^^^^^^^^^^ overruled by previous forbid
+
+error[E0453]: allow(non_snake_case) incompatible with previous forbid
+ --> $DIR/E0453.rs:3:9
+ |
+LL | #![forbid(non_snake_case)]
+ | -------------- `forbid` level set here
+LL |
+LL | #[allow(non_snake_case)]
+ | ^^^^^^^^^^^^^^ overruled by previous forbid
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0453`.
diff --git a/src/test/ui/error-codes/E0454.rs b/src/test/ui/error-codes/E0454.rs
new file mode 100644
index 000000000..ff5478382
--- /dev/null
+++ b/src/test/ui/error-codes/E0454.rs
@@ -0,0 +1,5 @@
+#[link(name = "")] extern "C" {}
+//~^ ERROR E0454
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0454.stderr b/src/test/ui/error-codes/E0454.stderr
new file mode 100644
index 000000000..b9a506fee
--- /dev/null
+++ b/src/test/ui/error-codes/E0454.stderr
@@ -0,0 +1,9 @@
+error[E0454]: link name must not be empty
+ --> $DIR/E0454.rs:1:15
+ |
+LL | #[link(name = "")] extern "C" {}
+ | ^^ empty link name
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0454`.
diff --git a/src/test/ui/error-codes/E0458.rs b/src/test/ui/error-codes/E0458.rs
new file mode 100644
index 000000000..35e7e84d4
--- /dev/null
+++ b/src/test/ui/error-codes/E0458.rs
@@ -0,0 +1,5 @@
+#[link(kind = "wonderful_unicorn")] extern "C" {} //~ ERROR E0458
+ //~| ERROR E0459
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0458.stderr b/src/test/ui/error-codes/E0458.stderr
new file mode 100644
index 000000000..e641bba54
--- /dev/null
+++ b/src/test/ui/error-codes/E0458.stderr
@@ -0,0 +1,16 @@
+error[E0458]: unknown link kind `wonderful_unicorn`, expected one of: static, dylib, framework, raw-dylib
+ --> $DIR/E0458.rs:1:15
+ |
+LL | #[link(kind = "wonderful_unicorn")] extern "C" {}
+ | ^^^^^^^^^^^^^^^^^^^ unknown link kind
+
+error[E0459]: `#[link]` attribute requires a `name = "string"` argument
+ --> $DIR/E0458.rs:1:1
+ |
+LL | #[link(kind = "wonderful_unicorn")] extern "C" {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `name` argument
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0458, E0459.
+For more information about an error, try `rustc --explain E0458`.
diff --git a/src/test/ui/error-codes/E0459.rs b/src/test/ui/error-codes/E0459.rs
new file mode 100644
index 000000000..c56d8f0a8
--- /dev/null
+++ b/src/test/ui/error-codes/E0459.rs
@@ -0,0 +1,4 @@
+#[link(kind = "dylib")] extern "C" {} //~ ERROR E0459
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0459.stderr b/src/test/ui/error-codes/E0459.stderr
new file mode 100644
index 000000000..8f0dd25e0
--- /dev/null
+++ b/src/test/ui/error-codes/E0459.stderr
@@ -0,0 +1,9 @@
+error[E0459]: `#[link]` attribute requires a `name = "string"` argument
+ --> $DIR/E0459.rs:1:1
+ |
+LL | #[link(kind = "dylib")] extern "C" {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^ missing `name` argument
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0459`.
diff --git a/src/test/ui/error-codes/E0463.rs b/src/test/ui/error-codes/E0463.rs
new file mode 100644
index 000000000..683565281
--- /dev/null
+++ b/src/test/ui/error-codes/E0463.rs
@@ -0,0 +1,7 @@
+#![feature(plugin)]
+#![plugin(cookie_monster)]
+//~^ ERROR E0463
+extern crate cake_is_a_lie;
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0463.stderr b/src/test/ui/error-codes/E0463.stderr
new file mode 100644
index 000000000..1aa66e1ec
--- /dev/null
+++ b/src/test/ui/error-codes/E0463.stderr
@@ -0,0 +1,9 @@
+error[E0463]: can't find crate for `cookie_monster`
+ --> $DIR/E0463.rs:2:11
+ |
+LL | #![plugin(cookie_monster)]
+ | ^^^^^^^^^^^^^^ can't find crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0463`.
diff --git a/src/test/ui/error-codes/E0464.rs b/src/test/ui/error-codes/E0464.rs
new file mode 100644
index 000000000..969115a7d
--- /dev/null
+++ b/src/test/ui/error-codes/E0464.rs
@@ -0,0 +1,15 @@
+// aux-build:crateresolve1-1.rs
+// aux-build:crateresolve1-2.rs
+// aux-build:crateresolve1-3.rs
+
+// normalize-stderr-test: "\.nll/" -> "/"
+// normalize-stderr-test: "\\\?\\" -> ""
+// normalize-stderr-test: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"
+
+// NOTE: This test is duplicated from `src/test/ui/crate-loading/crateresolve1.rs`.
+
+extern crate crateresolve1;
+//~^ ERROR multiple matching crates for `crateresolve1`
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0464.stderr b/src/test/ui/error-codes/E0464.stderr
new file mode 100644
index 000000000..3d950ddd2
--- /dev/null
+++ b/src/test/ui/error-codes/E0464.stderr
@@ -0,0 +1,14 @@
+error[E0464]: multiple matching crates for `crateresolve1`
+ --> $DIR/E0464.rs:11:1
+ |
+LL | extern crate crateresolve1;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: candidates:
+ crate `crateresolve1`: $TEST_BUILD_DIR/error-codes/E0464/auxiliary/libcrateresolve1-1.somelib
+ crate `crateresolve1`: $TEST_BUILD_DIR/error-codes/E0464/auxiliary/libcrateresolve1-2.somelib
+ crate `crateresolve1`: $TEST_BUILD_DIR/error-codes/E0464/auxiliary/libcrateresolve1-3.somelib
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0464`.
diff --git a/src/test/ui/error-codes/E0478.rs b/src/test/ui/error-codes/E0478.rs
new file mode 100644
index 000000000..b1562dc0a
--- /dev/null
+++ b/src/test/ui/error-codes/E0478.rs
@@ -0,0 +1,8 @@
+trait Wedding<'t>: 't { }
+
+struct Prince<'kiss, 'SnowWhite> {
+ child: Box<dyn Wedding<'kiss> + 'SnowWhite>, //~ ERROR E0478
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0478.stderr b/src/test/ui/error-codes/E0478.stderr
new file mode 100644
index 000000000..ec650085a
--- /dev/null
+++ b/src/test/ui/error-codes/E0478.stderr
@@ -0,0 +1,20 @@
+error[E0478]: lifetime bound not satisfied
+ --> $DIR/E0478.rs:4:12
+ |
+LL | child: Box<dyn Wedding<'kiss> + 'SnowWhite>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: lifetime parameter instantiated with the lifetime `'SnowWhite` as defined here
+ --> $DIR/E0478.rs:3:22
+ |
+LL | struct Prince<'kiss, 'SnowWhite> {
+ | ^^^^^^^^^^
+note: but lifetime parameter must outlive the lifetime `'kiss` as defined here
+ --> $DIR/E0478.rs:3:15
+ |
+LL | struct Prince<'kiss, 'SnowWhite> {
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0478`.
diff --git a/src/test/ui/error-codes/E0492.rs b/src/test/ui/error-codes/E0492.rs
new file mode 100644
index 000000000..2c735fcc9
--- /dev/null
+++ b/src/test/ui/error-codes/E0492.rs
@@ -0,0 +1,10 @@
+use std::sync::atomic::AtomicUsize;
+
+const A: AtomicUsize = AtomicUsize::new(0);
+const B: &'static AtomicUsize = &A; //~ ERROR E0492
+static C: &'static AtomicUsize = &A; //~ ERROR E0492
+
+const NONE: &'static Option<AtomicUsize> = &None;
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0492.stderr b/src/test/ui/error-codes/E0492.stderr
new file mode 100644
index 000000000..557c977e8
--- /dev/null
+++ b/src/test/ui/error-codes/E0492.stderr
@@ -0,0 +1,17 @@
+error[E0492]: constants cannot refer to interior mutable data
+ --> $DIR/E0492.rs:4:33
+ |
+LL | const B: &'static AtomicUsize = &A;
+ | ^^ this borrow of an interior mutable value may end up in the final value
+
+error[E0492]: statics cannot refer to interior mutable data
+ --> $DIR/E0492.rs:5:34
+ |
+LL | static C: &'static AtomicUsize = &A;
+ | ^^ this borrow of an interior mutable value may end up in the final value
+ |
+ = help: to fix this, the value can be extracted to a separate `static` item and then referenced
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0492`.
diff --git a/src/test/ui/error-codes/E0496.rs b/src/test/ui/error-codes/E0496.rs
new file mode 100644
index 000000000..b57c9c79e
--- /dev/null
+++ b/src/test/ui/error-codes/E0496.rs
@@ -0,0 +1,11 @@
+struct Foo<'a> {
+ a: &'a i32,
+}
+
+impl<'a> Foo<'a> {
+ fn f<'a>(x: &'a i32) { //~ ERROR E0496
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0496.stderr b/src/test/ui/error-codes/E0496.stderr
new file mode 100644
index 000000000..80ca2b1fb
--- /dev/null
+++ b/src/test/ui/error-codes/E0496.stderr
@@ -0,0 +1,11 @@
+error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
+ --> $DIR/E0496.rs:6:10
+ |
+LL | impl<'a> Foo<'a> {
+ | -- first declared here
+LL | fn f<'a>(x: &'a i32) {
+ | ^^ lifetime `'a` already in scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0496`.
diff --git a/src/test/ui/error-codes/E0499.rs b/src/test/ui/error-codes/E0499.rs
new file mode 100644
index 000000000..919f97c8a
--- /dev/null
+++ b/src/test/ui/error-codes/E0499.rs
@@ -0,0 +1,10 @@
+fn main() {
+ let mut i = 0;
+ let mut x = &mut i;
+ let mut a = &mut i; //~ ERROR E0499
+ a.use_mut();
+ x.use_mut();
+}
+
+trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
+impl<T> Fake for T { }
diff --git a/src/test/ui/error-codes/E0499.stderr b/src/test/ui/error-codes/E0499.stderr
new file mode 100644
index 000000000..af5a1e186
--- /dev/null
+++ b/src/test/ui/error-codes/E0499.stderr
@@ -0,0 +1,14 @@
+error[E0499]: cannot borrow `i` as mutable more than once at a time
+ --> $DIR/E0499.rs:4:17
+ |
+LL | let mut x = &mut i;
+ | ------ first mutable borrow occurs here
+LL | let mut a = &mut i;
+ | ^^^^^^ second mutable borrow occurs here
+LL | a.use_mut();
+LL | x.use_mut();
+ | ----------- first borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0499`.
diff --git a/src/test/ui/error-codes/E0501.rs b/src/test/ui/error-codes/E0501.rs
new file mode 100644
index 000000000..3e39d9a63
--- /dev/null
+++ b/src/test/ui/error-codes/E0501.rs
@@ -0,0 +1,24 @@
+fn inside_closure(x: &mut i32) {
+}
+
+fn outside_closure_1(x: &mut i32) {
+}
+
+fn outside_closure_2(x: &i32) {
+}
+
+fn foo(a: &mut i32) {
+ let bar = || {
+ inside_closure(a)
+ };
+ outside_closure_1(a);
+ //~^ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
+
+ outside_closure_2(a);
+ //~^ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
+
+ drop(bar);
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0501.stderr b/src/test/ui/error-codes/E0501.stderr
new file mode 100644
index 000000000..53d98d7e1
--- /dev/null
+++ b/src/test/ui/error-codes/E0501.stderr
@@ -0,0 +1,31 @@
+error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
+ --> $DIR/E0501.rs:14:23
+ |
+LL | let bar = || {
+ | -- closure construction occurs here
+LL | inside_closure(a)
+ | - first borrow occurs due to use of `a` in closure
+LL | };
+LL | outside_closure_1(a);
+ | ^ second borrow occurs here
+...
+LL | drop(bar);
+ | --- first borrow later used here
+
+error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
+ --> $DIR/E0501.rs:17:23
+ |
+LL | let bar = || {
+ | -- closure construction occurs here
+LL | inside_closure(a)
+ | - first borrow occurs due to use of `a` in closure
+...
+LL | outside_closure_2(a);
+ | ^ second borrow occurs here
+...
+LL | drop(bar);
+ | --- first borrow later used here
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0501`.
diff --git a/src/test/ui/error-codes/E0502.rs b/src/test/ui/error-codes/E0502.rs
new file mode 100644
index 000000000..958380ece
--- /dev/null
+++ b/src/test/ui/error-codes/E0502.rs
@@ -0,0 +1,12 @@
+fn bar(x: &mut i32) {}
+fn foo(a: &mut i32) {
+ let ref y = a;
+ bar(a); //~ ERROR E0502
+ y.use_ref();
+}
+
+fn main() {
+}
+
+trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
+impl<T> Fake for T { }
diff --git a/src/test/ui/error-codes/E0502.stderr b/src/test/ui/error-codes/E0502.stderr
new file mode 100644
index 000000000..94cc89754
--- /dev/null
+++ b/src/test/ui/error-codes/E0502.stderr
@@ -0,0 +1,13 @@
+error[E0502]: cannot borrow `*a` as mutable because it is also borrowed as immutable
+ --> $DIR/E0502.rs:4:5
+ |
+LL | let ref y = a;
+ | ----- immutable borrow occurs here
+LL | bar(a);
+ | ^^^^^^ mutable borrow occurs here
+LL | y.use_ref();
+ | ----------- immutable borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/error-codes/E0503.rs b/src/test/ui/error-codes/E0503.rs
new file mode 100644
index 000000000..88f5fc1bb
--- /dev/null
+++ b/src/test/ui/error-codes/E0503.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let mut value = 3;
+ let _borrow = &mut value;
+ let _sum = value + 1; //~ ERROR E0503
+ _borrow.use_mut();
+}
+
+trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
+impl<T> Fake for T { }
diff --git a/src/test/ui/error-codes/E0503.stderr b/src/test/ui/error-codes/E0503.stderr
new file mode 100644
index 000000000..fafe363eb
--- /dev/null
+++ b/src/test/ui/error-codes/E0503.stderr
@@ -0,0 +1,13 @@
+error[E0503]: cannot use `value` because it was mutably borrowed
+ --> $DIR/E0503.rs:4:16
+ |
+LL | let _borrow = &mut value;
+ | ---------- borrow of `value` occurs here
+LL | let _sum = value + 1;
+ | ^^^^^ use of borrowed `value`
+LL | _borrow.use_mut();
+ | ----------------- borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0503`.
diff --git a/src/test/ui/error-codes/E0504.rs b/src/test/ui/error-codes/E0504.rs
new file mode 100644
index 000000000..c2658bef6
--- /dev/null
+++ b/src/test/ui/error-codes/E0504.rs
@@ -0,0 +1,15 @@
+struct FancyNum {
+ num: u8,
+}
+
+fn main() {
+ let fancy_num = FancyNum { num: 5 };
+ let fancy_ref = &fancy_num;
+
+ let x = move || { //~ ERROR E0505
+ println!("child function: {}", fancy_num.num);
+ };
+
+ x();
+ println!("main function: {}", fancy_ref.num);
+}
diff --git a/src/test/ui/error-codes/E0504.stderr b/src/test/ui/error-codes/E0504.stderr
new file mode 100644
index 000000000..e677e8916
--- /dev/null
+++ b/src/test/ui/error-codes/E0504.stderr
@@ -0,0 +1,17 @@
+error[E0505]: cannot move out of `fancy_num` because it is borrowed
+ --> $DIR/E0504.rs:9:13
+ |
+LL | let fancy_ref = &fancy_num;
+ | ---------- borrow of `fancy_num` occurs here
+LL |
+LL | let x = move || {
+ | ^^^^^^^ move out of `fancy_num` occurs here
+LL | println!("child function: {}", fancy_num.num);
+ | ------------- move occurs due to use in closure
+...
+LL | println!("main function: {}", fancy_ref.num);
+ | ------------- borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0505`.
diff --git a/src/test/ui/error-codes/E0505.rs b/src/test/ui/error-codes/E0505.rs
new file mode 100644
index 000000000..941f5f219
--- /dev/null
+++ b/src/test/ui/error-codes/E0505.rs
@@ -0,0 +1,15 @@
+struct Value {}
+
+fn eat(val: Value) {}
+
+fn main() {
+ let x = Value{};
+ {
+ let _ref_to_val: &Value = &x;
+ eat(x); //~ ERROR E0505
+ _ref_to_val.use_ref();
+ }
+}
+
+trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
+impl<T> Fake for T { }
diff --git a/src/test/ui/error-codes/E0505.stderr b/src/test/ui/error-codes/E0505.stderr
new file mode 100644
index 000000000..bd3f37f54
--- /dev/null
+++ b/src/test/ui/error-codes/E0505.stderr
@@ -0,0 +1,13 @@
+error[E0505]: cannot move out of `x` because it is borrowed
+ --> $DIR/E0505.rs:9:13
+ |
+LL | let _ref_to_val: &Value = &x;
+ | -- borrow of `x` occurs here
+LL | eat(x);
+ | ^ move out of `x` occurs here
+LL | _ref_to_val.use_ref();
+ | --------------------- borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0505`.
diff --git a/src/test/ui/error-codes/E0506.rs b/src/test/ui/error-codes/E0506.rs
new file mode 100644
index 000000000..062a44a52
--- /dev/null
+++ b/src/test/ui/error-codes/E0506.rs
@@ -0,0 +1,11 @@
+struct FancyNum {
+ num: u8,
+}
+
+fn main() {
+ let mut fancy_num = FancyNum { num: 5 };
+ let fancy_ref = &fancy_num;
+ fancy_num = FancyNum { num: 6 }; //~ ERROR [E0506]
+
+ println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
+}
diff --git a/src/test/ui/error-codes/E0506.stderr b/src/test/ui/error-codes/E0506.stderr
new file mode 100644
index 000000000..d70406b75
--- /dev/null
+++ b/src/test/ui/error-codes/E0506.stderr
@@ -0,0 +1,14 @@
+error[E0506]: cannot assign to `fancy_num` because it is borrowed
+ --> $DIR/E0506.rs:8:5
+ |
+LL | let fancy_ref = &fancy_num;
+ | ---------- borrow of `fancy_num` occurs here
+LL | fancy_num = FancyNum { num: 6 };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
+LL |
+LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
+ | ------------- borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0506`.
diff --git a/src/test/ui/error-codes/E0507.rs b/src/test/ui/error-codes/E0507.rs
new file mode 100644
index 000000000..bae90a44c
--- /dev/null
+++ b/src/test/ui/error-codes/E0507.rs
@@ -0,0 +1,13 @@
+use std::cell::RefCell;
+
+struct TheDarkKnight;
+
+impl TheDarkKnight {
+ fn nothing_is_true(self) {}
+}
+
+fn main() {
+ let x = RefCell::new(TheDarkKnight);
+
+ x.borrow().nothing_is_true(); //~ ERROR E0507
+}
diff --git a/src/test/ui/error-codes/E0507.stderr b/src/test/ui/error-codes/E0507.stderr
new file mode 100644
index 000000000..ce8d1ef03
--- /dev/null
+++ b/src/test/ui/error-codes/E0507.stderr
@@ -0,0 +1,18 @@
+error[E0507]: cannot move out of dereference of `Ref<'_, TheDarkKnight>`
+ --> $DIR/E0507.rs:12:5
+ |
+LL | x.borrow().nothing_is_true();
+ | ^^^^^^^^^^^-----------------
+ | | |
+ | | value moved due to this method call
+ | move occurs because value has type `TheDarkKnight`, which does not implement the `Copy` trait
+ |
+note: this function takes ownership of the receiver `self`, which moves value
+ --> $DIR/E0507.rs:6:24
+ |
+LL | fn nothing_is_true(self) {}
+ | ^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/error-codes/E0508-fail.rs b/src/test/ui/error-codes/E0508-fail.rs
new file mode 100644
index 000000000..072c3d661
--- /dev/null
+++ b/src/test/ui/error-codes/E0508-fail.rs
@@ -0,0 +1,6 @@
+struct NonCopy;
+
+fn main() {
+ let array = [NonCopy; 1];
+ let _value = array[0]; //~ ERROR [E0508]
+}
diff --git a/src/test/ui/error-codes/E0508-fail.stderr b/src/test/ui/error-codes/E0508-fail.stderr
new file mode 100644
index 000000000..b69d7743b
--- /dev/null
+++ b/src/test/ui/error-codes/E0508-fail.stderr
@@ -0,0 +1,13 @@
+error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
+ --> $DIR/E0508-fail.rs:5:18
+ |
+LL | let _value = array[0];
+ | ^^^^^^^^
+ | |
+ | cannot move out of here
+ | move occurs because `array[_]` has type `NonCopy`, which does not implement the `Copy` trait
+ | help: consider borrowing here: `&array[0]`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0508`.
diff --git a/src/test/ui/error-codes/E0508.rs b/src/test/ui/error-codes/E0508.rs
new file mode 100644
index 000000000..072c3d661
--- /dev/null
+++ b/src/test/ui/error-codes/E0508.rs
@@ -0,0 +1,6 @@
+struct NonCopy;
+
+fn main() {
+ let array = [NonCopy; 1];
+ let _value = array[0]; //~ ERROR [E0508]
+}
diff --git a/src/test/ui/error-codes/E0508.stderr b/src/test/ui/error-codes/E0508.stderr
new file mode 100644
index 000000000..5e7b56dcd
--- /dev/null
+++ b/src/test/ui/error-codes/E0508.stderr
@@ -0,0 +1,13 @@
+error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
+ --> $DIR/E0508.rs:5:18
+ |
+LL | let _value = array[0];
+ | ^^^^^^^^
+ | |
+ | cannot move out of here
+ | move occurs because `array[_]` has type `NonCopy`, which does not implement the `Copy` trait
+ | help: consider borrowing here: `&array[0]`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0508`.
diff --git a/src/test/ui/error-codes/E0509.rs b/src/test/ui/error-codes/E0509.rs
new file mode 100644
index 000000000..b2665c4cc
--- /dev/null
+++ b/src/test/ui/error-codes/E0509.rs
@@ -0,0 +1,18 @@
+struct FancyNum {
+ num: usize
+}
+
+struct DropStruct {
+ fancy: FancyNum
+}
+
+impl Drop for DropStruct {
+ fn drop(&mut self) {
+ }
+}
+
+fn main() {
+ let drop_struct = DropStruct{fancy: FancyNum{num: 5}};
+ let fancy_field = drop_struct.fancy; //~ ERROR E0509
+ println!("Fancy: {}", fancy_field.num);
+}
diff --git a/src/test/ui/error-codes/E0509.stderr b/src/test/ui/error-codes/E0509.stderr
new file mode 100644
index 000000000..cbfbc3ccf
--- /dev/null
+++ b/src/test/ui/error-codes/E0509.stderr
@@ -0,0 +1,13 @@
+error[E0509]: cannot move out of type `DropStruct`, which implements the `Drop` trait
+ --> $DIR/E0509.rs:16:23
+ |
+LL | let fancy_field = drop_struct.fancy;
+ | ^^^^^^^^^^^^^^^^^
+ | |
+ | cannot move out of here
+ | move occurs because `drop_struct.fancy` has type `FancyNum`, which does not implement the `Copy` trait
+ | help: consider borrowing here: `&drop_struct.fancy`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0509`.
diff --git a/src/test/ui/error-codes/E0511.rs b/src/test/ui/error-codes/E0511.rs
new file mode 100644
index 000000000..a52f81a6c
--- /dev/null
+++ b/src/test/ui/error-codes/E0511.rs
@@ -0,0 +1,11 @@
+// build-fail
+
+#![feature(platform_intrinsics)]
+
+extern "platform-intrinsic" {
+ fn simd_add<T>(a: T, b: T) -> T;
+}
+
+fn main() {
+ unsafe { simd_add(0, 1); } //~ ERROR E0511
+}
diff --git a/src/test/ui/error-codes/E0511.stderr b/src/test/ui/error-codes/E0511.stderr
new file mode 100644
index 000000000..d797b10d5
--- /dev/null
+++ b/src/test/ui/error-codes/E0511.stderr
@@ -0,0 +1,9 @@
+error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32`
+ --> $DIR/E0511.rs:10:14
+ |
+LL | unsafe { simd_add(0, 1); }
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0511`.
diff --git a/src/test/ui/error-codes/E0512.rs b/src/test/ui/error-codes/E0512.rs
new file mode 100644
index 000000000..e70992aee
--- /dev/null
+++ b/src/test/ui/error-codes/E0512.rs
@@ -0,0 +1,5 @@
+fn takes_u8(_: u8) {}
+
+fn main() {
+ unsafe { takes_u8(::std::mem::transmute(0u16)); } //~ ERROR E0512
+}
diff --git a/src/test/ui/error-codes/E0512.stderr b/src/test/ui/error-codes/E0512.stderr
new file mode 100644
index 000000000..3fecce542
--- /dev/null
+++ b/src/test/ui/error-codes/E0512.stderr
@@ -0,0 +1,12 @@
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/E0512.rs:4:23
+ |
+LL | unsafe { takes_u8(::std::mem::transmute(0u16)); }
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `u16` (16 bits)
+ = note: target type: `u8` (8 bits)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0512`.
diff --git a/src/test/ui/error-codes/E0516.rs b/src/test/ui/error-codes/E0516.rs
new file mode 100644
index 000000000..834bb6309
--- /dev/null
+++ b/src/test/ui/error-codes/E0516.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let x: typeof(92) = 92; //~ ERROR E0516
+ //~| reserved keyword
+}
diff --git a/src/test/ui/error-codes/E0516.stderr b/src/test/ui/error-codes/E0516.stderr
new file mode 100644
index 000000000..5243b7caf
--- /dev/null
+++ b/src/test/ui/error-codes/E0516.stderr
@@ -0,0 +1,14 @@
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+ --> $DIR/E0516.rs:2:12
+ |
+LL | let x: typeof(92) = 92;
+ | ^^^^^^^^^^ reserved keyword
+ |
+help: consider replacing `typeof(...)` with an actual type
+ |
+LL | let x: i32 = 92;
+ | ~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0516`.
diff --git a/src/test/ui/error-codes/E0517.rs b/src/test/ui/error-codes/E0517.rs
new file mode 100644
index 000000000..1dcaa2d74
--- /dev/null
+++ b/src/test/ui/error-codes/E0517.rs
@@ -0,0 +1,15 @@
+#[repr(C)] //~ ERROR: E0517
+type Foo = u8;
+
+#[repr(packed)] //~ ERROR: E0517
+enum Foo2 {Bar, Baz}
+
+#[repr(u8)] //~ ERROR: E0517
+struct Foo3 {bar: bool, baz: bool}
+
+#[repr(C)] //~ ERROR: E0517
+impl Foo3 {
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0517.stderr b/src/test/ui/error-codes/E0517.stderr
new file mode 100644
index 000000000..2f90d4d0b
--- /dev/null
+++ b/src/test/ui/error-codes/E0517.stderr
@@ -0,0 +1,36 @@
+error[E0517]: attribute should be applied to a struct, enum, or union
+ --> $DIR/E0517.rs:1:8
+ |
+LL | #[repr(C)]
+ | ^
+LL | type Foo = u8;
+ | -------------- not a struct, enum, or union
+
+error[E0517]: attribute should be applied to a struct or union
+ --> $DIR/E0517.rs:4:8
+ |
+LL | #[repr(packed)]
+ | ^^^^^^
+LL | enum Foo2 {Bar, Baz}
+ | -------------------- not a struct or union
+
+error[E0517]: attribute should be applied to an enum
+ --> $DIR/E0517.rs:7:8
+ |
+LL | #[repr(u8)]
+ | ^^
+LL | struct Foo3 {bar: bool, baz: bool}
+ | ---------------------------------- not an enum
+
+error[E0517]: attribute should be applied to a struct, enum, or union
+ --> $DIR/E0517.rs:10:8
+ |
+LL | #[repr(C)]
+ | ^
+LL | / impl Foo3 {
+LL | | }
+ | |_- not a struct, enum, or union
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0517`.
diff --git a/src/test/ui/error-codes/E0518.rs b/src/test/ui/error-codes/E0518.rs
new file mode 100644
index 000000000..9c99702ad
--- /dev/null
+++ b/src/test/ui/error-codes/E0518.rs
@@ -0,0 +1,9 @@
+#[inline(always)] //~ ERROR: E0518
+struct Foo;
+
+#[inline(never)] //~ ERROR: E0518
+impl Foo {
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0518.stderr b/src/test/ui/error-codes/E0518.stderr
new file mode 100644
index 000000000..561446f81
--- /dev/null
+++ b/src/test/ui/error-codes/E0518.stderr
@@ -0,0 +1,20 @@
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/E0518.rs:1:1
+ |
+LL | #[inline(always)]
+ | ^^^^^^^^^^^^^^^^^
+LL | struct Foo;
+ | ----------- not a function or closure
+
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/E0518.rs:4:1
+ |
+LL | #[inline(never)]
+ | ^^^^^^^^^^^^^^^^
+LL | / impl Foo {
+LL | | }
+ | |_- not a function or closure
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0518`.
diff --git a/src/test/ui/error-codes/E0520.rs b/src/test/ui/error-codes/E0520.rs
new file mode 100644
index 000000000..ead78b7ff
--- /dev/null
+++ b/src/test/ui/error-codes/E0520.rs
@@ -0,0 +1,22 @@
+#![feature(specialization)]
+//~^ WARN the feature `specialization` is incomplete
+
+trait SpaceLlama {
+ fn fly(&self);
+}
+
+impl<T> SpaceLlama for T {
+ default fn fly(&self) {}
+}
+
+impl<T: Clone> SpaceLlama for T {
+ fn fly(&self) {}
+}
+
+impl SpaceLlama for i32 {
+ default fn fly(&self) {}
+ //~^ ERROR E0520
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0520.stderr b/src/test/ui/error-codes/E0520.stderr
new file mode 100644
index 000000000..65ebfcdbe
--- /dev/null
+++ b/src/test/ui/error-codes/E0520.stderr
@@ -0,0 +1,24 @@
+warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/E0520.rs:1:12
+ |
+LL | #![feature(specialization)]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
+ = help: consider using `min_specialization` instead, which is more stable and complete
+
+error[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default`
+ --> $DIR/E0520.rs:17:5
+ |
+LL | impl<T: Clone> SpaceLlama for T {
+ | ------------------------------- parent `impl` is here
+...
+LL | default fn fly(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly`
+ |
+ = note: to specialize, `fly` in the parent `impl` must be marked `default`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0520`.
diff --git a/src/test/ui/error-codes/E0522.rs b/src/test/ui/error-codes/E0522.rs
new file mode 100644
index 000000000..1414e8240
--- /dev/null
+++ b/src/test/ui/error-codes/E0522.rs
@@ -0,0 +1,9 @@
+#![feature(lang_items)]
+
+#[lang = "cookie"]
+fn cookie() -> ! {
+//~^^ ERROR definition of an unknown language item: `cookie` [E0522]
+ loop {}
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0522.stderr b/src/test/ui/error-codes/E0522.stderr
new file mode 100644
index 000000000..0a8a41598
--- /dev/null
+++ b/src/test/ui/error-codes/E0522.stderr
@@ -0,0 +1,9 @@
+error[E0522]: definition of an unknown language item: `cookie`
+ --> $DIR/E0522.rs:3:1
+ |
+LL | #[lang = "cookie"]
+ | ^^^^^^^^^^^^^^^^^^ definition of unknown language item `cookie`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0522`.
diff --git a/src/test/ui/error-codes/E0527.rs b/src/test/ui/error-codes/E0527.rs
new file mode 100644
index 000000000..af055ff26
--- /dev/null
+++ b/src/test/ui/error-codes/E0527.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let r = &[1, 2, 3, 4];
+ match r {
+ &[a, b] => {
+ //~^ ERROR E0527
+ println!("a={}, b={}", a, b);
+ }
+ }
+}
diff --git a/src/test/ui/error-codes/E0527.stderr b/src/test/ui/error-codes/E0527.stderr
new file mode 100644
index 000000000..a2e6288b2
--- /dev/null
+++ b/src/test/ui/error-codes/E0527.stderr
@@ -0,0 +1,9 @@
+error[E0527]: pattern requires 2 elements but array has 4
+ --> $DIR/E0527.rs:4:10
+ |
+LL | &[a, b] => {
+ | ^^^^^^ expected 4 elements
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0527`.
diff --git a/src/test/ui/error-codes/E0528.rs b/src/test/ui/error-codes/E0528.rs
new file mode 100644
index 000000000..0a337c961
--- /dev/null
+++ b/src/test/ui/error-codes/E0528.rs
@@ -0,0 +1,8 @@
+fn main() {
+ let r = &[1, 2];
+ match r {
+ &[a, b, c, rest @ ..] => {
+ //~^ ERROR E0528
+ }
+ }
+}
diff --git a/src/test/ui/error-codes/E0528.stderr b/src/test/ui/error-codes/E0528.stderr
new file mode 100644
index 000000000..21615f954
--- /dev/null
+++ b/src/test/ui/error-codes/E0528.stderr
@@ -0,0 +1,9 @@
+error[E0528]: pattern requires at least 3 elements but array has 2
+ --> $DIR/E0528.rs:4:10
+ |
+LL | &[a, b, c, rest @ ..] => {
+ | ^^^^^^^^^^^^^^^^^^^^ pattern cannot match array of 2 elements
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0528`.
diff --git a/src/test/ui/error-codes/E0529.rs b/src/test/ui/error-codes/E0529.rs
new file mode 100644
index 000000000..a82bc9ebc
--- /dev/null
+++ b/src/test/ui/error-codes/E0529.rs
@@ -0,0 +1,8 @@
+fn main() {
+ let r: f32 = 1.0;
+ match r {
+ [a, b] => {
+ //~^ ERROR E0529
+ }
+ }
+}
diff --git a/src/test/ui/error-codes/E0529.stderr b/src/test/ui/error-codes/E0529.stderr
new file mode 100644
index 000000000..96b22bb22
--- /dev/null
+++ b/src/test/ui/error-codes/E0529.stderr
@@ -0,0 +1,9 @@
+error[E0529]: expected an array or slice, found `f32`
+ --> $DIR/E0529.rs:4:9
+ |
+LL | [a, b] => {
+ | ^^^^^^ pattern cannot match with input type `f32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0529`.
diff --git a/src/test/ui/error-codes/E0530.rs b/src/test/ui/error-codes/E0530.rs
new file mode 100644
index 000000000..5bc40964f
--- /dev/null
+++ b/src/test/ui/error-codes/E0530.rs
@@ -0,0 +1,8 @@
+fn main() {
+ static TEST: i32 = 0;
+
+ let r: (i32, i32) = (0, 0);
+ match r {
+ TEST => {} //~ ERROR E0530
+ }
+}
diff --git a/src/test/ui/error-codes/E0530.stderr b/src/test/ui/error-codes/E0530.stderr
new file mode 100644
index 000000000..c31214413
--- /dev/null
+++ b/src/test/ui/error-codes/E0530.stderr
@@ -0,0 +1,12 @@
+error[E0530]: match bindings cannot shadow statics
+ --> $DIR/E0530.rs:6:9
+ |
+LL | static TEST: i32 = 0;
+ | --------------------- the static `TEST` is defined here
+...
+LL | TEST => {}
+ | ^^^^ cannot be named the same as a static
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0530`.
diff --git a/src/test/ui/error-codes/E0532.rs b/src/test/ui/error-codes/E0532.rs
new file mode 100644
index 000000000..486da0e02
--- /dev/null
+++ b/src/test/ui/error-codes/E0532.rs
@@ -0,0 +1,14 @@
+fn main() {
+ let value = 1;
+
+ match SomeStruct(value) {
+ StructConst1(_) => { },
+ //~^ ERROR expected tuple struct or tuple variant, found constant `StructConst1`
+ _ => { },
+ }
+
+ struct SomeStruct(u8);
+
+ const StructConst1 : SomeStruct = SomeStruct(1);
+ const StructConst2 : SomeStruct = SomeStruct(2);
+}
diff --git a/src/test/ui/error-codes/E0532.stderr b/src/test/ui/error-codes/E0532.stderr
new file mode 100644
index 000000000..eeccadccc
--- /dev/null
+++ b/src/test/ui/error-codes/E0532.stderr
@@ -0,0 +1,9 @@
+error[E0532]: expected tuple struct or tuple variant, found constant `StructConst1`
+ --> $DIR/E0532.rs:5:9
+ |
+LL | StructConst1(_) => { },
+ | ^^^^^^^^^^^^ not a tuple struct or tuple variant
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0532`.
diff --git a/src/test/ui/error-codes/E0534.rs b/src/test/ui/error-codes/E0534.rs
new file mode 100644
index 000000000..a42424994
--- /dev/null
+++ b/src/test/ui/error-codes/E0534.rs
@@ -0,0 +1,6 @@
+#[inline()] //~ ERROR E0534
+pub fn something() {}
+
+fn main() {
+ something();
+}
diff --git a/src/test/ui/error-codes/E0534.stderr b/src/test/ui/error-codes/E0534.stderr
new file mode 100644
index 000000000..23f9cd7ce
--- /dev/null
+++ b/src/test/ui/error-codes/E0534.stderr
@@ -0,0 +1,9 @@
+error[E0534]: expected one argument
+ --> $DIR/E0534.rs:1:1
+ |
+LL | #[inline()]
+ | ^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0534`.
diff --git a/src/test/ui/error-codes/E0559.rs b/src/test/ui/error-codes/E0559.rs
new file mode 100644
index 000000000..c6d04ff14
--- /dev/null
+++ b/src/test/ui/error-codes/E0559.rs
@@ -0,0 +1,8 @@
+enum Field {
+ Fool { x: u32 },
+}
+
+fn main() {
+ let s = Field::Fool { joke: 0 };
+ //~^ ERROR E0559
+}
diff --git a/src/test/ui/error-codes/E0559.stderr b/src/test/ui/error-codes/E0559.stderr
new file mode 100644
index 000000000..63ee1cd78
--- /dev/null
+++ b/src/test/ui/error-codes/E0559.stderr
@@ -0,0 +1,11 @@
+error[E0559]: variant `Field::Fool` has no field named `joke`
+ --> $DIR/E0559.rs:6:27
+ |
+LL | let s = Field::Fool { joke: 0 };
+ | ^^^^ `Field::Fool` does not have this field
+ |
+ = note: available fields are: `x`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0559`.
diff --git a/src/test/ui/error-codes/E0560.rs b/src/test/ui/error-codes/E0560.rs
new file mode 100644
index 000000000..1d60f8948
--- /dev/null
+++ b/src/test/ui/error-codes/E0560.rs
@@ -0,0 +1,8 @@
+struct Simba {
+ mother: u32,
+}
+
+fn main() {
+ let s = Simba { mother: 1, father: 0 };
+ //~^ ERROR E0560
+}
diff --git a/src/test/ui/error-codes/E0560.stderr b/src/test/ui/error-codes/E0560.stderr
new file mode 100644
index 000000000..6b634f185
--- /dev/null
+++ b/src/test/ui/error-codes/E0560.stderr
@@ -0,0 +1,11 @@
+error[E0560]: struct `Simba` has no field named `father`
+ --> $DIR/E0560.rs:6:32
+ |
+LL | let s = Simba { mother: 1, father: 0 };
+ | ^^^^^^ `Simba` does not have this field
+ |
+ = note: available fields are: `mother`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0560`.
diff --git a/src/test/ui/error-codes/E0565-1.rs b/src/test/ui/error-codes/E0565-1.rs
new file mode 100644
index 000000000..30fba0191
--- /dev/null
+++ b/src/test/ui/error-codes/E0565-1.rs
@@ -0,0 +1,5 @@
+// deprecated doesn't currently support literals
+#[deprecated("since")] //~ ERROR E0565
+fn f() { }
+
+fn main() { }
diff --git a/src/test/ui/error-codes/E0565-1.stderr b/src/test/ui/error-codes/E0565-1.stderr
new file mode 100644
index 000000000..1283a9c5e
--- /dev/null
+++ b/src/test/ui/error-codes/E0565-1.stderr
@@ -0,0 +1,9 @@
+error[E0565]: item in `deprecated` must be a key/value pair
+ --> $DIR/E0565-1.rs:2:14
+ |
+LL | #[deprecated("since")]
+ | ^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0565`.
diff --git a/src/test/ui/error-codes/E0565-2.rs b/src/test/ui/error-codes/E0565-2.rs
new file mode 100644
index 000000000..0319ecb11
--- /dev/null
+++ b/src/test/ui/error-codes/E0565-2.rs
@@ -0,0 +1,5 @@
+// repr currently doesn't support literals
+#[deprecated(since = b"1.29", note = "hi")] //~ ERROR E0565
+struct A { }
+
+fn main() { }
diff --git a/src/test/ui/error-codes/E0565-2.stderr b/src/test/ui/error-codes/E0565-2.stderr
new file mode 100644
index 000000000..bb30bd7be
--- /dev/null
+++ b/src/test/ui/error-codes/E0565-2.stderr
@@ -0,0 +1,9 @@
+error[E0565]: literal in `deprecated` value must be a string
+ --> $DIR/E0565-2.rs:2:22
+ |
+LL | #[deprecated(since = b"1.29", note = "hi")]
+ | ^^^^^^^ help: consider removing the prefix: `"1.29"`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0565`.
diff --git a/src/test/ui/error-codes/E0565.rs b/src/test/ui/error-codes/E0565.rs
new file mode 100644
index 000000000..df76f6b13
--- /dev/null
+++ b/src/test/ui/error-codes/E0565.rs
@@ -0,0 +1,5 @@
+// repr currently doesn't support literals
+#[repr("C")] //~ ERROR E0565
+struct A {}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0565.stderr b/src/test/ui/error-codes/E0565.stderr
new file mode 100644
index 000000000..6ed90c0ae
--- /dev/null
+++ b/src/test/ui/error-codes/E0565.stderr
@@ -0,0 +1,9 @@
+error[E0565]: meta item in `repr` must be an identifier
+ --> $DIR/E0565.rs:2:8
+ |
+LL | #[repr("C")]
+ | ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0565`.
diff --git a/src/test/ui/error-codes/E0572.rs b/src/test/ui/error-codes/E0572.rs
new file mode 100644
index 000000000..cb842c933
--- /dev/null
+++ b/src/test/ui/error-codes/E0572.rs
@@ -0,0 +1,3 @@
+const FOO: u32 = return 0; //~ ERROR E0572
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0572.stderr b/src/test/ui/error-codes/E0572.stderr
new file mode 100644
index 000000000..36619f8de
--- /dev/null
+++ b/src/test/ui/error-codes/E0572.stderr
@@ -0,0 +1,9 @@
+error[E0572]: return statement outside of function body
+ --> $DIR/E0572.rs:1:18
+ |
+LL | const FOO: u32 = return 0;
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0572`.
diff --git a/src/test/ui/error-codes/E0582.rs b/src/test/ui/error-codes/E0582.rs
new file mode 100644
index 000000000..ff25012d0
--- /dev/null
+++ b/src/test/ui/error-codes/E0582.rs
@@ -0,0 +1,42 @@
+// This test was derived from the wasm and parsell crates. They
+// stopped compiling when #32330 is fixed.
+
+#![allow(dead_code, unused_variables)]
+
+use std::str::Chars;
+
+pub trait HasOutput<Ch, Str> {
+ type Output;
+}
+
+#[derive(Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Debug)]
+pub enum Token<'a> {
+ Begin(&'a str)
+}
+
+fn mk_unexpected_char_err<'a>() -> Option<&'a i32> {
+ unimplemented!()
+}
+
+fn foo<'a>(data: &mut Chars<'a>) {
+ bar(mk_unexpected_char_err)
+}
+
+fn bar<F>(t: F)
+ // No type can satisfy this requirement, since `'a` does not
+ // appear in any of the input types:
+ where F: for<'a> Fn() -> Option<&'a i32>
+ //~^ ERROR E0582
+{
+}
+
+fn baz<F>(t: F)
+ // No type can satisfy this requirement, since `'a` does not
+ // appear in any of the input types:
+ where F: for<'a> Iterator<Item=&'a i32>
+ //~^ ERROR E0582
+{
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0582.stderr b/src/test/ui/error-codes/E0582.stderr
new file mode 100644
index 000000000..81a2f0046
--- /dev/null
+++ b/src/test/ui/error-codes/E0582.stderr
@@ -0,0 +1,15 @@
+error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
+ --> $DIR/E0582.rs:28:30
+ |
+LL | where F: for<'a> Fn() -> Option<&'a i32>
+ | ^^^^^^^^^^^^^^^
+
+error[E0582]: binding for associated type `Item` references lifetime `'a`, which does not appear in the trait input types
+ --> $DIR/E0582.rs:36:31
+ |
+LL | where F: for<'a> Iterator<Item=&'a i32>
+ | ^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0582`.
diff --git a/src/test/ui/error-codes/E0583.rs b/src/test/ui/error-codes/E0583.rs
new file mode 100644
index 000000000..969de79c0
--- /dev/null
+++ b/src/test/ui/error-codes/E0583.rs
@@ -0,0 +1,4 @@
+mod module_that_doesnt_exist; //~ ERROR E0583
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0583.stderr b/src/test/ui/error-codes/E0583.stderr
new file mode 100644
index 000000000..c7bbbf114
--- /dev/null
+++ b/src/test/ui/error-codes/E0583.stderr
@@ -0,0 +1,11 @@
+error[E0583]: file not found for module `module_that_doesnt_exist`
+ --> $DIR/E0583.rs:1:1
+ |
+LL | mod module_that_doesnt_exist;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: to create the module `module_that_doesnt_exist`, create file "$DIR/module_that_doesnt_exist.rs" or "$DIR/module_that_doesnt_exist/mod.rs"
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0583`.
diff --git a/src/test/ui/error-codes/E0585.rs b/src/test/ui/error-codes/E0585.rs
new file mode 100644
index 000000000..890b77b53
--- /dev/null
+++ b/src/test/ui/error-codes/E0585.rs
@@ -0,0 +1,4 @@
+fn main() {
+ /// Hello! I'm useless...
+ //~^ ERROR E0585
+}
diff --git a/src/test/ui/error-codes/E0585.stderr b/src/test/ui/error-codes/E0585.stderr
new file mode 100644
index 000000000..7a31c4896
--- /dev/null
+++ b/src/test/ui/error-codes/E0585.stderr
@@ -0,0 +1,11 @@
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/E0585.rs:2:5
+ |
+LL | /// Hello! I'm useless...
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0585`.
diff --git a/src/test/ui/error-codes/E0586.rs b/src/test/ui/error-codes/E0586.rs
new file mode 100644
index 000000000..2ab8a2959
--- /dev/null
+++ b/src/test/ui/error-codes/E0586.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
+ let x = &tmp[1..=]; //~ ERROR E0586
+}
diff --git a/src/test/ui/error-codes/E0586.stderr b/src/test/ui/error-codes/E0586.stderr
new file mode 100644
index 000000000..0bbf9a608
--- /dev/null
+++ b/src/test/ui/error-codes/E0586.stderr
@@ -0,0 +1,11 @@
+error[E0586]: inclusive range with no end
+ --> $DIR/E0586.rs:3:19
+ |
+LL | let x = &tmp[1..=];
+ | ^^^ help: use `..` instead
+ |
+ = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0586`.
diff --git a/src/test/ui/error-codes/E0594.rs b/src/test/ui/error-codes/E0594.rs
new file mode 100644
index 000000000..8b0cae7e1
--- /dev/null
+++ b/src/test/ui/error-codes/E0594.rs
@@ -0,0 +1,5 @@
+static NUM: i32 = 18;
+
+fn main() {
+ NUM = 20; //~ ERROR cannot assign to immutable static item `NUM`
+}
diff --git a/src/test/ui/error-codes/E0594.stderr b/src/test/ui/error-codes/E0594.stderr
new file mode 100644
index 000000000..f4d96f4e4
--- /dev/null
+++ b/src/test/ui/error-codes/E0594.stderr
@@ -0,0 +1,9 @@
+error[E0594]: cannot assign to immutable static item `NUM`
+ --> $DIR/E0594.rs:4:5
+ |
+LL | NUM = 20;
+ | ^^^^^^^^ cannot assign
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0594`.
diff --git a/src/test/ui/error-codes/E0596.rs b/src/test/ui/error-codes/E0596.rs
new file mode 100644
index 000000000..9e2f5ee76
--- /dev/null
+++ b/src/test/ui/error-codes/E0596.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let x = 1;
+ let y = &mut x; //~ ERROR [E0596]
+}
diff --git a/src/test/ui/error-codes/E0596.stderr b/src/test/ui/error-codes/E0596.stderr
new file mode 100644
index 000000000..79bc258f1
--- /dev/null
+++ b/src/test/ui/error-codes/E0596.stderr
@@ -0,0 +1,11 @@
+error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
+ --> $DIR/E0596.rs:3:13
+ |
+LL | let x = 1;
+ | - help: consider changing this to be mutable: `mut x`
+LL | let y = &mut x;
+ | ^^^^^^ cannot borrow as mutable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0596`.
diff --git a/src/test/ui/error-codes/E0597.rs b/src/test/ui/error-codes/E0597.rs
new file mode 100644
index 000000000..7217e3512
--- /dev/null
+++ b/src/test/ui/error-codes/E0597.rs
@@ -0,0 +1,12 @@
+struct Foo<'a> {
+ x: Option<&'a u32>,
+}
+
+fn main() {
+ let mut x = Foo { x: None };
+ let y = 0;
+ x.x = Some(&y);
+ //~^ `y` does not live long enough [E0597]
+}
+
+impl<'a> Drop for Foo<'a> { fn drop(&mut self) { } }
diff --git a/src/test/ui/error-codes/E0597.stderr b/src/test/ui/error-codes/E0597.stderr
new file mode 100644
index 000000000..b4a1180ad
--- /dev/null
+++ b/src/test/ui/error-codes/E0597.stderr
@@ -0,0 +1,17 @@
+error[E0597]: `y` does not live long enough
+ --> $DIR/E0597.rs:8:16
+ |
+LL | x.x = Some(&y);
+ | ^^ borrowed value does not live long enough
+LL |
+LL | }
+ | -
+ | |
+ | `y` dropped here while still borrowed
+ | borrow might be used here, when `x` is dropped and runs the `Drop` code for type `Foo`
+ |
+ = note: values in a scope are dropped in the opposite order they are defined
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/error-codes/E0599.rs b/src/test/ui/error-codes/E0599.rs
new file mode 100644
index 000000000..a2d7bb2dc
--- /dev/null
+++ b/src/test/ui/error-codes/E0599.rs
@@ -0,0 +1,5 @@
+struct Foo;
+
+fn main() {
+ || if let Foo::NotEvenReal() = Foo {}; //~ ERROR E0599
+}
diff --git a/src/test/ui/error-codes/E0599.stderr b/src/test/ui/error-codes/E0599.stderr
new file mode 100644
index 000000000..a1fb58f48
--- /dev/null
+++ b/src/test/ui/error-codes/E0599.stderr
@@ -0,0 +1,12 @@
+error[E0599]: no associated item named `NotEvenReal` found for struct `Foo` in the current scope
+ --> $DIR/E0599.rs:4:20
+ |
+LL | struct Foo;
+ | ---------- associated item `NotEvenReal` not found for this struct
+...
+LL | || if let Foo::NotEvenReal() = Foo {};
+ | ^^^^^^^^^^^ associated item not found in `Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/error-codes/E0600.rs b/src/test/ui/error-codes/E0600.rs
new file mode 100644
index 000000000..7731d8619
--- /dev/null
+++ b/src/test/ui/error-codes/E0600.rs
@@ -0,0 +1,3 @@
+fn main() {
+ !"a"; //~ ERROR E0600
+}
diff --git a/src/test/ui/error-codes/E0600.stderr b/src/test/ui/error-codes/E0600.stderr
new file mode 100644
index 000000000..95ac4510c
--- /dev/null
+++ b/src/test/ui/error-codes/E0600.stderr
@@ -0,0 +1,9 @@
+error[E0600]: cannot apply unary operator `!` to type `&'static str`
+ --> $DIR/E0600.rs:2:5
+ |
+LL | !"a";
+ | ^^^^ cannot apply unary operator `!`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0600`.
diff --git a/src/test/ui/error-codes/E0601.rs b/src/test/ui/error-codes/E0601.rs
new file mode 100644
index 000000000..4380ddeac
--- /dev/null
+++ b/src/test/ui/error-codes/E0601.rs
@@ -0,0 +1 @@
+//~ ERROR `main` function not found
diff --git a/src/test/ui/error-codes/E0601.stderr b/src/test/ui/error-codes/E0601.stderr
new file mode 100644
index 000000000..a687f5756
--- /dev/null
+++ b/src/test/ui/error-codes/E0601.stderr
@@ -0,0 +1,9 @@
+error[E0601]: `main` function not found in crate `E0601`
+ --> $DIR/E0601.rs:1:37
+ |
+LL |
+ | ^ consider adding a `main` function to `$DIR/E0601.rs`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0601`.
diff --git a/src/test/ui/error-codes/E0602.rs b/src/test/ui/error-codes/E0602.rs
new file mode 100644
index 000000000..8fadce526
--- /dev/null
+++ b/src/test/ui/error-codes/E0602.rs
@@ -0,0 +1,6 @@
+// compile-flags:-D bogus
+
+// error-pattern:E0602
+// error-pattern:requested on the command line with `-D bogus`
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0602.stderr b/src/test/ui/error-codes/E0602.stderr
new file mode 100644
index 000000000..2b3722633
--- /dev/null
+++ b/src/test/ui/error-codes/E0602.stderr
@@ -0,0 +1,11 @@
+error[E0602]: unknown lint: `bogus`
+ |
+ = note: requested on the command line with `-D bogus`
+
+error[E0602]: unknown lint: `bogus`
+ |
+ = note: requested on the command line with `-D bogus`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0602`.
diff --git a/src/test/ui/error-codes/E0603.rs b/src/test/ui/error-codes/E0603.rs
new file mode 100644
index 000000000..24a9ba887
--- /dev/null
+++ b/src/test/ui/error-codes/E0603.rs
@@ -0,0 +1,7 @@
+mod SomeModule {
+ const PRIVATE: u32 = 0x_a_bad_1dea_u32;
+}
+
+fn main() {
+ SomeModule::PRIVATE; //~ ERROR E0603
+}
diff --git a/src/test/ui/error-codes/E0603.stderr b/src/test/ui/error-codes/E0603.stderr
new file mode 100644
index 000000000..ee902584f
--- /dev/null
+++ b/src/test/ui/error-codes/E0603.stderr
@@ -0,0 +1,15 @@
+error[E0603]: constant `PRIVATE` is private
+ --> $DIR/E0603.rs:6:17
+ |
+LL | SomeModule::PRIVATE;
+ | ^^^^^^^ private constant
+ |
+note: the constant `PRIVATE` is defined here
+ --> $DIR/E0603.rs:2:5
+ |
+LL | const PRIVATE: u32 = 0x_a_bad_1dea_u32;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0603`.
diff --git a/src/test/ui/error-codes/E0604.rs b/src/test/ui/error-codes/E0604.rs
new file mode 100644
index 000000000..b9c0d1f92
--- /dev/null
+++ b/src/test/ui/error-codes/E0604.rs
@@ -0,0 +1,3 @@
+fn main() {
+ 1u32 as char; //~ ERROR E0604
+}
diff --git a/src/test/ui/error-codes/E0604.stderr b/src/test/ui/error-codes/E0604.stderr
new file mode 100644
index 000000000..68da03928
--- /dev/null
+++ b/src/test/ui/error-codes/E0604.stderr
@@ -0,0 +1,12 @@
+error[E0604]: only `u8` can be cast as `char`, not `u32`
+ --> $DIR/E0604.rs:2:5
+ |
+LL | 1u32 as char;
+ | ^^^^^^^^^^^^
+ | |
+ | invalid cast
+ | help: try `char::from_u32` instead: `char::from_u32(1u32)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0604`.
diff --git a/src/test/ui/error-codes/E0605.rs b/src/test/ui/error-codes/E0605.rs
new file mode 100644
index 000000000..cfbf1aa2b
--- /dev/null
+++ b/src/test/ui/error-codes/E0605.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let x = 0u8;
+ x as Vec<u8>; //~ ERROR E0605
+
+ let v = std::ptr::null::<u8>();
+ v as &u8; //~ ERROR E0605
+}
diff --git a/src/test/ui/error-codes/E0605.stderr b/src/test/ui/error-codes/E0605.stderr
new file mode 100644
index 000000000..e385b3394
--- /dev/null
+++ b/src/test/ui/error-codes/E0605.stderr
@@ -0,0 +1,21 @@
+error[E0605]: non-primitive cast: `u8` as `Vec<u8>`
+ --> $DIR/E0605.rs:3:5
+ |
+LL | x as Vec<u8>;
+ | ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
+
+error[E0605]: non-primitive cast: `*const u8` as `&u8`
+ --> $DIR/E0605.rs:6:5
+ |
+LL | v as &u8;
+ | ^^^^^^^^ invalid cast
+ |
+help: consider borrowing the value
+ |
+LL - v as &u8;
+LL + &*v;
+ |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0605`.
diff --git a/src/test/ui/error-codes/E0606.rs b/src/test/ui/error-codes/E0606.rs
new file mode 100644
index 000000000..cb0d8cfc3
--- /dev/null
+++ b/src/test/ui/error-codes/E0606.rs
@@ -0,0 +1,3 @@
+fn main() {
+ &0u8 as u8; //~ ERROR E0606
+}
diff --git a/src/test/ui/error-codes/E0606.stderr b/src/test/ui/error-codes/E0606.stderr
new file mode 100644
index 000000000..fce24886e
--- /dev/null
+++ b/src/test/ui/error-codes/E0606.stderr
@@ -0,0 +1,12 @@
+error[E0606]: casting `&u8` as `u8` is invalid
+ --> $DIR/E0606.rs:2:5
+ |
+LL | &0u8 as u8;
+ | ----^^^^^^
+ | |
+ | cannot cast `&u8` as `u8`
+ | help: dereference the expression: `*&0u8`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0606`.
diff --git a/src/test/ui/error-codes/E0607.rs b/src/test/ui/error-codes/E0607.rs
new file mode 100644
index 000000000..65001c471
--- /dev/null
+++ b/src/test/ui/error-codes/E0607.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let v = core::ptr::null::<u8>();
+ v as *const [u8]; //~ ERROR E0607
+}
diff --git a/src/test/ui/error-codes/E0607.stderr b/src/test/ui/error-codes/E0607.stderr
new file mode 100644
index 000000000..a0fe02c1c
--- /dev/null
+++ b/src/test/ui/error-codes/E0607.stderr
@@ -0,0 +1,9 @@
+error[E0607]: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]`
+ --> $DIR/E0607.rs:3:5
+ |
+LL | v as *const [u8];
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0607`.
diff --git a/src/test/ui/error-codes/E0608.rs b/src/test/ui/error-codes/E0608.rs
new file mode 100644
index 000000000..1e342d668
--- /dev/null
+++ b/src/test/ui/error-codes/E0608.rs
@@ -0,0 +1,3 @@
+fn main() {
+ 0u8[2]; //~ ERROR E0608
+}
diff --git a/src/test/ui/error-codes/E0608.stderr b/src/test/ui/error-codes/E0608.stderr
new file mode 100644
index 000000000..3aec50993
--- /dev/null
+++ b/src/test/ui/error-codes/E0608.stderr
@@ -0,0 +1,9 @@
+error[E0608]: cannot index into a value of type `u8`
+ --> $DIR/E0608.rs:2:5
+ |
+LL | 0u8[2];
+ | ^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0608`.
diff --git a/src/test/ui/error-codes/E0609.rs b/src/test/ui/error-codes/E0609.rs
new file mode 100644
index 000000000..e3a97f2fb
--- /dev/null
+++ b/src/test/ui/error-codes/E0609.rs
@@ -0,0 +1,12 @@
+struct Foo {
+ x: u32,
+}
+struct Bar;
+
+fn main() {
+ let x = Foo { x: 0 };
+ let _ = x.foo; //~ ERROR E0609
+
+ let y = Bar;
+ y.1; //~ ERROR E0609
+}
diff --git a/src/test/ui/error-codes/E0609.stderr b/src/test/ui/error-codes/E0609.stderr
new file mode 100644
index 000000000..797e95d02
--- /dev/null
+++ b/src/test/ui/error-codes/E0609.stderr
@@ -0,0 +1,17 @@
+error[E0609]: no field `foo` on type `Foo`
+ --> $DIR/E0609.rs:8:15
+ |
+LL | let _ = x.foo;
+ | ^^^ unknown field
+ |
+ = note: available fields are: `x`
+
+error[E0609]: no field `1` on type `Bar`
+ --> $DIR/E0609.rs:11:7
+ |
+LL | y.1;
+ | ^ unknown field
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0609`.
diff --git a/src/test/ui/error-codes/E0610.rs b/src/test/ui/error-codes/E0610.rs
new file mode 100644
index 000000000..de246f371
--- /dev/null
+++ b/src/test/ui/error-codes/E0610.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let x = 0;
+ let _ = x.foo; //~ ERROR E0610
+}
diff --git a/src/test/ui/error-codes/E0610.stderr b/src/test/ui/error-codes/E0610.stderr
new file mode 100644
index 000000000..a2966eea4
--- /dev/null
+++ b/src/test/ui/error-codes/E0610.stderr
@@ -0,0 +1,9 @@
+error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
+ --> $DIR/E0610.rs:3:15
+ |
+LL | let _ = x.foo;
+ | ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0610`.
diff --git a/src/test/ui/error-codes/E0614.rs b/src/test/ui/error-codes/E0614.rs
new file mode 100644
index 000000000..6b4817b69
--- /dev/null
+++ b/src/test/ui/error-codes/E0614.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let y = 0u32;
+ *y; //~ ERROR E0614
+}
diff --git a/src/test/ui/error-codes/E0614.stderr b/src/test/ui/error-codes/E0614.stderr
new file mode 100644
index 000000000..598117c2b
--- /dev/null
+++ b/src/test/ui/error-codes/E0614.stderr
@@ -0,0 +1,9 @@
+error[E0614]: type `u32` cannot be dereferenced
+ --> $DIR/E0614.rs:3:5
+ |
+LL | *y;
+ | ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0614`.
diff --git a/src/test/ui/error-codes/E0615.rs b/src/test/ui/error-codes/E0615.rs
new file mode 100644
index 000000000..d04e4d5f7
--- /dev/null
+++ b/src/test/ui/error-codes/E0615.rs
@@ -0,0 +1,12 @@
+struct Foo {
+ x: u32,
+}
+
+impl Foo {
+ fn method(&self) {}
+}
+
+fn main() {
+ let f = Foo { x: 0 };
+ f.method; //~ ERROR E0615
+}
diff --git a/src/test/ui/error-codes/E0615.stderr b/src/test/ui/error-codes/E0615.stderr
new file mode 100644
index 000000000..c12e1a3a6
--- /dev/null
+++ b/src/test/ui/error-codes/E0615.stderr
@@ -0,0 +1,14 @@
+error[E0615]: attempted to take value of method `method` on type `Foo`
+ --> $DIR/E0615.rs:11:7
+ |
+LL | f.method;
+ | ^^^^^^ method, not a field
+ |
+help: use parentheses to call the method
+ |
+LL | f.method();
+ | ++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0615`.
diff --git a/src/test/ui/error-codes/E0616.rs b/src/test/ui/error-codes/E0616.rs
new file mode 100644
index 000000000..98f87a83b
--- /dev/null
+++ b/src/test/ui/error-codes/E0616.rs
@@ -0,0 +1,14 @@
+mod a {
+ pub struct Foo {
+ x: u32,
+ }
+
+ impl Foo {
+ pub fn new() -> Foo { Foo { x: 0 } }
+ }
+}
+
+fn main() {
+ let f = a::Foo::new();
+ f.x; //~ ERROR E0616
+}
diff --git a/src/test/ui/error-codes/E0616.stderr b/src/test/ui/error-codes/E0616.stderr
new file mode 100644
index 000000000..da349ed2f
--- /dev/null
+++ b/src/test/ui/error-codes/E0616.stderr
@@ -0,0 +1,9 @@
+error[E0616]: field `x` of struct `Foo` is private
+ --> $DIR/E0616.rs:13:7
+ |
+LL | f.x;
+ | ^ private field
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0616`.
diff --git a/src/test/ui/error-codes/E0617.rs b/src/test/ui/error-codes/E0617.rs
new file mode 100644
index 000000000..b71ba0ed8
--- /dev/null
+++ b/src/test/ui/error-codes/E0617.rs
@@ -0,0 +1,26 @@
+extern "C" {
+ fn printf(c: *const i8, ...);
+}
+
+fn main() {
+ unsafe {
+ printf(::std::ptr::null(), 0f32);
+ //~^ ERROR can't pass `f32` to variadic function
+ //~| HELP cast the value to `c_double`
+ printf(::std::ptr::null(), 0i8);
+ //~^ ERROR can't pass `i8` to variadic function
+ //~| HELP cast the value to `c_int`
+ printf(::std::ptr::null(), 0i16);
+ //~^ ERROR can't pass `i16` to variadic function
+ //~| HELP cast the value to `c_int`
+ printf(::std::ptr::null(), 0u8);
+ //~^ ERROR can't pass `u8` to variadic function
+ //~| HELP cast the value to `c_uint`
+ printf(::std::ptr::null(), 0u16);
+ //~^ ERROR can't pass `u16` to variadic function
+ //~| HELP cast the value to `c_uint`
+ printf(::std::ptr::null(), printf);
+ //~^ ERROR can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to variadic function
+ //~| HELP cast the value to `unsafe extern "C" fn(*const i8, ...)`
+ }
+}
diff --git a/src/test/ui/error-codes/E0617.stderr b/src/test/ui/error-codes/E0617.stderr
new file mode 100644
index 000000000..ea91ad082
--- /dev/null
+++ b/src/test/ui/error-codes/E0617.stderr
@@ -0,0 +1,44 @@
+error[E0617]: can't pass `f32` to variadic function
+ --> $DIR/E0617.rs:7:36
+ |
+LL | printf(::std::ptr::null(), 0f32);
+ | ^^^^ help: cast the value to `c_double`: `0f32 as c_double`
+
+error[E0617]: can't pass `i8` to variadic function
+ --> $DIR/E0617.rs:10:36
+ |
+LL | printf(::std::ptr::null(), 0i8);
+ | ^^^ help: cast the value to `c_int`: `0i8 as c_int`
+
+error[E0617]: can't pass `i16` to variadic function
+ --> $DIR/E0617.rs:13:36
+ |
+LL | printf(::std::ptr::null(), 0i16);
+ | ^^^^ help: cast the value to `c_int`: `0i16 as c_int`
+
+error[E0617]: can't pass `u8` to variadic function
+ --> $DIR/E0617.rs:16:36
+ |
+LL | printf(::std::ptr::null(), 0u8);
+ | ^^^ help: cast the value to `c_uint`: `0u8 as c_uint`
+
+error[E0617]: can't pass `u16` to variadic function
+ --> $DIR/E0617.rs:19:36
+ |
+LL | printf(::std::ptr::null(), 0u16);
+ | ^^^^ help: cast the value to `c_uint`: `0u16 as c_uint`
+
+error[E0617]: can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to variadic function
+ --> $DIR/E0617.rs:22:36
+ |
+LL | printf(::std::ptr::null(), printf);
+ | ^^^^^^
+ |
+help: cast the value to `unsafe extern "C" fn(*const i8, ...)`
+ |
+LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...));
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0617`.
diff --git a/src/test/ui/error-codes/E0618.rs b/src/test/ui/error-codes/E0618.rs
new file mode 100644
index 000000000..2616e7134
--- /dev/null
+++ b/src/test/ui/error-codes/E0618.rs
@@ -0,0 +1,11 @@
+enum X {
+ Entry,
+}
+
+fn main() {
+ X::Entry();
+ //~^ ERROR expected function, found enum variant `X::Entry` [E0618]
+ let x = 0i32;
+ x();
+ //~^ ERROR expected function, found `i32` [E0618]
+}
diff --git a/src/test/ui/error-codes/E0618.stderr b/src/test/ui/error-codes/E0618.stderr
new file mode 100644
index 000000000..793ec02a8
--- /dev/null
+++ b/src/test/ui/error-codes/E0618.stderr
@@ -0,0 +1,30 @@
+error[E0618]: expected function, found enum variant `X::Entry`
+ --> $DIR/E0618.rs:6:5
+ |
+LL | Entry,
+ | ----- enum variant `X::Entry` defined here
+...
+LL | X::Entry();
+ | ^^^^^^^^--
+ | |
+ | call expression requires function
+ |
+help: `X::Entry` is a unit enum variant, and does not take parentheses to be constructed
+ |
+LL - X::Entry();
+LL + X::Entry;
+ |
+
+error[E0618]: expected function, found `i32`
+ --> $DIR/E0618.rs:9:5
+ |
+LL | let x = 0i32;
+ | - `x` has type `i32`
+LL | x();
+ | ^--
+ | |
+ | call expression requires function
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0618`.
diff --git a/src/test/ui/error-codes/E0620.rs b/src/test/ui/error-codes/E0620.rs
new file mode 100644
index 000000000..2831413ea
--- /dev/null
+++ b/src/test/ui/error-codes/E0620.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let _foo = &[1_usize, 2] as [usize]; //~ ERROR E0620
+}
diff --git a/src/test/ui/error-codes/E0620.stderr b/src/test/ui/error-codes/E0620.stderr
new file mode 100644
index 000000000..65152b2b7
--- /dev/null
+++ b/src/test/ui/error-codes/E0620.stderr
@@ -0,0 +1,15 @@
+error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]`
+ --> $DIR/E0620.rs:2:16
+ |
+LL | let _foo = &[1_usize, 2] as [usize];
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: consider using an implicit coercion to `&[usize]` instead
+ --> $DIR/E0620.rs:2:16
+ |
+LL | let _foo = &[1_usize, 2] as [usize];
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0620`.
diff --git a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.rs b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.rs
new file mode 100644
index 000000000..44f174c0f
--- /dev/null
+++ b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.rs
@@ -0,0 +1,16 @@
+// Test that we give the generic error when one of the free regions is
+// bound in a closure (rather than suggesting a change to the signature
+// of the closure, which is not specified in `foo` but rather in `invoke`).
+
+fn invoke<'a, F>(x: &'a i32, f: F) -> &'a i32
+where F: FnOnce(&'a i32, &i32) -> &'a i32
+{
+ let y = 22;
+ f(x, &y)
+}
+
+fn foo<'a>(x: &'a i32) {
+ invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR lifetime may not live long enough
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.stderr b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.stderr
new file mode 100644
index 000000000..b9edeb834
--- /dev/null
+++ b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.stderr
@@ -0,0 +1,11 @@
+error: lifetime may not live long enough
+ --> $DIR/E0621-does-not-trigger-for-closures.rs:13:45
+ |
+LL | invoke(&x, |a, b| if a > b { a } else { b });
+ | -- ^ returning this value requires that `'1` must outlive `'2`
+ | ||
+ | |return type of closure is &'2 i32
+ | has type `&'1 i32`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/error-codes/E0622.rs b/src/test/ui/error-codes/E0622.rs
new file mode 100644
index 000000000..ae7378a70
--- /dev/null
+++ b/src/test/ui/error-codes/E0622.rs
@@ -0,0 +1,6 @@
+#![feature(intrinsics)]
+extern "rust-intrinsic" {
+ pub static breakpoint : unsafe extern "rust-intrinsic" fn();
+ //~^ ERROR intrinsic must be a function [E0622]
+}
+fn main() { unsafe { breakpoint(); } }
diff --git a/src/test/ui/error-codes/E0622.stderr b/src/test/ui/error-codes/E0622.stderr
new file mode 100644
index 000000000..8466dfe38
--- /dev/null
+++ b/src/test/ui/error-codes/E0622.stderr
@@ -0,0 +1,9 @@
+error[E0622]: intrinsic must be a function
+ --> $DIR/E0622.rs:3:5
+ |
+LL | pub static breakpoint : unsafe extern "rust-intrinsic" fn();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected a function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0622`.
diff --git a/src/test/ui/error-codes/E0624.rs b/src/test/ui/error-codes/E0624.rs
new file mode 100644
index 000000000..4c68b70fb
--- /dev/null
+++ b/src/test/ui/error-codes/E0624.rs
@@ -0,0 +1,12 @@
+mod inner {
+ pub struct Foo;
+
+ impl Foo {
+ fn method(&self) {}
+ }
+}
+
+fn main() {
+ let foo = inner::Foo;
+ foo.method(); //~ ERROR associated function `method` is private [E0624]
+}
diff --git a/src/test/ui/error-codes/E0624.stderr b/src/test/ui/error-codes/E0624.stderr
new file mode 100644
index 000000000..e59b8a8ae
--- /dev/null
+++ b/src/test/ui/error-codes/E0624.stderr
@@ -0,0 +1,12 @@
+error[E0624]: associated function `method` is private
+ --> $DIR/E0624.rs:11:9
+ |
+LL | fn method(&self) {}
+ | ---------------- private associated function defined here
+...
+LL | foo.method();
+ | ^^^^^^ private associated function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0624`.
diff --git a/src/test/ui/error-codes/E0637.rs b/src/test/ui/error-codes/E0637.rs
new file mode 100644
index 000000000..382ce3ed0
--- /dev/null
+++ b/src/test/ui/error-codes/E0637.rs
@@ -0,0 +1,17 @@
+fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
+ //~^ ERROR: `'_` cannot be used here [E0637]
+ //~| ERROR: missing lifetime specifier
+ if str1.len() > str2.len() {
+ str1
+ } else {
+ str2
+ }
+}
+
+fn and_without_explicit_lifetime<T>()
+where
+ T: Into<&u32>, //~ ERROR: `&` without an explicit lifetime name cannot be used here [E0637]
+{
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0637.stderr b/src/test/ui/error-codes/E0637.stderr
new file mode 100644
index 000000000..35a4b34fb
--- /dev/null
+++ b/src/test/ui/error-codes/E0637.stderr
@@ -0,0 +1,28 @@
+error[E0637]: `'_` cannot be used here
+ --> $DIR/E0637.rs:1:24
+ |
+LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
+ | ^^ `'_` is a reserved lifetime name
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/E0637.rs:1:62
+ |
+LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
+ | ------- ------- ^^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `str1` or `str2`
+help: consider introducing a named lifetime parameter
+ |
+LL | fn underscore_lifetime<'a, '_>(str1: &'a str, str2: &'a str) -> &'a str {
+ | +++ ~~ ~~ ~~
+
+error[E0637]: `&` without an explicit lifetime name cannot be used here
+ --> $DIR/E0637.rs:13:13
+ |
+LL | T: Into<&u32>,
+ | ^ explicit lifetime name needed here
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0106, E0637.
+For more information about an error, try `rustc --explain E0106`.
diff --git a/src/test/ui/error-codes/E0642.fixed b/src/test/ui/error-codes/E0642.fixed
new file mode 100644
index 000000000..fc6255e02
--- /dev/null
+++ b/src/test/ui/error-codes/E0642.fixed
@@ -0,0 +1,20 @@
+// run-rustfix
+
+#![allow(unused)] // for rustfix
+
+#[derive(Clone, Copy)]
+struct S;
+
+trait T {
+ fn foo(_: (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies
+
+ fn bar(_: (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies
+
+ fn method(_: S) {} //~ ERROR patterns aren't allowed in methods without bodies
+
+ fn f(&ident: &S) {} // ok
+ fn g(&&ident: &&S) {} // ok
+ fn h(mut ident: S) {} // ok
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0642.rs b/src/test/ui/error-codes/E0642.rs
new file mode 100644
index 000000000..5f85f3935
--- /dev/null
+++ b/src/test/ui/error-codes/E0642.rs
@@ -0,0 +1,20 @@
+// run-rustfix
+
+#![allow(unused)] // for rustfix
+
+#[derive(Clone, Copy)]
+struct S;
+
+trait T {
+ fn foo((x, y): (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies
+
+ fn bar((x, y): (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies
+
+ fn method(S { .. }: S) {} //~ ERROR patterns aren't allowed in methods without bodies
+
+ fn f(&ident: &S) {} // ok
+ fn g(&&ident: &&S) {} // ok
+ fn h(mut ident: S) {} // ok
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0642.stderr b/src/test/ui/error-codes/E0642.stderr
new file mode 100644
index 000000000..dd9e28ad4
--- /dev/null
+++ b/src/test/ui/error-codes/E0642.stderr
@@ -0,0 +1,36 @@
+error[E0642]: patterns aren't allowed in methods without bodies
+ --> $DIR/E0642.rs:9:12
+ |
+LL | fn foo((x, y): (i32, i32));
+ | ^^^^^^
+ |
+help: give this argument a name or use an underscore to ignore it
+ |
+LL | fn foo(_: (i32, i32));
+ | ~
+
+error[E0642]: patterns aren't allowed in methods without bodies
+ --> $DIR/E0642.rs:11:12
+ |
+LL | fn bar((x, y): (i32, i32)) {}
+ | ^^^^^^
+ |
+help: give this argument a name or use an underscore to ignore it
+ |
+LL | fn bar(_: (i32, i32)) {}
+ | ~
+
+error[E0642]: patterns aren't allowed in methods without bodies
+ --> $DIR/E0642.rs:13:15
+ |
+LL | fn method(S { .. }: S) {}
+ | ^^^^^^^^
+ |
+help: give this argument a name or use an underscore to ignore it
+ |
+LL | fn method(_: S) {}
+ | ~
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0642`.
diff --git a/src/test/ui/error-codes/E0646.rs b/src/test/ui/error-codes/E0646.rs
new file mode 100644
index 000000000..bb62428f5
--- /dev/null
+++ b/src/test/ui/error-codes/E0646.rs
@@ -0,0 +1 @@
+fn main() where (): Copy {} //~ ERROR [E0646]
diff --git a/src/test/ui/error-codes/E0646.stderr b/src/test/ui/error-codes/E0646.stderr
new file mode 100644
index 000000000..069401b3f
--- /dev/null
+++ b/src/test/ui/error-codes/E0646.stderr
@@ -0,0 +1,9 @@
+error[E0646]: `main` function is not allowed to have a `where` clause
+ --> $DIR/E0646.rs:1:11
+ |
+LL | fn main() where (): Copy {}
+ | ^^^^^^^^^^^^^^ `main` cannot have a `where` clause
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0646`.
diff --git a/src/test/ui/error-codes/E0647.rs b/src/test/ui/error-codes/E0647.rs
new file mode 100644
index 000000000..fc085511c
--- /dev/null
+++ b/src/test/ui/error-codes/E0647.rs
@@ -0,0 +1,9 @@
+#![no_std]
+#![feature(start)]
+
+extern crate std;
+
+#[start]
+fn start(_: isize, _: *const *const u8) -> isize where (): Copy { //~ ERROR [E0647]
+ 0
+}
diff --git a/src/test/ui/error-codes/E0647.stderr b/src/test/ui/error-codes/E0647.stderr
new file mode 100644
index 000000000..08cedfaef
--- /dev/null
+++ b/src/test/ui/error-codes/E0647.stderr
@@ -0,0 +1,9 @@
+error[E0647]: start function is not allowed to have a `where` clause
+ --> $DIR/E0647.rs:7:50
+ |
+LL | fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
+ | ^^^^^^^^^^^^^^ start function cannot have a `where` clause
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0647`.
diff --git a/src/test/ui/error-codes/E0648.rs b/src/test/ui/error-codes/E0648.rs
new file mode 100644
index 000000000..8408a78c7
--- /dev/null
+++ b/src/test/ui/error-codes/E0648.rs
@@ -0,0 +1,4 @@
+#[export_name="\0foo"] //~ ERROR E0648
+pub fn bar() {}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0648.stderr b/src/test/ui/error-codes/E0648.stderr
new file mode 100644
index 000000000..1a65825c7
--- /dev/null
+++ b/src/test/ui/error-codes/E0648.stderr
@@ -0,0 +1,9 @@
+error[E0648]: `export_name` may not contain null characters
+ --> $DIR/E0648.rs:1:1
+ |
+LL | #[export_name="\0foo"]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0648`.
diff --git a/src/test/ui/error-codes/E0657.rs b/src/test/ui/error-codes/E0657.rs
new file mode 100644
index 000000000..cb11de13f
--- /dev/null
+++ b/src/test/ui/error-codes/E0657.rs
@@ -0,0 +1,26 @@
+#![allow(warnings)]
+
+trait Id<T> {}
+trait Lt<'a> {}
+
+impl<'a> Lt<'a> for () {}
+impl<T> Id<T> for T {}
+
+fn free_fn_capture_hrtb_in_impl_trait()
+ -> Box<for<'a> Id<impl Lt<'a>>>
+ //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level [E0657]
+{
+ Box::new(())
+}
+
+struct Foo;
+impl Foo {
+ fn impl_fn_capture_hrtb_in_impl_trait()
+ -> Box<for<'a> Id<impl Lt<'a>>>
+ //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level
+ {
+ Box::new(())
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0657.stderr b/src/test/ui/error-codes/E0657.stderr
new file mode 100644
index 000000000..df76b45a5
--- /dev/null
+++ b/src/test/ui/error-codes/E0657.stderr
@@ -0,0 +1,15 @@
+error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
+ --> $DIR/E0657.rs:10:31
+ |
+LL | -> Box<for<'a> Id<impl Lt<'a>>>
+ | ^^
+
+error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level
+ --> $DIR/E0657.rs:19:35
+ |
+LL | -> Box<for<'a> Id<impl Lt<'a>>>
+ | ^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0657`.
diff --git a/src/test/ui/error-codes/E0658.rs b/src/test/ui/error-codes/E0658.rs
new file mode 100644
index 000000000..9c9b95d70
--- /dev/null
+++ b/src/test/ui/error-codes/E0658.rs
@@ -0,0 +1,6 @@
+#[repr(u128)]
+enum Foo { //~ ERROR E0658
+ Bar(u64),
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0658.stderr b/src/test/ui/error-codes/E0658.stderr
new file mode 100644
index 000000000..8d4234845
--- /dev/null
+++ b/src/test/ui/error-codes/E0658.stderr
@@ -0,0 +1,12 @@
+error[E0658]: repr with 128-bit type is unstable
+ --> $DIR/E0658.rs:2:1
+ |
+LL | enum Foo {
+ | ^^^^^^^^
+ |
+ = note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
+ = help: add `#![feature(repr128)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/error-codes/E0659.rs b/src/test/ui/error-codes/E0659.rs
new file mode 100644
index 000000000..c00026bb7
--- /dev/null
+++ b/src/test/ui/error-codes/E0659.rs
@@ -0,0 +1,16 @@
+mod moon {
+ pub fn foo() {}
+}
+
+mod earth {
+ pub fn foo() {}
+}
+
+mod collider {
+ pub use moon::*;
+ pub use earth::*;
+}
+
+fn main() {
+ collider::foo(); //~ ERROR E0659
+}
diff --git a/src/test/ui/error-codes/E0659.stderr b/src/test/ui/error-codes/E0659.stderr
new file mode 100644
index 000000000..b0c73c636
--- /dev/null
+++ b/src/test/ui/error-codes/E0659.stderr
@@ -0,0 +1,23 @@
+error[E0659]: `foo` is ambiguous
+ --> $DIR/E0659.rs:15:15
+ |
+LL | collider::foo();
+ | ^^^ ambiguous name
+ |
+ = note: ambiguous because of multiple glob imports of a name in the same module
+note: `foo` could refer to the function imported here
+ --> $DIR/E0659.rs:10:13
+ |
+LL | pub use moon::*;
+ | ^^^^^^^
+ = help: consider adding an explicit import of `foo` to disambiguate
+note: `foo` could also refer to the function imported here
+ --> $DIR/E0659.rs:11:13
+ |
+LL | pub use earth::*;
+ | ^^^^^^^^
+ = help: consider adding an explicit import of `foo` to disambiguate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/src/test/ui/error-codes/E0705.rs b/src/test/ui/error-codes/E0705.rs
new file mode 100644
index 000000000..05abcb629
--- /dev/null
+++ b/src/test/ui/error-codes/E0705.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+// This is a stub feature that doesn't control anything, so to make tidy happy,
+// gate-test-test_2018_feature
+
+#![feature(test_2018_feature)]
+//~^ WARN the feature `test_2018_feature` is included in the Rust 2018 edition
+#![feature(rust_2018_preview)]
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0705.stderr b/src/test/ui/error-codes/E0705.stderr
new file mode 100644
index 000000000..6fa843158
--- /dev/null
+++ b/src/test/ui/error-codes/E0705.stderr
@@ -0,0 +1,9 @@
+warning[E0705]: the feature `test_2018_feature` is included in the Rust 2018 edition
+ --> $DIR/E0705.rs:6:12
+ |
+LL | #![feature(test_2018_feature)]
+ | ^^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
+For more information about this error, try `rustc --explain E0705`.
diff --git a/src/test/ui/error-codes/E0718.rs b/src/test/ui/error-codes/E0718.rs
new file mode 100644
index 000000000..909cae0ba
--- /dev/null
+++ b/src/test/ui/error-codes/E0718.rs
@@ -0,0 +1,7 @@
+#![feature(lang_items)]
+
+// Box is expected to be a struct, so this will error.
+#[lang = "owned_box"] //~ ERROR language item must be applied to a struct
+static X: u32 = 42;
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0718.stderr b/src/test/ui/error-codes/E0718.stderr
new file mode 100644
index 000000000..30378dd16
--- /dev/null
+++ b/src/test/ui/error-codes/E0718.stderr
@@ -0,0 +1,9 @@
+error[E0718]: `owned_box` language item must be applied to a struct
+ --> $DIR/E0718.rs:4:1
+ |
+LL | #[lang = "owned_box"]
+ | ^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a struct, not a static item
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0718`.
diff --git a/src/test/ui/error-codes/E0719.rs b/src/test/ui/error-codes/E0719.rs
new file mode 100644
index 000000000..3311e1909
--- /dev/null
+++ b/src/test/ui/error-codes/E0719.rs
@@ -0,0 +1,14 @@
+trait Foo: Iterator<Item = i32, Item = i32> {}
+//~^ ERROR is already specified
+
+type Unit = ();
+
+fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {
+//~^ ERROR is already specified
+ Box::new(None.into_iter())
+}
+
+fn main() {
+ let _: &dyn Iterator<Item = i32, Item = i32>;
+ test();
+}
diff --git a/src/test/ui/error-codes/E0719.stderr b/src/test/ui/error-codes/E0719.stderr
new file mode 100644
index 000000000..b342d6343
--- /dev/null
+++ b/src/test/ui/error-codes/E0719.stderr
@@ -0,0 +1,19 @@
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/E0719.rs:1:33
+ |
+LL | trait Foo: Iterator<Item = i32, Item = i32> {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/E0719.rs:6:42
+ |
+LL | fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {
+ | --------- ^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0719`.
diff --git a/src/test/ui/error-codes/E0730.rs b/src/test/ui/error-codes/E0730.rs
new file mode 100644
index 000000000..04f5e5d42
--- /dev/null
+++ b/src/test/ui/error-codes/E0730.rs
@@ -0,0 +1,8 @@
+fn is_123<const N: usize>(x: [u32; N]) -> bool {
+ match x {
+ [1, 2, ..] => true, //~ ERROR cannot pattern-match on an array without a fixed length
+ _ => false
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0730.stderr b/src/test/ui/error-codes/E0730.stderr
new file mode 100644
index 000000000..067e8c57c
--- /dev/null
+++ b/src/test/ui/error-codes/E0730.stderr
@@ -0,0 +1,9 @@
+error[E0730]: cannot pattern-match on an array without a fixed length
+ --> $DIR/E0730.rs:3:9
+ |
+LL | [1, 2, ..] => true,
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0730`.
diff --git a/src/test/ui/error-codes/E0746.fixed b/src/test/ui/error-codes/E0746.fixed
new file mode 100644
index 000000000..ca8319aa0
--- /dev/null
+++ b/src/test/ui/error-codes/E0746.fixed
@@ -0,0 +1,18 @@
+// run-rustfix
+#![allow(dead_code)]
+struct Struct;
+trait Trait {}
+impl Trait for Struct {}
+impl Trait for u32 {}
+
+fn foo() -> impl Trait { Struct }
+//~^ ERROR E0746
+
+fn bar() -> impl Trait { //~ ERROR E0746
+ if true {
+ return 0;
+ }
+ 42
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0746.rs b/src/test/ui/error-codes/E0746.rs
new file mode 100644
index 000000000..bf5ba8fff
--- /dev/null
+++ b/src/test/ui/error-codes/E0746.rs
@@ -0,0 +1,18 @@
+// run-rustfix
+#![allow(dead_code)]
+struct Struct;
+trait Trait {}
+impl Trait for Struct {}
+impl Trait for u32 {}
+
+fn foo() -> dyn Trait { Struct }
+//~^ ERROR E0746
+
+fn bar() -> dyn Trait { //~ ERROR E0746
+ if true {
+ return 0;
+ }
+ 42
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0746.stderr b/src/test/ui/error-codes/E0746.stderr
new file mode 100644
index 000000000..2153b59ad
--- /dev/null
+++ b/src/test/ui/error-codes/E0746.stderr
@@ -0,0 +1,27 @@
+error[E0746]: return type cannot have an unboxed trait object
+ --> $DIR/E0746.rs:8:13
+ |
+LL | fn foo() -> dyn Trait { Struct }
+ | ^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = note: for information on `impl Trait`, see <https://doc.rust-lang.org/book/ch10-02-traits.html#returning-types-that-implement-traits>
+help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
+ |
+LL | fn foo() -> impl Trait { Struct }
+ | ~~~~~~~~~~
+
+error[E0746]: return type cannot have an unboxed trait object
+ --> $DIR/E0746.rs:11:13
+ |
+LL | fn bar() -> dyn Trait {
+ | ^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = note: for information on `impl Trait`, see <https://doc.rust-lang.org/book/ch10-02-traits.html#returning-types-that-implement-traits>
+help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
+ |
+LL | fn bar() -> impl Trait {
+ | ~~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0746`.
diff --git a/src/test/ui/error-codes/E0767.rs b/src/test/ui/error-codes/E0767.rs
new file mode 100644
index 000000000..6c6cb746e
--- /dev/null
+++ b/src/test/ui/error-codes/E0767.rs
@@ -0,0 +1,7 @@
+fn main () {
+ 'a: loop {
+ || {
+ loop { break 'a; } //~ ERROR E0767
+ }
+ }
+}
diff --git a/src/test/ui/error-codes/E0767.stderr b/src/test/ui/error-codes/E0767.stderr
new file mode 100644
index 000000000..242982330
--- /dev/null
+++ b/src/test/ui/error-codes/E0767.stderr
@@ -0,0 +1,14 @@
+error[E0767]: use of unreachable label `'a`
+ --> $DIR/E0767.rs:4:26
+ |
+LL | 'a: loop {
+ | -- unreachable label defined here
+LL | || {
+LL | loop { break 'a; }
+ | ^^ unreachable label `'a`
+ |
+ = note: labels are unreachable through functions, closures, async blocks and modules
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0767`.
diff --git a/src/test/ui/error-codes/E0771.rs b/src/test/ui/error-codes/E0771.rs
new file mode 100644
index 000000000..67e7d106a
--- /dev/null
+++ b/src/test/ui/error-codes/E0771.rs
@@ -0,0 +1,8 @@
+#![feature(adt_const_params)]
+//~^ WARN the feature `adt_const_params` is incomplete
+
+fn function_with_str<'a, const STRING: &'a str>() {} //~ ERROR E0771
+
+fn main() {
+ function_with_str::<"Hello, world!">()
+}
diff --git a/src/test/ui/error-codes/E0771.stderr b/src/test/ui/error-codes/E0771.stderr
new file mode 100644
index 000000000..3ab727f5f
--- /dev/null
+++ b/src/test/ui/error-codes/E0771.stderr
@@ -0,0 +1,20 @@
+error[E0771]: use of non-static lifetime `'a` in const generic
+ --> $DIR/E0771.rs:4:41
+ |
+LL | fn function_with_str<'a, const STRING: &'a str>() {}
+ | ^^
+ |
+ = note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
+
+warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/E0771.rs:1:12
+ |
+LL | #![feature(adt_const_params)]
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0771`.
diff --git a/src/test/ui/error-codes/E0777.rs b/src/test/ui/error-codes/E0777.rs
new file mode 100644
index 000000000..ff70f7368
--- /dev/null
+++ b/src/test/ui/error-codes/E0777.rs
@@ -0,0 +1,7 @@
+#[derive("Clone")] //~ ERROR E0777
+#[derive("Clone
+")]
+//~^^ ERROR E0777
+struct Foo;
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0777.stderr b/src/test/ui/error-codes/E0777.stderr
new file mode 100644
index 000000000..14697d89e
--- /dev/null
+++ b/src/test/ui/error-codes/E0777.stderr
@@ -0,0 +1,21 @@
+error[E0777]: expected path to a trait, found literal
+ --> $DIR/E0777.rs:1:10
+ |
+LL | #[derive("Clone")]
+ | ^^^^^^^ not a trait
+ |
+ = help: try using `#[derive(Clone)]`
+
+error[E0777]: expected path to a trait, found literal
+ --> $DIR/E0777.rs:2:10
+ |
+LL | #[derive("Clone
+ | __________^
+LL | | ")]
+ | |_^ not a trait
+ |
+ = help: for example, write `#[derive(Debug)]` for `Debug`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0777`.
diff --git a/src/test/ui/error-codes/E0778.rs b/src/test/ui/error-codes/E0778.rs
new file mode 100644
index 000000000..60e5c2598
--- /dev/null
+++ b/src/test/ui/error-codes/E0778.rs
@@ -0,0 +1,8 @@
+#![feature(isa_attribute)]
+
+#[instruction_set()] //~ ERROR
+fn no_isa_defined() {
+}
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0778.stderr b/src/test/ui/error-codes/E0778.stderr
new file mode 100644
index 000000000..6ecae7924
--- /dev/null
+++ b/src/test/ui/error-codes/E0778.stderr
@@ -0,0 +1,9 @@
+error[E0778]: `#[instruction_set]` requires an argument
+ --> $DIR/E0778.rs:3:1
+ |
+LL | #[instruction_set()]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0778`.
diff --git a/src/test/ui/error-codes/E0779.rs b/src/test/ui/error-codes/E0779.rs
new file mode 100644
index 000000000..1b4dbce20
--- /dev/null
+++ b/src/test/ui/error-codes/E0779.rs
@@ -0,0 +1,6 @@
+#![feature(isa_attribute)]
+
+#[instruction_set(arm::magic)] //~ ERROR
+fn main() {
+
+}
diff --git a/src/test/ui/error-codes/E0779.stderr b/src/test/ui/error-codes/E0779.stderr
new file mode 100644
index 000000000..da787260d
--- /dev/null
+++ b/src/test/ui/error-codes/E0779.stderr
@@ -0,0 +1,9 @@
+error[E0779]: invalid instruction set specified
+ --> $DIR/E0779.rs:3:1
+ |
+LL | #[instruction_set(arm::magic)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0779`.
diff --git a/src/test/ui/error-codes/E0790.rs b/src/test/ui/error-codes/E0790.rs
new file mode 100644
index 000000000..d99006d2d
--- /dev/null
+++ b/src/test/ui/error-codes/E0790.rs
@@ -0,0 +1,53 @@
+mod inner {
+ pub trait MyTrait {
+ const MY_ASSOC_CONST: ();
+
+ fn my_fn();
+ }
+
+ pub struct MyStruct;
+
+ impl MyTrait for MyStruct {
+ const MY_ASSOC_CONST: () = ();
+
+ fn my_fn() {}
+ }
+
+ fn call() {
+ MyTrait::my_fn(); //~ ERROR E0790
+ }
+
+ fn use_const() {
+ let _ = MyTrait::MY_ASSOC_CONST; //~ ERROR E0790
+ }
+}
+
+fn call_inner() {
+ inner::MyTrait::my_fn(); //~ ERROR E0790
+}
+
+fn use_const_inner() {
+ let _ = inner::MyTrait::MY_ASSOC_CONST; //~ ERROR E0790
+}
+
+trait MyTrait2 {
+ fn my_fn();
+}
+
+struct Impl1;
+
+impl MyTrait2 for Impl1 {
+ fn my_fn() {}
+}
+
+struct Impl2;
+
+impl MyTrait2 for Impl2 {
+ fn my_fn() {}
+}
+
+fn call_multiple_impls() {
+ MyTrait2::my_fn(); //~ ERROR E0790
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0790.stderr b/src/test/ui/error-codes/E0790.stderr
new file mode 100644
index 000000000..6e173a968
--- /dev/null
+++ b/src/test/ui/error-codes/E0790.stderr
@@ -0,0 +1,73 @@
+error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
+ --> $DIR/E0790.rs:17:9
+ |
+LL | fn my_fn();
+ | ----------- `MyTrait::my_fn` defined here
+...
+LL | MyTrait::my_fn();
+ | ^^^^^^^^^^^^^^ cannot call associated function of trait
+ |
+help: use the fully-qualified path to the only available implementation
+ |
+LL | <::inner::MyStruct as MyTrait>::my_fn();
+ | +++++++++++++++++++++ +
+
+error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
+ --> $DIR/E0790.rs:21:17
+ |
+LL | const MY_ASSOC_CONST: ();
+ | ------------------------- `MyTrait::MY_ASSOC_CONST` defined here
+...
+LL | let _ = MyTrait::MY_ASSOC_CONST;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ cannot refer to the associated constant of trait
+ |
+help: use the fully-qualified path to the only available implementation
+ |
+LL | let _ = <::inner::MyStruct as MyTrait>::MY_ASSOC_CONST;
+ | +++++++++++++++++++++ +
+
+error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
+ --> $DIR/E0790.rs:26:5
+ |
+LL | fn my_fn();
+ | ----------- `MyTrait::my_fn` defined here
+...
+LL | inner::MyTrait::my_fn();
+ | ^^^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
+ |
+help: use the fully-qualified path to the only available implementation
+ |
+LL | inner::<::inner::MyStruct as MyTrait>::my_fn();
+ | +++++++++++++++++++++ +
+
+error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
+ --> $DIR/E0790.rs:30:13
+ |
+LL | const MY_ASSOC_CONST: ();
+ | ------------------------- `MyTrait::MY_ASSOC_CONST` defined here
+...
+LL | let _ = inner::MyTrait::MY_ASSOC_CONST;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot refer to the associated constant of trait
+ |
+help: use the fully-qualified path to the only available implementation
+ |
+LL | let _ = inner::<::inner::MyStruct as MyTrait>::MY_ASSOC_CONST;
+ | +++++++++++++++++++++ +
+
+error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
+ --> $DIR/E0790.rs:50:5
+ |
+LL | fn my_fn();
+ | ----------- `MyTrait2::my_fn` defined here
+...
+LL | MyTrait2::my_fn();
+ | ^^^^^^^^^^^^^^^ cannot call associated function of trait
+ |
+help: use a fully-qualified path to a specific available implementation (2 found)
+ |
+LL | <::Impl1 as MyTrait2>::my_fn();
+ | +++++++++++ +
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0790`.
diff --git a/src/test/ui/error-codes/auxiliary/crateresolve1-1.rs b/src/test/ui/error-codes/auxiliary/crateresolve1-1.rs
new file mode 100644
index 000000000..a00a19e46
--- /dev/null
+++ b/src/test/ui/error-codes/auxiliary/crateresolve1-1.rs
@@ -0,0 +1,5 @@
+// compile-flags:-C extra-filename=-1
+#![crate_name = "crateresolve1"]
+#![crate_type = "lib"]
+
+pub fn f() -> isize { 10 }
diff --git a/src/test/ui/error-codes/auxiliary/crateresolve1-2.rs b/src/test/ui/error-codes/auxiliary/crateresolve1-2.rs
new file mode 100644
index 000000000..71cc0a12e
--- /dev/null
+++ b/src/test/ui/error-codes/auxiliary/crateresolve1-2.rs
@@ -0,0 +1,5 @@
+// compile-flags:-C extra-filename=-2
+#![crate_name = "crateresolve1"]
+#![crate_type = "lib"]
+
+pub fn f() -> isize { 20 }
diff --git a/src/test/ui/error-codes/auxiliary/crateresolve1-3.rs b/src/test/ui/error-codes/auxiliary/crateresolve1-3.rs
new file mode 100644
index 000000000..921687d4c
--- /dev/null
+++ b/src/test/ui/error-codes/auxiliary/crateresolve1-3.rs
@@ -0,0 +1,5 @@
+// compile-flags:-C extra-filename=-3
+#![crate_name = "crateresolve1"]
+#![crate_type = "lib"]
+
+pub fn f() -> isize { 30 }
diff --git a/src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs b/src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs
new file mode 100644
index 000000000..ad5bb107f
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs
@@ -0,0 +1,22 @@
+use std::marker::PhantomData;
+
+pub trait External {}
+
+pub struct M<'a, 'b, 'c, T, U, V> {
+ a: PhantomData<&'a ()>,
+ b: PhantomData<&'b ()>,
+ c: PhantomData<&'c ()>,
+ d: PhantomData<T>,
+ e: PhantomData<U>,
+ f: PhantomData<V>,
+}
+
+impl<'a, 'b, 'c, T, U, V, W> External for (T, M<'a, 'b, 'c, Box<U>, V, W>)
+where
+ 'b: 'a,
+ T: 'a,
+ U: (FnOnce(T) -> V) + 'static,
+ V: Iterator<Item=T> + Clone,
+ W: std::ops::Add,
+ W::Output: Copy,
+{}
diff --git a/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs b/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs
new file mode 100644
index 000000000..141f36369
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs
@@ -0,0 +1,25 @@
+// Ref: https://github.com/rust-lang/rust/issues/23563#issuecomment-260751672
+
+pub trait LolTo<T> {
+ fn convert_to(&self) -> T;
+}
+
+pub trait LolInto<T>: Sized {
+ fn convert_into(self) -> T;
+}
+
+pub trait LolFrom<T> {
+ fn from(_: T) -> Self;
+}
+
+impl<'a, T: ?Sized, U> LolInto<U> for &'a T where T: LolTo<U> {
+ fn convert_into(self) -> U {
+ self.convert_to()
+ }
+}
+
+impl<T, U> LolFrom<T> for U where T: LolInto<U> {
+ fn from(t: T) -> U {
+ t.convert_into()
+ }
+}
diff --git a/src/test/ui/error-codes/e0119/complex-impl.rs b/src/test/ui/error-codes/e0119/complex-impl.rs
new file mode 100644
index 000000000..9149e4ce5
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/complex-impl.rs
@@ -0,0 +1,11 @@
+// aux-build:complex_impl_support.rs
+
+extern crate complex_impl_support;
+
+use complex_impl_support::{External, M};
+
+struct Q;
+
+impl<R> External for (Q, R) {} //~ ERROR only traits defined
+
+fn main() {}
diff --git a/src/test/ui/error-codes/e0119/complex-impl.stderr b/src/test/ui/error-codes/e0119/complex-impl.stderr
new file mode 100644
index 000000000..654073eec
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/complex-impl.stderr
@@ -0,0 +1,14 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+ --> $DIR/complex-impl.rs:9:1
+ |
+LL | impl<R> External for (Q, R) {}
+ | ^^^^^^^^^^^^^^^^^^^^^------
+ | | |
+ | | this is not defined in the current crate because tuples are always foreign
+ | impl doesn't use only types from inside the current crate
+ |
+ = note: define and implement a trait or new type instead
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0117`.
diff --git a/src/test/ui/error-codes/e0119/conflict-with-std.rs b/src/test/ui/error-codes/e0119/conflict-with-std.rs
new file mode 100644
index 000000000..c9db2bab1
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/conflict-with-std.rs
@@ -0,0 +1,26 @@
+use std::marker::PhantomData;
+use std::convert::{TryFrom, AsRef};
+
+struct Q;
+impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
+ fn as_ref(&self) -> &Q {
+ &**self
+ }
+}
+
+struct S;
+impl From<S> for S { //~ ERROR conflicting implementations
+ fn from(s: S) -> S {
+ s
+ }
+}
+
+struct X;
+impl TryFrom<X> for X { //~ ERROR conflicting implementations
+ type Error = ();
+ fn try_from(u: X) -> Result<X, ()> {
+ Ok(u)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/e0119/conflict-with-std.stderr b/src/test/ui/error-codes/e0119/conflict-with-std.stderr
new file mode 100644
index 000000000..3ff96a6a4
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/conflict-with-std.stderr
@@ -0,0 +1,32 @@
+error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`
+ --> $DIR/conflict-with-std.rs:5:1
+ |
+LL | impl AsRef<Q> for Box<Q> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `alloc`:
+ - impl<T, A> AsRef<T> for Box<T, A>
+ where A: Allocator, T: ?Sized;
+
+error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`
+ --> $DIR/conflict-with-std.rs:12:1
+ |
+LL | impl From<S> for S {
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<T> From<T> for T;
+
+error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`
+ --> $DIR/conflict-with-std.rs:19:1
+ |
+LL | impl TryFrom<X> for X {
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<T, U> TryFrom<U> for T
+ where U: Into<T>;
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/e0119/issue-23563.rs b/src/test/ui/error-codes/e0119/issue-23563.rs
new file mode 100644
index 000000000..f578560c5
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/issue-23563.rs
@@ -0,0 +1,29 @@
+// aux-build:issue-23563-a.rs
+
+// Ref: https://github.com/rust-lang/rust/issues/23563#issuecomment-260751672
+
+extern crate issue_23563_a as a;
+
+use a::LolFrom;
+use a::LolInto;
+use a::LolTo;
+
+struct LocalType<T>(Option<T>);
+
+impl<'a, T> LolFrom<&'a [T]> for LocalType<T> { //~ ERROR conflicting implementations of trait
+ fn from(_: &'a [T]) -> LocalType<T> { LocalType(None) }
+}
+
+impl<T> LolInto<LocalType<T>> for LocalType<T> {
+ fn convert_into(self) -> LocalType<T> {
+ self
+ }
+}
+
+impl LolTo<LocalType<u8>> for [u8] {
+ fn convert_to(&self) -> LocalType<u8> {
+ LocalType(None)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/e0119/issue-23563.stderr b/src/test/ui/error-codes/e0119/issue-23563.stderr
new file mode 100644
index 000000000..f149cef58
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/issue-23563.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`
+ --> $DIR/issue-23563.rs:13:1
+ |
+LL | impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `issue_23563_a`:
+ - impl<T, U> LolFrom<T> for U
+ where T: LolInto<U>;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/e0119/issue-27403.rs b/src/test/ui/error-codes/e0119/issue-27403.rs
new file mode 100644
index 000000000..b03a564ff
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/issue-27403.rs
@@ -0,0 +1,11 @@
+pub struct GenX<S> {
+ inner: S,
+}
+
+impl<S> Into<S> for GenX<S> { //~ ERROR conflicting implementations
+ fn into(self) -> S {
+ self.inner
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/e0119/issue-27403.stderr b/src/test/ui/error-codes/e0119/issue-27403.stderr
new file mode 100644
index 000000000..c11a50487
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/issue-27403.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`
+ --> $DIR/issue-27403.rs:5:1
+ |
+LL | impl<S> Into<S> for GenX<S> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<T, U> Into<U> for T
+ where U: From<T>;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/e0119/issue-28981.rs b/src/test/ui/error-codes/e0119/issue-28981.rs
new file mode 100644
index 000000000..5fb7e9a99
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/issue-28981.rs
@@ -0,0 +1,7 @@
+use std::ops::Deref;
+
+struct Foo;
+
+impl<Foo> Deref for Foo { } //~ ERROR must be used
+
+fn main() {}
diff --git a/src/test/ui/error-codes/e0119/issue-28981.stderr b/src/test/ui/error-codes/e0119/issue-28981.stderr
new file mode 100644
index 000000000..97b570bc7
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/issue-28981.stderr
@@ -0,0 +1,12 @@
+error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g., `MyStruct<Foo>`)
+ --> $DIR/issue-28981.rs:5:6
+ |
+LL | impl<Foo> Deref for Foo { }
+ | ^^^ type parameter `Foo` must be used as the type parameter for some local type
+ |
+ = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
+ = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/error-codes/e0119/so-37347311.rs b/src/test/ui/error-codes/e0119/so-37347311.rs
new file mode 100644
index 000000000..d5f624bc4
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/so-37347311.rs
@@ -0,0 +1,17 @@
+// Ref: https://stackoverflow.com/q/37347311
+
+trait Storage {
+ type Error;
+}
+
+enum MyError<S: Storage> {
+ StorageProblem(S::Error),
+}
+
+impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
+ fn from(error: S::Error) -> MyError<S> {
+ MyError::StorageProblem(error)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/e0119/so-37347311.stderr b/src/test/ui/error-codes/e0119/so-37347311.stderr
new file mode 100644
index 000000000..f1c2b0d29
--- /dev/null
+++ b/src/test/ui/error-codes/e0119/so-37347311.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`
+ --> $DIR/so-37347311.rs:11:1
+ |
+LL | impl<S: Storage> From<S::Error> for MyError<S> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<T> From<T> for T;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/ex-E0611.rs b/src/test/ui/error-codes/ex-E0611.rs
new file mode 100644
index 000000000..f18a3619f
--- /dev/null
+++ b/src/test/ui/error-codes/ex-E0611.rs
@@ -0,0 +1,12 @@
+mod a {
+ pub struct Foo(u32);
+
+ impl Foo {
+ pub fn new() -> Foo { Foo(0) }
+ }
+}
+
+fn main() {
+ let y = a::Foo::new();
+ y.0; //~ ERROR field `0` of struct `Foo` is private
+}
diff --git a/src/test/ui/error-codes/ex-E0611.stderr b/src/test/ui/error-codes/ex-E0611.stderr
new file mode 100644
index 000000000..1da7b33be
--- /dev/null
+++ b/src/test/ui/error-codes/ex-E0611.stderr
@@ -0,0 +1,9 @@
+error[E0616]: field `0` of struct `Foo` is private
+ --> $DIR/ex-E0611.rs:11:6
+ |
+LL | y.0;
+ | ^ private field
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0616`.
diff --git a/src/test/ui/error-codes/ex-E0612.rs b/src/test/ui/error-codes/ex-E0612.rs
new file mode 100644
index 000000000..c8ea53ae9
--- /dev/null
+++ b/src/test/ui/error-codes/ex-E0612.rs
@@ -0,0 +1,6 @@
+struct Foo(u32);
+
+fn main() {
+ let y = Foo(0);
+ y.1; //~ ERROR no field `1` on type `Foo`
+}
diff --git a/src/test/ui/error-codes/ex-E0612.stderr b/src/test/ui/error-codes/ex-E0612.stderr
new file mode 100644
index 000000000..b21b6fdfc
--- /dev/null
+++ b/src/test/ui/error-codes/ex-E0612.stderr
@@ -0,0 +1,9 @@
+error[E0609]: no field `1` on type `Foo`
+ --> $DIR/ex-E0612.rs:5:6
+ |
+LL | y.1;
+ | ^ help: a field with a similar name exists: `0`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0609`.