From 23327597e7a57dc8bddb3f7311e56750b0116114 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 15 Jul 2018 14:11:54 -0700 Subject: Move some `compile-fail` tests to `ui` --- src/test/compile-fail/issue-10176.rs | 19 -- src/test/compile-fail/issue-10200.rs | 19 -- src/test/compile-fail/issue-10291.rs | 17 -- src/test/compile-fail/issue-10398.rs | 21 -- src/test/compile-fail/issue-10401.rs | 15 -- src/test/compile-fail/issue-10412.rs | 32 --- src/test/compile-fail/issue-10465.rs | 33 --- src/test/compile-fail/issue-10536.rs | 31 --- src/test/compile-fail/issue-10545.rs | 20 -- src/test/compile-fail/issue-10656.rs | 14 -- src/test/compile-fail/issue-10755.rs | 15 -- src/test/compile-fail/issue-10764.rs | 15 -- src/test/compile-fail/issue-10877.rs | 24 -- src/test/compile-fail/issue-10991.rs | 14 -- src/test/compile-fail/issue-11154.rs | 15 -- src/test/compile-fail/issue-11192.rs | 32 --- src/test/compile-fail/issue-11374.rs | 37 --- src/test/compile-fail/issue-11493.rs | 18 -- src/test/compile-fail/issue-11515.rs | 20 -- src/test/compile-fail/issue-11681.rs | 29 --- src/test/compile-fail/issue-11692-1.rs | 14 -- src/test/compile-fail/issue-11692-2.rs | 14 -- src/test/compile-fail/issue-11740.rs | 38 ---- src/test/compile-fail/issue-11771.rs | 21 -- src/test/compile-fail/issue-11844.rs | 20 -- src/test/compile-fail/issue-11873.rs | 17 -- src/test/compile-fail/issue-12028.rs | 50 ----- src/test/compile-fail/issue-12041.rs | 23 -- src/test/compile-fail/issue-12116.rs | 31 --- src/test/compile-fail/issue-12127.rs | 24 -- src/test/compile-fail/issue-12369.rs | 22 -- src/test/compile-fail/issue-12470.rs | 44 ---- src/test/compile-fail/issue-12552.rs | 21 -- src/test/compile-fail/issue-12567.rs | 27 --- src/test/compile-fail/issue-12796.rs | 19 -- src/test/compile-fail/issue-12863.rs | 17 -- src/test/compile-fail/issue-12997-1.rs | 19 -- src/test/compile-fail/issue-12997-2.rs | 17 -- src/test/compile-fail/issue-13033.rs | 24 -- src/test/compile-fail/issue-13352.rs | 21 -- src/test/compile-fail/issue-13359.rs | 23 -- src/test/compile-fail/issue-13404.rs | 20 -- src/test/compile-fail/issue-13407.rs | 20 -- src/test/compile-fail/issue-13446.rs | 18 -- src/test/compile-fail/issue-13466.rs | 30 --- src/test/compile-fail/issue-13482-2.rs | 19 -- src/test/compile-fail/issue-13482.rs | 17 -- src/test/compile-fail/issue-13497-2.rs | 17 -- src/test/compile-fail/issue-13497.rs | 18 -- src/test/compile-fail/issue-1362.rs | 18 -- src/test/compile-fail/issue-13641.rs | 23 -- src/test/compile-fail/issue-13727.rs | 25 --- src/test/compile-fail/issue-13847.rs | 13 -- src/test/compile-fail/issue-13853-2.rs | 16 -- src/test/compile-fail/issue-13853-5.rs | 23 -- src/test/compile-fail/issue-13853.rs | 48 ---- src/test/compile-fail/issue-14091-2.rs | 26 --- src/test/compile-fail/issue-14091.rs | 13 -- src/test/compile-fail/issue-14221.rs | 31 --- src/test/compile-fail/issue-14227.rs | 20 -- src/test/compile-fail/issue-14285.rs | 27 --- src/test/compile-fail/issue-14309.rs | 49 ---- src/test/compile-fail/issue-14366.rs | 14 -- src/test/compile-fail/issue-1448-2.rs | 17 -- src/test/compile-fail/issue-14541.rs | 22 -- src/test/compile-fail/issue-14721.rs | 14 -- src/test/compile-fail/issue-1476.rs | 13 -- src/test/compile-fail/issue-14772.rs | 16 -- src/test/compile-fail/issue-14845.rs | 22 -- src/test/compile-fail/issue-14853.rs | 30 --- src/test/compile-fail/issue-14915.rs | 18 -- src/test/compile-fail/issue-15034.rs | 32 --- src/test/compile-fail/issue-15094.rs | 36 --- src/test/compile-fail/issue-15129.rs | 27 --- src/test/compile-fail/issue-15167.rs | 36 --- src/test/compile-fail/issue-15207.rs | 16 -- src/test/compile-fail/issue-15381.rs | 18 -- src/test/compile-fail/issue-15756.rs | 24 -- src/test/compile-fail/issue-15783.rs | 24 -- src/test/compile-fail/issue-15896.rs | 28 --- src/test/compile-fail/issue-15919.rs | 21 -- src/test/compile-fail/issue-15965.rs | 17 -- src/test/compile-fail/issue-16048.rs | 38 ---- src/test/compile-fail/issue-16098.rs | 26 --- src/test/compile-fail/issue-16149.rs | 21 -- src/test/compile-fail/issue-16250.rs | 20 -- src/test/compile-fail/issue-16338.rs | 20 -- src/test/compile-fail/issue-16401.rs | 25 --- src/test/compile-fail/issue-16538.rs | 27 --- src/test/compile-fail/issue-16562.rs | 27 --- src/test/compile-fail/issue-16683.rs | 18 -- src/test/compile-fail/issue-16922.rs | 20 -- src/test/compile-fail/issue-16939.rs | 18 -- src/test/compile-fail/issue-16966.rs | 16 -- src/test/compile-fail/issue-1697.rs | 16 -- src/test/compile-fail/issue-16994.rs | 20 -- src/test/compile-fail/issue-17001.rs | 15 -- src/test/compile-fail/issue-17025.rs | 23 -- src/test/compile-fail/issue-17033.rs | 18 -- src/test/compile-fail/issue-17252.rs | 20 -- src/test/compile-fail/issue-17337.rs | 27 --- src/test/compile-fail/issue-17373.rs | 14 -- src/test/compile-fail/issue-17385.rs | 39 ---- src/test/compile-fail/issue-17405.rs | 19 -- src/test/compile-fail/issue-17431-1.rs | 16 -- src/test/compile-fail/issue-17431-2.rs | 19 -- src/test/compile-fail/issue-17431-3.rs | 18 -- src/test/compile-fail/issue-17431-4.rs | 18 -- src/test/compile-fail/issue-17431-5.rs | 21 -- src/test/compile-fail/issue-17431-6.rs | 18 -- src/test/compile-fail/issue-17431-7.rs | 16 -- src/test/compile-fail/issue-17444.rs | 18 -- src/test/compile-fail/issue-17458.rs | 16 -- src/test/compile-fail/issue-17545.rs | 20 -- src/test/compile-fail/issue-17546.rs | 50 ----- src/test/compile-fail/issue-17551.rs | 18 -- src/test/compile-fail/issue-17651.rs | 17 -- .../compile-fail/issue-17718-const-bad-values.rs | 20 -- src/test/compile-fail/issue-17718-const-borrow.rs | 24 -- src/test/compile-fail/issue-17718-const-naming.rs | 18 -- .../issue-17718-constants-not-static.rs | 19 -- src/test/compile-fail/issue-17718-patterns.rs | 22 -- src/test/compile-fail/issue-17718-references.rs | 34 --- src/test/compile-fail/issue-17718-static-move.rs | 17 -- src/test/compile-fail/issue-17718-static-sync.rs | 22 -- src/test/compile-fail/issue-17728.rs | 132 ----------- src/test/compile-fail/issue-17740.rs | 28 --- src/test/compile-fail/issue-17758.rs | 22 -- src/test/compile-fail/issue-17800.rs | 23 -- src/test/compile-fail/issue-17904-2.rs | 16 -- src/test/compile-fail/issue-17905.rs | 26 --- src/test/compile-fail/issue-17913.rs | 28 --- src/test/compile-fail/issue-17933.rs | 19 -- src/test/compile-fail/issue-17954.rs | 33 --- src/test/compile-fail/issue-17959.rs | 31 --- src/test/compile-fail/issue-17994.rs | 13 -- src/test/compile-fail/issue-17999.rs | 20 -- src/test/compile-fail/issue-18058.rs | 14 -- src/test/compile-fail/issue-18107.rs | 23 -- src/test/compile-fail/issue-18118-2.rs | 17 -- src/test/compile-fail/issue-18118.rs | 21 -- src/test/compile-fail/issue-18119.rs | 22 -- src/test/compile-fail/issue-18159.rs | 13 -- src/test/compile-fail/issue-18294.rs | 15 -- src/test/compile-fail/issue-18389.rs | 28 --- src/test/compile-fail/issue-18400.rs | 36 --- src/test/compile-fail/issue-18423.rs | 18 -- src/test/compile-fail/issue-18446.rs | 29 --- src/test/compile-fail/issue-18532.rs | 17 -- src/test/compile-fail/issue-18566.rs | 35 --- src/test/compile-fail/issue-18611.rs | 19 -- src/test/compile-fail/issue-1871.rs | 22 -- src/test/compile-fail/issue-18783.rs | 38 ---- src/test/compile-fail/issue-18919.rs | 17 -- src/test/compile-fail/issue-18937.rs | 50 ----- src/test/compile-fail/issue-18959.rs | 30 --- src/test/compile-fail/issue-1900.rs | 12 - src/test/compile-fail/issue-19086.rs | 23 -- src/test/compile-fail/issue-19244-1.rs | 16 -- src/test/compile-fail/issue-19244-2.rs | 17 -- src/test/compile-fail/issue-19380.rs | 28 --- src/test/compile-fail/issue-19482.rs | 23 -- src/test/compile-fail/issue-19521.rs | 13 -- src/test/compile-fail/issue-19538.rs | 30 --- src/test/compile-fail/issue-19601.rs | 19 -- src/test/compile-fail/issue-19660.rs | 25 --- src/test/compile-fail/issue-19692.rs | 18 -- src/test/compile-fail/issue-19734.rs | 18 -- src/test/compile-fail/issue-19883.rs | 26 --- src/test/compile-fail/issue-19982.rs | 17 -- src/test/compile-fail/issue-19991.rs | 21 -- src/test/compile-fail/issue-20005.rs | 25 --- src/test/compile-fail/issue-20162.rs | 17 -- src/test/compile-fail/issue-20225.rs | 35 --- src/test/compile-fail/issue-20261.rs | 17 -- src/test/compile-fail/issue-20313.rs | 17 -- src/test/compile-fail/issue-20413.rs | 25 --- src/test/compile-fail/issue-20433.rs | 18 -- src/test/compile-fail/issue-20605.rs | 16 -- src/test/compile-fail/issue-20616-1.rs | 46 ---- src/test/compile-fail/issue-20616-2.rs | 46 ---- src/test/compile-fail/issue-20616-3.rs | 46 ---- src/test/compile-fail/issue-20616-4.rs | 47 ---- src/test/compile-fail/issue-20616-5.rs | 47 ---- src/test/compile-fail/issue-20616-6.rs | 47 ---- src/test/compile-fail/issue-20616-7.rs | 46 ---- src/test/compile-fail/issue-20616-8.rs | 46 ---- src/test/compile-fail/issue-20616-9.rs | 46 ---- src/test/compile-fail/issue-20714.rs | 15 -- src/test/compile-fail/issue-20772.rs | 16 -- src/test/compile-fail/issue-20801.rs | 47 ---- src/test/compile-fail/issue-20825.rs | 20 -- src/test/compile-fail/issue-20831-debruijn.rs | 49 ---- src/test/compile-fail/issue-20939.rs | 16 -- src/test/compile-fail/issue-2111.rs | 22 -- src/test/compile-fail/issue-21160.rs | 21 -- src/test/compile-fail/issue-21174.rs | 21 -- src/test/compile-fail/issue-21177.rs | 20 -- src/test/compile-fail/issue-21332.rs | 20 -- src/test/compile-fail/issue-21356.rs | 16 -- src/test/compile-fail/issue-21449.rs | 16 -- src/test/compile-fail/issue-2149.rs | 25 --- src/test/compile-fail/issue-2150.rs | 22 -- src/test/compile-fail/issue-2151.rs | 14 -- src/test/compile-fail/issue-21554.rs | 16 -- src/test/compile-fail/issue-21701.rs | 25 --- src/test/compile-fail/issue-21763.rs | 21 -- src/test/compile-fail/issue-21837.rs | 20 -- src/test/compile-fail/issue-21946.rs | 22 -- src/test/compile-fail/issue-21974.rs | 28 --- src/test/compile-fail/issue-22034.rs | 21 -- src/test/compile-fail/issue-22037.rs | 27 --- src/test/compile-fail/issue-22289.rs | 13 -- src/test/compile-fail/issue-22312.rs | 27 --- src/test/compile-fail/issue-22384.rs | 18 -- src/test/compile-fail/issue-22434.rs | 18 -- src/test/compile-fail/issue-22468.rs | 19 -- src/test/compile-fail/issue-22599.rs | 20 -- src/test/compile-fail/issue-22603.rs | 23 -- src/test/compile-fail/issue-22673.rs | 16 -- src/test/compile-fail/issue-22684.rs | 28 --- src/test/compile-fail/issue-22706.rs | 13 -- src/test/compile-fail/issue-22789.rs | 17 -- src/test/compile-fail/issue-2281-part1.rs | 11 - src/test/compile-fail/issue-22874.rs | 20 -- src/test/compile-fail/issue-22933-1.rs | 35 --- src/test/compile-fail/issue-22933-3.rs | 14 -- src/test/compile-fail/issue-23024.rs | 23 -- src/test/compile-fail/issue-23046.rs | 30 --- src/test/compile-fail/issue-23073.rs | 19 -- src/test/compile-fail/issue-23080-2.rs | 27 --- src/test/compile-fail/issue-23080.rs | 29 --- src/test/compile-fail/issue-23122-1.rs | 22 -- src/test/compile-fail/issue-23122-2.rs | 22 -- src/test/compile-fail/issue-23253.rs | 16 -- src/test/compile-fail/issue-23281.rs | 20 -- src/test/compile-fail/issue-2330.rs | 23 -- src/test/compile-fail/issue-23589.rs | 14 -- src/test/compile-fail/issue-23595-1.rs | 26 --- src/test/compile-fail/issue-23595-2.rs | 20 -- src/test/compile-fail/issue-23966.rs | 14 -- src/test/compile-fail/issue-24013.rs | 17 -- src/test/compile-fail/issue-24204.rs | 27 --- src/test/compile-fail/issue-24267-flow-exit.rs | 29 --- src/test/compile-fail/issue-24322.rs | 19 -- src/test/compile-fail/issue-24352.rs | 14 -- src/test/compile-fail/issue-24357.rs | 20 -- src/test/compile-fail/issue-24363.rs | 16 -- src/test/compile-fail/issue-24365.rs | 29 --- src/test/compile-fail/issue-24446.rs | 17 -- src/test/compile-fail/issue-24682.rs | 31 --- src/test/compile-fail/issue-24819.rs | 21 -- src/test/compile-fail/issue-24883.rs | 28 --- src/test/compile-fail/issue-25076.rs | 21 -- src/test/compile-fail/issue-25368.rs | 23 -- src/test/compile-fail/issue-25386.rs | 38 ---- src/test/compile-fail/issue-25396.rs | 37 --- src/test/compile-fail/issue-25439.rs | 19 -- src/test/compile-fail/issue-25579.rs | 32 --- src/test/compile-fail/issue-25700.rs | 24 -- src/test/compile-fail/issue-2590.rs | 26 --- src/test/compile-fail/issue-25901.rs | 24 -- src/test/compile-fail/issue-26094.rs | 23 -- src/test/compile-fail/issue-26158.rs | 16 -- src/test/compile-fail/issue-26217.rs | 16 -- src/test/compile-fail/issue-26237.rs | 23 -- src/test/compile-fail/issue-26262.rs | 32 --- src/test/compile-fail/issue-26459.rs | 16 -- src/test/compile-fail/issue-26548.rs | 21 -- src/test/compile-fail/issue-26614.rs | 27 --- src/test/compile-fail/issue-26812.rs | 16 -- src/test/compile-fail/issue-26905.rs | 34 --- src/test/compile-fail/issue-26930.rs | 20 -- src/test/compile-fail/issue-26948.rs | 16 -- src/test/compile-fail/issue-27008.rs | 19 -- src/test/compile-fail/issue-27033.rs | 22 -- src/test/compile-fail/issue-27042.rs | 26 --- src/test/compile-fail/issue-27060-2.rs | 16 -- src/test/compile-fail/issue-27078.rs | 21 -- src/test/compile-fail/issue-2718-a.rs | 22 -- src/test/compile-fail/issue-27340.rs | 16 -- src/test/compile-fail/issue-27433.rs | 15 -- src/test/compile-fail/issue-27592.rs | 29 --- src/test/compile-fail/issue-27815.rs | 22 -- src/test/compile-fail/issue-27895.rs | 20 -- src/test/compile-fail/issue-28098.rs | 35 --- src/test/compile-fail/issue-28105.rs | 18 -- src/test/compile-fail/issue-28109.rs | 22 -- src/test/compile-fail/issue-28113.rs | 18 -- src/test/compile-fail/issue-2823.rs | 24 -- src/test/compile-fail/issue-28324.rs | 21 -- src/test/compile-fail/issue-28344.rs | 21 -- src/test/compile-fail/issue-28433.rs | 23 -- src/test/compile-fail/issue-28472.rs | 24 -- src/test/compile-fail/issue-2849.rs | 18 -- src/test/compile-fail/issue-28576.rs | 22 -- src/test/compile-fail/issue-28586.rs | 17 -- src/test/compile-fail/issue-28625.rs | 30 --- src/test/compile-fail/issue-28992-empty.rs | 26 --- src/test/compile-fail/issue-29084.rs | 25 --- src/test/compile-fail/issue-29147.rs | 32 --- src/test/compile-fail/issue-29161.rs | 25 --- src/test/compile-fail/issue-29184.rs | 13 -- src/test/compile-fail/issue-2937.rs | 16 -- src/test/compile-fail/issue-2951.rs | 21 -- src/test/compile-fail/issue-29857.rs | 31 --- src/test/compile-fail/issue-29861.rs | 30 --- src/test/compile-fail/issue-2995.rs | 15 -- src/test/compile-fail/issue-30079.rs | 49 ---- src/test/compile-fail/issue-3008-3.rs | 20 -- src/test/compile-fail/issue-3021-b.rs | 24 -- src/test/compile-fail/issue-3021-c.rs | 19 -- src/test/compile-fail/issue-3021-d.rs | 38 ---- src/test/compile-fail/issue-3021.rs | 28 --- src/test/compile-fail/issue-30225.rs | 48 ---- src/test/compile-fail/issue-30236.rs | 18 -- src/test/compile-fail/issue-30240-b.rs | 26 --- src/test/compile-fail/issue-30240.rs | 20 -- src/test/compile-fail/issue-30355.rs | 21 -- src/test/compile-fail/issue-3038.rs | 36 --- src/test/compile-fail/issue-30438-a.rs | 33 --- src/test/compile-fail/issue-30438-b.rs | 34 --- src/test/compile-fail/issue-30438-c.rs | 30 --- src/test/compile-fail/issue-30560.rs | 22 -- src/test/compile-fail/issue-30589.rs | 19 -- src/test/compile-fail/issue-3080.rs | 18 -- src/test/compile-fail/issue-3096-1.rs | 13 -- src/test/compile-fail/issue-3096-2.rs | 16 -- src/test/compile-fail/issue-3099-a.rs | 15 -- src/test/compile-fail/issue-3099-b.rs | 15 -- src/test/compile-fail/issue-3099.rs | 21 -- src/test/compile-fail/issue-31011.rs | 39 ---- src/test/compile-fail/issue-31109.rs | 16 -- src/test/compile-fail/issue-31173.rs | 27 --- src/test/compile-fail/issue-31212.rs | 20 -- src/test/compile-fail/issue-31495.rs | 13 -- src/test/compile-fail/issue-31511.rs | 16 -- src/test/compile-fail/issue-3154.rs | 21 -- src/test/compile-fail/issue-31561.rs | 20 -- src/test/compile-fail/issue-31769.rs | 14 -- src/test/compile-fail/issue-31804.rs | 16 -- src/test/compile-fail/issue-31845.rs | 22 -- src/test/compile-fail/issue-31910.rs | 22 -- src/test/compile-fail/issue-31924-non-snake-ffi.rs | 18 -- src/test/compile-fail/issue-32004.rs | 29 --- src/test/compile-fail/issue-32086.rs | 17 -- src/test/compile-fail/issue-32119.rs | 29 --- src/test/compile-fail/issue-3214.rs | 21 -- src/test/compile-fail/issue-32201.rs | 23 -- src/test/compile-fail/issue-32222.rs | 34 --- src/test/compile-fail/issue-32323.rs | 18 -- src/test/compile-fail/issue-32377.rs | 27 --- src/test/compile-fail/issue-32655.rs | 32 --- src/test/compile-fail/issue-32709.rs | 18 -- src/test/compile-fail/issue-32782.rs | 23 -- src/test/compile-fail/issue-32797.rs | 24 -- src/test/compile-fail/issue-32829.rs | 17 -- src/test/compile-fail/issue-32833.rs | 17 -- src/test/compile-fail/issue-32922.rs | 41 ---- src/test/compile-fail/issue-32963.rs | 21 -- src/test/compile-fail/issue-32995-2.rs | 28 --- src/test/compile-fail/issue-32995.rs | 43 ---- src/test/compile-fail/issue-33241.rs | 23 -- src/test/compile-fail/issue-33293.rs | 16 -- src/test/compile-fail/issue-3344.rs | 17 -- src/test/compile-fail/issue-33464.rs | 20 -- src/test/compile-fail/issue-33504.rs | 19 -- src/test/compile-fail/issue-33571.rs | 14 -- src/test/compile-fail/issue-33819.rs | 18 -- src/test/compile-fail/issue-34028.rs | 21 -- src/test/compile-fail/issue-34171.rs | 21 -- src/test/compile-fail/issue-34222-1.rs | 13 -- src/test/compile-fail/issue-34334.rs | 14 -- src/test/compile-fail/issue-34349.rs | 32 --- src/test/compile-fail/issue-34373.rs | 21 -- src/test/compile-fail/issue-34418.rs | 31 --- src/test/compile-fail/issue-3477.rs | 15 -- src/test/compile-fail/issue-34839.rs | 31 --- src/test/compile-fail/issue-35075.rs | 19 -- src/test/compile-fail/issue-3521-2.rs | 18 -- src/test/compile-fail/issue-3521.rs | 21 -- src/test/compile-fail/issue-35450.rs | 15 -- src/test/compile-fail/issue-35570.rs | 40 ---- src/test/compile-fail/issue-35668.rs | 22 -- src/test/compile-fail/issue-35988.rs | 16 -- src/test/compile-fail/issue-3601.rs | 44 ---- src/test/compile-fail/issue-36082.rs | 34 --- src/test/compile-fail/issue-36116.rs | 37 --- src/test/compile-fail/issue-36299.rs | 15 -- src/test/compile-fail/issue-36379.rs | 16 -- src/test/compile-fail/issue-36617.rs | 11 - src/test/compile-fail/issue-36638.rs | 19 -- src/test/compile-fail/issue-3668-2.rs | 16 -- src/test/compile-fail/issue-3668.rs | 24 -- src/test/compile-fail/issue-3680.rs | 19 -- src/test/compile-fail/issue-36839.rs | 32 --- src/test/compile-fail/issue-3702-2.rs | 30 --- src/test/compile-fail/issue-37026.rs | 18 -- src/test/compile-fail/issue-37051.rs | 29 --- src/test/compile-fail/issue-3707.rs | 28 --- src/test/compile-fail/issue-37323.rs | 28 --- src/test/compile-fail/issue-37366.rs | 26 --- src/test/compile-fail/issue-37510.rs | 25 --- src/test/compile-fail/issue-37515.rs | 19 -- src/test/compile-fail/issue-37534.rs | 16 -- src/test/compile-fail/issue-37550.rs | 22 -- src/test/compile-fail/issue-37576.rs | 55 ----- src/test/compile-fail/issue-3763.rs | 36 --- src/test/compile-fail/issue-37665.rs | 21 -- src/test/compile-fail/issue-37887.rs | 14 -- src/test/compile-fail/issue-38160.rs | 31 --- src/test/compile-fail/issue-3820.rs | 25 --- src/test/compile-fail/issue-38293.rs | 26 --- src/test/compile-fail/issue-38381.rs | 18 -- src/test/compile-fail/issue-38404.rs | 16 -- src/test/compile-fail/issue-38412.rs | 20 -- src/test/compile-fail/issue-38458.rs | 15 -- src/test/compile-fail/issue-38604.rs | 26 --- src/test/compile-fail/issue-38857.rs | 15 -- src/test/compile-fail/issue-38868.rs | 23 -- src/test/compile-fail/issue-38919.rs | 15 -- src/test/compile-fail/issue-38954.rs | 14 -- src/test/compile-fail/issue-39211.rs | 24 -- src/test/compile-fail/issue-39362.rs | 28 --- src/test/compile-fail/issue-39388.rs | 19 -- src/test/compile-fail/issue-39404.rs | 17 -- src/test/compile-fail/issue-39559-2.rs | 30 --- src/test/compile-fail/issue-39559.rs | 29 --- src/test/compile-fail/issue-39616.rs | 15 -- src/test/compile-fail/issue-39687.rs | 16 -- src/test/compile-fail/issue-3973.rs | 35 --- src/test/compile-fail/issue-39848.rs | 20 -- src/test/compile-fail/issue-3993.rs | 20 -- src/test/compile-fail/issue-39970.rs | 31 --- src/test/compile-fail/issue-39974.rs | 21 -- src/test/compile-fail/issue-40000.rs | 18 -- src/test/compile-fail/issue-40288-2.rs | 41 ---- src/test/compile-fail/issue-40288.rs | 30 --- src/test/compile-fail/issue-40350.rs | 24 -- src/test/compile-fail/issue-40510-1.rs | 23 -- src/test/compile-fail/issue-40510-2.rs | 23 -- src/test/compile-fail/issue-40510-3.rs | 25 --- src/test/compile-fail/issue-40510-4.rs | 25 --- src/test/compile-fail/issue-40610.rs | 16 -- src/test/compile-fail/issue-40749.rs | 16 -- src/test/compile-fail/issue-40845.rs | 16 -- src/test/compile-fail/issue-40861.rs | 16 -- src/test/compile-fail/issue-41139.rs | 18 -- src/test/compile-fail/issue-41229-ref-str.rs | 14 -- src/test/compile-fail/issue-41255.rs | 50 ----- src/test/compile-fail/issue-41394.rs | 20 -- src/test/compile-fail/issue-41726.rs | 17 -- src/test/compile-fail/issue-41742.rs | 35 --- src/test/compile-fail/issue-41776.rs | 13 -- src/test/compile-fail/issue-41880.rs | 39 ---- src/test/compile-fail/issue-41974.rs | 24 -- src/test/compile-fail/issue-41998.rs | 20 -- src/test/compile-fail/issue-4201.rs | 21 -- src/test/compile-fail/issue-42312.rs | 21 -- src/test/compile-fail/issue-42344.rs | 17 -- src/test/compile-fail/issue-4265.rs | 24 -- src/test/compile-fail/issue-42755.rs | 17 -- src/test/compile-fail/issue-42796.rs | 29 --- src/test/compile-fail/issue-42880.rs | 18 -- src/test/compile-fail/issue-43023.rs | 28 --- src/test/compile-fail/issue-43105.rs | 22 -- src/test/compile-fail/issue-43162.rs | 18 -- src/test/compile-fail/issue-4321.rs | 18 -- src/test/compile-fail/issue-43250.rs | 23 -- src/test/compile-fail/issue-43355.rs | 30 --- src/test/compile-fail/issue-43424.rs | 22 -- src/test/compile-fail/issue-43431.rs | 24 -- src/test/compile-fail/issue-4366-2.rs | 36 --- src/test/compile-fail/issue-4366.rs | 36 --- src/test/compile-fail/issue-43733-2.rs | 39 ---- src/test/compile-fail/issue-43733.rs | 43 ---- .../compile-fail/issue-43784-associated-type.rs | 25 --- src/test/compile-fail/issue-43784-supertrait.rs | 18 -- src/test/compile-fail/issue-43925.rs | 16 -- src/test/compile-fail/issue-43926.rs | 14 -- src/test/compile-fail/issue-43988.rs | 49 ---- src/test/compile-fail/issue-44021.rs | 16 -- src/test/compile-fail/issue-44239.rs | 19 -- src/test/compile-fail/issue-44373.rs | 16 -- src/test/compile-fail/issue-44415.rs | 23 -- .../compile-fail/issue-45087-unreachable-unsafe.rs | 15 -- src/test/compile-fail/issue-4517.rs | 20 -- src/test/compile-fail/issue-45199.rs | 43 ---- .../issue-45729-unsafe-in-generator.rs | 19 -- src/test/compile-fail/issue-45801.rs | 35 --- src/test/compile-fail/issue-45965.rs | 14 -- src/test/compile-fail/issue-46023.rs | 22 -- src/test/compile-fail/issue-46036.rs | 23 -- src/test/compile-fail/issue-46311.rs | 14 -- src/test/compile-fail/issue-46438.rs | 23 -- src/test/compile-fail/issue-46604.rs | 22 -- src/test/compile-fail/issue-46771.rs | 14 -- src/test/compile-fail/issue-46843.rs | 22 -- src/test/compile-fail/issue-47309.rs | 31 --- src/test/compile-fail/issue-4736.rs | 15 -- src/test/compile-fail/issue-47412.rs | 31 --- src/test/compile-fail/issue-47715.rs | 38 ---- src/test/compile-fail/issue-48131.rs | 39 ---- src/test/compile-fail/issue-48838.rs | 15 -- src/test/compile-fail/issue-4968.rs | 20 -- src/test/compile-fail/issue-4972.rs | 28 --- src/test/compile-fail/issue-50471.rs | 19 -- src/test/compile-fail/issue-50600.rs | 15 -- src/test/compile-fail/issue-5062.rs | 12 - src/test/compile-fail/issue-5067.rs | 64 ------ src/test/compile-fail/issue-50688.rs | 13 -- src/test/compile-fail/issue-5099.rs | 14 -- src/test/compile-fail/issue-5100.rs | 67 ------ src/test/compile-fail/issue-5153.rs | 22 -- src/test/compile-fail/issue-5216.rs | 20 -- src/test/compile-fail/issue-52213.rs | 24 -- src/test/compile-fail/issue-5358-1.rs | 23 -- src/test/compile-fail/issue-5439.rs | 31 --- src/test/compile-fail/issue-5883.rs | 23 -- src/test/compile-fail/issue-5927.rs | 18 -- src/test/compile-fail/issue-5997-enum.rs | 20 -- src/test/compile-fail/issue-5997-struct.rs | 20 -- src/test/compile-fail/issue-6458-2.rs | 15 -- src/test/compile-fail/issue-6596-1.rs | 21 -- src/test/compile-fail/issue-6596-2.rs | 23 -- src/test/compile-fail/issue-6642.rs | 19 -- src/test/compile-fail/issue-6738.rs | 20 -- src/test/compile-fail/issue-6801.rs | 31 --- src/test/compile-fail/issue-6804.rs | 31 --- src/test/compile-fail/issue-6936.rs | 44 ---- src/test/compile-fail/issue-7013.rs | 38 ---- src/test/compile-fail/issue-7044.rs | 14 -- src/test/compile-fail/issue-7061.rs | 20 -- src/test/compile-fail/issue-7092.rs | 25 --- src/test/compile-fail/issue-7246.rs | 20 -- src/test/compile-fail/issue-7364.rs | 20 -- src/test/compile-fail/issue-7607-1.rs | 19 -- src/test/compile-fail/issue-7867.rs | 24 -- src/test/compile-fail/issue-7950.rs | 18 -- src/test/compile-fail/issue-7970a.rs | 18 -- src/test/compile-fail/issue-7970b.rs | 14 -- src/test/compile-fail/issue-8153.rs | 26 --- src/test/compile-fail/issue-8208.rs | 27 --- src/test/compile-fail/issue-8460-const.rs | 77 ------- src/test/compile-fail/issue-8640.rs | 20 -- src/test/compile-fail/issue-8727.rs | 24 -- src/test/compile-fail/issue-8761.rs | 20 -- src/test/compile-fail/issue-8767.rs | 15 -- src/test/compile-fail/issue-9575.rs | 17 -- src/test/compile-fail/issue-9725.rs | 17 -- src/test/compile-fail/issue-9814.rs | 18 -- src/test/compile-fail/issue-pr29383.rs | 22 -- src/test/ui/issue-10176.rs | 19 ++ src/test/ui/issue-10176.stderr | 14 ++ src/test/ui/issue-10200.rs | 19 ++ src/test/ui/issue-10200.stderr | 9 + src/test/ui/issue-10291.nll.stderr | 14 ++ src/test/ui/issue-10291.rs | 17 ++ src/test/ui/issue-10291.stderr | 23 ++ src/test/ui/issue-10398.nll.stderr | 13 ++ src/test/ui/issue-10398.rs | 21 ++ src/test/ui/issue-10398.stderr | 13 ++ src/test/ui/issue-10401.rs | 15 ++ src/test/ui/issue-10401.stderr | 16 ++ src/test/ui/issue-10412.rs | 32 +++ src/test/ui/issue-10412.stderr | 51 +++++ src/test/ui/issue-10465.rs | 33 +++ src/test/ui/issue-10465.stderr | 13 ++ src/test/ui/issue-10536.rs | 33 +++ src/test/ui/issue-10536.stderr | 14 ++ src/test/ui/issue-10545.rs | 20 ++ src/test/ui/issue-10545.stderr | 9 + src/test/ui/issue-10656.rs | 13 ++ src/test/ui/issue-10656.stderr | 15 ++ src/test/ui/issue-10755.rs | 15 ++ src/test/ui/issue-10755.stderr | 6 + src/test/ui/issue-10764.rs | 15 ++ src/test/ui/issue-10764.stderr | 12 + src/test/ui/issue-10877.rs | 24 ++ src/test/ui/issue-10877.stderr | 27 +++ src/test/ui/issue-10991.rs | 14 ++ src/test/ui/issue-10991.stderr | 11 + src/test/ui/issue-11154.rs | 15 ++ src/test/ui/issue-11154.stderr | 6 + src/test/ui/issue-11192.nll.stderr | 18 ++ src/test/ui/issue-11192.rs | 32 +++ src/test/ui/issue-11192.stderr | 18 ++ src/test/ui/issue-11374.rs | 37 +++ src/test/ui/issue-11374.stderr | 15 ++ src/test/ui/issue-11493.ast.stderr | 16 ++ src/test/ui/issue-11493.mir.stderr | 16 ++ src/test/ui/issue-11493.rs | 24 ++ src/test/ui/issue-11515.rs | 20 ++ src/test/ui/issue-11515.stderr | 12 + src/test/ui/issue-11681.rs | 29 +++ src/test/ui/issue-11681.stderr | 18 ++ src/test/ui/issue-11692-1.rs | 14 ++ src/test/ui/issue-11692-1.stderr | 8 + src/test/ui/issue-11692-2.rs | 14 ++ src/test/ui/issue-11692-2.stderr | 8 + src/test/ui/issue-11740.rs | 38 ++++ src/test/ui/issue-11740.stderr | 11 + src/test/ui/issue-11771.rs | 21 ++ src/test/ui/issue-11771.stderr | 19 ++ src/test/ui/issue-11844.rs | 20 ++ src/test/ui/issue-11844.stderr | 12 + src/test/ui/issue-11873.nll.stderr | 14 ++ src/test/ui/issue-11873.rs | 17 ++ src/test/ui/issue-11873.stderr | 11 + src/test/ui/issue-12028.rs | 50 +++++ src/test/ui/issue-12028.stderr | 9 + src/test/ui/issue-12041.nll.stderr | 11 + src/test/ui/issue-12041.rs | 23 ++ src/test/ui/issue-12041.stderr | 11 + src/test/ui/issue-12116.rs | 31 +++ src/test/ui/issue-12116.stderr | 14 ++ src/test/ui/issue-12127.rs | 24 ++ src/test/ui/issue-12127.stderr | 13 ++ src/test/ui/issue-12369.rs | 22 ++ src/test/ui/issue-12369.stderr | 14 ++ src/test/ui/issue-12470.nll.stderr | 18 ++ src/test/ui/issue-12470.rs | 44 ++++ src/test/ui/issue-12470.stderr | 18 ++ src/test/ui/issue-12552.rs | 21 ++ src/test/ui/issue-12552.stderr | 21 ++ src/test/ui/issue-12567.nll.stderr | 31 +++ src/test/ui/issue-12567.rs | 27 +++ src/test/ui/issue-12567.stderr | 39 ++++ src/test/ui/issue-12796.rs | 19 ++ src/test/ui/issue-12796.stderr | 11 + src/test/ui/issue-12863.rs | 17 ++ src/test/ui/issue-12863.stderr | 9 + src/test/ui/issue-12997-1.rs | 19 ++ src/test/ui/issue-12997-1.stderr | 14 ++ src/test/ui/issue-12997-2.rs | 17 ++ src/test/ui/issue-12997-2.stderr | 12 + src/test/ui/issue-13033.rs | 24 ++ src/test/ui/issue-13033.stderr | 15 ++ src/test/ui/issue-13352.rs | 21 ++ src/test/ui/issue-13352.stderr | 11 + src/test/ui/issue-13359.rs | 23 ++ src/test/ui/issue-13359.stderr | 15 ++ src/test/ui/issue-13404.rs | 20 ++ src/test/ui/issue-13404.stderr | 9 + src/test/ui/issue-13407.rs | 20 ++ src/test/ui/issue-13407.stderr | 25 +++ src/test/ui/issue-13446.rs | 18 ++ src/test/ui/issue-13446.stderr | 13 ++ src/test/ui/issue-13466.rs | 30 +++ src/test/ui/issue-13466.stderr | 21 ++ src/test/ui/issue-13482-2.rs | 19 ++ src/test/ui/issue-13482-2.stderr | 9 + src/test/ui/issue-13482.rs | 17 ++ src/test/ui/issue-13482.stderr | 9 + src/test/ui/issue-13497-2.rs | 17 ++ src/test/ui/issue-13497-2.stderr | 18 ++ src/test/ui/issue-13497.rs | 18 ++ src/test/ui/issue-13497.stderr | 12 + src/test/ui/issue-1362.rs | 18 ++ src/test/ui/issue-1362.stderr | 9 + src/test/ui/issue-13641.rs | 23 ++ src/test/ui/issue-13641.stderr | 15 ++ src/test/ui/issue-13727.rs | 25 +++ src/test/ui/issue-13727.stderr | 14 ++ src/test/ui/issue-13847.rs | 13 ++ src/test/ui/issue-13847.stderr | 9 + src/test/ui/issue-13853-2.rs | 16 ++ src/test/ui/issue-13853-2.stderr | 11 + src/test/ui/issue-13853-5.rs | 23 ++ src/test/ui/issue-13853-5.stderr | 9 + src/test/ui/issue-13853.rs | 48 ++++ src/test/ui/issue-13853.stderr | 34 +++ src/test/ui/issue-14091-2.rs | 27 +++ src/test/ui/issue-14091-2.stderr | 11 + src/test/ui/issue-14091.rs | 14 ++ src/test/ui/issue-14091.stderr | 12 + src/test/ui/issue-14221.rs | 31 +++ src/test/ui/issue-14221.stderr | 30 +++ src/test/ui/issue-14227.rs | 20 ++ src/test/ui/issue-14227.stderr | 9 + src/test/ui/issue-14285.nll.stderr | 17 ++ src/test/ui/issue-14285.rs | 27 +++ src/test/ui/issue-14285.stderr | 11 + src/test/ui/issue-14309.rs | 49 ++++ src/test/ui/issue-14309.stderr | 82 +++++++ src/test/ui/issue-14366.rs | 14 ++ src/test/ui/issue-14366.stderr | 13 ++ src/test/ui/issue-1448-2.rs | 17 ++ src/test/ui/issue-1448-2.stderr | 9 + src/test/ui/issue-14541.rs | 22 ++ src/test/ui/issue-14541.stderr | 12 + src/test/ui/issue-14721.rs | 14 ++ src/test/ui/issue-14721.stderr | 9 + src/test/ui/issue-1476.rs | 13 ++ src/test/ui/issue-1476.stderr | 9 + src/test/ui/issue-14772.rs | 16 ++ src/test/ui/issue-14772.stderr | 8 + src/test/ui/issue-14845.rs | 22 ++ src/test/ui/issue-14845.stderr | 15 ++ src/test/ui/issue-14853.rs | 30 +++ src/test/ui/issue-14853.stderr | 12 + src/test/ui/issue-14915.rs | 18 ++ src/test/ui/issue-14915.stderr | 11 + src/test/ui/issue-15034.nll.stderr | 17 ++ src/test/ui/issue-15034.rs | 32 +++ src/test/ui/issue-15034.stderr | 11 + src/test/ui/issue-15094.rs | 36 +++ src/test/ui/issue-15094.stderr | 12 + src/test/ui/issue-15129.rs | 27 +++ src/test/ui/issue-15129.stderr | 9 + src/test/ui/issue-15167.rs | 36 +++ src/test/ui/issue-15167.stderr | 39 ++++ src/test/ui/issue-15207.rs | 16 ++ src/test/ui/issue-15207.stderr | 9 + src/test/ui/issue-15381.rs | 18 ++ src/test/ui/issue-15381.stderr | 9 + src/test/ui/issue-15756.rs | 24 ++ src/test/ui/issue-15756.stderr | 13 ++ src/test/ui/issue-15783.rs | 24 ++ src/test/ui/issue-15783.stderr | 12 + src/test/ui/issue-15896.rs | 28 +++ src/test/ui/issue-15896.stderr | 12 + src/test/ui/issue-15919.rs | 21 ++ src/test/ui/issue-15919.stderr | 4 + src/test/ui/issue-15965.rs | 17 ++ src/test/ui/issue-15965.stderr | 13 ++ src/test/ui/issue-16048.rs | 38 ++++ src/test/ui/issue-16048.stderr | 12 + src/test/ui/issue-16098.rs | 26 +++ src/test/ui/issue-16098.stderr | 13 ++ src/test/ui/issue-16149.rs | 21 ++ src/test/ui/issue-16149.stderr | 12 + src/test/ui/issue-16250.rs | 20 ++ src/test/ui/issue-16250.stderr | 21 ++ src/test/ui/issue-16338.rs | 20 ++ src/test/ui/issue-16338.stderr | 12 + src/test/ui/issue-16401.rs | 25 +++ src/test/ui/issue-16401.stderr | 12 + src/test/ui/issue-16538.rs | 27 +++ src/test/ui/issue-16538.stderr | 19 ++ src/test/ui/issue-16562.rs | 27 +++ src/test/ui/issue-16562.stderr | 9 + src/test/ui/issue-16683.nll.stderr | 22 ++ src/test/ui/issue-16683.rs | 18 ++ src/test/ui/issue-16683.stderr | 30 +++ src/test/ui/issue-16922.nll.stderr | 17 ++ src/test/ui/issue-16922.rs | 20 ++ src/test/ui/issue-16922.stderr | 11 + src/test/ui/issue-16939.rs | 18 ++ src/test/ui/issue-16939.stderr | 9 + src/test/ui/issue-16966.rs | 16 ++ src/test/ui/issue-16966.stderr | 13 ++ src/test/ui/issue-1697.rs | 16 ++ src/test/ui/issue-1697.stderr | 9 + src/test/ui/issue-16994.rs | 20 ++ src/test/ui/issue-16994.stderr | 10 + src/test/ui/issue-17001.rs | 15 ++ src/test/ui/issue-17001.stderr | 9 + src/test/ui/issue-17025.rs | 23 ++ src/test/ui/issue-17033.rs | 18 ++ src/test/ui/issue-17033.stderr | 15 ++ src/test/ui/issue-17252.rs | 20 ++ src/test/ui/issue-17252.stderr | 16 ++ src/test/ui/issue-17337.rs | 27 +++ src/test/ui/issue-17337.stderr | 14 ++ src/test/ui/issue-17373.rs | 14 ++ src/test/ui/issue-17373.stderr | 9 + src/test/ui/issue-17385.nll.stderr | 77 +++++++ src/test/ui/issue-17385.rs | 39 ++++ src/test/ui/issue-17385.stderr | 23 ++ src/test/ui/issue-17405.rs | 19 ++ src/test/ui/issue-17405.stderr | 9 + src/test/ui/issue-17431-1.rs | 16 ++ src/test/ui/issue-17431-1.stderr | 13 ++ src/test/ui/issue-17431-2.rs | 19 ++ src/test/ui/issue-17431-2.stderr | 23 ++ src/test/ui/issue-17431-3.rs | 18 ++ src/test/ui/issue-17431-3.stderr | 13 ++ src/test/ui/issue-17431-4.rs | 18 ++ src/test/ui/issue-17431-4.stderr | 13 ++ src/test/ui/issue-17431-5.rs | 21 ++ src/test/ui/issue-17431-5.stderr | 13 ++ src/test/ui/issue-17431-6.rs | 18 ++ src/test/ui/issue-17431-6.stderr | 13 ++ src/test/ui/issue-17431-7.rs | 16 ++ src/test/ui/issue-17431-7.stderr | 13 ++ src/test/ui/issue-17444.rs | 18 ++ src/test/ui/issue-17444.stderr | 9 + src/test/ui/issue-17458.rs | 16 ++ src/test/ui/issue-17458.stderr | 9 + src/test/ui/issue-17545.nll.stderr | 17 ++ src/test/ui/issue-17545.rs | 20 ++ src/test/ui/issue-17545.stderr | 18 ++ src/test/ui/issue-17546.rs | 50 +++++ src/test/ui/issue-17546.stderr | 55 +++++ src/test/ui/issue-17551.rs | 18 ++ src/test/ui/issue-17551.stderr | 11 + src/test/ui/issue-17651.rs | 17 ++ src/test/ui/issue-17651.stderr | 13 ++ src/test/ui/issue-17718-const-bad-values.rs | 20 ++ src/test/ui/issue-17718-const-bad-values.stderr | 28 +++ src/test/ui/issue-17718-const-borrow.rs | 24 ++ src/test/ui/issue-17718-const-borrow.stderr | 21 ++ src/test/ui/issue-17718-const-naming.rs | 18 ++ src/test/ui/issue-17718-const-naming.stderr | 28 +++ src/test/ui/issue-17718-constants-not-static.rs | 19 ++ .../ui/issue-17718-constants-not-static.stderr | 13 ++ src/test/ui/issue-17718-patterns.rs | 22 ++ src/test/ui/issue-17718-patterns.stderr | 21 ++ src/test/ui/issue-17718-references.rs | 34 +++ src/test/ui/issue-17718-references.stderr | 21 ++ src/test/ui/issue-17718-static-move.rs | 17 ++ src/test/ui/issue-17718-static-move.stderr | 12 + src/test/ui/issue-17718-static-sync.rs | 22 ++ src/test/ui/issue-17718-static-sync.stderr | 12 + src/test/ui/issue-17728.nll.stderr | 25 +++ src/test/ui/issue-17728.rs | 132 +++++++++++ src/test/ui/issue-17728.stderr | 31 +++ src/test/ui/issue-17740.rs | 28 +++ src/test/ui/issue-17740.stderr | 53 +++++ src/test/ui/issue-17758.nll.stderr | 22 ++ src/test/ui/issue-17758.rs | 22 ++ src/test/ui/issue-17758.stderr | 31 +++ src/test/ui/issue-17800.rs | 23 ++ src/test/ui/issue-17800.stderr | 18 ++ src/test/ui/issue-17904-2.rs | 16 ++ src/test/ui/issue-17904-2.stderr | 11 + src/test/ui/issue-17905.rs | 26 +++ src/test/ui/issue-17905.stderr | 9 + src/test/ui/issue-17913.rs | 28 +++ src/test/ui/issue-17913.stderr | 4 + src/test/ui/issue-17933.rs | 19 ++ src/test/ui/issue-17933.stderr | 9 + src/test/ui/issue-17954.ast.nll.stderr | 14 ++ src/test/ui/issue-17954.ast.stderr | 14 ++ src/test/ui/issue-17954.mir.stderr | 14 ++ src/test/ui/issue-17954.rs | 33 +++ src/test/ui/issue-17959.rs | 31 +++ src/test/ui/issue-17959.stderr | 23 ++ src/test/ui/issue-17994.rs | 13 ++ src/test/ui/issue-17994.stderr | 9 + src/test/ui/issue-17999.rs | 20 ++ src/test/ui/issue-17999.stderr | 20 ++ src/test/ui/issue-18058.rs | 14 ++ src/test/ui/issue-18058.stderr | 9 + src/test/ui/issue-18107.rs | 23 ++ src/test/ui/issue-18107.stderr | 13 ++ src/test/ui/issue-18118-2.rs | 17 ++ src/test/ui/issue-18118-2.stderr | 9 + src/test/ui/issue-18118.nll.stderr | 67 ++++++ src/test/ui/issue-18118.rs | 21 ++ src/test/ui/issue-18118.stderr | 67 ++++++ src/test/ui/issue-18119.rs | 22 ++ src/test/ui/issue-18119.stderr | 21 ++ src/test/ui/issue-18159.rs | 13 ++ src/test/ui/issue-18159.stderr | 12 + src/test/ui/issue-18294.rs | 15 ++ src/test/ui/issue-18294.stderr | 9 + src/test/ui/issue-18389.rs | 28 +++ src/test/ui/issue-18389.stderr | 15 ++ src/test/ui/issue-18400.rs | 36 +++ src/test/ui/issue-18400.stderr | 75 +++++++ src/test/ui/issue-18423.rs | 18 ++ src/test/ui/issue-18423.stderr | 9 + src/test/ui/issue-18446.rs | 29 +++ src/test/ui/issue-18446.stderr | 21 ++ src/test/ui/issue-18532.rs | 17 ++ src/test/ui/issue-18532.stderr | 9 + src/test/ui/issue-18566.nll.stderr | 13 ++ src/test/ui/issue-18566.rs | 35 +++ src/test/ui/issue-18566.stderr | 12 + src/test/ui/issue-18611.rs | 19 ++ src/test/ui/issue-18611.stderr | 11 + src/test/ui/issue-1871.rs | 22 ++ src/test/ui/issue-1871.stderr | 9 + src/test/ui/issue-18783.nll.stderr | 33 +++ src/test/ui/issue-18783.rs | 38 ++++ src/test/ui/issue-18783.stderr | 33 +++ src/test/ui/issue-18919.rs | 17 ++ src/test/ui/issue-18919.stderr | 15 ++ src/test/ui/issue-18937.rs | 50 +++++ src/test/ui/issue-18937.stderr | 18 ++ src/test/ui/issue-18959.rs | 30 +++ src/test/ui/issue-18959.stderr | 11 + src/test/ui/issue-1900.rs | 12 + src/test/ui/issue-1900.stderr | 9 + src/test/ui/issue-19086.rs | 23 ++ src/test/ui/issue-19086.stderr | 9 + src/test/ui/issue-19244-1.rs | 16 ++ src/test/ui/issue-19244-1.stderr | 9 + src/test/ui/issue-19244-2.rs | 17 ++ src/test/ui/issue-19244-2.stderr | 11 + src/test/ui/issue-19380.rs | 28 +++ src/test/ui/issue-19380.stderr | 11 + src/test/ui/issue-19482.rs | 23 ++ src/test/ui/issue-19482.stderr | 9 + src/test/ui/issue-19521.rs | 13 ++ src/test/ui/issue-19521.stderr | 9 + src/test/ui/issue-19538.rs | 30 +++ src/test/ui/issue-19538.stderr | 20 ++ src/test/ui/issue-19601.rs | 19 ++ src/test/ui/issue-19601.stderr | 9 + src/test/ui/issue-19660.rs | 25 +++ src/test/ui/issue-19660.stderr | 4 + src/test/ui/issue-19692.rs | 18 ++ src/test/ui/issue-19692.stderr | 12 + src/test/ui/issue-19734.rs | 18 ++ src/test/ui/issue-19734.stderr | 8 + src/test/ui/issue-19883.rs | 26 +++ src/test/ui/issue-19883.stderr | 9 + src/test/ui/issue-19982.rs | 17 ++ src/test/ui/issue-19982.stderr | 9 + src/test/ui/issue-19991.rs | 21 ++ src/test/ui/issue-19991.stderr | 17 ++ src/test/ui/issue-20005.rs | 25 +++ src/test/ui/issue-20005.stderr | 22 ++ src/test/ui/issue-20162.rs | 17 ++ src/test/ui/issue-20162.stderr | 9 + src/test/ui/issue-20225.rs | 35 +++ src/test/ui/issue-20225.stderr | 30 +++ src/test/ui/issue-20261.rs | 17 ++ src/test/ui/issue-20261.stderr | 13 ++ src/test/ui/issue-20313.rs | 17 ++ src/test/ui/issue-20313.stderr | 11 + src/test/ui/issue-20413.rs | 25 +++ src/test/ui/issue-20413.stderr | 94 ++++++++ src/test/ui/issue-20433.rs | 18 ++ src/test/ui/issue-20433.stderr | 13 ++ src/test/ui/issue-20605.rs | 16 ++ src/test/ui/issue-20605.stderr | 13 ++ src/test/ui/issue-20616-1.rs | 46 ++++ src/test/ui/issue-20616-1.stderr | 8 + src/test/ui/issue-20616-2.rs | 46 ++++ src/test/ui/issue-20616-2.stderr | 8 + src/test/ui/issue-20616-3.rs | 46 ++++ src/test/ui/issue-20616-3.stderr | 8 + src/test/ui/issue-20616-4.rs | 47 ++++ src/test/ui/issue-20616-4.stderr | 8 + src/test/ui/issue-20616-5.rs | 47 ++++ src/test/ui/issue-20616-5.stderr | 8 + src/test/ui/issue-20616-6.rs | 47 ++++ src/test/ui/issue-20616-6.stderr | 8 + src/test/ui/issue-20616-7.rs | 46 ++++ src/test/ui/issue-20616-7.stderr | 8 + src/test/ui/issue-20616-8.rs | 46 ++++ src/test/ui/issue-20616-8.stderr | 8 + src/test/ui/issue-20616-9.rs | 46 ++++ src/test/ui/issue-20616-9.stderr | 8 + src/test/ui/issue-20714.rs | 15 ++ src/test/ui/issue-20714.stderr | 12 + src/test/ui/issue-20772.rs | 16 ++ src/test/ui/issue-20772.stderr | 21 ++ src/test/ui/issue-20801.nll.stderr | 8 + src/test/ui/issue-20801.rs | 47 ++++ src/test/ui/issue-20801.stderr | 27 +++ src/test/ui/issue-20825.rs | 20 ++ src/test/ui/issue-20825.stderr | 11 + src/test/ui/issue-20831-debruijn.rs | 49 ++++ src/test/ui/issue-20831-debruijn.stderr | 35 +++ src/test/ui/issue-20939.rs | 16 ++ src/test/ui/issue-20939.stderr | 9 + src/test/ui/issue-2111.rs | 22 ++ src/test/ui/issue-2111.stderr | 9 + src/test/ui/issue-21160.rs | 21 ++ src/test/ui/issue-21160.stderr | 11 + src/test/ui/issue-21174.rs | 21 ++ src/test/ui/issue-21174.stderr | 12 + src/test/ui/issue-21177.rs | 20 ++ src/test/ui/issue-21177.stderr | 23 ++ src/test/ui/issue-21332.rs | 20 ++ src/test/ui/issue-21332.stderr | 12 + src/test/ui/issue-21356.rs | 16 ++ src/test/ui/issue-21356.stderr | 10 + src/test/ui/issue-21449.rs | 16 ++ src/test/ui/issue-21449.stderr | 9 + src/test/ui/issue-2149.rs | 25 +++ src/test/ui/issue-2149.stderr | 22 ++ src/test/ui/issue-2150.rs | 22 ++ src/test/ui/issue-2150.stderr | 14 ++ src/test/ui/issue-2151.rs | 14 ++ src/test/ui/issue-2151.stderr | 13 ++ src/test/ui/issue-21554.rs | 16 ++ src/test/ui/issue-21554.stderr | 9 + src/test/ui/issue-21701.rs | 25 +++ src/test/ui/issue-21701.stderr | 20 ++ src/test/ui/issue-21763.rs | 21 ++ src/test/ui/issue-21763.stderr | 20 ++ src/test/ui/issue-21837.rs | 20 ++ src/test/ui/issue-21837.stderr | 16 ++ src/test/ui/issue-21946.rs | 22 ++ src/test/ui/issue-21946.stderr | 9 + src/test/ui/issue-21974.rs | 28 +++ src/test/ui/issue-21974.stderr | 21 ++ src/test/ui/issue-22034.rs | 21 ++ src/test/ui/issue-22034.stderr | 11 + src/test/ui/issue-22037.rs | 27 +++ src/test/ui/issue-22037.stderr | 9 + src/test/ui/issue-22289.rs | 13 ++ src/test/ui/issue-22289.stderr | 11 + src/test/ui/issue-22312.rs | 27 +++ src/test/ui/issue-22312.stderr | 11 + src/test/ui/issue-22384.rs | 18 ++ src/test/ui/issue-22384.stderr | 9 + src/test/ui/issue-22434.rs | 18 ++ src/test/ui/issue-22434.stderr | 9 + src/test/ui/issue-22468.rs | 19 ++ src/test/ui/issue-22468.stderr | 11 + src/test/ui/issue-22599.rs | 20 ++ src/test/ui/issue-22599.stderr | 14 ++ src/test/ui/issue-22603.rs | 23 ++ src/test/ui/issue-22603.stderr | 10 + src/test/ui/issue-22673.rs | 16 ++ src/test/ui/issue-22673.stderr | 11 + src/test/ui/issue-22684.rs | 28 +++ src/test/ui/issue-22684.stderr | 12 + src/test/ui/issue-22706.rs | 13 ++ src/test/ui/issue-22706.stderr | 9 + src/test/ui/issue-22789.rs | 17 ++ src/test/ui/issue-22789.stderr | 11 + src/test/ui/issue-2281-part1.rs | 11 + src/test/ui/issue-2281-part1.stderr | 9 + src/test/ui/issue-22874.rs | 20 ++ src/test/ui/issue-22874.stderr | 13 ++ src/test/ui/issue-22933-1.rs | 35 +++ src/test/ui/issue-22933-1.stderr | 8 + src/test/ui/issue-22933-3.rs | 14 ++ src/test/ui/issue-22933-3.stderr | 9 + src/test/ui/issue-23024.rs | 23 ++ src/test/ui/issue-23024.stderr | 24 ++ src/test/ui/issue-23046.rs | 30 +++ src/test/ui/issue-23046.stderr | 9 + src/test/ui/issue-23073.rs | 19 ++ src/test/ui/issue-23073.stderr | 11 + src/test/ui/issue-23080-2.rs | 27 +++ src/test/ui/issue-23080-2.stderr | 18 ++ src/test/ui/issue-23080.rs | 29 +++ src/test/ui/issue-23080.stderr | 14 ++ src/test/ui/issue-23122-1.rs | 22 ++ src/test/ui/issue-23122-1.stderr | 9 + src/test/ui/issue-23122-2.rs | 22 ++ src/test/ui/issue-23122-2.stderr | 11 + src/test/ui/issue-23253.rs | 16 ++ src/test/ui/issue-23253.stderr | 9 + src/test/ui/issue-23281.rs | 20 ++ src/test/ui/issue-23281.stderr | 13 ++ src/test/ui/issue-2330.rs | 23 ++ src/test/ui/issue-2330.stderr | 9 + src/test/ui/issue-23589.rs | 14 ++ src/test/ui/issue-23589.stderr | 9 + src/test/ui/issue-23595-1.rs | 26 +++ src/test/ui/issue-23595-1.stderr | 21 ++ src/test/ui/issue-23595-2.rs | 20 ++ src/test/ui/issue-23595-2.stderr | 9 + src/test/ui/issue-23966.rs | 14 ++ src/test/ui/issue-23966.stderr | 9 + src/test/ui/issue-24013.rs | 17 ++ src/test/ui/issue-24013.stderr | 9 + src/test/ui/issue-24204.rs | 27 +++ src/test/ui/issue-24204.stderr | 17 ++ src/test/ui/issue-24267-flow-exit.nll.stderr | 15 ++ src/test/ui/issue-24267-flow-exit.rs | 29 +++ src/test/ui/issue-24267-flow-exit.stderr | 15 ++ src/test/ui/issue-24322.rs | 19 ++ src/test/ui/issue-24322.stderr | 12 + src/test/ui/issue-24352.rs | 14 ++ src/test/ui/issue-24352.stderr | 11 + src/test/ui/issue-24357.nll.stderr | 14 ++ src/test/ui/issue-24357.rs | 20 ++ src/test/ui/issue-24357.stderr | 14 ++ src/test/ui/issue-24363.rs | 16 ++ src/test/ui/issue-24363.stderr | 18 ++ src/test/ui/issue-24365.rs | 29 +++ src/test/ui/issue-24365.stderr | 21 ++ src/test/ui/issue-24446.rs | 17 ++ src/test/ui/issue-24446.stderr | 33 +++ src/test/ui/issue-24682.rs | 31 +++ src/test/ui/issue-24682.stderr | 22 ++ src/test/ui/issue-24819.rs | 21 ++ src/test/ui/issue-24819.stderr | 12 + src/test/ui/issue-24883.rs | 28 +++ src/test/ui/issue-24883.stderr | 11 + src/test/ui/issue-25076.rs | 21 ++ src/test/ui/issue-25076.stderr | 15 ++ src/test/ui/issue-25368.rs | 23 ++ src/test/ui/issue-25368.stderr | 12 + src/test/ui/issue-25386.rs | 38 ++++ src/test/ui/issue-25386.stderr | 21 ++ src/test/ui/issue-25396.rs | 37 +++ src/test/ui/issue-25396.stderr | 59 +++++ src/test/ui/issue-25439.rs | 19 ++ src/test/ui/issue-25439.stderr | 13 ++ src/test/ui/issue-25579.ast.nll.stderr | 9 + src/test/ui/issue-25579.ast.stderr | 21 ++ src/test/ui/issue-25579.mir.stderr | 9 + src/test/ui/issue-25579.rs | 32 +++ src/test/ui/issue-25700.rs | 24 ++ src/test/ui/issue-25700.stderr | 13 ++ src/test/ui/issue-2590.nll.stderr | 9 + src/test/ui/issue-2590.rs | 26 +++ src/test/ui/issue-2590.stderr | 9 + src/test/ui/issue-25901.rs | 24 ++ src/test/ui/issue-25901.stderr | 9 + src/test/ui/issue-26094.rs | 23 ++ src/test/ui/issue-26094.stderr | 15 ++ src/test/ui/issue-26158.rs | 16 ++ src/test/ui/issue-26158.stderr | 9 + src/test/ui/issue-26217.nll.stderr | 15 ++ src/test/ui/issue-26217.rs | 16 ++ src/test/ui/issue-26217.stderr | 11 + src/test/ui/issue-26237.rs | 23 ++ src/test/ui/issue-26237.stderr | 15 ++ src/test/ui/issue-26262.rs | 32 +++ src/test/ui/issue-26262.stderr | 15 ++ src/test/ui/issue-26459.rs | 16 ++ src/test/ui/issue-26459.stderr | 9 + src/test/ui/issue-26548.rs | 22 ++ src/test/ui/issue-26548.stderr | 9 + src/test/ui/issue-26614.rs | 27 +++ src/test/ui/issue-26614.stderr | 11 + src/test/ui/issue-26812.rs | 16 ++ src/test/ui/issue-26812.stderr | 9 + src/test/ui/issue-26905.rs | 34 +++ src/test/ui/issue-26905.stderr | 12 + src/test/ui/issue-26930.rs | 20 ++ src/test/ui/issue-26930.stderr | 8 + src/test/ui/issue-26948.rs | 16 ++ src/test/ui/issue-26948.stderr | 9 + src/test/ui/issue-27008.rs | 19 ++ src/test/ui/issue-27008.stderr | 12 + src/test/ui/issue-27033.rs | 22 ++ src/test/ui/issue-27033.stderr | 18 ++ src/test/ui/issue-27042.rs | 26 +++ src/test/ui/issue-27042.stderr | 42 ++++ src/test/ui/issue-27060-2.rs | 16 ++ src/test/ui/issue-27060-2.stderr | 14 ++ src/test/ui/issue-27078.rs | 21 ++ src/test/ui/issue-27078.stderr | 14 ++ src/test/ui/issue-2718-a.rs | 22 ++ src/test/ui/issue-2718-a.stderr | 14 ++ src/test/ui/issue-27340.rs | 16 ++ src/test/ui/issue-27340.stderr | 12 + src/test/ui/issue-27433.rs | 15 ++ src/test/ui/issue-27433.stderr | 11 + src/test/ui/issue-27592.nll.stderr | 19 ++ src/test/ui/issue-27592.rs | 29 +++ src/test/ui/issue-27592.stderr | 21 ++ src/test/ui/issue-27815.rs | 22 ++ src/test/ui/issue-27815.stderr | 27 +++ src/test/ui/issue-27895.rs | 20 ++ src/test/ui/issue-27895.stderr | 9 + src/test/ui/issue-28098.rs | 35 +++ src/test/ui/issue-28098.stderr | 57 +++++ src/test/ui/issue-28105.rs | 18 ++ src/test/ui/issue-28105.stderr | 15 ++ src/test/ui/issue-28109.rs | 22 ++ src/test/ui/issue-28109.stderr | 15 ++ src/test/ui/issue-28113.rs | 18 ++ src/test/ui/issue-28113.stderr | 9 + src/test/ui/issue-2823.rs | 24 ++ src/test/ui/issue-2823.stderr | 16 ++ src/test/ui/issue-28324.rs | 21 ++ src/test/ui/issue-28324.stderr | 9 + src/test/ui/issue-28344.rs | 21 ++ src/test/ui/issue-28344.stderr | 32 +++ src/test/ui/issue-28433.rs | 23 ++ src/test/ui/issue-28433.stderr | 14 ++ src/test/ui/issue-28472.rs | 24 ++ src/test/ui/issue-28472.stderr | 27 +++ src/test/ui/issue-2849.rs | 18 ++ src/test/ui/issue-2849.stderr | 11 + src/test/ui/issue-28576.rs | 22 ++ src/test/ui/issue-28576.stderr | 12 + src/test/ui/issue-28586.rs | 17 ++ src/test/ui/issue-28586.stderr | 9 + src/test/ui/issue-28625.rs | 30 +++ src/test/ui/issue-28625.stderr | 12 + src/test/ui/issue-28992-empty.rs | 26 +++ src/test/ui/issue-28992-empty.stderr | 16 ++ src/test/ui/issue-29084.rs | 25 +++ src/test/ui/issue-29084.stderr | 15 ++ src/test/ui/issue-29147.rs | 32 +++ src/test/ui/issue-29147.stderr | 15 ++ src/test/ui/issue-29161.rs | 25 +++ src/test/ui/issue-29161.stderr | 16 ++ src/test/ui/issue-29184.rs | 13 ++ src/test/ui/issue-29184.stderr | 9 + src/test/ui/issue-2937.rs | 16 ++ src/test/ui/issue-2937.stderr | 9 + src/test/ui/issue-2951.rs | 21 ++ src/test/ui/issue-2951.stderr | 12 + src/test/ui/issue-29857.rs | 31 +++ src/test/ui/issue-29857.stderr | 8 + src/test/ui/issue-29861.rs | 30 +++ src/test/ui/issue-29861.stderr | 9 + src/test/ui/issue-2995.rs | 15 ++ src/test/ui/issue-2995.stderr | 11 + src/test/ui/issue-30079.rs | 49 ++++ src/test/ui/issue-30079.stderr | 31 +++ src/test/ui/issue-3008-3.rs | 20 ++ src/test/ui/issue-3008-3.stderr | 13 ++ src/test/ui/issue-3021-b.rs | 24 ++ src/test/ui/issue-3021-b.stderr | 11 + src/test/ui/issue-3021-c.rs | 19 ++ src/test/ui/issue-3021-c.stderr | 25 +++ src/test/ui/issue-3021-d.rs | 38 ++++ src/test/ui/issue-3021-d.stderr | 19 ++ src/test/ui/issue-3021.rs | 28 +++ src/test/ui/issue-3021.stderr | 11 + src/test/ui/issue-30225.rs | 48 ++++ src/test/ui/issue-30225.stderr | 12 + src/test/ui/issue-30236.rs | 18 ++ src/test/ui/issue-30236.stderr | 9 + src/test/ui/issue-30240-b.rs | 26 +++ src/test/ui/issue-30240-b.stderr | 14 ++ src/test/ui/issue-30240.rs | 20 ++ src/test/ui/issue-30240.stderr | 15 ++ src/test/ui/issue-30355.nll.stderr | 22 ++ src/test/ui/issue-30355.rs | 21 ++ src/test/ui/issue-30355.stderr | 22 ++ src/test/ui/issue-3038.rs | 36 +++ src/test/ui/issue-3038.stderr | 21 ++ src/test/ui/issue-30438-a.nll.stderr | 20 ++ src/test/ui/issue-30438-a.rs | 33 +++ src/test/ui/issue-30438-a.stderr | 21 ++ src/test/ui/issue-30438-b.rs | 34 +++ src/test/ui/issue-30438-b.stderr | 21 ++ src/test/ui/issue-30438-c.nll.stderr | 18 ++ src/test/ui/issue-30438-c.rs | 30 +++ src/test/ui/issue-30438-c.stderr | 18 ++ src/test/ui/issue-30560.rs | 22 ++ src/test/ui/issue-30560.stderr | 21 ++ src/test/ui/issue-30589.rs | 19 ++ src/test/ui/issue-30589.stderr | 9 + src/test/ui/issue-3080.rs | 18 ++ src/test/ui/issue-3080.stderr | 11 + src/test/ui/issue-3096-1.rs | 13 ++ src/test/ui/issue-3096-1.stderr | 15 ++ src/test/ui/issue-3096-2.rs | 16 ++ src/test/ui/issue-3096-2.stderr | 15 ++ src/test/ui/issue-3099-a.rs | 15 ++ src/test/ui/issue-3099-a.stderr | 14 ++ src/test/ui/issue-3099-b.rs | 15 ++ src/test/ui/issue-3099-b.stderr | 14 ++ src/test/ui/issue-3099.rs | 21 ++ src/test/ui/issue-3099.stderr | 14 ++ src/test/ui/issue-31011.rs | 39 ++++ src/test/ui/issue-31011.stderr | 12 + src/test/ui/issue-31109.rs | 16 ++ src/test/ui/issue-31109.stderr | 8 + src/test/ui/issue-31173.rs | 27 +++ src/test/ui/issue-31173.stderr | 23 ++ src/test/ui/issue-31212.rs | 20 ++ src/test/ui/issue-31212.stderr | 16 ++ src/test/ui/issue-31495.rs | 13 ++ src/test/ui/issue-31511.rs | 16 ++ src/test/ui/issue-31511.stderr | 9 + src/test/ui/issue-3154.nll.stderr | 23 ++ src/test/ui/issue-3154.rs | 21 ++ src/test/ui/issue-3154.stderr | 11 + src/test/ui/issue-31561.rs | 20 ++ src/test/ui/issue-31561.stderr | 9 + src/test/ui/issue-31769.rs | 14 ++ src/test/ui/issue-31769.stderr | 16 ++ src/test/ui/issue-31804.rs | 16 ++ src/test/ui/issue-31804.stderr | 8 + src/test/ui/issue-31845.rs | 22 ++ src/test/ui/issue-31845.stderr | 9 + src/test/ui/issue-31910.rs | 22 ++ src/test/ui/issue-31910.stderr | 9 + src/test/ui/issue-31924-non-snake-ffi.rs | 18 ++ src/test/ui/issue-31924-non-snake-ffi.stderr | 8 + src/test/ui/issue-32004.rs | 29 +++ src/test/ui/issue-32004.stderr | 17 ++ src/test/ui/issue-32086.rs | 17 ++ src/test/ui/issue-32086.stderr | 15 ++ src/test/ui/issue-32119.rs | 29 +++ src/test/ui/issue-32119.stderr | 8 + src/test/ui/issue-3214.rs | 21 ++ src/test/ui/issue-3214.stderr | 21 ++ src/test/ui/issue-32201.rs | 23 ++ src/test/ui/issue-32201.stderr | 9 + src/test/ui/issue-32222.rs | 34 +++ src/test/ui/issue-32222.stderr | 8 + src/test/ui/issue-32323.rs | 18 ++ src/test/ui/issue-32323.stderr | 12 + src/test/ui/issue-32377.rs | 27 +++ src/test/ui/issue-32377.stderr | 12 + src/test/ui/issue-32655.rs | 32 +++ src/test/ui/issue-32655.stderr | 22 ++ src/test/ui/issue-32709.rs | 18 ++ src/test/ui/issue-32709.stderr | 11 + src/test/ui/issue-32782.rs | 23 ++ src/test/ui/issue-32782.stderr | 14 ++ src/test/ui/issue-32797.rs | 24 ++ src/test/ui/issue-32797.stderr | 8 + src/test/ui/issue-32829.rs | 17 ++ src/test/ui/issue-32829.stderr | 11 + src/test/ui/issue-32833.rs | 17 ++ src/test/ui/issue-32833.stderr | 9 + src/test/ui/issue-32922.rs | 41 ++++ src/test/ui/issue-32922.stderr | 14 ++ src/test/ui/issue-32963.rs | 21 ++ src/test/ui/issue-32963.stderr | 22 ++ src/test/ui/issue-32995-2.rs | 28 +++ src/test/ui/issue-32995-2.stderr | 30 +++ src/test/ui/issue-32995.rs | 43 ++++ src/test/ui/issue-32995.stderr | 66 ++++++ src/test/ui/issue-33241.rs | 23 ++ src/test/ui/issue-33241.stderr | 11 + src/test/ui/issue-33293.rs | 16 ++ src/test/ui/issue-33293.stderr | 9 + src/test/ui/issue-3344.rs | 17 ++ src/test/ui/issue-3344.stderr | 11 + src/test/ui/issue-33464.rs | 20 ++ src/test/ui/issue-33464.stderr | 21 ++ src/test/ui/issue-33504.rs | 19 ++ src/test/ui/issue-33504.stderr | 12 + src/test/ui/issue-33571.rs | 14 ++ src/test/ui/issue-33571.stderr | 8 + src/test/ui/issue-33819.nll.stderr | 12 + src/test/ui/issue-33819.rs | 18 ++ src/test/ui/issue-33819.stderr | 9 + src/test/ui/issue-34028.rs | 21 ++ src/test/ui/issue-34028.stderr | 8 + src/test/ui/issue-34171.rs | 21 ++ src/test/ui/issue-34171.stderr | 10 + src/test/ui/issue-34222-1.rs | 13 ++ src/test/ui/issue-34222-1.stderr | 11 + src/test/ui/issue-34334.rs | 14 ++ src/test/ui/issue-34334.stderr | 10 + src/test/ui/issue-34349.rs | 32 +++ src/test/ui/issue-34349.stderr | 14 ++ src/test/ui/issue-34373.rs | 21 ++ src/test/ui/issue-34373.stderr | 16 ++ src/test/ui/issue-34418.rs | 31 +++ src/test/ui/issue-34418.stderr | 8 + src/test/ui/issue-3477.rs | 15 ++ src/test/ui/issue-3477.stderr | 9 + src/test/ui/issue-34839.rs | 31 +++ src/test/ui/issue-34839.stderr | 8 + src/test/ui/issue-35075.rs | 19 ++ src/test/ui/issue-35075.stderr | 21 ++ src/test/ui/issue-3521-2.rs | 18 ++ src/test/ui/issue-3521-2.stderr | 11 + src/test/ui/issue-3521.rs | 21 ++ src/test/ui/issue-3521.stderr | 9 + src/test/ui/issue-35450.rs | 15 ++ src/test/ui/issue-35450.stderr | 8 + src/test/ui/issue-35570.rs | 40 ++++ src/test/ui/issue-35570.stderr | 10 + src/test/ui/issue-35668.rs | 22 ++ src/test/ui/issue-35668.stderr | 11 + src/test/ui/issue-35988.rs | 16 ++ src/test/ui/issue-35988.stderr | 13 ++ src/test/ui/issue-3601.rs | 44 ++++ src/test/ui/issue-3601.stderr | 9 + src/test/ui/issue-36082.ast.nll.stderr | 14 ++ src/test/ui/issue-36082.ast.stderr | 16 ++ src/test/ui/issue-36082.mir.stderr | 14 ++ src/test/ui/issue-36082.rs | 34 +++ src/test/ui/issue-36116.rs | 37 +++ src/test/ui/issue-36116.stderr | 20 ++ src/test/ui/issue-36299.rs | 15 ++ src/test/ui/issue-36299.stderr | 19 ++ src/test/ui/issue-36379.rs | 16 ++ src/test/ui/issue-36379.stderr | 8 + src/test/ui/issue-36617.rs | 11 + src/test/ui/issue-36617.stderr | 8 + src/test/ui/issue-36638.rs | 19 ++ src/test/ui/issue-36638.stderr | 14 ++ src/test/ui/issue-3668-2.rs | 16 ++ src/test/ui/issue-3668-2.stderr | 11 + src/test/ui/issue-3668.rs | 24 ++ src/test/ui/issue-3668.stderr | 11 + src/test/ui/issue-3680.rs | 19 ++ src/test/ui/issue-3680.stderr | 12 + src/test/ui/issue-36839.rs | 32 +++ src/test/ui/issue-36839.stderr | 10 + src/test/ui/issue-3702-2.rs | 30 +++ src/test/ui/issue-3702-2.stderr | 20 ++ src/test/ui/issue-37026.rs | 18 ++ src/test/ui/issue-37026.stderr | 21 ++ src/test/ui/issue-37051.rs | 29 +++ src/test/ui/issue-37051.stderr | 9 + src/test/ui/issue-3707.rs | 28 +++ src/test/ui/issue-3707.stderr | 19 ++ src/test/ui/issue-37323.rs | 28 +++ src/test/ui/issue-37323.stderr | 20 ++ src/test/ui/issue-37366.rs | 26 +++ src/test/ui/issue-37366.stderr | 9 + src/test/ui/issue-37510.rs | 25 +++ src/test/ui/issue-37510.stderr | 14 ++ src/test/ui/issue-37515.rs | 19 ++ src/test/ui/issue-37515.stderr | 22 ++ src/test/ui/issue-37534.rs | 16 ++ src/test/ui/issue-37534.stderr | 28 +++ src/test/ui/issue-37550.rs | 22 ++ src/test/ui/issue-37550.stderr | 35 +++ src/test/ui/issue-37576.rs | 55 +++++ src/test/ui/issue-37576.stderr | 51 +++++ src/test/ui/issue-3763.rs | 36 +++ src/test/ui/issue-3763.stderr | 34 +++ src/test/ui/issue-37665.rs | 21 ++ src/test/ui/issue-37665.stderr | 12 + src/test/ui/issue-37887.rs | 14 ++ src/test/ui/issue-37887.stderr | 18 ++ src/test/ui/issue-38160.rs | 31 +++ src/test/ui/issue-38160.stderr | 8 + src/test/ui/issue-3820.rs | 25 +++ src/test/ui/issue-3820.stderr | 11 + src/test/ui/issue-38293.rs | 26 +++ src/test/ui/issue-38293.stderr | 20 ++ src/test/ui/issue-38381.rs | 18 ++ src/test/ui/issue-38381.stderr | 10 + src/test/ui/issue-38404.rs | 16 ++ src/test/ui/issue-38404.stderr | 11 + src/test/ui/issue-38412.rs | 20 ++ src/test/ui/issue-38412.stderr | 9 + src/test/ui/issue-38458.rs | 15 ++ src/test/ui/issue-38458.stderr | 9 + src/test/ui/issue-38604.rs | 26 +++ src/test/ui/issue-38604.stderr | 20 ++ src/test/ui/issue-38857.rs | 15 ++ src/test/ui/issue-38857.stderr | 16 ++ src/test/ui/issue-38868.rs | 23 ++ src/test/ui/issue-38868.stderr | 21 ++ src/test/ui/issue-38919.rs | 15 ++ src/test/ui/issue-38919.stderr | 9 + src/test/ui/issue-38954.rs | 14 ++ src/test/ui/issue-38954.stderr | 12 + src/test/ui/issue-39211.rs | 24 ++ src/test/ui/issue-39211.stderr | 9 + src/test/ui/issue-39362.rs | 28 +++ src/test/ui/issue-39362.stderr | 9 + src/test/ui/issue-39388.rs | 19 ++ src/test/ui/issue-39388.stderr | 8 + src/test/ui/issue-39404.rs | 17 ++ src/test/ui/issue-39404.stderr | 12 + src/test/ui/issue-39559-2.rs | 30 +++ src/test/ui/issue-39559-2.stderr | 30 +++ src/test/ui/issue-39559.rs | 29 +++ src/test/ui/issue-39559.stderr | 13 ++ src/test/ui/issue-39616.rs | 15 ++ src/test/ui/issue-39616.stderr | 14 ++ src/test/ui/issue-39687.rs | 16 ++ src/test/ui/issue-39687.stderr | 9 + src/test/ui/issue-3973.rs | 35 +++ src/test/ui/issue-3973.stderr | 22 ++ src/test/ui/issue-39848.rs | 20 ++ src/test/ui/issue-39848.stderr | 13 ++ src/test/ui/issue-3993.rs | 20 ++ src/test/ui/issue-3993.stderr | 9 + src/test/ui/issue-39970.rs | 31 +++ src/test/ui/issue-39970.stderr | 18 ++ src/test/ui/issue-39974.rs | 21 ++ src/test/ui/issue-39974.stderr | 9 + src/test/ui/issue-40000.rs | 18 ++ src/test/ui/issue-40000.stderr | 12 + src/test/ui/issue-40288-2.nll.stderr | 55 +++++ src/test/ui/issue-40288-2.rs | 41 ++++ src/test/ui/issue-40288-2.stderr | 21 ++ src/test/ui/issue-40288.nll.stderr | 15 ++ src/test/ui/issue-40288.rs | 30 +++ src/test/ui/issue-40288.stderr | 12 + src/test/ui/issue-40350.rs | 24 ++ src/test/ui/issue-40350.stderr | 8 + src/test/ui/issue-40510-1.nll.stderr | 17 ++ src/test/ui/issue-40510-1.rs | 23 ++ src/test/ui/issue-40510-1.stderr | 8 + src/test/ui/issue-40510-2.rs | 23 ++ src/test/ui/issue-40510-2.stderr | 8 + src/test/ui/issue-40510-3.nll.stderr | 20 ++ src/test/ui/issue-40510-3.rs | 25 +++ src/test/ui/issue-40510-3.stderr | 8 + src/test/ui/issue-40510-4.rs | 25 +++ src/test/ui/issue-40510-4.stderr | 8 + src/test/ui/issue-40610.rs | 16 ++ src/test/ui/issue-40610.stderr | 11 + src/test/ui/issue-40749.rs | 16 ++ src/test/ui/issue-40749.stderr | 12 + src/test/ui/issue-40845.rs | 16 ++ src/test/ui/issue-40845.stderr | 14 ++ src/test/ui/issue-40861.rs | 16 ++ src/test/ui/issue-40861.stderr | 11 + src/test/ui/issue-41139.nll.stderr | 9 + src/test/ui/issue-41139.rs | 18 ++ src/test/ui/issue-41139.stderr | 9 + src/test/ui/issue-41229-ref-str.rs | 14 ++ src/test/ui/issue-41229-ref-str.stderr | 12 + src/test/ui/issue-41255.rs | 50 +++++ src/test/ui/issue-41255.stderr | 88 ++++++++ src/test/ui/issue-41394.rs | 20 ++ src/test/ui/issue-41394.stderr | 11 + src/test/ui/issue-41726.nll.stderr | 9 + src/test/ui/issue-41726.rs | 17 ++ src/test/ui/issue-41726.stderr | 9 + src/test/ui/issue-41742.rs | 35 +++ src/test/ui/issue-41742.stderr | 12 + src/test/ui/issue-41776.rs | 13 ++ src/test/ui/issue-41776.stderr | 8 + src/test/ui/issue-41880.rs | 39 ++++ src/test/ui/issue-41880.stderr | 12 + src/test/ui/issue-41974.rs | 24 ++ src/test/ui/issue-41974.stderr | 29 +++ src/test/ui/issue-41998.rs | 20 ++ src/test/ui/issue-41998.stderr | 14 ++ src/test/ui/issue-4201.rs | 21 ++ src/test/ui/issue-4201.stderr | 19 ++ src/test/ui/issue-42312.rs | 21 ++ src/test/ui/issue-42312.stderr | 22 ++ src/test/ui/issue-42344.nll.stderr | 9 + src/test/ui/issue-42344.rs | 17 ++ src/test/ui/issue-42344.stderr | 9 + src/test/ui/issue-4265.rs | 24 ++ src/test/ui/issue-4265.stderr | 15 ++ src/test/ui/issue-42755.rs | 17 ++ src/test/ui/issue-42755.stderr | 13 ++ src/test/ui/issue-42796.nll.stderr | 14 ++ src/test/ui/issue-42796.rs | 29 +++ src/test/ui/issue-42796.stderr | 14 ++ src/test/ui/issue-42880.rs | 18 ++ src/test/ui/issue-42880.stderr | 9 + src/test/ui/issue-43023.rs | 28 +++ src/test/ui/issue-43023.stderr | 20 ++ src/test/ui/issue-43105.rs | 22 ++ src/test/ui/issue-43105.stderr | 19 ++ src/test/ui/issue-43162.rs | 18 ++ src/test/ui/issue-43162.stderr | 30 +++ src/test/ui/issue-4321.rs | 18 ++ src/test/ui/issue-4321.stderr | 9 + src/test/ui/issue-43250.rs | 23 ++ src/test/ui/issue-43250.stderr | 14 ++ src/test/ui/issue-43355.rs | 30 +++ src/test/ui/issue-43355.stderr | 16 ++ src/test/ui/issue-43424.rs | 22 ++ src/test/ui/issue-43424.stderr | 8 + src/test/ui/issue-43431.rs | 24 ++ src/test/ui/issue-43431.stderr | 9 + src/test/ui/issue-4366-2.rs | 36 +++ src/test/ui/issue-4366-2.stderr | 26 +++ src/test/ui/issue-4366.rs | 36 +++ src/test/ui/issue-4366.stderr | 15 ++ src/test/ui/issue-43733-2.rs | 39 ++++ src/test/ui/issue-43733-2.stderr | 23 ++ src/test/ui/issue-43733.rs | 43 ++++ src/test/ui/issue-43733.stderr | 19 ++ src/test/ui/issue-43784-associated-type.rs | 25 +++ src/test/ui/issue-43784-associated-type.stderr | 16 ++ src/test/ui/issue-43784-supertrait.rs | 18 ++ src/test/ui/issue-43784-supertrait.stderr | 16 ++ src/test/ui/issue-43925.rs | 16 ++ src/test/ui/issue-43925.stderr | 8 + src/test/ui/issue-43926.rs | 14 ++ src/test/ui/issue-43926.stderr | 8 + src/test/ui/issue-43988.rs | 49 ++++ src/test/ui/issue-43988.stderr | 79 +++++++ src/test/ui/issue-44021.rs | 16 ++ src/test/ui/issue-44021.stderr | 8 + src/test/ui/issue-44239.rs | 19 ++ src/test/ui/issue-44239.stderr | 9 + src/test/ui/issue-44373.rs | 16 ++ src/test/ui/issue-44373.stderr | 13 ++ src/test/ui/issue-44415.rs | 23 ++ src/test/ui/issue-44415.stderr | 18 ++ src/test/ui/issue-45087-unreachable-unsafe.rs | 15 ++ src/test/ui/issue-45087-unreachable-unsafe.stderr | 11 + src/test/ui/issue-4517.rs | 20 ++ src/test/ui/issue-4517.stderr | 12 + src/test/ui/issue-45199.ast.nll.stderr | 36 +++ src/test/ui/issue-45199.ast.stderr | 30 +++ src/test/ui/issue-45199.mir.stderr | 36 +++ src/test/ui/issue-45199.rs | 43 ++++ src/test/ui/issue-45729-unsafe-in-generator.rs | 19 ++ src/test/ui/issue-45729-unsafe-in-generator.stderr | 11 + src/test/ui/issue-45801.rs | 35 +++ src/test/ui/issue-45801.stderr | 12 + src/test/ui/issue-45965.rs | 14 ++ src/test/ui/issue-45965.stderr | 9 + src/test/ui/issue-46023.ast.nll.stderr | 9 + src/test/ui/issue-46023.ast.stderr | 12 + src/test/ui/issue-46023.mir.stderr | 9 + src/test/ui/issue-46023.rs | 22 ++ src/test/ui/issue-46036.rs | 23 ++ src/test/ui/issue-46036.stderr | 14 ++ src/test/ui/issue-46311.rs | 14 ++ src/test/ui/issue-46311.stderr | 8 + src/test/ui/issue-46438.rs | 23 ++ src/test/ui/issue-46438.stderr | 8 + src/test/ui/issue-46604.ast.nll.stderr | 16 ++ src/test/ui/issue-46604.ast.stderr | 16 ++ src/test/ui/issue-46604.mir.stderr | 16 ++ src/test/ui/issue-46604.rs | 22 ++ src/test/ui/issue-46771.rs | 14 ++ src/test/ui/issue-46771.stderr | 11 + src/test/ui/issue-46843.rs | 22 ++ src/test/ui/issue-46843.stderr | 16 ++ src/test/ui/issue-47309.rs | 31 +++ src/test/ui/issue-4736.rs | 15 ++ src/test/ui/issue-4736.stderr | 9 + src/test/ui/issue-47412.rs | 31 +++ src/test/ui/issue-47412.stderr | 19 ++ src/test/ui/issue-47715.rs | 38 ++++ src/test/ui/issue-47715.stderr | 27 +++ src/test/ui/issue-48131.rs | 39 ++++ src/test/ui/issue-48131.stderr | 20 ++ src/test/ui/issue-48838.rs | 15 ++ src/test/ui/issue-48838.stderr | 12 + src/test/ui/issue-4968.rs | 20 ++ src/test/ui/issue-4968.stderr | 12 + src/test/ui/issue-4972.rs | 28 +++ src/test/ui/issue-4972.stderr | 9 + src/test/ui/issue-50471.rs | 19 ++ src/test/ui/issue-50600.rs | 15 ++ src/test/ui/issue-50600.stderr | 12 + src/test/ui/issue-5062.rs | 12 + src/test/ui/issue-5062.stderr | 9 + src/test/ui/issue-5067.rs | 64 ++++++ src/test/ui/issue-5067.stderr | 62 ++++++ src/test/ui/issue-50688.rs | 13 ++ src/test/ui/issue-50688.stderr | 12 + src/test/ui/issue-5099.rs | 14 ++ src/test/ui/issue-5099.stderr | 9 + src/test/ui/issue-5100.rs | 67 ++++++ src/test/ui/issue-5100.stderr | 63 ++++++ src/test/ui/issue-5153.rs | 22 ++ src/test/ui/issue-5153.stderr | 13 ++ src/test/ui/issue-5216.rs | 20 ++ src/test/ui/issue-5216.stderr | 21 ++ src/test/ui/issue-52213.nll.stderr | 14 ++ src/test/ui/issue-52213.rs | 24 ++ src/test/ui/issue-52213.stderr | 28 +++ src/test/ui/issue-5358-1.rs | 23 ++ src/test/ui/issue-5358-1.stderr | 12 + src/test/ui/issue-5439.rs | 31 +++ src/test/ui/issue-5439.stderr | 11 + src/test/ui/issue-5883.rs | 23 ++ src/test/ui/issue-5883.stderr | 24 ++ src/test/ui/issue-5927.rs | 18 ++ src/test/ui/issue-5927.stderr | 16 ++ src/test/ui/issue-5997-enum.rs | 20 ++ src/test/ui/issue-5997-enum.stderr | 13 ++ src/test/ui/issue-5997-struct.rs | 20 ++ src/test/ui/issue-5997-struct.stderr | 13 ++ src/test/ui/issue-6458-2.rs | 15 ++ src/test/ui/issue-6458-2.stderr | 9 + src/test/ui/issue-6596-1.rs | 21 ++ src/test/ui/issue-6596-1.stderr | 11 + src/test/ui/issue-6596-2.rs | 23 ++ src/test/ui/issue-6596-2.stderr | 20 ++ src/test/ui/issue-6642.rs | 19 ++ src/test/ui/issue-6642.stderr | 11 + src/test/ui/issue-6738.rs | 20 ++ src/test/ui/issue-6738.stderr | 13 ++ src/test/ui/issue-6801.nll.stderr | 14 ++ src/test/ui/issue-6801.rs | 31 +++ src/test/ui/issue-6801.stderr | 12 + src/test/ui/issue-6804.rs | 31 +++ src/test/ui/issue-6804.stderr | 25 +++ src/test/ui/issue-6936.rs | 44 ++++ src/test/ui/issue-6936.stderr | 43 ++++ src/test/ui/issue-7013.rs | 38 ++++ src/test/ui/issue-7013.stderr | 14 ++ src/test/ui/issue-7044.rs | 14 ++ src/test/ui/issue-7044.stderr | 13 ++ src/test/ui/issue-7061.rs | 20 ++ src/test/ui/issue-7061.stderr | 14 ++ src/test/ui/issue-7092.rs | 25 +++ src/test/ui/issue-7092.stderr | 12 + src/test/ui/issue-7246.rs | 20 ++ src/test/ui/issue-7246.stderr | 14 ++ src/test/ui/issue-7364.rs | 20 ++ src/test/ui/issue-7364.stderr | 21 ++ src/test/ui/issue-7607-1.rs | 19 ++ src/test/ui/issue-7607-1.stderr | 9 + src/test/ui/issue-7867.rs | 24 ++ src/test/ui/issue-7867.stderr | 12 + src/test/ui/issue-7950.rs | 18 ++ src/test/ui/issue-7950.stderr | 12 + src/test/ui/issue-7970a.rs | 18 ++ src/test/ui/issue-7970a.stderr | 8 + src/test/ui/issue-7970b.rs | 14 ++ src/test/ui/issue-7970b.stderr | 8 + src/test/ui/issue-8153.rs | 26 +++ src/test/ui/issue-8153.stderr | 11 + src/test/ui/issue-8208.rs | 27 +++ src/test/ui/issue-8208.stderr | 21 ++ src/test/ui/issue-8460-const.rs | 77 +++++++ src/test/ui/issue-8460-const.stderr | 248 +++++++++++++++++++++ src/test/ui/issue-8640.rs | 20 ++ src/test/ui/issue-8640.stderr | 17 ++ src/test/ui/issue-8727.rs | 25 +++ src/test/ui/issue-8727.stderr | 21 ++ src/test/ui/issue-8761.rs | 20 ++ src/test/ui/issue-8761.stderr | 15 ++ src/test/ui/issue-8767.rs | 15 ++ src/test/ui/issue-8767.stderr | 9 + src/test/ui/issue-9575.rs | 17 ++ src/test/ui/issue-9575.stderr | 12 + src/test/ui/issue-9725.rs | 17 ++ src/test/ui/issue-9725.stderr | 18 ++ src/test/ui/issue-9814.rs | 18 ++ src/test/ui/issue-9814.stderr | 9 + src/test/ui/issue-pr29383.rs | 22 ++ src/test/ui/issue-pr29383.stderr | 15 ++ 1704 files changed, 22672 insertions(+), 13021 deletions(-) delete mode 100644 src/test/compile-fail/issue-10176.rs delete mode 100644 src/test/compile-fail/issue-10200.rs delete mode 100644 src/test/compile-fail/issue-10291.rs delete mode 100644 src/test/compile-fail/issue-10398.rs delete mode 100644 src/test/compile-fail/issue-10401.rs delete mode 100644 src/test/compile-fail/issue-10412.rs delete mode 100644 src/test/compile-fail/issue-10465.rs delete mode 100644 src/test/compile-fail/issue-10536.rs delete mode 100644 src/test/compile-fail/issue-10545.rs delete mode 100644 src/test/compile-fail/issue-10656.rs delete mode 100644 src/test/compile-fail/issue-10755.rs delete mode 100644 src/test/compile-fail/issue-10764.rs delete mode 100644 src/test/compile-fail/issue-10877.rs delete mode 100644 src/test/compile-fail/issue-10991.rs delete mode 100644 src/test/compile-fail/issue-11154.rs delete mode 100644 src/test/compile-fail/issue-11192.rs delete mode 100644 src/test/compile-fail/issue-11374.rs delete mode 100644 src/test/compile-fail/issue-11493.rs delete mode 100644 src/test/compile-fail/issue-11515.rs delete mode 100644 src/test/compile-fail/issue-11681.rs delete mode 100644 src/test/compile-fail/issue-11692-1.rs delete mode 100644 src/test/compile-fail/issue-11692-2.rs delete mode 100644 src/test/compile-fail/issue-11740.rs delete mode 100644 src/test/compile-fail/issue-11771.rs delete mode 100644 src/test/compile-fail/issue-11844.rs delete mode 100644 src/test/compile-fail/issue-11873.rs delete mode 100644 src/test/compile-fail/issue-12028.rs delete mode 100644 src/test/compile-fail/issue-12041.rs delete mode 100644 src/test/compile-fail/issue-12116.rs delete mode 100644 src/test/compile-fail/issue-12127.rs delete mode 100644 src/test/compile-fail/issue-12369.rs delete mode 100644 src/test/compile-fail/issue-12470.rs delete mode 100644 src/test/compile-fail/issue-12552.rs delete mode 100644 src/test/compile-fail/issue-12567.rs delete mode 100644 src/test/compile-fail/issue-12796.rs delete mode 100644 src/test/compile-fail/issue-12863.rs delete mode 100644 src/test/compile-fail/issue-12997-1.rs delete mode 100644 src/test/compile-fail/issue-12997-2.rs delete mode 100644 src/test/compile-fail/issue-13033.rs delete mode 100644 src/test/compile-fail/issue-13352.rs delete mode 100644 src/test/compile-fail/issue-13359.rs delete mode 100644 src/test/compile-fail/issue-13404.rs delete mode 100644 src/test/compile-fail/issue-13407.rs delete mode 100644 src/test/compile-fail/issue-13446.rs delete mode 100644 src/test/compile-fail/issue-13466.rs delete mode 100644 src/test/compile-fail/issue-13482-2.rs delete mode 100644 src/test/compile-fail/issue-13482.rs delete mode 100644 src/test/compile-fail/issue-13497-2.rs delete mode 100644 src/test/compile-fail/issue-13497.rs delete mode 100644 src/test/compile-fail/issue-1362.rs delete mode 100644 src/test/compile-fail/issue-13641.rs delete mode 100644 src/test/compile-fail/issue-13727.rs delete mode 100644 src/test/compile-fail/issue-13847.rs delete mode 100644 src/test/compile-fail/issue-13853-2.rs delete mode 100644 src/test/compile-fail/issue-13853-5.rs delete mode 100644 src/test/compile-fail/issue-13853.rs delete mode 100644 src/test/compile-fail/issue-14091-2.rs delete mode 100644 src/test/compile-fail/issue-14091.rs delete mode 100644 src/test/compile-fail/issue-14221.rs delete mode 100644 src/test/compile-fail/issue-14227.rs delete mode 100644 src/test/compile-fail/issue-14285.rs delete mode 100644 src/test/compile-fail/issue-14309.rs delete mode 100644 src/test/compile-fail/issue-14366.rs delete mode 100644 src/test/compile-fail/issue-1448-2.rs delete mode 100644 src/test/compile-fail/issue-14541.rs delete mode 100644 src/test/compile-fail/issue-14721.rs delete mode 100644 src/test/compile-fail/issue-1476.rs delete mode 100644 src/test/compile-fail/issue-14772.rs delete mode 100644 src/test/compile-fail/issue-14845.rs delete mode 100644 src/test/compile-fail/issue-14853.rs delete mode 100644 src/test/compile-fail/issue-14915.rs delete mode 100644 src/test/compile-fail/issue-15034.rs delete mode 100644 src/test/compile-fail/issue-15094.rs delete mode 100644 src/test/compile-fail/issue-15129.rs delete mode 100644 src/test/compile-fail/issue-15167.rs delete mode 100644 src/test/compile-fail/issue-15207.rs delete mode 100644 src/test/compile-fail/issue-15381.rs delete mode 100644 src/test/compile-fail/issue-15756.rs delete mode 100644 src/test/compile-fail/issue-15783.rs delete mode 100644 src/test/compile-fail/issue-15896.rs delete mode 100644 src/test/compile-fail/issue-15919.rs delete mode 100644 src/test/compile-fail/issue-15965.rs delete mode 100644 src/test/compile-fail/issue-16048.rs delete mode 100644 src/test/compile-fail/issue-16098.rs delete mode 100644 src/test/compile-fail/issue-16149.rs delete mode 100644 src/test/compile-fail/issue-16250.rs delete mode 100644 src/test/compile-fail/issue-16338.rs delete mode 100644 src/test/compile-fail/issue-16401.rs delete mode 100644 src/test/compile-fail/issue-16538.rs delete mode 100644 src/test/compile-fail/issue-16562.rs delete mode 100644 src/test/compile-fail/issue-16683.rs delete mode 100644 src/test/compile-fail/issue-16922.rs delete mode 100644 src/test/compile-fail/issue-16939.rs delete mode 100644 src/test/compile-fail/issue-16966.rs delete mode 100644 src/test/compile-fail/issue-1697.rs delete mode 100644 src/test/compile-fail/issue-16994.rs delete mode 100644 src/test/compile-fail/issue-17001.rs delete mode 100644 src/test/compile-fail/issue-17025.rs delete mode 100644 src/test/compile-fail/issue-17033.rs delete mode 100644 src/test/compile-fail/issue-17252.rs delete mode 100644 src/test/compile-fail/issue-17337.rs delete mode 100644 src/test/compile-fail/issue-17373.rs delete mode 100644 src/test/compile-fail/issue-17385.rs delete mode 100644 src/test/compile-fail/issue-17405.rs delete mode 100644 src/test/compile-fail/issue-17431-1.rs delete mode 100644 src/test/compile-fail/issue-17431-2.rs delete mode 100644 src/test/compile-fail/issue-17431-3.rs delete mode 100644 src/test/compile-fail/issue-17431-4.rs delete mode 100644 src/test/compile-fail/issue-17431-5.rs delete mode 100644 src/test/compile-fail/issue-17431-6.rs delete mode 100644 src/test/compile-fail/issue-17431-7.rs delete mode 100644 src/test/compile-fail/issue-17444.rs delete mode 100644 src/test/compile-fail/issue-17458.rs delete mode 100644 src/test/compile-fail/issue-17545.rs delete mode 100644 src/test/compile-fail/issue-17546.rs delete mode 100644 src/test/compile-fail/issue-17551.rs delete mode 100644 src/test/compile-fail/issue-17651.rs delete mode 100644 src/test/compile-fail/issue-17718-const-bad-values.rs delete mode 100644 src/test/compile-fail/issue-17718-const-borrow.rs delete mode 100644 src/test/compile-fail/issue-17718-const-naming.rs delete mode 100644 src/test/compile-fail/issue-17718-constants-not-static.rs delete mode 100644 src/test/compile-fail/issue-17718-patterns.rs delete mode 100644 src/test/compile-fail/issue-17718-references.rs delete mode 100644 src/test/compile-fail/issue-17718-static-move.rs delete mode 100644 src/test/compile-fail/issue-17718-static-sync.rs delete mode 100644 src/test/compile-fail/issue-17728.rs delete mode 100644 src/test/compile-fail/issue-17740.rs delete mode 100644 src/test/compile-fail/issue-17758.rs delete mode 100644 src/test/compile-fail/issue-17800.rs delete mode 100644 src/test/compile-fail/issue-17904-2.rs delete mode 100644 src/test/compile-fail/issue-17905.rs delete mode 100644 src/test/compile-fail/issue-17913.rs delete mode 100644 src/test/compile-fail/issue-17933.rs delete mode 100644 src/test/compile-fail/issue-17954.rs delete mode 100644 src/test/compile-fail/issue-17959.rs delete mode 100644 src/test/compile-fail/issue-17994.rs delete mode 100644 src/test/compile-fail/issue-17999.rs delete mode 100644 src/test/compile-fail/issue-18058.rs delete mode 100644 src/test/compile-fail/issue-18107.rs delete mode 100644 src/test/compile-fail/issue-18118-2.rs delete mode 100644 src/test/compile-fail/issue-18118.rs delete mode 100644 src/test/compile-fail/issue-18119.rs delete mode 100644 src/test/compile-fail/issue-18159.rs delete mode 100644 src/test/compile-fail/issue-18294.rs delete mode 100644 src/test/compile-fail/issue-18389.rs delete mode 100644 src/test/compile-fail/issue-18400.rs delete mode 100644 src/test/compile-fail/issue-18423.rs delete mode 100644 src/test/compile-fail/issue-18446.rs delete mode 100644 src/test/compile-fail/issue-18532.rs delete mode 100644 src/test/compile-fail/issue-18566.rs delete mode 100644 src/test/compile-fail/issue-18611.rs delete mode 100644 src/test/compile-fail/issue-1871.rs delete mode 100644 src/test/compile-fail/issue-18783.rs delete mode 100644 src/test/compile-fail/issue-18919.rs delete mode 100644 src/test/compile-fail/issue-18937.rs delete mode 100644 src/test/compile-fail/issue-18959.rs delete mode 100644 src/test/compile-fail/issue-1900.rs delete mode 100644 src/test/compile-fail/issue-19086.rs delete mode 100644 src/test/compile-fail/issue-19244-1.rs delete mode 100644 src/test/compile-fail/issue-19244-2.rs delete mode 100644 src/test/compile-fail/issue-19380.rs delete mode 100644 src/test/compile-fail/issue-19482.rs delete mode 100644 src/test/compile-fail/issue-19521.rs delete mode 100644 src/test/compile-fail/issue-19538.rs delete mode 100644 src/test/compile-fail/issue-19601.rs delete mode 100644 src/test/compile-fail/issue-19660.rs delete mode 100644 src/test/compile-fail/issue-19692.rs delete mode 100644 src/test/compile-fail/issue-19734.rs delete mode 100644 src/test/compile-fail/issue-19883.rs delete mode 100644 src/test/compile-fail/issue-19982.rs delete mode 100644 src/test/compile-fail/issue-19991.rs delete mode 100644 src/test/compile-fail/issue-20005.rs delete mode 100644 src/test/compile-fail/issue-20162.rs delete mode 100644 src/test/compile-fail/issue-20225.rs delete mode 100644 src/test/compile-fail/issue-20261.rs delete mode 100644 src/test/compile-fail/issue-20313.rs delete mode 100644 src/test/compile-fail/issue-20413.rs delete mode 100644 src/test/compile-fail/issue-20433.rs delete mode 100644 src/test/compile-fail/issue-20605.rs delete mode 100644 src/test/compile-fail/issue-20616-1.rs delete mode 100644 src/test/compile-fail/issue-20616-2.rs delete mode 100644 src/test/compile-fail/issue-20616-3.rs delete mode 100644 src/test/compile-fail/issue-20616-4.rs delete mode 100644 src/test/compile-fail/issue-20616-5.rs delete mode 100644 src/test/compile-fail/issue-20616-6.rs delete mode 100644 src/test/compile-fail/issue-20616-7.rs delete mode 100644 src/test/compile-fail/issue-20616-8.rs delete mode 100644 src/test/compile-fail/issue-20616-9.rs delete mode 100644 src/test/compile-fail/issue-20714.rs delete mode 100644 src/test/compile-fail/issue-20772.rs delete mode 100644 src/test/compile-fail/issue-20801.rs delete mode 100644 src/test/compile-fail/issue-20825.rs delete mode 100644 src/test/compile-fail/issue-20831-debruijn.rs delete mode 100644 src/test/compile-fail/issue-20939.rs delete mode 100644 src/test/compile-fail/issue-2111.rs delete mode 100644 src/test/compile-fail/issue-21160.rs delete mode 100644 src/test/compile-fail/issue-21174.rs delete mode 100644 src/test/compile-fail/issue-21177.rs delete mode 100644 src/test/compile-fail/issue-21332.rs delete mode 100644 src/test/compile-fail/issue-21356.rs delete mode 100644 src/test/compile-fail/issue-21449.rs delete mode 100644 src/test/compile-fail/issue-2149.rs delete mode 100644 src/test/compile-fail/issue-2150.rs delete mode 100644 src/test/compile-fail/issue-2151.rs delete mode 100644 src/test/compile-fail/issue-21554.rs delete mode 100644 src/test/compile-fail/issue-21701.rs delete mode 100644 src/test/compile-fail/issue-21763.rs delete mode 100644 src/test/compile-fail/issue-21837.rs delete mode 100644 src/test/compile-fail/issue-21946.rs delete mode 100644 src/test/compile-fail/issue-21974.rs delete mode 100644 src/test/compile-fail/issue-22034.rs delete mode 100644 src/test/compile-fail/issue-22037.rs delete mode 100644 src/test/compile-fail/issue-22289.rs delete mode 100644 src/test/compile-fail/issue-22312.rs delete mode 100644 src/test/compile-fail/issue-22384.rs delete mode 100644 src/test/compile-fail/issue-22434.rs delete mode 100644 src/test/compile-fail/issue-22468.rs delete mode 100644 src/test/compile-fail/issue-22599.rs delete mode 100644 src/test/compile-fail/issue-22603.rs delete mode 100644 src/test/compile-fail/issue-22673.rs delete mode 100644 src/test/compile-fail/issue-22684.rs delete mode 100644 src/test/compile-fail/issue-22706.rs delete mode 100644 src/test/compile-fail/issue-22789.rs delete mode 100644 src/test/compile-fail/issue-2281-part1.rs delete mode 100644 src/test/compile-fail/issue-22874.rs delete mode 100644 src/test/compile-fail/issue-22933-1.rs delete mode 100644 src/test/compile-fail/issue-22933-3.rs delete mode 100644 src/test/compile-fail/issue-23024.rs delete mode 100644 src/test/compile-fail/issue-23046.rs delete mode 100644 src/test/compile-fail/issue-23073.rs delete mode 100644 src/test/compile-fail/issue-23080-2.rs delete mode 100644 src/test/compile-fail/issue-23080.rs delete mode 100644 src/test/compile-fail/issue-23122-1.rs delete mode 100644 src/test/compile-fail/issue-23122-2.rs delete mode 100644 src/test/compile-fail/issue-23253.rs delete mode 100644 src/test/compile-fail/issue-23281.rs delete mode 100644 src/test/compile-fail/issue-2330.rs delete mode 100644 src/test/compile-fail/issue-23589.rs delete mode 100644 src/test/compile-fail/issue-23595-1.rs delete mode 100644 src/test/compile-fail/issue-23595-2.rs delete mode 100644 src/test/compile-fail/issue-23966.rs delete mode 100644 src/test/compile-fail/issue-24013.rs delete mode 100644 src/test/compile-fail/issue-24204.rs delete mode 100644 src/test/compile-fail/issue-24267-flow-exit.rs delete mode 100644 src/test/compile-fail/issue-24322.rs delete mode 100644 src/test/compile-fail/issue-24352.rs delete mode 100644 src/test/compile-fail/issue-24357.rs delete mode 100644 src/test/compile-fail/issue-24363.rs delete mode 100644 src/test/compile-fail/issue-24365.rs delete mode 100644 src/test/compile-fail/issue-24446.rs delete mode 100644 src/test/compile-fail/issue-24682.rs delete mode 100644 src/test/compile-fail/issue-24819.rs delete mode 100644 src/test/compile-fail/issue-24883.rs delete mode 100644 src/test/compile-fail/issue-25076.rs delete mode 100644 src/test/compile-fail/issue-25368.rs delete mode 100644 src/test/compile-fail/issue-25386.rs delete mode 100644 src/test/compile-fail/issue-25396.rs delete mode 100644 src/test/compile-fail/issue-25439.rs delete mode 100644 src/test/compile-fail/issue-25579.rs delete mode 100644 src/test/compile-fail/issue-25700.rs delete mode 100644 src/test/compile-fail/issue-2590.rs delete mode 100644 src/test/compile-fail/issue-25901.rs delete mode 100644 src/test/compile-fail/issue-26094.rs delete mode 100644 src/test/compile-fail/issue-26158.rs delete mode 100644 src/test/compile-fail/issue-26217.rs delete mode 100644 src/test/compile-fail/issue-26237.rs delete mode 100644 src/test/compile-fail/issue-26262.rs delete mode 100644 src/test/compile-fail/issue-26459.rs delete mode 100644 src/test/compile-fail/issue-26548.rs delete mode 100644 src/test/compile-fail/issue-26614.rs delete mode 100644 src/test/compile-fail/issue-26812.rs delete mode 100644 src/test/compile-fail/issue-26905.rs delete mode 100644 src/test/compile-fail/issue-26930.rs delete mode 100644 src/test/compile-fail/issue-26948.rs delete mode 100644 src/test/compile-fail/issue-27008.rs delete mode 100644 src/test/compile-fail/issue-27033.rs delete mode 100644 src/test/compile-fail/issue-27042.rs delete mode 100644 src/test/compile-fail/issue-27060-2.rs delete mode 100644 src/test/compile-fail/issue-27078.rs delete mode 100644 src/test/compile-fail/issue-2718-a.rs delete mode 100644 src/test/compile-fail/issue-27340.rs delete mode 100644 src/test/compile-fail/issue-27433.rs delete mode 100644 src/test/compile-fail/issue-27592.rs delete mode 100644 src/test/compile-fail/issue-27815.rs delete mode 100644 src/test/compile-fail/issue-27895.rs delete mode 100644 src/test/compile-fail/issue-28098.rs delete mode 100644 src/test/compile-fail/issue-28105.rs delete mode 100644 src/test/compile-fail/issue-28109.rs delete mode 100644 src/test/compile-fail/issue-28113.rs delete mode 100644 src/test/compile-fail/issue-2823.rs delete mode 100644 src/test/compile-fail/issue-28324.rs delete mode 100644 src/test/compile-fail/issue-28344.rs delete mode 100644 src/test/compile-fail/issue-28433.rs delete mode 100644 src/test/compile-fail/issue-28472.rs delete mode 100644 src/test/compile-fail/issue-2849.rs delete mode 100644 src/test/compile-fail/issue-28576.rs delete mode 100644 src/test/compile-fail/issue-28586.rs delete mode 100644 src/test/compile-fail/issue-28625.rs delete mode 100644 src/test/compile-fail/issue-28992-empty.rs delete mode 100644 src/test/compile-fail/issue-29084.rs delete mode 100644 src/test/compile-fail/issue-29147.rs delete mode 100644 src/test/compile-fail/issue-29161.rs delete mode 100644 src/test/compile-fail/issue-29184.rs delete mode 100644 src/test/compile-fail/issue-2937.rs delete mode 100644 src/test/compile-fail/issue-2951.rs delete mode 100644 src/test/compile-fail/issue-29857.rs delete mode 100644 src/test/compile-fail/issue-29861.rs delete mode 100644 src/test/compile-fail/issue-2995.rs delete mode 100644 src/test/compile-fail/issue-30079.rs delete mode 100644 src/test/compile-fail/issue-3008-3.rs delete mode 100644 src/test/compile-fail/issue-3021-b.rs delete mode 100644 src/test/compile-fail/issue-3021-c.rs delete mode 100644 src/test/compile-fail/issue-3021-d.rs delete mode 100644 src/test/compile-fail/issue-3021.rs delete mode 100644 src/test/compile-fail/issue-30225.rs delete mode 100644 src/test/compile-fail/issue-30236.rs delete mode 100644 src/test/compile-fail/issue-30240-b.rs delete mode 100644 src/test/compile-fail/issue-30240.rs delete mode 100644 src/test/compile-fail/issue-30355.rs delete mode 100644 src/test/compile-fail/issue-3038.rs delete mode 100644 src/test/compile-fail/issue-30438-a.rs delete mode 100644 src/test/compile-fail/issue-30438-b.rs delete mode 100644 src/test/compile-fail/issue-30438-c.rs delete mode 100644 src/test/compile-fail/issue-30560.rs delete mode 100644 src/test/compile-fail/issue-30589.rs delete mode 100644 src/test/compile-fail/issue-3080.rs delete mode 100644 src/test/compile-fail/issue-3096-1.rs delete mode 100644 src/test/compile-fail/issue-3096-2.rs delete mode 100644 src/test/compile-fail/issue-3099-a.rs delete mode 100644 src/test/compile-fail/issue-3099-b.rs delete mode 100644 src/test/compile-fail/issue-3099.rs delete mode 100644 src/test/compile-fail/issue-31011.rs delete mode 100644 src/test/compile-fail/issue-31109.rs delete mode 100644 src/test/compile-fail/issue-31173.rs delete mode 100644 src/test/compile-fail/issue-31212.rs delete mode 100644 src/test/compile-fail/issue-31495.rs delete mode 100644 src/test/compile-fail/issue-31511.rs delete mode 100644 src/test/compile-fail/issue-3154.rs delete mode 100644 src/test/compile-fail/issue-31561.rs delete mode 100644 src/test/compile-fail/issue-31769.rs delete mode 100644 src/test/compile-fail/issue-31804.rs delete mode 100644 src/test/compile-fail/issue-31845.rs delete mode 100644 src/test/compile-fail/issue-31910.rs delete mode 100644 src/test/compile-fail/issue-31924-non-snake-ffi.rs delete mode 100644 src/test/compile-fail/issue-32004.rs delete mode 100644 src/test/compile-fail/issue-32086.rs delete mode 100644 src/test/compile-fail/issue-32119.rs delete mode 100644 src/test/compile-fail/issue-3214.rs delete mode 100644 src/test/compile-fail/issue-32201.rs delete mode 100644 src/test/compile-fail/issue-32222.rs delete mode 100644 src/test/compile-fail/issue-32323.rs delete mode 100644 src/test/compile-fail/issue-32377.rs delete mode 100644 src/test/compile-fail/issue-32655.rs delete mode 100644 src/test/compile-fail/issue-32709.rs delete mode 100644 src/test/compile-fail/issue-32782.rs delete mode 100644 src/test/compile-fail/issue-32797.rs delete mode 100644 src/test/compile-fail/issue-32829.rs delete mode 100644 src/test/compile-fail/issue-32833.rs delete mode 100644 src/test/compile-fail/issue-32922.rs delete mode 100644 src/test/compile-fail/issue-32963.rs delete mode 100644 src/test/compile-fail/issue-32995-2.rs delete mode 100644 src/test/compile-fail/issue-32995.rs delete mode 100644 src/test/compile-fail/issue-33241.rs delete mode 100644 src/test/compile-fail/issue-33293.rs delete mode 100644 src/test/compile-fail/issue-3344.rs delete mode 100644 src/test/compile-fail/issue-33464.rs delete mode 100644 src/test/compile-fail/issue-33504.rs delete mode 100644 src/test/compile-fail/issue-33571.rs delete mode 100644 src/test/compile-fail/issue-33819.rs delete mode 100644 src/test/compile-fail/issue-34028.rs delete mode 100644 src/test/compile-fail/issue-34171.rs delete mode 100644 src/test/compile-fail/issue-34222-1.rs delete mode 100644 src/test/compile-fail/issue-34334.rs delete mode 100644 src/test/compile-fail/issue-34349.rs delete mode 100644 src/test/compile-fail/issue-34373.rs delete mode 100644 src/test/compile-fail/issue-34418.rs delete mode 100644 src/test/compile-fail/issue-3477.rs delete mode 100644 src/test/compile-fail/issue-34839.rs delete mode 100644 src/test/compile-fail/issue-35075.rs delete mode 100644 src/test/compile-fail/issue-3521-2.rs delete mode 100644 src/test/compile-fail/issue-3521.rs delete mode 100644 src/test/compile-fail/issue-35450.rs delete mode 100644 src/test/compile-fail/issue-35570.rs delete mode 100644 src/test/compile-fail/issue-35668.rs delete mode 100644 src/test/compile-fail/issue-35988.rs delete mode 100644 src/test/compile-fail/issue-3601.rs delete mode 100644 src/test/compile-fail/issue-36082.rs delete mode 100644 src/test/compile-fail/issue-36116.rs delete mode 100644 src/test/compile-fail/issue-36299.rs delete mode 100644 src/test/compile-fail/issue-36379.rs delete mode 100644 src/test/compile-fail/issue-36617.rs delete mode 100644 src/test/compile-fail/issue-36638.rs delete mode 100644 src/test/compile-fail/issue-3668-2.rs delete mode 100644 src/test/compile-fail/issue-3668.rs delete mode 100644 src/test/compile-fail/issue-3680.rs delete mode 100644 src/test/compile-fail/issue-36839.rs delete mode 100644 src/test/compile-fail/issue-3702-2.rs delete mode 100644 src/test/compile-fail/issue-37026.rs delete mode 100644 src/test/compile-fail/issue-37051.rs delete mode 100644 src/test/compile-fail/issue-3707.rs delete mode 100644 src/test/compile-fail/issue-37323.rs delete mode 100644 src/test/compile-fail/issue-37366.rs delete mode 100644 src/test/compile-fail/issue-37510.rs delete mode 100644 src/test/compile-fail/issue-37515.rs delete mode 100644 src/test/compile-fail/issue-37534.rs delete mode 100644 src/test/compile-fail/issue-37550.rs delete mode 100644 src/test/compile-fail/issue-37576.rs delete mode 100644 src/test/compile-fail/issue-3763.rs delete mode 100644 src/test/compile-fail/issue-37665.rs delete mode 100644 src/test/compile-fail/issue-37887.rs delete mode 100644 src/test/compile-fail/issue-38160.rs delete mode 100644 src/test/compile-fail/issue-3820.rs delete mode 100644 src/test/compile-fail/issue-38293.rs delete mode 100644 src/test/compile-fail/issue-38381.rs delete mode 100644 src/test/compile-fail/issue-38404.rs delete mode 100644 src/test/compile-fail/issue-38412.rs delete mode 100644 src/test/compile-fail/issue-38458.rs delete mode 100644 src/test/compile-fail/issue-38604.rs delete mode 100644 src/test/compile-fail/issue-38857.rs delete mode 100644 src/test/compile-fail/issue-38868.rs delete mode 100644 src/test/compile-fail/issue-38919.rs delete mode 100644 src/test/compile-fail/issue-38954.rs delete mode 100644 src/test/compile-fail/issue-39211.rs delete mode 100644 src/test/compile-fail/issue-39362.rs delete mode 100644 src/test/compile-fail/issue-39388.rs delete mode 100644 src/test/compile-fail/issue-39404.rs delete mode 100644 src/test/compile-fail/issue-39559-2.rs delete mode 100644 src/test/compile-fail/issue-39559.rs delete mode 100644 src/test/compile-fail/issue-39616.rs delete mode 100644 src/test/compile-fail/issue-39687.rs delete mode 100644 src/test/compile-fail/issue-3973.rs delete mode 100644 src/test/compile-fail/issue-39848.rs delete mode 100644 src/test/compile-fail/issue-3993.rs delete mode 100644 src/test/compile-fail/issue-39970.rs delete mode 100644 src/test/compile-fail/issue-39974.rs delete mode 100644 src/test/compile-fail/issue-40000.rs delete mode 100644 src/test/compile-fail/issue-40288-2.rs delete mode 100644 src/test/compile-fail/issue-40288.rs delete mode 100644 src/test/compile-fail/issue-40350.rs delete mode 100644 src/test/compile-fail/issue-40510-1.rs delete mode 100644 src/test/compile-fail/issue-40510-2.rs delete mode 100644 src/test/compile-fail/issue-40510-3.rs delete mode 100644 src/test/compile-fail/issue-40510-4.rs delete mode 100644 src/test/compile-fail/issue-40610.rs delete mode 100644 src/test/compile-fail/issue-40749.rs delete mode 100644 src/test/compile-fail/issue-40845.rs delete mode 100644 src/test/compile-fail/issue-40861.rs delete mode 100644 src/test/compile-fail/issue-41139.rs delete mode 100644 src/test/compile-fail/issue-41229-ref-str.rs delete mode 100644 src/test/compile-fail/issue-41255.rs delete mode 100644 src/test/compile-fail/issue-41394.rs delete mode 100644 src/test/compile-fail/issue-41726.rs delete mode 100644 src/test/compile-fail/issue-41742.rs delete mode 100644 src/test/compile-fail/issue-41776.rs delete mode 100644 src/test/compile-fail/issue-41880.rs delete mode 100644 src/test/compile-fail/issue-41974.rs delete mode 100644 src/test/compile-fail/issue-41998.rs delete mode 100644 src/test/compile-fail/issue-4201.rs delete mode 100644 src/test/compile-fail/issue-42312.rs delete mode 100644 src/test/compile-fail/issue-42344.rs delete mode 100644 src/test/compile-fail/issue-4265.rs delete mode 100644 src/test/compile-fail/issue-42755.rs delete mode 100644 src/test/compile-fail/issue-42796.rs delete mode 100644 src/test/compile-fail/issue-42880.rs delete mode 100644 src/test/compile-fail/issue-43023.rs delete mode 100644 src/test/compile-fail/issue-43105.rs delete mode 100644 src/test/compile-fail/issue-43162.rs delete mode 100644 src/test/compile-fail/issue-4321.rs delete mode 100644 src/test/compile-fail/issue-43250.rs delete mode 100644 src/test/compile-fail/issue-43355.rs delete mode 100644 src/test/compile-fail/issue-43424.rs delete mode 100644 src/test/compile-fail/issue-43431.rs delete mode 100644 src/test/compile-fail/issue-4366-2.rs delete mode 100644 src/test/compile-fail/issue-4366.rs delete mode 100644 src/test/compile-fail/issue-43733-2.rs delete mode 100644 src/test/compile-fail/issue-43733.rs delete mode 100644 src/test/compile-fail/issue-43784-associated-type.rs delete mode 100644 src/test/compile-fail/issue-43784-supertrait.rs delete mode 100644 src/test/compile-fail/issue-43925.rs delete mode 100644 src/test/compile-fail/issue-43926.rs delete mode 100644 src/test/compile-fail/issue-43988.rs delete mode 100644 src/test/compile-fail/issue-44021.rs delete mode 100644 src/test/compile-fail/issue-44239.rs delete mode 100644 src/test/compile-fail/issue-44373.rs delete mode 100644 src/test/compile-fail/issue-44415.rs delete mode 100644 src/test/compile-fail/issue-45087-unreachable-unsafe.rs delete mode 100644 src/test/compile-fail/issue-4517.rs delete mode 100644 src/test/compile-fail/issue-45199.rs delete mode 100644 src/test/compile-fail/issue-45729-unsafe-in-generator.rs delete mode 100644 src/test/compile-fail/issue-45801.rs delete mode 100644 src/test/compile-fail/issue-45965.rs delete mode 100644 src/test/compile-fail/issue-46023.rs delete mode 100644 src/test/compile-fail/issue-46036.rs delete mode 100644 src/test/compile-fail/issue-46311.rs delete mode 100644 src/test/compile-fail/issue-46438.rs delete mode 100644 src/test/compile-fail/issue-46604.rs delete mode 100644 src/test/compile-fail/issue-46771.rs delete mode 100644 src/test/compile-fail/issue-46843.rs delete mode 100644 src/test/compile-fail/issue-47309.rs delete mode 100644 src/test/compile-fail/issue-4736.rs delete mode 100644 src/test/compile-fail/issue-47412.rs delete mode 100644 src/test/compile-fail/issue-47715.rs delete mode 100644 src/test/compile-fail/issue-48131.rs delete mode 100644 src/test/compile-fail/issue-48838.rs delete mode 100644 src/test/compile-fail/issue-4968.rs delete mode 100644 src/test/compile-fail/issue-4972.rs delete mode 100644 src/test/compile-fail/issue-50471.rs delete mode 100644 src/test/compile-fail/issue-50600.rs delete mode 100644 src/test/compile-fail/issue-5062.rs delete mode 100644 src/test/compile-fail/issue-5067.rs delete mode 100644 src/test/compile-fail/issue-50688.rs delete mode 100644 src/test/compile-fail/issue-5099.rs delete mode 100644 src/test/compile-fail/issue-5100.rs delete mode 100644 src/test/compile-fail/issue-5153.rs delete mode 100644 src/test/compile-fail/issue-5216.rs delete mode 100644 src/test/compile-fail/issue-52213.rs delete mode 100644 src/test/compile-fail/issue-5358-1.rs delete mode 100644 src/test/compile-fail/issue-5439.rs delete mode 100644 src/test/compile-fail/issue-5883.rs delete mode 100644 src/test/compile-fail/issue-5927.rs delete mode 100644 src/test/compile-fail/issue-5997-enum.rs delete mode 100644 src/test/compile-fail/issue-5997-struct.rs delete mode 100644 src/test/compile-fail/issue-6458-2.rs delete mode 100644 src/test/compile-fail/issue-6596-1.rs delete mode 100644 src/test/compile-fail/issue-6596-2.rs delete mode 100644 src/test/compile-fail/issue-6642.rs delete mode 100644 src/test/compile-fail/issue-6738.rs delete mode 100644 src/test/compile-fail/issue-6801.rs delete mode 100644 src/test/compile-fail/issue-6804.rs delete mode 100644 src/test/compile-fail/issue-6936.rs delete mode 100644 src/test/compile-fail/issue-7013.rs delete mode 100644 src/test/compile-fail/issue-7044.rs delete mode 100644 src/test/compile-fail/issue-7061.rs delete mode 100644 src/test/compile-fail/issue-7092.rs delete mode 100644 src/test/compile-fail/issue-7246.rs delete mode 100644 src/test/compile-fail/issue-7364.rs delete mode 100644 src/test/compile-fail/issue-7607-1.rs delete mode 100644 src/test/compile-fail/issue-7867.rs delete mode 100644 src/test/compile-fail/issue-7950.rs delete mode 100644 src/test/compile-fail/issue-7970a.rs delete mode 100644 src/test/compile-fail/issue-7970b.rs delete mode 100644 src/test/compile-fail/issue-8153.rs delete mode 100644 src/test/compile-fail/issue-8208.rs delete mode 100644 src/test/compile-fail/issue-8460-const.rs delete mode 100644 src/test/compile-fail/issue-8640.rs delete mode 100644 src/test/compile-fail/issue-8727.rs delete mode 100644 src/test/compile-fail/issue-8761.rs delete mode 100644 src/test/compile-fail/issue-8767.rs delete mode 100644 src/test/compile-fail/issue-9575.rs delete mode 100644 src/test/compile-fail/issue-9725.rs delete mode 100644 src/test/compile-fail/issue-9814.rs delete mode 100644 src/test/compile-fail/issue-pr29383.rs create mode 100644 src/test/ui/issue-10176.rs create mode 100644 src/test/ui/issue-10176.stderr create mode 100644 src/test/ui/issue-10200.rs create mode 100644 src/test/ui/issue-10200.stderr create mode 100644 src/test/ui/issue-10291.nll.stderr create mode 100644 src/test/ui/issue-10291.rs create mode 100644 src/test/ui/issue-10291.stderr create mode 100644 src/test/ui/issue-10398.nll.stderr create mode 100644 src/test/ui/issue-10398.rs create mode 100644 src/test/ui/issue-10398.stderr create mode 100644 src/test/ui/issue-10401.rs create mode 100644 src/test/ui/issue-10401.stderr create mode 100644 src/test/ui/issue-10412.rs create mode 100644 src/test/ui/issue-10412.stderr create mode 100644 src/test/ui/issue-10465.rs create mode 100644 src/test/ui/issue-10465.stderr create mode 100644 src/test/ui/issue-10536.rs create mode 100644 src/test/ui/issue-10536.stderr create mode 100644 src/test/ui/issue-10545.rs create mode 100644 src/test/ui/issue-10545.stderr create mode 100644 src/test/ui/issue-10656.rs create mode 100644 src/test/ui/issue-10656.stderr create mode 100644 src/test/ui/issue-10755.rs create mode 100644 src/test/ui/issue-10755.stderr create mode 100644 src/test/ui/issue-10764.rs create mode 100644 src/test/ui/issue-10764.stderr create mode 100644 src/test/ui/issue-10877.rs create mode 100644 src/test/ui/issue-10877.stderr create mode 100644 src/test/ui/issue-10991.rs create mode 100644 src/test/ui/issue-10991.stderr create mode 100644 src/test/ui/issue-11154.rs create mode 100644 src/test/ui/issue-11154.stderr create mode 100644 src/test/ui/issue-11192.nll.stderr create mode 100644 src/test/ui/issue-11192.rs create mode 100644 src/test/ui/issue-11192.stderr create mode 100644 src/test/ui/issue-11374.rs create mode 100644 src/test/ui/issue-11374.stderr create mode 100644 src/test/ui/issue-11493.ast.stderr create mode 100644 src/test/ui/issue-11493.mir.stderr create mode 100644 src/test/ui/issue-11493.rs create mode 100644 src/test/ui/issue-11515.rs create mode 100644 src/test/ui/issue-11515.stderr create mode 100644 src/test/ui/issue-11681.rs create mode 100644 src/test/ui/issue-11681.stderr create mode 100644 src/test/ui/issue-11692-1.rs create mode 100644 src/test/ui/issue-11692-1.stderr create mode 100644 src/test/ui/issue-11692-2.rs create mode 100644 src/test/ui/issue-11692-2.stderr create mode 100644 src/test/ui/issue-11740.rs create mode 100644 src/test/ui/issue-11740.stderr create mode 100644 src/test/ui/issue-11771.rs create mode 100644 src/test/ui/issue-11771.stderr create mode 100644 src/test/ui/issue-11844.rs create mode 100644 src/test/ui/issue-11844.stderr create mode 100644 src/test/ui/issue-11873.nll.stderr create mode 100644 src/test/ui/issue-11873.rs create mode 100644 src/test/ui/issue-11873.stderr create mode 100644 src/test/ui/issue-12028.rs create mode 100644 src/test/ui/issue-12028.stderr create mode 100644 src/test/ui/issue-12041.nll.stderr create mode 100644 src/test/ui/issue-12041.rs create mode 100644 src/test/ui/issue-12041.stderr create mode 100644 src/test/ui/issue-12116.rs create mode 100644 src/test/ui/issue-12116.stderr create mode 100644 src/test/ui/issue-12127.rs create mode 100644 src/test/ui/issue-12127.stderr create mode 100644 src/test/ui/issue-12369.rs create mode 100644 src/test/ui/issue-12369.stderr create mode 100644 src/test/ui/issue-12470.nll.stderr create mode 100644 src/test/ui/issue-12470.rs create mode 100644 src/test/ui/issue-12470.stderr create mode 100644 src/test/ui/issue-12552.rs create mode 100644 src/test/ui/issue-12552.stderr create mode 100644 src/test/ui/issue-12567.nll.stderr create mode 100644 src/test/ui/issue-12567.rs create mode 100644 src/test/ui/issue-12567.stderr create mode 100644 src/test/ui/issue-12796.rs create mode 100644 src/test/ui/issue-12796.stderr create mode 100644 src/test/ui/issue-12863.rs create mode 100644 src/test/ui/issue-12863.stderr create mode 100644 src/test/ui/issue-12997-1.rs create mode 100644 src/test/ui/issue-12997-1.stderr create mode 100644 src/test/ui/issue-12997-2.rs create mode 100644 src/test/ui/issue-12997-2.stderr create mode 100644 src/test/ui/issue-13033.rs create mode 100644 src/test/ui/issue-13033.stderr create mode 100644 src/test/ui/issue-13352.rs create mode 100644 src/test/ui/issue-13352.stderr create mode 100644 src/test/ui/issue-13359.rs create mode 100644 src/test/ui/issue-13359.stderr create mode 100644 src/test/ui/issue-13404.rs create mode 100644 src/test/ui/issue-13404.stderr create mode 100644 src/test/ui/issue-13407.rs create mode 100644 src/test/ui/issue-13407.stderr create mode 100644 src/test/ui/issue-13446.rs create mode 100644 src/test/ui/issue-13446.stderr create mode 100644 src/test/ui/issue-13466.rs create mode 100644 src/test/ui/issue-13466.stderr create mode 100644 src/test/ui/issue-13482-2.rs create mode 100644 src/test/ui/issue-13482-2.stderr create mode 100644 src/test/ui/issue-13482.rs create mode 100644 src/test/ui/issue-13482.stderr create mode 100644 src/test/ui/issue-13497-2.rs create mode 100644 src/test/ui/issue-13497-2.stderr create mode 100644 src/test/ui/issue-13497.rs create mode 100644 src/test/ui/issue-13497.stderr create mode 100644 src/test/ui/issue-1362.rs create mode 100644 src/test/ui/issue-1362.stderr create mode 100644 src/test/ui/issue-13641.rs create mode 100644 src/test/ui/issue-13641.stderr create mode 100644 src/test/ui/issue-13727.rs create mode 100644 src/test/ui/issue-13727.stderr create mode 100644 src/test/ui/issue-13847.rs create mode 100644 src/test/ui/issue-13847.stderr create mode 100644 src/test/ui/issue-13853-2.rs create mode 100644 src/test/ui/issue-13853-2.stderr create mode 100644 src/test/ui/issue-13853-5.rs create mode 100644 src/test/ui/issue-13853-5.stderr create mode 100644 src/test/ui/issue-13853.rs create mode 100644 src/test/ui/issue-13853.stderr create mode 100644 src/test/ui/issue-14091-2.rs create mode 100644 src/test/ui/issue-14091-2.stderr create mode 100644 src/test/ui/issue-14091.rs create mode 100644 src/test/ui/issue-14091.stderr create mode 100644 src/test/ui/issue-14221.rs create mode 100644 src/test/ui/issue-14221.stderr create mode 100644 src/test/ui/issue-14227.rs create mode 100644 src/test/ui/issue-14227.stderr create mode 100644 src/test/ui/issue-14285.nll.stderr create mode 100644 src/test/ui/issue-14285.rs create mode 100644 src/test/ui/issue-14285.stderr create mode 100644 src/test/ui/issue-14309.rs create mode 100644 src/test/ui/issue-14309.stderr create mode 100644 src/test/ui/issue-14366.rs create mode 100644 src/test/ui/issue-14366.stderr create mode 100644 src/test/ui/issue-1448-2.rs create mode 100644 src/test/ui/issue-1448-2.stderr create mode 100644 src/test/ui/issue-14541.rs create mode 100644 src/test/ui/issue-14541.stderr create mode 100644 src/test/ui/issue-14721.rs create mode 100644 src/test/ui/issue-14721.stderr create mode 100644 src/test/ui/issue-1476.rs create mode 100644 src/test/ui/issue-1476.stderr create mode 100644 src/test/ui/issue-14772.rs create mode 100644 src/test/ui/issue-14772.stderr create mode 100644 src/test/ui/issue-14845.rs create mode 100644 src/test/ui/issue-14845.stderr create mode 100644 src/test/ui/issue-14853.rs create mode 100644 src/test/ui/issue-14853.stderr create mode 100644 src/test/ui/issue-14915.rs create mode 100644 src/test/ui/issue-14915.stderr create mode 100644 src/test/ui/issue-15034.nll.stderr create mode 100644 src/test/ui/issue-15034.rs create mode 100644 src/test/ui/issue-15034.stderr create mode 100644 src/test/ui/issue-15094.rs create mode 100644 src/test/ui/issue-15094.stderr create mode 100644 src/test/ui/issue-15129.rs create mode 100644 src/test/ui/issue-15129.stderr create mode 100644 src/test/ui/issue-15167.rs create mode 100644 src/test/ui/issue-15167.stderr create mode 100644 src/test/ui/issue-15207.rs create mode 100644 src/test/ui/issue-15207.stderr create mode 100644 src/test/ui/issue-15381.rs create mode 100644 src/test/ui/issue-15381.stderr create mode 100644 src/test/ui/issue-15756.rs create mode 100644 src/test/ui/issue-15756.stderr create mode 100644 src/test/ui/issue-15783.rs create mode 100644 src/test/ui/issue-15783.stderr create mode 100644 src/test/ui/issue-15896.rs create mode 100644 src/test/ui/issue-15896.stderr create mode 100644 src/test/ui/issue-15919.rs create mode 100644 src/test/ui/issue-15919.stderr create mode 100644 src/test/ui/issue-15965.rs create mode 100644 src/test/ui/issue-15965.stderr create mode 100644 src/test/ui/issue-16048.rs create mode 100644 src/test/ui/issue-16048.stderr create mode 100644 src/test/ui/issue-16098.rs create mode 100644 src/test/ui/issue-16098.stderr create mode 100644 src/test/ui/issue-16149.rs create mode 100644 src/test/ui/issue-16149.stderr create mode 100644 src/test/ui/issue-16250.rs create mode 100644 src/test/ui/issue-16250.stderr create mode 100644 src/test/ui/issue-16338.rs create mode 100644 src/test/ui/issue-16338.stderr create mode 100644 src/test/ui/issue-16401.rs create mode 100644 src/test/ui/issue-16401.stderr create mode 100644 src/test/ui/issue-16538.rs create mode 100644 src/test/ui/issue-16538.stderr create mode 100644 src/test/ui/issue-16562.rs create mode 100644 src/test/ui/issue-16562.stderr create mode 100644 src/test/ui/issue-16683.nll.stderr create mode 100644 src/test/ui/issue-16683.rs create mode 100644 src/test/ui/issue-16683.stderr create mode 100644 src/test/ui/issue-16922.nll.stderr create mode 100644 src/test/ui/issue-16922.rs create mode 100644 src/test/ui/issue-16922.stderr create mode 100644 src/test/ui/issue-16939.rs create mode 100644 src/test/ui/issue-16939.stderr create mode 100644 src/test/ui/issue-16966.rs create mode 100644 src/test/ui/issue-16966.stderr create mode 100644 src/test/ui/issue-1697.rs create mode 100644 src/test/ui/issue-1697.stderr create mode 100644 src/test/ui/issue-16994.rs create mode 100644 src/test/ui/issue-16994.stderr create mode 100644 src/test/ui/issue-17001.rs create mode 100644 src/test/ui/issue-17001.stderr create mode 100644 src/test/ui/issue-17025.rs create mode 100644 src/test/ui/issue-17033.rs create mode 100644 src/test/ui/issue-17033.stderr create mode 100644 src/test/ui/issue-17252.rs create mode 100644 src/test/ui/issue-17252.stderr create mode 100644 src/test/ui/issue-17337.rs create mode 100644 src/test/ui/issue-17337.stderr create mode 100644 src/test/ui/issue-17373.rs create mode 100644 src/test/ui/issue-17373.stderr create mode 100644 src/test/ui/issue-17385.nll.stderr create mode 100644 src/test/ui/issue-17385.rs create mode 100644 src/test/ui/issue-17385.stderr create mode 100644 src/test/ui/issue-17405.rs create mode 100644 src/test/ui/issue-17405.stderr create mode 100644 src/test/ui/issue-17431-1.rs create mode 100644 src/test/ui/issue-17431-1.stderr create mode 100644 src/test/ui/issue-17431-2.rs create mode 100644 src/test/ui/issue-17431-2.stderr create mode 100644 src/test/ui/issue-17431-3.rs create mode 100644 src/test/ui/issue-17431-3.stderr create mode 100644 src/test/ui/issue-17431-4.rs create mode 100644 src/test/ui/issue-17431-4.stderr create mode 100644 src/test/ui/issue-17431-5.rs create mode 100644 src/test/ui/issue-17431-5.stderr create mode 100644 src/test/ui/issue-17431-6.rs create mode 100644 src/test/ui/issue-17431-6.stderr create mode 100644 src/test/ui/issue-17431-7.rs create mode 100644 src/test/ui/issue-17431-7.stderr create mode 100644 src/test/ui/issue-17444.rs create mode 100644 src/test/ui/issue-17444.stderr create mode 100644 src/test/ui/issue-17458.rs create mode 100644 src/test/ui/issue-17458.stderr create mode 100644 src/test/ui/issue-17545.nll.stderr create mode 100644 src/test/ui/issue-17545.rs create mode 100644 src/test/ui/issue-17545.stderr create mode 100644 src/test/ui/issue-17546.rs create mode 100644 src/test/ui/issue-17546.stderr create mode 100644 src/test/ui/issue-17551.rs create mode 100644 src/test/ui/issue-17551.stderr create mode 100644 src/test/ui/issue-17651.rs create mode 100644 src/test/ui/issue-17651.stderr create mode 100644 src/test/ui/issue-17718-const-bad-values.rs create mode 100644 src/test/ui/issue-17718-const-bad-values.stderr create mode 100644 src/test/ui/issue-17718-const-borrow.rs create mode 100644 src/test/ui/issue-17718-const-borrow.stderr create mode 100644 src/test/ui/issue-17718-const-naming.rs create mode 100644 src/test/ui/issue-17718-const-naming.stderr create mode 100644 src/test/ui/issue-17718-constants-not-static.rs create mode 100644 src/test/ui/issue-17718-constants-not-static.stderr create mode 100644 src/test/ui/issue-17718-patterns.rs create mode 100644 src/test/ui/issue-17718-patterns.stderr create mode 100644 src/test/ui/issue-17718-references.rs create mode 100644 src/test/ui/issue-17718-references.stderr create mode 100644 src/test/ui/issue-17718-static-move.rs create mode 100644 src/test/ui/issue-17718-static-move.stderr create mode 100644 src/test/ui/issue-17718-static-sync.rs create mode 100644 src/test/ui/issue-17718-static-sync.stderr create mode 100644 src/test/ui/issue-17728.nll.stderr create mode 100644 src/test/ui/issue-17728.rs create mode 100644 src/test/ui/issue-17728.stderr create mode 100644 src/test/ui/issue-17740.rs create mode 100644 src/test/ui/issue-17740.stderr create mode 100644 src/test/ui/issue-17758.nll.stderr create mode 100644 src/test/ui/issue-17758.rs create mode 100644 src/test/ui/issue-17758.stderr create mode 100644 src/test/ui/issue-17800.rs create mode 100644 src/test/ui/issue-17800.stderr create mode 100644 src/test/ui/issue-17904-2.rs create mode 100644 src/test/ui/issue-17904-2.stderr create mode 100644 src/test/ui/issue-17905.rs create mode 100644 src/test/ui/issue-17905.stderr create mode 100644 src/test/ui/issue-17913.rs create mode 100644 src/test/ui/issue-17913.stderr create mode 100644 src/test/ui/issue-17933.rs create mode 100644 src/test/ui/issue-17933.stderr create mode 100644 src/test/ui/issue-17954.ast.nll.stderr create mode 100644 src/test/ui/issue-17954.ast.stderr create mode 100644 src/test/ui/issue-17954.mir.stderr create mode 100644 src/test/ui/issue-17954.rs create mode 100644 src/test/ui/issue-17959.rs create mode 100644 src/test/ui/issue-17959.stderr create mode 100644 src/test/ui/issue-17994.rs create mode 100644 src/test/ui/issue-17994.stderr create mode 100644 src/test/ui/issue-17999.rs create mode 100644 src/test/ui/issue-17999.stderr create mode 100644 src/test/ui/issue-18058.rs create mode 100644 src/test/ui/issue-18058.stderr create mode 100644 src/test/ui/issue-18107.rs create mode 100644 src/test/ui/issue-18107.stderr create mode 100644 src/test/ui/issue-18118-2.rs create mode 100644 src/test/ui/issue-18118-2.stderr create mode 100644 src/test/ui/issue-18118.nll.stderr create mode 100644 src/test/ui/issue-18118.rs create mode 100644 src/test/ui/issue-18118.stderr create mode 100644 src/test/ui/issue-18119.rs create mode 100644 src/test/ui/issue-18119.stderr create mode 100644 src/test/ui/issue-18159.rs create mode 100644 src/test/ui/issue-18159.stderr create mode 100644 src/test/ui/issue-18294.rs create mode 100644 src/test/ui/issue-18294.stderr create mode 100644 src/test/ui/issue-18389.rs create mode 100644 src/test/ui/issue-18389.stderr create mode 100644 src/test/ui/issue-18400.rs create mode 100644 src/test/ui/issue-18400.stderr create mode 100644 src/test/ui/issue-18423.rs create mode 100644 src/test/ui/issue-18423.stderr create mode 100644 src/test/ui/issue-18446.rs create mode 100644 src/test/ui/issue-18446.stderr create mode 100644 src/test/ui/issue-18532.rs create mode 100644 src/test/ui/issue-18532.stderr create mode 100644 src/test/ui/issue-18566.nll.stderr create mode 100644 src/test/ui/issue-18566.rs create mode 100644 src/test/ui/issue-18566.stderr create mode 100644 src/test/ui/issue-18611.rs create mode 100644 src/test/ui/issue-18611.stderr create mode 100644 src/test/ui/issue-1871.rs create mode 100644 src/test/ui/issue-1871.stderr create mode 100644 src/test/ui/issue-18783.nll.stderr create mode 100644 src/test/ui/issue-18783.rs create mode 100644 src/test/ui/issue-18783.stderr create mode 100644 src/test/ui/issue-18919.rs create mode 100644 src/test/ui/issue-18919.stderr create mode 100644 src/test/ui/issue-18937.rs create mode 100644 src/test/ui/issue-18937.stderr create mode 100644 src/test/ui/issue-18959.rs create mode 100644 src/test/ui/issue-18959.stderr create mode 100644 src/test/ui/issue-1900.rs create mode 100644 src/test/ui/issue-1900.stderr create mode 100644 src/test/ui/issue-19086.rs create mode 100644 src/test/ui/issue-19086.stderr create mode 100644 src/test/ui/issue-19244-1.rs create mode 100644 src/test/ui/issue-19244-1.stderr create mode 100644 src/test/ui/issue-19244-2.rs create mode 100644 src/test/ui/issue-19244-2.stderr create mode 100644 src/test/ui/issue-19380.rs create mode 100644 src/test/ui/issue-19380.stderr create mode 100644 src/test/ui/issue-19482.rs create mode 100644 src/test/ui/issue-19482.stderr create mode 100644 src/test/ui/issue-19521.rs create mode 100644 src/test/ui/issue-19521.stderr create mode 100644 src/test/ui/issue-19538.rs create mode 100644 src/test/ui/issue-19538.stderr create mode 100644 src/test/ui/issue-19601.rs create mode 100644 src/test/ui/issue-19601.stderr create mode 100644 src/test/ui/issue-19660.rs create mode 100644 src/test/ui/issue-19660.stderr create mode 100644 src/test/ui/issue-19692.rs create mode 100644 src/test/ui/issue-19692.stderr create mode 100644 src/test/ui/issue-19734.rs create mode 100644 src/test/ui/issue-19734.stderr create mode 100644 src/test/ui/issue-19883.rs create mode 100644 src/test/ui/issue-19883.stderr create mode 100644 src/test/ui/issue-19982.rs create mode 100644 src/test/ui/issue-19982.stderr create mode 100644 src/test/ui/issue-19991.rs create mode 100644 src/test/ui/issue-19991.stderr create mode 100644 src/test/ui/issue-20005.rs create mode 100644 src/test/ui/issue-20005.stderr create mode 100644 src/test/ui/issue-20162.rs create mode 100644 src/test/ui/issue-20162.stderr create mode 100644 src/test/ui/issue-20225.rs create mode 100644 src/test/ui/issue-20225.stderr create mode 100644 src/test/ui/issue-20261.rs create mode 100644 src/test/ui/issue-20261.stderr create mode 100644 src/test/ui/issue-20313.rs create mode 100644 src/test/ui/issue-20313.stderr create mode 100644 src/test/ui/issue-20413.rs create mode 100644 src/test/ui/issue-20413.stderr create mode 100644 src/test/ui/issue-20433.rs create mode 100644 src/test/ui/issue-20433.stderr create mode 100644 src/test/ui/issue-20605.rs create mode 100644 src/test/ui/issue-20605.stderr create mode 100644 src/test/ui/issue-20616-1.rs create mode 100644 src/test/ui/issue-20616-1.stderr create mode 100644 src/test/ui/issue-20616-2.rs create mode 100644 src/test/ui/issue-20616-2.stderr create mode 100644 src/test/ui/issue-20616-3.rs create mode 100644 src/test/ui/issue-20616-3.stderr create mode 100644 src/test/ui/issue-20616-4.rs create mode 100644 src/test/ui/issue-20616-4.stderr create mode 100644 src/test/ui/issue-20616-5.rs create mode 100644 src/test/ui/issue-20616-5.stderr create mode 100644 src/test/ui/issue-20616-6.rs create mode 100644 src/test/ui/issue-20616-6.stderr create mode 100644 src/test/ui/issue-20616-7.rs create mode 100644 src/test/ui/issue-20616-7.stderr create mode 100644 src/test/ui/issue-20616-8.rs create mode 100644 src/test/ui/issue-20616-8.stderr create mode 100644 src/test/ui/issue-20616-9.rs create mode 100644 src/test/ui/issue-20616-9.stderr create mode 100644 src/test/ui/issue-20714.rs create mode 100644 src/test/ui/issue-20714.stderr create mode 100644 src/test/ui/issue-20772.rs create mode 100644 src/test/ui/issue-20772.stderr create mode 100644 src/test/ui/issue-20801.nll.stderr create mode 100644 src/test/ui/issue-20801.rs create mode 100644 src/test/ui/issue-20801.stderr create mode 100644 src/test/ui/issue-20825.rs create mode 100644 src/test/ui/issue-20825.stderr create mode 100644 src/test/ui/issue-20831-debruijn.rs create mode 100644 src/test/ui/issue-20831-debruijn.stderr create mode 100644 src/test/ui/issue-20939.rs create mode 100644 src/test/ui/issue-20939.stderr create mode 100644 src/test/ui/issue-2111.rs create mode 100644 src/test/ui/issue-2111.stderr create mode 100644 src/test/ui/issue-21160.rs create mode 100644 src/test/ui/issue-21160.stderr create mode 100644 src/test/ui/issue-21174.rs create mode 100644 src/test/ui/issue-21174.stderr create mode 100644 src/test/ui/issue-21177.rs create mode 100644 src/test/ui/issue-21177.stderr create mode 100644 src/test/ui/issue-21332.rs create mode 100644 src/test/ui/issue-21332.stderr create mode 100644 src/test/ui/issue-21356.rs create mode 100644 src/test/ui/issue-21356.stderr create mode 100644 src/test/ui/issue-21449.rs create mode 100644 src/test/ui/issue-21449.stderr create mode 100644 src/test/ui/issue-2149.rs create mode 100644 src/test/ui/issue-2149.stderr create mode 100644 src/test/ui/issue-2150.rs create mode 100644 src/test/ui/issue-2150.stderr create mode 100644 src/test/ui/issue-2151.rs create mode 100644 src/test/ui/issue-2151.stderr create mode 100644 src/test/ui/issue-21554.rs create mode 100644 src/test/ui/issue-21554.stderr create mode 100644 src/test/ui/issue-21701.rs create mode 100644 src/test/ui/issue-21701.stderr create mode 100644 src/test/ui/issue-21763.rs create mode 100644 src/test/ui/issue-21763.stderr create mode 100644 src/test/ui/issue-21837.rs create mode 100644 src/test/ui/issue-21837.stderr create mode 100644 src/test/ui/issue-21946.rs create mode 100644 src/test/ui/issue-21946.stderr create mode 100644 src/test/ui/issue-21974.rs create mode 100644 src/test/ui/issue-21974.stderr create mode 100644 src/test/ui/issue-22034.rs create mode 100644 src/test/ui/issue-22034.stderr create mode 100644 src/test/ui/issue-22037.rs create mode 100644 src/test/ui/issue-22037.stderr create mode 100644 src/test/ui/issue-22289.rs create mode 100644 src/test/ui/issue-22289.stderr create mode 100644 src/test/ui/issue-22312.rs create mode 100644 src/test/ui/issue-22312.stderr create mode 100644 src/test/ui/issue-22384.rs create mode 100644 src/test/ui/issue-22384.stderr create mode 100644 src/test/ui/issue-22434.rs create mode 100644 src/test/ui/issue-22434.stderr create mode 100644 src/test/ui/issue-22468.rs create mode 100644 src/test/ui/issue-22468.stderr create mode 100644 src/test/ui/issue-22599.rs create mode 100644 src/test/ui/issue-22599.stderr create mode 100644 src/test/ui/issue-22603.rs create mode 100644 src/test/ui/issue-22603.stderr create mode 100644 src/test/ui/issue-22673.rs create mode 100644 src/test/ui/issue-22673.stderr create mode 100644 src/test/ui/issue-22684.rs create mode 100644 src/test/ui/issue-22684.stderr create mode 100644 src/test/ui/issue-22706.rs create mode 100644 src/test/ui/issue-22706.stderr create mode 100644 src/test/ui/issue-22789.rs create mode 100644 src/test/ui/issue-22789.stderr create mode 100644 src/test/ui/issue-2281-part1.rs create mode 100644 src/test/ui/issue-2281-part1.stderr create mode 100644 src/test/ui/issue-22874.rs create mode 100644 src/test/ui/issue-22874.stderr create mode 100644 src/test/ui/issue-22933-1.rs create mode 100644 src/test/ui/issue-22933-1.stderr create mode 100644 src/test/ui/issue-22933-3.rs create mode 100644 src/test/ui/issue-22933-3.stderr create mode 100644 src/test/ui/issue-23024.rs create mode 100644 src/test/ui/issue-23024.stderr create mode 100644 src/test/ui/issue-23046.rs create mode 100644 src/test/ui/issue-23046.stderr create mode 100644 src/test/ui/issue-23073.rs create mode 100644 src/test/ui/issue-23073.stderr create mode 100644 src/test/ui/issue-23080-2.rs create mode 100644 src/test/ui/issue-23080-2.stderr create mode 100644 src/test/ui/issue-23080.rs create mode 100644 src/test/ui/issue-23080.stderr create mode 100644 src/test/ui/issue-23122-1.rs create mode 100644 src/test/ui/issue-23122-1.stderr create mode 100644 src/test/ui/issue-23122-2.rs create mode 100644 src/test/ui/issue-23122-2.stderr create mode 100644 src/test/ui/issue-23253.rs create mode 100644 src/test/ui/issue-23253.stderr create mode 100644 src/test/ui/issue-23281.rs create mode 100644 src/test/ui/issue-23281.stderr create mode 100644 src/test/ui/issue-2330.rs create mode 100644 src/test/ui/issue-2330.stderr create mode 100644 src/test/ui/issue-23589.rs create mode 100644 src/test/ui/issue-23589.stderr create mode 100644 src/test/ui/issue-23595-1.rs create mode 100644 src/test/ui/issue-23595-1.stderr create mode 100644 src/test/ui/issue-23595-2.rs create mode 100644 src/test/ui/issue-23595-2.stderr create mode 100644 src/test/ui/issue-23966.rs create mode 100644 src/test/ui/issue-23966.stderr create mode 100644 src/test/ui/issue-24013.rs create mode 100644 src/test/ui/issue-24013.stderr create mode 100644 src/test/ui/issue-24204.rs create mode 100644 src/test/ui/issue-24204.stderr create mode 100644 src/test/ui/issue-24267-flow-exit.nll.stderr create mode 100644 src/test/ui/issue-24267-flow-exit.rs create mode 100644 src/test/ui/issue-24267-flow-exit.stderr create mode 100644 src/test/ui/issue-24322.rs create mode 100644 src/test/ui/issue-24322.stderr create mode 100644 src/test/ui/issue-24352.rs create mode 100644 src/test/ui/issue-24352.stderr create mode 100644 src/test/ui/issue-24357.nll.stderr create mode 100644 src/test/ui/issue-24357.rs create mode 100644 src/test/ui/issue-24357.stderr create mode 100644 src/test/ui/issue-24363.rs create mode 100644 src/test/ui/issue-24363.stderr create mode 100644 src/test/ui/issue-24365.rs create mode 100644 src/test/ui/issue-24365.stderr create mode 100644 src/test/ui/issue-24446.rs create mode 100644 src/test/ui/issue-24446.stderr create mode 100644 src/test/ui/issue-24682.rs create mode 100644 src/test/ui/issue-24682.stderr create mode 100644 src/test/ui/issue-24819.rs create mode 100644 src/test/ui/issue-24819.stderr create mode 100644 src/test/ui/issue-24883.rs create mode 100644 src/test/ui/issue-24883.stderr create mode 100644 src/test/ui/issue-25076.rs create mode 100644 src/test/ui/issue-25076.stderr create mode 100644 src/test/ui/issue-25368.rs create mode 100644 src/test/ui/issue-25368.stderr create mode 100644 src/test/ui/issue-25386.rs create mode 100644 src/test/ui/issue-25386.stderr create mode 100644 src/test/ui/issue-25396.rs create mode 100644 src/test/ui/issue-25396.stderr create mode 100644 src/test/ui/issue-25439.rs create mode 100644 src/test/ui/issue-25439.stderr create mode 100644 src/test/ui/issue-25579.ast.nll.stderr create mode 100644 src/test/ui/issue-25579.ast.stderr create mode 100644 src/test/ui/issue-25579.mir.stderr create mode 100644 src/test/ui/issue-25579.rs create mode 100644 src/test/ui/issue-25700.rs create mode 100644 src/test/ui/issue-25700.stderr create mode 100644 src/test/ui/issue-2590.nll.stderr create mode 100644 src/test/ui/issue-2590.rs create mode 100644 src/test/ui/issue-2590.stderr create mode 100644 src/test/ui/issue-25901.rs create mode 100644 src/test/ui/issue-25901.stderr create mode 100644 src/test/ui/issue-26094.rs create mode 100644 src/test/ui/issue-26094.stderr create mode 100644 src/test/ui/issue-26158.rs create mode 100644 src/test/ui/issue-26158.stderr create mode 100644 src/test/ui/issue-26217.nll.stderr create mode 100644 src/test/ui/issue-26217.rs create mode 100644 src/test/ui/issue-26217.stderr create mode 100644 src/test/ui/issue-26237.rs create mode 100644 src/test/ui/issue-26237.stderr create mode 100644 src/test/ui/issue-26262.rs create mode 100644 src/test/ui/issue-26262.stderr create mode 100644 src/test/ui/issue-26459.rs create mode 100644 src/test/ui/issue-26459.stderr create mode 100644 src/test/ui/issue-26548.rs create mode 100644 src/test/ui/issue-26548.stderr create mode 100644 src/test/ui/issue-26614.rs create mode 100644 src/test/ui/issue-26614.stderr create mode 100644 src/test/ui/issue-26812.rs create mode 100644 src/test/ui/issue-26812.stderr create mode 100644 src/test/ui/issue-26905.rs create mode 100644 src/test/ui/issue-26905.stderr create mode 100644 src/test/ui/issue-26930.rs create mode 100644 src/test/ui/issue-26930.stderr create mode 100644 src/test/ui/issue-26948.rs create mode 100644 src/test/ui/issue-26948.stderr create mode 100644 src/test/ui/issue-27008.rs create mode 100644 src/test/ui/issue-27008.stderr create mode 100644 src/test/ui/issue-27033.rs create mode 100644 src/test/ui/issue-27033.stderr create mode 100644 src/test/ui/issue-27042.rs create mode 100644 src/test/ui/issue-27042.stderr create mode 100644 src/test/ui/issue-27060-2.rs create mode 100644 src/test/ui/issue-27060-2.stderr create mode 100644 src/test/ui/issue-27078.rs create mode 100644 src/test/ui/issue-27078.stderr create mode 100644 src/test/ui/issue-2718-a.rs create mode 100644 src/test/ui/issue-2718-a.stderr create mode 100644 src/test/ui/issue-27340.rs create mode 100644 src/test/ui/issue-27340.stderr create mode 100644 src/test/ui/issue-27433.rs create mode 100644 src/test/ui/issue-27433.stderr create mode 100644 src/test/ui/issue-27592.nll.stderr create mode 100644 src/test/ui/issue-27592.rs create mode 100644 src/test/ui/issue-27592.stderr create mode 100644 src/test/ui/issue-27815.rs create mode 100644 src/test/ui/issue-27815.stderr create mode 100644 src/test/ui/issue-27895.rs create mode 100644 src/test/ui/issue-27895.stderr create mode 100644 src/test/ui/issue-28098.rs create mode 100644 src/test/ui/issue-28098.stderr create mode 100644 src/test/ui/issue-28105.rs create mode 100644 src/test/ui/issue-28105.stderr create mode 100644 src/test/ui/issue-28109.rs create mode 100644 src/test/ui/issue-28109.stderr create mode 100644 src/test/ui/issue-28113.rs create mode 100644 src/test/ui/issue-28113.stderr create mode 100644 src/test/ui/issue-2823.rs create mode 100644 src/test/ui/issue-2823.stderr create mode 100644 src/test/ui/issue-28324.rs create mode 100644 src/test/ui/issue-28324.stderr create mode 100644 src/test/ui/issue-28344.rs create mode 100644 src/test/ui/issue-28344.stderr create mode 100644 src/test/ui/issue-28433.rs create mode 100644 src/test/ui/issue-28433.stderr create mode 100644 src/test/ui/issue-28472.rs create mode 100644 src/test/ui/issue-28472.stderr create mode 100644 src/test/ui/issue-2849.rs create mode 100644 src/test/ui/issue-2849.stderr create mode 100644 src/test/ui/issue-28576.rs create mode 100644 src/test/ui/issue-28576.stderr create mode 100644 src/test/ui/issue-28586.rs create mode 100644 src/test/ui/issue-28586.stderr create mode 100644 src/test/ui/issue-28625.rs create mode 100644 src/test/ui/issue-28625.stderr create mode 100644 src/test/ui/issue-28992-empty.rs create mode 100644 src/test/ui/issue-28992-empty.stderr create mode 100644 src/test/ui/issue-29084.rs create mode 100644 src/test/ui/issue-29084.stderr create mode 100644 src/test/ui/issue-29147.rs create mode 100644 src/test/ui/issue-29147.stderr create mode 100644 src/test/ui/issue-29161.rs create mode 100644 src/test/ui/issue-29161.stderr create mode 100644 src/test/ui/issue-29184.rs create mode 100644 src/test/ui/issue-29184.stderr create mode 100644 src/test/ui/issue-2937.rs create mode 100644 src/test/ui/issue-2937.stderr create mode 100644 src/test/ui/issue-2951.rs create mode 100644 src/test/ui/issue-2951.stderr create mode 100644 src/test/ui/issue-29857.rs create mode 100644 src/test/ui/issue-29857.stderr create mode 100644 src/test/ui/issue-29861.rs create mode 100644 src/test/ui/issue-29861.stderr create mode 100644 src/test/ui/issue-2995.rs create mode 100644 src/test/ui/issue-2995.stderr create mode 100644 src/test/ui/issue-30079.rs create mode 100644 src/test/ui/issue-30079.stderr create mode 100644 src/test/ui/issue-3008-3.rs create mode 100644 src/test/ui/issue-3008-3.stderr create mode 100644 src/test/ui/issue-3021-b.rs create mode 100644 src/test/ui/issue-3021-b.stderr create mode 100644 src/test/ui/issue-3021-c.rs create mode 100644 src/test/ui/issue-3021-c.stderr create mode 100644 src/test/ui/issue-3021-d.rs create mode 100644 src/test/ui/issue-3021-d.stderr create mode 100644 src/test/ui/issue-3021.rs create mode 100644 src/test/ui/issue-3021.stderr create mode 100644 src/test/ui/issue-30225.rs create mode 100644 src/test/ui/issue-30225.stderr create mode 100644 src/test/ui/issue-30236.rs create mode 100644 src/test/ui/issue-30236.stderr create mode 100644 src/test/ui/issue-30240-b.rs create mode 100644 src/test/ui/issue-30240-b.stderr create mode 100644 src/test/ui/issue-30240.rs create mode 100644 src/test/ui/issue-30240.stderr create mode 100644 src/test/ui/issue-30355.nll.stderr create mode 100644 src/test/ui/issue-30355.rs create mode 100644 src/test/ui/issue-30355.stderr create mode 100644 src/test/ui/issue-3038.rs create mode 100644 src/test/ui/issue-3038.stderr create mode 100644 src/test/ui/issue-30438-a.nll.stderr create mode 100644 src/test/ui/issue-30438-a.rs create mode 100644 src/test/ui/issue-30438-a.stderr create mode 100644 src/test/ui/issue-30438-b.rs create mode 100644 src/test/ui/issue-30438-b.stderr create mode 100644 src/test/ui/issue-30438-c.nll.stderr create mode 100644 src/test/ui/issue-30438-c.rs create mode 100644 src/test/ui/issue-30438-c.stderr create mode 100644 src/test/ui/issue-30560.rs create mode 100644 src/test/ui/issue-30560.stderr create mode 100644 src/test/ui/issue-30589.rs create mode 100644 src/test/ui/issue-30589.stderr create mode 100644 src/test/ui/issue-3080.rs create mode 100644 src/test/ui/issue-3080.stderr create mode 100644 src/test/ui/issue-3096-1.rs create mode 100644 src/test/ui/issue-3096-1.stderr create mode 100644 src/test/ui/issue-3096-2.rs create mode 100644 src/test/ui/issue-3096-2.stderr create mode 100644 src/test/ui/issue-3099-a.rs create mode 100644 src/test/ui/issue-3099-a.stderr create mode 100644 src/test/ui/issue-3099-b.rs create mode 100644 src/test/ui/issue-3099-b.stderr create mode 100644 src/test/ui/issue-3099.rs create mode 100644 src/test/ui/issue-3099.stderr create mode 100644 src/test/ui/issue-31011.rs create mode 100644 src/test/ui/issue-31011.stderr create mode 100644 src/test/ui/issue-31109.rs create mode 100644 src/test/ui/issue-31109.stderr create mode 100644 src/test/ui/issue-31173.rs create mode 100644 src/test/ui/issue-31173.stderr create mode 100644 src/test/ui/issue-31212.rs create mode 100644 src/test/ui/issue-31212.stderr create mode 100644 src/test/ui/issue-31495.rs create mode 100644 src/test/ui/issue-31511.rs create mode 100644 src/test/ui/issue-31511.stderr create mode 100644 src/test/ui/issue-3154.nll.stderr create mode 100644 src/test/ui/issue-3154.rs create mode 100644 src/test/ui/issue-3154.stderr create mode 100644 src/test/ui/issue-31561.rs create mode 100644 src/test/ui/issue-31561.stderr create mode 100644 src/test/ui/issue-31769.rs create mode 100644 src/test/ui/issue-31769.stderr create mode 100644 src/test/ui/issue-31804.rs create mode 100644 src/test/ui/issue-31804.stderr create mode 100644 src/test/ui/issue-31845.rs create mode 100644 src/test/ui/issue-31845.stderr create mode 100644 src/test/ui/issue-31910.rs create mode 100644 src/test/ui/issue-31910.stderr create mode 100644 src/test/ui/issue-31924-non-snake-ffi.rs create mode 100644 src/test/ui/issue-31924-non-snake-ffi.stderr create mode 100644 src/test/ui/issue-32004.rs create mode 100644 src/test/ui/issue-32004.stderr create mode 100644 src/test/ui/issue-32086.rs create mode 100644 src/test/ui/issue-32086.stderr create mode 100644 src/test/ui/issue-32119.rs create mode 100644 src/test/ui/issue-32119.stderr create mode 100644 src/test/ui/issue-3214.rs create mode 100644 src/test/ui/issue-3214.stderr create mode 100644 src/test/ui/issue-32201.rs create mode 100644 src/test/ui/issue-32201.stderr create mode 100644 src/test/ui/issue-32222.rs create mode 100644 src/test/ui/issue-32222.stderr create mode 100644 src/test/ui/issue-32323.rs create mode 100644 src/test/ui/issue-32323.stderr create mode 100644 src/test/ui/issue-32377.rs create mode 100644 src/test/ui/issue-32377.stderr create mode 100644 src/test/ui/issue-32655.rs create mode 100644 src/test/ui/issue-32655.stderr create mode 100644 src/test/ui/issue-32709.rs create mode 100644 src/test/ui/issue-32709.stderr create mode 100644 src/test/ui/issue-32782.rs create mode 100644 src/test/ui/issue-32782.stderr create mode 100644 src/test/ui/issue-32797.rs create mode 100644 src/test/ui/issue-32797.stderr create mode 100644 src/test/ui/issue-32829.rs create mode 100644 src/test/ui/issue-32829.stderr create mode 100644 src/test/ui/issue-32833.rs create mode 100644 src/test/ui/issue-32833.stderr create mode 100644 src/test/ui/issue-32922.rs create mode 100644 src/test/ui/issue-32922.stderr create mode 100644 src/test/ui/issue-32963.rs create mode 100644 src/test/ui/issue-32963.stderr create mode 100644 src/test/ui/issue-32995-2.rs create mode 100644 src/test/ui/issue-32995-2.stderr create mode 100644 src/test/ui/issue-32995.rs create mode 100644 src/test/ui/issue-32995.stderr create mode 100644 src/test/ui/issue-33241.rs create mode 100644 src/test/ui/issue-33241.stderr create mode 100644 src/test/ui/issue-33293.rs create mode 100644 src/test/ui/issue-33293.stderr create mode 100644 src/test/ui/issue-3344.rs create mode 100644 src/test/ui/issue-3344.stderr create mode 100644 src/test/ui/issue-33464.rs create mode 100644 src/test/ui/issue-33464.stderr create mode 100644 src/test/ui/issue-33504.rs create mode 100644 src/test/ui/issue-33504.stderr create mode 100644 src/test/ui/issue-33571.rs create mode 100644 src/test/ui/issue-33571.stderr create mode 100644 src/test/ui/issue-33819.nll.stderr create mode 100644 src/test/ui/issue-33819.rs create mode 100644 src/test/ui/issue-33819.stderr create mode 100644 src/test/ui/issue-34028.rs create mode 100644 src/test/ui/issue-34028.stderr create mode 100644 src/test/ui/issue-34171.rs create mode 100644 src/test/ui/issue-34171.stderr create mode 100644 src/test/ui/issue-34222-1.rs create mode 100644 src/test/ui/issue-34222-1.stderr create mode 100644 src/test/ui/issue-34334.rs create mode 100644 src/test/ui/issue-34334.stderr create mode 100644 src/test/ui/issue-34349.rs create mode 100644 src/test/ui/issue-34349.stderr create mode 100644 src/test/ui/issue-34373.rs create mode 100644 src/test/ui/issue-34373.stderr create mode 100644 src/test/ui/issue-34418.rs create mode 100644 src/test/ui/issue-34418.stderr create mode 100644 src/test/ui/issue-3477.rs create mode 100644 src/test/ui/issue-3477.stderr create mode 100644 src/test/ui/issue-34839.rs create mode 100644 src/test/ui/issue-34839.stderr create mode 100644 src/test/ui/issue-35075.rs create mode 100644 src/test/ui/issue-35075.stderr create mode 100644 src/test/ui/issue-3521-2.rs create mode 100644 src/test/ui/issue-3521-2.stderr create mode 100644 src/test/ui/issue-3521.rs create mode 100644 src/test/ui/issue-3521.stderr create mode 100644 src/test/ui/issue-35450.rs create mode 100644 src/test/ui/issue-35450.stderr create mode 100644 src/test/ui/issue-35570.rs create mode 100644 src/test/ui/issue-35570.stderr create mode 100644 src/test/ui/issue-35668.rs create mode 100644 src/test/ui/issue-35668.stderr create mode 100644 src/test/ui/issue-35988.rs create mode 100644 src/test/ui/issue-35988.stderr create mode 100644 src/test/ui/issue-3601.rs create mode 100644 src/test/ui/issue-3601.stderr create mode 100644 src/test/ui/issue-36082.ast.nll.stderr create mode 100644 src/test/ui/issue-36082.ast.stderr create mode 100644 src/test/ui/issue-36082.mir.stderr create mode 100644 src/test/ui/issue-36082.rs create mode 100644 src/test/ui/issue-36116.rs create mode 100644 src/test/ui/issue-36116.stderr create mode 100644 src/test/ui/issue-36299.rs create mode 100644 src/test/ui/issue-36299.stderr create mode 100644 src/test/ui/issue-36379.rs create mode 100644 src/test/ui/issue-36379.stderr create mode 100644 src/test/ui/issue-36617.rs create mode 100644 src/test/ui/issue-36617.stderr create mode 100644 src/test/ui/issue-36638.rs create mode 100644 src/test/ui/issue-36638.stderr create mode 100644 src/test/ui/issue-3668-2.rs create mode 100644 src/test/ui/issue-3668-2.stderr create mode 100644 src/test/ui/issue-3668.rs create mode 100644 src/test/ui/issue-3668.stderr create mode 100644 src/test/ui/issue-3680.rs create mode 100644 src/test/ui/issue-3680.stderr create mode 100644 src/test/ui/issue-36839.rs create mode 100644 src/test/ui/issue-36839.stderr create mode 100644 src/test/ui/issue-3702-2.rs create mode 100644 src/test/ui/issue-3702-2.stderr create mode 100644 src/test/ui/issue-37026.rs create mode 100644 src/test/ui/issue-37026.stderr create mode 100644 src/test/ui/issue-37051.rs create mode 100644 src/test/ui/issue-37051.stderr create mode 100644 src/test/ui/issue-3707.rs create mode 100644 src/test/ui/issue-3707.stderr create mode 100644 src/test/ui/issue-37323.rs create mode 100644 src/test/ui/issue-37323.stderr create mode 100644 src/test/ui/issue-37366.rs create mode 100644 src/test/ui/issue-37366.stderr create mode 100644 src/test/ui/issue-37510.rs create mode 100644 src/test/ui/issue-37510.stderr create mode 100644 src/test/ui/issue-37515.rs create mode 100644 src/test/ui/issue-37515.stderr create mode 100644 src/test/ui/issue-37534.rs create mode 100644 src/test/ui/issue-37534.stderr create mode 100644 src/test/ui/issue-37550.rs create mode 100644 src/test/ui/issue-37550.stderr create mode 100644 src/test/ui/issue-37576.rs create mode 100644 src/test/ui/issue-37576.stderr create mode 100644 src/test/ui/issue-3763.rs create mode 100644 src/test/ui/issue-3763.stderr create mode 100644 src/test/ui/issue-37665.rs create mode 100644 src/test/ui/issue-37665.stderr create mode 100644 src/test/ui/issue-37887.rs create mode 100644 src/test/ui/issue-37887.stderr create mode 100644 src/test/ui/issue-38160.rs create mode 100644 src/test/ui/issue-38160.stderr create mode 100644 src/test/ui/issue-3820.rs create mode 100644 src/test/ui/issue-3820.stderr create mode 100644 src/test/ui/issue-38293.rs create mode 100644 src/test/ui/issue-38293.stderr create mode 100644 src/test/ui/issue-38381.rs create mode 100644 src/test/ui/issue-38381.stderr create mode 100644 src/test/ui/issue-38404.rs create mode 100644 src/test/ui/issue-38404.stderr create mode 100644 src/test/ui/issue-38412.rs create mode 100644 src/test/ui/issue-38412.stderr create mode 100644 src/test/ui/issue-38458.rs create mode 100644 src/test/ui/issue-38458.stderr create mode 100644 src/test/ui/issue-38604.rs create mode 100644 src/test/ui/issue-38604.stderr create mode 100644 src/test/ui/issue-38857.rs create mode 100644 src/test/ui/issue-38857.stderr create mode 100644 src/test/ui/issue-38868.rs create mode 100644 src/test/ui/issue-38868.stderr create mode 100644 src/test/ui/issue-38919.rs create mode 100644 src/test/ui/issue-38919.stderr create mode 100644 src/test/ui/issue-38954.rs create mode 100644 src/test/ui/issue-38954.stderr create mode 100644 src/test/ui/issue-39211.rs create mode 100644 src/test/ui/issue-39211.stderr create mode 100644 src/test/ui/issue-39362.rs create mode 100644 src/test/ui/issue-39362.stderr create mode 100644 src/test/ui/issue-39388.rs create mode 100644 src/test/ui/issue-39388.stderr create mode 100644 src/test/ui/issue-39404.rs create mode 100644 src/test/ui/issue-39404.stderr create mode 100644 src/test/ui/issue-39559-2.rs create mode 100644 src/test/ui/issue-39559-2.stderr create mode 100644 src/test/ui/issue-39559.rs create mode 100644 src/test/ui/issue-39559.stderr create mode 100644 src/test/ui/issue-39616.rs create mode 100644 src/test/ui/issue-39616.stderr create mode 100644 src/test/ui/issue-39687.rs create mode 100644 src/test/ui/issue-39687.stderr create mode 100644 src/test/ui/issue-3973.rs create mode 100644 src/test/ui/issue-3973.stderr create mode 100644 src/test/ui/issue-39848.rs create mode 100644 src/test/ui/issue-39848.stderr create mode 100644 src/test/ui/issue-3993.rs create mode 100644 src/test/ui/issue-3993.stderr create mode 100644 src/test/ui/issue-39970.rs create mode 100644 src/test/ui/issue-39970.stderr create mode 100644 src/test/ui/issue-39974.rs create mode 100644 src/test/ui/issue-39974.stderr create mode 100644 src/test/ui/issue-40000.rs create mode 100644 src/test/ui/issue-40000.stderr create mode 100644 src/test/ui/issue-40288-2.nll.stderr create mode 100644 src/test/ui/issue-40288-2.rs create mode 100644 src/test/ui/issue-40288-2.stderr create mode 100644 src/test/ui/issue-40288.nll.stderr create mode 100644 src/test/ui/issue-40288.rs create mode 100644 src/test/ui/issue-40288.stderr create mode 100644 src/test/ui/issue-40350.rs create mode 100644 src/test/ui/issue-40350.stderr create mode 100644 src/test/ui/issue-40510-1.nll.stderr create mode 100644 src/test/ui/issue-40510-1.rs create mode 100644 src/test/ui/issue-40510-1.stderr create mode 100644 src/test/ui/issue-40510-2.rs create mode 100644 src/test/ui/issue-40510-2.stderr create mode 100644 src/test/ui/issue-40510-3.nll.stderr create mode 100644 src/test/ui/issue-40510-3.rs create mode 100644 src/test/ui/issue-40510-3.stderr create mode 100644 src/test/ui/issue-40510-4.rs create mode 100644 src/test/ui/issue-40510-4.stderr create mode 100644 src/test/ui/issue-40610.rs create mode 100644 src/test/ui/issue-40610.stderr create mode 100644 src/test/ui/issue-40749.rs create mode 100644 src/test/ui/issue-40749.stderr create mode 100644 src/test/ui/issue-40845.rs create mode 100644 src/test/ui/issue-40845.stderr create mode 100644 src/test/ui/issue-40861.rs create mode 100644 src/test/ui/issue-40861.stderr create mode 100644 src/test/ui/issue-41139.nll.stderr create mode 100644 src/test/ui/issue-41139.rs create mode 100644 src/test/ui/issue-41139.stderr create mode 100644 src/test/ui/issue-41229-ref-str.rs create mode 100644 src/test/ui/issue-41229-ref-str.stderr create mode 100644 src/test/ui/issue-41255.rs create mode 100644 src/test/ui/issue-41255.stderr create mode 100644 src/test/ui/issue-41394.rs create mode 100644 src/test/ui/issue-41394.stderr create mode 100644 src/test/ui/issue-41726.nll.stderr create mode 100644 src/test/ui/issue-41726.rs create mode 100644 src/test/ui/issue-41726.stderr create mode 100644 src/test/ui/issue-41742.rs create mode 100644 src/test/ui/issue-41742.stderr create mode 100644 src/test/ui/issue-41776.rs create mode 100644 src/test/ui/issue-41776.stderr create mode 100644 src/test/ui/issue-41880.rs create mode 100644 src/test/ui/issue-41880.stderr create mode 100644 src/test/ui/issue-41974.rs create mode 100644 src/test/ui/issue-41974.stderr create mode 100644 src/test/ui/issue-41998.rs create mode 100644 src/test/ui/issue-41998.stderr create mode 100644 src/test/ui/issue-4201.rs create mode 100644 src/test/ui/issue-4201.stderr create mode 100644 src/test/ui/issue-42312.rs create mode 100644 src/test/ui/issue-42312.stderr create mode 100644 src/test/ui/issue-42344.nll.stderr create mode 100644 src/test/ui/issue-42344.rs create mode 100644 src/test/ui/issue-42344.stderr create mode 100644 src/test/ui/issue-4265.rs create mode 100644 src/test/ui/issue-4265.stderr create mode 100644 src/test/ui/issue-42755.rs create mode 100644 src/test/ui/issue-42755.stderr create mode 100644 src/test/ui/issue-42796.nll.stderr create mode 100644 src/test/ui/issue-42796.rs create mode 100644 src/test/ui/issue-42796.stderr create mode 100644 src/test/ui/issue-42880.rs create mode 100644 src/test/ui/issue-42880.stderr create mode 100644 src/test/ui/issue-43023.rs create mode 100644 src/test/ui/issue-43023.stderr create mode 100644 src/test/ui/issue-43105.rs create mode 100644 src/test/ui/issue-43105.stderr create mode 100644 src/test/ui/issue-43162.rs create mode 100644 src/test/ui/issue-43162.stderr create mode 100644 src/test/ui/issue-4321.rs create mode 100644 src/test/ui/issue-4321.stderr create mode 100644 src/test/ui/issue-43250.rs create mode 100644 src/test/ui/issue-43250.stderr create mode 100644 src/test/ui/issue-43355.rs create mode 100644 src/test/ui/issue-43355.stderr create mode 100644 src/test/ui/issue-43424.rs create mode 100644 src/test/ui/issue-43424.stderr create mode 100644 src/test/ui/issue-43431.rs create mode 100644 src/test/ui/issue-43431.stderr create mode 100644 src/test/ui/issue-4366-2.rs create mode 100644 src/test/ui/issue-4366-2.stderr create mode 100644 src/test/ui/issue-4366.rs create mode 100644 src/test/ui/issue-4366.stderr create mode 100644 src/test/ui/issue-43733-2.rs create mode 100644 src/test/ui/issue-43733-2.stderr create mode 100644 src/test/ui/issue-43733.rs create mode 100644 src/test/ui/issue-43733.stderr create mode 100644 src/test/ui/issue-43784-associated-type.rs create mode 100644 src/test/ui/issue-43784-associated-type.stderr create mode 100644 src/test/ui/issue-43784-supertrait.rs create mode 100644 src/test/ui/issue-43784-supertrait.stderr create mode 100644 src/test/ui/issue-43925.rs create mode 100644 src/test/ui/issue-43925.stderr create mode 100644 src/test/ui/issue-43926.rs create mode 100644 src/test/ui/issue-43926.stderr create mode 100644 src/test/ui/issue-43988.rs create mode 100644 src/test/ui/issue-43988.stderr create mode 100644 src/test/ui/issue-44021.rs create mode 100644 src/test/ui/issue-44021.stderr create mode 100644 src/test/ui/issue-44239.rs create mode 100644 src/test/ui/issue-44239.stderr create mode 100644 src/test/ui/issue-44373.rs create mode 100644 src/test/ui/issue-44373.stderr create mode 100644 src/test/ui/issue-44415.rs create mode 100644 src/test/ui/issue-44415.stderr create mode 100644 src/test/ui/issue-45087-unreachable-unsafe.rs create mode 100644 src/test/ui/issue-45087-unreachable-unsafe.stderr create mode 100644 src/test/ui/issue-4517.rs create mode 100644 src/test/ui/issue-4517.stderr create mode 100644 src/test/ui/issue-45199.ast.nll.stderr create mode 100644 src/test/ui/issue-45199.ast.stderr create mode 100644 src/test/ui/issue-45199.mir.stderr create mode 100644 src/test/ui/issue-45199.rs create mode 100644 src/test/ui/issue-45729-unsafe-in-generator.rs create mode 100644 src/test/ui/issue-45729-unsafe-in-generator.stderr create mode 100644 src/test/ui/issue-45801.rs create mode 100644 src/test/ui/issue-45801.stderr create mode 100644 src/test/ui/issue-45965.rs create mode 100644 src/test/ui/issue-45965.stderr create mode 100644 src/test/ui/issue-46023.ast.nll.stderr create mode 100644 src/test/ui/issue-46023.ast.stderr create mode 100644 src/test/ui/issue-46023.mir.stderr create mode 100644 src/test/ui/issue-46023.rs create mode 100644 src/test/ui/issue-46036.rs create mode 100644 src/test/ui/issue-46036.stderr create mode 100644 src/test/ui/issue-46311.rs create mode 100644 src/test/ui/issue-46311.stderr create mode 100644 src/test/ui/issue-46438.rs create mode 100644 src/test/ui/issue-46438.stderr create mode 100644 src/test/ui/issue-46604.ast.nll.stderr create mode 100644 src/test/ui/issue-46604.ast.stderr create mode 100644 src/test/ui/issue-46604.mir.stderr create mode 100644 src/test/ui/issue-46604.rs create mode 100644 src/test/ui/issue-46771.rs create mode 100644 src/test/ui/issue-46771.stderr create mode 100644 src/test/ui/issue-46843.rs create mode 100644 src/test/ui/issue-46843.stderr create mode 100644 src/test/ui/issue-47309.rs create mode 100644 src/test/ui/issue-4736.rs create mode 100644 src/test/ui/issue-4736.stderr create mode 100644 src/test/ui/issue-47412.rs create mode 100644 src/test/ui/issue-47412.stderr create mode 100644 src/test/ui/issue-47715.rs create mode 100644 src/test/ui/issue-47715.stderr create mode 100644 src/test/ui/issue-48131.rs create mode 100644 src/test/ui/issue-48131.stderr create mode 100644 src/test/ui/issue-48838.rs create mode 100644 src/test/ui/issue-48838.stderr create mode 100644 src/test/ui/issue-4968.rs create mode 100644 src/test/ui/issue-4968.stderr create mode 100644 src/test/ui/issue-4972.rs create mode 100644 src/test/ui/issue-4972.stderr create mode 100644 src/test/ui/issue-50471.rs create mode 100644 src/test/ui/issue-50600.rs create mode 100644 src/test/ui/issue-50600.stderr create mode 100644 src/test/ui/issue-5062.rs create mode 100644 src/test/ui/issue-5062.stderr create mode 100644 src/test/ui/issue-5067.rs create mode 100644 src/test/ui/issue-5067.stderr create mode 100644 src/test/ui/issue-50688.rs create mode 100644 src/test/ui/issue-50688.stderr create mode 100644 src/test/ui/issue-5099.rs create mode 100644 src/test/ui/issue-5099.stderr create mode 100644 src/test/ui/issue-5100.rs create mode 100644 src/test/ui/issue-5100.stderr create mode 100644 src/test/ui/issue-5153.rs create mode 100644 src/test/ui/issue-5153.stderr create mode 100644 src/test/ui/issue-5216.rs create mode 100644 src/test/ui/issue-5216.stderr create mode 100644 src/test/ui/issue-52213.nll.stderr create mode 100644 src/test/ui/issue-52213.rs create mode 100644 src/test/ui/issue-52213.stderr create mode 100644 src/test/ui/issue-5358-1.rs create mode 100644 src/test/ui/issue-5358-1.stderr create mode 100644 src/test/ui/issue-5439.rs create mode 100644 src/test/ui/issue-5439.stderr create mode 100644 src/test/ui/issue-5883.rs create mode 100644 src/test/ui/issue-5883.stderr create mode 100644 src/test/ui/issue-5927.rs create mode 100644 src/test/ui/issue-5927.stderr create mode 100644 src/test/ui/issue-5997-enum.rs create mode 100644 src/test/ui/issue-5997-enum.stderr create mode 100644 src/test/ui/issue-5997-struct.rs create mode 100644 src/test/ui/issue-5997-struct.stderr create mode 100644 src/test/ui/issue-6458-2.rs create mode 100644 src/test/ui/issue-6458-2.stderr create mode 100644 src/test/ui/issue-6596-1.rs create mode 100644 src/test/ui/issue-6596-1.stderr create mode 100644 src/test/ui/issue-6596-2.rs create mode 100644 src/test/ui/issue-6596-2.stderr create mode 100644 src/test/ui/issue-6642.rs create mode 100644 src/test/ui/issue-6642.stderr create mode 100644 src/test/ui/issue-6738.rs create mode 100644 src/test/ui/issue-6738.stderr create mode 100644 src/test/ui/issue-6801.nll.stderr create mode 100644 src/test/ui/issue-6801.rs create mode 100644 src/test/ui/issue-6801.stderr create mode 100644 src/test/ui/issue-6804.rs create mode 100644 src/test/ui/issue-6804.stderr create mode 100644 src/test/ui/issue-6936.rs create mode 100644 src/test/ui/issue-6936.stderr create mode 100644 src/test/ui/issue-7013.rs create mode 100644 src/test/ui/issue-7013.stderr create mode 100644 src/test/ui/issue-7044.rs create mode 100644 src/test/ui/issue-7044.stderr create mode 100644 src/test/ui/issue-7061.rs create mode 100644 src/test/ui/issue-7061.stderr create mode 100644 src/test/ui/issue-7092.rs create mode 100644 src/test/ui/issue-7092.stderr create mode 100644 src/test/ui/issue-7246.rs create mode 100644 src/test/ui/issue-7246.stderr create mode 100644 src/test/ui/issue-7364.rs create mode 100644 src/test/ui/issue-7364.stderr create mode 100644 src/test/ui/issue-7607-1.rs create mode 100644 src/test/ui/issue-7607-1.stderr create mode 100644 src/test/ui/issue-7867.rs create mode 100644 src/test/ui/issue-7867.stderr create mode 100644 src/test/ui/issue-7950.rs create mode 100644 src/test/ui/issue-7950.stderr create mode 100644 src/test/ui/issue-7970a.rs create mode 100644 src/test/ui/issue-7970a.stderr create mode 100644 src/test/ui/issue-7970b.rs create mode 100644 src/test/ui/issue-7970b.stderr create mode 100644 src/test/ui/issue-8153.rs create mode 100644 src/test/ui/issue-8153.stderr create mode 100644 src/test/ui/issue-8208.rs create mode 100644 src/test/ui/issue-8208.stderr create mode 100644 src/test/ui/issue-8460-const.rs create mode 100644 src/test/ui/issue-8460-const.stderr create mode 100644 src/test/ui/issue-8640.rs create mode 100644 src/test/ui/issue-8640.stderr create mode 100644 src/test/ui/issue-8727.rs create mode 100644 src/test/ui/issue-8727.stderr create mode 100644 src/test/ui/issue-8761.rs create mode 100644 src/test/ui/issue-8761.stderr create mode 100644 src/test/ui/issue-8767.rs create mode 100644 src/test/ui/issue-8767.stderr create mode 100644 src/test/ui/issue-9575.rs create mode 100644 src/test/ui/issue-9575.stderr create mode 100644 src/test/ui/issue-9725.rs create mode 100644 src/test/ui/issue-9725.stderr create mode 100644 src/test/ui/issue-9814.rs create mode 100644 src/test/ui/issue-9814.stderr create mode 100644 src/test/ui/issue-pr29383.rs create mode 100644 src/test/ui/issue-pr29383.stderr (limited to 'src/test') diff --git a/src/test/compile-fail/issue-10176.rs b/src/test/compile-fail/issue-10176.rs deleted file mode 100644 index c968844ae21..00000000000 --- a/src/test/compile-fail/issue-10176.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f() -> isize { - (return 1, return 2) -//~^ ERROR mismatched types -//~| expected type `isize` -//~| found type `(!, !)` -//~| expected isize, found tuple -} - -fn main() {} diff --git a/src/test/compile-fail/issue-10200.rs b/src/test/compile-fail/issue-10200.rs deleted file mode 100644 index 8c58ef6261e..00000000000 --- a/src/test/compile-fail/issue-10200.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo(bool); -fn foo(_: usize) -> Foo { Foo(false) } - -fn main() { - match Foo(true) { - foo(x) //~ ERROR expected tuple struct/variant, found function `foo` - => () - } -} diff --git a/src/test/compile-fail/issue-10291.rs b/src/test/compile-fail/issue-10291.rs deleted file mode 100644 index d4e7dc7e9a3..00000000000 --- a/src/test/compile-fail/issue-10291.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn test<'x>(x: &'x isize) { - drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { - x //~ ERROR E0312 - })); -} - -fn main() {} diff --git a/src/test/compile-fail/issue-10398.rs b/src/test/compile-fail/issue-10398.rs deleted file mode 100644 index 08e8effc626..00000000000 --- a/src/test/compile-fail/issue-10398.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -fn main() { - let x: Box<_> = box 1; - let f = move|| { - let _a = x; - drop(x); - //~^ ERROR: use of moved value: `x` - }; - f(); -} diff --git a/src/test/compile-fail/issue-10401.rs b/src/test/compile-fail/issue-10401.rs deleted file mode 100644 index e36193aee25..00000000000 --- a/src/test/compile-fail/issue-10401.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let mut a = "a"; - a += { "b" }; - //~^ ERROR: binary assignment operation `+=` cannot be applied -} diff --git a/src/test/compile-fail/issue-10412.rs b/src/test/compile-fail/issue-10412.rs deleted file mode 100644 index ee553730a35..00000000000 --- a/src/test/compile-fail/issue-10412.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names - fn serialize(val : &'self T) -> Vec; //~ ERROR lifetimes cannot use keyword names - fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names -} - -impl<'self> Serializable for &'self str { //~ ERROR lifetimes cannot use keyword names - //~^ ERROR lifetimes cannot use keyword names - //~| ERROR missing lifetime specifier - fn serialize(val : &'self str) -> Vec { //~ ERROR lifetimes cannot use keyword names - vec![1] - } - fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names - "hi" - } -} - -fn main() { - println!("hello"); - let x = "foo".to_string(); - let y = x; - println!("{}", y); -} diff --git a/src/test/compile-fail/issue-10465.rs b/src/test/compile-fail/issue-10465.rs deleted file mode 100644 index ed91e935407..00000000000 --- a/src/test/compile-fail/issue-10465.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub mod a { - pub trait A { - fn foo(&self); - } - -} -pub mod b { - use a::A; - - pub struct B; - impl A for B { fn foo(&self) {} } - - pub mod c { - use b::B; - - fn foo(b: &B) { - b.foo(); //~ ERROR: no method named `foo` found - } - } - -} - -fn main() {} diff --git a/src/test/compile-fail/issue-10536.rs b/src/test/compile-fail/issue-10536.rs deleted file mode 100644 index 3b0ea55cfa9..00000000000 --- a/src/test/compile-fail/issue-10536.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We only want to assert that this doesn't ICE, we don't particularly care -// about whether it nor it fails to compile. - -// error-pattern: - -macro_rules! foo{ - () => {{ - macro_rules! bar{() => (())} - 1 - }} -} - -pub fn main() { - foo!(); - - assert!({one! two()}); - - // regardless of whether nested macro_rules works, the following should at - // least throw a conventional error. - assert!({one! two}); -} diff --git a/src/test/compile-fail/issue-10545.rs b/src/test/compile-fail/issue-10545.rs deleted file mode 100644 index 708eea39a95..00000000000 --- a/src/test/compile-fail/issue-10545.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -mod a { - struct S; - impl S { } -} - -fn foo(_: a::S) { //~ ERROR: struct `S` is private -} - -fn main() {} diff --git a/src/test/compile-fail/issue-10656.rs b/src/test/compile-fail/issue-10656.rs deleted file mode 100644 index 0b335a526a4..00000000000 --- a/src/test/compile-fail/issue-10656.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: missing documentation for crate - -#![deny(missing_docs)] -#![crate_type="lib"] diff --git a/src/test/compile-fail/issue-10755.rs b/src/test/compile-fail/issue-10755.rs deleted file mode 100644 index 57915bce456..00000000000 --- a/src/test/compile-fail/issue-10755.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -C linker=llllll -Z linker-flavor=ld -// error-pattern: linker `llllll` not found - -fn main() { -} diff --git a/src/test/compile-fail/issue-10764.rs b/src/test/compile-fail/issue-10764.rs deleted file mode 100644 index cd4ec495556..00000000000 --- a/src/test/compile-fail/issue-10764.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f(_: extern "Rust" fn()) {} -extern fn bar() {} - -fn main() { f(bar) } -//~^ ERROR mismatched types diff --git a/src/test/compile-fail/issue-10877.rs b/src/test/compile-fail/issue-10877.rs deleted file mode 100644 index 39f25b837cd..00000000000 --- a/src/test/compile-fail/issue-10877.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo { x: isize } -extern { - fn foo(1: ()); - //~^ ERROR: patterns aren't allowed in foreign function declarations - fn bar((): isize); - //~^ ERROR: patterns aren't allowed in foreign function declarations - fn baz(Foo { x }: isize); - //~^ ERROR: patterns aren't allowed in foreign function declarations - fn qux((x,y): ()); - //~^ ERROR: patterns aren't allowed in foreign function declarations - fn this_is_actually_ok(a: usize); - fn and_so_is_this(_: usize); -} -fn main() {} diff --git a/src/test/compile-fail/issue-10991.rs b/src/test/compile-fail/issue-10991.rs deleted file mode 100644 index 2d00f339f33..00000000000 --- a/src/test/compile-fail/issue-10991.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let nil = (); - let _t = nil as usize; //~ ERROR: non-primitive cast: `()` as `usize` -} diff --git a/src/test/compile-fail/issue-11154.rs b/src/test/compile-fail/issue-11154.rs deleted file mode 100644 index 1ff68123374..00000000000 --- a/src/test/compile-fail/issue-11154.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -C lto -C prefer-dynamic - -// error-pattern: cannot prefer dynamic linking - -fn main() {} diff --git a/src/test/compile-fail/issue-11192.rs b/src/test/compile-fail/issue-11192.rs deleted file mode 100644 index 7d8a1528aba..00000000000 --- a/src/test/compile-fail/issue-11192.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -struct Foo { - x: isize -} - -impl Drop for Foo { - fn drop(&mut self) { - println!("drop {}", self.x); - } -} - -fn main() { - let mut ptr: Box<_> = box Foo { x: 0 }; - let mut test = |foo: &Foo| { - println!("access {}", foo.x); - ptr = box Foo { x: ptr.x + 1 }; - println!("access {}", foo.x); - }; - test(&*ptr); - //~^ ERROR: cannot borrow `*ptr` as immutable -} diff --git a/src/test/compile-fail/issue-11374.rs b/src/test/compile-fail/issue-11374.rs deleted file mode 100644 index 1e444a6bebf..00000000000 --- a/src/test/compile-fail/issue-11374.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::io::{self, Read}; -use std::vec; - -pub struct Container<'a> { - reader: &'a mut Read -} - -impl<'a> Container<'a> { - pub fn wrap<'s>(reader: &'s mut io::Read) -> Container<'s> { - Container { reader: reader } - } - - pub fn read_to(&mut self, vec: &mut [u8]) { - self.reader.read(vec); - } -} - -pub fn for_stdin<'a>() -> Container<'a> { - let mut r = io::stdin(); - Container::wrap(&mut r as &mut io::Read) -} - -fn main() { - let mut c = for_stdin(); - let mut v = Vec::new(); - c.read_to(v); //~ ERROR E0308 -} diff --git a/src/test/compile-fail/issue-11493.rs b/src/test/compile-fail/issue-11493.rs deleted file mode 100644 index 3045c06ca4c..00000000000 --- a/src/test/compile-fail/issue-11493.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This file must never have a trailing newline - -fn id(x: T) -> T { x } - -fn main() { - let x = Some(3); - let y = x.as_ref().unwrap_or(&id(5)); //~ ERROR: borrowed value does not live long enough -} diff --git a/src/test/compile-fail/issue-11515.rs b/src/test/compile-fail/issue-11515.rs deleted file mode 100644 index 7afb8314ea6..00000000000 --- a/src/test/compile-fail/issue-11515.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -struct Test { - func: Box -} - -fn main() { - let closure: Box = Box::new(|| ()); - let test = box Test { func: closure }; //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-11681.rs b/src/test/compile-fail/issue-11681.rs deleted file mode 100644 index 71f1d5dcc9a..00000000000 --- a/src/test/compile-fail/issue-11681.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This tests verifies that unary structs and enum variants -// are treated as rvalues and their lifetime is not bounded to -// the static scope. - -struct Test; - -impl Drop for Test { - fn drop (&mut self) {} -} - -fn createTest<'a>() -> &'a Test { - let testValue = &Test; //~ ERROR borrowed value does not live long enough - return testValue; -} - - -pub fn main() { - createTest(); -} diff --git a/src/test/compile-fail/issue-11692-1.rs b/src/test/compile-fail/issue-11692-1.rs deleted file mode 100644 index f577aad04e6..00000000000 --- a/src/test/compile-fail/issue-11692-1.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - print!(test!()); - //~^ ERROR: format argument must be a string literal -} diff --git a/src/test/compile-fail/issue-11692-2.rs b/src/test/compile-fail/issue-11692-2.rs deleted file mode 100644 index acac2d151fe..00000000000 --- a/src/test/compile-fail/issue-11692-2.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - concat!(test!()); - //~^ ERROR cannot find macro `test!` in this scope -} diff --git a/src/test/compile-fail/issue-11740.rs b/src/test/compile-fail/issue-11740.rs deleted file mode 100644 index 0bda06be9e8..00000000000 --- a/src/test/compile-fail/issue-11740.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -struct Attr { - name: String, - value: String, -} - -struct Element { - attrs: Vec>, -} - -impl Element { - pub unsafe fn get_attr<'a>(&'a self, name: &str) { - self.attrs - .iter() - .find(|attr| { - let attr: &&Box = std::mem::transmute(attr); - true - }); - } -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let element = Element { attrs: Vec::new() }; - let _ = unsafe { element.get_attr("foo") }; -} diff --git a/src/test/compile-fail/issue-11771.rs b/src/test/compile-fail/issue-11771.rs deleted file mode 100644 index 69899105bc3..00000000000 --- a/src/test/compile-fail/issue-11771.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let x = (); - 1 + - x //~^ ERROR E0277 - ; - - let x: () = (); - 1 + - x //~^ ERROR E0277 - ; -} diff --git a/src/test/compile-fail/issue-11844.rs b/src/test/compile-fail/issue-11844.rs deleted file mode 100644 index a6dbe954ec0..00000000000 --- a/src/test/compile-fail/issue-11844.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -fn main() { - let a = Some(box 1); - match a { - Ok(a) => //~ ERROR: mismatched types - println!("{}",a), - None => panic!() - } -} diff --git a/src/test/compile-fail/issue-11873.rs b/src/test/compile-fail/issue-11873.rs deleted file mode 100644 index 4618851529a..00000000000 --- a/src/test/compile-fail/issue-11873.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let mut v = vec![1]; - let mut f = || v.push(2); - let _w = v; //~ ERROR: cannot move out of `v` - - f(); -} diff --git a/src/test/compile-fail/issue-12028.rs b/src/test/compile-fail/issue-12028.rs deleted file mode 100644 index 980385ce4cc..00000000000 --- a/src/test/compile-fail/issue-12028.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test an example where we fail to infer the type parameter H. This -// is because there is really nothing constraining it. At one time, we -// would infer based on the where clauses in scope, but that no longer -// works. - -trait Hash { - fn hash2(&self, hasher: &H) -> u64; -} - -trait Stream { - fn input(&mut self, bytes: &[u8]); - fn result(&self) -> u64; -} - -trait StreamHasher { - type S : Stream; - fn stream(&self) -> Self::S; -} - -////////////////////////////////////////////////////////////////////////////// - -trait StreamHash: Hash { - fn input_stream(&self, stream: &mut H::S); -} - -impl Hash for u8 { - fn hash2(&self, hasher: &H) -> u64 { - let mut stream = hasher.stream(); - self.input_stream(&mut stream); //~ ERROR type annotations required - Stream::result(&stream) - } -} - -impl StreamHash for u8 { - fn input_stream(&self, stream: &mut H::S) { - Stream::input(stream, &[*self]); - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-12041.rs b/src/test/compile-fail/issue-12041.rs deleted file mode 100644 index f0f4bf5ca71..00000000000 --- a/src/test/compile-fail/issue-12041.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::sync::mpsc::channel; -use std::thread; - -fn main() { - let (tx, rx) = channel(); - let _t = thread::spawn(move|| -> () { - loop { - let tx = tx; - //~^ ERROR: use of moved value: `tx` - tx.send(1); - } - }); -} diff --git a/src/test/compile-fail/issue-12116.rs b/src/test/compile-fail/issue-12116.rs deleted file mode 100644 index a8d2c552553..00000000000 --- a/src/test/compile-fail/issue-12116.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_patterns)] -#![feature(box_syntax)] -#![allow(dead_code)] -#![allow(unused_variables)] -#![deny(unreachable_patterns)] - -enum IntList { - Cons(isize, Box), - Nil -} - -fn tail(source_list: &IntList) -> IntList { - match source_list { - &IntList::Cons(val, box ref next_list) => tail(next_list), - &IntList::Cons(val, box IntList::Nil) => IntList::Cons(val, box IntList::Nil), -//~^ ERROR unreachable pattern - _ => panic!() - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-12127.rs b/src/test/compile-fail/issue-12127.rs deleted file mode 100644 index 5565a9a5761..00000000000 --- a/src/test/compile-fail/issue-12127.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax, unboxed_closures)] - -fn to_fn_once>(f: F) -> F { f } -fn do_it(x: &isize) { } - -fn main() { - let x: Box<_> = box 22; - let f = to_fn_once(move|| do_it(&*x)); - to_fn_once(move|| { - f(); - f(); - //~^ ERROR: use of moved value: `f` - })() -} diff --git a/src/test/compile-fail/issue-12369.rs b/src/test/compile-fail/issue-12369.rs deleted file mode 100644 index 1b9af393ccc..00000000000 --- a/src/test/compile-fail/issue-12369.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(slice_patterns)] -#![deny(unreachable_patterns)] - -fn main() { - let sl = vec![1,2,3]; - let v: isize = match &*sl { - &[] => 0, - &[a,b,c] => 3, - &[a, ref rest..] => a, - &[10,a, ref rest..] => 10 //~ ERROR: unreachable pattern - }; -} diff --git a/src/test/compile-fail/issue-12470.rs b/src/test/compile-fail/issue-12470.rs deleted file mode 100644 index 93785817e14..00000000000 --- a/src/test/compile-fail/issue-12470.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -trait X { - fn get_i(&self) -> isize; -} - - -struct B { - i: isize -} - -impl X for B { - fn get_i(&self) -> isize { - self.i - } -} - -struct A<'a> { - p: &'a (X+'a) -} - -fn make_a<'a>(p: &'a X) -> A<'a> { - A { p: p } -} - -fn make_make_a<'a>() -> A<'a> { - let b: Box = box B {i:1}; - let bb: &B = &*b; //~ ERROR does not live long enough - make_a(bb) -} - -fn main() { - let _a = make_make_a(); -} diff --git a/src/test/compile-fail/issue-12552.rs b/src/test/compile-fail/issue-12552.rs deleted file mode 100644 index e4788bac256..00000000000 --- a/src/test/compile-fail/issue-12552.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// this code used to cause an ICE - -fn main() { - let t = Err(0); - match t { - Some(k) => match k { //~ ERROR mismatched types - a => println!("{}", a) - }, - None => () //~ ERROR mismatched types - } -} diff --git a/src/test/compile-fail/issue-12567.rs b/src/test/compile-fail/issue-12567.rs deleted file mode 100644 index 30cdd07b399..00000000000 --- a/src/test/compile-fail/issue-12567.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(slice_patterns)] - -fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) { - match (l1, l2) { - (&[], &[]) => println!("both empty"), - (&[], &[hd, ..]) | (&[hd, ..], &[]) - => println!("one empty"), - //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice - //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice - (&[hd1, ..], &[hd2, ..]) - => println!("both nonempty"), - //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice - //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-12796.rs b/src/test/compile-fail/issue-12796.rs deleted file mode 100644 index 0c3c82a99f2..00000000000 --- a/src/test/compile-fail/issue-12796.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Trait { - fn outer(&self) { - fn inner(_: &Self) { - //~^ ERROR can't use type parameters from outer function - } - } -} - -fn main() { } diff --git a/src/test/compile-fail/issue-12863.rs b/src/test/compile-fail/issue-12863.rs deleted file mode 100644 index d3432410c54..00000000000 --- a/src/test/compile-fail/issue-12863.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod foo { pub fn bar() {} } - -fn main() { - match () { - foo::bar => {} //~ ERROR expected unit struct/variant or constant, found function `foo::bar` - } -} diff --git a/src/test/compile-fail/issue-12997-1.rs b/src/test/compile-fail/issue-12997-1.rs deleted file mode 100644 index 2d8d7857c99..00000000000 --- a/src/test/compile-fail/issue-12997-1.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: --test - -//! Test that makes sure wrongly-typed bench functions aren't ignored - -#[bench] -fn foo() { } //~ ERROR functions used as benches - -#[bench] -fn bar(x: isize, y: isize) { } //~ ERROR functions used as benches diff --git a/src/test/compile-fail/issue-12997-2.rs b/src/test/compile-fail/issue-12997-2.rs deleted file mode 100644 index 8d3df68577b..00000000000 --- a/src/test/compile-fail/issue-12997-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: --test - -//! Test that makes sure wrongly-typed bench functions are rejected - -#[bench] -fn bar(x: isize) { } -//~^ ERROR mismatched types diff --git a/src/test/compile-fail/issue-13033.rs b/src/test/compile-fail/issue-13033.rs deleted file mode 100644 index f1fd617717a..00000000000 --- a/src/test/compile-fail/issue-13033.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo { - fn bar(&mut self, other: &mut Foo); -} - -struct Baz; - -impl Foo for Baz { - fn bar(&mut self, other: &Foo) {} - //~^ ERROR method `bar` has an incompatible type for trait - //~| expected type `fn(&mut Baz, &mut dyn Foo)` - //~| found type `fn(&mut Baz, &dyn Foo)` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-13352.rs b/src/test/compile-fail/issue-13352.rs deleted file mode 100644 index e9d76c758cd..00000000000 --- a/src/test/compile-fail/issue-13352.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-cloudabi no std::process - -fn foo(_: Box) {} - -fn main() { - foo(loop { - std::process::exit(0); - }); - 2_usize + (loop {}); - //~^ ERROR E0277 -} diff --git a/src/test/compile-fail/issue-13359.rs b/src/test/compile-fail/issue-13359.rs deleted file mode 100644 index e33859e8c19..00000000000 --- a/src/test/compile-fail/issue-13359.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo(_s: i16) { } - -fn bar(_s: u32) { } - -fn main() { - foo(1*(1 as isize)); - //~^ ERROR mismatched types - //~| expected i16, found isize - - bar(1*(1 as usize)); - //~^ ERROR mismatched types - //~| expected u32, found usize -} diff --git a/src/test/compile-fail/issue-13404.rs b/src/test/compile-fail/issue-13404.rs deleted file mode 100644 index 0059e92e07f..00000000000 --- a/src/test/compile-fail/issue-13404.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use a::f; -use b::f; //~ ERROR: unresolved import `b::f` [E0432] - //~^ no `f` in `b` - -mod a { pub fn f() {} } -mod b { } - -fn main() { - f(); -} diff --git a/src/test/compile-fail/issue-13407.rs b/src/test/compile-fail/issue-13407.rs deleted file mode 100644 index afb2e867f45..00000000000 --- a/src/test/compile-fail/issue-13407.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod A { - struct C; -} - -fn main() { - A::C = 1; - //~^ ERROR: invalid left-hand side expression - //~| ERROR: mismatched types - //~| ERROR: struct `C` is private -} diff --git a/src/test/compile-fail/issue-13446.rs b/src/test/compile-fail/issue-13446.rs deleted file mode 100644 index 6ad3ec67b29..00000000000 --- a/src/test/compile-fail/issue-13446.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -// Used to cause ICE - -// error-pattern: mismatched types - -static VEC: [u32; 256] = vec![]; - -fn main() {} diff --git a/src/test/compile-fail/issue-13466.rs b/src/test/compile-fail/issue-13466.rs deleted file mode 100644 index abddf6ba7a3..00000000000 --- a/src/test/compile-fail/issue-13466.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for #13466 - -pub fn main() { - // The expected arm type `Option` has one type parameter, while - // the actual arm `Result` has two. typeck should not be - // tricked into looking up a non-existing second type parameter. - let _x: usize = match Some(1) { - Ok(u) => u, - //~^ ERROR mismatched types - //~| expected type `std::option::Option<{integer}>` - //~| found type `std::result::Result<_, _>` - //~| expected enum `std::option::Option`, found enum `std::result::Result` - - Err(e) => panic!(e) - //~^ ERROR mismatched types - //~| expected type `std::option::Option<{integer}>` - //~| found type `std::result::Result<_, _>` - //~| expected enum `std::option::Option`, found enum `std::result::Result` - }; -} diff --git a/src/test/compile-fail/issue-13482-2.rs b/src/test/compile-fail/issue-13482-2.rs deleted file mode 100644 index fe7fbb176cc..00000000000 --- a/src/test/compile-fail/issue-13482-2.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags:-Z verbose - -fn main() { - let x = [1,2]; - let y = match x { - [] => None, //~ ERROR pattern requires 0 elements but array has 2 - [a,_] => Some(a) - }; -} diff --git a/src/test/compile-fail/issue-13482.rs b/src/test/compile-fail/issue-13482.rs deleted file mode 100644 index 32a63b79a32..00000000000 --- a/src/test/compile-fail/issue-13482.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let x = [1,2]; - let y = match x { - [] => None, //~ ERROR pattern requires 0 elements but array has 2 - [a,_] => Some(a) - }; -} diff --git a/src/test/compile-fail/issue-13497-2.rs b/src/test/compile-fail/issue-13497-2.rs deleted file mode 100644 index 31716837493..00000000000 --- a/src/test/compile-fail/issue-13497-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn read_lines_borrowed<'a>() -> Vec<&'a str> { - let rawLines: Vec = vec!["foo ".to_string(), " bar".to_string()]; - rawLines //~ ERROR `rawLines` does not live long enough - .iter().map(|l| l.trim()).collect() -} - -fn main() {} diff --git a/src/test/compile-fail/issue-13497.rs b/src/test/compile-fail/issue-13497.rs deleted file mode 100644 index d544a92d9c3..00000000000 --- a/src/test/compile-fail/issue-13497.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn read_lines_borrowed1() -> Vec< - &str //~ ERROR missing lifetime specifier -> { - let rawLines: Vec = vec!["foo ".to_string(), " bar".to_string()]; - rawLines.iter().map(|l| l.trim()).collect() -} - -fn main() {} diff --git a/src/test/compile-fail/issue-1362.rs b/src/test/compile-fail/issue-1362.rs deleted file mode 100644 index d51db479599..00000000000 --- a/src/test/compile-fail/issue-1362.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for issue #1362 - without that fix the span will be bogus -// no-reformat -fn main() { - let x: u32 = 20i32; //~ ERROR mismatched types -} -// NOTE: Do not add any extra lines as the line number the error is -// on is significant; an error later in the source file might not -// trigger the bug. diff --git a/src/test/compile-fail/issue-13641.rs b/src/test/compile-fail/issue-13641.rs deleted file mode 100644 index 3b690e08f61..00000000000 --- a/src/test/compile-fail/issue-13641.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod a { - struct Foo; - impl Foo { pub fn new() {} } - enum Bar {} - impl Bar { pub fn new() {} } -} - -fn main() { - a::Foo::new(); - //~^ ERROR: struct `Foo` is private - a::Bar::new(); - //~^ ERROR: enum `Bar` is private -} diff --git a/src/test/compile-fail/issue-13727.rs b/src/test/compile-fail/issue-13727.rs deleted file mode 100644 index 2e815548e89..00000000000 --- a/src/test/compile-fail/issue-13727.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(overflowing_literals)] -#![deny(unreachable_patterns)] - -fn test(val: u8) { - match val { - 256 => print!("0b1110\n"), - 512 => print!("0b1111\n"), - //~^ ERROR: unreachable pattern - _ => print!("fail\n"), - } -} - -fn main() { - test(1); -} diff --git a/src/test/compile-fail/issue-13847.rs b/src/test/compile-fail/issue-13847.rs deleted file mode 100644 index 0314f109a7c..00000000000 --- a/src/test/compile-fail/issue-13847.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - return.is_failure //~ ERROR no field `is_failure` on type `!` -} diff --git a/src/test/compile-fail/issue-13853-2.rs b/src/test/compile-fail/issue-13853-2.rs deleted file mode 100644 index 1635a8f69a6..00000000000 --- a/src/test/compile-fail/issue-13853-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait FromStructReader<'a> { } -trait ResponseHook { - fn get(&self); -} -fn foo(res : Box) { res.get } //~ ERROR attempted to take value of method -fn main() {} diff --git a/src/test/compile-fail/issue-13853-5.rs b/src/test/compile-fail/issue-13853-5.rs deleted file mode 100644 index 78b079a7c44..00000000000 --- a/src/test/compile-fail/issue-13853-5.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Deserializer<'a> { } - -trait Deserializable { - fn deserialize_token<'a, D: Deserializer<'a>>(_: D, _: &'a str) -> Self; -} - -impl<'a, T: Deserializable> Deserializable for &'a str { - //~^ ERROR type parameter `T` is not constrained - fn deserialize_token>(_x: D, _y: &'a str) -> &'a str { - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-13853.rs b/src/test/compile-fail/issue-13853.rs deleted file mode 100644 index 86a6bdfd4dd..00000000000 --- a/src/test/compile-fail/issue-13853.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Node { - fn zomg(); -} - -trait Graph { - fn nodes<'a, I: Iterator>(&'a self) -> I - where N: 'a; -} - -impl Graph for Vec { - fn nodes<'a, I: Iterator>(&self) -> I - where N: 'a - { - self.iter() //~ ERROR mismatched types - } -} - -struct Stuff; - -impl Node for Stuff { - fn zomg() { - println!("zomg"); - } -} - -fn iterate>(graph: &G) { - for node in graph.iter() { //~ ERROR no method named `iter` found - node.zomg(); - } -} - -pub fn main() { - let graph = Vec::new(); - - graph.push(Stuff); - - iterate(graph); //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-14091-2.rs b/src/test/compile-fail/issue-14091-2.rs deleted file mode 100644 index d3823a8cc55..00000000000 --- a/src/test/compile-fail/issue-14091-2.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: cannot apply unary operator `!` to type `BytePos` - -// Very - -// sensitive -pub struct BytePos(pub u32); - -// to particular - -// line numberings / offsets - -fn main() { - let x = BytePos(1); - - assert!(x, x); -} diff --git a/src/test/compile-fail/issue-14091.rs b/src/test/compile-fail/issue-14091.rs deleted file mode 100644 index 9c594ef485f..00000000000 --- a/src/test/compile-fail/issue-14091.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern:mismatched types - -fn main(){assert!(1,1);} diff --git a/src/test/compile-fail/issue-14221.rs b/src/test/compile-fail/issue-14221.rs deleted file mode 100644 index d11fe99c07f..00000000000 --- a/src/test/compile-fail/issue-14221.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(unreachable_patterns)] -#![allow(unused_variables)] -#![allow(non_snake_case)] - -pub enum E { - A, - B, -} - -pub mod b { - pub fn key(e: ::E) -> &'static str { - match e { - A => "A", -//~^ WARN pattern binding `A` is named the same as one of the variants of the type `E` - B => "B", //~ ERROR: unreachable pattern -//~^ WARN pattern binding `B` is named the same as one of the variants of the type `E` - } - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-14227.rs b/src/test/compile-fail/issue-14227.rs deleted file mode 100644 index 250e78ce246..00000000000 --- a/src/test/compile-fail/issue-14227.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(safe_extern_statics, warnings)] - -extern { - pub static symbol: (); -} -static CRASH: () = symbol; -//~^ ERROR could not evaluate static initializer -//~| tried to read from foreign (extern) static - -fn main() {} diff --git a/src/test/compile-fail/issue-14285.rs b/src/test/compile-fail/issue-14285.rs deleted file mode 100644 index dceecee6ca7..00000000000 --- a/src/test/compile-fail/issue-14285.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo { - fn dummy(&self) { } -} - -struct A; - -impl Foo for A {} - -struct B<'a>(&'a (Foo+'a)); - -fn foo<'a>(a: &Foo) -> B<'a> { - B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621] -} - -fn main() { - let _test = foo(&A); -} diff --git a/src/test/compile-fail/issue-14309.rs b/src/test/compile-fail/issue-14309.rs deleted file mode 100644 index f76fa3e4a8e..00000000000 --- a/src/test/compile-fail/issue-14309.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(improper_ctypes)] -#![allow(dead_code)] - -struct A { - x: i32 -} - -#[repr(C, packed)] -struct B { - x: i32, - y: A -} - -#[repr(C)] -struct C { - x: i32 -} - -type A2 = A; -type B2 = B; -type C2 = C; - -#[repr(C)] -struct D { - x: C, - y: A -} - -extern "C" { - fn foo(x: A); //~ ERROR type `A` which is not FFI-safe - fn bar(x: B); //~ ERROR type `A` - fn baz(x: C); - fn qux(x: A2); //~ ERROR type `A` - fn quux(x: B2); //~ ERROR type `A` - fn corge(x: C2); - fn fred(x: D); //~ ERROR type `A` -} - -fn main() { } diff --git a/src/test/compile-fail/issue-14366.rs b/src/test/compile-fail/issue-14366.rs deleted file mode 100644 index 0b154d0a3ea..00000000000 --- a/src/test/compile-fail/issue-14366.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let _x = "test" as &::std::any::Any; - //~^ ERROR the size for values of type -} diff --git a/src/test/compile-fail/issue-1448-2.rs b/src/test/compile-fail/issue-1448-2.rs deleted file mode 100644 index ddfed3647c2..00000000000 --- a/src/test/compile-fail/issue-1448-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for issue #1448 and #1386 - -fn foo(a: u32) -> u32 { a } - -fn main() { - println!("{}", foo(10i32)); //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-14541.rs b/src/test/compile-fail/issue-14541.rs deleted file mode 100644 index 84c600d2201..00000000000 --- a/src/test/compile-fail/issue-14541.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct vec2 { y: f32 } -struct vec3 { y: f32, z: f32 } - -fn make(v: vec2) { - let vec3 { y: _, z: _ } = v; - //~^ ERROR mismatched types - //~| expected type `vec2` - //~| found type `vec3` - //~| expected struct `vec2`, found struct `vec3` -} - -fn main() { } diff --git a/src/test/compile-fail/issue-14721.rs b/src/test/compile-fail/issue-14721.rs deleted file mode 100644 index 58e8e10ee37..00000000000 --- a/src/test/compile-fail/issue-14721.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let foo = "str"; - println!("{}", foo.desc); //~ no field `desc` on type `&str` -} diff --git a/src/test/compile-fail/issue-1476.rs b/src/test/compile-fail/issue-1476.rs deleted file mode 100644 index 48bf71f5892..00000000000 --- a/src/test/compile-fail/issue-1476.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - println!("{}", x); //~ ERROR cannot find value `x` in this scope -} diff --git a/src/test/compile-fail/issue-14772.rs b/src/test/compile-fail/issue-14772.rs deleted file mode 100644 index aaaad67be52..00000000000 --- a/src/test/compile-fail/issue-14772.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: --test - -#[test] -mod foo {} //~ ERROR only functions may be used as tests - -fn main() {} diff --git a/src/test/compile-fail/issue-14845.rs b/src/test/compile-fail/issue-14845.rs deleted file mode 100644 index 74f0833e8d1..00000000000 --- a/src/test/compile-fail/issue-14845.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -struct X { - a: [u8; 1] -} - -fn main() { - let x = X { a: [0] }; - let _f = &x.a as *mut u8; //~ ERROR casting - - let local: [u8; 1] = [0]; - let _v = &local as *mut u8; //~ ERROR casting -} diff --git a/src/test/compile-fail/issue-14853.rs b/src/test/compile-fail/issue-14853.rs deleted file mode 100644 index e4da3e4fa43..00000000000 --- a/src/test/compile-fail/issue-14853.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::fmt::Debug; - -trait Str {} - -trait Something: Sized { - fn yay(_: Option, thing: &[T]); -} - -struct X { data: u32 } - -impl Something for X { - fn yay(_:Option, thing: &[T]) { - //~^ ERROR E0276 - } -} - -fn main() { - let arr = &["one", "two", "three"]; - println!("{:?}", Something::yay(None::, arr)); -} diff --git a/src/test/compile-fail/issue-14915.rs b/src/test/compile-fail/issue-14915.rs deleted file mode 100644 index 810d6656a8f..00000000000 --- a/src/test/compile-fail/issue-14915.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -fn main() { - let x: Box = box 0; - - println!("{}", x + 1); - //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box` -} diff --git a/src/test/compile-fail/issue-15034.rs b/src/test/compile-fail/issue-15034.rs deleted file mode 100644 index a62e46820d3..00000000000 --- a/src/test/compile-fail/issue-15034.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub struct Lexer<'a> { - input: &'a str, -} - -impl<'a> Lexer<'a> { - pub fn new(input: &'a str) -> Lexer<'a> { - Lexer { input: input } - } -} - -struct Parser<'a> { - lexer: &'a mut Lexer<'a>, -} - -impl<'a> Parser<'a> { - pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { - Parser { lexer: lexer } - //~^ ERROR 27:25: 27:30: explicit lifetime required in the type of `lexer` [E0621] - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-15094.rs b/src/test/compile-fail/issue-15094.rs deleted file mode 100644 index 1dd6763cbe5..00000000000 --- a/src/test/compile-fail/issue-15094.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(fn_traits, unboxed_closures)] - -use std::{fmt, ops}; - -struct Debuger { - x: T -} - -impl ops::FnOnce<(),> for Debuger { - type Output = (); - fn call_once(self, _args: ()) { - //~^ ERROR `call_once` has an incompatible type for trait - //~| expected type `extern "rust-call" fn - //~| found type `fn - println!("{:?}", self.x); - } -} - -fn make_shower(x: T) -> Debuger { - Debuger { x: x } -} - -pub fn main() { - let show3 = make_shower(3); - show3(); -} diff --git a/src/test/compile-fail/issue-15129.rs b/src/test/compile-fail/issue-15129.rs deleted file mode 100644 index 7a7ba46de74..00000000000 --- a/src/test/compile-fail/issue-15129.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub enum T { - T1(()), - T2(()) -} - -pub enum V { - V1(isize), - V2(bool) -} - -fn main() { - match (T::T1(()), V::V2(true)) { - //~^ ERROR non-exhaustive patterns: `(T1(()), V2(_))` not covered - (T::T1(()), V::V1(i)) => (), - (T::T2(()), V::V2(b)) => () - } -} diff --git a/src/test/compile-fail/issue-15167.rs b/src/test/compile-fail/issue-15167.rs deleted file mode 100644 index d224b8a548c..00000000000 --- a/src/test/compile-fail/issue-15167.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// macro f should not be able to inject a reference to 'n'. - -macro_rules! f { () => (n) } -//~^ ERROR cannot find value `n` in this scope -//~| ERROR cannot find value `n` in this scope -//~| ERROR cannot find value `n` in this scope -//~| ERROR cannot find value `n` in this scope - -fn main() -> (){ - for n in 0..1 { - println!("{}", f!()); - } - - if let Some(n) = None { - println!("{}", f!()); - } - - if false { - } else if let Some(n) = None { - println!("{}", f!()); - } - - while let Some(n) = None { - println!("{}", f!()); - } -} diff --git a/src/test/compile-fail/issue-15207.rs b/src/test/compile-fail/issue-15207.rs deleted file mode 100644 index 70da8cf4169..00000000000 --- a/src/test/compile-fail/issue-15207.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - loop { - break.push(1) //~ ERROR no method named `push` found for type `!` - ; - } -} diff --git a/src/test/compile-fail/issue-15381.rs b/src/test/compile-fail/issue-15381.rs deleted file mode 100644 index 1cdd803971b..00000000000 --- a/src/test/compile-fail/issue-15381.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let values: Vec = vec![1,2,3,4,5,6,7,8]; - - for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) { - //~^ ERROR refutable pattern in `for` loop binding: `&[]` not covered - println!("y={}", y); - } -} diff --git a/src/test/compile-fail/issue-15756.rs b/src/test/compile-fail/issue-15756.rs deleted file mode 100644 index c123e85a0e0..00000000000 --- a/src/test/compile-fail/issue-15756.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::slice::Chunks; -use std::slice::ChunksMut; - -fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>) -{ - for - &mut something - //~^ ERROR the size for values of type - in arg2 - { - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-15783.rs b/src/test/compile-fail/issue-15783.rs deleted file mode 100644 index 37a2f1582bf..00000000000 --- a/src/test/compile-fail/issue-15783.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub fn foo(params: Option<&[&str]>) -> usize { - params.unwrap().first().unwrap().len() -} - -fn main() { - let name = "Foo"; - let x = Some(&[name]); - let msg = foo(x); -//~^ ERROR mismatched types -//~| expected type `std::option::Option<&[&str]>` -//~| found type `std::option::Option<&[&str; 1]>` -//~| expected slice, found array of 1 elements - assert_eq!(msg, 3); -} diff --git a/src/test/compile-fail/issue-15896.rs b/src/test/compile-fail/issue-15896.rs deleted file mode 100644 index 35ef9ba2b4b..00000000000 --- a/src/test/compile-fail/issue-15896.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for #15896. It used to ICE rustc. - -fn main() { - enum R { REB(()) } - struct Tau { t: usize } - enum E { B(R, Tau) } - - let e = E::B(R::REB(()), Tau { t: 3 }); - let u = match e { - E::B( - Tau{t: x}, - //~^ ERROR mismatched types - //~| expected type `main::R` - //~| found type `main::Tau` - //~| expected enum `main::R`, found struct `main::Tau` - _) => x, - }; -} diff --git a/src/test/compile-fail/issue-15919.rs b/src/test/compile-fail/issue-15919.rs deleted file mode 100644 index df7e7c102b2..00000000000 --- a/src/test/compile-fail/issue-15919.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: too big for the current architecture - -#[cfg(target_pointer_width = "32")] -fn main() { - let x = [0usize; 0xffff_ffff]; -} - -#[cfg(target_pointer_width = "64")] -fn main() { - let x = [0usize; 0xffff_ffff_ffff_ffff]; -} diff --git a/src/test/compile-fail/issue-15965.rs b/src/test/compile-fail/issue-15965.rs deleted file mode 100644 index 76ba5a0f4b3..00000000000 --- a/src/test/compile-fail/issue-15965.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - return - { return () } -//~^ ERROR type annotations needed [E0282] - () - ; -} diff --git a/src/test/compile-fail/issue-16048.rs b/src/test/compile-fail/issue-16048.rs deleted file mode 100644 index cda83fe54b0..00000000000 --- a/src/test/compile-fail/issue-16048.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait NoLifetime { - fn get<'p, T : Test<'p>>(&self) -> T; - //~^ NOTE lifetimes in impl do not match this method in trait -} - -trait Test<'p> { - fn new(buf: &'p mut [u8]) -> Self; -} - -struct Foo<'a> { - buf: &'a mut [u8], -} - -impl<'a> Test<'a> for Foo<'a> { - fn new(buf: &'a mut [u8]) -> Foo<'a> { - Foo { buf: buf } - } -} - -impl<'a> NoLifetime for Foo<'a> { - fn get<'p, T : Test<'a>>(&self) -> T { - //~^ ERROR E0195 - //~| NOTE lifetimes do not match method in trait - return *self as T; - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-16098.rs b/src/test/compile-fail/issue-16098.rs deleted file mode 100644 index 68ac19b383f..00000000000 --- a/src/test/compile-fail/issue-16098.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! prob1 { - (0) => { - 0 - }; - ($n:expr) => { - if ($n % 3 == 0) || ($n % 5 == 0) { - $n + prob1!($n - 1); //~ ERROR recursion limit reached while expanding the macro `prob1` - } else { - prob1!($n - 1); - } - }; -} - -fn main() { - println!("Problem 1: {}", prob1!(1000)); -} diff --git a/src/test/compile-fail/issue-16149.rs b/src/test/compile-fail/issue-16149.rs deleted file mode 100644 index 60117bd88d4..00000000000 --- a/src/test/compile-fail/issue-16149.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern { - static externalValue: isize; -} - -fn main() { - let boolValue = match 42 { - externalValue => true, - //~^ ERROR match bindings cannot shadow statics - _ => false - }; -} diff --git a/src/test/compile-fail/issue-16250.rs b/src/test/compile-fail/issue-16250.rs deleted file mode 100644 index f9d01003005..00000000000 --- a/src/test/compile-fail/issue-16250.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(warnings)] - -pub struct Foo; - -extern { - pub fn foo(x: (Foo)); //~ ERROR unspecified layout -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-16338.rs b/src/test/compile-fail/issue-16338.rs deleted file mode 100644 index 438073e3b2f..00000000000 --- a/src/test/compile-fail/issue-16338.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Slice { - data: *const T, - len: usize, -} - -fn main() { - let Slice { data: data, len: len } = "foo"; - //~^ ERROR mismatched types - //~| found type `Slice<_>` -} diff --git a/src/test/compile-fail/issue-16401.rs b/src/test/compile-fail/issue-16401.rs deleted file mode 100644 index 3060bbea43c..00000000000 --- a/src/test/compile-fail/issue-16401.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Slice { - data: *const T, - len: usize, -} - -fn main() { - match () { - Slice { data: data, len: len } => (), - //~^ ERROR mismatched types - //~| expected type `()` - //~| found type `Slice<_>` - //~| expected (), found struct `Slice` - _ => unreachable!() - } -} diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs deleted file mode 100644 index cc652119377..00000000000 --- a/src/test/compile-fail/issue-16538.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(safe_extern_statics)] - -mod Y { - pub type X = usize; - extern { - pub static x: *const usize; - } - pub fn foo(value: *const X) -> *const X { - value - } -} - -static foo: *const Y::X = Y::foo(Y::x as *const Y::X); -//~^ ERROR `*const usize` cannot be shared between threads safely [E0277] -//~| ERROR E0015 - -fn main() {} diff --git a/src/test/compile-fail/issue-16562.rs b/src/test/compile-fail/issue-16562.rs deleted file mode 100644 index a400263a243..00000000000 --- a/src/test/compile-fail/issue-16562.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait MatrixShape {} - -struct Col { - data: D, - col: C, -} - -trait Collection { fn len(&self) -> usize; } - -impl Collection for Col { -//~^ ERROR type parameter `T` is not constrained - fn len(&self) -> usize { - unimplemented!() - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-16683.rs b/src/test/compile-fail/issue-16683.rs deleted file mode 100644 index fcbf8a3d351..00000000000 --- a/src/test/compile-fail/issue-16683.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait T<'a> { - fn a(&'a self) -> &'a bool; - fn b(&self) { - self.a(); //~ ERROR cannot infer - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-16922.rs b/src/test/compile-fail/issue-16922.rs deleted file mode 100644 index 1768c834cb3..00000000000 --- a/src/test/compile-fail/issue-16922.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::any::Any; - -fn foo(value: &T) -> Box { - Box::new(value) as Box - //~^ ERROR explicit lifetime required in the type of `value` [E0621] -} - -fn main() { - let _ = foo(&5); -} diff --git a/src/test/compile-fail/issue-16939.rs b/src/test/compile-fail/issue-16939.rs deleted file mode 100644 index e16c58b8a6c..00000000000 --- a/src/test/compile-fail/issue-16939.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Make sure we don't ICE when making an overloaded call with the -// wrong arity. - -fn _foo (f: F) { - |t| f(t); //~ ERROR E0057 -} - -fn main() {} diff --git a/src/test/compile-fail/issue-16966.rs b/src/test/compile-fail/issue-16966.rs deleted file mode 100644 index ecf81c8af17..00000000000 --- a/src/test/compile-fail/issue-16966.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern:type annotations needed -fn main() { - panic!( - std::default::Default::default() - ); -} diff --git a/src/test/compile-fail/issue-1697.rs b/src/test/compile-fail/issue-1697.rs deleted file mode 100644 index f8a68264339..00000000000 --- a/src/test/compile-fail/issue-1697.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Testing that we don't fail abnormally after hitting the errors - -use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] - //~^ Maybe a missing `extern crate unresolved;`? - -fn main() {} diff --git a/src/test/compile-fail/issue-16994.rs b/src/test/compile-fail/issue-16994.rs deleted file mode 100644 index ae4e8ce1df8..00000000000 --- a/src/test/compile-fail/issue-16994.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -fn cb<'a,T>(_x: Box, bool))) -> T>) -> T { - panic!() -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b))); -} diff --git a/src/test/compile-fail/issue-17001.rs b/src/test/compile-fail/issue-17001.rs deleted file mode 100644 index 413e8b464ff..00000000000 --- a/src/test/compile-fail/issue-17001.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod foo {} - -fn main() { - let p = foo { x: () }; //~ ERROR expected struct, variant or union type, found module `foo` -} diff --git a/src/test/compile-fail/issue-17025.rs b/src/test/compile-fail/issue-17025.rs deleted file mode 100644 index f250103b144..00000000000 --- a/src/test/compile-fail/issue-17025.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-test the unsized enum no longer compiles - -enum A { - B(char), - C([Box]), -} - -fn c(c:char) { - A::B(c); - //~^ ERROR cannot move a value of type A: the size of A cannot be statically determined -} - -pub fn main() {} diff --git a/src/test/compile-fail/issue-17033.rs b/src/test/compile-fail/issue-17033.rs deleted file mode 100644 index 1cd43cbb0f8..00000000000 --- a/src/test/compile-fail/issue-17033.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f<'r>(p: &'r mut fn(p: &mut ())) { - (*p)(()) //~ ERROR mismatched types - //~| expected type `&mut ()` - //~| found type `()` - //~| expected &mut (), found () -} - -fn main() {} diff --git a/src/test/compile-fail/issue-17252.rs b/src/test/compile-fail/issue-17252.rs deleted file mode 100644 index 1c3e6890c8e..00000000000 --- a/src/test/compile-fail/issue-17252.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const FOO: usize = FOO; //~ ERROR E0391 - -fn main() { - let _x: [u8; FOO]; // caused stack overflow prior to fix - let _y: usize = 1 + { - const BAR: usize = BAR; - let _z: [u8; BAR]; // caused stack overflow prior to fix - 1 - }; -} diff --git a/src/test/compile-fail/issue-17337.rs b/src/test/compile-fail/issue-17337.rs deleted file mode 100644 index 1208321b529..00000000000 --- a/src/test/compile-fail/issue-17337.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(staged_api)] -#![deny(deprecated)] - -#![unstable(feature = "test_feature", issue = "0")] - -struct Foo; - -impl Foo { - #[unstable(feature = "test_feature", issue = "0")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] - fn foo(self) {} -} - -fn main() { - Foo - .foo(); //~ ERROR use of deprecated item -} diff --git a/src/test/compile-fail/issue-17373.rs b/src/test/compile-fail/issue-17373.rs deleted file mode 100644 index f6e6a8a0852..00000000000 --- a/src/test/compile-fail/issue-17373.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - *return //~ ERROR type `!` cannot be dereferenced - ; -} diff --git a/src/test/compile-fail/issue-17385.rs b/src/test/compile-fail/issue-17385.rs deleted file mode 100644 index eb293c79247..00000000000 --- a/src/test/compile-fail/issue-17385.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct X(isize); - -enum Enum { - Variant1, - Variant2 -} - -impl Drop for X { - fn drop(&mut self) {} -} -impl Drop for Enum { - fn drop(&mut self) {} -} - -fn main() { - let foo = X(1); - drop(foo); - match foo { //~ ERROR use of moved value - X(1) => (), - _ => unreachable!() - } - - let e = Enum::Variant2; - drop(e); - match e { //~ ERROR use of moved value - Enum::Variant1 => unreachable!(), - Enum::Variant2 => () - } -} diff --git a/src/test/compile-fail/issue-17405.rs b/src/test/compile-fail/issue-17405.rs deleted file mode 100644 index 5a6bd5ed588..00000000000 --- a/src/test/compile-fail/issue-17405.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { - Bar(isize) -} - -fn main() { - match Foo::Bar(1) { - Foo { i } => () //~ ERROR expected struct, variant or union type, found enum `Foo` - } -} diff --git a/src/test/compile-fail/issue-17431-1.rs b/src/test/compile-fail/issue-17431-1.rs deleted file mode 100644 index 260cc366fae..00000000000 --- a/src/test/compile-fail/issue-17431-1.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo { foo: Option> } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/src/test/compile-fail/issue-17431-2.rs b/src/test/compile-fail/issue-17431-2.rs deleted file mode 100644 index f39fb0e31c6..00000000000 --- a/src/test/compile-fail/issue-17431-2.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Baz { q: Option } -//~^ ERROR recursive type `Baz` has infinite size - -struct Foo { q: Option } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/src/test/compile-fail/issue-17431-3.rs b/src/test/compile-fail/issue-17431-3.rs deleted file mode 100644 index 9ba085591f0..00000000000 --- a/src/test/compile-fail/issue-17431-3.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::sync::Mutex; - -struct Foo { foo: Mutex> } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/src/test/compile-fail/issue-17431-4.rs b/src/test/compile-fail/issue-17431-4.rs deleted file mode 100644 index 665c3cf8fe6..00000000000 --- a/src/test/compile-fail/issue-17431-4.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::marker; - -struct Foo { foo: Option>>, marker: marker::PhantomData } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/src/test/compile-fail/issue-17431-5.rs b/src/test/compile-fail/issue-17431-5.rs deleted file mode 100644 index 85ed4d5d634..00000000000 --- a/src/test/compile-fail/issue-17431-5.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::marker; - -struct Foo { foo: Bar } - -struct Bar { x: Bar , marker: marker::PhantomData } -//~^ ERROR recursive type `Bar` has infinite size - -impl Foo { fn foo(&self) {} } - -fn main() { -} diff --git a/src/test/compile-fail/issue-17431-6.rs b/src/test/compile-fail/issue-17431-6.rs deleted file mode 100644 index 4c1e82c3d6a..00000000000 --- a/src/test/compile-fail/issue-17431-6.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::sync::Mutex; - -enum Foo { X(Mutex>) } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(self) {} } - -fn main() {} diff --git a/src/test/compile-fail/issue-17431-7.rs b/src/test/compile-fail/issue-17431-7.rs deleted file mode 100644 index 71b85da29fc..00000000000 --- a/src/test/compile-fail/issue-17431-7.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { Voo(Option>) } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() { } diff --git a/src/test/compile-fail/issue-17444.rs b/src/test/compile-fail/issue-17444.rs deleted file mode 100644 index dafcff23838..00000000000 --- a/src/test/compile-fail/issue-17444.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Test { - Foo = 0 -} - -fn main() { - let _x = Test::Foo as *const isize; - //~^ ERROR casting `Test` as `*const isize` is invalid -} diff --git a/src/test/compile-fail/issue-17458.rs b/src/test/compile-fail/issue-17458.rs deleted file mode 100644 index f5b7a0c13b7..00000000000 --- a/src/test/compile-fail/issue-17458.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -static X: usize = 0 as *const usize as usize; -//~^ ERROR: raw pointers cannot be cast to integers in statics - -fn main() { - assert_eq!(X, 0); -} diff --git a/src/test/compile-fail/issue-17545.rs b/src/test/compile-fail/issue-17545.rs deleted file mode 100644 index 9264305e6ea..00000000000 --- a/src/test/compile-fail/issue-17545.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(fn_traits)] - -fn id(x: T) -> T { x } - -pub fn foo<'a, F: Fn(&'a ())>(bar: F) { - bar.call(( - &id(()), //~ ERROR borrowed value does not live long enough - )); -} -fn main() {} diff --git a/src/test/compile-fail/issue-17546.rs b/src/test/compile-fail/issue-17546.rs deleted file mode 100644 index fe125b973d9..00000000000 --- a/src/test/compile-fail/issue-17546.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use foo::MyEnum::Result; -use foo::NoResult; // Through a re-export - -mod foo { - pub use self::MyEnum::NoResult; - - pub enum MyEnum { - Result, - NoResult - } - - fn new() -> NoResult { - //~^ ERROR expected type, found variant `NoResult` - unimplemented!() - } -} - -mod bar { - use foo::MyEnum::Result; - use foo; - - fn new() -> Result { - //~^ ERROR expected type, found variant `Result` - unimplemented!() - } -} - -fn new() -> Result { - //~^ ERROR expected type, found variant `Result` - unimplemented!() -} - -fn newer() -> NoResult { - //~^ ERROR expected type, found variant `NoResult` - unimplemented!() -} - -fn main() { - let _ = new(); -} diff --git a/src/test/compile-fail/issue-17551.rs b/src/test/compile-fail/issue-17551.rs deleted file mode 100644 index b55863f0dda..00000000000 --- a/src/test/compile-fail/issue-17551.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::marker; - -struct B(marker::PhantomData); - -fn main() { - let foo = B(marker::PhantomData); //~ ERROR type annotations needed - let closure = || foo; -} diff --git a/src/test/compile-fail/issue-17651.rs b/src/test/compile-fail/issue-17651.rs deleted file mode 100644 index cbd0da4b53c..00000000000 --- a/src/test/compile-fail/issue-17651.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that moves of unsized values within closures are caught -// and rejected. - -fn main() { - (|| Box::new(*(&[0][..])))(); - //~^ ERROR the size for values of type -} diff --git a/src/test/compile-fail/issue-17718-const-bad-values.rs b/src/test/compile-fail/issue-17718-const-bad-values.rs deleted file mode 100644 index 17ec77d77ee..00000000000 --- a/src/test/compile-fail/issue-17718-const-bad-values.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const C1: &'static mut [usize] = &mut []; -//~^ ERROR: references in constants may only refer to immutable values - -static mut S: usize = 3; -const C2: &'static mut usize = unsafe { &mut S }; -//~^ ERROR: constants cannot refer to statics -//~| ERROR: references in constants may only refer to immutable values -//~| ERROR: references in constants may only refer to immutable values - -fn main() {} diff --git a/src/test/compile-fail/issue-17718-const-borrow.rs b/src/test/compile-fail/issue-17718-const-borrow.rs deleted file mode 100644 index 07123c69492..00000000000 --- a/src/test/compile-fail/issue-17718-const-borrow.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::cell::UnsafeCell; - -const A: UnsafeCell = UnsafeCell::new(1); -const B: &'static UnsafeCell = &A; -//~^ ERROR: cannot borrow a constant which may contain interior mutability - -struct C { a: UnsafeCell } -const D: C = C { a: UnsafeCell::new(1) }; -const E: &'static UnsafeCell = &D.a; -//~^ ERROR: cannot borrow a constant which may contain interior mutability -const F: &'static C = &D; -//~^ ERROR: cannot borrow a constant which may contain interior mutability - -fn main() {} diff --git a/src/test/compile-fail/issue-17718-const-naming.rs b/src/test/compile-fail/issue-17718-const-naming.rs deleted file mode 100644 index 4857c2fb446..00000000000 --- a/src/test/compile-fail/issue-17718-const-naming.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![warn(unused)] -#[deny(warnings)] - -const foo: isize = 3; -//~^ ERROR: should have an upper case name such as -//~^^ ERROR: constant item is never used - -fn main() {} diff --git a/src/test/compile-fail/issue-17718-constants-not-static.rs b/src/test/compile-fail/issue-17718-constants-not-static.rs deleted file mode 100644 index 9b7ed463499..00000000000 --- a/src/test/compile-fail/issue-17718-constants-not-static.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn id(x: T) -> T { x } - -const FOO: usize = 3; - -fn foo() -> &'static usize { &id(FOO) } -//~^ ERROR: borrowed value does not live long enough - -fn main() { -} diff --git a/src/test/compile-fail/issue-17718-patterns.rs b/src/test/compile-fail/issue-17718-patterns.rs deleted file mode 100644 index b9f5e98b6fa..00000000000 --- a/src/test/compile-fail/issue-17718-patterns.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -static A1: usize = 1; -static mut A2: usize = 1; -const A3: usize = 1; - -fn main() { - match 1 { - A1 => {} //~ ERROR: match bindings cannot shadow statics - A2 => {} //~ ERROR: match bindings cannot shadow statics - A3 => {} - _ => {} - } -} diff --git a/src/test/compile-fail/issue-17718-references.rs b/src/test/compile-fail/issue-17718-references.rs deleted file mode 100644 index 586cfebcd16..00000000000 --- a/src/test/compile-fail/issue-17718-references.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(warnings)] - -struct Struct { a: usize } - -const C: usize = 1; -static S: usize = 1; - -const T1: &'static usize = &C; -const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics -static T3: &'static usize = &C; -static T4: &'static usize = &S; - -const T5: usize = C; -const T6: usize = S; //~ ERROR: constants cannot refer to statics -static T7: usize = C; -static T8: usize = S; - -const T9: Struct = Struct { a: C }; -const T10: Struct = Struct { a: S }; -//~^ ERROR: constants cannot refer to statics -static T11: Struct = Struct { a: C }; -static T12: Struct = Struct { a: S }; - -fn main() {} diff --git a/src/test/compile-fail/issue-17718-static-move.rs b/src/test/compile-fail/issue-17718-static-move.rs deleted file mode 100644 index a5a7117956f..00000000000 --- a/src/test/compile-fail/issue-17718-static-move.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo; -const INIT: Foo = Foo; -static FOO: Foo = INIT; - -fn main() { - let _a = FOO; //~ ERROR: cannot move out of static item -} diff --git a/src/test/compile-fail/issue-17718-static-sync.rs b/src/test/compile-fail/issue-17718-static-sync.rs deleted file mode 100644 index c5349d4e82b..00000000000 --- a/src/test/compile-fail/issue-17718-static-sync.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(optin_builtin_traits)] - -use std::marker::Sync; - -struct Foo; -impl !Sync for Foo {} - -static FOO: usize = 3; -static BAR: Foo = Foo; -//~^ ERROR: `Foo` cannot be shared between threads safely [E0277] - -fn main() {} diff --git a/src/test/compile-fail/issue-17728.rs b/src/test/compile-fail/issue-17728.rs deleted file mode 100644 index 8516a8ea52e..00000000000 --- a/src/test/compile-fail/issue-17728.rs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::fmt::{Debug, Formatter, Error}; -use std::collections::HashMap; - -trait HasInventory { - fn getInventory<'s>(&'s self) -> &'s mut Inventory; - fn addToInventory(&self, item: &Item); - fn removeFromInventory(&self, itemName: &str) -> bool; -} - -trait TraversesWorld { - fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> { - let direction = str_to_direction(directionStr); - let maybe_room = room.direction_to_room.get(&direction); - match maybe_room { - Some(entry) => Ok(entry), - //~^ ERROR 25:28: 25:37: lifetime mismatch [E0623] - _ => Err("Direction does not exist in room.") - } - } -} - - -#[derive(Debug, Eq, PartialEq, Hash)] -enum RoomDirection { - West, - East, - North, - South, - Up, - Down, - In, - Out, - - None -} - -struct Room { - description: String, - items: Vec, - direction_to_room: HashMap, -} - -impl Room { - fn new(description: &'static str) -> Room { - Room { - description: description.to_string(), - items: Vec::new(), - direction_to_room: HashMap::new() - } - } - - fn add_direction(&mut self, direction: RoomDirection, room: Room) { - self.direction_to_room.insert(direction, room); - } -} - -struct Item { - name: String, -} - -struct Inventory { - items: Vec, -} - -impl Inventory { - fn new() -> Inventory { - Inventory { - items: Vec::new() - } - } -} - -struct Player { - name: String, - inventory: Inventory, -} - -impl Player { - fn new(name: &'static str) -> Player { - Player { - name: name.to_string(), - inventory: Inventory::new() - } - } -} - -impl TraversesWorld for Player { -} - -impl Debug for Player { - fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> { - formatter.write_str("Player{ name:"); - formatter.write_str(&self.name); - formatter.write_str(" }"); - Ok(()) - } -} - -fn str_to_direction(to_parse: &str) -> RoomDirection { - match to_parse { //~ ERROR match arms have incompatible types - "w" | "west" => RoomDirection::West, - "e" | "east" => RoomDirection::East, - "n" | "north" => RoomDirection::North, - "s" | "south" => RoomDirection::South, - "in" => RoomDirection::In, - "out" => RoomDirection::Out, - "up" => RoomDirection::Up, - "down" => RoomDirection::Down, - _ => None - } -} - -fn main() { - let mut player = Player::new("Test player"); - let mut room = Room::new("A test room"); - println!("Made a player: {:?}", player); - println!("Direction parse: {:?}", str_to_direction("east")); - match player.attemptTraverse(&room, "west") { - Ok(_) => println!("Was able to move west"), - Err(msg) => println!("Not able to move west: {}", msg) - }; -} diff --git a/src/test/compile-fail/issue-17740.rs b/src/test/compile-fail/issue-17740.rs deleted file mode 100644 index 1d5ef4360dc..00000000000 --- a/src/test/compile-fail/issue-17740.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo<'a> { - data: &'a[u8], -} - -impl <'a> Foo<'a>{ - fn bar(self: &mut Foo) { - //~^ mismatched method receiver - //~| expected type `Foo<'a>` - //~| found type `Foo<'_>` - //~| lifetime mismatch - //~| mismatched method receiver - //~| expected type `Foo<'a>` - //~| found type `Foo<'_>` - //~| lifetime mismatch - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-17758.rs b/src/test/compile-fail/issue-17758.rs deleted file mode 100644 index a47f5c16a46..00000000000 --- a/src/test/compile-fail/issue-17758.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that regionck suggestions in a provided method of a trait -// don't ICE - -trait Foo<'a> { - fn foo(&'a self); - fn bar(&self) { - self.foo(); - //~^ ERROR cannot infer - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-17800.rs b/src/test/compile-fail/issue-17800.rs deleted file mode 100644 index f7cae91aa93..00000000000 --- a/src/test/compile-fail/issue-17800.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum MyOption { - MySome(T), - MyNone, -} - -fn main() { - match MyOption::MySome(42) { - MyOption::MySome { x: 42 } => (), - //~^ ERROR variant `MyOption::MySome` does not have a field named `x` - //~| ERROR pattern does not mention field `0` - _ => (), - } -} diff --git a/src/test/compile-fail/issue-17904-2.rs b/src/test/compile-fail/issue-17904-2.rs deleted file mode 100644 index a15ccb71aa7..00000000000 --- a/src/test/compile-fail/issue-17904-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that we can parse a unit struct with a where clause, even if -// it leads to an error later on since `T` is unused. - -struct Foo where T: Copy; //~ ERROR parameter `T` is never used - -fn main() {} diff --git a/src/test/compile-fail/issue-17905.rs b/src/test/compile-fail/issue-17905.rs deleted file mode 100644 index f11d482ea16..00000000000 --- a/src/test/compile-fail/issue-17905.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[derive(Debug)] -struct Pair (T, V); - -impl Pair< - &str, //~ ERROR missing lifetime specifier - isize -> { - fn say(self: &Pair<&str, isize>) { - println!("{}", self); - } -} - -fn main() { - let result = &Pair("shane", 1); - result.say(); -} diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/compile-fail/issue-17913.rs deleted file mode 100644 index 80e5f2b6e21..00000000000 --- a/src/test/compile-fail/issue-17913.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -// error-pattern: too big for the current architecture - -#![feature(box_syntax)] - -#[cfg(target_pointer_width = "64")] -fn main() { - let n = 0_usize; - let a: Box<_> = box [&n; 0xF000000000000000_usize]; - println!("{}", a[0xFFFFFF_usize]); -} - -#[cfg(target_pointer_width = "32")] -fn main() { - let n = 0_usize; - let a: Box<_> = box [&n; 0xFFFFFFFF_usize]; - println!("{}", a[0xFFFFFF_usize]); -} diff --git a/src/test/compile-fail/issue-17933.rs b/src/test/compile-fail/issue-17933.rs deleted file mode 100644 index 049a0665c54..00000000000 --- a/src/test/compile-fail/issue-17933.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub static X: usize = 1; - -fn main() { - match 1 { - self::X => { }, - //~^ ERROR expected unit struct/variant or constant, found static `self::X` - _ => { }, - } -} diff --git a/src/test/compile-fail/issue-17954.rs b/src/test/compile-fail/issue-17954.rs deleted file mode 100644 index 4211057610b..00000000000 --- a/src/test/compile-fail/issue-17954.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// revisions: ast mir -//[mir]compile-flags: -Z borrowck=mir - -#![feature(thread_local)] - -#[thread_local] -static FOO: u8 = 3; - -fn main() { - let a = &FOO; - //[mir]~^ ERROR `FOO` does not live long enough [E0597] - //[mir]~| does not live long enough - //[mir]~| NOTE borrowed value must be valid for the static lifetime - //[ast]~^^^^ ERROR borrowed value does not live long enough - //[ast]~| does not live long enough - //[ast]~| NOTE borrowed value must be valid for the static lifetime - - std::thread::spawn(move || { - println!("{}", a); - }); -} -//[mir]~^ borrowed value only lives until here -//[ast]~^^ temporary value only lives until here diff --git a/src/test/compile-fail/issue-17959.rs b/src/test/compile-fail/issue-17959.rs deleted file mode 100644 index 37c8173c4f6..00000000000 --- a/src/test/compile-fail/issue-17959.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern crate core; - -use core::ops::Drop; - -trait Bar {} - -struct G { - _ptr: *const T -} - -impl Drop for G { -//~^ ERROR: The requirement `T: std::marker::Sized` is added only by the Drop impl. [E0367] - fn drop(&mut self) { - if !self._ptr.is_null() { - } - } -} - -fn main() { - let x:G; -} diff --git a/src/test/compile-fail/issue-17994.rs b/src/test/compile-fail/issue-17994.rs deleted file mode 100644 index 25141b9b825..00000000000 --- a/src/test/compile-fail/issue-17994.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Tr {} -type Huh where T: Tr = isize; //~ ERROR type parameter `T` is unused -fn main() {} diff --git a/src/test/compile-fail/issue-17999.rs b/src/test/compile-fail/issue-17999.rs deleted file mode 100644 index 88945f80eae..00000000000 --- a/src/test/compile-fail/issue-17999.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(unused_variables)] - -fn main() { - for _ in 1..101 { - let x = (); //~ ERROR: unused variable: `x` - match () { - a => {} //~ ERROR: unused variable: `a` - } - } -} diff --git a/src/test/compile-fail/issue-18058.rs b/src/test/compile-fail/issue-18058.rs deleted file mode 100644 index 4c815e689d4..00000000000 --- a/src/test/compile-fail/issue-18058.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -impl Undefined {} -//~^ ERROR cannot find type `Undefined` in this scope - -fn main() {} diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs deleted file mode 100644 index 260038b7add..00000000000 --- a/src/test/compile-fail/issue-18107.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait AbstractRenderer {} - -fn _create_render(_: &()) -> - AbstractRenderer -//~^ ERROR the size for values of type -{ - match 0 { - _ => unimplemented!() - } -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-18118-2.rs b/src/test/compile-fail/issue-18118-2.rs deleted file mode 100644 index 6efe532b5fd..00000000000 --- a/src/test/compile-fail/issue-18118-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub fn main() { - const z: &'static isize = { - static p: isize = 3; - &p - //~^ ERROR constants cannot refer to statics, use a constant instead - }; -} diff --git a/src/test/compile-fail/issue-18118.rs b/src/test/compile-fail/issue-18118.rs deleted file mode 100644 index 7194c159c1e..00000000000 --- a/src/test/compile-fail/issue-18118.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub fn main() { - const z: &'static isize = { - //~^ ERROR let bindings in constants are unstable - //~| ERROR statements in constants are unstable - let p = 3; - //~^ ERROR let bindings in constants are unstable - //~| ERROR statements in constants are unstable - &p //~ ERROR `p` does not live long enough - //~^ ERROR let bindings in constants are unstable - }; -} diff --git a/src/test/compile-fail/issue-18119.rs b/src/test/compile-fail/issue-18119.rs deleted file mode 100644 index 412f7566f47..00000000000 --- a/src/test/compile-fail/issue-18119.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const X: u8 = 1; -static Y: u8 = 1; -fn foo() {} - -impl X {} -//~^ ERROR expected type, found constant `X` -impl Y {} -//~^ ERROR expected type, found static `Y` -impl foo {} -//~^ ERROR expected type, found function `foo` - -fn main() {} diff --git a/src/test/compile-fail/issue-18159.rs b/src/test/compile-fail/issue-18159.rs deleted file mode 100644 index 8991eded3d6..00000000000 --- a/src/test/compile-fail/issue-18159.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let x; //~ ERROR type annotations needed -} diff --git a/src/test/compile-fail/issue-18294.rs b/src/test/compile-fail/issue-18294.rs deleted file mode 100644 index efc1ba1635c..00000000000 --- a/src/test/compile-fail/issue-18294.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - const X: u32 = 1; - const Y: usize = &X as *const u32 as usize; //~ ERROR E0018 - println!("{}", Y); -} diff --git a/src/test/compile-fail/issue-18389.rs b/src/test/compile-fail/issue-18389.rs deleted file mode 100644 index aad3d52153a..00000000000 --- a/src/test/compile-fail/issue-18389.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::any::Any; -use std::any::TypeId; - -trait Private { - fn call(&self, p: P, r: R); -} -pub trait Public: Private< -//~^ ERROR private trait `Private<::P, ::R>` in public interface - ::P, - ::R -> { - type P; - type R; - - fn call_inner(&self); -} - -fn main() {} diff --git a/src/test/compile-fail/issue-18400.rs b/src/test/compile-fail/issue-18400.rs deleted file mode 100644 index dd17189aeea..00000000000 --- a/src/test/compile-fail/issue-18400.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Set { - fn contains(&self, _: T) -> bool; - fn set(&mut self, _: T); -} - -impl<'a, T, S> Set<&'a [T]> for S where - T: Copy, - S: Set, -{ - fn contains(&self, bits: &[T]) -> bool { - bits.iter().all(|&bit| self.contains(bit)) - } - - fn set(&mut self, bits: &[T]) { - for &bit in bits { - self.set(bit) - } - } -} - -fn main() { - let bits: &[_] = &[0, 1]; - - 0.contains(bits); - //~^ ERROR overflow -} diff --git a/src/test/compile-fail/issue-18423.rs b/src/test/compile-fail/issue-18423.rs deleted file mode 100644 index 5945a7a1c9a..00000000000 --- a/src/test/compile-fail/issue-18423.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that `Box` cannot be used with a lifetime parameter. - -struct Foo<'a> { - x: Box<'a, isize> //~ ERROR wrong number of lifetime parameters -} - -pub fn main() { -} diff --git a/src/test/compile-fail/issue-18446.rs b/src/test/compile-fail/issue-18446.rs deleted file mode 100644 index 60afea5a621..00000000000 --- a/src/test/compile-fail/issue-18446.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that name clashes between the method in an impl for the type -// and the method in the trait when both are in the same scope. - -trait T { - fn foo(&self); -} - -impl<'a> T + 'a { - fn foo(&self) {} -} - -impl T for i32 { - fn foo(&self) {} -} - -fn main() { - let x: &T = &0i32; - x.foo(); //~ ERROR multiple applicable items in scope [E0034] -} diff --git a/src/test/compile-fail/issue-18532.rs b/src/test/compile-fail/issue-18532.rs deleted file mode 100644 index 2be5fdcac4e..00000000000 --- a/src/test/compile-fail/issue-18532.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that overloaded call parameter checking does not ICE -// when a type error or unconstrained type variable propagates -// into it. - -fn main() { - (return)((),()); //~ ERROR expected function, found `!` -} diff --git a/src/test/compile-fail/issue-18566.rs b/src/test/compile-fail/issue-18566.rs deleted file mode 100644 index 41e82d0cd89..00000000000 --- a/src/test/compile-fail/issue-18566.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::ops::Deref; - -struct MyPtr<'a>(&'a mut usize); -impl<'a> Deref for MyPtr<'a> { - type Target = usize; - - fn deref<'b>(&'b self) -> &'b usize { self.0 } -} - -trait Tr { - fn poke(&self, s: &mut usize); -} - -impl Tr for usize { - fn poke(&self, s: &mut usize) { - *s = 2; - } -} - -fn main() { - let s = &mut 1; - - MyPtr(s).poke(s); - //~^ ERROR cannot borrow `*s` as mutable more than once at a time -} diff --git a/src/test/compile-fail/issue-18611.rs b/src/test/compile-fail/issue-18611.rs deleted file mode 100644 index a3ad76e1be0..00000000000 --- a/src/test/compile-fail/issue-18611.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn add_state(op: ::State) { -//~^ ERROR `isize: HasState` is not satisfied -} - -trait HasState { - type State; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-1871.rs b/src/test/compile-fail/issue-1871.rs deleted file mode 100644 index e4d132c8641..00000000000 --- a/src/test/compile-fail/issue-1871.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Tests that we don't generate a spurious error about f.honk's type -// being undeterminable -fn main() { - let f = 42; - - let _g = if f < 5 { - f.honk() //~ ERROR no method named `honk` found - } - else { - () - }; -} diff --git a/src/test/compile-fail/issue-18783.rs b/src/test/compile-fail/issue-18783.rs deleted file mode 100644 index 9a7b3781f1e..00000000000 --- a/src/test/compile-fail/issue-18783.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::cell::RefCell; - -fn main() { - let mut y = 1; - let c = RefCell::new(vec![]); - c.push(Box::new(|| y = 0)); - c.push(Box::new(|| y = 0)); -//~^ ERROR cannot borrow `y` as mutable more than once at a time -} - -fn ufcs() { - let mut y = 1; - let c = RefCell::new(vec![]); - - Push::push(&c, Box::new(|| y = 0)); - Push::push(&c, Box::new(|| y = 0)); -//~^ ERROR cannot borrow `y` as mutable more than once at a time -} - -trait Push<'c> { - fn push<'f: 'c>(&self, push: Box); -} - -impl<'c> Push<'c> for RefCell>> { - fn push<'f: 'c>(&self, fun: Box) { - self.borrow_mut().push(fun) - } -} diff --git a/src/test/compile-fail/issue-18919.rs b/src/test/compile-fail/issue-18919.rs deleted file mode 100644 index cc87a0977a0..00000000000 --- a/src/test/compile-fail/issue-18919.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -type FuncType<'f> = Fn(&isize) -> isize + 'f; - -fn ho_func(f: Option) { - //~^ ERROR the size for values of type -} - -fn main() {} diff --git a/src/test/compile-fail/issue-18937.rs b/src/test/compile-fail/issue-18937.rs deleted file mode 100644 index f7f84e6452d..00000000000 --- a/src/test/compile-fail/issue-18937.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for #18937. - -use std::fmt; - -#[derive(Debug)] -struct MyString<'a>(&'a String); - -struct B { - list: Vec>, -} - -trait A<'a> { - fn foo(&mut self, f: F) - where F: fmt::Debug + 'a, - Self: Sized; -} - -impl<'a> A<'a> for B { - fn foo(&mut self, f: F) //~ ERROR impl has stricter - where F: fmt::Debug + 'static, - { - self.list.push(Box::new(f)); - } -} - -fn main() { - let mut b = B { list: Vec::new() }; - - // Create a borrowed pointer, put it in `b`, then drop what's borrowing it - let a = "hello".to_string(); - b.foo(MyString(&a)); - - // Drop the data which `b` has a reference to - drop(a); - - // Use the data, probably segfaulting - for b in b.list.iter() { - println!("{:?}", b); - } -} diff --git a/src/test/compile-fail/issue-18959.rs b/src/test/compile-fail/issue-18959.rs deleted file mode 100644 index 7a6d012a3b6..00000000000 --- a/src/test/compile-fail/issue-18959.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Foo { fn foo(&self, ext_thing: &T); } -pub trait Bar: Foo { } -impl Bar for T { } - -pub struct Thing; -impl Foo for Thing { - fn foo(&self, _: &T) {} -} - -#[inline(never)] -fn foo(b: &Bar) { - //~^ ERROR E0038 - b.foo(&0) -} - -fn main() { - let mut thing = Thing; - let test: &Bar = &mut thing; - foo(test); -} diff --git a/src/test/compile-fail/issue-1900.rs b/src/test/compile-fail/issue-1900.rs deleted file mode 100644 index ccdd9db25c4..00000000000 --- a/src/test/compile-fail/issue-1900.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: `main` function is not allowed to have generic parameters -fn main() { } diff --git a/src/test/compile-fail/issue-19086.rs b/src/test/compile-fail/issue-19086.rs deleted file mode 100644 index ba571ce17fd..00000000000 --- a/src/test/compile-fail/issue-19086.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use Foo::FooB; - -enum Foo { - FooB { x: i32, y: i32 } -} - -fn main() { - let f = FooB { x: 3, y: 4 }; - match f { - FooB(a, b) => println!("{} {}", a, b), - //~^ ERROR expected tuple struct/variant, found struct variant `FooB` - } -} diff --git a/src/test/compile-fail/issue-19244-1.rs b/src/test/compile-fail/issue-19244-1.rs deleted file mode 100644 index df34aab4b8f..00000000000 --- a/src/test/compile-fail/issue-19244-1.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const TUP: (usize,) = (42,); - -fn main() { - let a: [isize; TUP.1]; - //~^ ERROR no field `1` on type `(usize,)` -} diff --git a/src/test/compile-fail/issue-19244-2.rs b/src/test/compile-fail/issue-19244-2.rs deleted file mode 100644 index 864f8f6b54e..00000000000 --- a/src/test/compile-fail/issue-19244-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct MyStruct { field: usize } -const STRUCT: MyStruct = MyStruct { field: 42 }; - -fn main() { - let a: [isize; STRUCT.nonexistent_field]; - //~^ no field `nonexistent_field` on type `MyStruct` -} diff --git a/src/test/compile-fail/issue-19380.rs b/src/test/compile-fail/issue-19380.rs deleted file mode 100644 index 322952ffef1..00000000000 --- a/src/test/compile-fail/issue-19380.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Qiz { - fn qiz(); -} - -struct Foo; -impl Qiz for Foo { - fn qiz() {} -} - -struct Bar { - foos: &'static [&'static (Qiz + 'static)] -//~^ ERROR E0038 -} - -const FOO : Foo = Foo; -const BAR : Bar = Bar { foos: &[&FOO]}; - -fn main() { } diff --git a/src/test/compile-fail/issue-19482.rs b/src/test/compile-fail/issue-19482.rs deleted file mode 100644 index b54f008f8ce..00000000000 --- a/src/test/compile-fail/issue-19482.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that a partially specified trait object with unspecified associated -// type does not type-check. - -trait Foo { - type A; - - fn dummy(&self) { } -} - -fn bar(x: &Foo) {} -//~^ ERROR the associated type `A` (from the trait `Foo`) must be specified - -pub fn main() {} diff --git a/src/test/compile-fail/issue-19521.rs b/src/test/compile-fail/issue-19521.rs deleted file mode 100644 index 93d95ca0b0f..00000000000 --- a/src/test/compile-fail/issue-19521.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - "".homura()(); //~ ERROR no method named `homura` found -} diff --git a/src/test/compile-fail/issue-19538.rs b/src/test/compile-fail/issue-19538.rs deleted file mode 100644 index a6190500582..00000000000 --- a/src/test/compile-fail/issue-19538.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo { - fn foo(&self, val: T); -} - -trait Bar: Foo { } - -pub struct Thing; - -impl Foo for Thing { - fn foo(&self, val: T) { } -} - -impl Bar for Thing { } - -fn main() { - let mut thing = Thing; - let test: &mut Bar = &mut thing; - //~^ ERROR E0038 - //~| ERROR E0038 -} diff --git a/src/test/compile-fail/issue-19601.rs b/src/test/compile-fail/issue-19601.rs deleted file mode 100644 index 02b4932cea8..00000000000 --- a/src/test/compile-fail/issue-19601.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -trait A {} -struct B where B: A> { t: T } - -#[rustc_error] -fn main() { //~ ERROR compilation successful -} diff --git a/src/test/compile-fail/issue-19660.rs b/src/test/compile-fail/issue-19660.rs deleted file mode 100644 index c4b871a28c5..00000000000 --- a/src/test/compile-fail/issue-19660.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: requires `copy` lang_item - -#![feature(lang_items, start, no_core)] -#![no_core] - -#[lang = "sized"] -trait Sized { } - -struct S; - -#[start] -fn main(_: isize, _: *const *const u8) -> isize { - let _ = S; - 0 -} diff --git a/src/test/compile-fail/issue-19692.rs b/src/test/compile-fail/issue-19692.rs deleted file mode 100644 index ca1715445e5..00000000000 --- a/src/test/compile-fail/issue-19692.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Homura; - -fn akemi(homura: Homura) { - let Some(ref madoka) = Some(homura.kaname()); //~ ERROR no method named `kaname` found - madoka.clone(); -} - -fn main() { } diff --git a/src/test/compile-fail/issue-19734.rs b/src/test/compile-fail/issue-19734.rs deleted file mode 100644 index a3820d20aac..00000000000 --- a/src/test/compile-fail/issue-19734.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() {} - -struct Type; - -impl Type { - undef!(); - //~^ ERROR cannot find macro `undef!` in this scope -} diff --git a/src/test/compile-fail/issue-19883.rs b/src/test/compile-fail/issue-19883.rs deleted file mode 100644 index 9b6a87702a9..00000000000 --- a/src/test/compile-fail/issue-19883.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait From { - type Output; - - fn from(src: Src) -> >::Output; -} - -trait To: Sized { - fn to>(self) -> - >::Dst - //~^ ERROR cannot find associated type `Dst` in trait `From` - { - From::from(self) - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-19982.rs b/src/test/compile-fail/issue-19982.rs deleted file mode 100644 index 9dbca997341..00000000000 --- a/src/test/compile-fail/issue-19982.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(unboxed_closures)] - -struct Foo; - -impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier - -fn main() {} diff --git a/src/test/compile-fail/issue-19991.rs b/src/test/compile-fail/issue-19991.rs deleted file mode 100644 index e07dfaf9fe5..00000000000 --- a/src/test/compile-fail/issue-19991.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test if the sugared if-let construct correctly prints "missing an else clause" when an else -// clause does not exist, instead of the unsympathetic "match arms have incompatible types" - -fn main() { - if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause - //~| expected type `()` - //~| found type `{integer}` - //~| expected (), found integral variable - 765 - }; -} diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs deleted file mode 100644 index 8db09182fa3..00000000000 --- a/src/test/compile-fail/issue-20005.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait From { - type Result; - - fn from(src: Src) -> Self::Result; -} - -trait To { - fn to( //~ ERROR the size for values of type - self - ) -> >::Result where Dst: From { - From::from(self) - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-20162.rs b/src/test/compile-fail/issue-20162.rs deleted file mode 100644 index b2f3a2da516..00000000000 --- a/src/test/compile-fail/issue-20162.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct X { x: i32 } - -fn main() { - let mut b: Vec = vec![]; - b.sort(); - //~^ ERROR `X: std::cmp::Ord` is not satisfied -} diff --git a/src/test/compile-fail/issue-20225.rs b/src/test/compile-fail/issue-20225.rs deleted file mode 100644 index da98f21e461..00000000000 --- a/src/test/compile-fail/issue-20225.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(fn_traits, unboxed_closures)] - -struct Foo; - -impl<'a, T> Fn<(&'a T,)> for Foo { - extern "rust-call" fn call(&self, (_,): (T,)) {} - //~^ ERROR: has an incompatible type for trait - //~| expected reference -} - -impl<'a, T> FnMut<(&'a T,)> for Foo { - extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} - //~^ ERROR: has an incompatible type for trait - //~| expected reference -} - -impl<'a, T> FnOnce<(&'a T,)> for Foo { - type Output = (); - - extern "rust-call" fn call_once(self, (_,): (T,)) {} - //~^ ERROR: has an incompatible type for trait - //~| expected reference -} - -fn main() {} diff --git a/src/test/compile-fail/issue-20261.rs b/src/test/compile-fail/issue-20261.rs deleted file mode 100644 index bb4dbdcd0cb..00000000000 --- a/src/test/compile-fail/issue-20261.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - // NB: this (almost) typechecks when default binding modes are enabled. - for (ref i,) in [].iter() { - i.clone(); - //~^ ERROR type annotations needed - } -} diff --git a/src/test/compile-fail/issue-20313.rs b/src/test/compile-fail/issue-20313.rs deleted file mode 100644 index dfb23c05036..00000000000 --- a/src/test/compile-fail/issue-20313.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern { - #[link_name = "llvm.sqrt.f32"] - fn sqrt(x: f32) -> f32; //~ ERROR linking to LLVM intrinsics is experimental -} - -fn main(){ -} diff --git a/src/test/compile-fail/issue-20413.rs b/src/test/compile-fail/issue-20413.rs deleted file mode 100644 index a48c03aa178..00000000000 --- a/src/test/compile-fail/issue-20413.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo { - fn answer(self); -} - -struct NoData; -//~^ ERROR: parameter `T` is never used - -impl Foo for T where NoData: Foo { -//~^ ERROR: overflow evaluating the requirement - fn answer(self) { - let val: NoData = NoData; - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-20433.rs b/src/test/compile-fail/issue-20433.rs deleted file mode 100644 index f760cd59968..00000000000 --- a/src/test/compile-fail/issue-20433.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() {} - -struct The; - -impl The { - fn iceman(c: Vec<[i32]>) {} - //~^ ERROR the size for values of type -} diff --git a/src/test/compile-fail/issue-20605.rs b/src/test/compile-fail/issue-20605.rs deleted file mode 100644 index 60d012ab134..00000000000 --- a/src/test/compile-fail/issue-20605.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn changer<'a>(mut things: Box>) { - for item in *things { *item = 0 } -//~^ ERROR the size for values of type -} - -fn main() {} diff --git a/src/test/compile-fail/issue-20616-1.rs b/src/test/compile-fail/issue-20616-1.rs deleted file mode 100644 index 3e29383d62c..00000000000 --- a/src/test/compile-fail/issue-20616-1.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -type Type_1<'a T> = &'a T; //~ error: expected one of `,`, `:`, or `>`, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-2.rs b/src/test/compile-fail/issue-20616-2.rs deleted file mode 100644 index 1ec7a74559a..00000000000 --- a/src/test/compile-fail/issue-20616-2.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -type Type_2 = Type_1_<'static ()>; //~ error: expected one of `,` or `>`, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-3.rs b/src/test/compile-fail/issue-20616-3.rs deleted file mode 100644 index 885fd246547..00000000000 --- a/src/test/compile-fail/issue-20616-3.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -type Type_3 = Box; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-4.rs b/src/test/compile-fail/issue-20616-4.rs deleted file mode 100644 index 0dbe92fc1bc..00000000000 --- a/src/test/compile-fail/issue-20616-4.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -type Type_4 = Type_1_<'static,, T>; -//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-5.rs b/src/test/compile-fail/issue-20616-5.rs deleted file mode 100644 index 794e5178f4b..00000000000 --- a/src/test/compile-fail/issue-20616-5.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -type Type_5<'a> = Type_1_<'a, (),,>; -//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-6.rs b/src/test/compile-fail/issue-20616-6.rs deleted file mode 100644 index fe91751a4a0..00000000000 --- a/src/test/compile-fail/issue-20616-6.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -type Type_6 = Type_5_<'a,,>; -//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-7.rs b/src/test/compile-fail/issue-20616-7.rs deleted file mode 100644 index 184ad027102..00000000000 --- a/src/test/compile-fail/issue-20616-7.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -type Type_7 = Box<(),,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` - - -//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/compile-fail/issue-20616-8.rs b/src/test/compile-fail/issue-20616-8.rs deleted file mode 100644 index 5cdec33e94b..00000000000 --- a/src/test/compile-fail/issue-20616-8.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, identifier, or lifetime, found `,` - - -//type Type_9 = Box; // error: expected identifier, found `,` diff --git a/src/test/compile-fail/issue-20616-9.rs b/src/test/compile-fail/issue-20616-9.rs deleted file mode 100644 index 7995addb692..00000000000 --- a/src/test/compile-fail/issue-20616-9.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We need all these 9 issue-20616-N.rs files -// because we can only catch one parsing error at a time - - - -type Type_1_<'a, T> = &'a T; - - -//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` - - -//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` - - -//type Type_3 = Box; // error: expected type, found `,` - - -//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` - - -type Type_5_<'a> = Type_1_<'a, ()>; - - -//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` - - -//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` - - -//type Type_7 = Box<(),,>; // error: expected type, found `,` - - -//type Type_8<'a,,> = &'a (); // error: expected identifier, found `,` - - -type Type_9 = Box; //~ error: expected one of `>`, identifier, or lifetime, found `,` diff --git a/src/test/compile-fail/issue-20714.rs b/src/test/compile-fail/issue-20714.rs deleted file mode 100644 index cb322f00723..00000000000 --- a/src/test/compile-fail/issue-20714.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct G; - -fn main() { - let g = G(); //~ ERROR: expected function, found `G` -} diff --git a/src/test/compile-fail/issue-20772.rs b/src/test/compile-fail/issue-20772.rs deleted file mode 100644 index d67c76a1525..00000000000 --- a/src/test/compile-fail/issue-20772.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait T : Iterator -//~^ ERROR cycle detected -//~| ERROR associated type `Item` not found for `Self` -{} - -fn main() {} diff --git a/src/test/compile-fail/issue-20801.rs b/src/test/compile-fail/issue-20801.rs deleted file mode 100644 index d3b97a9c058..00000000000 --- a/src/test/compile-fail/issue-20801.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// We used to ICE when moving out of a `*mut T` or `*const T`. - -struct T(u8); - -static mut GLOBAL_MUT_T: T = T(0); - -static GLOBAL_T: T = T(0); - -fn imm_ref() -> &'static T { - unsafe { &GLOBAL_T } -} - -fn mut_ref() -> &'static mut T { - unsafe { &mut GLOBAL_MUT_T } -} - -fn mut_ptr() -> *mut T { - unsafe { 0 as *mut T } -} - -fn const_ptr() -> *const T { - unsafe { 0 as *const T } -} - -pub fn main() { - let a = unsafe { *mut_ref() }; - //~^ ERROR cannot move out of borrowed content - - let b = unsafe { *imm_ref() }; - //~^ ERROR cannot move out of borrowed content - - let c = unsafe { *mut_ptr() }; - //~^ ERROR cannot move out of dereference of raw pointer - - let d = unsafe { *const_ptr() }; - //~^ ERROR cannot move out of dereference of raw pointer -} diff --git a/src/test/compile-fail/issue-20825.rs b/src/test/compile-fail/issue-20825.rs deleted file mode 100644 index cbb987cd512..00000000000 --- a/src/test/compile-fail/issue-20825.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Subscriber { - type Input; -} - -pub trait Processor: Subscriber { - //~^ ERROR cycle detected - type Input; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-20831-debruijn.rs b/src/test/compile-fail/issue-20831-debruijn.rs deleted file mode 100644 index 3f00f561ae9..00000000000 --- a/src/test/compile-fail/issue-20831-debruijn.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for #20831: debruijn index account was thrown off -// by the (anonymous) lifetime in `::Output` -// below. Note that changing to a named lifetime made the problem go -// away. - -use std::cell::RefCell; -use std::ops::{Shl, Shr}; - -pub trait Subscriber { - type Input; -} - -pub trait Publisher<'a> { - type Output; - fn subscribe(&mut self, _: Box + 'a>); -} - -pub trait Processor<'a> : Subscriber + Publisher<'a> { } - -impl<'a, P> Processor<'a> for P where P : Subscriber + Publisher<'a> { } - -struct MyStruct<'a> { - sub: Box + 'a> -} - -impl<'a> Publisher<'a> for MyStruct<'a> { - type Output = u64; - fn subscribe(&mut self, t : Box::Output> + 'a>) { - // Not obvious, but there is an implicit lifetime here -------^ - //~^^ ERROR cannot infer - // - // The fact that `Publisher` is using an implicit lifetime is - // what was causing the debruijn accounting to be off, so - // leave it that way! - self.sub = t; - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-20939.rs b/src/test/compile-fail/issue-20939.rs deleted file mode 100644 index 5282ce4bb88..00000000000 --- a/src/test/compile-fail/issue-20939.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo {} - -impl<'a> Foo for Foo+'a {} -//~^ ERROR the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` - -fn main() {} diff --git a/src/test/compile-fail/issue-2111.rs b/src/test/compile-fail/issue-2111.rs deleted file mode 100644 index 8180ce52bdb..00000000000 --- a/src/test/compile-fail/issue-2111.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo(a: Option, b: Option) { - match (a,b) { - //~^ ERROR: non-exhaustive patterns: `(None, None)` not covered - (Some(a), Some(b)) if a == b => { } - (Some(_), None) | - (None, Some(_)) => { } - } -} - -fn main() { - foo(None, None); -} diff --git a/src/test/compile-fail/issue-21160.rs b/src/test/compile-fail/issue-21160.rs deleted file mode 100644 index 0de0ab2269b..00000000000 --- a/src/test/compile-fail/issue-21160.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Bar; - -impl Bar { - fn hash(&self, _: T) {} -} - -#[derive(Hash)] -struct Foo(Bar); -//~^ error: `Bar: std::hash::Hash` is not satisfied - -fn main() {} diff --git a/src/test/compile-fail/issue-21174.rs b/src/test/compile-fail/issue-21174.rs deleted file mode 100644 index 9d9b7e48043..00000000000 --- a/src/test/compile-fail/issue-21174.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Trait<'a> { - type A; - type B; -} - -fn foo<'a, T: Trait<'a>>(value: T::A) { - let new: T::B = unsafe { std::mem::transmute(value) }; -//~^ ERROR: transmute called with types of different sizes -} - -fn main() { } diff --git a/src/test/compile-fail/issue-21177.rs b/src/test/compile-fail/issue-21177.rs deleted file mode 100644 index 9da57877a09..00000000000 --- a/src/test/compile-fail/issue-21177.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Trait { - type A; - type B; -} - -fn foo>() { } -//~^ ERROR cycle detected -//~| ERROR associated type `B` not found for `T` - -fn main() { } diff --git a/src/test/compile-fail/issue-21332.rs b/src/test/compile-fail/issue-21332.rs deleted file mode 100644 index db3334834d4..00000000000 --- a/src/test/compile-fail/issue-21332.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct S; - -impl Iterator for S { - type Item = i32; - fn next(&mut self) -> Result { Ok(7) } - //~^ ERROR method `next` has an incompatible type for trait - //~| expected enum `std::option::Option`, found enum `std::result::Result` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-21356.rs b/src/test/compile-fail/issue-21356.rs deleted file mode 100644 index f66c09291cc..00000000000 --- a/src/test/compile-fail/issue-21356.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused_macros)] - -macro_rules! test { ($wrong:t_ty ..) => () } - //~^ ERROR: invalid fragment specifier `t_ty` - -fn main() {} diff --git a/src/test/compile-fail/issue-21449.rs b/src/test/compile-fail/issue-21449.rs deleted file mode 100644 index cc44cf88f09..00000000000 --- a/src/test/compile-fail/issue-21449.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod MyMod {} - -fn main() { - let myVar = MyMod { T: 0 }; - //~^ ERROR expected struct, variant or union type, found module `MyMod` -} diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs deleted file mode 100644 index 256c5d8e6f7..00000000000 --- a/src/test/compile-fail/issue-2149.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait vec_monad { - fn bind(&self, f: F) where F: FnMut(A) -> Vec; -} - -impl vec_monad for Vec { - fn bind(&self, mut f: F) where F: FnMut(A) -> Vec { - let mut r = panic!(); - for elt in self { r = r + f(*elt); } - //~^ ERROR E0277 - } -} -fn main() { - ["hi"].bind(|x| [x] ); - //~^ ERROR no method named `bind` found for type `[&str; 1]` in the current scope -} diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs deleted file mode 100644 index 8b109b0a5c0..00000000000 --- a/src/test/compile-fail/issue-2150.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(unreachable_code)] -#![allow(unused_variables)] -#![allow(dead_code)] - -fn fail_len(v: Vec ) -> usize { - let mut i = 3; - panic!(); - for x in &v { i += 1; } - //~^ ERROR: unreachable statement - return i; -} -fn main() {} diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs deleted file mode 100644 index 3cf971f3f8d..00000000000 --- a/src/test/compile-fail/issue-2151.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let x = panic!(); - x.clone(); //~ ERROR type annotations needed -} diff --git a/src/test/compile-fail/issue-21554.rs b/src/test/compile-fail/issue-21554.rs deleted file mode 100644 index 1b87862a056..00000000000 --- a/src/test/compile-fail/issue-21554.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Inches(i32); - -fn main() { - Inches as f32; - //~^ ERROR casting -} diff --git a/src/test/compile-fail/issue-21701.rs b/src/test/compile-fail/issue-21701.rs deleted file mode 100644 index f24de2ffe6b..00000000000 --- a/src/test/compile-fail/issue-21701.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo(t: U) { - let y = t(); -//~^ ERROR: expected function, found `U` -} - -struct Bar; - -pub fn some_func() { - let f = Bar(); -//~^ ERROR: expected function, found `Bar` -} - -fn main() { - foo(|| { 1 }); -} diff --git a/src/test/compile-fail/issue-21763.rs b/src/test/compile-fail/issue-21763.rs deleted file mode 100644 index b4f952c87d4..00000000000 --- a/src/test/compile-fail/issue-21763.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for HashMap only impl'ing Send/Sync if its contents do - -use std::collections::HashMap; -use std::rc::Rc; - -fn foo() {} - -fn main() { - foo::, Rc<()>>>(); - //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely -} diff --git a/src/test/compile-fail/issue-21837.rs b/src/test/compile-fail/issue-21837.rs deleted file mode 100644 index 86506de1ea9..00000000000 --- a/src/test/compile-fail/issue-21837.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Bound {} -pub struct Foo(T); - -pub trait Trait1 {} -impl Trait1 for Foo {} - -pub trait Trait2 {} -impl Trait2 for Foo {} //~ ERROR the trait bound `T: Bound` is not satisfied - -fn main() {} diff --git a/src/test/compile-fail/issue-21946.rs b/src/test/compile-fail/issue-21946.rs deleted file mode 100644 index 0d652be5c26..00000000000 --- a/src/test/compile-fail/issue-21946.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo { - type A; -} - -struct FooStruct; - -impl Foo for FooStruct { -//~^ ERROR overflow evaluating the requirement `::A` - type A = ::A; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-21974.rs b/src/test/compile-fail/issue-21974.rs deleted file mode 100644 index 6ddfa4c8e3e..00000000000 --- a/src/test/compile-fail/issue-21974.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that (for now) we report an ambiguity error here, because -// specific trait relationships are ignored for the purposes of trait -// matching. This behavior should likely be improved such that this -// test passes. See #21974 for more details. - -trait Foo { - fn foo(self); -} - -fn foo<'a,'b,T>(x: &'a T, y: &'b T) //~ ERROR type annotations required - where &'a T : Foo, - &'b T : Foo -{ - x.foo(); - y.foo(); -} - -fn main() { } diff --git a/src/test/compile-fail/issue-22034.rs b/src/test/compile-fail/issue-22034.rs deleted file mode 100644 index 5271ea79917..00000000000 --- a/src/test/compile-fail/issue-22034.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(libc)] - -extern crate libc; - -fn main() { - let ptr: *mut () = 0 as *mut _; - let _: &mut Fn() = unsafe { - &mut *(ptr as *mut Fn()) - //~^ ERROR `(): std::ops::Fn<()>` is not satisfied - }; -} diff --git a/src/test/compile-fail/issue-22037.rs b/src/test/compile-fail/issue-22037.rs deleted file mode 100644 index ffa881b49c5..00000000000 --- a/src/test/compile-fail/issue-22037.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait A { - type Output; - fn a(&self) -> ::X; - //~^ ERROR cannot find associated type `X` in trait `A` -} - -impl A for u32 { - type Output = u32; - fn a(&self) -> u32 { - 0 - } -} - -fn main() { - let a: u32 = 0; - let b: u32 = a.a(); -} diff --git a/src/test/compile-fail/issue-22289.rs b/src/test/compile-fail/issue-22289.rs deleted file mode 100644 index c23fc4f3344..00000000000 --- a/src/test/compile-fail/issue-22289.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - 0 as &std::any::Any; //~ ERROR non-primitive cast -} diff --git a/src/test/compile-fail/issue-22312.rs b/src/test/compile-fail/issue-22312.rs deleted file mode 100644 index 2128c420630..00000000000 --- a/src/test/compile-fail/issue-22312.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::ops::Index; - -pub trait Array2D: Index { - fn rows(&self) -> usize; - fn columns(&self) -> usize; - fn get<'a>(&'a self, y: usize, x: usize) -> Option<&'a >::Output> { - if y >= self.rows() || x >= self.columns() { - return None; - } - let i = y * self.columns() + x; - let indexer = &(*self as &Index>::Output>); - //~^ERROR non-primitive cast - Some(indexer.index(i)) - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-22384.rs b/src/test/compile-fail/issue-22384.rs deleted file mode 100644 index ae7fb01e057..00000000000 --- a/src/test/compile-fail/issue-22384.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Trait { - fn foo(); -} - -fn main() { - <::foobar as Trait>::foo(); - //~^ ERROR cannot find associated type `foobar` in trait `Copy` -} diff --git a/src/test/compile-fail/issue-22434.rs b/src/test/compile-fail/issue-22434.rs deleted file mode 100644 index 6effd02bac8..00000000000 --- a/src/test/compile-fail/issue-22434.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Foo { - type A; -} - -type I<'a> = &'a (Foo + 'a); -//~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified - -fn main() {} diff --git a/src/test/compile-fail/issue-22468.rs b/src/test/compile-fail/issue-22468.rs deleted file mode 100644 index 50e5dd2955d..00000000000 --- a/src/test/compile-fail/issue-22468.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let foo = "bar"; - let x = foo("baz"); - //~^ ERROR: expected function, found `&str` -} - -fn foo(file: &str) -> bool { - true -} diff --git a/src/test/compile-fail/issue-22599.rs b/src/test/compile-fail/issue-22599.rs deleted file mode 100644 index b9ea3583296..00000000000 --- a/src/test/compile-fail/issue-22599.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(unused_variables)] - -fn f(_: i32) {} - -fn main() { - let mut v = 0; - f(v); - v = match 0 { a => 0 }; //~ ERROR: unused variable: `a` - f(v); -} diff --git a/src/test/compile-fail/issue-22603.rs b/src/test/compile-fail/issue-22603.rs deleted file mode 100644 index d08f916b870..00000000000 --- a/src/test/compile-fail/issue-22603.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(unboxed_closures, fn_traits, rustc_attrs)] - -struct Foo; - -impl FnOnce<(A,)> for Foo { - type Output = (); - extern "rust-call" fn call_once(self, (_,): (A,)) { - } -} -#[rustc_error] -fn main() { //~ ERROR compilation successful - println!("{:?}", Foo("bar")); -} diff --git a/src/test/compile-fail/issue-22673.rs b/src/test/compile-fail/issue-22673.rs deleted file mode 100644 index 2396007c3df..00000000000 --- a/src/test/compile-fail/issue-22673.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Expr : PartialEq { - //~^ ERROR: cycle detected - type Item; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-22684.rs b/src/test/compile-fail/issue-22684.rs deleted file mode 100644 index a791758ad17..00000000000 --- a/src/test/compile-fail/issue-22684.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod foo { - pub struct Foo; - impl Foo { - fn bar(&self) {} - } - - pub trait Baz { - fn bar(&self) -> bool { true } - } - impl Baz for Foo {} -} - -fn main() { - use foo::Baz; - - // Check that `bar` resolves to the trait method, not the inherent impl method. - let _: () = foo::Foo.bar(); //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-22706.rs b/src/test/compile-fail/issue-22706.rs deleted file mode 100644 index 3d9ec0a6581..00000000000 --- a/src/test/compile-fail/issue-22706.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn is_copy::Copy>() {} -//~^ ERROR type parameters are not allowed on this type [E0109] -fn main() {} diff --git a/src/test/compile-fail/issue-22789.rs b/src/test/compile-fail/issue-22789.rs deleted file mode 100644 index cba1c367bb9..00000000000 --- a/src/test/compile-fail/issue-22789.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(unboxed_closures, fn_traits, rustc_attrs)] - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let k = |x: i32| { x + 1 }; - Fn::call(&k, (0,)); -} diff --git a/src/test/compile-fail/issue-2281-part1.rs b/src/test/compile-fail/issue-2281-part1.rs deleted file mode 100644 index e3fd9c48a52..00000000000 --- a/src/test/compile-fail/issue-2281-part1.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { println!("{}", foobar); } //~ ERROR cannot find value `foobar` in this scope diff --git a/src/test/compile-fail/issue-22874.rs b/src/test/compile-fail/issue-22874.rs deleted file mode 100644 index e0a87b3a174..00000000000 --- a/src/test/compile-fail/issue-22874.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Table { - rows: [[String]], - //~^ ERROR the size for values of type -} - -fn f(table: &Table) -> &[String] { - &table.rows[0] -} - -fn main() {} diff --git a/src/test/compile-fail/issue-22933-1.rs b/src/test/compile-fail/issue-22933-1.rs deleted file mode 100644 index afb972faaca..00000000000 --- a/src/test/compile-fail/issue-22933-1.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -struct CNFParser { - token: char, -} - -impl CNFParser { - fn is_whitespace(c: char) -> bool { - c == ' ' || c == '\n' - } - - fn consume_whitespace(&mut self) { - self.consume_while(&(CNFParser::is_whitespace)) - } - - fn consume_while(&mut self, p: &Fn(char) -> bool) { - while p(self.token) { - return - } - } -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-22933-3.rs b/src/test/compile-fail/issue-22933-3.rs deleted file mode 100644 index 62adae41adf..00000000000 --- a/src/test/compile-fail/issue-22933-3.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const FOO: [u32; u8::MIN as usize] = []; -//~^ ERROR no associated item named `MIN` found for type `u8` - -fn main() {} diff --git a/src/test/compile-fail/issue-23024.rs b/src/test/compile-fail/issue-23024.rs deleted file mode 100644 index 5d9b49f486c..00000000000 --- a/src/test/compile-fail/issue-23024.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] -use std::any::Any; - -fn main() -{ - fn h(x:i32) -> i32 {3*x} - let mut vfnfer:Vec> = vec![]; - vfnfer.push(box h); - println!("{:?}",(vfnfer[0] as Fn)(3)); - //~^ ERROR the precise format of `Fn`-family traits' - //~| ERROR wrong number of type arguments: expected 1, found 0 [E0243] - //~| ERROR the value of the associated type `Output` (from the trait `std::ops::FnOnce`) -} diff --git a/src/test/compile-fail/issue-23046.rs b/src/test/compile-fail/issue-23046.rs deleted file mode 100644 index 670706b7a9a..00000000000 --- a/src/test/compile-fail/issue-23046.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub enum Expr<'var, VAR> { - Let(Box>, - Box Fn(Expr<'v, VAR>) -> Expr<'v, VAR> + 'var>) -} - -pub fn add<'var, VAR> - (a: Expr<'var, VAR>, b: Expr<'var, VAR>) -> Expr<'var, VAR> { - loop {} -} - -pub fn let_<'var, VAR, F: for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR>> - (a: Expr<'var, VAR>, b: F) -> Expr<'var, VAR> { - loop {} -} - -fn main() { - let ex = |x| { //~ ERROR type annotations needed - let_(add(x,x), |y| { - let_(add(x, x), |x|x)})}; -} diff --git a/src/test/compile-fail/issue-23073.rs b/src/test/compile-fail/issue-23073.rs deleted file mode 100644 index 2d219177a80..00000000000 --- a/src/test/compile-fail/issue-23073.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_type_defaults)] - -trait Foo { type T; } -trait Bar { - type Foo: Foo; - type FooT = <::Foo>::T; //~ ERROR ambiguous associated type -} - -fn main() {} diff --git a/src/test/compile-fail/issue-23080-2.rs b/src/test/compile-fail/issue-23080-2.rs deleted file mode 100644 index fc365a4b9aa..00000000000 --- a/src/test/compile-fail/issue-23080-2.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-tidy-linelength - -//~^^^^^^^^^^^^ ERROR - -#![feature(optin_builtin_traits)] - -unsafe auto trait Trait { -//~^ ERROR E0380 - type Output; -} - -fn call_method(x: T) {} - -fn main() { - // ICE - call_method(()); -} diff --git a/src/test/compile-fail/issue-23080.rs b/src/test/compile-fail/issue-23080.rs deleted file mode 100644 index 153b6fd07e6..00000000000 --- a/src/test/compile-fail/issue-23080.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-tidy-linelength - -#![feature(optin_builtin_traits)] - -unsafe auto trait Trait { -//~^ ERROR E0380 - fn method(&self) { - println!("Hello"); - } -} - -fn call_method(x: T) { - x.method(); -} - -fn main() { - // ICE - call_method(()); -} diff --git a/src/test/compile-fail/issue-23122-1.rs b/src/test/compile-fail/issue-23122-1.rs deleted file mode 100644 index 36d8450848d..00000000000 --- a/src/test/compile-fail/issue-23122-1.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Next { - type Next: Next; -} - -struct GetNext { t: T } - -impl Next for GetNext { - //~^ ERROR overflow evaluating the requirement - type Next = as Next>::Next; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-23122-2.rs b/src/test/compile-fail/issue-23122-2.rs deleted file mode 100644 index faaf78f894b..00000000000 --- a/src/test/compile-fail/issue-23122-2.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Next { - type Next: Next; -} - -struct GetNext { t: T } - -impl Next for GetNext { - //~^ ERROR overflow evaluating the requirement - type Next = as Next>::Next; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-23253.rs b/src/test/compile-fail/issue-23253.rs deleted file mode 100644 index 626604a87a7..00000000000 --- a/src/test/compile-fail/issue-23253.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { Bar } - -fn main() { - Foo::Bar.a; - //~^ no field `a` on type `Foo` -} diff --git a/src/test/compile-fail/issue-23281.rs b/src/test/compile-fail/issue-23281.rs deleted file mode 100644 index 5de00eb8f68..00000000000 --- a/src/test/compile-fail/issue-23281.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-tidy-linelength - -pub struct Struct; - -impl Struct { - pub fn function(funs: Vec ()>) {} - //~^ ERROR the size for values of type -} - -fn main() {} diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs deleted file mode 100644 index f1a282695ac..00000000000 --- a/src/test/compile-fail/issue-2330.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum chan { } - -trait channel { - fn send(&self, v: T); -} - -// `chan` is not a trait, it's an enum -impl chan for isize { //~ ERROR expected trait, found enum `chan` - fn send(&self, v: isize) { panic!() } -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-23589.rs b/src/test/compile-fail/issue-23589.rs deleted file mode 100644 index 1c1d42da029..00000000000 --- a/src/test/compile-fail/issue-23589.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let v: Vec(&str) = vec!['1', '2']; - //~^ ERROR parenthesized parameters may only be used with a trait -} diff --git a/src/test/compile-fail/issue-23595-1.rs b/src/test/compile-fail/issue-23595-1.rs deleted file mode 100644 index a3422d859c6..00000000000 --- a/src/test/compile-fail/issue-23595-1.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_type_defaults)] - -use std::ops::{Index}; - -trait Hierarchy { - type Value; - type ChildKey; - type Children = Index; - //~^ ERROR: the value of the associated type `ChildKey` - //~^^ ERROR: the value of the associated type `Children` - //~^^^ ERROR: the value of the associated type `Value` - - fn data(&self) -> Option<(Self::Value, Self::Children)>; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-23595-2.rs b/src/test/compile-fail/issue-23595-2.rs deleted file mode 100644 index 6a3ce03fce5..00000000000 --- a/src/test/compile-fail/issue-23595-2.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_type_defaults)] - -pub struct C {a:AType} - -pub trait A { - type B = C; - //~^ ERROR: associated type `anything_here_kills_it` not found for `Self` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-23966.rs b/src/test/compile-fail/issue-23966.rs deleted file mode 100644 index 544d3c8af20..00000000000 --- a/src/test/compile-fail/issue-23966.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - "".chars().fold(|_, _| (), ()); - //~^ ERROR E0277 -} diff --git a/src/test/compile-fail/issue-24013.rs b/src/test/compile-fail/issue-24013.rs deleted file mode 100644 index a7232781f6f..00000000000 --- a/src/test/compile-fail/issue-24013.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - use std::mem::{transmute, swap}; - let a = 1; - let b = 2; - unsafe {swap::<&mut _>(transmute(&a), transmute(&b))}; - //~^ ERROR type annotations needed -} diff --git a/src/test/compile-fail/issue-24204.rs b/src/test/compile-fail/issue-24204.rs deleted file mode 100644 index 2a012da0083..00000000000 --- a/src/test/compile-fail/issue-24204.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(dead_code)] - -trait MultiDispatch { - type O; -} - -trait Trait: Sized { - type A: MultiDispatch; - type B; - - fn new(u: U) -> >::O where Self::A : MultiDispatch; -} - -fn test>(b: i32) -> T where T::A: MultiDispatch { T::new(b) } -//~^ ERROR type mismatch resolving - -fn main() {} diff --git a/src/test/compile-fail/issue-24267-flow-exit.rs b/src/test/compile-fail/issue-24267-flow-exit.rs deleted file mode 100644 index 4aca6bf38e1..00000000000 --- a/src/test/compile-fail/issue-24267-flow-exit.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Ensure that we reject code when a nonlocal exit (`break`, -// `continue`) causes us to pop over a needed assignment. - -pub fn main() { - foo1(); - foo2(); -} - -pub fn foo1() { - let x: i32; - loop { x = break; } - println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` -} - -pub fn foo2() { - let x: i32; - for _ in 0..10 { x = continue; } - println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` -} diff --git a/src/test/compile-fail/issue-24322.rs b/src/test/compile-fail/issue-24322.rs deleted file mode 100644 index bb726aca921..00000000000 --- a/src/test/compile-fail/issue-24322.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct B; - -impl B { - fn func(&self) -> u32 { 42 } -} - -fn main() { - let x: &fn(&B) -> u32 = &B::func; //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-24352.rs b/src/test/compile-fail/issue-24352.rs deleted file mode 100644 index 4b077314056..00000000000 --- a/src/test/compile-fail/issue-24352.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - 1.0f64 - 1.0; - 1.0f64 - 1 //~ ERROR E0277 -} diff --git a/src/test/compile-fail/issue-24357.rs b/src/test/compile-fail/issue-24357.rs deleted file mode 100644 index 016ce93a0bd..00000000000 --- a/src/test/compile-fail/issue-24357.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct NoCopy; -fn main() { - let x = NoCopy; - let f = move || { let y = x; }; - //~^ NOTE value moved (into closure) here - let z = x; - //~^ ERROR use of moved value: `x` - //~| NOTE value used here after move - //~| NOTE move occurs because `x` has type `NoCopy` -} diff --git a/src/test/compile-fail/issue-24363.rs b/src/test/compile-fail/issue-24363.rs deleted file mode 100644 index 619ad74ad00..00000000000 --- a/src/test/compile-fail/issue-24363.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - 1.create_a_type_error[ //~ `{integer}` is a primitive type and therefore doesn't have fields - ()+() //~ ERROR binary operation `+` cannot be applied - // ^ ensure that we typeck the inner expression ^ - ]; -} diff --git a/src/test/compile-fail/issue-24365.rs b/src/test/compile-fail/issue-24365.rs deleted file mode 100644 index 72df6fb5999..00000000000 --- a/src/test/compile-fail/issue-24365.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub enum Attribute { - Code {attr_name_idx: u16}, -} - -pub enum Foo { - Bar -} - -fn test(a: Foo) { - println!("{}", a.b); //~ no field `b` on type `Foo` -} - -fn main() { - let x = Attribute::Code { - attr_name_idx: 42, - }; - let z = (&x).attr_name_idx; //~ no field `attr_name_idx` on type `&Attribute` - let y = x.attr_name_idx; //~ no field `attr_name_idx` on type `Attribute` -} diff --git a/src/test/compile-fail/issue-24446.rs b/src/test/compile-fail/issue-24446.rs deleted file mode 100644 index a9c7978642d..00000000000 --- a/src/test/compile-fail/issue-24446.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - static foo: Fn() -> u32 = || -> u32 { - //~^ ERROR mismatched types - //~| ERROR the size for values of type - 0 - }; -} diff --git a/src/test/compile-fail/issue-24682.rs b/src/test/compile-fail/issue-24682.rs deleted file mode 100644 index 0e872f71df4..00000000000 --- a/src/test/compile-fail/issue-24682.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait A: Sized { - type N; - fn x() -> - Self< - N= //~ ERROR associated type bindings are not allowed here - Self::N> { - loop {} - } - fn y(&self) -> - std - //~ ERROR associated type bindings are not allowed here - ::option::Option<()> - { None } - fn z(&self) -> - u32 //~ ERROR associated type bindings are not allowed here - { 42 } - -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-24819.rs b/src/test/compile-fail/issue-24819.rs deleted file mode 100644 index 52f5f1cd079..00000000000 --- a/src/test/compile-fail/issue-24819.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::collections::HashSet; - -fn main() { - let mut v = Vec::new(); - foo(&mut v); - //~^ ERROR mismatched types - //~| expected struct `std::collections::HashSet`, found struct `std::vec::Vec` -} - -fn foo(h: &mut HashSet) { -} diff --git a/src/test/compile-fail/issue-24883.rs b/src/test/compile-fail/issue-24883.rs deleted file mode 100644 index 097f2a5630c..00000000000 --- a/src/test/compile-fail/issue-24883.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -mod a { - pub mod b { pub struct Foo; } - - pub mod c { - use super::b; - pub struct Bar(pub b::Foo); - } - - pub use self::c::*; -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let _ = a::c::Bar(a::b::Foo); - let _ = a::Bar(a::b::Foo); -} diff --git a/src/test/compile-fail/issue-25076.rs b/src/test/compile-fail/issue-25076.rs deleted file mode 100644 index 1c255b4e631..00000000000 --- a/src/test/compile-fail/issue-25076.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct S; - -trait InOut { type Out; } - -fn do_fold>(init: B, f: F) {} - -fn bot() -> T { loop {} } - -fn main() { - do_fold(bot(), ()); //~ ERROR `(): InOut<_>` is not satisfied -} diff --git a/src/test/compile-fail/issue-25368.rs b/src/test/compile-fail/issue-25368.rs deleted file mode 100644 index e70c0050221..00000000000 --- a/src/test/compile-fail/issue-25368.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::sync::mpsc::channel; -use std::thread::spawn; -use std::marker::PhantomData; - -struct Foo {foo: PhantomData} - -fn main() { - let (tx, rx) = channel(); - - spawn(move || { - tx.send(Foo{ foo: PhantomData }); //~ ERROR E0282 - }); -} diff --git a/src/test/compile-fail/issue-25386.rs b/src/test/compile-fail/issue-25386.rs deleted file mode 100644 index b2775db5e75..00000000000 --- a/src/test/compile-fail/issue-25386.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod stuff { - pub struct Item { - c_object: Box, - } - pub struct CObj { - name: Option, - } - impl Item { - pub fn new() -> Item { - Item { - c_object: Box::new(CObj { name: None }), - } - } - } -} - -macro_rules! check_ptr_exist { - ($var:expr, $member:ident) => ( - (*$var.c_object).$member.is_some() - //~^ ERROR field `name` of struct `stuff::CObj` is private - //~^^ ERROR field `c_object` of struct `stuff::Item` is private - ); -} - -fn main() { - let item = stuff::Item::new(); - println!("{}", check_ptr_exist!(item, name)); -} diff --git a/src/test/compile-fail/issue-25396.rs b/src/test/compile-fail/issue-25396.rs deleted file mode 100644 index 7cfcbc5471a..00000000000 --- a/src/test/compile-fail/issue-25396.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use foo::baz; -use bar::baz; //~ ERROR the name `baz` is defined multiple times - -use foo::Quux; -use bar::Quux; //~ ERROR the name `Quux` is defined multiple times - -use foo::blah; -use bar::blah; //~ ERROR the name `blah` is defined multiple times - -use foo::WOMP; -use bar::WOMP; //~ ERROR the name `WOMP` is defined multiple times - -fn main() {} - -mod foo { - pub mod baz {} - pub trait Quux { } - pub type blah = (f64, u32); - pub const WOMP: u8 = 5; -} - -mod bar { - pub mod baz {} - pub type Quux = i32; - pub struct blah { x: i8 } - pub const WOMP: i8 = -5; -} diff --git a/src/test/compile-fail/issue-25439.rs b/src/test/compile-fail/issue-25439.rs deleted file mode 100644 index 6e33fd5ae71..00000000000 --- a/src/test/compile-fail/issue-25439.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Helper<'a, F: 'a>(&'a F); - -fn fix(f: F) -> i32 where F: Fn(Helper, i32) -> i32 { - f(Helper(&f), 8) -} - -fn main() { - fix(|_, x| x); //~ ERROR closure/generator type that references itself [E0644] -} diff --git a/src/test/compile-fail/issue-25579.rs b/src/test/compile-fail/issue-25579.rs deleted file mode 100644 index 71c1d63cf5a..00000000000 --- a/src/test/compile-fail/issue-25579.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// revisions: ast mir -//[mir]compile-flags: -Z borrowck=mir - -#![feature(rustc_attrs)] - -enum Sexpression { - Num(()), - Cons(&'static mut Sexpression) -} - -fn causes_error_in_ast(mut l: &mut Sexpression) { - loop { match l { - &mut Sexpression::Num(ref mut n) => {}, - &mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] - l = &mut **expr; //[ast]~ ERROR [E0506] - } - }} -} - -#[rustc_error] -fn main() { //[mir]~ ERROR compilation successful -} diff --git a/src/test/compile-fail/issue-25700.rs b/src/test/compile-fail/issue-25700.rs deleted file mode 100644 index 477c3237f84..00000000000 --- a/src/test/compile-fail/issue-25700.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct S(Option<&'static T>); - -trait Tr { type Out; } -impl Tr for T { type Out = T; } - -impl Copy for S where S: Tr {} -impl Clone for S where S: Tr { - fn clone(&self) -> Self { *self } -} -fn main() { - let t = S::<()>(None); - drop(t); - drop(t); //~ ERROR use of moved value -} diff --git a/src/test/compile-fail/issue-2590.rs b/src/test/compile-fail/issue-2590.rs deleted file mode 100644 index d7e438d1049..00000000000 --- a/src/test/compile-fail/issue-2590.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -struct parser { - tokens: Vec , -} - -trait parse { - fn parse(&self) -> Vec ; -} - -impl parse for parser { - fn parse(&self) -> Vec { - self.tokens //~ ERROR cannot move out of borrowed content - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-25901.rs b/src/test/compile-fail/issue-25901.rs deleted file mode 100644 index 72fb2a682eb..00000000000 --- a/src/test/compile-fail/issue-25901.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct A; -struct B; - -static S: &'static B = &A; -//~^ ERROR calls in statics are limited to constant functions - -use std::ops::Deref; - -impl Deref for A { - type Target = B; - fn deref(&self)->&B { static B_: B = B; &B_ } -} - -fn main(){} diff --git a/src/test/compile-fail/issue-26094.rs b/src/test/compile-fail/issue-26094.rs deleted file mode 100644 index 99add95e806..00000000000 --- a/src/test/compile-fail/issue-26094.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! some_macro { - ($other: expr) => ({ - $other(None) - //~^ this function takes 0 parameters but 1 parameter was supplied - }) -} - -fn some_function() {} - -fn main() { - some_macro!(some_function); - //~^ in this expansion of some_macro! -} diff --git a/src/test/compile-fail/issue-26158.rs b/src/test/compile-fail/issue-26158.rs deleted file mode 100644 index 54f5313aed1..00000000000 --- a/src/test/compile-fail/issue-26158.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(slice_patterns)] - -fn main() { - let x: &[u32] = &[]; - let &[[ref _a, ref _b..]..] = x; //~ ERROR refutable pattern -} diff --git a/src/test/compile-fail/issue-26217.rs b/src/test/compile-fail/issue-26217.rs deleted file mode 100644 index 06a8fe52588..00000000000 --- a/src/test/compile-fail/issue-26217.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo() where for<'a> T: 'a {} - -fn main<'a>() { - foo::<&'a i32>(); - //~^ ERROR the type `&'a i32` does not fulfill the required lifetime -} diff --git a/src/test/compile-fail/issue-26237.rs b/src/test/compile-fail/issue-26237.rs deleted file mode 100644 index 22772e596b1..00000000000 --- a/src/test/compile-fail/issue-26237.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! macro_panic { - ($not_a_function:expr, $some_argument:ident) => { - $not_a_function($some_argument) - //~^ ERROR expected function, found `{integer}` - } -} - -fn main() { - let mut value_a = 0; - let mut value_b = 0; - macro_panic!(value_a, value_b); - //~^ in this expansion of macro_panic! -} diff --git a/src/test/compile-fail/issue-26262.rs b/src/test/compile-fail/issue-26262.rs deleted file mode 100644 index 8d79fd4570d..00000000000 --- a/src/test/compile-fail/issue-26262.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Check that projections don't count as constraining type parameters. - -struct S(T); - -trait Tr { type Assoc; fn test(); } - -impl S { -//~^ ERROR the type parameter `T` is not constrained - fn foo(self, _: T) { - T::test(); - } -} - -trait Trait1 { type Bar; } -trait Trait2<'x> { type Foo; } - -impl<'a,T: Trait2<'a>> Trait1<>::Foo> for T { -//~^ ERROR the lifetime parameter `'a` is not constrained - type Bar = &'a (); -} - -fn main() {} diff --git a/src/test/compile-fail/issue-26459.rs b/src/test/compile-fail/issue-26459.rs deleted file mode 100644 index 8be3d88bd5c..00000000000 --- a/src/test/compile-fail/issue-26459.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - match 'a' { - char{ch} => true - //~^ ERROR expected struct, variant or union type, found builtin type `char` - }; -} diff --git a/src/test/compile-fail/issue-26548.rs b/src/test/compile-fail/issue-26548.rs deleted file mode 100644 index aab674fbb1a..00000000000 --- a/src/test/compile-fail/issue-26548.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: cycle detected when computing layout of -// note-pattern: ...which requires computing layout of -// note-pattern: ...which again requires computing layout of - -trait Mirror { type It: ?Sized; } -impl Mirror for T { type It = Self; } -struct S(Option<::It>); - -fn main() { - let _s = S(None); -} diff --git a/src/test/compile-fail/issue-26614.rs b/src/test/compile-fail/issue-26614.rs deleted file mode 100644 index c128fb3b479..00000000000 --- a/src/test/compile-fail/issue-26614.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -trait Mirror { - type It; -} - -impl Mirror for T { - type It = Self; -} - - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let c: ::It = 5; - const CCCC: ::It = 5; -} diff --git a/src/test/compile-fail/issue-26812.rs b/src/test/compile-fail/issue-26812.rs deleted file mode 100644 index 1dd00881078..00000000000 --- a/src/test/compile-fail/issue-26812.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(default_type_parameter_fallback)] - -fn avg(_: T) {} -//~^ ERROR type parameters with a default cannot use forward declared identifiers - -fn main() {} diff --git a/src/test/compile-fail/issue-26905.rs b/src/test/compile-fail/issue-26905.rs deleted file mode 100644 index 3b8fac832a4..00000000000 --- a/src/test/compile-fail/issue-26905.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(unsize, coerce_unsized)] - -// Verfies that non-PhantomData ZSTs still cause coercions to fail. -// They might have additional semantics that we don't want to bulldoze. - -use std::marker::{Unsize, PhantomData}; -use std::ops::CoerceUnsized; - -struct NotPhantomData(PhantomData); - -struct MyRc { - _ptr: *const T, - _boo: NotPhantomData, -} - -impl, U: ?Sized> CoerceUnsized> for MyRc{ } //~ERROR - -fn main() { - let data = [1, 2, 3]; - let iter = data.iter(); - let x = MyRc { _ptr: &iter, _boo: NotPhantomData(PhantomData) }; - let _y: MyRc> = x; -} - diff --git a/src/test/compile-fail/issue-26930.rs b/src/test/compile-fail/issue-26930.rs deleted file mode 100644 index 6c98f3e8560..00000000000 --- a/src/test/compile-fail/issue-26930.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(unused)] - -extern crate core; -use core as core_export; -use self::x::*; -mod x {} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-26948.rs b/src/test/compile-fail/issue-26948.rs deleted file mode 100644 index c63cb5defb7..00000000000 --- a/src/test/compile-fail/issue-26948.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - enum Foo { A { x: u32 } } - let orig = Foo::A { x: 5 }; - Foo::A { x: 6, ..orig }; - //~^ ERROR functional record update syntax requires a struct -} diff --git a/src/test/compile-fail/issue-27008.rs b/src/test/compile-fail/issue-27008.rs deleted file mode 100644 index f80135848e0..00000000000 --- a/src/test/compile-fail/issue-27008.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct S; - -fn main() { - let b = [0; S]; - //~^ ERROR mismatched types - //~| expected type `usize` - //~| found type `S` - //~| expected usize, found struct `S` -} diff --git a/src/test/compile-fail/issue-27033.rs b/src/test/compile-fail/issue-27033.rs deleted file mode 100644 index b8552aaee90..00000000000 --- a/src/test/compile-fail/issue-27033.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - match Some(1) { - None @ _ => {} //~ ERROR match bindings cannot shadow unit variants - }; - const C: u8 = 1; - match 1 { - C @ 2 => { //~ ERROR match bindings cannot shadow constant - println!("{}", C); - } - _ => {} - }; -} diff --git a/src/test/compile-fail/issue-27042.rs b/src/test/compile-fail/issue-27042.rs deleted file mode 100644 index 23afa4b6296..00000000000 --- a/src/test/compile-fail/issue-27042.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for #27042. Test that a loop's label is included in its span. - -fn main() { - let _: i32 = - 'a: // in this case, the citation is just the `break`: - loop { break }; //~ ERROR mismatched types - let _: i32 = - 'b: //~ ERROR mismatched types - while true { break }; // but here we cite the whole loop - let _: i32 = - 'c: //~ ERROR mismatched types - for _ in None { break }; // but here we cite the whole loop - let _: i32 = - 'd: //~ ERROR mismatched types - while let Some(_) = None { break }; -} diff --git a/src/test/compile-fail/issue-27060-2.rs b/src/test/compile-fail/issue-27060-2.rs deleted file mode 100644 index 619616adda6..00000000000 --- a/src/test/compile-fail/issue-27060-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[repr(packed)] -pub struct Bad { - data: T, //~ ERROR the size for values of type -} - -fn main() {} diff --git a/src/test/compile-fail/issue-27078.rs b/src/test/compile-fail/issue-27078.rs deleted file mode 100644 index 294c288a970..00000000000 --- a/src/test/compile-fail/issue-27078.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_consts)] - -trait Foo { - const BAR: i32; - fn foo(self) -> &'static i32 { - //~^ ERROR the size for values of type - &::BAR - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-2718-a.rs b/src/test/compile-fail/issue-2718-a.rs deleted file mode 100644 index 6de28cbbf35..00000000000 --- a/src/test/compile-fail/issue-2718-a.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub struct send_packet { - p: T -} - -mod pingpong { - use send_packet; - pub type ping = send_packet; - pub struct pong(send_packet); - //~^ ERROR recursive type `pingpong::pong` has infinite size -} - -fn main() {} diff --git a/src/test/compile-fail/issue-27340.rs b/src/test/compile-fail/issue-27340.rs deleted file mode 100644 index ce3fa487d4e..00000000000 --- a/src/test/compile-fail/issue-27340.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo; -#[derive(Copy, Clone)] -//~^ ERROR the trait `Copy` may not be implemented for this type -struct Bar(Foo); - -fn main() {} diff --git a/src/test/compile-fail/issue-27433.rs b/src/test/compile-fail/issue-27433.rs deleted file mode 100644 index 782b2057438..00000000000 --- a/src/test/compile-fail/issue-27433.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let foo = 42u32; - const FOO : u32 = foo; - //~^ ERROR can't capture dynamic environment -} diff --git a/src/test/compile-fail/issue-27592.rs b/src/test/compile-fail/issue-27592.rs deleted file mode 100644 index 731d4fb2bf6..00000000000 --- a/src/test/compile-fail/issue-27592.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for issue #27592. - -fn write<'a, F: ::std::ops::FnOnce()->::std::fmt::Arguments<'a> + 'a>(fcn: F) { - use std::fmt::Write; - let _ = match fcn() { a => write!(&mut Stream, "{}", a), }; -} - -struct Stream; -impl ::std::fmt::Write for Stream { - fn write_str(&mut self, _s: &str) -> ::std::fmt::Result { - Ok( () ) - } -} - -fn main() { - write(|| format_args!("{}", String::from("Hello world"))); - //~^ ERROR borrowed value does not live long enough - //~| ERROR borrowed value does not live long enough -} diff --git a/src/test/compile-fail/issue-27815.rs b/src/test/compile-fail/issue-27815.rs deleted file mode 100644 index d9840abf0ca..00000000000 --- a/src/test/compile-fail/issue-27815.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod A {} - -fn main() { - let u = A { x: 1 }; //~ ERROR expected struct, variant or union type, found module `A` - let v = u32 { x: 1 }; //~ ERROR expected struct, variant or union type, found builtin type `u32` - match () { - A { x: 1 } => {} - //~^ ERROR expected struct, variant or union type, found module `A` - u32 { x: 1 } => {} - //~^ ERROR expected struct, variant or union type, found builtin type `u32` - } -} diff --git a/src/test/compile-fail/issue-27895.rs b/src/test/compile-fail/issue-27895.rs deleted file mode 100644 index 6063755c04f..00000000000 --- a/src/test/compile-fail/issue-27895.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let i = 5; - let index = 6; - - match i { - 0..=index => println!("winner"), - //~^ ERROR runtime values cannot be referenced in patterns - _ => println!("hello"), - } -} diff --git a/src/test/compile-fail/issue-28098.rs b/src/test/compile-fail/issue-28098.rs deleted file mode 100644 index 5dded2b1e16..00000000000 --- a/src/test/compile-fail/issue-28098.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let _ = Iterator::next(&mut ()); - //~^ ERROR `(): std::iter::Iterator` is not satisfied - - for _ in false {} - //~^ ERROR `bool: std::iter::Iterator` is not satisfied - - let _ = Iterator::next(&mut ()); - //~^ ERROR `(): std::iter::Iterator` is not satisfied - - other() -} - -pub fn other() { - // check errors are still reported globally - - let _ = Iterator::next(&mut ()); - //~^ ERROR `(): std::iter::Iterator` is not satisfied - - let _ = Iterator::next(&mut ()); - //~^ ERROR `(): std::iter::Iterator` is not satisfied - - for _ in false {} - //~^ ERROR `bool: std::iter::Iterator` is not satisfied -} diff --git a/src/test/compile-fail/issue-28105.rs b/src/test/compile-fail/issue-28105.rs deleted file mode 100644 index 8e58d1aaf24..00000000000 --- a/src/test/compile-fail/issue-28105.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Make sure that a continue span actually contains the keyword. - -fn main() { - continue //~ ERROR `continue` outside of loop - ; - break //~ ERROR `break` outside of loop - ; -} diff --git a/src/test/compile-fail/issue-28109.rs b/src/test/compile-fail/issue-28109.rs deleted file mode 100644 index 0d372d30015..00000000000 --- a/src/test/compile-fail/issue-28109.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Make sure that label for continue and break is spanned correctly - -fn main() { - loop { - continue - 'b //~ ERROR use of undeclared label - ; - break - 'c //~ ERROR use of undeclared label - ; - } -} diff --git a/src/test/compile-fail/issue-28113.rs b/src/test/compile-fail/issue-28113.rs deleted file mode 100644 index 7d2541966a4..00000000000 --- a/src/test/compile-fail/issue-28113.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(warnings)] - -const X: u8 = - || -> u8 { 5 }() - //~^ ERROR calls in constants are limited to constant functions -; - -fn main() {} diff --git a/src/test/compile-fail/issue-2823.rs b/src/test/compile-fail/issue-2823.rs deleted file mode 100644 index 631bcb7bd9e..00000000000 --- a/src/test/compile-fail/issue-2823.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct C { - x: isize, -} - -impl Drop for C { - fn drop(&mut self) { - println!("dropping: {}", self.x); - } -} - -fn main() { - let c = C{ x: 2}; - let _d = c.clone(); //~ ERROR no method named `clone` found -} diff --git a/src/test/compile-fail/issue-28324.rs b/src/test/compile-fail/issue-28324.rs deleted file mode 100644 index af73db2b4d2..00000000000 --- a/src/test/compile-fail/issue-28324.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(safe_extern_statics)] - -extern { - static error_message_count: u32; -} - -pub static BAZ: u32 = *&error_message_count; -//~^ ERROR could not evaluate static initializer -//~| tried to read from foreign (extern) static - -fn main() {} diff --git a/src/test/compile-fail/issue-28344.rs b/src/test/compile-fail/issue-28344.rs deleted file mode 100644 index d28c3146404..00000000000 --- a/src/test/compile-fail/issue-28344.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::ops::BitXor; - -fn main() { - let x: u8 = BitXor::bitor(0 as u8, 0 as u8); - //~^ ERROR must be specified - //~| no function or associated item named - - let g = BitXor::bitor; - //~^ ERROR must be specified - //~| no function or associated item named -} diff --git a/src/test/compile-fail/issue-28433.rs b/src/test/compile-fail/issue-28433.rs deleted file mode 100644 index 9253a490733..00000000000 --- a/src/test/compile-fail/issue-28433.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z continue-parse-after-error - -enum bird { - pub duck, - //~^ ERROR: expected identifier, found keyword `pub` - //~| ERROR: expected - goose -} - - -fn main() { - let y = bird::goose; -} diff --git a/src/test/compile-fail/issue-28472.rs b/src/test/compile-fail/issue-28472.rs deleted file mode 100644 index 837de8eddcf..00000000000 --- a/src/test/compile-fail/issue-28472.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Check that the visibility modifier is included in the span of foreign items. - -extern { - fn foo(); - - pub //~ ERROR the name `foo` is defined multiple times - fn foo(); - - pub //~ ERROR the name `foo` is defined multiple times - static mut foo: u32; -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-2849.rs b/src/test/compile-fail/issue-2849.rs deleted file mode 100644 index 203b28bd5e4..00000000000 --- a/src/test/compile-fail/issue-2849.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum foo { alpha, beta(isize) } - -fn main() { - match foo::alpha { - foo::alpha | foo::beta(i) => {} - //~^ ERROR variable `i` is not bound in all patterns - } -} diff --git a/src/test/compile-fail/issue-28576.rs b/src/test/compile-fail/issue-28576.rs deleted file mode 100644 index bd7186708a6..00000000000 --- a/src/test/compile-fail/issue-28576.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Foo { - type Assoc; -} - -pub trait Bar: Foo { - fn new(&self, b: & - Bar //~ ERROR the trait `Bar` cannot be made into an object - - ); -} - -fn main() {} diff --git a/src/test/compile-fail/issue-28586.rs b/src/test/compile-fail/issue-28586.rs deleted file mode 100644 index b8571d2e85e..00000000000 --- a/src/test/compile-fail/issue-28586.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for issue #28586 - -pub trait Foo {} -impl Foo for [u8; usize::BYTES] {} -//~^ ERROR no associated item named `BYTES` found for type `usize` - -fn main() { } diff --git a/src/test/compile-fail/issue-28625.rs b/src/test/compile-fail/issue-28625.rs deleted file mode 100644 index dc9155ed66c..00000000000 --- a/src/test/compile-fail/issue-28625.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Bar { - type Bar; -} - -struct ArrayPeano { - data: T::Bar, -} - -fn foo(a: &ArrayPeano) -> &[T] where T: Bar { - unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes -} - -impl Bar for () { - type Bar = (); -} - -fn main() { - let x: ArrayPeano<()> = ArrayPeano { data: () }; - foo(&x); -} diff --git a/src/test/compile-fail/issue-28992-empty.rs b/src/test/compile-fail/issue-28992-empty.rs deleted file mode 100644 index 536784508b7..00000000000 --- a/src/test/compile-fail/issue-28992-empty.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Can't use constants as tuple struct patterns - - -const C1: i32 = 0; - -struct S; - -impl S { - const C2: i32 = 0; -} - -fn main() { - if let C1(..) = 0 {} //~ ERROR expected tuple struct/variant, found constant `C1` - if let S::C2(..) = 0 {} - //~^ ERROR expected tuple struct/variant, found associated constant `::C2` -} diff --git a/src/test/compile-fail/issue-29084.rs b/src/test/compile-fail/issue-29084.rs deleted file mode 100644 index 6cb6bbf1893..00000000000 --- a/src/test/compile-fail/issue-29084.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! foo { - ($d:expr) => {{ - fn bar(d: u8) { } - bar(&mut $d); - //~^ ERROR mismatched types - //~| expected u8, found &mut u8 - //~| expected type `u8` - //~| found type `&mut u8` - }} -} - -fn main() { - foo!(0u8); - //~^ in this expansion of foo! -} diff --git a/src/test/compile-fail/issue-29147.rs b/src/test/compile-fail/issue-29147.rs deleted file mode 100644 index 0ecaa409412..00000000000 --- a/src/test/compile-fail/issue-29147.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![recursion_limit="1024"] - -pub struct S0(T,T); -pub struct S1(Option>>>,Option>>>); -pub struct S2(Option>>>,Option>>>); -pub struct S3(Option>>>,Option>>>); -pub struct S4(Option>>>,Option>>>); -pub struct S5(Option>>>,Option>>>,Option); - -trait Foo { fn xxx(&self); } -trait Bar {} // anything local or #[fundamental] - -impl Foo for T where T: Bar, T: Sync { - fn xxx(&self) {} -} - -impl Foo for S5 { fn xxx(&self) {} } -impl Foo for S5 { fn xxx(&self) {} } - -fn main() { - let _ = >::xxx; //~ ERROR cannot resolve `S5<_>: Foo` -} diff --git a/src/test/compile-fail/issue-29161.rs b/src/test/compile-fail/issue-29161.rs deleted file mode 100644 index 97ba222fe45..00000000000 --- a/src/test/compile-fail/issue-29161.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod a { - struct A; - - impl Default for A { - pub fn default() -> A { //~ ERROR unnecessary visibility qualifier - A - } - } -} - - -fn main() { - a::A::default(); - //~^ ERROR struct `A` is private - } diff --git a/src/test/compile-fail/issue-29184.rs b/src/test/compile-fail/issue-29184.rs deleted file mode 100644 index 98fe12c1b9d..00000000000 --- a/src/test/compile-fail/issue-29184.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let x: typeof(92) = 92; //~ ERROR `typeof` is a reserved keyword -} diff --git a/src/test/compile-fail/issue-2937.rs b/src/test/compile-fail/issue-2937.rs deleted file mode 100644 index 0d684ec5ae1..00000000000 --- a/src/test/compile-fail/issue-2937.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use m::f as x; //~ ERROR unresolved import `m::f` [E0432] - //~^ no `f` in `m` - -mod m {} - -fn main() {} diff --git a/src/test/compile-fail/issue-2951.rs b/src/test/compile-fail/issue-2951.rs deleted file mode 100644 index 11ff7ab2476..00000000000 --- a/src/test/compile-fail/issue-2951.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo(x: T, y: U) { - let mut xx = x; - xx = y; - //~^ ERROR mismatched types - //~| expected type `T` - //~| found type `U` - //~| expected type parameter, found a different type parameter -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-29857.rs b/src/test/compile-fail/issue-29857.rs deleted file mode 100644 index 661579f52b6..00000000000 --- a/src/test/compile-fail/issue-29857.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -#![feature(rustc_attrs)] - -use std::marker::PhantomData; - -pub trait Foo

{} - -impl > Foo

for Option {} - -pub struct Qux (PhantomData<*mut T>); - -impl Foo<*mut T> for Option> {} - -pub trait Bar { - type Output: 'static; -} - -impl> Foo<*mut T> for W {} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-29861.rs b/src/test/compile-fail/issue-29861.rs deleted file mode 100644 index 79514ad376b..00000000000 --- a/src/test/compile-fail/issue-29861.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait MakeRef<'a> { - type Ref; -} -impl<'a, T: 'a> MakeRef<'a> for T { - type Ref = &'a T; -} - -pub trait MakeRef2 { - type Ref2; -} -impl<'a, T: 'a> MakeRef2 for T { -//~^ ERROR the lifetime parameter `'a` is not constrained - type Ref2 = >::Ref; -} - -fn foo() -> ::Ref2 { &String::from("foo") } - -fn main() { - println!("{}", foo()); -} diff --git a/src/test/compile-fail/issue-2995.rs b/src/test/compile-fail/issue-2995.rs deleted file mode 100644 index d735e184d5c..00000000000 --- a/src/test/compile-fail/issue-2995.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn bad (p: *const isize) { - let _q: &isize = p as &isize; //~ ERROR non-primitive cast -} - -fn main() { } diff --git a/src/test/compile-fail/issue-30079.rs b/src/test/compile-fail/issue-30079.rs deleted file mode 100644 index 04ae8f6d255..00000000000 --- a/src/test/compile-fail/issue-30079.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct SemiPriv; - -mod m1 { - struct Priv; - impl ::SemiPriv { - pub fn f(_: Priv) {} //~ WARN private type `m1::Priv` in public interface - //~^ WARNING hard error - } - - impl Priv { - pub fn f(_: Priv) {} // ok - } -} - -mod m2 { - struct Priv; - impl ::std::ops::Deref for ::SemiPriv { - type Target = Priv; //~ ERROR private type `m2::Priv` in public interface - fn deref(&self) -> &Self::Target { unimplemented!() } - } - - impl ::std::ops::Deref for Priv { - type Target = Priv; // ok - fn deref(&self) -> &Self::Target { unimplemented!() } - } -} - -trait SemiPrivTrait { - type Assoc; -} - -mod m3 { - struct Priv; - impl ::SemiPrivTrait for () { - type Assoc = Priv; //~ ERROR private type `m3::Priv` in public interface - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3008-3.rs b/src/test/compile-fail/issue-3008-3.rs deleted file mode 100644 index 66bfab003e9..00000000000 --- a/src/test/compile-fail/issue-3008-3.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::marker; - -enum E1 { V1(E2), } -enum E2 { V2(E2, marker::PhantomData), } -//~^ ERROR recursive type `E2` has infinite size - -impl E1 { fn foo(&self) {} } - -fn main() { -} diff --git a/src/test/compile-fail/issue-3021-b.rs b/src/test/compile-fail/issue-3021-b.rs deleted file mode 100644 index 2b0a24cfdb3..00000000000 --- a/src/test/compile-fail/issue-3021-b.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn siphash(k0 : u64) { - - struct siphash { - v0: u64, - } - - impl siphash { - pub fn reset(&mut self) { - self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment - } - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3021-c.rs b/src/test/compile-fail/issue-3021-c.rs deleted file mode 100644 index 55975cc8e86..00000000000 --- a/src/test/compile-fail/issue-3021-c.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn siphash() { - - trait t { - fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function - //~^ ERROR can't use type parameters from outer function - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3021-d.rs b/src/test/compile-fail/issue-3021-d.rs deleted file mode 100644 index c23e12e713a..00000000000 --- a/src/test/compile-fail/issue-3021-d.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait siphash { - fn result(&self) -> u64; - fn reset(&self); -} - -fn siphash(k0 : u64, k1 : u64) { - struct SipState { - v0: u64, - v1: u64, - } - - fn mk_result(st : &SipState) -> u64 { - - let v0 = st.v0; - let v1 = st.v1; - return v0 ^ v1; - } - - impl siphash for SipState { - fn reset(&self) { - self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment - self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment - } - fn result(&self) -> u64 { return mk_result(self); } - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs deleted file mode 100644 index f93a333d2ae..00000000000 --- a/src/test/compile-fail/issue-3021.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait SipHash { - fn reset(&self); -} - -fn siphash(k0 : u64) { - struct SipState { - v0: u64, - } - - impl SipHash for SipState { - fn reset(&self) { - self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment - } - } - panic!(); -} - -fn main() {} diff --git a/src/test/compile-fail/issue-30225.rs b/src/test/compile-fail/issue-30225.rs deleted file mode 100644 index 7acbbfb8826..00000000000 --- a/src/test/compile-fail/issue-30225.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for #30225, which was an ICE that would trigger as -// a result of a poor interaction between trait result caching and -// type inference. Specifically, at that time, unification could cause -// unrelated type variables to become instantiated, if subtyping -// relationships existed. These relationships are now propagated -// through obligations and hence everything works out fine. - -trait Foo : Sized { - fn foo(self, u: Option, v: Option) {} -} - -struct A; -struct B; - -impl Foo for () {} // impl A -impl Foo for u32 {} // impl B, creating ambiguity - -fn toxic() { - // cache the resolution <() as Foo<$0,$1>> = impl A - let u = None; - let v = None; - Foo::foo((), u, v); -} - -fn bomb() { - let mut u = None; // type is Option<$0> - let mut v = None; // type is Option<$1> - let mut x = None; // type is Option<$2> - - Foo::foo(x.unwrap(),u,v); // register <$2 as Foo<$0, $1>> - u = v; // mark $0 and $1 in a subtype relationship - //~^ ERROR mismatched types - x = Some(()); // set $2 = (), allowing impl selection - // to proceed for <() as Foo<$0, $1>> = impl A. - // kaboom, this *used* to trigge an ICE -} - -fn main() {} diff --git a/src/test/compile-fail/issue-30236.rs b/src/test/compile-fail/issue-30236.rs deleted file mode 100644 index 45a5cd09337..00000000000 --- a/src/test/compile-fail/issue-30236.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -type Foo< - Unused //~ ERROR type parameter `Unused` is unused - > = u8; - -fn main() { - -} - diff --git a/src/test/compile-fail/issue-30240-b.rs b/src/test/compile-fail/issue-30240-b.rs deleted file mode 100644 index cf6935b9ba6..00000000000 --- a/src/test/compile-fail/issue-30240-b.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(unreachable_patterns)] - -fn main() { - match "world" { - "hello" => {} - _ => {}, - } - - match "world" { - ref _x if false => {} - "hello" => {} - "hello" => {} //~ ERROR unreachable pattern - _ => {}, - } -} - diff --git a/src/test/compile-fail/issue-30240.rs b/src/test/compile-fail/issue-30240.rs deleted file mode 100644 index 60fb307d4e1..00000000000 --- a/src/test/compile-fail/issue-30240.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - match "world" { //~ ERROR non-exhaustive patterns: `&_` - "hello" => {} - } - - match "world" { //~ ERROR non-exhaustive patterns: `&_` - ref _x if false => {} - "hello" => {} - } -} diff --git a/src/test/compile-fail/issue-30355.rs b/src/test/compile-fail/issue-30355.rs deleted file mode 100644 index ee19d040318..00000000000 --- a/src/test/compile-fail/issue-30355.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub struct X([u8]); - -pub static Y: &'static X = { - const Y: &'static [u8] = b""; - &X(*Y) - //~^ ERROR cannot move out - //~^^ ERROR cannot move a - //~^^^ ERROR cannot move a -}; - -fn main() {} diff --git a/src/test/compile-fail/issue-3038.rs b/src/test/compile-fail/issue-3038.rs deleted file mode 100644 index 1eec62df788..00000000000 --- a/src/test/compile-fail/issue-3038.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum f { g(isize, isize) } - -enum h { i(j, k) } - -enum j { l(isize, isize) } -enum k { m(isize, isize) } - -fn main() -{ - - let _z = match f::g(1, 2) { - f::g(x, x) => { println!("{}", x + x); } - //~^ ERROR identifier `x` is bound more than once in the same pattern - }; - - let _z = match h::i(j::l(1, 2), k::m(3, 4)) { - h::i(j::l(x, _), k::m(_, x)) - //~^ ERROR identifier `x` is bound more than once in the same pattern - => { println!("{}", x + x); } - }; - - let _z = match (1, 2) { - (x, x) => { x } //~ ERROR identifier `x` is bound more than once in the same pattern - }; - -} diff --git a/src/test/compile-fail/issue-30438-a.rs b/src/test/compile-fail/issue-30438-a.rs deleted file mode 100644 index 441815de81d..00000000000 --- a/src/test/compile-fail/issue-30438-a.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Original regression test for Issue #30438. - -use std::ops::Index; - -struct Test<'a> { - s: &'a String -} - -impl <'a> Index for Test<'a> { - type Output = Test<'a>; - fn index(&self, _: usize) -> &Self::Output { - return &Test { s: &self.s}; - //~^ ERROR: borrowed value does not live long enough - } -} - -fn main() { - let s = "Hello World".to_string(); - let test = Test{s: &s}; - let r = &test[0]; - println!("{}", test.s); // OK since test is valid - println!("{}", r.s); // Segfault since value pointed by r has already been dropped -} diff --git a/src/test/compile-fail/issue-30438-b.rs b/src/test/compile-fail/issue-30438-b.rs deleted file mode 100644 index 981b196c4ae..00000000000 --- a/src/test/compile-fail/issue-30438-b.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Modified regression test for Issue #30438 that exposed an -// independent issue (see discussion on ticket). - -use std::ops::Index; - -struct Test<'a> { - s: &'a String -} - -impl <'a> Index for Test<'a> { - type Output = Test<'a>; - fn index(&self, _: usize) -> &Self::Output { - &Test { s: &self.s} - //~^ ERROR: borrowed value does not live long enough - } -} - -fn main() { - let s = "Hello World".to_string(); - let test = Test{s: &s}; - let r = &test[0]; - println!("{}", test.s); // OK since test is valid - println!("{}", r.s); // Segfault since value pointed by r has already been dropped -} diff --git a/src/test/compile-fail/issue-30438-c.rs b/src/test/compile-fail/issue-30438-c.rs deleted file mode 100644 index 2b4d0dc339b..00000000000 --- a/src/test/compile-fail/issue-30438-c.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Simplified regression test for #30438, inspired by arielb1. - -trait Trait { type Out; } - -struct Test<'a> { s: &'a str } - -fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { - let x = Test { s: "this cannot last" }; - &x - //~^ ERROR: `x` does not live long enough -} - -impl<'b> Trait for Test<'b> { type Out = Test<'b>; } - -fn main() { - let orig = Test { s: "Hello World" }; - let r = silly(&orig); - println!("{}", orig.s); // OK since `orig` is valid - println!("{}", r.s); // Segfault (method does not return a sane value) -} diff --git a/src/test/compile-fail/issue-30560.rs b/src/test/compile-fail/issue-30560.rs deleted file mode 100644 index 0b1afd75ca9..00000000000 --- a/src/test/compile-fail/issue-30560.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -type Alias = (); -use Alias::*; -//~^ ERROR unresolved import `Alias` [E0432] -//~| Not a module `Alias` -use std::io::Result::*; -//~^ ERROR unresolved import `std::io::Result` [E0432] -//~| Not a module `Result` - -trait T {} -use T::*; //~ ERROR items in traits are not importable - -fn main() {} diff --git a/src/test/compile-fail/issue-30589.rs b/src/test/compile-fail/issue-30589.rs deleted file mode 100644 index 61721fe58b3..00000000000 --- a/src/test/compile-fail/issue-30589.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::fmt; - -impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` in this scope - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Missing data: {}", self.0) - } -} -fn main() { -} diff --git a/src/test/compile-fail/issue-3080.rs b/src/test/compile-fail/issue-3080.rs deleted file mode 100644 index fb16dad3960..00000000000 --- a/src/test/compile-fail/issue-3080.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct x(()); -impl x { - pub unsafe fn with(&self) { } -} - -fn main() { - x(()).with(); //~ ERROR requires unsafe function or block -} diff --git a/src/test/compile-fail/issue-3096-1.rs b/src/test/compile-fail/issue-3096-1.rs deleted file mode 100644 index 62c2639836b..00000000000 --- a/src/test/compile-fail/issue-3096-1.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - match () { } //~ ERROR non-exhaustive -} diff --git a/src/test/compile-fail/issue-3096-2.rs b/src/test/compile-fail/issue-3096-2.rs deleted file mode 100644 index 2d1ad9a2692..00000000000 --- a/src/test/compile-fail/issue-3096-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum bottom { } - -fn main() { - let x = &() as *const () as *const bottom; - match x { } //~ ERROR non-exhaustive patterns -} diff --git a/src/test/compile-fail/issue-3099-a.rs b/src/test/compile-fail/issue-3099-a.rs deleted file mode 100644 index db60d70ca9b..00000000000 --- a/src/test/compile-fail/issue-3099-a.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum a { b, c } - -enum a { d, e } //~ ERROR the name `a` is defined multiple times - -fn main() {} diff --git a/src/test/compile-fail/issue-3099-b.rs b/src/test/compile-fail/issue-3099-b.rs deleted file mode 100644 index 956d2186752..00000000000 --- a/src/test/compile-fail/issue-3099-b.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub mod a {} - -pub mod a {} //~ ERROR the name `a` is defined multiple times - -fn main() {} diff --git a/src/test/compile-fail/issue-3099.rs b/src/test/compile-fail/issue-3099.rs deleted file mode 100644 index 42766533556..00000000000 --- a/src/test/compile-fail/issue-3099.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn a(x: String) -> String { - format!("First function with {}", x) -} - -fn a(x: String, y: String) -> String { //~ ERROR the name `a` is defined multiple times - format!("Second function with {} and {}", x, y) -} - -fn main() { - println!("Result: "); -} diff --git a/src/test/compile-fail/issue-31011.rs b/src/test/compile-fail/issue-31011.rs deleted file mode 100644 index 716b0bbe772..00000000000 --- a/src/test/compile-fail/issue-31011.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! log { - ( $ctx:expr, $( $args:expr),* ) => { - if $ctx.trace { - //~^ no field `trace` on type `&T` - println!( $( $args, )* ); - } - } -} - -// Create a structure. -struct Foo { - trace: bool, -} - -// Generic wrapper calls log! with a structure. -fn wrap(context: &T) -> () -{ - log!(context, "entered wrapper"); - //~^ in this expansion of log! -} - -fn main() { - // Create a structure. - let x = Foo { trace: true }; - log!(x, "run started"); - // Apply a closure which accesses internal fields. - wrap(&x); - log!(x, "run finished"); -} diff --git a/src/test/compile-fail/issue-31109.rs b/src/test/compile-fail/issue-31109.rs deleted file mode 100644 index 74121e3a420..00000000000 --- a/src/test/compile-fail/issue-31109.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - // FIXME(#31407) this error should go away, but in the meantime we test that it - // is accompanied by a somewhat useful error message. - let _: f64 = 1234567890123456789012345678901234567890e-340; - //~^ ERROR could not evaluate float literal (see issue #31407) -} diff --git a/src/test/compile-fail/issue-31173.rs b/src/test/compile-fail/issue-31173.rs deleted file mode 100644 index fb1e3cc87e8..00000000000 --- a/src/test/compile-fail/issue-31173.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::vec::IntoIter; - -pub fn get_tok(it: &mut IntoIter) { - let mut found_e = false; - - let temp: Vec = it.take_while(|&x| { - found_e = true; - false - }) - .cloned() - //~^ ERROR type mismatch resolving - //~| expected type `u8` - //~| found type `&_` - .collect(); //~ ERROR no method named `collect` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-31212.rs b/src/test/compile-fail/issue-31212.rs deleted file mode 100644 index 8dc58eee5fb..00000000000 --- a/src/test/compile-fail/issue-31212.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This checks that a path that cannot be resolved because of an indeterminate import -// does not trigger an ICE. - -mod foo { - pub use self::*; //~ ERROR unresolved -} - -fn main() { - foo::f(); //~ ERROR cannot find function `f` in module `foo` -} diff --git a/src/test/compile-fail/issue-31495.rs b/src/test/compile-fail/issue-31495.rs deleted file mode 100644 index 794b8bb86bb..00000000000 --- a/src/test/compile-fail/issue-31495.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: --cfg foo(bar) -// error-pattern: invalid predicate in --cfg command line argument: `foo` -fn main() {} diff --git a/src/test/compile-fail/issue-31511.rs b/src/test/compile-fail/issue-31511.rs deleted file mode 100644 index dd1af2f4448..00000000000 --- a/src/test/compile-fail/issue-31511.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn cast_thin_to_fat(x: *const ()) { - x as *const [u8]; - //~^ ERROR: cannot cast thin pointer `*const ()` to fat pointer `*const [u8]` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3154.rs b/src/test/compile-fail/issue-3154.rs deleted file mode 100644 index 519e9d06d1b..00000000000 --- a/src/test/compile-fail/issue-3154.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct thing<'a, Q:'a> { - x: &'a Q -} - -fn thing<'a,Q>(x: &Q) -> thing<'a,Q> { - thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621] -} - -fn main() { - thing(&()); -} diff --git a/src/test/compile-fail/issue-31561.rs b/src/test/compile-fail/issue-31561.rs deleted file mode 100644 index f8645c4d3a7..00000000000 --- a/src/test/compile-fail/issue-31561.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Thing { - Foo(u8), - Bar, - Baz -} - -fn main() { - let Thing::Foo(y) = Thing::Foo(1); - //~^ ERROR refutable pattern in local binding: `Bar` not covered -} diff --git a/src/test/compile-fail/issue-31769.rs b/src/test/compile-fail/issue-31769.rs deleted file mode 100644 index 2bd45deeab4..00000000000 --- a/src/test/compile-fail/issue-31769.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - #[inline] struct Foo; //~ ERROR attribute should be applied to function or closure - #[repr(C)] fn foo() {} //~ ERROR attribute should be applied to struct, enum or union -} diff --git a/src/test/compile-fail/issue-31804.rs b/src/test/compile-fail/issue-31804.rs deleted file mode 100644 index cea52b11c5d..00000000000 --- a/src/test/compile-fail/issue-31804.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that error recovery in the parser to an EOF does not give an infinite -// spew of errors. - -fn main() { - let -} //~ ERROR expected pattern, found `}` diff --git a/src/test/compile-fail/issue-31845.rs b/src/test/compile-fail/issue-31845.rs deleted file mode 100644 index 514255e4676..00000000000 --- a/src/test/compile-fail/issue-31845.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Checks lexical scopes cannot see through normal module boundries - -fn f() { - fn g() {} - mod foo { - fn h() { - g(); //~ ERROR cannot find function `g` in this scope - } - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-31910.rs b/src/test/compile-fail/issue-31910.rs deleted file mode 100644 index 7524049c5df..00000000000 --- a/src/test/compile-fail/issue-31910.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -enum Enum { - X = Trait::Number, - //~^ ERROR mismatched types - //~| expected isize, found i32 -} - -trait Trait { - const Number: i32 = 1; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-31924-non-snake-ffi.rs b/src/test/compile-fail/issue-31924-non-snake-ffi.rs deleted file mode 100644 index d9ce1159c0e..00000000000 --- a/src/test/compile-fail/issue-31924-non-snake-ffi.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![deny(non_snake_case)] - -#[no_mangle] -pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-32004.rs b/src/test/compile-fail/issue-32004.rs deleted file mode 100644 index 7e1f4c28d21..00000000000 --- a/src/test/compile-fail/issue-32004.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { - Bar(i32), - Baz -} - -struct S; - -fn main() { - match Foo::Baz { - Foo::Bar => {} - //~^ ERROR expected unit struct/variant or constant, found tuple variant `Foo::Bar` - _ => {} - } - - match S { - S(()) => {} - //~^ ERROR expected tuple struct/variant, found unit struct `S` - } -} diff --git a/src/test/compile-fail/issue-32086.rs b/src/test/compile-fail/issue-32086.rs deleted file mode 100644 index dd236b76a67..00000000000 --- a/src/test/compile-fail/issue-32086.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct S(u8); -const C: S = S(10); - -fn main() { - let C(a) = S(11); //~ ERROR expected tuple struct/variant, found constant `C` - let C(..) = S(11); //~ ERROR expected tuple struct/variant, found constant `C` -} diff --git a/src/test/compile-fail/issue-32119.rs b/src/test/compile-fail/issue-32119.rs deleted file mode 100644 index e630a01a593..00000000000 --- a/src/test/compile-fail/issue-32119.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(dead_code)] - -pub type T = (); -mod foo { pub use super::T; } -mod bar { pub use super::T; } - -pub use foo::*; -pub use bar::*; - -mod baz { - pub type T = (); - mod foo { pub use super::T as S; } - mod bar { pub use super::foo::S as T; } - pub use self::bar::*; -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-3214.rs b/src/test/compile-fail/issue-3214.rs deleted file mode 100644 index 9a769c39eca..00000000000 --- a/src/test/compile-fail/issue-3214.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo() { - struct foo { - x: T, //~ ERROR can't use type parameters from outer function - } - - impl Drop for foo { - //~^ ERROR wrong number of type arguments - fn drop(&mut self) {} - } -} -fn main() { } diff --git a/src/test/compile-fail/issue-32201.rs b/src/test/compile-fail/issue-32201.rs deleted file mode 100644 index bf9f8ecbc80..00000000000 --- a/src/test/compile-fail/issue-32201.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern { - fn foo(a: i32, ...); -} - -fn bar(_: *const u8) {} - -fn main() { - unsafe { - foo(0, bar); - //~^ ERROR can't pass `fn(*const u8) {bar}` to variadic function - //~| HELP cast the value to `fn(*const u8)` - } -} diff --git a/src/test/compile-fail/issue-32222.rs b/src/test/compile-fail/issue-32222.rs deleted file mode 100644 index b3b34f4b0ef..00000000000 --- a/src/test/compile-fail/issue-32222.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -mod foo { - pub fn bar() {} -} - -pub use foo::*; -use b::bar; - -mod foobar { - use super::*; -} - -mod a { - pub mod bar {} -} - -mod b { - pub use a::bar; -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-32323.rs b/src/test/compile-fail/issue-32323.rs deleted file mode 100644 index e5cb8130327..00000000000 --- a/src/test/compile-fail/issue-32323.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Tr<'a> { - type Out; -} - -pub fn f<'a, T: Tr<'a>>() -> >::Out {} -//~^ ERROR mismatched types - -pub fn main() {} diff --git a/src/test/compile-fail/issue-32377.rs b/src/test/compile-fail/issue-32377.rs deleted file mode 100644 index 5091ba4ee1a..00000000000 --- a/src/test/compile-fail/issue-32377.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::mem; -use std::marker::PhantomData; - -trait Foo { - type Error; -} - -struct Bar { - stream: PhantomData, -} - -fn foo(x: [usize; 2]) -> Bar { - unsafe { mem::transmute(x) } - //~^ ERROR transmute called with types of different sizes -} - -fn main() {} diff --git a/src/test/compile-fail/issue-32655.rs b/src/test/compile-fail/issue-32655.rs deleted file mode 100644 index 25ecd5d0862..00000000000 --- a/src/test/compile-fail/issue-32655.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(dead_code)] -#![feature(rustc_attrs)] - -macro_rules! foo ( - () => ( - #[derive_Clone] //~ ERROR attributes of the form - struct T; - ); -); - -macro_rules! bar ( - ($e:item) => ($e) -); - -foo!(); - -bar!( - #[derive_Clone] //~ ERROR attributes of the form - struct S; -); - -fn main() {} diff --git a/src/test/compile-fail/issue-32709.rs b/src/test/compile-fail/issue-32709.rs deleted file mode 100644 index 09538818dcd..00000000000 --- a/src/test/compile-fail/issue-32709.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Make sure that the span of try shorthand does not include the trailing -// semicolon; -fn a() -> Result { - Err(5)?; //~ ERROR 14:5: 14:12 - Ok(1) -} - -fn main() {} diff --git a/src/test/compile-fail/issue-32782.rs b/src/test/compile-fail/issue-32782.rs deleted file mode 100644 index 696ea0ef547..00000000000 --- a/src/test/compile-fail/issue-32782.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! bar ( - () => () -); - -macro_rules! foo ( - () => ( - #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps - bar!(); - ); -); - -foo!(); -fn main() {} diff --git a/src/test/compile-fail/issue-32797.rs b/src/test/compile-fail/issue-32797.rs deleted file mode 100644 index 2c54ed3e857..00000000000 --- a/src/test/compile-fail/issue-32797.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -pub use bar::*; -mod bar { - pub use super::*; -} - -pub use baz::*; -mod baz { - pub use main as f; -} - -#[rustc_error] -pub fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-32829.rs b/src/test/compile-fail/issue-32829.rs deleted file mode 100644 index 9ac70882ca2..00000000000 --- a/src/test/compile-fail/issue-32829.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: calls in statics are limited - -static S : u64 = { { panic!("foo"); 0 } }; - -fn main() { - println!("{:?}", S); -} diff --git a/src/test/compile-fail/issue-32833.rs b/src/test/compile-fail/issue-32833.rs deleted file mode 100644 index 41383e93603..00000000000 --- a/src/test/compile-fail/issue-32833.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use bar::Foo; //~ ERROR unresolved import `bar::Foo` [E0432] - //~^ no `Foo` in `bar` -mod bar { - use Foo; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-32922.rs b/src/test/compile-fail/issue-32922.rs deleted file mode 100644 index 317a47156c1..00000000000 --- a/src/test/compile-fail/issue-32922.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -macro_rules! foo { () => { - let x = 1; - macro_rules! bar { () => {x} } - let _ = bar!(); -}} - -macro_rules! m { // test issue #31856 - ($n:ident) => ( - let a = 1; - let $n = a; - ) -} - -macro_rules! baz { - ($i:ident) => { - let mut $i = 2; - $i = $i + 1; - } -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - foo! {}; - bar! {}; - - let mut a = true; - baz!(a); -} diff --git a/src/test/compile-fail/issue-32963.rs b/src/test/compile-fail/issue-32963.rs deleted file mode 100644 index 24db822f89c..00000000000 --- a/src/test/compile-fail/issue-32963.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::mem; - -trait Misc {} - -fn size_of_copy() -> usize { mem::size_of::() } - -fn main() { - size_of_copy::(); - //~^ ERROR only auto traits can be used as additional traits in a trait object - //~| ERROR the trait bound `dyn Misc: std::marker::Copy` is not satisfied -} diff --git a/src/test/compile-fail/issue-32995-2.rs b/src/test/compile-fail/issue-32995-2.rs deleted file mode 100644 index 18424fcc9e0..00000000000 --- a/src/test/compile-fail/issue-32995-2.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused)] - -fn main() { - { fn f() {} } - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted - - { fn f() -> impl ::std::marker()::Send { } } - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted -} - -#[derive(Clone)] -struct X; - -impl ::std::marker()::Copy for X {} -//~^ ERROR parenthesized parameters may only be used with a trait -//~| WARN previously accepted diff --git a/src/test/compile-fail/issue-32995.rs b/src/test/compile-fail/issue-32995.rs deleted file mode 100644 index ffbd0c0c22a..00000000000 --- a/src/test/compile-fail/issue-32995.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused)] - -fn main() { - let x: usize() = 1; - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted - - let b: ::std::boxed()::Box<_> = Box::new(1); - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted - - let p = ::std::str::()::from_utf8(b"foo").unwrap(); - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted - - let p = ::std::str::from_utf8::()(b"foo").unwrap(); - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted - - let o : Box<::std::marker()::Send> = Box::new(1); - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted - - let o : Box = Box::new(1); - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted -} - -fn foo() { - let d : X() = Default::default(); - //~^ ERROR parenthesized parameters may only be used with a trait - //~| WARN previously accepted -} diff --git a/src/test/compile-fail/issue-33241.rs b/src/test/compile-fail/issue-33241.rs deleted file mode 100644 index 6a411b4c59c..00000000000 --- a/src/test/compile-fail/issue-33241.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -use std::fmt; - -// CoerceUnsized is not implemented for tuples. You can still create -// an unsized tuple by transmuting a trait object. -fn any() -> T { unreachable!() } - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let t: &(u8, fmt::Debug) = any(); - println!("{:?}", &t.1); -} diff --git a/src/test/compile-fail/issue-33293.rs b/src/test/compile-fail/issue-33293.rs deleted file mode 100644 index bed577b8b9d..00000000000 --- a/src/test/compile-fail/issue-33293.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - match 0 { - aaa::bbb(_) => () - //~^ ERROR failed to resolve. Use of undeclared type or module `aaa` - }; -} diff --git a/src/test/compile-fail/issue-3344.rs b/src/test/compile-fail/issue-3344.rs deleted file mode 100644 index 73532cb768a..00000000000 --- a/src/test/compile-fail/issue-3344.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[derive(PartialEq)] -struct thing(usize); -impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp` - fn le(&self, other: &thing) -> bool { true } - fn ge(&self, other: &thing) -> bool { true } -} -fn main() {} diff --git a/src/test/compile-fail/issue-33464.rs b/src/test/compile-fail/issue-33464.rs deleted file mode 100644 index b7dbaf20eca..00000000000 --- a/src/test/compile-fail/issue-33464.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Make sure that the spans of import errors are correct. - -use abc::one_el; -//~^ ERROR 13:5: 13:8 -use abc::{a, bbb, cccccc}; -//~^ ERROR 15:5: 15:8 -use a_very_long_name::{el, el2}; -//~^ ERROR 17:5: 17:21 - -fn main() {} diff --git a/src/test/compile-fail/issue-33504.rs b/src/test/compile-fail/issue-33504.rs deleted file mode 100644 index 1e1994357c7..00000000000 --- a/src/test/compile-fail/issue-33504.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Shadowing a unit-like enum in a closure - -struct Test; - -fn main() { - || { - let Test = 1; //~ ERROR mismatched types - }; -} diff --git a/src/test/compile-fail/issue-33571.rs b/src/test/compile-fail/issue-33571.rs deleted file mode 100644 index 5dfc41c8f4a..00000000000 --- a/src/test/compile-fail/issue-33571.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[derive(Clone, - Sync, //~ ERROR this unsafe trait should be implemented explicitly - Copy)] -enum Foo {} diff --git a/src/test/compile-fail/issue-33819.rs b/src/test/compile-fail/issue-33819.rs deleted file mode 100644 index 499e7e54947..00000000000 --- a/src/test/compile-fail/issue-33819.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. -fn main() { - let mut op = Some(2); - match op { - Some(ref v) => { let a = &mut v; }, - //~^ ERROR:cannot borrow immutable - //~| cannot borrow mutably - None => {}, - } -} diff --git a/src/test/compile-fail/issue-34028.rs b/src/test/compile-fail/issue-34028.rs deleted file mode 100644 index 117ab18a115..00000000000 --- a/src/test/compile-fail/issue-34028.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -macro_rules! m { - () => { #[cfg(any())] fn f() {} } -} - -trait T {} -impl T for () { m!(); } - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-34171.rs b/src/test/compile-fail/issue-34171.rs deleted file mode 100644 index 30dd34ae9a0..00000000000 --- a/src/test/compile-fail/issue-34171.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -macro_rules! null { ($i:tt) => {} } -macro_rules! apply_null { - ($i:item) => { null! { $i } } -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - apply_null!(#[cfg(all())] fn f() {}); -} diff --git a/src/test/compile-fail/issue-34222-1.rs b/src/test/compile-fail/issue-34222-1.rs deleted file mode 100644 index 6c85414860f..00000000000 --- a/src/test/compile-fail/issue-34222-1.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - /// comment //~ ERROR found a documentation comment that doesn't document anything -} diff --git a/src/test/compile-fail/issue-34334.rs b/src/test/compile-fail/issue-34334.rs deleted file mode 100644 index a752a36ade2..00000000000 --- a/src/test/compile-fail/issue-34334.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main () { - let sr: Vec<(u32, _, _) = vec![]; //~ ERROR expected one of `,` or `>`, found `=` - let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect(); -} diff --git a/src/test/compile-fail/issue-34349.rs b/src/test/compile-fail/issue-34349.rs deleted file mode 100644 index 591753181db..00000000000 --- a/src/test/compile-fail/issue-34349.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This is a regression test for a problem encountered around upvar -// inference and trait caching: in particular, we were entering a -// temporary closure kind during inference, and then caching results -// based on that temporary kind, which led to no error being reported -// in this particular test. - -fn main() { - let inc = || {}; - inc(); - - fn apply(f: F) where F: Fn() { - f() - } - - let mut farewell = "goodbye".to_owned(); - let diary = || { //~ ERROR E0525 - farewell.push_str("!!!"); - println!("Then I screamed {}.", farewell); - }; - - apply(diary); -} diff --git a/src/test/compile-fail/issue-34373.rs b/src/test/compile-fail/issue-34373.rs deleted file mode 100644 index 4d7238ad76f..00000000000 --- a/src/test/compile-fail/issue-34373.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(warnings)] - -trait Trait { - fn foo(_: T) {} -} - -pub struct Foo>>; //~ ERROR cycle detected -type DefaultFoo = Foo; - -fn main() { -} diff --git a/src/test/compile-fail/issue-34418.rs b/src/test/compile-fail/issue-34418.rs deleted file mode 100644 index 6bc0add2205..00000000000 --- a/src/test/compile-fail/issue-34418.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(unused)] - -macro_rules! make_item { - () => { fn f() {} } -} - -macro_rules! make_stmt { - () => { let x = 0; } -} - -fn f() { - make_item! {} -} - -fn g() { - make_stmt! {} -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-3477.rs b/src/test/compile-fail/issue-3477.rs deleted file mode 100644 index 0bad7372a12..00000000000 --- a/src/test/compile-fail/issue-3477.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let _p: char = 100; - //~^ ERROR mismatched types - //~| expected char, found u8 -} diff --git a/src/test/compile-fail/issue-34839.rs b/src/test/compile-fail/issue-34839.rs deleted file mode 100644 index be7e7820020..00000000000 --- a/src/test/compile-fail/issue-34839.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(dead_code)] - -trait RegularExpression: Sized { - type Text; -} - -struct ExecNoSyncStr<'a>(&'a u8); - -impl<'c> RegularExpression for ExecNoSyncStr<'c> { - type Text = u8; -} - -struct FindCaptures<'t, R>(&'t R::Text) where R: RegularExpression, R::Text: 't; - -enum FindCapturesInner<'r, 't> { - Dynamic(FindCaptures<'t, ExecNoSyncStr<'r>>), -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-35075.rs b/src/test/compile-fail/issue-35075.rs deleted file mode 100644 index 9943cfb9bca..00000000000 --- a/src/test/compile-fail/issue-35075.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Bar { - inner: Foo //~ ERROR cannot find type `Foo` in this scope -} - -enum Baz { - Foo(Foo) //~ ERROR cannot find type `Foo` in this scope -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3521-2.rs b/src/test/compile-fail/issue-3521-2.rs deleted file mode 100644 index 1742cb4fb72..00000000000 --- a/src/test/compile-fail/issue-3521-2.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let foo = 100; - - static y: isize = foo + 1; - //~^ ERROR can't capture dynamic environment - - println!("{}", y); -} diff --git a/src/test/compile-fail/issue-3521.rs b/src/test/compile-fail/issue-3521.rs deleted file mode 100644 index 78af11a0b58..00000000000 --- a/src/test/compile-fail/issue-3521.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let foo = 100; - - #[derive(Debug)] - enum Stuff { - Bar = foo - //~^ ERROR attempt to use a non-constant value in a constant - } - - println!("{:?}", Stuff::Bar); -} diff --git a/src/test/compile-fail/issue-35450.rs b/src/test/compile-fail/issue-35450.rs deleted file mode 100644 index 5f54f269c6c..00000000000 --- a/src/test/compile-fail/issue-35450.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! m { ($($t:tt)*) => { $($t)* } } - -fn main() { - m!($t); //~ ERROR expected expression -} diff --git a/src/test/compile-fail/issue-35570.rs b/src/test/compile-fail/issue-35570.rs deleted file mode 100644 index 092bf00ddd6..00000000000 --- a/src/test/compile-fail/issue-35570.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -use std::mem; - -trait Trait1 {} -trait Trait2<'a> { - type Ty; -} - -fn _ice(param: Box Trait1<<() as Trait2<'a>>::Ty>>) { - let _e: (usize, usize) = unsafe{mem::transmute(param)}; -} - -trait Lifetime<'a> { - type Out; -} -impl<'a> Lifetime<'a> for () { - type Out = &'a (); -} -fn foo<'a>(x: &'a ()) -> <() as Lifetime<'a>>::Out { - x -} - -fn takes_lifetime(_f: for<'a> fn(&'a ()) -> <() as Lifetime<'a>>::Out) { -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - takes_lifetime(foo); -} diff --git a/src/test/compile-fail/issue-35668.rs b/src/test/compile-fail/issue-35668.rs deleted file mode 100644 index 17fd77b6df3..00000000000 --- a/src/test/compile-fail/issue-35668.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn func<'a, T>(a: &'a [T]) -> impl Iterator { - a.iter().map(|a| a*a) - //~^ ERROR binary operation `*` cannot be applied to type `&T` -} - -fn main() { - let a = (0..30).collect::>(); - - for k in func(&a) { - println!("{}", k); - } -} diff --git a/src/test/compile-fail/issue-35988.rs b/src/test/compile-fail/issue-35988.rs deleted file mode 100644 index 5909322ff1f..00000000000 --- a/src/test/compile-fail/issue-35988.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum E { - V([Box]), - //~^ ERROR the size for values of type -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3601.rs b/src/test/compile-fail/issue-3601.rs deleted file mode 100644 index cc69a76e043..00000000000 --- a/src/test/compile-fail/issue-3601.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_patterns)] -#![feature(box_syntax)] - -struct HTMLImageData { - image: Option -} - -struct ElementData { - kind: Box -} - -enum ElementKind { - HTMLImageElement(HTMLImageData) -} - -enum NodeKind { - Element(ElementData) -} - -struct NodeData { - kind: Box, -} - -fn main() { - let mut id = HTMLImageData { image: None }; - let ed = ElementData { kind: box ElementKind::HTMLImageElement(id) }; - let n = NodeData {kind : box NodeKind::Element(ed)}; - // n.b. span could be better - match n.kind { - box NodeKind::Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns - box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => { true } - }, - }; -} diff --git a/src/test/compile-fail/issue-36082.rs b/src/test/compile-fail/issue-36082.rs deleted file mode 100644 index ed6a2f85fbe..00000000000 --- a/src/test/compile-fail/issue-36082.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// revisions: ast mir -//[mir]compile-flags: -Z borrowck=mir - -// FIXME(#49821) -- No tip about using a let binding - -use std::cell::RefCell; - -fn main() { - let mut r = 0; - let s = 0; - let x = RefCell::new((&mut r,s)); - - let val: &_ = x.borrow().0; - //[ast]~^ ERROR borrowed value does not live long enough [E0597] - //[ast]~| NOTE temporary value dropped here while still borrowed - //[ast]~| NOTE temporary value does not live long enough - //[ast]~| NOTE consider using a `let` binding to increase its lifetime - //[mir]~^^^^^ ERROR borrowed value does not live long enough [E0597] - //[mir]~| NOTE temporary value does not live long enough - //[mir]~| NOTE temporary value only lives until here - println!("{}", val); - //[mir]~^ borrow later used here -} -//[ast]~^ NOTE temporary value needs to live until here diff --git a/src/test/compile-fail/issue-36116.rs b/src/test/compile-fail/issue-36116.rs deleted file mode 100644 index 3afbfa61984..00000000000 --- a/src/test/compile-fail/issue-36116.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Unnecessary path disambiguator is ok - -#![feature(rustc_attrs)] -#![allow(unused)] - -macro_rules! m { - ($p: path) => { - let _ = $p(0); - let _: $p; - } -} - -struct Foo { - _a: T, -} - -struct S(T); - -fn f() { - let f = Some(Foo { _a: 42 }).map(|a| a as Foo::); //~ WARN unnecessary path disambiguator - let g: Foo:: = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator - - m!(S::); // OK, no warning -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-36299.rs b/src/test/compile-fail/issue-36299.rs deleted file mode 100644 index 88ac74cb09e..00000000000 --- a/src/test/compile-fail/issue-36299.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo<'a, A> {} -//~^ ERROR parameter `'a` is never used -//~| ERROR parameter `A` is never used - -fn main() {} diff --git a/src/test/compile-fail/issue-36379.rs b/src/test/compile-fail/issue-36379.rs deleted file mode 100644 index b20765815e0..00000000000 --- a/src/test/compile-fail/issue-36379.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -fn _test() -> impl Default { } - -#[rustc_error] -fn main() { } //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-36617.rs b/src/test/compile-fail/issue-36617.rs deleted file mode 100644 index 9f5eeb1a45d..00000000000 --- a/src/test/compile-fail/issue-36617.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions diff --git a/src/test/compile-fail/issue-36638.rs b/src/test/compile-fail/issue-36638.rs deleted file mode 100644 index 5e43536ef3f..00000000000 --- a/src/test/compile-fail/issue-36638.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z continue-parse-after-error - -struct Foo(Self); -//~^ ERROR expected identifier, found keyword `Self` - -trait Bar {} -//~^ ERROR expected identifier, found keyword `Self` - -fn main() {} diff --git a/src/test/compile-fail/issue-3668-2.rs b/src/test/compile-fail/issue-3668-2.rs deleted file mode 100644 index fe46877e8d3..00000000000 --- a/src/test/compile-fail/issue-3668-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f(x:isize) { - static child: isize = x + 1; - //~^ ERROR can't capture dynamic environment -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3668.rs b/src/test/compile-fail/issue-3668.rs deleted file mode 100644 index 00f64414a9e..00000000000 --- a/src/test/compile-fail/issue-3668.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct P { child: Option> } -trait PTrait { - fn getChildOption(&self) -> Option>; -} - -impl PTrait for P { - fn getChildOption(&self) -> Option> { - static childVal: Box

{} + +impl > Foo

for Option {} + +pub struct Qux (PhantomData<*mut T>); + +impl Foo<*mut T> for Option> {} + +pub trait Bar { + type Output: 'static; +} + +impl> Foo<*mut T> for W {} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-29857.stderr b/src/test/ui/issue-29857.stderr new file mode 100644 index 00000000000..d5ba942b19f --- /dev/null +++ b/src/test/ui/issue-29857.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-29857.rs:31:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-29861.rs b/src/test/ui/issue-29861.rs new file mode 100644 index 00000000000..79514ad376b --- /dev/null +++ b/src/test/ui/issue-29861.rs @@ -0,0 +1,30 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait MakeRef<'a> { + type Ref; +} +impl<'a, T: 'a> MakeRef<'a> for T { + type Ref = &'a T; +} + +pub trait MakeRef2 { + type Ref2; +} +impl<'a, T: 'a> MakeRef2 for T { +//~^ ERROR the lifetime parameter `'a` is not constrained + type Ref2 = >::Ref; +} + +fn foo() -> ::Ref2 { &String::from("foo") } + +fn main() { + println!("{}", foo()); +} diff --git a/src/test/ui/issue-29861.stderr b/src/test/ui/issue-29861.stderr new file mode 100644 index 00000000000..27453337b10 --- /dev/null +++ b/src/test/ui/issue-29861.stderr @@ -0,0 +1,9 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-29861.rs:21:6 + | +LL | impl<'a, T: 'a> MakeRef2 for T { + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/issue-2995.rs b/src/test/ui/issue-2995.rs new file mode 100644 index 00000000000..d735e184d5c --- /dev/null +++ b/src/test/ui/issue-2995.rs @@ -0,0 +1,15 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn bad (p: *const isize) { + let _q: &isize = p as &isize; //~ ERROR non-primitive cast +} + +fn main() { } diff --git a/src/test/ui/issue-2995.stderr b/src/test/ui/issue-2995.stderr new file mode 100644 index 00000000000..b52bbbead91 --- /dev/null +++ b/src/test/ui/issue-2995.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `*const isize` as `&isize` + --> $DIR/issue-2995.rs:12:22 + | +LL | let _q: &isize = p as &isize; //~ ERROR non-primitive cast + | ^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/ui/issue-30079.rs b/src/test/ui/issue-30079.rs new file mode 100644 index 00000000000..04ae8f6d255 --- /dev/null +++ b/src/test/ui/issue-30079.rs @@ -0,0 +1,49 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct SemiPriv; + +mod m1 { + struct Priv; + impl ::SemiPriv { + pub fn f(_: Priv) {} //~ WARN private type `m1::Priv` in public interface + //~^ WARNING hard error + } + + impl Priv { + pub fn f(_: Priv) {} // ok + } +} + +mod m2 { + struct Priv; + impl ::std::ops::Deref for ::SemiPriv { + type Target = Priv; //~ ERROR private type `m2::Priv` in public interface + fn deref(&self) -> &Self::Target { unimplemented!() } + } + + impl ::std::ops::Deref for Priv { + type Target = Priv; // ok + fn deref(&self) -> &Self::Target { unimplemented!() } + } +} + +trait SemiPrivTrait { + type Assoc; +} + +mod m3 { + struct Priv; + impl ::SemiPrivTrait for () { + type Assoc = Priv; //~ ERROR private type `m3::Priv` in public interface + } +} + +fn main() {} diff --git a/src/test/ui/issue-30079.stderr b/src/test/ui/issue-30079.stderr new file mode 100644 index 00000000000..dadaf3db24e --- /dev/null +++ b/src/test/ui/issue-30079.stderr @@ -0,0 +1,31 @@ +warning: private type `m1::Priv` in public interface (error E0446) + --> $DIR/issue-30079.rs:16:9 + | +LL | pub fn f(_: Priv) {} //~ WARN private type `m1::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: #[warn(private_in_public)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 + +error[E0446]: private type `m2::Priv` in public interface + --> $DIR/issue-30079.rs:28:9 + | +LL | struct Priv; + | - `m2::Priv` declared as private +LL | impl ::std::ops::Deref for ::SemiPriv { +LL | type Target = Priv; //~ ERROR private type `m2::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `m3::Priv` in public interface + --> $DIR/issue-30079.rs:45:9 + | +LL | struct Priv; + | - `m3::Priv` declared as private +LL | impl ::SemiPrivTrait for () { +LL | type Assoc = Priv; //~ ERROR private type `m3::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/ui/issue-3008-3.rs b/src/test/ui/issue-3008-3.rs new file mode 100644 index 00000000000..66bfab003e9 --- /dev/null +++ b/src/test/ui/issue-3008-3.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::marker; + +enum E1 { V1(E2), } +enum E2 { V2(E2, marker::PhantomData), } +//~^ ERROR recursive type `E2` has infinite size + +impl E1 { fn foo(&self) {} } + +fn main() { +} diff --git a/src/test/ui/issue-3008-3.stderr b/src/test/ui/issue-3008-3.stderr new file mode 100644 index 00000000000..22c0871fb0c --- /dev/null +++ b/src/test/ui/issue-3008-3.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `E2` has infinite size + --> $DIR/issue-3008-3.rs:14:1 + | +LL | enum E2 { V2(E2, marker::PhantomData), } + | ^^^^^^^^^^ ------ recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `E2` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-3021-b.rs b/src/test/ui/issue-3021-b.rs new file mode 100644 index 00000000000..2b0a24cfdb3 --- /dev/null +++ b/src/test/ui/issue-3021-b.rs @@ -0,0 +1,24 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn siphash(k0 : u64) { + + struct siphash { + v0: u64, + } + + impl siphash { + pub fn reset(&mut self) { + self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment + } + } +} + +fn main() {} diff --git a/src/test/ui/issue-3021-b.stderr b/src/test/ui/issue-3021-b.stderr new file mode 100644 index 00000000000..dfc80e5ca52 --- /dev/null +++ b/src/test/ui/issue-3021-b.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3021-b.rs:19:22 + | +LL | self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment + | ^^ + | + = 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/issue-3021-c.rs b/src/test/ui/issue-3021-c.rs new file mode 100644 index 00000000000..55975cc8e86 --- /dev/null +++ b/src/test/ui/issue-3021-c.rs @@ -0,0 +1,19 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn siphash() { + + trait t { + fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function + //~^ ERROR can't use type parameters from outer function + } +} + +fn main() {} diff --git a/src/test/ui/issue-3021-c.stderr b/src/test/ui/issue-3021-c.stderr new file mode 100644 index 00000000000..4a250e76af3 --- /dev/null +++ b/src/test/ui/issue-3021-c.stderr @@ -0,0 +1,25 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/issue-3021-c.rs:14:24 + | +LL | fn siphash() { + | - type variable from outer function +... +LL | fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function + | - ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `g` + +error[E0401]: can't use type parameters from outer function + --> $DIR/issue-3021-c.rs:14:30 + | +LL | fn siphash() { + | - type variable from outer function +... +LL | fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function + | - ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `g` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/issue-3021-d.rs b/src/test/ui/issue-3021-d.rs new file mode 100644 index 00000000000..c23e12e713a --- /dev/null +++ b/src/test/ui/issue-3021-d.rs @@ -0,0 +1,38 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait siphash { + fn result(&self) -> u64; + fn reset(&self); +} + +fn siphash(k0 : u64, k1 : u64) { + struct SipState { + v0: u64, + v1: u64, + } + + fn mk_result(st : &SipState) -> u64 { + + let v0 = st.v0; + let v1 = st.v1; + return v0 ^ v1; + } + + impl siphash for SipState { + fn reset(&self) { + self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment + self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment + } + fn result(&self) -> u64 { return mk_result(self); } + } +} + +fn main() {} diff --git a/src/test/ui/issue-3021-d.stderr b/src/test/ui/issue-3021-d.stderr new file mode 100644 index 00000000000..ab5ad94a031 --- /dev/null +++ b/src/test/ui/issue-3021-d.stderr @@ -0,0 +1,19 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3021-d.rs:31:23 + | +LL | self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment + | ^^ + | + = help: use the `|| { ... }` closure form instead + +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3021-d.rs:32:23 + | +LL | self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment + | ^^ + | + = help: use the `|| { ... }` closure form instead + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0434`. diff --git a/src/test/ui/issue-3021.rs b/src/test/ui/issue-3021.rs new file mode 100644 index 00000000000..f93a333d2ae --- /dev/null +++ b/src/test/ui/issue-3021.rs @@ -0,0 +1,28 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait SipHash { + fn reset(&self); +} + +fn siphash(k0 : u64) { + struct SipState { + v0: u64, + } + + impl SipHash for SipState { + fn reset(&self) { + self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment + } + } + panic!(); +} + +fn main() {} diff --git a/src/test/ui/issue-3021.stderr b/src/test/ui/issue-3021.stderr new file mode 100644 index 00000000000..312b9f3b864 --- /dev/null +++ b/src/test/ui/issue-3021.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3021.rs:22:22 + | +LL | self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment + | ^^ + | + = 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/issue-30225.rs b/src/test/ui/issue-30225.rs new file mode 100644 index 00000000000..7acbbfb8826 --- /dev/null +++ b/src/test/ui/issue-30225.rs @@ -0,0 +1,48 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for #30225, which was an ICE that would trigger as +// a result of a poor interaction between trait result caching and +// type inference. Specifically, at that time, unification could cause +// unrelated type variables to become instantiated, if subtyping +// relationships existed. These relationships are now propagated +// through obligations and hence everything works out fine. + +trait Foo : Sized { + fn foo(self, u: Option, v: Option) {} +} + +struct A; +struct B; + +impl Foo for () {} // impl A +impl Foo for u32 {} // impl B, creating ambiguity + +fn toxic() { + // cache the resolution <() as Foo<$0,$1>> = impl A + let u = None; + let v = None; + Foo::foo((), u, v); +} + +fn bomb() { + let mut u = None; // type is Option<$0> + let mut v = None; // type is Option<$1> + let mut x = None; // type is Option<$2> + + Foo::foo(x.unwrap(),u,v); // register <$2 as Foo<$0, $1>> + u = v; // mark $0 and $1 in a subtype relationship + //~^ ERROR mismatched types + x = Some(()); // set $2 = (), allowing impl selection + // to proceed for <() as Foo<$0, $1>> = impl A. + // kaboom, this *used* to trigge an ICE +} + +fn main() {} diff --git a/src/test/ui/issue-30225.stderr b/src/test/ui/issue-30225.stderr new file mode 100644 index 00000000000..b3bbf233257 --- /dev/null +++ b/src/test/ui/issue-30225.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-30225.rs:41:9 + | +LL | u = v; // mark $0 and $1 in a subtype relationship + | ^ expected struct `A`, found struct `B` + | + = note: expected type `A` + found type `B` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-30236.rs b/src/test/ui/issue-30236.rs new file mode 100644 index 00000000000..45a5cd09337 --- /dev/null +++ b/src/test/ui/issue-30236.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +type Foo< + Unused //~ ERROR type parameter `Unused` is unused + > = u8; + +fn main() { + +} + diff --git a/src/test/ui/issue-30236.stderr b/src/test/ui/issue-30236.stderr new file mode 100644 index 00000000000..3a9f075d480 --- /dev/null +++ b/src/test/ui/issue-30236.stderr @@ -0,0 +1,9 @@ +error[E0091]: type parameter `Unused` is unused + --> $DIR/issue-30236.rs:12:5 + | +LL | Unused //~ ERROR type parameter `Unused` is unused + | ^^^^^^ unused type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0091`. diff --git a/src/test/ui/issue-30240-b.rs b/src/test/ui/issue-30240-b.rs new file mode 100644 index 00000000000..cf6935b9ba6 --- /dev/null +++ b/src/test/ui/issue-30240-b.rs @@ -0,0 +1,26 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(unreachable_patterns)] + +fn main() { + match "world" { + "hello" => {} + _ => {}, + } + + match "world" { + ref _x if false => {} + "hello" => {} + "hello" => {} //~ ERROR unreachable pattern + _ => {}, + } +} + diff --git a/src/test/ui/issue-30240-b.stderr b/src/test/ui/issue-30240-b.stderr new file mode 100644 index 00000000000..535d1a92ed9 --- /dev/null +++ b/src/test/ui/issue-30240-b.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/issue-30240-b.rs:22:9 + | +LL | "hello" => {} //~ ERROR unreachable pattern + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-30240-b.rs:11:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-30240.rs b/src/test/ui/issue-30240.rs new file mode 100644 index 00000000000..60fb307d4e1 --- /dev/null +++ b/src/test/ui/issue-30240.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + match "world" { //~ ERROR non-exhaustive patterns: `&_` + "hello" => {} + } + + match "world" { //~ ERROR non-exhaustive patterns: `&_` + ref _x if false => {} + "hello" => {} + } +} diff --git a/src/test/ui/issue-30240.stderr b/src/test/ui/issue-30240.stderr new file mode 100644 index 00000000000..9acb53ff911 --- /dev/null +++ b/src/test/ui/issue-30240.stderr @@ -0,0 +1,15 @@ +error[E0004]: non-exhaustive patterns: `&_` not covered + --> $DIR/issue-30240.rs:12:11 + | +LL | match "world" { //~ ERROR non-exhaustive patterns: `&_` + | ^^^^^^^ pattern `&_` not covered + +error[E0004]: non-exhaustive patterns: `&_` not covered + --> $DIR/issue-30240.rs:16:11 + | +LL | match "world" { //~ ERROR non-exhaustive patterns: `&_` + | ^^^^^^^ pattern `&_` not covered + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-30355.nll.stderr b/src/test/ui/issue-30355.nll.stderr new file mode 100644 index 00000000000..e565ad59116 --- /dev/null +++ b/src/test/ui/issue-30355.nll.stderr @@ -0,0 +1,22 @@ +error[E0508]: cannot move out of type `[u8]`, a non-copy slice + --> $DIR/issue-30355.rs:15:8 + | +LL | &X(*Y) + | ^^ cannot move out of here + +error[E0161]: cannot move a value of type X: the size of X cannot be statically determined + --> $DIR/issue-30355.rs:15:6 + | +LL | &X(*Y) + | ^^^^^ + +error[E0161]: cannot move a value of type [u8]: the size of [u8] cannot be statically determined + --> $DIR/issue-30355.rs:15:8 + | +LL | &X(*Y) + | ^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0161, E0508. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/ui/issue-30355.rs b/src/test/ui/issue-30355.rs new file mode 100644 index 00000000000..ee19d040318 --- /dev/null +++ b/src/test/ui/issue-30355.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct X([u8]); + +pub static Y: &'static X = { + const Y: &'static [u8] = b""; + &X(*Y) + //~^ ERROR cannot move out + //~^^ ERROR cannot move a + //~^^^ ERROR cannot move a +}; + +fn main() {} diff --git a/src/test/ui/issue-30355.stderr b/src/test/ui/issue-30355.stderr new file mode 100644 index 00000000000..7e843688035 --- /dev/null +++ b/src/test/ui/issue-30355.stderr @@ -0,0 +1,22 @@ +error[E0161]: cannot move a value of type X: the size of X cannot be statically determined + --> $DIR/issue-30355.rs:15:6 + | +LL | &X(*Y) + | ^^^^^ + +error[E0161]: cannot move a value of type [u8]: the size of [u8] cannot be statically determined + --> $DIR/issue-30355.rs:15:8 + | +LL | &X(*Y) + | ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/issue-30355.rs:15:8 + | +LL | &X(*Y) + | ^^ cannot move out of borrowed content + +error: aborting due to 3 previous errors + +Some errors occurred: E0161, E0507. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/ui/issue-3038.rs b/src/test/ui/issue-3038.rs new file mode 100644 index 00000000000..1eec62df788 --- /dev/null +++ b/src/test/ui/issue-3038.rs @@ -0,0 +1,36 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum f { g(isize, isize) } + +enum h { i(j, k) } + +enum j { l(isize, isize) } +enum k { m(isize, isize) } + +fn main() +{ + + let _z = match f::g(1, 2) { + f::g(x, x) => { println!("{}", x + x); } + //~^ ERROR identifier `x` is bound more than once in the same pattern + }; + + let _z = match h::i(j::l(1, 2), k::m(3, 4)) { + h::i(j::l(x, _), k::m(_, x)) + //~^ ERROR identifier `x` is bound more than once in the same pattern + => { println!("{}", x + x); } + }; + + let _z = match (1, 2) { + (x, x) => { x } //~ ERROR identifier `x` is bound more than once in the same pattern + }; + +} diff --git a/src/test/ui/issue-3038.stderr b/src/test/ui/issue-3038.stderr new file mode 100644 index 00000000000..17ad9936149 --- /dev/null +++ b/src/test/ui/issue-3038.stderr @@ -0,0 +1,21 @@ +error[E0416]: identifier `x` is bound more than once in the same pattern + --> $DIR/issue-3038.rs:22:15 + | +LL | f::g(x, x) => { println!("{}", x + x); } + | ^ used in a pattern more than once + +error[E0416]: identifier `x` is bound more than once in the same pattern + --> $DIR/issue-3038.rs:27:32 + | +LL | h::i(j::l(x, _), k::m(_, x)) + | ^ used in a pattern more than once + +error[E0416]: identifier `x` is bound more than once in the same pattern + --> $DIR/issue-3038.rs:33:13 + | +LL | (x, x) => { x } //~ ERROR identifier `x` is bound more than once in the same pattern + | ^ used in a pattern more than once + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0416`. diff --git a/src/test/ui/issue-30438-a.nll.stderr b/src/test/ui/issue-30438-a.nll.stderr new file mode 100644 index 00000000000..2d27cd55e01 --- /dev/null +++ b/src/test/ui/issue-30438-a.nll.stderr @@ -0,0 +1,20 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-30438-a.rs:22:17 + | +LL | return &Test { s: &self.s}; + | ^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the method body at 21:5... + --> $DIR/issue-30438-a.rs:21:5 + | +LL | / fn index(&self, _: usize) -> &Self::Output { +LL | | return &Test { s: &self.s}; +LL | | //~^ ERROR: borrowed value does not live long enough +LL | | } + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-30438-a.rs b/src/test/ui/issue-30438-a.rs new file mode 100644 index 00000000000..441815de81d --- /dev/null +++ b/src/test/ui/issue-30438-a.rs @@ -0,0 +1,33 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Original regression test for Issue #30438. + +use std::ops::Index; + +struct Test<'a> { + s: &'a String +} + +impl <'a> Index for Test<'a> { + type Output = Test<'a>; + fn index(&self, _: usize) -> &Self::Output { + return &Test { s: &self.s}; + //~^ ERROR: borrowed value does not live long enough + } +} + +fn main() { + let s = "Hello World".to_string(); + let test = Test{s: &s}; + let r = &test[0]; + println!("{}", test.s); // OK since test is valid + println!("{}", r.s); // Segfault since value pointed by r has already been dropped +} diff --git a/src/test/ui/issue-30438-a.stderr b/src/test/ui/issue-30438-a.stderr new file mode 100644 index 00000000000..5f4a51a927a --- /dev/null +++ b/src/test/ui/issue-30438-a.stderr @@ -0,0 +1,21 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-30438-a.rs:22:17 + | +LL | return &Test { s: &self.s}; + | ^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the method body at 21:5... + --> $DIR/issue-30438-a.rs:21:5 + | +LL | / fn index(&self, _: usize) -> &Self::Output { +LL | | return &Test { s: &self.s}; +LL | | //~^ ERROR: borrowed value does not live long enough +LL | | } + | |_____^ + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-30438-b.rs b/src/test/ui/issue-30438-b.rs new file mode 100644 index 00000000000..981b196c4ae --- /dev/null +++ b/src/test/ui/issue-30438-b.rs @@ -0,0 +1,34 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Modified regression test for Issue #30438 that exposed an +// independent issue (see discussion on ticket). + +use std::ops::Index; + +struct Test<'a> { + s: &'a String +} + +impl <'a> Index for Test<'a> { + type Output = Test<'a>; + fn index(&self, _: usize) -> &Self::Output { + &Test { s: &self.s} + //~^ ERROR: borrowed value does not live long enough + } +} + +fn main() { + let s = "Hello World".to_string(); + let test = Test{s: &s}; + let r = &test[0]; + println!("{}", test.s); // OK since test is valid + println!("{}", r.s); // Segfault since value pointed by r has already been dropped +} diff --git a/src/test/ui/issue-30438-b.stderr b/src/test/ui/issue-30438-b.stderr new file mode 100644 index 00000000000..651ff9f2ae1 --- /dev/null +++ b/src/test/ui/issue-30438-b.stderr @@ -0,0 +1,21 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-30438-b.rs:23:10 + | +LL | &Test { s: &self.s} + | ^^^^^^^^^^^^^^^^^^ temporary value does not live long enough +LL | //~^ ERROR: borrowed value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the method body at 22:5... + --> $DIR/issue-30438-b.rs:22:5 + | +LL | / fn index(&self, _: usize) -> &Self::Output { +LL | | &Test { s: &self.s} +LL | | //~^ ERROR: borrowed value does not live long enough +LL | | } + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-30438-c.nll.stderr b/src/test/ui/issue-30438-c.nll.stderr new file mode 100644 index 00000000000..0bfac131e22 --- /dev/null +++ b/src/test/ui/issue-30438-c.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: `x` does not live long enough + --> $DIR/issue-30438-c.rs:19:5 + | +LL | &x + | ^^ borrowed value does not live long enough +LL | //~^ ERROR: `x` does not live long enough +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'y as defined on the function body at 17:10... + --> $DIR/issue-30438-c.rs:17:10 + | +LL | fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-30438-c.rs b/src/test/ui/issue-30438-c.rs new file mode 100644 index 00000000000..2b4d0dc339b --- /dev/null +++ b/src/test/ui/issue-30438-c.rs @@ -0,0 +1,30 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Simplified regression test for #30438, inspired by arielb1. + +trait Trait { type Out; } + +struct Test<'a> { s: &'a str } + +fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { + let x = Test { s: "this cannot last" }; + &x + //~^ ERROR: `x` does not live long enough +} + +impl<'b> Trait for Test<'b> { type Out = Test<'b>; } + +fn main() { + let orig = Test { s: "Hello World" }; + let r = silly(&orig); + println!("{}", orig.s); // OK since `orig` is valid + println!("{}", r.s); // Segfault (method does not return a sane value) +} diff --git a/src/test/ui/issue-30438-c.stderr b/src/test/ui/issue-30438-c.stderr new file mode 100644 index 00000000000..dc6e1c52be1 --- /dev/null +++ b/src/test/ui/issue-30438-c.stderr @@ -0,0 +1,18 @@ +error[E0597]: `x` does not live long enough + --> $DIR/issue-30438-c.rs:19:6 + | +LL | &x + | ^ borrowed value does not live long enough +LL | //~^ ERROR: `x` does not live long enough +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'y as defined on the function body at 17:10... + --> $DIR/issue-30438-c.rs:17:10 + | +LL | fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-30560.rs b/src/test/ui/issue-30560.rs new file mode 100644 index 00000000000..0b1afd75ca9 --- /dev/null +++ b/src/test/ui/issue-30560.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +type Alias = (); +use Alias::*; +//~^ ERROR unresolved import `Alias` [E0432] +//~| Not a module `Alias` +use std::io::Result::*; +//~^ ERROR unresolved import `std::io::Result` [E0432] +//~| Not a module `Result` + +trait T {} +use T::*; //~ ERROR items in traits are not importable + +fn main() {} diff --git a/src/test/ui/issue-30560.stderr b/src/test/ui/issue-30560.stderr new file mode 100644 index 00000000000..cb38c0dabe0 --- /dev/null +++ b/src/test/ui/issue-30560.stderr @@ -0,0 +1,21 @@ +error: items in traits are not importable. + --> $DIR/issue-30560.rs:20:5 + | +LL | use T::*; //~ ERROR items in traits are not importable + | ^^^^ + +error[E0432]: unresolved import `Alias` + --> $DIR/issue-30560.rs:12:5 + | +LL | use Alias::*; + | ^^^^^ Not a module `Alias` + +error[E0432]: unresolved import `std::io::Result` + --> $DIR/issue-30560.rs:15:14 + | +LL | use std::io::Result::*; + | ^^^^^^ Not a module `Result` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-30589.rs b/src/test/ui/issue-30589.rs new file mode 100644 index 00000000000..61721fe58b3 --- /dev/null +++ b/src/test/ui/issue-30589.rs @@ -0,0 +1,19 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::fmt; + +impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` in this scope + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Missing data: {}", self.0) + } +} +fn main() { +} diff --git a/src/test/ui/issue-30589.stderr b/src/test/ui/issue-30589.stderr new file mode 100644 index 00000000000..8174af83230 --- /dev/null +++ b/src/test/ui/issue-30589.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `DecoderError` in this scope + --> $DIR/issue-30589.rs:13:23 + | +LL | impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` in this scope + | ^^^^^^^^^^^^ 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/issue-3080.rs b/src/test/ui/issue-3080.rs new file mode 100644 index 00000000000..fb16dad3960 --- /dev/null +++ b/src/test/ui/issue-3080.rs @@ -0,0 +1,18 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct x(()); +impl x { + pub unsafe fn with(&self) { } +} + +fn main() { + x(()).with(); //~ ERROR requires unsafe function or block +} diff --git a/src/test/ui/issue-3080.stderr b/src/test/ui/issue-3080.stderr new file mode 100644 index 00000000000..3a966e3f315 --- /dev/null +++ b/src/test/ui/issue-3080.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/issue-3080.rs:17:5 + | +LL | x(()).with(); //~ ERROR requires unsafe function or block + | ^^^^^^^^^^^^ 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/issue-3096-1.rs b/src/test/ui/issue-3096-1.rs new file mode 100644 index 00000000000..62c2639836b --- /dev/null +++ b/src/test/ui/issue-3096-1.rs @@ -0,0 +1,13 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + match () { } //~ ERROR non-exhaustive +} diff --git a/src/test/ui/issue-3096-1.stderr b/src/test/ui/issue-3096-1.stderr new file mode 100644 index 00000000000..783e831a2a5 --- /dev/null +++ b/src/test/ui/issue-3096-1.stderr @@ -0,0 +1,15 @@ +error[E0004]: non-exhaustive patterns: type () is non-empty + --> $DIR/issue-3096-1.rs:12:11 + | +LL | match () { } //~ ERROR non-exhaustive + | ^^ + | +help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms. + --> $DIR/issue-3096-1.rs:12:11 + | +LL | match () { } //~ ERROR non-exhaustive + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-3096-2.rs b/src/test/ui/issue-3096-2.rs new file mode 100644 index 00000000000..2d1ad9a2692 --- /dev/null +++ b/src/test/ui/issue-3096-2.rs @@ -0,0 +1,16 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum bottom { } + +fn main() { + let x = &() as *const () as *const bottom; + match x { } //~ ERROR non-exhaustive patterns +} diff --git a/src/test/ui/issue-3096-2.stderr b/src/test/ui/issue-3096-2.stderr new file mode 100644 index 00000000000..6031f25c03d --- /dev/null +++ b/src/test/ui/issue-3096-2.stderr @@ -0,0 +1,15 @@ +error[E0004]: non-exhaustive patterns: type *const bottom is non-empty + --> $DIR/issue-3096-2.rs:15:11 + | +LL | match x { } //~ ERROR non-exhaustive patterns + | ^ + | +help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms. + --> $DIR/issue-3096-2.rs:15:11 + | +LL | match x { } //~ ERROR non-exhaustive patterns + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-3099-a.rs b/src/test/ui/issue-3099-a.rs new file mode 100644 index 00000000000..db60d70ca9b --- /dev/null +++ b/src/test/ui/issue-3099-a.rs @@ -0,0 +1,15 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum a { b, c } + +enum a { d, e } //~ ERROR the name `a` is defined multiple times + +fn main() {} diff --git a/src/test/ui/issue-3099-a.stderr b/src/test/ui/issue-3099-a.stderr new file mode 100644 index 00000000000..6a194593c3f --- /dev/null +++ b/src/test/ui/issue-3099-a.stderr @@ -0,0 +1,14 @@ +error[E0428]: the name `a` is defined multiple times + --> $DIR/issue-3099-a.rs:13:1 + | +LL | enum a { b, c } + | ------ previous definition of the type `a` here +LL | +LL | enum a { d, e } //~ ERROR the name `a` is defined multiple times + | ^^^^^^ `a` redefined here + | + = note: `a` 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/issue-3099-b.rs b/src/test/ui/issue-3099-b.rs new file mode 100644 index 00000000000..956d2186752 --- /dev/null +++ b/src/test/ui/issue-3099-b.rs @@ -0,0 +1,15 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub mod a {} + +pub mod a {} //~ ERROR the name `a` is defined multiple times + +fn main() {} diff --git a/src/test/ui/issue-3099-b.stderr b/src/test/ui/issue-3099-b.stderr new file mode 100644 index 00000000000..226d99e3b82 --- /dev/null +++ b/src/test/ui/issue-3099-b.stderr @@ -0,0 +1,14 @@ +error[E0428]: the name `a` is defined multiple times + --> $DIR/issue-3099-b.rs:13:1 + | +LL | pub mod a {} + | --------- previous definition of the module `a` here +LL | +LL | pub mod a {} //~ ERROR the name `a` is defined multiple times + | ^^^^^^^^^ `a` redefined here + | + = note: `a` 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/issue-3099.rs b/src/test/ui/issue-3099.rs new file mode 100644 index 00000000000..42766533556 --- /dev/null +++ b/src/test/ui/issue-3099.rs @@ -0,0 +1,21 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn a(x: String) -> String { + format!("First function with {}", x) +} + +fn a(x: String, y: String) -> String { //~ ERROR the name `a` is defined multiple times + format!("Second function with {} and {}", x, y) +} + +fn main() { + println!("Result: "); +} diff --git a/src/test/ui/issue-3099.stderr b/src/test/ui/issue-3099.stderr new file mode 100644 index 00000000000..a5f29e7b6c3 --- /dev/null +++ b/src/test/ui/issue-3099.stderr @@ -0,0 +1,14 @@ +error[E0428]: the name `a` is defined multiple times + --> $DIR/issue-3099.rs:15:1 + | +LL | fn a(x: String) -> String { + | ------------------------- previous definition of the value `a` here +... +LL | fn a(x: String, y: String) -> String { //~ ERROR the name `a` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `a` redefined here + | + = note: `a` must be defined only once in the value 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/issue-31011.rs b/src/test/ui/issue-31011.rs new file mode 100644 index 00000000000..716b0bbe772 --- /dev/null +++ b/src/test/ui/issue-31011.rs @@ -0,0 +1,39 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! log { + ( $ctx:expr, $( $args:expr),* ) => { + if $ctx.trace { + //~^ no field `trace` on type `&T` + println!( $( $args, )* ); + } + } +} + +// Create a structure. +struct Foo { + trace: bool, +} + +// Generic wrapper calls log! with a structure. +fn wrap(context: &T) -> () +{ + log!(context, "entered wrapper"); + //~^ in this expansion of log! +} + +fn main() { + // Create a structure. + let x = Foo { trace: true }; + log!(x, "run started"); + // Apply a closure which accesses internal fields. + wrap(&x); + log!(x, "run finished"); +} diff --git a/src/test/ui/issue-31011.stderr b/src/test/ui/issue-31011.stderr new file mode 100644 index 00000000000..c2e7c9876cb --- /dev/null +++ b/src/test/ui/issue-31011.stderr @@ -0,0 +1,12 @@ +error[E0609]: no field `trace` on type `&T` + --> $DIR/issue-31011.rs:13:17 + | +LL | if $ctx.trace { + | ^^^^^ +... +LL | log!(context, "entered wrapper"); + | --------------------------------- in this macro invocation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-31109.rs b/src/test/ui/issue-31109.rs new file mode 100644 index 00000000000..74121e3a420 --- /dev/null +++ b/src/test/ui/issue-31109.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + // FIXME(#31407) this error should go away, but in the meantime we test that it + // is accompanied by a somewhat useful error message. + let _: f64 = 1234567890123456789012345678901234567890e-340; + //~^ ERROR could not evaluate float literal (see issue #31407) +} diff --git a/src/test/ui/issue-31109.stderr b/src/test/ui/issue-31109.stderr new file mode 100644 index 00000000000..c66a4f0b175 --- /dev/null +++ b/src/test/ui/issue-31109.stderr @@ -0,0 +1,8 @@ +error: could not evaluate float literal (see issue #31407) + --> $DIR/issue-31109.rs:14:18 + | +LL | let _: f64 = 1234567890123456789012345678901234567890e-340; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-31173.rs b/src/test/ui/issue-31173.rs new file mode 100644 index 00000000000..fb1e3cc87e8 --- /dev/null +++ b/src/test/ui/issue-31173.rs @@ -0,0 +1,27 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::vec::IntoIter; + +pub fn get_tok(it: &mut IntoIter) { + let mut found_e = false; + + let temp: Vec = it.take_while(|&x| { + found_e = true; + false + }) + .cloned() + //~^ ERROR type mismatch resolving + //~| expected type `u8` + //~| found type `&_` + .collect(); //~ ERROR no method named `collect` +} + +fn main() {} diff --git a/src/test/ui/issue-31173.stderr b/src/test/ui/issue-31173.stderr new file mode 100644 index 00000000000..e2630b5b8ce --- /dev/null +++ b/src/test/ui/issue-31173.stderr @@ -0,0 +1,23 @@ +error[E0271]: type mismatch resolving `, [closure@$DIR/issue-31173.rs:16:39: 19:6 found_e:_]> as std::iter::Iterator>::Item == &_` + --> $DIR/issue-31173.rs:20:10 + | +LL | .cloned() + | ^^^^^^ expected u8, found reference + | + = note: expected type `u8` + found type `&_` + +error[E0599]: no method named `collect` found for type `std::iter::Cloned, [closure@$DIR/issue-31173.rs:16:39: 19:6 found_e:_]>>` in the current scope + --> $DIR/issue-31173.rs:24:10 + | +LL | .collect(); //~ ERROR no method named `collect` + | ^^^^^^^ + | + = note: the method `collect` exists but the following trait bounds were not satisfied: + `std::iter::Cloned, [closure@$DIR/issue-31173.rs:16:39: 19:6 found_e:_]>> : std::iter::Iterator` + `&mut std::iter::Cloned, [closure@$DIR/issue-31173.rs:16:39: 19:6 found_e:_]>> : std::iter::Iterator` + +error: aborting due to 2 previous errors + +Some errors occurred: E0271, E0599. +For more information about an error, try `rustc --explain E0271`. diff --git a/src/test/ui/issue-31212.rs b/src/test/ui/issue-31212.rs new file mode 100644 index 00000000000..8dc58eee5fb --- /dev/null +++ b/src/test/ui/issue-31212.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This checks that a path that cannot be resolved because of an indeterminate import +// does not trigger an ICE. + +mod foo { + pub use self::*; //~ ERROR unresolved +} + +fn main() { + foo::f(); //~ ERROR cannot find function `f` in module `foo` +} diff --git a/src/test/ui/issue-31212.stderr b/src/test/ui/issue-31212.stderr new file mode 100644 index 00000000000..17cf2e81236 --- /dev/null +++ b/src/test/ui/issue-31212.stderr @@ -0,0 +1,16 @@ +error[E0432]: unresolved import `self::*` + --> $DIR/issue-31212.rs:15:13 + | +LL | pub use self::*; //~ ERROR unresolved + | ^^^^^^^ Cannot glob-import a module into itself. + +error[E0425]: cannot find function `f` in module `foo` + --> $DIR/issue-31212.rs:19:10 + | +LL | foo::f(); //~ ERROR cannot find function `f` in module `foo` + | ^ not found in `foo` + +error: aborting due to 2 previous errors + +Some errors occurred: E0425, E0432. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/issue-31495.rs b/src/test/ui/issue-31495.rs new file mode 100644 index 00000000000..794b8bb86bb --- /dev/null +++ b/src/test/ui/issue-31495.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --cfg foo(bar) +// error-pattern: invalid predicate in --cfg command line argument: `foo` +fn main() {} diff --git a/src/test/ui/issue-31511.rs b/src/test/ui/issue-31511.rs new file mode 100644 index 00000000000..dd1af2f4448 --- /dev/null +++ b/src/test/ui/issue-31511.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn cast_thin_to_fat(x: *const ()) { + x as *const [u8]; + //~^ ERROR: cannot cast thin pointer `*const ()` to fat pointer `*const [u8]` +} + +fn main() {} diff --git a/src/test/ui/issue-31511.stderr b/src/test/ui/issue-31511.stderr new file mode 100644 index 00000000000..7d4c9426da1 --- /dev/null +++ b/src/test/ui/issue-31511.stderr @@ -0,0 +1,9 @@ +error[E0607]: cannot cast thin pointer `*const ()` to fat pointer `*const [u8]` + --> $DIR/issue-31511.rs:12:5 + | +LL | x 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/issue-3154.nll.stderr b/src/test/ui/issue-3154.nll.stderr new file mode 100644 index 00000000000..4420f9dcae4 --- /dev/null +++ b/src/test/ui/issue-3154.nll.stderr @@ -0,0 +1,23 @@ +warning: not reporting region error due to nll + --> $DIR/issue-3154.rs:16:15 + | +LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621] + | ^ + +warning: not reporting region error due to nll + --> $DIR/issue-3154.rs:16:5 + | +LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621] + | ^^^^^ + +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/issue-3154.rs:16:15 + | +LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> { + | - consider changing the type of `x` to `&'a Q` +LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621] + | ^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-3154.rs b/src/test/ui/issue-3154.rs new file mode 100644 index 00000000000..519e9d06d1b --- /dev/null +++ b/src/test/ui/issue-3154.rs @@ -0,0 +1,21 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct thing<'a, Q:'a> { + x: &'a Q +} + +fn thing<'a,Q>(x: &Q) -> thing<'a,Q> { + thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621] +} + +fn main() { + thing(&()); +} diff --git a/src/test/ui/issue-3154.stderr b/src/test/ui/issue-3154.stderr new file mode 100644 index 00000000000..cc0cfd768c4 --- /dev/null +++ b/src/test/ui/issue-3154.stderr @@ -0,0 +1,11 @@ +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/issue-3154.rs:16:5 + | +LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> { + | - consider changing the type of `x` to `&'a Q` +LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621] + | ^^^^^^^^^^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-31561.rs b/src/test/ui/issue-31561.rs new file mode 100644 index 00000000000..f8645c4d3a7 --- /dev/null +++ b/src/test/ui/issue-31561.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Thing { + Foo(u8), + Bar, + Baz +} + +fn main() { + let Thing::Foo(y) = Thing::Foo(1); + //~^ ERROR refutable pattern in local binding: `Bar` not covered +} diff --git a/src/test/ui/issue-31561.stderr b/src/test/ui/issue-31561.stderr new file mode 100644 index 00000000000..4608a95459b --- /dev/null +++ b/src/test/ui/issue-31561.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `Bar` not covered + --> $DIR/issue-31561.rs:18:9 + | +LL | let Thing::Foo(y) = Thing::Foo(1); + | ^^^^^^^^^^^^^ pattern `Bar` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/issue-31769.rs b/src/test/ui/issue-31769.rs new file mode 100644 index 00000000000..2bd45deeab4 --- /dev/null +++ b/src/test/ui/issue-31769.rs @@ -0,0 +1,14 @@ +// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + #[inline] struct Foo; //~ ERROR attribute should be applied to function or closure + #[repr(C)] fn foo() {} //~ ERROR attribute should be applied to struct, enum or union +} diff --git a/src/test/ui/issue-31769.stderr b/src/test/ui/issue-31769.stderr new file mode 100644 index 00000000000..1f1904e3c2c --- /dev/null +++ b/src/test/ui/issue-31769.stderr @@ -0,0 +1,16 @@ +error[E0518]: attribute should be applied to function or closure + --> $DIR/issue-31769.rs:12:5 + | +LL | #[inline] struct Foo; //~ ERROR attribute should be applied to function or closure + | ^^^^^^^^^ ----------- not a function or closure + +error[E0517]: attribute should be applied to struct, enum or union + --> $DIR/issue-31769.rs:13:12 + | +LL | #[repr(C)] fn foo() {} //~ ERROR attribute should be applied to struct, enum or union + | ^ ----------- not a struct, enum or union + +error: aborting due to 2 previous errors + +Some errors occurred: E0517, E0518. +For more information about an error, try `rustc --explain E0517`. diff --git a/src/test/ui/issue-31804.rs b/src/test/ui/issue-31804.rs new file mode 100644 index 00000000000..cea52b11c5d --- /dev/null +++ b/src/test/ui/issue-31804.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that error recovery in the parser to an EOF does not give an infinite +// spew of errors. + +fn main() { + let +} //~ ERROR expected pattern, found `}` diff --git a/src/test/ui/issue-31804.stderr b/src/test/ui/issue-31804.stderr new file mode 100644 index 00000000000..e0ac2f631ba --- /dev/null +++ b/src/test/ui/issue-31804.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found `}` + --> $DIR/issue-31804.rs:16:1 + | +LL | } //~ ERROR expected pattern, found `}` + | ^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/ui/issue-31845.rs b/src/test/ui/issue-31845.rs new file mode 100644 index 00000000000..514255e4676 --- /dev/null +++ b/src/test/ui/issue-31845.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Checks lexical scopes cannot see through normal module boundries + +fn f() { + fn g() {} + mod foo { + fn h() { + g(); //~ ERROR cannot find function `g` in this scope + } + } +} + +fn main() {} diff --git a/src/test/ui/issue-31845.stderr b/src/test/ui/issue-31845.stderr new file mode 100644 index 00000000000..9fb8f2ead87 --- /dev/null +++ b/src/test/ui/issue-31845.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `g` in this scope + --> $DIR/issue-31845.rs:17:12 + | +LL | g(); //~ ERROR cannot find function `g` in this scope + | ^ did you mean `h`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/issue-31910.rs b/src/test/ui/issue-31910.rs new file mode 100644 index 00000000000..7524049c5df --- /dev/null +++ b/src/test/ui/issue-31910.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +enum Enum { + X = Trait::Number, + //~^ ERROR mismatched types + //~| expected isize, found i32 +} + +trait Trait { + const Number: i32 = 1; +} + +fn main() {} diff --git a/src/test/ui/issue-31910.stderr b/src/test/ui/issue-31910.stderr new file mode 100644 index 00000000000..da5aa154450 --- /dev/null +++ b/src/test/ui/issue-31910.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/issue-31910.rs:13:9 + | +LL | X = Trait::Number, + | ^^^^^^^^^^^^^ expected isize, found i32 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-31924-non-snake-ffi.rs b/src/test/ui/issue-31924-non-snake-ffi.rs new file mode 100644 index 00000000000..d9ce1159c0e --- /dev/null +++ b/src/test/ui/issue-31924-non-snake-ffi.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![deny(non_snake_case)] + +#[no_mangle] +pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-31924-non-snake-ffi.stderr b/src/test/ui/issue-31924-non-snake-ffi.stderr new file mode 100644 index 00000000000..2aaaa1578a5 --- /dev/null +++ b/src/test/ui/issue-31924-non-snake-ffi.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-31924-non-snake-ffi.rs:18:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-32004.rs b/src/test/ui/issue-32004.rs new file mode 100644 index 00000000000..7e1f4c28d21 --- /dev/null +++ b/src/test/ui/issue-32004.rs @@ -0,0 +1,29 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + Bar(i32), + Baz +} + +struct S; + +fn main() { + match Foo::Baz { + Foo::Bar => {} + //~^ ERROR expected unit struct/variant or constant, found tuple variant `Foo::Bar` + _ => {} + } + + match S { + S(()) => {} + //~^ ERROR expected tuple struct/variant, found unit struct `S` + } +} diff --git a/src/test/ui/issue-32004.stderr b/src/test/ui/issue-32004.stderr new file mode 100644 index 00000000000..c409d4bb612 --- /dev/null +++ b/src/test/ui/issue-32004.stderr @@ -0,0 +1,17 @@ +error[E0532]: expected unit struct/variant or constant, found tuple variant `Foo::Bar` + --> $DIR/issue-32004.rs:20:9 + | +LL | Foo::Bar => {} + | ^^^^^--- + | | + | did you mean `Baz`? + +error[E0532]: expected tuple struct/variant, found unit struct `S` + --> $DIR/issue-32004.rs:26:9 + | +LL | S(()) => {} + | ^ not a tuple struct/variant + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-32086.rs b/src/test/ui/issue-32086.rs new file mode 100644 index 00000000000..dd236b76a67 --- /dev/null +++ b/src/test/ui/issue-32086.rs @@ -0,0 +1,17 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S(u8); +const C: S = S(10); + +fn main() { + let C(a) = S(11); //~ ERROR expected tuple struct/variant, found constant `C` + let C(..) = S(11); //~ ERROR expected tuple struct/variant, found constant `C` +} diff --git a/src/test/ui/issue-32086.stderr b/src/test/ui/issue-32086.stderr new file mode 100644 index 00000000000..28d21708b21 --- /dev/null +++ b/src/test/ui/issue-32086.stderr @@ -0,0 +1,15 @@ +error[E0532]: expected tuple struct/variant, found constant `C` + --> $DIR/issue-32086.rs:15:9 + | +LL | let C(a) = S(11); //~ ERROR expected tuple struct/variant, found constant `C` + | ^ did you mean `S`? + +error[E0532]: expected tuple struct/variant, found constant `C` + --> $DIR/issue-32086.rs:16:9 + | +LL | let C(..) = S(11); //~ ERROR expected tuple struct/variant, found constant `C` + | ^ did you mean `S`? + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-32119.rs b/src/test/ui/issue-32119.rs new file mode 100644 index 00000000000..e630a01a593 --- /dev/null +++ b/src/test/ui/issue-32119.rs @@ -0,0 +1,29 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(dead_code)] + +pub type T = (); +mod foo { pub use super::T; } +mod bar { pub use super::T; } + +pub use foo::*; +pub use bar::*; + +mod baz { + pub type T = (); + mod foo { pub use super::T as S; } + mod bar { pub use super::foo::S as T; } + pub use self::bar::*; +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-32119.stderr b/src/test/ui/issue-32119.stderr new file mode 100644 index 00000000000..04276ec1ffd --- /dev/null +++ b/src/test/ui/issue-32119.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-32119.rs:29:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-3214.rs b/src/test/ui/issue-3214.rs new file mode 100644 index 00000000000..9a769c39eca --- /dev/null +++ b/src/test/ui/issue-3214.rs @@ -0,0 +1,21 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() { + struct foo { + x: T, //~ ERROR can't use type parameters from outer function + } + + impl Drop for foo { + //~^ ERROR wrong number of type arguments + fn drop(&mut self) {} + } +} +fn main() { } diff --git a/src/test/ui/issue-3214.stderr b/src/test/ui/issue-3214.stderr new file mode 100644 index 00000000000..1298e4a007d --- /dev/null +++ b/src/test/ui/issue-3214.stderr @@ -0,0 +1,21 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/issue-3214.rs:13:12 + | +LL | fn foo() { + | --- - type variable from outer function + | | + | try adding a local type parameter in this method instead +LL | struct foo { +LL | x: T, //~ ERROR can't use type parameters from outer function + | ^ use of type variable from outer function + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/issue-3214.rs:16:22 + | +LL | impl Drop for foo { + | ^^^^^^ expected no type arguments + +error: aborting due to 2 previous errors + +Some errors occurred: E0244, E0401. +For more information about an error, try `rustc --explain E0244`. diff --git a/src/test/ui/issue-32201.rs b/src/test/ui/issue-32201.rs new file mode 100644 index 00000000000..bf9f8ecbc80 --- /dev/null +++ b/src/test/ui/issue-32201.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern { + fn foo(a: i32, ...); +} + +fn bar(_: *const u8) {} + +fn main() { + unsafe { + foo(0, bar); + //~^ ERROR can't pass `fn(*const u8) {bar}` to variadic function + //~| HELP cast the value to `fn(*const u8)` + } +} diff --git a/src/test/ui/issue-32201.stderr b/src/test/ui/issue-32201.stderr new file mode 100644 index 00000000000..986c2f0890c --- /dev/null +++ b/src/test/ui/issue-32201.stderr @@ -0,0 +1,9 @@ +error[E0617]: can't pass `fn(*const u8) {bar}` to variadic function + --> $DIR/issue-32201.rs:19:16 + | +LL | foo(0, bar); + | ^^^ help: cast the value to `fn(*const u8)`: `bar as fn(*const u8)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0617`. diff --git a/src/test/ui/issue-32222.rs b/src/test/ui/issue-32222.rs new file mode 100644 index 00000000000..b3b34f4b0ef --- /dev/null +++ b/src/test/ui/issue-32222.rs @@ -0,0 +1,34 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +mod foo { + pub fn bar() {} +} + +pub use foo::*; +use b::bar; + +mod foobar { + use super::*; +} + +mod a { + pub mod bar {} +} + +mod b { + pub use a::bar; +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-32222.stderr b/src/test/ui/issue-32222.stderr new file mode 100644 index 00000000000..ba2c5396e4d --- /dev/null +++ b/src/test/ui/issue-32222.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-32222.rs:34:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-32323.rs b/src/test/ui/issue-32323.rs new file mode 100644 index 00000000000..e5cb8130327 --- /dev/null +++ b/src/test/ui/issue-32323.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Tr<'a> { + type Out; +} + +pub fn f<'a, T: Tr<'a>>() -> >::Out {} +//~^ ERROR mismatched types + +pub fn main() {} diff --git a/src/test/ui/issue-32323.stderr b/src/test/ui/issue-32323.stderr new file mode 100644 index 00000000000..09ac1553b3a --- /dev/null +++ b/src/test/ui/issue-32323.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-32323.rs:15:49 + | +LL | pub fn f<'a, T: Tr<'a>>() -> >::Out {} + | ^^ expected associated type, found () + | + = note: expected type `>::Out` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-32377.rs b/src/test/ui/issue-32377.rs new file mode 100644 index 00000000000..5091ba4ee1a --- /dev/null +++ b/src/test/ui/issue-32377.rs @@ -0,0 +1,27 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::mem; +use std::marker::PhantomData; + +trait Foo { + type Error; +} + +struct Bar { + stream: PhantomData, +} + +fn foo(x: [usize; 2]) -> Bar { + unsafe { mem::transmute(x) } + //~^ ERROR transmute called with types of different sizes +} + +fn main() {} diff --git a/src/test/ui/issue-32377.stderr b/src/test/ui/issue-32377.stderr new file mode 100644 index 00000000000..a0698885caa --- /dev/null +++ b/src/test/ui/issue-32377.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-32377.rs:23:14 + | +LL | unsafe { mem::transmute(x) } + | ^^^^^^^^^^^^^^ + | + = note: source type: [usize; 2] (128 bits) + = note: target type: Bar (0 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/issue-32655.rs b/src/test/ui/issue-32655.rs new file mode 100644 index 00000000000..25ecd5d0862 --- /dev/null +++ b/src/test/ui/issue-32655.rs @@ -0,0 +1,32 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(dead_code)] +#![feature(rustc_attrs)] + +macro_rules! foo ( + () => ( + #[derive_Clone] //~ ERROR attributes of the form + struct T; + ); +); + +macro_rules! bar ( + ($e:item) => ($e) +); + +foo!(); + +bar!( + #[derive_Clone] //~ ERROR attributes of the form + struct S; +); + +fn main() {} diff --git a/src/test/ui/issue-32655.stderr b/src/test/ui/issue-32655.stderr new file mode 100644 index 00000000000..a1323808a91 --- /dev/null +++ b/src/test/ui/issue-32655.stderr @@ -0,0 +1,22 @@ +error[E0658]: attributes of the form `#[derive_*]` are reserved for the compiler (see issue #29644) + --> $DIR/issue-32655.rs:16:9 + | +LL | #[derive_Clone] //~ ERROR attributes of the form + | ^^^^^^^^^^^^^^^ +... +LL | foo!(); + | ------- in this macro invocation + | + = help: add #![feature(custom_derive)] to the crate attributes to enable + +error[E0658]: attributes of the form `#[derive_*]` are reserved for the compiler (see issue #29644) + --> $DIR/issue-32655.rs:28:5 + | +LL | #[derive_Clone] //~ ERROR attributes of the form + | ^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_derive)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issue-32709.rs b/src/test/ui/issue-32709.rs new file mode 100644 index 00000000000..09538818dcd --- /dev/null +++ b/src/test/ui/issue-32709.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure that the span of try shorthand does not include the trailing +// semicolon; +fn a() -> Result { + Err(5)?; //~ ERROR 14:5: 14:12 + Ok(1) +} + +fn main() {} diff --git a/src/test/ui/issue-32709.stderr b/src/test/ui/issue-32709.stderr new file mode 100644 index 00000000000..8da4be2ba2b --- /dev/null +++ b/src/test/ui/issue-32709.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `(): std::convert::From<{integer}>` is not satisfied + --> $DIR/issue-32709.rs:14:5 + | +LL | Err(5)?; //~ ERROR 14:5: 14:12 + | ^^^^^^^ the trait `std::convert::From<{integer}>` is not implemented for `()` + | + = note: required by `std::convert::From::from` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-32782.rs b/src/test/ui/issue-32782.rs new file mode 100644 index 00000000000..696ea0ef547 --- /dev/null +++ b/src/test/ui/issue-32782.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! bar ( + () => () +); + +macro_rules! foo ( + () => ( + #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps + bar!(); + ); +); + +foo!(); +fn main() {} diff --git a/src/test/ui/issue-32782.stderr b/src/test/ui/issue-32782.stderr new file mode 100644 index 00000000000..8b486000a45 --- /dev/null +++ b/src/test/ui/issue-32782.stderr @@ -0,0 +1,14 @@ +error[E0658]: allow_internal_unstable side-steps feature gating and stability checks + --> $DIR/issue-32782.rs:17:9 + | +LL | #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | foo!(); + | ------- in this macro invocation + | + = help: add #![feature(allow_internal_unstable)] 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/issue-32797.rs b/src/test/ui/issue-32797.rs new file mode 100644 index 00000000000..2c54ed3e857 --- /dev/null +++ b/src/test/ui/issue-32797.rs @@ -0,0 +1,24 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +pub use bar::*; +mod bar { + pub use super::*; +} + +pub use baz::*; +mod baz { + pub use main as f; +} + +#[rustc_error] +pub fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-32797.stderr b/src/test/ui/issue-32797.stderr new file mode 100644 index 00000000000..8e1430e505d --- /dev/null +++ b/src/test/ui/issue-32797.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-32797.rs:24:1 + | +LL | pub fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-32829.rs b/src/test/ui/issue-32829.rs new file mode 100644 index 00000000000..9ac70882ca2 --- /dev/null +++ b/src/test/ui/issue-32829.rs @@ -0,0 +1,17 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern: calls in statics are limited + +static S : u64 = { { panic!("foo"); 0 } }; + +fn main() { + println!("{:?}", S); +} diff --git a/src/test/ui/issue-32829.stderr b/src/test/ui/issue-32829.stderr new file mode 100644 index 00000000000..fc7d356411a --- /dev/null +++ b/src/test/ui/issue-32829.stderr @@ -0,0 +1,11 @@ +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-32829.rs:13:22 + | +LL | static S : u64 = { { panic!("foo"); 0 } }; + | ^^^^^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-32833.rs b/src/test/ui/issue-32833.rs new file mode 100644 index 00000000000..41383e93603 --- /dev/null +++ b/src/test/ui/issue-32833.rs @@ -0,0 +1,17 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use bar::Foo; //~ ERROR unresolved import `bar::Foo` [E0432] + //~^ no `Foo` in `bar` +mod bar { + use Foo; +} + +fn main() {} diff --git a/src/test/ui/issue-32833.stderr b/src/test/ui/issue-32833.stderr new file mode 100644 index 00000000000..11af5d56766 --- /dev/null +++ b/src/test/ui/issue-32833.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `bar::Foo` + --> $DIR/issue-32833.rs:11:5 + | +LL | use bar::Foo; //~ ERROR unresolved import `bar::Foo` [E0432] + | ^^^^^^^^ no `Foo` in `bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-32922.rs b/src/test/ui/issue-32922.rs new file mode 100644 index 00000000000..317a47156c1 --- /dev/null +++ b/src/test/ui/issue-32922.rs @@ -0,0 +1,41 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +macro_rules! foo { () => { + let x = 1; + macro_rules! bar { () => {x} } + let _ = bar!(); +}} + +macro_rules! m { // test issue #31856 + ($n:ident) => ( + let a = 1; + let $n = a; + ) +} + +macro_rules! baz { + ($i:ident) => { + let mut $i = 2; + $i = $i + 1; + } +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + foo! {}; + bar! {}; + + let mut a = true; + baz!(a); +} diff --git a/src/test/ui/issue-32922.stderr b/src/test/ui/issue-32922.stderr new file mode 100644 index 00000000000..c1e80b0eb78 --- /dev/null +++ b/src/test/ui/issue-32922.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/issue-32922.rs:35:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | foo! {}; +LL | | bar! {}; +LL | | +LL | | let mut a = true; +LL | | baz!(a); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-32963.rs b/src/test/ui/issue-32963.rs new file mode 100644 index 00000000000..24db822f89c --- /dev/null +++ b/src/test/ui/issue-32963.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::mem; + +trait Misc {} + +fn size_of_copy() -> usize { mem::size_of::() } + +fn main() { + size_of_copy::(); + //~^ ERROR only auto traits can be used as additional traits in a trait object + //~| ERROR the trait bound `dyn Misc: std::marker::Copy` is not satisfied +} diff --git a/src/test/ui/issue-32963.stderr b/src/test/ui/issue-32963.stderr new file mode 100644 index 00000000000..dff7c9f2b8b --- /dev/null +++ b/src/test/ui/issue-32963.stderr @@ -0,0 +1,22 @@ +error[E0225]: only auto traits can be used as additional traits in a trait object + --> $DIR/issue-32963.rs:18:25 + | +LL | size_of_copy::(); + | ^^^^ non-auto additional trait + +error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied + --> $DIR/issue-32963.rs:18:5 + | +LL | size_of_copy::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc` + | +note: required by `size_of_copy` + --> $DIR/issue-32963.rs:15:1 + | +LL | fn size_of_copy() -> usize { mem::size_of::() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0225, E0277. +For more information about an error, try `rustc --explain E0225`. diff --git a/src/test/ui/issue-32995-2.rs b/src/test/ui/issue-32995-2.rs new file mode 100644 index 00000000000..18424fcc9e0 --- /dev/null +++ b/src/test/ui/issue-32995-2.rs @@ -0,0 +1,28 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused)] + +fn main() { + { fn f() {} } + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted + + { fn f() -> impl ::std::marker()::Send { } } + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted +} + +#[derive(Clone)] +struct X; + +impl ::std::marker()::Copy for X {} +//~^ ERROR parenthesized parameters may only be used with a trait +//~| WARN previously accepted diff --git a/src/test/ui/issue-32995-2.stderr b/src/test/ui/issue-32995-2.stderr new file mode 100644 index 00000000000..68eda14f81d --- /dev/null +++ b/src/test/ui/issue-32995-2.stderr @@ -0,0 +1,30 @@ +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995-2.rs:14:28 + | +LL | { fn f() {} } + | ^^ + | + = note: #[deny(parenthesized_params_in_types_and_modules)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995-2.rs:18:35 + | +LL | { fn f() -> impl ::std::marker()::Send { } } + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995-2.rs:26:19 + | +LL | impl ::std::marker()::Copy for X {} + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/issue-32995.rs b/src/test/ui/issue-32995.rs new file mode 100644 index 00000000000..ffbd0c0c22a --- /dev/null +++ b/src/test/ui/issue-32995.rs @@ -0,0 +1,43 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused)] + +fn main() { + let x: usize() = 1; + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted + + let b: ::std::boxed()::Box<_> = Box::new(1); + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted + + let p = ::std::str::()::from_utf8(b"foo").unwrap(); + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted + + let p = ::std::str::from_utf8::()(b"foo").unwrap(); + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted + + let o : Box<::std::marker()::Send> = Box::new(1); + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted + + let o : Box = Box::new(1); + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted +} + +fn foo() { + let d : X() = Default::default(); + //~^ ERROR parenthesized parameters may only be used with a trait + //~| WARN previously accepted +} diff --git a/src/test/ui/issue-32995.stderr b/src/test/ui/issue-32995.stderr new file mode 100644 index 00000000000..f427964135c --- /dev/null +++ b/src/test/ui/issue-32995.stderr @@ -0,0 +1,66 @@ +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:14:17 + | +LL | let x: usize() = 1; + | ^^ + | + = note: #[deny(parenthesized_params_in_types_and_modules)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:18:24 + | +LL | let b: ::std::boxed()::Box<_> = Box::new(1); + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:22:23 + | +LL | let p = ::std::str::()::from_utf8(b"foo").unwrap(); + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:26:34 + | +LL | let p = ::std::str::from_utf8::()(b"foo").unwrap(); + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:30:30 + | +LL | let o : Box<::std::marker()::Send> = Box::new(1); + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:34:37 + | +LL | let o : Box = Box::new(1); + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: parenthesized parameters may only be used with a trait + --> $DIR/issue-32995.rs:40:14 + | +LL | let d : X() = Default::default(); + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42238 + +error: aborting due to 7 previous errors + diff --git a/src/test/ui/issue-33241.rs b/src/test/ui/issue-33241.rs new file mode 100644 index 00000000000..6a411b4c59c --- /dev/null +++ b/src/test/ui/issue-33241.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +use std::fmt; + +// CoerceUnsized is not implemented for tuples. You can still create +// an unsized tuple by transmuting a trait object. +fn any() -> T { unreachable!() } + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let t: &(u8, fmt::Debug) = any(); + println!("{:?}", &t.1); +} diff --git a/src/test/ui/issue-33241.stderr b/src/test/ui/issue-33241.stderr new file mode 100644 index 00000000000..1b6577dc41f --- /dev/null +++ b/src/test/ui/issue-33241.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/issue-33241.rs:20:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let t: &(u8, fmt::Debug) = any(); +LL | | println!("{:?}", &t.1); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-33293.rs b/src/test/ui/issue-33293.rs new file mode 100644 index 00000000000..bed577b8b9d --- /dev/null +++ b/src/test/ui/issue-33293.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + match 0 { + aaa::bbb(_) => () + //~^ ERROR failed to resolve. Use of undeclared type or module `aaa` + }; +} diff --git a/src/test/ui/issue-33293.stderr b/src/test/ui/issue-33293.stderr new file mode 100644 index 00000000000..e94979b6da4 --- /dev/null +++ b/src/test/ui/issue-33293.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `aaa` + --> $DIR/issue-33293.rs:13:9 + | +LL | aaa::bbb(_) => () + | ^^^ Use of undeclared type or module `aaa` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/issue-3344.rs b/src/test/ui/issue-3344.rs new file mode 100644 index 00000000000..73532cb768a --- /dev/null +++ b/src/test/ui/issue-3344.rs @@ -0,0 +1,17 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(PartialEq)] +struct thing(usize); +impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp` + fn le(&self, other: &thing) -> bool { true } + fn ge(&self, other: &thing) -> bool { true } +} +fn main() {} diff --git a/src/test/ui/issue-3344.stderr b/src/test/ui/issue-3344.stderr new file mode 100644 index 00000000000..eb6caa7307e --- /dev/null +++ b/src/test/ui/issue-3344.stderr @@ -0,0 +1,11 @@ +error[E0046]: not all trait items implemented, missing: `partial_cmp` + --> $DIR/issue-3344.rs:13:1 + | +LL | impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `partial_cmp` in implementation + | + = note: `partial_cmp` from trait: `fn(&Self, &Rhs) -> std::option::Option` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/ui/issue-33464.rs b/src/test/ui/issue-33464.rs new file mode 100644 index 00000000000..b7dbaf20eca --- /dev/null +++ b/src/test/ui/issue-33464.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure that the spans of import errors are correct. + +use abc::one_el; +//~^ ERROR 13:5: 13:8 +use abc::{a, bbb, cccccc}; +//~^ ERROR 15:5: 15:8 +use a_very_long_name::{el, el2}; +//~^ ERROR 17:5: 17:21 + +fn main() {} diff --git a/src/test/ui/issue-33464.stderr b/src/test/ui/issue-33464.stderr new file mode 100644 index 00000000000..b70fff01c9e --- /dev/null +++ b/src/test/ui/issue-33464.stderr @@ -0,0 +1,21 @@ +error[E0432]: unresolved import `abc` + --> $DIR/issue-33464.rs:13:5 + | +LL | use abc::one_el; + | ^^^ Maybe a missing `extern crate abc;`? + +error[E0432]: unresolved import `abc` + --> $DIR/issue-33464.rs:15:5 + | +LL | use abc::{a, bbb, cccccc}; + | ^^^ Maybe a missing `extern crate abc;`? + +error[E0432]: unresolved import `a_very_long_name` + --> $DIR/issue-33464.rs:17:5 + | +LL | use a_very_long_name::{el, el2}; + | ^^^^^^^^^^^^^^^^ Maybe a missing `extern crate a_very_long_name;`? + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-33504.rs b/src/test/ui/issue-33504.rs new file mode 100644 index 00000000000..1e1994357c7 --- /dev/null +++ b/src/test/ui/issue-33504.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Shadowing a unit-like enum in a closure + +struct Test; + +fn main() { + || { + let Test = 1; //~ ERROR mismatched types + }; +} diff --git a/src/test/ui/issue-33504.stderr b/src/test/ui/issue-33504.stderr new file mode 100644 index 00000000000..ecf8076b2b3 --- /dev/null +++ b/src/test/ui/issue-33504.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-33504.rs:17:13 + | +LL | let Test = 1; //~ ERROR mismatched types + | ^^^^ expected integral variable, found struct `Test` + | + = note: expected type `{integer}` + found type `Test` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-33571.rs b/src/test/ui/issue-33571.rs new file mode 100644 index 00000000000..5dfc41c8f4a --- /dev/null +++ b/src/test/ui/issue-33571.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Clone, + Sync, //~ ERROR this unsafe trait should be implemented explicitly + Copy)] +enum Foo {} diff --git a/src/test/ui/issue-33571.stderr b/src/test/ui/issue-33571.stderr new file mode 100644 index 00000000000..be45f377c1f --- /dev/null +++ b/src/test/ui/issue-33571.stderr @@ -0,0 +1,8 @@ +error: this unsafe trait should be implemented explicitly + --> $DIR/issue-33571.rs:12:10 + | +LL | Sync, //~ ERROR this unsafe trait should be implemented explicitly + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-33819.nll.stderr b/src/test/ui/issue-33819.nll.stderr new file mode 100644 index 00000000000..88728207921 --- /dev/null +++ b/src/test/ui/issue-33819.nll.stderr @@ -0,0 +1,12 @@ +error[E0596]: cannot borrow immutable item `v` as mutable + --> $DIR/issue-33819.rs:13:34 + | +LL | Some(ref v) => { let a = &mut v; }, + | ^^^^^^ + | | + | cannot borrow as mutable + | try removing `&mut` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/issue-33819.rs b/src/test/ui/issue-33819.rs new file mode 100644 index 00000000000..499e7e54947 --- /dev/null +++ b/src/test/ui/issue-33819.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +fn main() { + let mut op = Some(2); + match op { + Some(ref v) => { let a = &mut v; }, + //~^ ERROR:cannot borrow immutable + //~| cannot borrow mutably + None => {}, + } +} diff --git a/src/test/ui/issue-33819.stderr b/src/test/ui/issue-33819.stderr new file mode 100644 index 00000000000..bb8a542b12b --- /dev/null +++ b/src/test/ui/issue-33819.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow immutable local variable `v` as mutable + --> $DIR/issue-33819.rs:13:39 + | +LL | Some(ref v) => { let a = &mut v; }, + | ^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/issue-34028.rs b/src/test/ui/issue-34028.rs new file mode 100644 index 00000000000..117ab18a115 --- /dev/null +++ b/src/test/ui/issue-34028.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +macro_rules! m { + () => { #[cfg(any())] fn f() {} } +} + +trait T {} +impl T for () { m!(); } + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-34028.stderr b/src/test/ui/issue-34028.stderr new file mode 100644 index 00000000000..b715fa84f60 --- /dev/null +++ b/src/test/ui/issue-34028.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-34028.rs:21:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-34171.rs b/src/test/ui/issue-34171.rs new file mode 100644 index 00000000000..30dd34ae9a0 --- /dev/null +++ b/src/test/ui/issue-34171.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +macro_rules! null { ($i:tt) => {} } +macro_rules! apply_null { + ($i:item) => { null! { $i } } +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + apply_null!(#[cfg(all())] fn f() {}); +} diff --git a/src/test/ui/issue-34171.stderr b/src/test/ui/issue-34171.stderr new file mode 100644 index 00000000000..cb8cfbd8599 --- /dev/null +++ b/src/test/ui/issue-34171.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/issue-34171.rs:19:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | apply_null!(#[cfg(all())] fn f() {}); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-34222-1.rs b/src/test/ui/issue-34222-1.rs new file mode 100644 index 00000000000..6c85414860f --- /dev/null +++ b/src/test/ui/issue-34222-1.rs @@ -0,0 +1,13 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + /// comment //~ ERROR found a documentation comment that doesn't document anything +} diff --git a/src/test/ui/issue-34222-1.stderr b/src/test/ui/issue-34222-1.stderr new file mode 100644 index 00000000000..ef68d41da3c --- /dev/null +++ b/src/test/ui/issue-34222-1.stderr @@ -0,0 +1,11 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/issue-34222-1.rs:12:5 + | +LL | /// comment //~ ERROR found a documentation comment that doesn't document anything + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = 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/issue-34334.rs b/src/test/ui/issue-34334.rs new file mode 100644 index 00000000000..a752a36ade2 --- /dev/null +++ b/src/test/ui/issue-34334.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main () { + let sr: Vec<(u32, _, _) = vec![]; //~ ERROR expected one of `,` or `>`, found `=` + let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect(); +} diff --git a/src/test/ui/issue-34334.stderr b/src/test/ui/issue-34334.stderr new file mode 100644 index 00000000000..240df196ae7 --- /dev/null +++ b/src/test/ui/issue-34334.stderr @@ -0,0 +1,10 @@ +error: expected one of `,` or `>`, found `=` + --> $DIR/issue-34334.rs:12:29 + | +LL | let sr: Vec<(u32, _, _) = vec![]; //~ ERROR expected one of `,` or `>`, found `=` + | -- ^ expected one of `,` or `>` here + | | + | while parsing the type for `sr` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-34349.rs b/src/test/ui/issue-34349.rs new file mode 100644 index 00000000000..591753181db --- /dev/null +++ b/src/test/ui/issue-34349.rs @@ -0,0 +1,32 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This is a regression test for a problem encountered around upvar +// inference and trait caching: in particular, we were entering a +// temporary closure kind during inference, and then caching results +// based on that temporary kind, which led to no error being reported +// in this particular test. + +fn main() { + let inc = || {}; + inc(); + + fn apply(f: F) where F: Fn() { + f() + } + + let mut farewell = "goodbye".to_owned(); + let diary = || { //~ ERROR E0525 + farewell.push_str("!!!"); + println!("Then I screamed {}.", farewell); + }; + + apply(diary); +} diff --git a/src/test/ui/issue-34349.stderr b/src/test/ui/issue-34349.stderr new file mode 100644 index 00000000000..8683962b24d --- /dev/null +++ b/src/test/ui/issue-34349.stderr @@ -0,0 +1,14 @@ +error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut` + --> $DIR/issue-34349.rs:26:17 + | +LL | let diary = || { //~ ERROR E0525 + | ^^ this closure implements `FnMut`, not `Fn` +LL | farewell.push_str("!!!"); + | -------- closure is `FnMut` because it mutates the variable `farewell` here +... +LL | apply(diary); + | ----- the requirement to implement `Fn` derives from here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0525`. diff --git a/src/test/ui/issue-34373.rs b/src/test/ui/issue-34373.rs new file mode 100644 index 00000000000..4d7238ad76f --- /dev/null +++ b/src/test/ui/issue-34373.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(warnings)] + +trait Trait { + fn foo(_: T) {} +} + +pub struct Foo>>; //~ ERROR cycle detected +type DefaultFoo = Foo; + +fn main() { +} diff --git a/src/test/ui/issue-34373.stderr b/src/test/ui/issue-34373.stderr new file mode 100644 index 00000000000..ea80111b5e2 --- /dev/null +++ b/src/test/ui/issue-34373.stderr @@ -0,0 +1,16 @@ +error[E0391]: cycle detected when processing `Foo::T` + --> $DIR/issue-34373.rs:17:30 + | +LL | pub struct Foo>>; //~ ERROR cycle detected + | ^^^^^^^^^^ + | +note: ...which requires processing `DefaultFoo`... + --> $DIR/issue-34373.rs:18:19 + | +LL | type DefaultFoo = Foo; + | ^^^ + = note: ...which again requires processing `Foo::T`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-34418.rs b/src/test/ui/issue-34418.rs new file mode 100644 index 00000000000..6bc0add2205 --- /dev/null +++ b/src/test/ui/issue-34418.rs @@ -0,0 +1,31 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +macro_rules! make_item { + () => { fn f() {} } +} + +macro_rules! make_stmt { + () => { let x = 0; } +} + +fn f() { + make_item! {} +} + +fn g() { + make_stmt! {} +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-34418.stderr b/src/test/ui/issue-34418.stderr new file mode 100644 index 00000000000..4cb5ec1ae3b --- /dev/null +++ b/src/test/ui/issue-34418.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-34418.rs:31:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-3477.rs b/src/test/ui/issue-3477.rs new file mode 100644 index 00000000000..0bad7372a12 --- /dev/null +++ b/src/test/ui/issue-3477.rs @@ -0,0 +1,15 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let _p: char = 100; + //~^ ERROR mismatched types + //~| expected char, found u8 +} diff --git a/src/test/ui/issue-3477.stderr b/src/test/ui/issue-3477.stderr new file mode 100644 index 00000000000..4207828693a --- /dev/null +++ b/src/test/ui/issue-3477.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/issue-3477.rs:12:20 + | +LL | let _p: char = 100; + | ^^^ expected char, found u8 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-34839.rs b/src/test/ui/issue-34839.rs new file mode 100644 index 00000000000..be7e7820020 --- /dev/null +++ b/src/test/ui/issue-34839.rs @@ -0,0 +1,31 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(dead_code)] + +trait RegularExpression: Sized { + type Text; +} + +struct ExecNoSyncStr<'a>(&'a u8); + +impl<'c> RegularExpression for ExecNoSyncStr<'c> { + type Text = u8; +} + +struct FindCaptures<'t, R>(&'t R::Text) where R: RegularExpression, R::Text: 't; + +enum FindCapturesInner<'r, 't> { + Dynamic(FindCaptures<'t, ExecNoSyncStr<'r>>), +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-34839.stderr b/src/test/ui/issue-34839.stderr new file mode 100644 index 00000000000..538cc7a581b --- /dev/null +++ b/src/test/ui/issue-34839.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-34839.rs:31:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-35075.rs b/src/test/ui/issue-35075.rs new file mode 100644 index 00000000000..9943cfb9bca --- /dev/null +++ b/src/test/ui/issue-35075.rs @@ -0,0 +1,19 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Bar { + inner: Foo //~ ERROR cannot find type `Foo` in this scope +} + +enum Baz { + Foo(Foo) //~ ERROR cannot find type `Foo` in this scope +} + +fn main() {} diff --git a/src/test/ui/issue-35075.stderr b/src/test/ui/issue-35075.stderr new file mode 100644 index 00000000000..9b2f17f038b --- /dev/null +++ b/src/test/ui/issue-35075.stderr @@ -0,0 +1,21 @@ +error[E0412]: cannot find type `Foo` in this scope + --> $DIR/issue-35075.rs:12:12 + | +LL | inner: Foo //~ ERROR cannot find type `Foo` in this scope + | ^^^--- + | | + | not found in this scope + | help: you can try using the variant's enum: `Baz` + +error[E0412]: cannot find type `Foo` in this scope + --> $DIR/issue-35075.rs:16:9 + | +LL | Foo(Foo) //~ ERROR cannot find type `Foo` in this scope + | ^^^--- + | | + | not found in this scope + | help: you can try using the variant's enum: `Baz` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/issue-3521-2.rs b/src/test/ui/issue-3521-2.rs new file mode 100644 index 00000000000..1742cb4fb72 --- /dev/null +++ b/src/test/ui/issue-3521-2.rs @@ -0,0 +1,18 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let foo = 100; + + static y: isize = foo + 1; + //~^ ERROR can't capture dynamic environment + + println!("{}", y); +} diff --git a/src/test/ui/issue-3521-2.stderr b/src/test/ui/issue-3521-2.stderr new file mode 100644 index 00000000000..07c37fadbba --- /dev/null +++ b/src/test/ui/issue-3521-2.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3521-2.rs:14:23 + | +LL | static y: isize = foo + 1; + | ^^^ + | + = 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/issue-3521.rs b/src/test/ui/issue-3521.rs new file mode 100644 index 00000000000..78af11a0b58 --- /dev/null +++ b/src/test/ui/issue-3521.rs @@ -0,0 +1,21 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let foo = 100; + + #[derive(Debug)] + enum Stuff { + Bar = foo + //~^ ERROR attempt to use a non-constant value in a constant + } + + println!("{:?}", Stuff::Bar); +} diff --git a/src/test/ui/issue-3521.stderr b/src/test/ui/issue-3521.stderr new file mode 100644 index 00000000000..f4a1ef5cefa --- /dev/null +++ b/src/test/ui/issue-3521.stderr @@ -0,0 +1,9 @@ +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/issue-3521.rs:16:15 + | +LL | Bar = 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/issue-35450.rs b/src/test/ui/issue-35450.rs new file mode 100644 index 00000000000..5f54f269c6c --- /dev/null +++ b/src/test/ui/issue-35450.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! m { ($($t:tt)*) => { $($t)* } } + +fn main() { + m!($t); //~ ERROR expected expression +} diff --git a/src/test/ui/issue-35450.stderr b/src/test/ui/issue-35450.stderr new file mode 100644 index 00000000000..b8fc7d2054c --- /dev/null +++ b/src/test/ui/issue-35450.stderr @@ -0,0 +1,8 @@ +error: expected expression, found `$` + --> $DIR/issue-35450.rs:14:8 + | +LL | m!($t); //~ ERROR expected expression + | ^ expected expression + +error: aborting due to previous error + diff --git a/src/test/ui/issue-35570.rs b/src/test/ui/issue-35570.rs new file mode 100644 index 00000000000..092bf00ddd6 --- /dev/null +++ b/src/test/ui/issue-35570.rs @@ -0,0 +1,40 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +use std::mem; + +trait Trait1 {} +trait Trait2<'a> { + type Ty; +} + +fn _ice(param: Box Trait1<<() as Trait2<'a>>::Ty>>) { + let _e: (usize, usize) = unsafe{mem::transmute(param)}; +} + +trait Lifetime<'a> { + type Out; +} +impl<'a> Lifetime<'a> for () { + type Out = &'a (); +} +fn foo<'a>(x: &'a ()) -> <() as Lifetime<'a>>::Out { + x +} + +fn takes_lifetime(_f: for<'a> fn(&'a ()) -> <() as Lifetime<'a>>::Out) { +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + takes_lifetime(foo); +} diff --git a/src/test/ui/issue-35570.stderr b/src/test/ui/issue-35570.stderr new file mode 100644 index 00000000000..349693f29d5 --- /dev/null +++ b/src/test/ui/issue-35570.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/issue-35570.rs:38:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | takes_lifetime(foo); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-35668.rs b/src/test/ui/issue-35668.rs new file mode 100644 index 00000000000..17fd77b6df3 --- /dev/null +++ b/src/test/ui/issue-35668.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn func<'a, T>(a: &'a [T]) -> impl Iterator { + a.iter().map(|a| a*a) + //~^ ERROR binary operation `*` cannot be applied to type `&T` +} + +fn main() { + let a = (0..30).collect::>(); + + for k in func(&a) { + println!("{}", k); + } +} diff --git a/src/test/ui/issue-35668.stderr b/src/test/ui/issue-35668.stderr new file mode 100644 index 00000000000..51d6b040240 --- /dev/null +++ b/src/test/ui/issue-35668.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `*` cannot be applied to type `&T` + --> $DIR/issue-35668.rs:12:22 + | +LL | a.iter().map(|a| a*a) + | ^^^ + | + = note: an implementation of `std::ops::Mul` might be missing for `&T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/ui/issue-35988.rs b/src/test/ui/issue-35988.rs new file mode 100644 index 00000000000..5909322ff1f --- /dev/null +++ b/src/test/ui/issue-35988.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum E { + V([Box]), + //~^ ERROR the size for values of type +} + +fn main() {} diff --git a/src/test/ui/issue-35988.stderr b/src/test/ui/issue-35988.stderr new file mode 100644 index 00000000000..35452fcf392 --- /dev/null +++ b/src/test/ui/issue-35988.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `[std::boxed::Box]` cannot be known at compilation time + --> $DIR/issue-35988.rs:12:7 + | +LL | V([Box]), + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[std::boxed::Box]` + = note: to learn more, visit + = note: no field of an enum variant may have a dynamically sized type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-3601.rs b/src/test/ui/issue-3601.rs new file mode 100644 index 00000000000..cc69a76e043 --- /dev/null +++ b/src/test/ui/issue-3601.rs @@ -0,0 +1,44 @@ +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_patterns)] +#![feature(box_syntax)] + +struct HTMLImageData { + image: Option +} + +struct ElementData { + kind: Box +} + +enum ElementKind { + HTMLImageElement(HTMLImageData) +} + +enum NodeKind { + Element(ElementData) +} + +struct NodeData { + kind: Box, +} + +fn main() { + let mut id = HTMLImageData { image: None }; + let ed = ElementData { kind: box ElementKind::HTMLImageElement(id) }; + let n = NodeData {kind : box NodeKind::Element(ed)}; + // n.b. span could be better + match n.kind { + box NodeKind::Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns + box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => { true } + }, + }; +} diff --git a/src/test/ui/issue-3601.stderr b/src/test/ui/issue-3601.stderr new file mode 100644 index 00000000000..6c28ccb2ee8 --- /dev/null +++ b/src/test/ui/issue-3601.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `_` not covered + --> $DIR/issue-3601.rs:40:44 + | +LL | box NodeKind::Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns + | ^^^^^^^ pattern `_` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-36082.ast.nll.stderr b/src/test/ui/issue-36082.ast.nll.stderr new file mode 100644 index 00000000000..cf280bd80b2 --- /dev/null +++ b/src/test/ui/issue-36082.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-36082.rs:23:19 + | +LL | let val: &_ = x.borrow().0; + | ^^^^^^^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough +... +LL | println!("{}", val); + | --- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-36082.ast.stderr b/src/test/ui/issue-36082.ast.stderr new file mode 100644 index 00000000000..b79958de5cb --- /dev/null +++ b/src/test/ui/issue-36082.ast.stderr @@ -0,0 +1,16 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-36082.rs:23:19 + | +LL | let val: &_ = x.borrow().0; + | ^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-36082.mir.stderr b/src/test/ui/issue-36082.mir.stderr new file mode 100644 index 00000000000..cf280bd80b2 --- /dev/null +++ b/src/test/ui/issue-36082.mir.stderr @@ -0,0 +1,14 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-36082.rs:23:19 + | +LL | let val: &_ = x.borrow().0; + | ^^^^^^^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough +... +LL | println!("{}", val); + | --- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-36082.rs b/src/test/ui/issue-36082.rs new file mode 100644 index 00000000000..ed6a2f85fbe --- /dev/null +++ b/src/test/ui/issue-36082.rs @@ -0,0 +1,34 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions: ast mir +//[mir]compile-flags: -Z borrowck=mir + +// FIXME(#49821) -- No tip about using a let binding + +use std::cell::RefCell; + +fn main() { + let mut r = 0; + let s = 0; + let x = RefCell::new((&mut r,s)); + + let val: &_ = x.borrow().0; + //[ast]~^ ERROR borrowed value does not live long enough [E0597] + //[ast]~| NOTE temporary value dropped here while still borrowed + //[ast]~| NOTE temporary value does not live long enough + //[ast]~| NOTE consider using a `let` binding to increase its lifetime + //[mir]~^^^^^ ERROR borrowed value does not live long enough [E0597] + //[mir]~| NOTE temporary value does not live long enough + //[mir]~| NOTE temporary value only lives until here + println!("{}", val); + //[mir]~^ borrow later used here +} +//[ast]~^ NOTE temporary value needs to live until here diff --git a/src/test/ui/issue-36116.rs b/src/test/ui/issue-36116.rs new file mode 100644 index 00000000000..3afbfa61984 --- /dev/null +++ b/src/test/ui/issue-36116.rs @@ -0,0 +1,37 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Unnecessary path disambiguator is ok + +#![feature(rustc_attrs)] +#![allow(unused)] + +macro_rules! m { + ($p: path) => { + let _ = $p(0); + let _: $p; + } +} + +struct Foo { + _a: T, +} + +struct S(T); + +fn f() { + let f = Some(Foo { _a: 42 }).map(|a| a as Foo::); //~ WARN unnecessary path disambiguator + let g: Foo:: = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator + + m!(S::); // OK, no warning +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-36116.stderr b/src/test/ui/issue-36116.stderr new file mode 100644 index 00000000000..df69dcb0d92 --- /dev/null +++ b/src/test/ui/issue-36116.stderr @@ -0,0 +1,20 @@ +warning: unnecessary path disambiguator + --> $DIR/issue-36116.rs:30:50 + | +LL | let f = Some(Foo { _a: 42 }).map(|a| a as Foo::); //~ WARN unnecessary path disambiguator + | ^^ try removing `::` + +warning: unnecessary path disambiguator + --> $DIR/issue-36116.rs:31:15 + | +LL | let g: Foo:: = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator + | ^^ try removing `::` + +error: compilation successful + --> $DIR/issue-36116.rs:37:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-36299.rs b/src/test/ui/issue-36299.rs new file mode 100644 index 00000000000..88ac74cb09e --- /dev/null +++ b/src/test/ui/issue-36299.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo<'a, A> {} +//~^ ERROR parameter `'a` is never used +//~| ERROR parameter `A` is never used + +fn main() {} diff --git a/src/test/ui/issue-36299.stderr b/src/test/ui/issue-36299.stderr new file mode 100644 index 00000000000..faa20253b9b --- /dev/null +++ b/src/test/ui/issue-36299.stderr @@ -0,0 +1,19 @@ +error[E0392]: parameter `'a` is never used + --> $DIR/issue-36299.rs:11:12 + | +LL | struct Foo<'a, A> {} + | ^^ unused type parameter + | + = help: consider removing `'a` or using a marker such as `std::marker::PhantomData` + +error[E0392]: parameter `A` is never used + --> $DIR/issue-36299.rs:11:16 + | +LL | struct Foo<'a, A> {} + | ^ unused type parameter + | + = help: consider removing `A` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/issue-36379.rs b/src/test/ui/issue-36379.rs new file mode 100644 index 00000000000..b20765815e0 --- /dev/null +++ b/src/test/ui/issue-36379.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +fn _test() -> impl Default { } + +#[rustc_error] +fn main() { } //~ ERROR compilation successful diff --git a/src/test/ui/issue-36379.stderr b/src/test/ui/issue-36379.stderr new file mode 100644 index 00000000000..b06591f411e --- /dev/null +++ b/src/test/ui/issue-36379.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-36379.rs:16:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-36617.rs b/src/test/ui/issue-36617.rs new file mode 100644 index 00000000000..9f5eeb1a45d --- /dev/null +++ b/src/test/ui/issue-36617.rs @@ -0,0 +1,11 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions diff --git a/src/test/ui/issue-36617.stderr b/src/test/ui/issue-36617.stderr new file mode 100644 index 00000000000..efd58235282 --- /dev/null +++ b/src/test/ui/issue-36617.stderr @@ -0,0 +1,8 @@ +error: `derive` may only be applied to structs, enums and unions + --> $DIR/issue-36617.rs:11:1 + | +LL | #![derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^ help: try an outer attribute: `#[derive(Copy)]` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-36638.rs b/src/test/ui/issue-36638.rs new file mode 100644 index 00000000000..5e43536ef3f --- /dev/null +++ b/src/test/ui/issue-36638.rs @@ -0,0 +1,19 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z continue-parse-after-error + +struct Foo(Self); +//~^ ERROR expected identifier, found keyword `Self` + +trait Bar {} +//~^ ERROR expected identifier, found keyword `Self` + +fn main() {} diff --git a/src/test/ui/issue-36638.stderr b/src/test/ui/issue-36638.stderr new file mode 100644 index 00000000000..d111fb469bf --- /dev/null +++ b/src/test/ui/issue-36638.stderr @@ -0,0 +1,14 @@ +error: expected identifier, found keyword `Self` + --> $DIR/issue-36638.rs:13:12 + | +LL | struct Foo(Self); + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/issue-36638.rs:16:11 + | +LL | trait Bar {} + | ^^^^ expected identifier, found keyword + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-3668-2.rs b/src/test/ui/issue-3668-2.rs new file mode 100644 index 00000000000..fe46877e8d3 --- /dev/null +++ b/src/test/ui/issue-3668-2.rs @@ -0,0 +1,16 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f(x:isize) { + static child: isize = x + 1; + //~^ ERROR can't capture dynamic environment +} + +fn main() {} diff --git a/src/test/ui/issue-3668-2.stderr b/src/test/ui/issue-3668-2.stderr new file mode 100644 index 00000000000..e78a2791907 --- /dev/null +++ b/src/test/ui/issue-3668-2.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3668-2.rs:12:27 + | +LL | static child: isize = x + 1; + | ^ + | + = 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/issue-3668.rs b/src/test/ui/issue-3668.rs new file mode 100644 index 00000000000..00f64414a9e --- /dev/null +++ b/src/test/ui/issue-3668.rs @@ -0,0 +1,24 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct P { child: Option> } +trait PTrait { + fn getChildOption(&self) -> Option>; +} + +impl PTrait for P { + fn getChildOption(&self) -> Option> { + static childVal: Box

= self.child.get(); + //~^ ERROR can't capture dynamic environment + panic!(); + } +} + +fn main() {} diff --git a/src/test/ui/issue-3668.stderr b/src/test/ui/issue-3668.stderr new file mode 100644 index 00000000000..73eaf57c955 --- /dev/null +++ b/src/test/ui/issue-3668.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-3668.rs:18:34 + | +LL | static childVal: Box

= self.child.get(); + | ^^^^ + | + = 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/issue-3680.rs b/src/test/ui/issue-3680.rs new file mode 100644 index 00000000000..e698e6da529 --- /dev/null +++ b/src/test/ui/issue-3680.rs @@ -0,0 +1,19 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + match None { + Err(_) => () + //~^ ERROR mismatched types + //~| expected type `std::option::Option<_>` + //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option`, found enum `std::result::Result` + } +} diff --git a/src/test/ui/issue-3680.stderr b/src/test/ui/issue-3680.stderr new file mode 100644 index 00000000000..4fea4789dbd --- /dev/null +++ b/src/test/ui/issue-3680.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-3680.rs:13:9 + | +LL | Err(_) => () + | ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` + | + = note: expected type `std::option::Option<_>` + found type `std::result::Result<_, _>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-36839.rs b/src/test/ui/issue-36839.rs new file mode 100644 index 00000000000..3e34b250672 --- /dev/null +++ b/src/test/ui/issue-36839.rs @@ -0,0 +1,32 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +pub trait Foo { + type Bar; +} + +pub trait Broken { + type Assoc; + fn broken(&self) where Self::Assoc: Foo; +} + +impl Broken for T { + type Assoc = (); + fn broken(&self) where Self::Assoc: Foo { + let _x: ::Bar; + } +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let _m: &Broken = &(); +} diff --git a/src/test/ui/issue-36839.stderr b/src/test/ui/issue-36839.stderr new file mode 100644 index 00000000000..dd78668801c --- /dev/null +++ b/src/test/ui/issue-36839.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/issue-36839.rs:30:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let _m: &Broken = &(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-3702-2.rs b/src/test/ui/issue-3702-2.rs new file mode 100644 index 00000000000..325f05841f4 --- /dev/null +++ b/src/test/ui/issue-3702-2.rs @@ -0,0 +1,30 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait ToPrimitive { + fn to_int(&self) -> isize { 0 } +} + +impl ToPrimitive for i32 {} +impl ToPrimitive for isize {} + +trait Add { + fn to_int(&self) -> isize; + fn add_dynamic(&self, other: &Add) -> isize; +} + +impl Add for isize { + fn to_int(&self) -> isize { *self } + fn add_dynamic(&self, other: &Add) -> isize { + self.to_int() + other.to_int() //~ ERROR multiple applicable items in scope + } +} + +fn main() { } diff --git a/src/test/ui/issue-3702-2.stderr b/src/test/ui/issue-3702-2.stderr new file mode 100644 index 00000000000..9ec400db47f --- /dev/null +++ b/src/test/ui/issue-3702-2.stderr @@ -0,0 +1,20 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/issue-3702-2.rs:26:14 + | +LL | self.to_int() + other.to_int() //~ ERROR multiple applicable items in scope + | ^^^^^^ multiple `to_int` found + | +note: candidate #1 is defined in an impl of the trait `ToPrimitive` for the type `isize` + --> $DIR/issue-3702-2.rs:12:5 + | +LL | fn to_int(&self) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +note: candidate #2 is defined in an impl of the trait `Add` for the type `isize` + --> $DIR/issue-3702-2.rs:24:5 + | +LL | fn to_int(&self) -> isize { *self } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/ui/issue-37026.rs b/src/test/ui/issue-37026.rs new file mode 100644 index 00000000000..95fd5d1222e --- /dev/null +++ b/src/test/ui/issue-37026.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:empty-struct.rs + +extern crate empty_struct; + +fn main() { + let empty_struct::XEmpty2 = (); //~ ERROR mismatched types + let empty_struct::XEmpty6(..) = (); //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-37026.stderr b/src/test/ui/issue-37026.stderr new file mode 100644 index 00000000000..c53ec5b55ce --- /dev/null +++ b/src/test/ui/issue-37026.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/issue-37026.rs:16:9 + | +LL | let empty_struct::XEmpty2 = (); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` + | + = note: expected type `()` + found type `empty_struct::XEmpty2` + +error[E0308]: mismatched types + --> $DIR/issue-37026.rs:17:9 + | +LL | let empty_struct::XEmpty6(..) = (); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` + | + = note: expected type `()` + found type `empty_struct::XEmpty6` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-37051.rs b/src/test/ui/issue-37051.rs new file mode 100644 index 00000000000..ab08e1899a0 --- /dev/null +++ b/src/test/ui/issue-37051.rs @@ -0,0 +1,29 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs, associated_type_defaults)] +#![allow(warnings)] + +trait State: Sized { + type NextState: State = StateMachineEnded; + fn execute(self) -> Option; +} + +struct StateMachineEnded; + +impl State for StateMachineEnded { + fn execute(self) -> Option { + None + } +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful +} diff --git a/src/test/ui/issue-37051.stderr b/src/test/ui/issue-37051.stderr new file mode 100644 index 00000000000..b0404088d4d --- /dev/null +++ b/src/test/ui/issue-37051.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/issue-37051.rs:28:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-3707.rs b/src/test/ui/issue-3707.rs new file mode 100644 index 00000000000..ad56b125b08 --- /dev/null +++ b/src/test/ui/issue-3707.rs @@ -0,0 +1,28 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Obj { + member: usize +} + +impl Obj { + pub fn boom() -> bool { + return 1+1 == 2 + } + pub fn chirp(&self) { + self.boom(); //~ ERROR no method named `boom` found for type `&Obj` in the current scope + } +} + +fn main() { + let o = Obj { member: 0 }; + o.chirp(); + 1 + 1; +} diff --git a/src/test/ui/issue-3707.stderr b/src/test/ui/issue-3707.stderr new file mode 100644 index 00000000000..c6d28fecaf9 --- /dev/null +++ b/src/test/ui/issue-3707.stderr @@ -0,0 +1,19 @@ +error[E0599]: no method named `boom` found for type `&Obj` in the current scope + --> $DIR/issue-3707.rs:20:14 + | +LL | self.boom(); //~ ERROR no method named `boom` found for type `&Obj` in the current scope + | -----^^^^ + | | | + | | this is an associated function, not a method + | help: use associated function syntax instead: `&Obj::boom` + | + = note: found the following associated functions; to be used as methods, functions must have a `self` parameter +note: the candidate is defined in an impl for the type `Obj` + --> $DIR/issue-3707.rs:16:5 + | +LL | pub fn boom() -> bool { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-37323.rs b/src/test/ui/issue-37323.rs new file mode 100644 index 00000000000..98806cdd1b9 --- /dev/null +++ b/src/test/ui/issue-37323.rs @@ -0,0 +1,28 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +#[derive(Debug)] +struct Point { +} + +struct NestedA<'a, 'b> { + x: &'a NestedB<'b> + //~^ ERROR E0491 +} + +struct NestedB<'a> { + x: &'a i32, +} + +fn main() { +} diff --git a/src/test/ui/issue-37323.stderr b/src/test/ui/issue-37323.stderr new file mode 100644 index 00000000000..a83923a5910 --- /dev/null +++ b/src/test/ui/issue-37323.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a NestedB<'b>`, reference has a longer lifetime than the data it references + --> $DIR/issue-37323.rs:19:5 + | +LL | x: &'a NestedB<'b> + | ^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 18:16 + --> $DIR/issue-37323.rs:18:16 + | +LL | struct NestedA<'a, 'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 18:20 + --> $DIR/issue-37323.rs:18:20 + | +LL | struct NestedA<'a, 'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/issue-37366.rs b/src/test/ui/issue-37366.rs new file mode 100644 index 00000000000..2a4808fb186 --- /dev/null +++ b/src/test/ui/issue-37366.rs @@ -0,0 +1,26 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-emscripten + +#![feature(rustc_attrs, asm)] + +macro_rules! interrupt_handler { + () => { + unsafe fn _interrupt_handler() { + asm!("pop eax" :::: "intel"); + } + } +} +interrupt_handler!{} + +#[rustc_error] +fn main() { //~ ERROR compilation successful +} diff --git a/src/test/ui/issue-37366.stderr b/src/test/ui/issue-37366.stderr new file mode 100644 index 00000000000..8667feccf99 --- /dev/null +++ b/src/test/ui/issue-37366.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/issue-37366.rs:25:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-37510.rs b/src/test/ui/issue-37510.rs new file mode 100644 index 00000000000..53c91f323d0 --- /dev/null +++ b/src/test/ui/issue-37510.rs @@ -0,0 +1,25 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +fn foo(_: &mut i32) -> bool { true } + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let opt = Some(92); + let mut x = 62; + + if let Some(_) = opt { + + } else if foo(&mut x) { + + } +} diff --git a/src/test/ui/issue-37510.stderr b/src/test/ui/issue-37510.stderr new file mode 100644 index 00000000000..48db0d5e202 --- /dev/null +++ b/src/test/ui/issue-37510.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/issue-37510.rs:16:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let opt = Some(92); +LL | | let mut x = 62; +LL | | +... | +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-37515.rs b/src/test/ui/issue-37515.rs new file mode 100644 index 00000000000..d5733f98193 --- /dev/null +++ b/src/test/ui/issue-37515.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![warn(unused)] + +type Z = for<'x> Send; +//~^ WARN type alias is never used + +#[rustc_error] +fn main() { //~ ERROR compilation successful +} diff --git a/src/test/ui/issue-37515.stderr b/src/test/ui/issue-37515.stderr new file mode 100644 index 00000000000..68e983f23b0 --- /dev/null +++ b/src/test/ui/issue-37515.stderr @@ -0,0 +1,22 @@ +warning: type alias is never used: `Z` + --> $DIR/issue-37515.rs:14:1 + | +LL | type Z = for<'x> Send; + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-37515.rs:12:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: #[warn(dead_code)] implied by #[warn(unused)] + +error: compilation successful + --> $DIR/issue-37515.rs:18:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-37534.rs b/src/test/ui/issue-37534.rs new file mode 100644 index 00000000000..70c8f92de63 --- /dev/null +++ b/src/test/ui/issue-37534.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { } +//~^ ERROR cannot find trait `Hash` in this scope +//~^^ ERROR parameter `T` is never used +//~^^^ WARN default bound relaxed for a type parameter, but this does nothing + +fn main() { } diff --git a/src/test/ui/issue-37534.stderr b/src/test/ui/issue-37534.stderr new file mode 100644 index 00000000000..c4fc9db31f5 --- /dev/null +++ b/src/test/ui/issue-37534.stderr @@ -0,0 +1,28 @@ +error[E0405]: cannot find trait `Hash` in this scope + --> $DIR/issue-37534.rs:11:16 + | +LL | struct Foo { } + | ^^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use std::hash::Hash; + | + +warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default. Only `?Sized` is supported + --> $DIR/issue-37534.rs:11:12 + | +LL | struct Foo { } + | ^ + +error[E0392]: parameter `T` is never used + --> $DIR/issue-37534.rs:11:12 + | +LL | struct Foo { } + | ^ unused type parameter + | + = help: consider removing `T` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 2 previous errors + +Some errors occurred: E0392, E0405. +For more information about an error, try `rustc --explain E0392`. diff --git a/src/test/ui/issue-37550.rs b/src/test/ui/issue-37550.rs new file mode 100644 index 00000000000..af1f6ef5ed4 --- /dev/null +++ b/src/test/ui/issue-37550.rs @@ -0,0 +1,22 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(const_fn)] + +const fn x() { + let t = true; + //~^ ERROR let bindings in constant functions are unstable + //~| ERROR statements in constant functions are unstable + let x = || t; + //~^ ERROR let bindings in constant functions are unstable + //~| ERROR statements in constant functions are unstable +} + +fn main() {} diff --git a/src/test/ui/issue-37550.stderr b/src/test/ui/issue-37550.stderr new file mode 100644 index 00000000000..7468510de6a --- /dev/null +++ b/src/test/ui/issue-37550.stderr @@ -0,0 +1,35 @@ +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/issue-37550.rs:14:13 + | +LL | let t = true; + | ^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constant functions are unstable (see issue #48821) + --> $DIR/issue-37550.rs:14:13 + | +LL | let t = true; + | ^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/issue-37550.rs:17:13 + | +LL | let x = || t; + | ^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constant functions are unstable (see issue #48821) + --> $DIR/issue-37550.rs:17:13 + | +LL | let x = || t; + | ^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issue-37576.rs b/src/test/ui/issue-37576.rs new file mode 100644 index 00000000000..e3c1ada878d --- /dev/null +++ b/src/test/ui/issue-37576.rs @@ -0,0 +1,55 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + 'test_1: while break 'test_1 {} + while break {} + //~^ ERROR `break` or `continue` with no label + + 'test_2: while let true = break 'test_2 {} + while let true = break {} + //~^ ERROR `break` or `continue` with no label + + loop { 'test_3: while break 'test_3 {} } + loop { while break {} } + //~^ ERROR `break` or `continue` with no label + + loop { + 'test_4: while break 'test_4 {} + break; + } + loop { + while break {} + //~^ ERROR `break` or `continue` with no label + break; + } + + 'test_5: while continue 'test_5 {} + while continue {} + //~^ ERROR `break` or `continue` with no label + + 'test_6: while let true = continue 'test_6 {} + while let true = continue {} + //~^ ERROR `break` or `continue` with no label + + loop { 'test_7: while continue 'test_7 {} } + loop { while continue {} } + //~^ ERROR `break` or `continue` with no label + + loop { + 'test_8: while continue 'test_8 {} + continue; + } + loop { + while continue {} + //~^ ERROR `break` or `continue` with no label + continue; + } +} diff --git a/src/test/ui/issue-37576.stderr b/src/test/ui/issue-37576.stderr new file mode 100644 index 00000000000..b663c8b8a28 --- /dev/null +++ b/src/test/ui/issue-37576.stderr @@ -0,0 +1,51 @@ +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:13:11 + | +LL | while break {} + | ^^^^^ unlabeled `break` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:17:22 + | +LL | while let true = break {} + | ^^^^^ unlabeled `break` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:21:18 + | +LL | loop { while break {} } + | ^^^^^ unlabeled `break` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:29:15 + | +LL | while break {} + | ^^^^^ unlabeled `break` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:35:11 + | +LL | while continue {} + | ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:39:22 + | +LL | while let true = continue {} + | ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:43:18 + | +LL | loop { while continue {} } + | ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop + +error[E0590]: `break` or `continue` with no label in the condition of a `while` loop + --> $DIR/issue-37576.rs:51:15 + | +LL | while continue {} + | ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0590`. diff --git a/src/test/ui/issue-3763.rs b/src/test/ui/issue-3763.rs new file mode 100644 index 00000000000..851f5dfeabe --- /dev/null +++ b/src/test/ui/issue-3763.rs @@ -0,0 +1,36 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod my_mod { + pub struct MyStruct { + priv_field: isize + } + pub fn MyStruct () -> MyStruct { + MyStruct {priv_field: 4} + } + impl MyStruct { + fn happyfun(&self) {} + } +} + +fn main() { + let my_struct = my_mod::MyStruct(); + let _woohoo = (&my_struct).priv_field; + //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private + + let _woohoo = (Box::new(my_struct)).priv_field; + //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private + + (&my_struct).happyfun(); //~ ERROR method `happyfun` is private + + (Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private + let nope = my_struct.priv_field; + //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private +} diff --git a/src/test/ui/issue-3763.stderr b/src/test/ui/issue-3763.stderr new file mode 100644 index 00000000000..0dd7d6819e8 --- /dev/null +++ b/src/test/ui/issue-3763.stderr @@ -0,0 +1,34 @@ +error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private + --> $DIR/issue-3763.rs:25:19 + | +LL | let _woohoo = (&my_struct).priv_field; + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private + --> $DIR/issue-3763.rs:28:19 + | +LL | let _woohoo = (Box::new(my_struct)).priv_field; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0624]: method `happyfun` is private + --> $DIR/issue-3763.rs:31:18 + | +LL | (&my_struct).happyfun(); //~ ERROR method `happyfun` is private + | ^^^^^^^^ + +error[E0624]: method `happyfun` is private + --> $DIR/issue-3763.rs:33:27 + | +LL | (Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private + | ^^^^^^^^ + +error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private + --> $DIR/issue-3763.rs:34:16 + | +LL | let nope = my_struct.priv_field; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0616, E0624. +For more information about an error, try `rustc --explain E0616`. diff --git a/src/test/ui/issue-37665.rs b/src/test/ui/issue-37665.rs new file mode 100644 index 00000000000..81ed4375e77 --- /dev/null +++ b/src/test/ui/issue-37665.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z unpretty=mir +// ignore-cloudabi no std::path + +use std::path::MAIN_SEPARATOR; + +fn main() { + let mut foo : String = "hello".to_string(); + foo.push(MAIN_SEPARATOR); + println!("{}", foo); + let x: () = 0; //~ ERROR: mismatched types +} diff --git a/src/test/ui/issue-37665.stderr b/src/test/ui/issue-37665.stderr new file mode 100644 index 00000000000..cdf9129c002 --- /dev/null +++ b/src/test/ui/issue-37665.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-37665.rs:20:17 + | +LL | let x: () = 0; //~ ERROR: mismatched types + | ^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-37887.rs b/src/test/ui/issue-37887.rs new file mode 100644 index 00000000000..f120bbbfc9f --- /dev/null +++ b/src/test/ui/issue-37887.rs @@ -0,0 +1,14 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + extern crate libc; //~ ERROR use of unstable + use libc::*; //~ ERROR unresolved import +} diff --git a/src/test/ui/issue-37887.stderr b/src/test/ui/issue-37887.stderr new file mode 100644 index 00000000000..8448466087d --- /dev/null +++ b/src/test/ui/issue-37887.stderr @@ -0,0 +1,18 @@ +error[E0432]: unresolved import `libc` + --> $DIR/issue-37887.rs:13:9 + | +LL | use libc::*; //~ ERROR unresolved import + | ^^^^ Maybe a missing `extern crate libc;`? + +error[E0658]: use of unstable library feature 'libc': use `libc` from crates.io (see issue #27783) + --> $DIR/issue-37887.rs:12:5 + | +LL | extern crate libc; //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(libc)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +Some errors occurred: E0432, E0658. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-38160.rs b/src/test/ui/issue-38160.rs new file mode 100644 index 00000000000..311d0ceb4d3 --- /dev/null +++ b/src/test/ui/issue-38160.rs @@ -0,0 +1,31 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_consts, rustc_attrs)] +#![allow(warnings)] + +trait MyTrait { + const MY_CONST: &'static str; +} + +macro_rules! my_macro { + () => { + struct MyStruct; + + impl MyTrait for MyStruct { + const MY_CONST: &'static str = stringify!(abc); + } + } +} + +my_macro!(); + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-38160.stderr b/src/test/ui/issue-38160.stderr new file mode 100644 index 00000000000..1277d84a032 --- /dev/null +++ b/src/test/ui/issue-38160.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-38160.rs:31:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-3820.rs b/src/test/ui/issue-3820.rs new file mode 100644 index 00000000000..28de76f18da --- /dev/null +++ b/src/test/ui/issue-3820.rs @@ -0,0 +1,25 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Thing { + x: isize +} + +impl Thing { + fn mul(&self, c: &isize) -> Thing { + Thing {x: self.x * *c} + } +} + +fn main() { + let u = Thing {x: 2}; + let _v = u.mul(&3); // This is ok + let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing` +} diff --git a/src/test/ui/issue-3820.stderr b/src/test/ui/issue-3820.stderr new file mode 100644 index 00000000000..cdd14e9da7b --- /dev/null +++ b/src/test/ui/issue-3820.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `*` cannot be applied to type `Thing` + --> $DIR/issue-3820.rs:24:13 + | +LL | let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing` + | ^^^^^ + | + = note: an implementation of `std::ops::Mul` might be missing for `Thing` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/ui/issue-38293.rs b/src/test/ui/issue-38293.rs new file mode 100644 index 00000000000..1867bafa7e3 --- /dev/null +++ b/src/test/ui/issue-38293.rs @@ -0,0 +1,26 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that `fn foo::bar::{self}` only imports `bar` in the type namespace. + +mod foo { + pub fn f() { } +} +use foo::f::{self}; //~ ERROR unresolved import `foo::f` + +mod bar { + pub fn baz() {} + pub mod baz {} +} +use bar::baz::{self}; + +fn main() { + baz(); //~ ERROR expected function, found module `baz` +} diff --git a/src/test/ui/issue-38293.stderr b/src/test/ui/issue-38293.stderr new file mode 100644 index 00000000000..73f5425cfc0 --- /dev/null +++ b/src/test/ui/issue-38293.stderr @@ -0,0 +1,20 @@ +error[E0432]: unresolved import `foo::f` + --> $DIR/issue-38293.rs:16:14 + | +LL | use foo::f::{self}; //~ ERROR unresolved import `foo::f` + | ^^^^ no `f` in `foo` + +error[E0423]: expected function, found module `baz` + --> $DIR/issue-38293.rs:25:5 + | +LL | baz(); //~ ERROR expected function, found module `baz` + | ^^^ not a function +help: possible better candidate is found in another module, you can import it into scope + | +LL | use bar::baz; + | + +error: aborting due to 2 previous errors + +Some errors occurred: E0423, E0432. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/issue-38381.rs b/src/test/ui/issue-38381.rs new file mode 100644 index 00000000000..6b7dde117df --- /dev/null +++ b/src/test/ui/issue-38381.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +use std::ops::Deref; + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let _x: fn(&i32) -> <&i32 as Deref>::Target = unimplemented!(); +} diff --git a/src/test/ui/issue-38381.stderr b/src/test/ui/issue-38381.stderr new file mode 100644 index 00000000000..baa6338a37e --- /dev/null +++ b/src/test/ui/issue-38381.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/issue-38381.rs:16:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let _x: fn(&i32) -> <&i32 as Deref>::Target = unimplemented!(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-38404.rs b/src/test/ui/issue-38404.rs new file mode 100644 index 00000000000..a2b0d0a60c0 --- /dev/null +++ b/src/test/ui/issue-38404.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait A: std::ops::Add + Sized {} +trait B: A {} +trait C: A> {} +//~^ ERROR the trait `B` cannot be made into an object + +fn main() {} diff --git a/src/test/ui/issue-38404.stderr b/src/test/ui/issue-38404.stderr new file mode 100644 index 00000000000..ac55be75f5b --- /dev/null +++ b/src/test/ui/issue-38404.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `B` cannot be made into an object + --> $DIR/issue-38404.rs:13:15 + | +LL | trait C: A> {} + | ^^^^^^^^^^^^^^^^^^ the trait `B` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/issue-38412.rs b/src/test/ui/issue-38412.rs new file mode 100644 index 00000000000..b4feadbacf7 --- /dev/null +++ b/src/test/ui/issue-38412.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let Box(a) = loop { }; + //~^ ERROR expected tuple struct/variant, found struct `Box` + + // (The below is a trick to allow compiler to infer a type for + // variable `a` without attempting to ascribe a type to the + // pattern or otherwise attempting to name the Box type, which + // would run afoul of issue #22207) + let _b: *mut i32 = *a; +} diff --git a/src/test/ui/issue-38412.stderr b/src/test/ui/issue-38412.stderr new file mode 100644 index 00000000000..96851436d6c --- /dev/null +++ b/src/test/ui/issue-38412.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected tuple struct/variant, found struct `Box` + --> $DIR/issue-38412.rs:12:9 + | +LL | let Box(a) = loop { }; + | ^^^ constructor is not visible here due to private fields + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-38458.rs b/src/test/ui/issue-38458.rs new file mode 100644 index 00000000000..56eb5f874cd --- /dev/null +++ b/src/test/ui/issue-38458.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const x: () = { + return; //~ ERROR return statement outside of function body +}; + +fn main() {} diff --git a/src/test/ui/issue-38458.stderr b/src/test/ui/issue-38458.stderr new file mode 100644 index 00000000000..d870da63d89 --- /dev/null +++ b/src/test/ui/issue-38458.stderr @@ -0,0 +1,9 @@ +error[E0572]: return statement outside of function body + --> $DIR/issue-38458.rs:12:5 + | +LL | return; //~ ERROR return statement outside of function body + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0572`. diff --git a/src/test/ui/issue-38604.rs b/src/test/ui/issue-38604.rs new file mode 100644 index 00000000000..c1939a7707f --- /dev/null +++ b/src/test/ui/issue-38604.rs @@ -0,0 +1,26 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Q {} +trait Foo where u32: Q { + fn foo(&self); +} + +impl Q<()> for u32 {} +impl Foo for () { + fn foo(&self) { + println!("foo!"); + } +} + +fn main() { + let _f: Box = //~ ERROR `Foo` cannot be made into an object + Box::new(()); //~ ERROR `Foo` cannot be made into an object +} diff --git a/src/test/ui/issue-38604.stderr b/src/test/ui/issue-38604.stderr new file mode 100644 index 00000000000..78aee9172f5 --- /dev/null +++ b/src/test/ui/issue-38604.stderr @@ -0,0 +1,20 @@ +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/issue-38604.rs:24:13 + | +LL | let _f: Box = //~ ERROR `Foo` cannot be made into an object + | ^^^^^^^^ the trait `Foo` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/issue-38604.rs:25:9 + | +LL | Box::new(()); //~ ERROR `Foo` cannot be made into an object + | ^^^^^^^^^^^^ the trait `Foo` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized>` for `std::boxed::Box<()>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/issue-38857.rs b/src/test/ui/issue-38857.rs new file mode 100644 index 00000000000..b38b1b9fdc6 --- /dev/null +++ b/src/test/ui/issue-38857.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; + //~^ ERROR failed to resolve. Could not find `imp` in `sys` [E0433] + //~^^ ERROR module `sys` is private [E0603] +} diff --git a/src/test/ui/issue-38857.stderr b/src/test/ui/issue-38857.stderr new file mode 100644 index 00000000000..985927c25a1 --- /dev/null +++ b/src/test/ui/issue-38857.stderr @@ -0,0 +1,16 @@ +error[E0433]: failed to resolve. Could not find `imp` in `sys` + --> $DIR/issue-38857.rs:12:23 + | +LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; + | ^^^ Could not find `imp` in `sys` + +error[E0603]: module `sys` is private + --> $DIR/issue-38857.rs:12:13 + | +LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0433, E0603. +For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/issue-38868.rs b/src/test/ui/issue-38868.rs new file mode 100644 index 00000000000..c7e1da7094f --- /dev/null +++ b/src/test/ui/issue-38868.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct List { + head: T, +} + +impl Drop for List { //~ ERROR E0366 + fn drop(&mut self) { + panic!() + } +} + +fn main() { + List { head: 0 }; +} diff --git a/src/test/ui/issue-38868.stderr b/src/test/ui/issue-38868.stderr new file mode 100644 index 00000000000..3a8ffe7d5e9 --- /dev/null +++ b/src/test/ui/issue-38868.stderr @@ -0,0 +1,21 @@ +error[E0366]: Implementations of Drop cannot be specialized + --> $DIR/issue-38868.rs:15:1 + | +LL | / impl Drop for List { //~ ERROR E0366 +LL | | fn drop(&mut self) { +LL | | panic!() +LL | | } +LL | | } + | |_^ + | +note: Use same sequence of generic type and region parameters that is on the struct/enum definition + --> $DIR/issue-38868.rs:11:1 + | +LL | / pub struct List { +LL | | head: T, +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0366`. diff --git a/src/test/ui/issue-38919.rs b/src/test/ui/issue-38919.rs new file mode 100644 index 00000000000..e6cee4afd59 --- /dev/null +++ b/src/test/ui/issue-38919.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() { + T::Item; //~ ERROR no associated item named `Item` found for type `T` in the current scope +} + +fn main() { } diff --git a/src/test/ui/issue-38919.stderr b/src/test/ui/issue-38919.stderr new file mode 100644 index 00000000000..b80367d7c6c --- /dev/null +++ b/src/test/ui/issue-38919.stderr @@ -0,0 +1,9 @@ +error[E0599]: no associated item named `Item` found for type `T` in the current scope + --> $DIR/issue-38919.rs:12:5 + | +LL | T::Item; //~ ERROR no associated item named `Item` found for type `T` in the current scope + | ^^^^^^^ associated item not found in `T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-38954.rs b/src/test/ui/issue-38954.rs new file mode 100644 index 00000000000..7f01ed3f820 --- /dev/null +++ b/src/test/ui/issue-38954.rs @@ -0,0 +1,14 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn _test(ref _p: str) {} +//~^ ERROR the size for values of type + +fn main() { } diff --git a/src/test/ui/issue-38954.stderr b/src/test/ui/issue-38954.stderr new file mode 100644 index 00000000000..f9c380317b4 --- /dev/null +++ b/src/test/ui/issue-38954.stderr @@ -0,0 +1,12 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-38954.rs:11:23 + | +LL | fn _test(ref _p: str) {} + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-39211.rs b/src/test/ui/issue-39211.rs new file mode 100644 index 00000000000..96ba1c83997 --- /dev/null +++ b/src/test/ui/issue-39211.rs @@ -0,0 +1,24 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_consts)] + +trait VecN { + const DIM: usize; +} +trait Mat { + type Row: VecN; +} + +fn m() { + let a = [3; M::Row::DIM]; //~ ERROR associated type `Row` not found for `M` +} +fn main() { +} diff --git a/src/test/ui/issue-39211.stderr b/src/test/ui/issue-39211.stderr new file mode 100644 index 00000000000..6859c6caeb0 --- /dev/null +++ b/src/test/ui/issue-39211.stderr @@ -0,0 +1,9 @@ +error[E0220]: associated type `Row` not found for `M` + --> $DIR/issue-39211.rs:21:17 + | +LL | let a = [3; M::Row::DIM]; //~ ERROR associated type `Row` not found for `M` + | ^^^^^^^^^^^ associated type `Row` not found + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0220`. diff --git a/src/test/ui/issue-39362.rs b/src/test/ui/issue-39362.rs new file mode 100644 index 00000000000..9d8abbfc65d --- /dev/null +++ b/src/test/ui/issue-39362.rs @@ -0,0 +1,28 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + Bar { bar: Bar, id: usize } +} + +enum Bar { + A, B, C, D, E, F +} + +fn test(f: Foo) { + match f { + //~^ ERROR non-exhaustive patterns + //~| patterns + Foo::Bar { bar: Bar::A, .. } => (), + Foo::Bar { bar: Bar::B, .. } => (), + } +} + +fn main() {} diff --git a/src/test/ui/issue-39362.stderr b/src/test/ui/issue-39362.stderr new file mode 100644 index 00000000000..3e613553dea --- /dev/null +++ b/src/test/ui/issue-39362.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered + --> $DIR/issue-39362.rs:20:11 + | +LL | match f { + | ^ patterns `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-39388.rs b/src/test/ui/issue-39388.rs new file mode 100644 index 00000000000..6da04937408 --- /dev/null +++ b/src/test/ui/issue-39388.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused_macros)] + +macro_rules! assign { + (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?` + $($a)* = $($b)* + } +} + +fn main() {} diff --git a/src/test/ui/issue-39388.stderr b/src/test/ui/issue-39388.stderr new file mode 100644 index 00000000000..a38d38a51ad --- /dev/null +++ b/src/test/ui/issue-39388.stderr @@ -0,0 +1,8 @@ +error: expected one of: `*`, `+`, or `?` + --> $DIR/issue-39388.rs:14:22 + | +LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?` + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-39404.rs b/src/test/ui/issue-39404.rs new file mode 100644 index 00000000000..56bfe27a4ff --- /dev/null +++ b/src/test/ui/issue-39404.rs @@ -0,0 +1,17 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused)] + +macro_rules! m { ($i) => {} } +//~^ ERROR missing fragment specifier +//~| WARN previously accepted + +fn main() {} diff --git a/src/test/ui/issue-39404.stderr b/src/test/ui/issue-39404.stderr new file mode 100644 index 00000000000..435a03c2858 --- /dev/null +++ b/src/test/ui/issue-39404.stderr @@ -0,0 +1,12 @@ +error: missing fragment specifier + --> $DIR/issue-39404.rs:13:19 + | +LL | macro_rules! m { ($i) => {} } + | ^^ + | + = note: #[deny(missing_fragment_specifier)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #40107 + +error: aborting due to previous error + diff --git a/src/test/ui/issue-39559-2.rs b/src/test/ui/issue-39559-2.rs new file mode 100644 index 00000000000..f01fd1fd8f1 --- /dev/null +++ b/src/test/ui/issue-39559-2.rs @@ -0,0 +1,30 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Dim { + fn dim() -> usize; +} + +enum Dim3 {} + +impl Dim for Dim3 { + fn dim() -> usize { + 3 + } +} + +fn main() { + let array: [usize; Dim3::dim()] + //~^ ERROR E0015 + //~| ERROR E0080 + = [0; Dim3::dim()]; + //~^ ERROR E0015 + //~| ERROR E0080 +} diff --git a/src/test/ui/issue-39559-2.stderr b/src/test/ui/issue-39559-2.stderr new file mode 100644 index 00000000000..91520a7ec08 --- /dev/null +++ b/src/test/ui/issue-39559-2.stderr @@ -0,0 +1,30 @@ +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-39559-2.rs:24:24 + | +LL | let array: [usize; Dim3::dim()] + | ^^^^^^^^^^^ + +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-39559-2.rs:27:15 + | +LL | = [0; Dim3::dim()]; + | ^^^^^^^^^^^ + +error[E0080]: could not evaluate repeat length + --> $DIR/issue-39559-2.rs:27:15 + | +LL | = [0; Dim3::dim()]; + | ^^^^^^^^^^^ calling non-const fn `::dim` + +error[E0080]: could not evaluate constant expression + --> $DIR/issue-39559-2.rs:24:16 + | +LL | let array: [usize; Dim3::dim()] + | ^^^^^^^^-----------^ + | | + | calling non-const fn `::dim` + +error: aborting due to 4 previous errors + +Some errors occurred: E0015, E0080. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-39559.rs b/src/test/ui/issue-39559.rs new file mode 100644 index 00000000000..2da21fb14bd --- /dev/null +++ b/src/test/ui/issue-39559.rs @@ -0,0 +1,29 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Dim { + fn dim() -> usize; +} + +enum Dim3 {} + +impl Dim for Dim3 { + fn dim() -> usize { + 3 + } +} + +pub struct Vector { + entries: [T; D::dim()], + //~^ ERROR no function or associated item named `dim` found for type `D` in the current scope + _dummy: D, +} + +fn main() {} diff --git a/src/test/ui/issue-39559.stderr b/src/test/ui/issue-39559.stderr new file mode 100644 index 00000000000..2ce6dfdbe44 --- /dev/null +++ b/src/test/ui/issue-39559.stderr @@ -0,0 +1,13 @@ +error[E0599]: no function or associated item named `dim` found for type `D` in the current scope + --> $DIR/issue-39559.rs:24:18 + | +LL | entries: [T; D::dim()], + | ^^^^^^ function or associated item not found in `D` + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `dim`, perhaps you need to implement it: + candidate #1: `Dim` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-39616.rs b/src/test/ui/issue-39616.rs new file mode 100644 index 00000000000..13b4c0896e7 --- /dev/null +++ b/src/test/ui/issue-39616.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(a: [0; 1]) {} //~ ERROR expected type, found `0` +//~| ERROR expected one of `)`, `,`, `->`, `where`, or `{`, found `]` +// FIXME(jseyfried): avoid emitting the second error (preexisting) + +fn main() {} diff --git a/src/test/ui/issue-39616.stderr b/src/test/ui/issue-39616.stderr new file mode 100644 index 00000000000..eebf47afb54 --- /dev/null +++ b/src/test/ui/issue-39616.stderr @@ -0,0 +1,14 @@ +error: expected type, found `0` + --> $DIR/issue-39616.rs:11:12 + | +LL | fn foo(a: [0; 1]) {} //~ ERROR expected type, found `0` + | ^ + +error: expected one of `)`, `,`, `->`, `where`, or `{`, found `]` + --> $DIR/issue-39616.rs:11:16 + | +LL | fn foo(a: [0; 1]) {} //~ ERROR expected type, found `0` + | ^ expected one of `)`, `,`, `->`, `where`, or `{` here + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-39687.rs b/src/test/ui/issue-39687.rs new file mode 100644 index 00000000000..404465e6a0f --- /dev/null +++ b/src/test/ui/issue-39687.rs @@ -0,0 +1,16 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(fn_traits)] + +fn main() { + ::call; + //~^ ERROR associated type bindings are not allowed here [E0229] +} diff --git a/src/test/ui/issue-39687.stderr b/src/test/ui/issue-39687.stderr new file mode 100644 index 00000000000..9f8d0910d87 --- /dev/null +++ b/src/test/ui/issue-39687.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-39687.rs:14:16 + | +LL | ::call; + | ^^ 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/issue-3973.rs b/src/test/ui/issue-3973.rs new file mode 100644 index 00000000000..67a934fccce --- /dev/null +++ b/src/test/ui/issue-3973.rs @@ -0,0 +1,35 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Point { + x: f64, + y: f64, +} + +trait ToString_ { + fn to_string(&self) -> String; +} + +impl ToString_ for Point { + fn new(x: f64, y: f64) -> Point { + //~^ ERROR method `new` is not a member of trait `ToString_` + Point { x: x, y: y } + } + + fn to_string(&self) -> String { + format!("({}, {})", self.x, self.y) + } +} + +fn main() { + let p = Point::new(0.0, 0.0); + //~^ ERROR no function or associated item named `new` found for type `Point` + println!("{}", p.to_string()); +} diff --git a/src/test/ui/issue-3973.stderr b/src/test/ui/issue-3973.stderr new file mode 100644 index 00000000000..9be07614ec1 --- /dev/null +++ b/src/test/ui/issue-3973.stderr @@ -0,0 +1,22 @@ +error[E0407]: method `new` is not a member of trait `ToString_` + --> $DIR/issue-3973.rs:21:5 + | +LL | / fn new(x: f64, y: f64) -> Point { +LL | | //~^ ERROR method `new` is not a member of trait `ToString_` +LL | | Point { x: x, y: y } +LL | | } + | |_____^ not a member of trait `ToString_` + +error[E0599]: no function or associated item named `new` found for type `Point` in the current scope + --> $DIR/issue-3973.rs:32:13 + | +LL | struct Point { + | ------------ function or associated item `new` not found for this +... +LL | let p = Point::new(0.0, 0.0); + | ^^^^^^^^^^ function or associated item not found in `Point` + +error: aborting due to 2 previous errors + +Some errors occurred: E0407, E0599. +For more information about an error, try `rustc --explain E0407`. diff --git a/src/test/ui/issue-39848.rs b/src/test/ui/issue-39848.rs new file mode 100644 index 00000000000..d5ca009d310 --- /dev/null +++ b/src/test/ui/issue-39848.rs @@ -0,0 +1,20 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! get_opt { + ($tgt:expr, $field:ident) => { + if $tgt.has_$field() {} + } +} + +fn main() { + get_opt!(bar, foo); + //~^ ERROR expected `{`, found `foo` +} diff --git a/src/test/ui/issue-39848.stderr b/src/test/ui/issue-39848.stderr new file mode 100644 index 00000000000..9ca39dbaa34 --- /dev/null +++ b/src/test/ui/issue-39848.stderr @@ -0,0 +1,13 @@ +error: expected `{`, found `foo` + --> $DIR/issue-39848.rs:18:19 + | +LL | if $tgt.has_$field() {} + | -- - help: try placing this code inside a block: `{ foo(); }` + | | + | this `if` statement has a condition, but no block +... +LL | get_opt!(bar, foo); + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-3993.rs b/src/test/ui/issue-3993.rs new file mode 100644 index 00000000000..fae5eb51272 --- /dev/null +++ b/src/test/ui/issue-3993.rs @@ -0,0 +1,20 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use zoo::fly; //~ ERROR: function `fly` is private + +mod zoo { + fn fly() {} +} + + +fn main() { + fly(); +} diff --git a/src/test/ui/issue-3993.stderr b/src/test/ui/issue-3993.stderr new file mode 100644 index 00000000000..4b569f2dea9 --- /dev/null +++ b/src/test/ui/issue-3993.stderr @@ -0,0 +1,9 @@ +error[E0603]: function `fly` is private + --> $DIR/issue-3993.rs:11:5 + | +LL | use zoo::fly; //~ ERROR: function `fly` is private + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/issue-39970.rs b/src/test/ui/issue-39970.rs new file mode 100644 index 00000000000..65ea1baa4a1 --- /dev/null +++ b/src/test/ui/issue-39970.rs @@ -0,0 +1,31 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Array<'a> { + type Element: 'a; +} + +trait Visit { + fn visit() {} +} + +impl<'a> Array<'a> for () { + type Element = &'a (); +} + +impl Visit for () where + //(): for<'a> Array<'a, Element=&'a ()>, // No ICE + (): for<'a> Array<'a, Element=()>, // ICE +{} + +fn main() { + <() as Visit>::visit(); + //~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` +} diff --git a/src/test/ui/issue-39970.stderr b/src/test/ui/issue-39970.stderr new file mode 100644 index 00000000000..397d7b8e650 --- /dev/null +++ b/src/test/ui/issue-39970.stderr @@ -0,0 +1,18 @@ +error[E0271]: type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` + --> $DIR/issue-39970.rs:29:5 + | +LL | <() as Visit>::visit(); + | ^^^^^^^^^^^^^^^^^^^^ expected &(), found () + | + = note: expected type `&()` + found type `()` + = note: required because of the requirements on the impl of `Visit` for `()` +note: required by `Visit::visit` + --> $DIR/issue-39970.rs:16:5 + | +LL | fn visit() {} + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/issue-39974.rs b/src/test/ui/issue-39974.rs new file mode 100644 index 00000000000..6f6b775a2a3 --- /dev/null +++ b/src/test/ui/issue-39974.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const LENGTH: f64 = 2; + +struct Thing { + f: [[f64; 2]; LENGTH], + //~^ ERROR mismatched types + //~| expected usize, found f64 +} + +fn main() { + let _t = Thing { f: [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]] }; +} diff --git a/src/test/ui/issue-39974.stderr b/src/test/ui/issue-39974.stderr new file mode 100644 index 00000000000..ddd149ccba8 --- /dev/null +++ b/src/test/ui/issue-39974.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/issue-39974.rs:14:19 + | +LL | f: [[f64; 2]; LENGTH], + | ^^^^^^ expected usize, found f64 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-40000.rs b/src/test/ui/issue-40000.rs new file mode 100644 index 00000000000..7daf4bcbaa4 --- /dev/null +++ b/src/test/ui/issue-40000.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let bar: fn(&mut u32) = |_| {}; + + fn foo(x: Box) {} + let bar = Box::new(|x: &i32| {}) as Box; + foo(bar); //~ ERROR mismatched types + //~| expected concrete lifetime, found bound lifetime parameter +} diff --git a/src/test/ui/issue-40000.stderr b/src/test/ui/issue-40000.stderr new file mode 100644 index 00000000000..26e52a7ecdb --- /dev/null +++ b/src/test/ui/issue-40000.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-40000.rs:16:9 + | +LL | foo(bar); //~ ERROR mismatched types + | ^^^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r i32) + 'static)>` + found type `std::boxed::Box` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-40288-2.nll.stderr b/src/test/ui/issue-40288-2.nll.stderr new file mode 100644 index 00000000000..fcff5c6a8ed --- /dev/null +++ b/src/test/ui/issue-40288-2.nll.stderr @@ -0,0 +1,55 @@ +warning: not reporting region error due to nll + --> $DIR/issue-40288-2.rs:17:20 + | +LL | slice[0] = y; + | ^ + +warning: not reporting region error due to nll + --> $DIR/issue-40288-2.rs:16:20 + | +LL | let slice: &mut [_] = &mut out; + | ^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/issue-40288-2.rs:14:19 + | +LL | let mut out = [x]; + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/issue-40288-2.rs:32:20 + | +LL | dst.head = y; + | ^ + +warning: not reporting region error due to nll + --> $DIR/issue-40288-2.rs:31:18 + | +LL | let dst: &mut Struct<_, [()]> = &mut out; + | ^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/issue-40288-2.rs:29:19 + | +LL | let mut out = Struct { head: x, _tail: [()] }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0621]: explicit lifetime required in the type of `y` + --> $DIR/issue-40288-2.rs:14:9 + | +LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { + | - consider changing the type of `y` to `&'a T` +LL | let mut out = [x]; + | ^^^^^^^ lifetime `'a` required + +error[E0621]: explicit lifetime required in the type of `y` + --> $DIR/issue-40288-2.rs:29:9 + | +LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { + | - consider changing the type of `y` to `&'a T` +LL | let mut out = Struct { head: x, _tail: [()] }; + | ^^^^^^^ lifetime `'a` required + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-40288-2.rs b/src/test/ui/issue-40288-2.rs new file mode 100644 index 00000000000..e16a7ecf6b9 --- /dev/null +++ b/src/test/ui/issue-40288-2.rs @@ -0,0 +1,41 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn prove_static(_: &'static T) {} + +fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { + let mut out = [x]; + { + let slice: &mut [_] = &mut out; + slice[0] = y; + } + out[0] + //~^ ERROR 19:5: 19:11: explicit lifetime required in the type of `y` [E0621] +} + +struct Struct { + head: T, + _tail: U +} + +fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { + let mut out = Struct { head: x, _tail: [()] }; + { + let dst: &mut Struct<_, [()]> = &mut out; + dst.head = y; + } + out.head + //~^ ERROR 34:5: 34:13: explicit lifetime required in the type of `y` [E0621] +} + +fn main() { + prove_static(lifetime_transmute_slice("", &String::from("foo"))); + prove_static(lifetime_transmute_struct("", &String::from("bar"))); +} diff --git a/src/test/ui/issue-40288-2.stderr b/src/test/ui/issue-40288-2.stderr new file mode 100644 index 00000000000..d2313ef89a7 --- /dev/null +++ b/src/test/ui/issue-40288-2.stderr @@ -0,0 +1,21 @@ +error[E0621]: explicit lifetime required in the type of `y` + --> $DIR/issue-40288-2.rs:19:5 + | +LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { + | - consider changing the type of `y` to `&'a T` +... +LL | out[0] + | ^^^^^^ lifetime `'a` required + +error[E0621]: explicit lifetime required in the type of `y` + --> $DIR/issue-40288-2.rs:34:5 + | +LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { + | - consider changing the type of `y` to `&'a T` +... +LL | out.head + | ^^^^^^^^ lifetime `'a` required + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-40288.nll.stderr b/src/test/ui/issue-40288.nll.stderr new file mode 100644 index 00000000000..bd4efa10f3d --- /dev/null +++ b/src/test/ui/issue-40288.nll.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `*refr` because it is borrowed + --> $DIR/issue-40288.rs:26:5 + | +LL | save_ref(&*refr, &mut out); + | ------ borrow of `*refr` occurs here +... +LL | *refr = 3; //~ ERROR cannot assign to `*refr` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `*refr` occurs here +... +LL | println!("{:?}", out[0]); + | ------ 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/issue-40288.rs b/src/test/ui/issue-40288.rs new file mode 100644 index 00000000000..b5418e85bec --- /dev/null +++ b/src/test/ui/issue-40288.rs @@ -0,0 +1,30 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn save_ref<'a>(refr: &'a i32, to: &mut [&'a i32]) { + for val in &mut *to { + *val = refr; + } +} + +fn main() { + let ref init = 0i32; + let ref mut refr = 1i32; + + let mut out = [init]; + + save_ref(&*refr, &mut out); + + // This shouldn't be allowed as `refr` is borrowed + *refr = 3; //~ ERROR cannot assign to `*refr` because it is borrowed + + // Prints 3?! + println!("{:?}", out[0]); +} diff --git a/src/test/ui/issue-40288.stderr b/src/test/ui/issue-40288.stderr new file mode 100644 index 00000000000..e69c3bc83a6 --- /dev/null +++ b/src/test/ui/issue-40288.stderr @@ -0,0 +1,12 @@ +error[E0506]: cannot assign to `*refr` because it is borrowed + --> $DIR/issue-40288.rs:26:5 + | +LL | save_ref(&*refr, &mut out); + | ----- borrow of `*refr` occurs here +... +LL | *refr = 3; //~ ERROR cannot assign to `*refr` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `*refr` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/issue-40350.rs b/src/test/ui/issue-40350.rs new file mode 100644 index 00000000000..39249ee4718 --- /dev/null +++ b/src/test/ui/issue-40350.rs @@ -0,0 +1,24 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +enum E { + A = { + enum F { B } + 0 + } +} + +#[rustc_error] +fn main() {} +//~^ ERROR compilation successful + diff --git a/src/test/ui/issue-40350.stderr b/src/test/ui/issue-40350.stderr new file mode 100644 index 00000000000..ad85bf2a778 --- /dev/null +++ b/src/test/ui/issue-40350.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-40350.rs:22:1 + | +LL | fn main() {} + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40510-1.nll.stderr b/src/test/ui/issue-40510-1.nll.stderr new file mode 100644 index 00000000000..73a8d58290d --- /dev/null +++ b/src/test/ui/issue-40510-1.nll.stderr @@ -0,0 +1,17 @@ +error: unsatisfied lifetime constraints + --> $DIR/issue-40510-1.rs:18:9 + | +LL | || { + | _____- + | |_____| + | || +LL | || &mut x + | || ^^^^^^ free region requires that `'1` must outlive `'2` +LL | || }; + | || - + | ||_____| + | |______lifetime `'1` represents the closure body + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40510-1.rs b/src/test/ui/issue-40510-1.rs new file mode 100644 index 00000000000..142092ff41e --- /dev/null +++ b/src/test/ui/issue-40510-1.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +fn f() { + let mut x: Box<()> = Box::new(()); + + || { + &mut x + }; +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-40510-1.stderr b/src/test/ui/issue-40510-1.stderr new file mode 100644 index 00000000000..1f5a41fce96 --- /dev/null +++ b/src/test/ui/issue-40510-1.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-40510-1.rs:23:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40510-2.rs b/src/test/ui/issue-40510-2.rs new file mode 100644 index 00000000000..0fe56584822 --- /dev/null +++ b/src/test/ui/issue-40510-2.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +fn f() { + let x: Box<()> = Box::new(()); + + || { + &x + }; +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-40510-2.stderr b/src/test/ui/issue-40510-2.stderr new file mode 100644 index 00000000000..03998af50c2 --- /dev/null +++ b/src/test/ui/issue-40510-2.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-40510-2.rs:23:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40510-3.nll.stderr b/src/test/ui/issue-40510-3.nll.stderr new file mode 100644 index 00000000000..4133c69f031 --- /dev/null +++ b/src/test/ui/issue-40510-3.nll.stderr @@ -0,0 +1,20 @@ +error: unsatisfied lifetime constraints + --> $DIR/issue-40510-3.rs:18:9 + | +LL | || { + | _____- + | |_____| + | || +LL | || || { + | ||_________^ +LL | ||| x.push(()) +LL | ||| } + | |||_________^ free region requires that `'1` must outlive `'2` +LL | || }; + | || - + | ||_____| + | |______lifetime `'1` represents the closure body + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40510-3.rs b/src/test/ui/issue-40510-3.rs new file mode 100644 index 00000000000..afa8f15ee57 --- /dev/null +++ b/src/test/ui/issue-40510-3.rs @@ -0,0 +1,25 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +fn f() { + let mut x: Vec<()> = Vec::new(); + + || { + || { + x.push(()) + } + }; +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-40510-3.stderr b/src/test/ui/issue-40510-3.stderr new file mode 100644 index 00000000000..c77b5cc8303 --- /dev/null +++ b/src/test/ui/issue-40510-3.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-40510-3.rs:25:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40510-4.rs b/src/test/ui/issue-40510-4.rs new file mode 100644 index 00000000000..a39c500225b --- /dev/null +++ b/src/test/ui/issue-40510-4.rs @@ -0,0 +1,25 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +fn f() { + let x: Vec<()> = Vec::new(); + + || { + || { + x.len() + } + }; +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-40510-4.stderr b/src/test/ui/issue-40510-4.stderr new file mode 100644 index 00000000000..1f3cd00fb48 --- /dev/null +++ b/src/test/ui/issue-40510-4.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-40510-4.rs:25:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-40610.rs b/src/test/ui/issue-40610.rs new file mode 100644 index 00000000000..aec20b4ad87 --- /dev/null +++ b/src/test/ui/issue-40610.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f(_: &[f32]) {} + +fn main() { + () + f(&[1.0]); + //~^ ERROR binary operation `+` cannot be applied to type `()` +} diff --git a/src/test/ui/issue-40610.stderr b/src/test/ui/issue-40610.stderr new file mode 100644 index 00000000000..faf1a4d1c38 --- /dev/null +++ b/src/test/ui/issue-40610.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `()` + --> $DIR/issue-40610.rs:14:5 + | +LL | () + f(&[1.0]); + | ^^^^^^^^^^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/ui/issue-40749.rs b/src/test/ui/issue-40749.rs new file mode 100644 index 00000000000..261ed49d10c --- /dev/null +++ b/src/test/ui/issue-40749.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + [0; ..10]; + //~^ ERROR mismatched types + //~| expected type `usize` + //~| found type `std::ops::RangeTo<{integer}>` +} diff --git a/src/test/ui/issue-40749.stderr b/src/test/ui/issue-40749.stderr new file mode 100644 index 00000000000..b76d469d116 --- /dev/null +++ b/src/test/ui/issue-40749.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-40749.rs:12:9 + | +LL | [0; ..10]; + | ^^^^ expected usize, found struct `std::ops::RangeTo` + | + = note: expected type `usize` + found type `std::ops::RangeTo<{integer}>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-40845.rs b/src/test/ui/issue-40845.rs new file mode 100644 index 00000000000..c5604a0427b --- /dev/null +++ b/src/test/ui/issue-40845.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait T { m!(); } //~ ERROR cannot find macro `m!` in this scope + +struct S; +impl S { m!(); } //~ ERROR cannot find macro `m!` in this scope + +fn main() {} diff --git a/src/test/ui/issue-40845.stderr b/src/test/ui/issue-40845.stderr new file mode 100644 index 00000000000..2e8f008a52d --- /dev/null +++ b/src/test/ui/issue-40845.stderr @@ -0,0 +1,14 @@ +error: cannot find macro `m!` in this scope + --> $DIR/issue-40845.rs:14:10 + | +LL | impl S { m!(); } //~ ERROR cannot find macro `m!` in this scope + | ^ + +error: cannot find macro `m!` in this scope + --> $DIR/issue-40845.rs:11:11 + | +LL | trait T { m!(); } //~ ERROR cannot find macro `m!` in this scope + | ^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-40861.rs b/src/test/ui/issue-40861.rs new file mode 100644 index 00000000000..75d58c58538 --- /dev/null +++ b/src/test/ui/issue-40861.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f(_: &[f32]) {} + +fn main() { + ()[f(&[1.0])]; + //~^ ERROR cannot index into a value of type `()` +} diff --git a/src/test/ui/issue-40861.stderr b/src/test/ui/issue-40861.stderr new file mode 100644 index 00000000000..dbde40fb25e --- /dev/null +++ b/src/test/ui/issue-40861.stderr @@ -0,0 +1,11 @@ +error[E0608]: cannot index into a value of type `()` + --> $DIR/issue-40861.rs:14:5 + | +LL | ()[f(&[1.0])]; + | ^^^^^^^^^^^^^ + | + = help: to access tuple elements, use tuple indexing syntax (e.g. `tuple.0`) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0608`. diff --git a/src/test/ui/issue-41139.nll.stderr b/src/test/ui/issue-41139.nll.stderr new file mode 100644 index 00000000000..3f79c66252a --- /dev/null +++ b/src/test/ui/issue-41139.nll.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type dyn Trait: the size of dyn Trait cannot be statically determined + --> $DIR/issue-41139.rs:16:23 + | +LL | let t : &Trait = &get_function()(); + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/issue-41139.rs b/src/test/ui/issue-41139.rs new file mode 100644 index 00000000000..0509a4387ba --- /dev/null +++ b/src/test/ui/issue-41139.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait {} + +fn get_function<'a>() -> &'a Fn() -> Trait { panic!("") } + +fn main() { + let t : &Trait = &get_function()(); + //~^ ERROR cannot move a value of type (dyn Trait + 'static) +} diff --git a/src/test/ui/issue-41139.stderr b/src/test/ui/issue-41139.stderr new file mode 100644 index 00000000000..9d0e19df3f2 --- /dev/null +++ b/src/test/ui/issue-41139.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type (dyn Trait + 'static): the size of (dyn Trait + 'static) cannot be statically determined + --> $DIR/issue-41139.rs:16:23 + | +LL | let t : &Trait = &get_function()(); + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/issue-41229-ref-str.rs b/src/test/ui/issue-41229-ref-str.rs new file mode 100644 index 00000000000..5d7546e1bc4 --- /dev/null +++ b/src/test/ui/issue-41229-ref-str.rs @@ -0,0 +1,14 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub fn example(ref s: str) {} +//~^ ERROR the size for values of type + +fn main() {} diff --git a/src/test/ui/issue-41229-ref-str.stderr b/src/test/ui/issue-41229-ref-str.stderr new file mode 100644 index 00000000000..889da66a4e8 --- /dev/null +++ b/src/test/ui/issue-41229-ref-str.stderr @@ -0,0 +1,12 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-41229-ref-str.rs:11:28 + | +LL | pub fn example(ref s: str) {} + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-41255.rs b/src/test/ui/issue-41255.rs new file mode 100644 index 00000000000..29912de37eb --- /dev/null +++ b/src/test/ui/issue-41255.rs @@ -0,0 +1,50 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Matching against float literals should result in a linter error + +#![feature(exclusive_range_pattern)] +#![allow(unused)] +#![forbid(illegal_floating_point_literal_pattern)] + +fn main() { + let x = 42.0; + match x { + 5.0 => {}, //~ ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + 5.0f32 => {}, //~ ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + -5.0 => {}, //~ ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + 1.0 .. 33.0 => {}, //~ ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + //~| ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + 39.0 ..= 70.0 => {}, //~ ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + //~| ERROR floating-point types cannot be used in patterns + //~| WARNING hard error + _ => {}, + }; + let y = 5.0; + // Same for tuples + match (x, 5) { + (3.14, 1) => {}, //~ ERROR floating-point types cannot be used + //~| WARNING hard error + _ => {}, + } + // Or structs + struct Foo { x: f32 }; + match (Foo { x }) { + Foo { x: 2.0 } => {}, //~ ERROR floating-point types cannot be used + //~| WARNING hard error + _ => {}, + } +} diff --git a/src/test/ui/issue-41255.stderr b/src/test/ui/issue-41255.stderr new file mode 100644 index 00000000000..03100b6db76 --- /dev/null +++ b/src/test/ui/issue-41255.stderr @@ -0,0 +1,88 @@ +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:20:9 + | +LL | 5.0 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^ + | +note: lint level defined here + --> $DIR/issue-41255.rs:15:11 + | +LL | #![forbid(illegal_floating_point_literal_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:22:9 + | +LL | 5.0f32 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:24:10 + | +LL | -5.0 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:26:9 + | +LL | 1.0 .. 33.0 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:26:16 + | +LL | 1.0 .. 33.0 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:30:9 + | +LL | 39.0 ..= 70.0 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:30:18 + | +LL | 39.0 ..= 70.0 => {}, //~ ERROR floating-point types cannot be used in patterns + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:39:10 + | +LL | (3.14, 1) => {}, //~ ERROR floating-point types cannot be used + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-41255.rs:46:18 + | +LL | Foo { x: 2.0 } => {}, //~ ERROR floating-point types cannot be used + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: aborting due to 9 previous errors + diff --git a/src/test/ui/issue-41394.rs b/src/test/ui/issue-41394.rs new file mode 100644 index 00000000000..89f11edaec8 --- /dev/null +++ b/src/test/ui/issue-41394.rs @@ -0,0 +1,20 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + A = "" + 1 + //~^ ERROR binary operation `+` cannot be applied to type `&str` +} + +enum Bar { + A = Foo::A as isize +} + +fn main() {} diff --git a/src/test/ui/issue-41394.stderr b/src/test/ui/issue-41394.stderr new file mode 100644 index 00000000000..9e4afb3b28a --- /dev/null +++ b/src/test/ui/issue-41394.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `&str` + --> $DIR/issue-41394.rs:12:9 + | +LL | A = "" + 1 + | ^^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `&str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/ui/issue-41726.nll.stderr b/src/test/ui/issue-41726.nll.stderr new file mode 100644 index 00000000000..feeb63e1ebb --- /dev/null +++ b/src/test/ui/issue-41726.nll.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow immutable item as mutable + --> $DIR/issue-41726.rs:15:9 + | +LL | things[src.as_str()].sort(); //~ ERROR cannot borrow immutable + | ^^^^^^^^^^^^^^^^^^^^ 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/issue-41726.rs b/src/test/ui/issue-41726.rs new file mode 100644 index 00000000000..c8cd9209bce --- /dev/null +++ b/src/test/ui/issue-41726.rs @@ -0,0 +1,17 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::collections::HashMap; +fn main() { + let things: HashMap> = HashMap::new(); + for src in things.keys() { + things[src.as_str()].sort(); //~ ERROR cannot borrow immutable + } +} diff --git a/src/test/ui/issue-41726.stderr b/src/test/ui/issue-41726.stderr new file mode 100644 index 00000000000..172309537bf --- /dev/null +++ b/src/test/ui/issue-41726.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow immutable indexed content as mutable + --> $DIR/issue-41726.rs:15:9 + | +LL | things[src.as_str()].sort(); //~ ERROR cannot borrow immutable + | ^^^^^^^^^^^^^^^^^^^^ 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/issue-41742.rs b/src/test/ui/issue-41742.rs new file mode 100644 index 00000000000..067531e036a --- /dev/null +++ b/src/test/ui/issue-41742.rs @@ -0,0 +1,35 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::{Index, IndexMut}; + +struct S; +struct H; + +impl S { + fn f(&mut self) {} +} + +impl Index for H { + type Output = S; + fn index(&self, index: u32) -> &S { + unimplemented!() + } +} + +impl IndexMut for H { + fn index_mut(&mut self, index: u32) -> &mut S { + unimplemented!() + } +} + +fn main() { + H["?"].f(); //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-41742.stderr b/src/test/ui/issue-41742.stderr new file mode 100644 index 00000000000..314b44f603a --- /dev/null +++ b/src/test/ui/issue-41742.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-41742.rs:34:7 + | +LL | H["?"].f(); //~ ERROR mismatched types + | ^^^ expected u32, found reference + | + = note: expected type `u32` + found type `&'static str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-41776.rs b/src/test/ui/issue-41776.rs new file mode 100644 index 00000000000..5f108e0a1ed --- /dev/null +++ b/src/test/ui/issue-41776.rs @@ -0,0 +1,13 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + include!(line!()); //~ ERROR argument must be a string literal +} diff --git a/src/test/ui/issue-41776.stderr b/src/test/ui/issue-41776.stderr new file mode 100644 index 00000000000..9742f091f04 --- /dev/null +++ b/src/test/ui/issue-41776.stderr @@ -0,0 +1,8 @@ +error: argument must be a string literal + --> $DIR/issue-41776.rs:12:14 + | +LL | include!(line!()); //~ ERROR argument must be a string literal + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-41880.rs b/src/test/ui/issue-41880.rs new file mode 100644 index 00000000000..23a2b78a769 --- /dev/null +++ b/src/test/ui/issue-41880.rs @@ -0,0 +1,39 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn iterate(initial: T, f: F) -> Iterate { + Iterate { + state: initial, + f: f, + } +} + +pub struct Iterate { + state: T, + f: F +} + +impl Iterator for Iterate where F: Fn(&T) -> T { + type Item = T; + + #[inline] + fn next(&mut self) -> Option { + self.state = (self.f)(&self.state); + Some(self.state.clone()) + } + #[inline] + fn size_hint(&self) -> (usize, Option) { (std::usize::MAX, None) } +} + +fn main() { + let a = iterate(0, |x| x+1); + println!("{:?}", a.iter().take(10).collect::>()); + //~^ ERROR no method named `iter` found for type `Iterate<{integer} +} diff --git a/src/test/ui/issue-41880.stderr b/src/test/ui/issue-41880.stderr new file mode 100644 index 00000000000..fa9fdbd8194 --- /dev/null +++ b/src/test/ui/issue-41880.stderr @@ -0,0 +1,12 @@ +error[E0599]: no method named `iter` found for type `Iterate<{integer}, [closure@$DIR/issue-41880.rs:36:24: 36:31]>` in the current scope + --> $DIR/issue-41880.rs:37:24 + | +LL | pub struct Iterate { + | ------------------------ method `iter` not found for this +... +LL | println!("{:?}", a.iter().take(10).collect::>()); + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-41974.rs b/src/test/ui/issue-41974.rs new file mode 100644 index 00000000000..5c9077783c7 --- /dev/null +++ b/src/test/ui/issue-41974.rs @@ -0,0 +1,24 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Copy, Clone)] +struct Flags; + +trait A { +} + +impl Drop for T where T: A { //~ ERROR E0119 + //~^ ERROR E0120 + //~| ERROR E0210 + fn drop(&mut self) { + } +} + +fn main() {} diff --git a/src/test/ui/issue-41974.stderr b/src/test/ui/issue-41974.stderr new file mode 100644 index 00000000000..eca40ed4355 --- /dev/null +++ b/src/test/ui/issue-41974.stderr @@ -0,0 +1,29 @@ +error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_>`: + --> $DIR/issue-41974.rs:17:1 + | +LL | impl Drop for T where T: A { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: conflicting implementation in crate `alloc`: + - impl std::ops::Drop for std::boxed::Box + where T: ?Sized; + = note: downstream crates may implement trait `A` for type `std::boxed::Box<_>` + +error[E0120]: the Drop trait may only be implemented on structures + --> $DIR/issue-41974.rs:17:18 + | +LL | impl Drop for T where T: A { //~ ERROR E0119 + | ^ implementing Drop requires a struct + +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct`) + --> $DIR/issue-41974.rs:17:1 + | +LL | impl Drop for T where T: A { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to 3 previous errors + +Some errors occurred: E0119, E0120, E0210. +For more information about an error, try `rustc --explain E0119`. diff --git a/src/test/ui/issue-41998.rs b/src/test/ui/issue-41998.rs new file mode 100644 index 00000000000..406aadcd212 --- /dev/null +++ b/src/test/ui/issue-41998.rs @@ -0,0 +1,20 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +#[rustc_error] +fn main() { //~ ERROR compilation successful + if ('x' as char) < ('y' as char) { + print!("x"); + } else { + print!("y"); + } +} diff --git a/src/test/ui/issue-41998.stderr b/src/test/ui/issue-41998.stderr new file mode 100644 index 00000000000..e757c7f3a44 --- /dev/null +++ b/src/test/ui/issue-41998.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/issue-41998.rs:14:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | if ('x' as char) < ('y' as char) { +LL | | print!("x"); +LL | | } else { +LL | | print!("y"); +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-4201.rs b/src/test/ui/issue-4201.rs new file mode 100644 index 00000000000..b1f668d9c5e --- /dev/null +++ b/src/test/ui/issue-4201.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let a = if true { + 0 + } else if false { +//~^ ERROR if may be missing an else clause +//~| expected type `()` +//~| found type `{integer}` +//~| expected (), found integral variable + 1 + }; +} diff --git a/src/test/ui/issue-4201.stderr b/src/test/ui/issue-4201.stderr new file mode 100644 index 00000000000..40de077ce76 --- /dev/null +++ b/src/test/ui/issue-4201.stderr @@ -0,0 +1,19 @@ +error[E0317]: if may be missing an else clause + --> $DIR/issue-4201.rs:14:12 + | +LL | } else if false { + | ____________^ +LL | | //~^ ERROR if may be missing an else clause +LL | | //~| expected type `()` +LL | | //~| found type `{integer}` +LL | | //~| expected (), found integral variable +LL | | 1 +LL | | }; + | |_____^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0317`. diff --git a/src/test/ui/issue-42312.rs b/src/test/ui/issue-42312.rs new file mode 100644 index 00000000000..f7705297dfd --- /dev/null +++ b/src/test/ui/issue-42312.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::Deref; + +pub trait Foo { + fn baz(_: Self::Target) where Self: Deref {} + //~^ ERROR the size for values of type +} + +pub fn f(_: ToString) {} +//~^ ERROR the size for values of type + +fn main() { } diff --git a/src/test/ui/issue-42312.stderr b/src/test/ui/issue-42312.stderr new file mode 100644 index 00000000000..ae6496c037a --- /dev/null +++ b/src/test/ui/issue-42312.stderr @@ -0,0 +1,22 @@ +error[E0277]: the size for values of type `::Target` cannot be known at compilation time + --> $DIR/issue-42312.rs:14:29 + | +LL | fn baz(_: Self::Target) where Self: Deref {} + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `::Target` + = note: to learn more, visit + = help: consider adding a `where ::Target: std::marker::Sized` bound + +error[E0277]: the size for values of type `(dyn std::string::ToString + 'static)` cannot be known at compilation time + --> $DIR/issue-42312.rs:18:23 + | +LL | pub fn f(_: ToString) {} + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)` + = note: to learn more, visit + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-42344.nll.stderr b/src/test/ui/issue-42344.nll.stderr new file mode 100644 index 00000000000..02f6ffe1734 --- /dev/null +++ b/src/test/ui/issue-42344.nll.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow immutable item `*TAB[..]` as mutable + --> $DIR/issue-42344.rs:14:5 + | +LL | TAB[0].iter_mut(); //~ ERROR cannot borrow data mutably in a `&` reference [E0389] + | ^^^^^^ 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/issue-42344.rs b/src/test/ui/issue-42344.rs new file mode 100644 index 00000000000..2f11ff402be --- /dev/null +++ b/src/test/ui/issue-42344.rs @@ -0,0 +1,17 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +static TAB: [&mut [u8]; 0] = []; + +pub unsafe fn test() { + TAB[0].iter_mut(); //~ ERROR cannot borrow data mutably in a `&` reference [E0389] +} + +pub fn main() {} diff --git a/src/test/ui/issue-42344.stderr b/src/test/ui/issue-42344.stderr new file mode 100644 index 00000000000..92bbe70d9ce --- /dev/null +++ b/src/test/ui/issue-42344.stderr @@ -0,0 +1,9 @@ +error[E0389]: cannot borrow data mutably in a `&` reference + --> $DIR/issue-42344.rs:14:5 + | +LL | TAB[0].iter_mut(); //~ ERROR cannot borrow data mutably in a `&` reference [E0389] + | ^^^^^^ assignment into an immutable reference + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0389`. diff --git a/src/test/ui/issue-4265.rs b/src/test/ui/issue-4265.rs new file mode 100644 index 00000000000..62db68dcbb2 --- /dev/null +++ b/src/test/ui/issue-4265.rs @@ -0,0 +1,24 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { + baz: usize +} + +impl Foo { + fn bar() { + Foo { baz: 0 }.bar(); + } + + fn bar() { //~ ERROR duplicate definitions + } +} + +fn main() {} diff --git a/src/test/ui/issue-4265.stderr b/src/test/ui/issue-4265.stderr new file mode 100644 index 00000000000..8f22c6757c2 --- /dev/null +++ b/src/test/ui/issue-4265.stderr @@ -0,0 +1,15 @@ +error[E0201]: duplicate definitions with name `bar`: + --> $DIR/issue-4265.rs:20:5 + | +LL | / fn bar() { +LL | | Foo { baz: 0 }.bar(); +LL | | } + | |_____- previous definition of `bar` here +LL | +LL | / fn bar() { //~ ERROR duplicate definitions +LL | | } + | |_____^ duplicate definition + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/ui/issue-42755.rs b/src/test/ui/issue-42755.rs new file mode 100644 index 00000000000..7547c4a17be --- /dev/null +++ b/src/test/ui/issue-42755.rs @@ -0,0 +1,17 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(macro_vis_matcher)] + +macro_rules! foo { + ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree +} + +foo!(a); diff --git a/src/test/ui/issue-42755.stderr b/src/test/ui/issue-42755.stderr new file mode 100644 index 00000000000..91439061996 --- /dev/null +++ b/src/test/ui/issue-42755.stderr @@ -0,0 +1,13 @@ +error: repetition matches empty token tree + --> $DIR/issue-42755.rs:14:7 + | +LL | ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree + | ^^^^^^^^ + +error[E0601]: `main` function not found in crate `issue_42755` + | + = note: consider adding a `main` function to `$DIR/issue-42755.rs` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/issue-42796.nll.stderr b/src/test/ui/issue-42796.nll.stderr new file mode 100644 index 00000000000..fda7cf9ae8e --- /dev/null +++ b/src/test/ui/issue-42796.nll.stderr @@ -0,0 +1,14 @@ +error[E0382]: borrow of moved value: `s` + --> $DIR/issue-42796.rs:28:20 + | +LL | let mut s_copy = s; + | - value moved here +... +LL | println!("{}", s); //~ ERROR use of moved value + | ^ value borrowed here after move + | + = note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-42796.rs b/src/test/ui/issue-42796.rs new file mode 100644 index 00000000000..b07c23c3fc7 --- /dev/null +++ b/src/test/ui/issue-42796.rs @@ -0,0 +1,29 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Mirror { + type Image; +} + +impl Mirror for T { + type Image = T; +} + +pub fn poison(victim: String) where >::Image: Copy { + loop { drop(victim); } +} + +fn main() { + let s = "Hello!".to_owned(); + let mut s_copy = s; + s_copy.push_str("World!"); + "0wned!".to_owned(); + println!("{}", s); //~ ERROR use of moved value +} diff --git a/src/test/ui/issue-42796.stderr b/src/test/ui/issue-42796.stderr new file mode 100644 index 00000000000..9c2481b2f90 --- /dev/null +++ b/src/test/ui/issue-42796.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `s` + --> $DIR/issue-42796.rs:28:20 + | +LL | let mut s_copy = s; + | ---------- value moved here +... +LL | println!("{}", s); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-42880.rs b/src/test/ui/issue-42880.rs new file mode 100644 index 00000000000..ebb1ec425d1 --- /dev/null +++ b/src/test/ui/issue-42880.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +type Value = String; + +fn main() { + let f = |&Value::String(_)| (); //~ ERROR no associated item named + + let vec: Vec = Vec::new(); + vec.last().map(f); +} diff --git a/src/test/ui/issue-42880.stderr b/src/test/ui/issue-42880.stderr new file mode 100644 index 00000000000..cf1c3022a22 --- /dev/null +++ b/src/test/ui/issue-42880.stderr @@ -0,0 +1,9 @@ +error[E0599]: no associated item named `String` found for type `std::string::String` in the current scope + --> $DIR/issue-42880.rs:14:15 + | +LL | let f = |&Value::String(_)| (); //~ ERROR no associated item named + | ^^^^^^^^^^^^^^^^ associated item not found in `std::string::String` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-43023.rs b/src/test/ui/issue-43023.rs new file mode 100644 index 00000000000..6a5f7a1136a --- /dev/null +++ b/src/test/ui/issue-43023.rs @@ -0,0 +1,28 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S; + +impl S { + #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions + fn f() { + file!(); + } +} + +trait Tr1 { + #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions + fn f(); +} + +trait Tr2 { + #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions + type F; +} diff --git a/src/test/ui/issue-43023.stderr b/src/test/ui/issue-43023.stderr new file mode 100644 index 00000000000..2aa1efa9ca8 --- /dev/null +++ b/src/test/ui/issue-43023.stderr @@ -0,0 +1,20 @@ +error: `derive` may only be applied to structs, enums and unions + --> $DIR/issue-43023.rs:14:5 + | +LL | #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/issue-43023.rs:21:5 + | +LL | #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/issue-43023.rs:26:5 + | +LL | #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/issue-43105.rs b/src/test/ui/issue-43105.rs new file mode 100644 index 00000000000..8a0471135af --- /dev/null +++ b/src/test/ui/issue-43105.rs @@ -0,0 +1,22 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn xyz() -> u8 { 42 } + +const NUM: u8 = xyz(); +//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants + +fn main() { + match 1 { + NUM => unimplemented!(), + //~^ ERROR could not evaluate constant pattern + _ => unimplemented!(), + } +} diff --git a/src/test/ui/issue-43105.stderr b/src/test/ui/issue-43105.stderr new file mode 100644 index 00000000000..18da9310503 --- /dev/null +++ b/src/test/ui/issue-43105.stderr @@ -0,0 +1,19 @@ +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-43105.rs:13:17 + | +LL | const NUM: u8 = xyz(); + | ^^^^^ + +error[E0080]: could not evaluate constant pattern + --> $DIR/issue-43105.rs:18:9 + | +LL | const NUM: u8 = xyz(); + | ----- calling non-const fn `xyz` +... +LL | NUM => unimplemented!(), + | ^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0015, E0080. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-43162.rs b/src/test/ui/issue-43162.rs new file mode 100644 index 00000000000..b236283f757 --- /dev/null +++ b/src/test/ui/issue-43162.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() -> bool { + //~^ ERROR E0308 + break true; //~ ERROR E0268 +} + +fn main() { + break {}; //~ ERROR E0268 +} diff --git a/src/test/ui/issue-43162.stderr b/src/test/ui/issue-43162.stderr new file mode 100644 index 00000000000..4b3b4638f26 --- /dev/null +++ b/src/test/ui/issue-43162.stderr @@ -0,0 +1,30 @@ +error[E0268]: `break` outside of loop + --> $DIR/issue-43162.rs:13:5 + | +LL | break true; //~ ERROR E0268 + | ^^^^^^^^^^ cannot break outside of a loop + +error[E0268]: `break` outside of loop + --> $DIR/issue-43162.rs:17:5 + | +LL | break {}; //~ ERROR E0268 + | ^^^^^^^^ cannot break outside of a loop + +error[E0308]: mismatched types + --> $DIR/issue-43162.rs:11:18 + | +LL | fn foo() -> bool { + | __________________^ +LL | | //~^ ERROR E0308 +LL | | break true; //~ ERROR E0268 + | | - help: consider removing this semicolon +LL | | } + | |_^ expected bool, found () + | + = note: expected type `bool` + found type `()` + +error: aborting due to 3 previous errors + +Some errors occurred: E0268, E0308. +For more information about an error, try `rustc --explain E0268`. diff --git a/src/test/ui/issue-4321.rs b/src/test/ui/issue-4321.rs new file mode 100644 index 00000000000..d589680b0ec --- /dev/null +++ b/src/test/ui/issue-4321.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let tup = (true, true); + println!("foo {:}", match tup { //~ ERROR non-exhaustive patterns: `(true, false)` not covered + (false, false) => "foo", + (false, true) => "bar", + (true, true) => "baz" + }); +} diff --git a/src/test/ui/issue-4321.stderr b/src/test/ui/issue-4321.stderr new file mode 100644 index 00000000000..db52cd557f1 --- /dev/null +++ b/src/test/ui/issue-4321.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `(true, false)` not covered + --> $DIR/issue-4321.rs:13:31 + | +LL | println!("foo {:}", match tup { //~ ERROR non-exhaustive patterns: `(true, false)` not covered + | ^^^ pattern `(true, false)` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-43250.rs b/src/test/ui/issue-43250.rs new file mode 100644 index 00000000000..e1d34f339dc --- /dev/null +++ b/src/test/ui/issue-43250.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let mut y; + const C: u32 = 0; + macro_rules! m { + ($a:expr) => { + let $a = 0; + } + } + m!(y); + //~^ ERROR arbitrary expressions aren't allowed in patterns + m!(C); + //~^ ERROR arbitrary expressions aren't allowed in patterns +} diff --git a/src/test/ui/issue-43250.stderr b/src/test/ui/issue-43250.stderr new file mode 100644 index 00000000000..a05d4d41cc7 --- /dev/null +++ b/src/test/ui/issue-43250.stderr @@ -0,0 +1,14 @@ +error: arbitrary expressions aren't allowed in patterns + --> $DIR/issue-43250.rs:19:8 + | +LL | m!(y); + | ^ + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/issue-43250.rs:21:8 + | +LL | m!(C); + | ^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-43355.rs b/src/test/ui/issue-43355.rs new file mode 100644 index 00000000000..d793a78799a --- /dev/null +++ b/src/test/ui/issue-43355.rs @@ -0,0 +1,30 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Trait1 { + type Output; +} + +pub trait Trait2 {} + +pub struct A; + +impl Trait1 for T where T: Trait2 { + type Output = (); +} + +impl Trait1> for A { +//~^ ERROR conflicting implementations of trait +//~| hard error +//~| downstream crates may implement trait `Trait2>` for type `A` + type Output = i32; +} + +fn main() {} diff --git a/src/test/ui/issue-43355.stderr b/src/test/ui/issue-43355.stderr new file mode 100644 index 00000000000..dbcf1b52b89 --- /dev/null +++ b/src/test/ui/issue-43355.stderr @@ -0,0 +1,16 @@ +error: conflicting implementations of trait `Trait1>` for type `A`: (E0119) + --> $DIR/issue-43355.rs:23:1 + | +LL | impl Trait1 for T where T: Trait2 { + | --------------------------------------------- first implementation here +... +LL | impl Trait1> for A { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A` + | + = note: #[deny(incoherent_fundamental_impls)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #46205 + = note: downstream crates may implement trait `Trait2>` for type `A` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-43424.rs b/src/test/ui/issue-43424.rs new file mode 100644 index 00000000000..431fc8a5aa2 --- /dev/null +++ b/src/test/ui/issue-43424.rs @@ -0,0 +1,22 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused)] + +macro_rules! m { + ($attr_path: path) => { + #[$attr_path] + fn f() {} + } +} + +m!(inline); //~ ERROR: unexpected generic arguments in path + +fn main() {} diff --git a/src/test/ui/issue-43424.stderr b/src/test/ui/issue-43424.stderr new file mode 100644 index 00000000000..3a9a3164703 --- /dev/null +++ b/src/test/ui/issue-43424.stderr @@ -0,0 +1,8 @@ +error: unexpected generic arguments in path + --> $DIR/issue-43424.rs:20:4 + | +LL | m!(inline); //~ ERROR: unexpected generic arguments in path + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-43431.rs b/src/test/ui/issue-43431.rs new file mode 100644 index 00000000000..1e6366e068a --- /dev/null +++ b/src/test/ui/issue-43431.rs @@ -0,0 +1,24 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(fn_traits)] + +trait CallSingle { + fn call(&self, a: A) -> B where Self: Sized, Self: Fn(A) -> B; +} + +impl B> CallSingle for F { + fn call(&self, a: A) -> B { + B>::call(self, (a,)) + //~^ ERROR associated type bindings are not allowed here + } +} + +fn main() {} diff --git a/src/test/ui/issue-43431.stderr b/src/test/ui/issue-43431.stderr new file mode 100644 index 00000000000..3eb8fac6c0f --- /dev/null +++ b/src/test/ui/issue-43431.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-43431.rs:19:27 + | +LL | B>::call(self, (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/issue-4366-2.rs b/src/test/ui/issue-4366-2.rs new file mode 100644 index 00000000000..33abc196a6b --- /dev/null +++ b/src/test/ui/issue-4366-2.rs @@ -0,0 +1,36 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ensures that 'use foo:*' doesn't import non-public item + +use m1::*; + +mod foo { + pub fn foo() {} +} +mod a { + pub mod b { + use foo::foo; + type bar = isize; + } + pub mod sub { + use a::b::*; + fn sub() -> bar { 1 } + //~^ ERROR cannot find type `bar` in this scope + } +} + +mod m1 { + fn foo() {} +} + +fn main() { + foo(); //~ ERROR expected function, found module `foo` +} diff --git a/src/test/ui/issue-4366-2.stderr b/src/test/ui/issue-4366-2.stderr new file mode 100644 index 00000000000..1c9a9eb25c3 --- /dev/null +++ b/src/test/ui/issue-4366-2.stderr @@ -0,0 +1,26 @@ +error[E0412]: cannot find type `bar` in this scope + --> $DIR/issue-4366-2.rs:25:21 + | +LL | fn sub() -> bar { 1 } + | ^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use a::b::bar; + | + +error[E0423]: expected function, found module `foo` + --> $DIR/issue-4366-2.rs:35:5 + | +LL | foo(); //~ ERROR expected function, found module `foo` + | ^^^ not a function +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo::foo; + | +LL | use m1::foo; + | + +error: aborting due to 2 previous errors + +Some errors occurred: E0412, E0423. +For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/issue-4366.rs b/src/test/ui/issue-4366.rs new file mode 100644 index 00000000000..47fd426592c --- /dev/null +++ b/src/test/ui/issue-4366.rs @@ -0,0 +1,36 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// regression test for issue 4366 + +// ensures that 'use foo:*' doesn't import non-public 'use' statements in the +// module 'foo' + +use m1::*; + +mod foo { + pub fn foo() {} +} +mod a { + pub mod b { + use foo::foo; + type bar = isize; + } + pub mod sub { + use a::b::*; + fn sub() -> isize { foo(); 1 } //~ ERROR cannot find function `foo` in this scope + } +} + +mod m1 { + fn foo() {} +} + +fn main() {} diff --git a/src/test/ui/issue-4366.stderr b/src/test/ui/issue-4366.stderr new file mode 100644 index 00000000000..e78aec9d0e8 --- /dev/null +++ b/src/test/ui/issue-4366.stderr @@ -0,0 +1,15 @@ +error[E0425]: cannot find function `foo` in this scope + --> $DIR/issue-4366.rs:28:29 + | +LL | fn sub() -> isize { foo(); 1 } //~ ERROR cannot find function `foo` in this scope + | ^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use foo::foo; + | +LL | use m1::foo; + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/issue-43733-2.rs b/src/test/ui/issue-43733-2.rs new file mode 100644 index 00000000000..a5ba9ef9bd3 --- /dev/null +++ b/src/test/ui/issue-43733-2.rs @@ -0,0 +1,39 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(const_fn)] +#![feature(cfg_target_thread_local, thread_local_internals)] + +// On platforms *without* `#[thread_local]`, use +// a custom non-`Sync` type to fake the same error. +#[cfg(not(target_thread_local))] +struct Key { + _data: std::cell::UnsafeCell>, + _flag: std::cell::Cell, +} + +#[cfg(not(target_thread_local))] +impl Key { + const fn new() -> Self { + Key { + _data: std::cell::UnsafeCell::new(None), + _flag: std::cell::Cell::new(false), + } + } +} + +#[cfg(target_thread_local)] +use std::thread::__FastLocalKeyInner as Key; + +static __KEY: Key<()> = Key::new(); +//~^ ERROR `std::cell::UnsafeCell>` cannot be shared between threads +//~| ERROR `std::cell::Cell` cannot be shared between threads safely [E0277] + +fn main() {} diff --git a/src/test/ui/issue-43733-2.stderr b/src/test/ui/issue-43733-2.stderr new file mode 100644 index 00000000000..8eb150ff833 --- /dev/null +++ b/src/test/ui/issue-43733-2.stderr @@ -0,0 +1,23 @@ +error[E0277]: `std::cell::UnsafeCell>` cannot be shared between threads safely + --> $DIR/issue-43733-2.rs:35:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell>` cannot be shared between threads safely + | + = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell>` + = note: required because it appears within the type `std::thread::Key<()>` + = note: shared static variables must have a type that implements `Sync` + +error[E0277]: `std::cell::Cell` cannot be shared between threads safely + --> $DIR/issue-43733-2.rs:35:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely + | + = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell` + = note: required because it appears within the type `std::thread::Key<()>` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-43733.rs b/src/test/ui/issue-43733.rs new file mode 100644 index 00000000000..7b1364ff41c --- /dev/null +++ b/src/test/ui/issue-43733.rs @@ -0,0 +1,43 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(const_fn)] +#![feature(thread_local)] +#![feature(cfg_target_thread_local, thread_local_internals)] + +type Foo = std::cell::RefCell; + +#[cfg(target_thread_local)] +#[thread_local] +static __KEY: std::thread::__FastLocalKeyInner = + std::thread::__FastLocalKeyInner::new(); + +#[cfg(not(target_thread_local))] +static __KEY: std::thread::__OsLocalKeyInner = + std::thread::__OsLocalKeyInner::new(); + +fn __getit() -> std::option::Option< + &'static std::cell::UnsafeCell< + std::option::Option>> +{ + __KEY.get() //~ ERROR call to unsafe function is unsafe +} + +static FOO: std::thread::LocalKey = + std::thread::LocalKey::new(__getit, Default::default); +//~^ ERROR call to unsafe function is unsafe + +fn main() { + FOO.with(|foo| println!("{}", foo.borrow())); + std::thread::spawn(|| { + FOO.with(|foo| *foo.borrow_mut() += "foo"); + }).join().unwrap(); + FOO.with(|foo| println!("{}", foo.borrow())); +} diff --git a/src/test/ui/issue-43733.stderr b/src/test/ui/issue-43733.stderr new file mode 100644 index 00000000000..5f91d3d2266 --- /dev/null +++ b/src/test/ui/issue-43733.stderr @@ -0,0 +1,19 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/issue-43733.rs:30:5 + | +LL | __KEY.get() //~ ERROR call to unsafe function is unsafe + | ^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/issue-43733.rs:34:5 + | +LL | std::thread::LocalKey::new(__getit, Default::default); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/issue-43784-associated-type.rs b/src/test/ui/issue-43784-associated-type.rs new file mode 100644 index 00000000000..94b5c0034a7 --- /dev/null +++ b/src/test/ui/issue-43784-associated-type.rs @@ -0,0 +1,25 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Partial: Copy { +} + +pub trait Complete { + type Assoc: Partial; +} + +impl Partial for T::Assoc where + T: Complete +{ +} + +impl Complete for T { //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied + type Assoc = T; +} diff --git a/src/test/ui/issue-43784-associated-type.stderr b/src/test/ui/issue-43784-associated-type.stderr new file mode 100644 index 00000000000..798d8c66016 --- /dev/null +++ b/src/test/ui/issue-43784-associated-type.stderr @@ -0,0 +1,16 @@ +error[E0601]: `main` function not found in crate `issue_43784_associated_type` + | + = note: consider adding a `main` function to `$DIR/issue-43784-associated-type.rs` + +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/issue-43784-associated-type.rs:23:9 + | +LL | impl Complete for T { //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied + | ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0601. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-43784-supertrait.rs b/src/test/ui/issue-43784-supertrait.rs new file mode 100644 index 00000000000..e70df113da3 --- /dev/null +++ b/src/test/ui/issue-43784-supertrait.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Partial: Copy { +} + +pub trait Complete: Partial { +} + +impl Partial for T where T: Complete {} +impl Complete for T {} //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied diff --git a/src/test/ui/issue-43784-supertrait.stderr b/src/test/ui/issue-43784-supertrait.stderr new file mode 100644 index 00000000000..8646b315abd --- /dev/null +++ b/src/test/ui/issue-43784-supertrait.stderr @@ -0,0 +1,16 @@ +error[E0601]: `main` function not found in crate `issue_43784_supertrait` + | + = note: consider adding a `main` function to `$DIR/issue-43784-supertrait.rs` + +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/issue-43784-supertrait.rs:18:9 + | +LL | impl Complete for T {} //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied + | ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0601. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-43925.rs b/src/test/ui/issue-43925.rs new file mode 100644 index 00000000000..8ad57647290 --- /dev/null +++ b/src/test/ui/issue-43925.rs @@ -0,0 +1,16 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(attr_literals)] + +#[link(name="foo", cfg("rlib"))] //~ ERROR invalid argument for `cfg(..)` +extern {} + +fn main() {} diff --git a/src/test/ui/issue-43925.stderr b/src/test/ui/issue-43925.stderr new file mode 100644 index 00000000000..995289aec01 --- /dev/null +++ b/src/test/ui/issue-43925.stderr @@ -0,0 +1,8 @@ +error: invalid argument for `cfg(..)` + --> $DIR/issue-43925.rs:13:24 + | +LL | #[link(name="foo", cfg("rlib"))] //~ ERROR invalid argument for `cfg(..)` + | ^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-43926.rs b/src/test/ui/issue-43926.rs new file mode 100644 index 00000000000..5d510b643a3 --- /dev/null +++ b/src/test/ui/issue-43926.rs @@ -0,0 +1,14 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[link(name="foo", cfg())] //~ ERROR `cfg()` must have an argument +extern {} + +fn main() {} diff --git a/src/test/ui/issue-43926.stderr b/src/test/ui/issue-43926.stderr new file mode 100644 index 00000000000..9719a87b31b --- /dev/null +++ b/src/test/ui/issue-43926.stderr @@ -0,0 +1,8 @@ +error: `cfg()` must have an argument + --> $DIR/issue-43926.rs:11:1 + | +LL | #[link(name="foo", cfg())] //~ ERROR `cfg()` must have an argument + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-43988.rs b/src/test/ui/issue-43988.rs new file mode 100644 index 00000000000..6361af76482 --- /dev/null +++ b/src/test/ui/issue-43988.rs @@ -0,0 +1,49 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(stmt_expr_attributes)] + +fn main() { + + #[inline] + let _a = 4; + //~^^ ERROR attribute should be applied to function or closure + + + #[inline(XYZ)] + let _b = 4; + //~^^ ERROR attribute should be applied to function or closure + + #[repr(nothing)] + let _x = 0; + //~^^ ERROR attribute should not be applied to a statement + + #[repr(something_not_real)] + loop { + () + }; + //~^^^^ ERROR attribute should not be applied to an expression + + #[repr] + let _y = "123"; + //~^^ ERROR attribute should not be applied to a statement + //~| WARN `repr` attribute must have a hint + + + fn foo() {} + + #[inline(ABC)] + foo(); + //~^^ ERROR attribute should be applied to function or closure + + let _z = #[repr] 1; + //~^ ERROR attribute should not be applied to an expression + //~| WARN `repr` attribute must have a hint +} diff --git a/src/test/ui/issue-43988.stderr b/src/test/ui/issue-43988.stderr new file mode 100644 index 00000000000..7237851f778 --- /dev/null +++ b/src/test/ui/issue-43988.stderr @@ -0,0 +1,79 @@ +warning: `repr` attribute must have a hint + --> $DIR/issue-43988.rs:34:5 + | +LL | #[repr] + | ^^^^^^^ needs a hint + | + = note: #[warn(bad_repr)] on by default + = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` + = note: for more information, visit + +warning: `repr` attribute must have a hint + --> $DIR/issue-43988.rs:46:14 + | +LL | let _z = #[repr] 1; + | ^^^^^^^ needs a hint + | + = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` + = note: for more information, visit + +error[E0518]: attribute should be applied to function or closure + --> $DIR/issue-43988.rs:15:5 + | +LL | #[inline] + | ^^^^^^^^^ +LL | let _a = 4; + | ----------- not a function or closure + +error[E0518]: attribute should be applied to function or closure + --> $DIR/issue-43988.rs:20:5 + | +LL | #[inline(XYZ)] + | ^^^^^^^^^^^^^^ +LL | let _b = 4; + | ----------- not a function or closure + +error[E0517]: attribute should not be applied to a statement + --> $DIR/issue-43988.rs:24:5 + | +LL | #[repr(nothing)] + | ^^^^^^^^^^^^^^^^ +LL | let _x = 0; + | ----------- not a struct, enum or union + +error[E0517]: attribute should not be applied to an expression + --> $DIR/issue-43988.rs:28:5 + | +LL | #[repr(something_not_real)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | / loop { +LL | | () +LL | | }; + | |_____- not defining a struct, enum or union + +error[E0517]: attribute should not be applied to a statement + --> $DIR/issue-43988.rs:34:5 + | +LL | #[repr] + | ^^^^^^^ +LL | let _y = "123"; + | --------------- not a struct, enum or union + +error[E0518]: attribute should be applied to function or closure + --> $DIR/issue-43988.rs:42:5 + | +LL | #[inline(ABC)] + | ^^^^^^^^^^^^^^ +LL | foo(); + | ----- not a function or closure + +error[E0517]: attribute should not be applied to an expression + --> $DIR/issue-43988.rs:46:14 + | +LL | let _z = #[repr] 1; + | ^^^^^^^ - not defining a struct, enum or union + +error: aborting due to 7 previous errors + +Some errors occurred: E0517, E0518. +For more information about an error, try `rustc --explain E0517`. diff --git a/src/test/ui/issue-44021.rs b/src/test/ui/issue-44021.rs new file mode 100644 index 00000000000..b6ec21b94c7 --- /dev/null +++ b/src/test/ui/issue-44021.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct MyStruct; +impl MyStruct { + fn f() {|x, y} //~ ERROR expected one of `:`, `@`, or `|`, found `}` +} + +fn main() {} diff --git a/src/test/ui/issue-44021.stderr b/src/test/ui/issue-44021.stderr new file mode 100644 index 00000000000..2c74531cf24 --- /dev/null +++ b/src/test/ui/issue-44021.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `@`, or `|`, found `}` + --> $DIR/issue-44021.rs:13:18 + | +LL | fn f() {|x, y} //~ ERROR expected one of `:`, `@`, or `|`, found `}` + | ^ expected one of `:`, `@`, or `|` here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-44239.rs b/src/test/ui/issue-44239.rs new file mode 100644 index 00000000000..131c6526642 --- /dev/null +++ b/src/test/ui/issue-44239.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let n = 0; + + struct Foo; + impl Foo { + const N: usize = n; + //~^ ERROR attempt to use a non-constant value + } +} diff --git a/src/test/ui/issue-44239.stderr b/src/test/ui/issue-44239.stderr new file mode 100644 index 00000000000..43d4968a89f --- /dev/null +++ b/src/test/ui/issue-44239.stderr @@ -0,0 +1,9 @@ +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/issue-44239.rs:16:26 + | +LL | const N: usize = n; + | ^ 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/issue-44373.rs b/src/test/ui/issue-44373.rs new file mode 100644 index 00000000000..d744ad11c5c --- /dev/null +++ b/src/test/ui/issue-44373.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +static FOO: u32 = 50; + +fn main() { + let _val: &'static [&'static u32] = &[&FOO]; //~ ERROR borrowed value does not live long enough +} diff --git a/src/test/ui/issue-44373.stderr b/src/test/ui/issue-44373.stderr new file mode 100644 index 00000000000..17a634ba747 --- /dev/null +++ b/src/test/ui/issue-44373.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-44373.rs:15:42 + | +LL | let _val: &'static [&'static u32] = &[&FOO]; //~ ERROR borrowed value does not live long enough + | ^^^^^^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-44415.rs b/src/test/ui/issue-44415.rs new file mode 100644 index 00000000000..5d295510844 --- /dev/null +++ b/src/test/ui/issue-44415.rs @@ -0,0 +1,23 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//~^^^^^^^^^^ ERROR cycle detected when computing layout of + +#![feature(const_fn)] +#![feature(core_intrinsics)] + +use std::intrinsics; + +struct Foo { + bytes: [u8; unsafe { intrinsics::size_of::() }], + x: usize, +} + +fn main() {} diff --git a/src/test/ui/issue-44415.stderr b/src/test/ui/issue-44415.stderr new file mode 100644 index 00000000000..ac2072c513e --- /dev/null +++ b/src/test/ui/issue-44415.stderr @@ -0,0 +1,18 @@ +error[E0391]: cycle detected when computing layout of `Foo` + | +note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`... +note: ...which requires const-evaluating `Foo::bytes::{{constant}}`... + --> $DIR/issue-44415.rs:19:26 + | +LL | bytes: [u8; unsafe { intrinsics::size_of::() }], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which again requires computing layout of `Foo`, completing the cycle +note: cycle used when const-evaluating `Foo::bytes::{{constant}}` + --> $DIR/issue-44415.rs:19:26 + | +LL | bytes: [u8; unsafe { intrinsics::size_of::() }], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-45087-unreachable-unsafe.rs b/src/test/ui/issue-45087-unreachable-unsafe.rs new file mode 100644 index 00000000000..5af0bf6be56 --- /dev/null +++ b/src/test/ui/issue-45087-unreachable-unsafe.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + return; + *(1 as *mut u32) = 42; + //~^ ERROR dereference of raw pointer is unsafe +} diff --git a/src/test/ui/issue-45087-unreachable-unsafe.stderr b/src/test/ui/issue-45087-unreachable-unsafe.stderr new file mode 100644 index 00000000000..8a967838bc3 --- /dev/null +++ b/src/test/ui/issue-45087-unreachable-unsafe.stderr @@ -0,0 +1,11 @@ +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/issue-45087-unreachable-unsafe.rs:13:5 + | +LL | *(1 as *mut u32) = 42; + | ^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer + | + = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/issue-4517.rs b/src/test/ui/issue-4517.rs new file mode 100644 index 00000000000..fbd8972cbfa --- /dev/null +++ b/src/test/ui/issue-4517.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn bar(int_param: usize) {} + +fn main() { + let foo: [u8; 4] = [1; 4]; + bar(foo); + //~^ ERROR mismatched types + //~| expected type `usize` + //~| found type `[u8; 4]` + //~| expected usize, found array of 4 elements +} diff --git a/src/test/ui/issue-4517.stderr b/src/test/ui/issue-4517.stderr new file mode 100644 index 00000000000..ca96c396fd0 --- /dev/null +++ b/src/test/ui/issue-4517.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-4517.rs:15:9 + | +LL | bar(foo); + | ^^^ expected usize, found array of 4 elements + | + = note: expected type `usize` + found type `[u8; 4]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-45199.ast.nll.stderr b/src/test/ui/issue-45199.ast.nll.stderr new file mode 100644 index 00000000000..ce39776252b --- /dev/null +++ b/src/test/ui/issue-45199.ast.nll.stderr @@ -0,0 +1,36 @@ +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:19:5 + | +LL | let b: Box; + | - consider changing this to `mut b` +LL | //[mir]~^ NOTE consider changing this to `mut b` +LL | b = Box::new(1); //[ast]~ NOTE first assignment + | - first assignment to `b` +LL | //[mir]~^ NOTE first assignment +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:29:5 + | +LL | let b = Box::new(1); //[ast]~ NOTE first assignment + | - + | | + | first assignment to `b` + | consider changing this to `mut b` +... +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign twice to immutable variable + +error[E0384]: cannot assign to immutable argument `b` + --> $DIR/issue-45199.rs:37:5 + | +LL | fn test_args(b: Box) { //[ast]~ NOTE first assignment + | - consider changing this to `mut b` +LL | //[mir]~^ NOTE consider changing this to `mut b` +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign to immutable argument + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/issue-45199.ast.stderr b/src/test/ui/issue-45199.ast.stderr new file mode 100644 index 00000000000..ff8f78b5116 --- /dev/null +++ b/src/test/ui/issue-45199.ast.stderr @@ -0,0 +1,30 @@ +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:19:5 + | +LL | b = Box::new(1); //[ast]~ NOTE first assignment + | --------------- first assignment to `b` +LL | //[mir]~^ NOTE first assignment +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:29:5 + | +LL | let b = Box::new(1); //[ast]~ NOTE first assignment + | - first assignment to `b` +... +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:37:5 + | +LL | fn test_args(b: Box) { //[ast]~ NOTE first assignment + | - first assignment to `b` +LL | //[mir]~^ NOTE consider changing this to `mut b` +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/issue-45199.mir.stderr b/src/test/ui/issue-45199.mir.stderr new file mode 100644 index 00000000000..ce39776252b --- /dev/null +++ b/src/test/ui/issue-45199.mir.stderr @@ -0,0 +1,36 @@ +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:19:5 + | +LL | let b: Box; + | - consider changing this to `mut b` +LL | //[mir]~^ NOTE consider changing this to `mut b` +LL | b = Box::new(1); //[ast]~ NOTE first assignment + | - first assignment to `b` +LL | //[mir]~^ NOTE first assignment +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/issue-45199.rs:29:5 + | +LL | let b = Box::new(1); //[ast]~ NOTE first assignment + | - + | | + | first assignment to `b` + | consider changing this to `mut b` +... +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign twice to immutable variable + +error[E0384]: cannot assign to immutable argument `b` + --> $DIR/issue-45199.rs:37:5 + | +LL | fn test_args(b: Box) { //[ast]~ NOTE first assignment + | - consider changing this to `mut b` +LL | //[mir]~^ NOTE consider changing this to `mut b` +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign to immutable argument + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/issue-45199.rs b/src/test/ui/issue-45199.rs new file mode 100644 index 00000000000..61e19ffc0d2 --- /dev/null +++ b/src/test/ui/issue-45199.rs @@ -0,0 +1,43 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions: ast mir +//[mir]compile-flags: -Zborrowck=mir + +fn test_drop_replace() { + let b: Box; + //[mir]~^ NOTE consider changing this to `mut b` + b = Box::new(1); //[ast]~ NOTE first assignment + //[mir]~^ NOTE first assignment + b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + //[mir]~^ ERROR cannot assign twice to immutable variable `b` + //[ast]~| NOTE cannot assign twice to immutable + //[mir]~| NOTE cannot assign twice to immutable +} + +fn test_call() { + let b = Box::new(1); //[ast]~ NOTE first assignment + //[mir]~^ NOTE first assignment + //[mir]~| NOTE consider changing this to `mut b` + b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + //[mir]~^ ERROR cannot assign twice to immutable variable `b` + //[ast]~| NOTE cannot assign twice to immutable + //[mir]~| NOTE cannot assign twice to immutable +} + +fn test_args(b: Box) { //[ast]~ NOTE first assignment + //[mir]~^ NOTE consider changing this to `mut b` + b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + //[mir]~^ ERROR cannot assign to immutable argument `b` + //[ast]~| NOTE cannot assign twice to immutable + //[mir]~| NOTE cannot assign to immutable argument +} + +fn main() {} diff --git a/src/test/ui/issue-45729-unsafe-in-generator.rs b/src/test/ui/issue-45729-unsafe-in-generator.rs new file mode 100644 index 00000000000..b42ced07583 --- /dev/null +++ b/src/test/ui/issue-45729-unsafe-in-generator.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(generators)] + +fn main() { + let _ = || { + *(1 as *mut u32) = 42; + //~^ ERROR dereference of raw pointer is unsafe + yield; + }; +} diff --git a/src/test/ui/issue-45729-unsafe-in-generator.stderr b/src/test/ui/issue-45729-unsafe-in-generator.stderr new file mode 100644 index 00000000000..3fad5209fd5 --- /dev/null +++ b/src/test/ui/issue-45729-unsafe-in-generator.stderr @@ -0,0 +1,11 @@ +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/issue-45729-unsafe-in-generator.rs:15:9 + | +LL | *(1 as *mut u32) = 42; + | ^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer + | + = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/issue-45801.rs b/src/test/ui/issue-45801.rs new file mode 100644 index 00000000000..7823a7d6ba8 --- /dev/null +++ b/src/test/ui/issue-45801.rs @@ -0,0 +1,35 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Params; + +pub trait Plugin { + type Error; +} + +pub trait Pluggable { + fn get_ref>(&mut self) -> Option { + None + } +} + +struct Foo; +impl Plugin for Params { + type Error = (); +} + +impl Pluggable for T {} + +fn handle(req: &mut i32) { + req.get_ref::(); + //~^ ERROR the trait bound `Params: Plugin` is not satisfied +} + +fn main() {} diff --git a/src/test/ui/issue-45801.stderr b/src/test/ui/issue-45801.stderr new file mode 100644 index 00000000000..91c14be8833 --- /dev/null +++ b/src/test/ui/issue-45801.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `Params: Plugin` is not satisfied + --> $DIR/issue-45801.rs:31:9 + | +LL | req.get_ref::(); + | ^^^^^^^ the trait `Plugin` is not implemented for `Params` + | + = help: the following implementations were found: + > + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-45965.rs b/src/test/ui/issue-45965.rs new file mode 100644 index 00000000000..0b82f2b32ff --- /dev/null +++ b/src/test/ui/issue-45965.rs @@ -0,0 +1,14 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let a = |r: f64| if r != 0.0(r != 0.0) { 1.0 } else { 0.0 }; + //~^ ERROR expected function, found `{float}` +} diff --git a/src/test/ui/issue-45965.stderr b/src/test/ui/issue-45965.stderr new file mode 100644 index 00000000000..2b3870feef3 --- /dev/null +++ b/src/test/ui/issue-45965.stderr @@ -0,0 +1,9 @@ +error[E0618]: expected function, found `{float}` + --> $DIR/issue-45965.rs:12:30 + | +LL | let a = |r: f64| if r != 0.0(r != 0.0) { 1.0 } else { 0.0 }; + | ^^^^^^^^^^^^^ not a function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-46023.ast.nll.stderr b/src/test/ui/issue-46023.ast.nll.stderr new file mode 100644 index 00000000000..2fc2924c2ec --- /dev/null +++ b/src/test/ui/issue-46023.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable item `x` + --> $DIR/issue-46023.rs:18:9 + | +LL | x = 1; + | ^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/issue-46023.ast.stderr b/src/test/ui/issue-46023.ast.stderr new file mode 100644 index 00000000000..42fe73d88e6 --- /dev/null +++ b/src/test/ui/issue-46023.ast.stderr @@ -0,0 +1,12 @@ +error[E0594]: cannot assign to captured outer variable in an `FnMut` closure + --> $DIR/issue-46023.rs:18:9 + | +LL | let x = 0; + | - help: consider making `x` mutable: `mut x` +... +LL | x = 1; + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/issue-46023.mir.stderr b/src/test/ui/issue-46023.mir.stderr new file mode 100644 index 00000000000..2fc2924c2ec --- /dev/null +++ b/src/test/ui/issue-46023.mir.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable item `x` + --> $DIR/issue-46023.rs:18:9 + | +LL | x = 1; + | ^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/issue-46023.rs b/src/test/ui/issue-46023.rs new file mode 100644 index 00000000000..d51d92570fd --- /dev/null +++ b/src/test/ui/issue-46023.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions: ast mir +//[mir]compile-flags: -Z emit-end-regions -Z borrowck=mir + +fn main() { + let x = 0; + + (move || { + x = 1; + //[mir]~^ ERROR cannot assign to immutable item `x` [E0594] + //[ast]~^^ ERROR cannot assign to captured outer variable in an `FnMut` closure [E0594] + })() +} diff --git a/src/test/ui/issue-46036.rs b/src/test/ui/issue-46036.rs new file mode 100644 index 00000000000..b5cdded4d30 --- /dev/null +++ b/src/test/ui/issue-46036.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Issue 46036: [NLL] false edges on infinite loops +// Infinite loops should create false edges to the cleanup block. +#![feature(nll)] + +struct Foo { x: &'static u32 } + +fn foo() { + let a = 3; + let foo = Foo { x: &a }; //~ ERROR E0597 + loop { } +} + +fn main() { } diff --git a/src/test/ui/issue-46036.stderr b/src/test/ui/issue-46036.stderr new file mode 100644 index 00000000000..e0df49f5823 --- /dev/null +++ b/src/test/ui/issue-46036.stderr @@ -0,0 +1,14 @@ +error[E0597]: `a` does not live long enough + --> $DIR/issue-46036.rs:19:24 + | +LL | let foo = Foo { x: &a }; //~ ERROR E0597 + | ^^ borrowed value does not live long enough +LL | loop { } +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-46311.rs b/src/test/ui/issue-46311.rs new file mode 100644 index 00000000000..82f55f2c142 --- /dev/null +++ b/src/test/ui/issue-46311.rs @@ -0,0 +1,14 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + 'break: loop { //~ ERROR invalid label name `'break` + } +} diff --git a/src/test/ui/issue-46311.stderr b/src/test/ui/issue-46311.stderr new file mode 100644 index 00000000000..790399c75ee --- /dev/null +++ b/src/test/ui/issue-46311.stderr @@ -0,0 +1,8 @@ +error: invalid label name `'break` + --> $DIR/issue-46311.rs:12:5 + | +LL | 'break: loop { //~ ERROR invalid label name `'break` + | ^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-46438.rs b/src/test/ui/issue-46438.rs new file mode 100644 index 00000000000..d84b5813385 --- /dev/null +++ b/src/test/ui/issue-46438.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! m { + ($my_type: ty) => { + impl $my_type for u8 {} + } +} + +trait Trait {} + +m!(Tr); + +m!(&'static u8); //~ ERROR expected a trait, found type + +fn main() {} diff --git a/src/test/ui/issue-46438.stderr b/src/test/ui/issue-46438.stderr new file mode 100644 index 00000000000..b0d6229d24b --- /dev/null +++ b/src/test/ui/issue-46438.stderr @@ -0,0 +1,8 @@ +error: expected a trait, found type + --> $DIR/issue-46438.rs:21:4 + | +LL | m!(&'static u8); //~ ERROR expected a trait, found type + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-46604.ast.nll.stderr b/src/test/ui/issue-46604.ast.nll.stderr new file mode 100644 index 00000000000..b947bec6397 --- /dev/null +++ b/src/test/ui/issue-46604.ast.nll.stderr @@ -0,0 +1,16 @@ +error[E0017]: references in statics may only refer to immutable values + --> $DIR/issue-46604.rs:14:25 + | +LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 + | ^^^^^^^^^^^^^^^^^^^^ statics require immutable values + +error[E0594]: cannot assign to immutable item `buf[..]` + --> $DIR/issue-46604.rs:20:5 + | +LL | buf[0]=2; //[ast]~ ERROR E0389 + | ^^^^^^^^ cannot assign + +error: aborting due to 2 previous errors + +Some errors occurred: E0017, E0594. +For more information about an error, try `rustc --explain E0017`. diff --git a/src/test/ui/issue-46604.ast.stderr b/src/test/ui/issue-46604.ast.stderr new file mode 100644 index 00000000000..713ba476a1c --- /dev/null +++ b/src/test/ui/issue-46604.ast.stderr @@ -0,0 +1,16 @@ +error[E0017]: references in statics may only refer to immutable values + --> $DIR/issue-46604.rs:14:25 + | +LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 + | ^^^^^^^^^^^^^^^^^^^^ statics require immutable values + +error[E0389]: cannot assign to data in a `&` reference + --> $DIR/issue-46604.rs:20:5 + | +LL | buf[0]=2; //[ast]~ ERROR E0389 + | ^^^^^^^^ assignment into an immutable reference + +error: aborting due to 2 previous errors + +Some errors occurred: E0017, E0389. +For more information about an error, try `rustc --explain E0017`. diff --git a/src/test/ui/issue-46604.mir.stderr b/src/test/ui/issue-46604.mir.stderr new file mode 100644 index 00000000000..b947bec6397 --- /dev/null +++ b/src/test/ui/issue-46604.mir.stderr @@ -0,0 +1,16 @@ +error[E0017]: references in statics may only refer to immutable values + --> $DIR/issue-46604.rs:14:25 + | +LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 + | ^^^^^^^^^^^^^^^^^^^^ statics require immutable values + +error[E0594]: cannot assign to immutable item `buf[..]` + --> $DIR/issue-46604.rs:20:5 + | +LL | buf[0]=2; //[ast]~ ERROR E0389 + | ^^^^^^^^ cannot assign + +error: aborting due to 2 previous errors + +Some errors occurred: E0017, E0594. +For more information about an error, try `rustc --explain E0017`. diff --git a/src/test/ui/issue-46604.rs b/src/test/ui/issue-46604.rs new file mode 100644 index 00000000000..dc14eca1e67 --- /dev/null +++ b/src/test/ui/issue-46604.rs @@ -0,0 +1,22 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions: ast mir +//[mir]compile-flags: -Z borrowck=mir + +static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 + //[mir]~^ ERROR E0017 +fn write>(buffer: T) { } + +fn main() { + write(&buf); + buf[0]=2; //[ast]~ ERROR E0389 + //[mir]~^ ERROR E0594 +} diff --git a/src/test/ui/issue-46771.rs b/src/test/ui/issue-46771.rs new file mode 100644 index 00000000000..f8bcd8861f3 --- /dev/null +++ b/src/test/ui/issue-46771.rs @@ -0,0 +1,14 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + struct Foo; + (1 .. 2).find(|_| Foo(0) == 0); //~ ERROR expected function, found `main::Foo` +} diff --git a/src/test/ui/issue-46771.stderr b/src/test/ui/issue-46771.stderr new file mode 100644 index 00000000000..0d57d61e9ff --- /dev/null +++ b/src/test/ui/issue-46771.stderr @@ -0,0 +1,11 @@ +error[E0618]: expected function, found `main::Foo` + --> $DIR/issue-46771.rs:13:23 + | +LL | struct Foo; + | ----------- `main::Foo` defined here +LL | (1 .. 2).find(|_| Foo(0) == 0); //~ ERROR expected function, found `main::Foo` + | ^^^^^^ not a function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-46843.rs b/src/test/ui/issue-46843.rs new file mode 100644 index 00000000000..d88b4e568b0 --- /dev/null +++ b/src/test/ui/issue-46843.rs @@ -0,0 +1,22 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Thing { This, That } + +fn non_const() -> Thing { + Thing::This +} + +pub const Q: i32 = match non_const() { //~ ERROR E0015 + Thing::This => 1, //~ ERROR unimplemented expression type + Thing::That => 0 +}; + +fn main() {} diff --git a/src/test/ui/issue-46843.stderr b/src/test/ui/issue-46843.stderr new file mode 100644 index 00000000000..9b752f41f59 --- /dev/null +++ b/src/test/ui/issue-46843.stderr @@ -0,0 +1,16 @@ +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-46843.rs:17:26 + | +LL | pub const Q: i32 = match non_const() { //~ ERROR E0015 + | ^^^^^^^^^^^ + +error[E0019]: constant contains unimplemented expression type + --> $DIR/issue-46843.rs:18:5 + | +LL | Thing::This => 1, //~ ERROR unimplemented expression type + | ^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0015, E0019. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-47309.rs b/src/test/ui/issue-47309.rs new file mode 100644 index 00000000000..1b9ff36f714 --- /dev/null +++ b/src/test/ui/issue-47309.rs @@ -0,0 +1,31 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure that the mono-item collector does not crash when trying to +// instantiate a default impl of a method with lifetime parameters. +// See https://github.com/rust-lang/rust/issues/47309 + +// compile-flags:-Clink-dead-code +// compile-pass + +#![crate_type="rlib"] + +pub trait EnvFuture { + type Item; + + fn boxed_result<'a>(self) where Self: Sized, Self::Item: 'a, { + } +} + +struct Foo; + +impl<'a> EnvFuture for &'a Foo { + type Item = (); +} diff --git a/src/test/ui/issue-4736.rs b/src/test/ui/issue-4736.rs new file mode 100644 index 00000000000..19803079d02 --- /dev/null +++ b/src/test/ui/issue-4736.rs @@ -0,0 +1,15 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct NonCopyable(()); + +fn main() { + let z = NonCopyable{ p: () }; //~ ERROR struct `NonCopyable` has no field named `p` +} diff --git a/src/test/ui/issue-4736.stderr b/src/test/ui/issue-4736.stderr new file mode 100644 index 00000000000..6c0acc0b63f --- /dev/null +++ b/src/test/ui/issue-4736.stderr @@ -0,0 +1,9 @@ +error[E0560]: struct `NonCopyable` has no field named `p` + --> $DIR/issue-4736.rs:14:26 + | +LL | let z = NonCopyable{ p: () }; //~ ERROR struct `NonCopyable` has no field named `p` + | ^ field does not exist - did you mean `0`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0560`. diff --git a/src/test/ui/issue-47412.rs b/src/test/ui/issue-47412.rs new file mode 100644 index 00000000000..683ef876f4e --- /dev/null +++ b/src/test/ui/issue-47412.rs @@ -0,0 +1,31 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Copy, Clone)] +enum Void {} + +// Tests that we detect unsafe places (specifically, union fields and +// raw pointer dereferences), even when they're matched on while having +// an uninhabited type (equivalent to `std::intrinsics::unreachable()`). + +fn union_field() { + union Union { unit: (), void: Void } + let u = Union { unit: () }; + match u.void {} + //~^ ERROR access to union field is unsafe +} + +fn raw_ptr_deref() { + let ptr = std::ptr::null::(); + match *ptr {} + //~^ ERROR dereference of raw pointer is unsafe +} + +fn main() {} diff --git a/src/test/ui/issue-47412.stderr b/src/test/ui/issue-47412.stderr new file mode 100644 index 00000000000..6ca404003a5 --- /dev/null +++ b/src/test/ui/issue-47412.stderr @@ -0,0 +1,19 @@ +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/issue-47412.rs:21:5 + | +LL | match u.void {} + | ^^^^^^^^^^^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/issue-47412.rs:27:5 + | +LL | match *ptr {} + | ^^^^^^^^^^^^^ dereference of raw pointer + | + = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/issue-47715.rs b/src/test/ui/issue-47715.rs new file mode 100644 index 00000000000..b6b720f088a --- /dev/null +++ b/src/test/ui/issue-47715.rs @@ -0,0 +1,38 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo {} + +trait Bar {} + +trait Iterable { + type Item; +} + +struct Container> { + //~^ ERROR `impl Trait` not allowed + field: T +} + +enum Enum> { + //~^ ERROR `impl Trait` not allowed + A(T), +} + +union Union + Copy> { + //~^ ERROR `impl Trait` not allowed + x: T, +} + +type Type> = T; +//~^ ERROR `impl Trait` not allowed + +fn main() { +} diff --git a/src/test/ui/issue-47715.stderr b/src/test/ui/issue-47715.stderr new file mode 100644 index 00000000000..29b6afe7d07 --- /dev/null +++ b/src/test/ui/issue-47715.stderr @@ -0,0 +1,27 @@ +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/issue-47715.rs:19:37 + | +LL | struct Container> { + | ^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/issue-47715.rs:24:30 + | +LL | enum Enum> { + | ^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/issue-47715.rs:29:32 + | +LL | union Union + Copy> { + | ^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/issue-47715.rs:34:30 + | +LL | type Type> = T; + | ^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0562`. diff --git a/src/test/ui/issue-48131.rs b/src/test/ui/issue-48131.rs new file mode 100644 index 00000000000..9eb567a5d3e --- /dev/null +++ b/src/test/ui/issue-48131.rs @@ -0,0 +1,39 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This note is annotated because the purpose of the test +// is to ensure that certain other notes are not generated. +#![deny(unused_unsafe)] //~ NOTE + +// (test that no note is generated on this unsafe fn) +pub unsafe fn a() { + fn inner() { + unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe` + //~^ NOTE + } + + inner() +} + +pub fn b() { + // (test that no note is generated on this unsafe block) + unsafe { + fn inner() { + unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe` + //~^ NOTE + } + + let () = ::std::mem::uninitialized(); + + inner() + } +} + +fn main() {} diff --git a/src/test/ui/issue-48131.stderr b/src/test/ui/issue-48131.stderr new file mode 100644 index 00000000000..d0ba1a1c37d --- /dev/null +++ b/src/test/ui/issue-48131.stderr @@ -0,0 +1,20 @@ +error: unnecessary `unsafe` block + --> $DIR/issue-48131.rs:18:9 + | +LL | unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe` + | ^^^^^^ unnecessary `unsafe` block + | +note: lint level defined here + --> $DIR/issue-48131.rs:13:9 + | +LL | #![deny(unused_unsafe)] //~ NOTE + | ^^^^^^^^^^^^^ + +error: unnecessary `unsafe` block + --> $DIR/issue-48131.rs:29:13 + | +LL | unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe` + | ^^^^^^ unnecessary `unsafe` block + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-48838.rs b/src/test/ui/issue-48838.rs new file mode 100644 index 00000000000..ab52a32869f --- /dev/null +++ b/src/test/ui/issue-48838.rs @@ -0,0 +1,15 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Functions { + Square = |x| x, //~ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/issue-48838.stderr b/src/test/ui/issue-48838.stderr new file mode 100644 index 00000000000..2c7e682a982 --- /dev/null +++ b/src/test/ui/issue-48838.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-48838.rs:12:14 + | +LL | Square = |x| x, //~ ERROR mismatched types + | ^^^^^ expected isize, found closure + | + = note: expected type `isize` + found type `[closure@$DIR/issue-48838.rs:12:14: 12:19]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-4968.rs b/src/test/ui/issue-4968.rs new file mode 100644 index 00000000000..77588e5c221 --- /dev/null +++ b/src/test/ui/issue-4968.rs @@ -0,0 +1,20 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for issue #4968 + +const A: (isize,isize) = (4,2); +fn main() { + match 42 { A => () } + //~^ ERROR mismatched types + //~| expected type `{integer}` + //~| found type `(isize, isize)` + //~| expected integral variable, found tuple +} diff --git a/src/test/ui/issue-4968.stderr b/src/test/ui/issue-4968.stderr new file mode 100644 index 00000000000..a9d58eda6e8 --- /dev/null +++ b/src/test/ui/issue-4968.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-4968.rs:15:16 + | +LL | match 42 { A => () } + | ^ expected integral variable, found tuple + | + = note: expected type `{integer}` + found type `(isize, isize)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-4972.rs b/src/test/ui/issue-4972.rs new file mode 100644 index 00000000000..f384dba7c9e --- /dev/null +++ b/src/test/ui/issue-4972.rs @@ -0,0 +1,28 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_patterns)] +#![feature(box_syntax)] + +trait MyTrait { + fn dummy(&self) {} +} + +pub enum TraitWrapper { + A(Box), +} + +fn get_tw_map(tw: &TraitWrapper) -> &MyTrait { + match *tw { + TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced + } +} + +pub fn main() {} diff --git a/src/test/ui/issue-4972.stderr b/src/test/ui/issue-4972.stderr new file mode 100644 index 00000000000..e9c1bdb6f86 --- /dev/null +++ b/src/test/ui/issue-4972.stderr @@ -0,0 +1,9 @@ +error[E0033]: type `std::boxed::Box<(dyn MyTrait + 'static)>` cannot be dereferenced + --> $DIR/issue-4972.rs:24:25 + | +LL | TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced + | ^^^^^^^^^^^ type `std::boxed::Box<(dyn MyTrait + 'static)>` cannot be dereferenced + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0033`. diff --git a/src/test/ui/issue-50471.rs b/src/test/ui/issue-50471.rs new file mode 100644 index 00000000000..ce2947144af --- /dev/null +++ b/src/test/ui/issue-50471.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-pass + +fn main() { + assert!({false}); + + assert!(r"\u{41}" == "A"); + + assert!(r"\u{".is_empty()); +} diff --git a/src/test/ui/issue-50600.rs b/src/test/ui/issue-50600.rs new file mode 100644 index 00000000000..6169a7770bf --- /dev/null +++ b/src/test/ui/issue-50600.rs @@ -0,0 +1,15 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo ( + fn([u8; |x: u8| {}]), //~ ERROR mismatched types +); + +fn main() {} diff --git a/src/test/ui/issue-50600.stderr b/src/test/ui/issue-50600.stderr new file mode 100644 index 00000000000..a72dbace248 --- /dev/null +++ b/src/test/ui/issue-50600.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-50600.rs:12:13 + | +LL | fn([u8; |x: u8| {}]), //~ ERROR mismatched types + | ^^^^^^^^^^ expected usize, found closure + | + = note: expected type `usize` + found type `[closure@$DIR/issue-50600.rs:12:13: 12:23]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-5062.rs b/src/test/ui/issue-5062.rs new file mode 100644 index 00000000000..ebfa4975d4d --- /dev/null +++ b/src/test/ui/issue-5062.rs @@ -0,0 +1,12 @@ +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { format!("{:?}", None); } + //~^ ERROR type annotations needed [E0282] diff --git a/src/test/ui/issue-5062.stderr b/src/test/ui/issue-5062.stderr new file mode 100644 index 00000000000..988c5c137b4 --- /dev/null +++ b/src/test/ui/issue-5062.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/issue-5062.rs:11:29 + | +LL | fn main() { format!("{:?}", None); } + | ^^^^ cannot infer type for `T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-5067.rs b/src/test/ui/issue-5067.rs new file mode 100644 index 00000000000..267362f902d --- /dev/null +++ b/src/test/ui/issue-5067.rs @@ -0,0 +1,64 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused_macros)] + +macro_rules! foo { + ( $()* ) => {}; + //~^ ERROR repetition matches empty token tree + ( $()+ ) => {}; + //~^ ERROR repetition matches empty token tree + + ( $(),* ) => {}; // PASS + ( $(),+ ) => {}; // PASS + + ( [$()*] ) => {}; + //~^ ERROR repetition matches empty token tree + ( [$()+] ) => {}; + //~^ ERROR repetition matches empty token tree + + ( [$(),*] ) => {}; // PASS + ( [$(),+] ) => {}; // PASS + + ( $($()* $(),* $(a)* $(a),* )* ) => {}; + //~^ ERROR repetition matches empty token tree + ( $($()* $(),* $(a)* $(a),* )+ ) => {}; + //~^ ERROR repetition matches empty token tree + + ( $(a $(),* $(a)* $(a),* )* ) => {}; // PASS + ( $($(a)+ $(),* $(a)* $(a),* )+ ) => {}; // PASS + + ( $(a $()+)* ) => {}; + //~^ ERROR repetition matches empty token tree + ( $(a $()*)+ ) => {}; + //~^ ERROR repetition matches empty token tree +} + + +// --- Original Issue --- // + +macro_rules! make_vec { + (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]); + //~^ ERROR repetition matches empty token tree +} + +fn main() { + let _ = make_vec![a 1, a 2, a 3]; +} + + +// --- Minified Issue --- // + +macro_rules! m { + ( $()* ) => {} + //~^ ERROR repetition matches empty token tree +} + +m!(); diff --git a/src/test/ui/issue-5067.stderr b/src/test/ui/issue-5067.stderr new file mode 100644 index 00000000000..2ea3ea5204c --- /dev/null +++ b/src/test/ui/issue-5067.stderr @@ -0,0 +1,62 @@ +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:14:8 + | +LL | ( $()* ) => {}; + | ^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:16:8 + | +LL | ( $()+ ) => {}; + | ^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:22:9 + | +LL | ( [$()*] ) => {}; + | ^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:24:9 + | +LL | ( [$()+] ) => {}; + | ^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:30:8 + | +LL | ( $($()* $(),* $(a)* $(a),* )* ) => {}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:32:8 + | +LL | ( $($()* $(),* $(a)* $(a),* )+ ) => {}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:38:12 + | +LL | ( $(a $()+)* ) => {}; + | ^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:40:12 + | +LL | ( $(a $()*)+ ) => {}; + | ^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:48:18 + | +LL | (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]); + | ^^^^^^^^^^^^^^^^^^ + +error: repetition matches empty token tree + --> $DIR/issue-5067.rs:60:8 + | +LL | ( $()* ) => {} + | ^^ + +error: aborting due to 10 previous errors + diff --git a/src/test/ui/issue-50688.rs b/src/test/ui/issue-50688.rs new file mode 100644 index 00000000000..ff45cf639de --- /dev/null +++ b/src/test/ui/issue-50688.rs @@ -0,0 +1,13 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + [1; || {}]; //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-50688.stderr b/src/test/ui/issue-50688.stderr new file mode 100644 index 00000000000..094b0e1ec89 --- /dev/null +++ b/src/test/ui/issue-50688.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-50688.rs:12:9 + | +LL | [1; || {}]; //~ ERROR mismatched types + | ^^^^^ expected usize, found closure + | + = note: expected type `usize` + found type `[closure@$DIR/issue-50688.rs:12:9: 12:14]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-5099.rs b/src/test/ui/issue-5099.rs new file mode 100644 index 00000000000..1bb6f34b8e9 --- /dev/null +++ b/src/test/ui/issue-5099.rs @@ -0,0 +1,14 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +trait B < A > { fn a() -> A { this.a } } //~ ERROR cannot find value `this` in this scope + +fn main() {} diff --git a/src/test/ui/issue-5099.stderr b/src/test/ui/issue-5099.stderr new file mode 100644 index 00000000000..26a26f731cf --- /dev/null +++ b/src/test/ui/issue-5099.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `this` in this scope + --> $DIR/issue-5099.rs:12:31 + | +LL | trait B < A > { fn a() -> A { this.a } } //~ ERROR cannot find value `this` in this scope + | ^^^^ 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/issue-5100.rs b/src/test/ui/issue-5100.rs new file mode 100644 index 00000000000..9ef780aac8e --- /dev/null +++ b/src/test/ui/issue-5100.rs @@ -0,0 +1,67 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_patterns)] +#![feature(box_syntax)] + +enum A { B, C } + +fn main() { + match (true, false) { + A::B => (), +//~^ ERROR mismatched types +//~| expected type `(bool, bool)` +//~| found type `A` +//~| expected tuple, found enum `A` + _ => () + } + + match (true, false) { + (true, false, false) => () +//~^ ERROR mismatched types +//~| expected type `(bool, bool)` +//~| found type `(_, _, _)` +//~| expected a tuple with 2 elements, found one with 3 elements + } + + match (true, false) { + (true, false, false) => () +//~^ ERROR mismatched types +//~| expected type `(bool, bool)` +//~| found type `(_, _, _)` +//~| expected a tuple with 2 elements, found one with 3 elements + } + + match (true, false) { + box (true, false) => () +//~^ ERROR mismatched types +//~| expected type `(bool, bool)` +//~| found type `std::boxed::Box<_>` + } + + match (true, false) { + &(true, false) => () +//~^ ERROR mismatched types +//~| expected type `(bool, bool)` +//~| found type `&_` +//~| expected tuple, found reference + } + + + let v = [('a', 'b') //~ ERROR expected function, found `(char, char)` + ('c', 'd'), + ('e', 'f')]; + + for &(x,y) in &v {} // should be OK + + // Make sure none of the errors above were fatal + let x: char = true; //~ ERROR mismatched types + //~| expected char, found bool +} diff --git a/src/test/ui/issue-5100.stderr b/src/test/ui/issue-5100.stderr new file mode 100644 index 00000000000..6f5a84966bf --- /dev/null +++ b/src/test/ui/issue-5100.stderr @@ -0,0 +1,63 @@ +error[E0308]: mismatched types + --> $DIR/issue-5100.rs:18:9 + | +LL | A::B => (), + | ^^^^ expected tuple, found enum `A` + | + = note: expected type `(bool, bool)` + found type `A` + +error[E0308]: mismatched types + --> $DIR/issue-5100.rs:27:9 + | +LL | (true, false, false) => () + | ^^^^^^^^^^^^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements + | + = note: expected type `(bool, bool)` + found type `(_, _, _)` + +error[E0308]: mismatched types + --> $DIR/issue-5100.rs:35:9 + | +LL | (true, false, false) => () + | ^^^^^^^^^^^^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements + | + = note: expected type `(bool, bool)` + found type `(_, _, _)` + +error[E0308]: mismatched types + --> $DIR/issue-5100.rs:43:9 + | +LL | box (true, false) => () + | ^^^^^^^^^^^^^^^^^ expected tuple, found struct `std::boxed::Box` + | + = note: expected type `(bool, bool)` + found type `std::boxed::Box<_>` + +error[E0308]: mismatched types + --> $DIR/issue-5100.rs:50:9 + | +LL | &(true, false) => () + | ^^^^^^^^^^^^^^ expected tuple, found reference + | + = note: expected type `(bool, bool)` + found type `&_` + +error[E0618]: expected function, found `(char, char)` + --> $DIR/issue-5100.rs:58:14 + | +LL | let v = [('a', 'b') //~ ERROR expected function, found `(char, char)` + | ______________^ +LL | | ('c', 'd'), + | |_______________________^ not a function + +error[E0308]: mismatched types + --> $DIR/issue-5100.rs:65:19 + | +LL | let x: char = true; //~ ERROR mismatched types + | ^^^^ expected char, found bool + +error: aborting due to 7 previous errors + +Some errors occurred: E0308, E0618. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-5153.rs b/src/test/ui/issue-5153.rs new file mode 100644 index 00000000000..9b49886961d --- /dev/null +++ b/src/test/ui/issue-5153.rs @@ -0,0 +1,22 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn foo(self: Box); +} + +impl Foo for isize { + fn foo(self: Box) { } +} + +fn main() { + (&5isize as &Foo).foo(); + //~^ ERROR: no method named `foo` found for type `&dyn Foo` in the current scope +} diff --git a/src/test/ui/issue-5153.stderr b/src/test/ui/issue-5153.stderr new file mode 100644 index 00000000000..6f8dce109e1 --- /dev/null +++ b/src/test/ui/issue-5153.stderr @@ -0,0 +1,13 @@ +error[E0599]: no method named `foo` found for type `&dyn Foo` in the current scope + --> $DIR/issue-5153.rs:20:23 + | +LL | (&5isize as &Foo).foo(); + | ^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `foo`, perhaps you need to implement it: + candidate #1: `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-5216.rs b/src/test/ui/issue-5216.rs new file mode 100644 index 00000000000..81424577d49 --- /dev/null +++ b/src/test/ui/issue-5216.rs @@ -0,0 +1,20 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f() { } +struct S(Box); +pub static C: S = S(f); //~ ERROR mismatched types + + +fn g() { } +type T = Box; +pub static D: T = g; //~ ERROR mismatched types + +fn main() {} diff --git a/src/test/ui/issue-5216.stderr b/src/test/ui/issue-5216.stderr new file mode 100644 index 00000000000..7ea329749a0 --- /dev/null +++ b/src/test/ui/issue-5216.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/issue-5216.rs:13:21 + | +LL | pub static C: S = S(f); //~ ERROR mismatched types + | ^ expected struct `std::boxed::Box`, found fn item + | + = note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` + found type `fn() {f}` + +error[E0308]: mismatched types + --> $DIR/issue-5216.rs:18:19 + | +LL | pub static D: T = g; //~ ERROR mismatched types + | ^ expected struct `std::boxed::Box`, found fn item + | + = note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` + found type `fn() {g}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-52213.nll.stderr b/src/test/ui/issue-52213.nll.stderr new file mode 100644 index 00000000000..c288cf9ed82 --- /dev/null +++ b/src/test/ui/issue-52213.nll.stderr @@ -0,0 +1,14 @@ +warning: not reporting region error due to nll + --> $DIR/issue-52213.rs:12:11 + | +LL | match (&t,) { //~ ERROR cannot infer an appropriate lifetime + | ^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/issue-52213.rs:13:11 + | +LL | ((u,),) => u, + | ^ free region requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-52213.rs b/src/test/ui/issue-52213.rs new file mode 100644 index 00000000000..810379c63d3 --- /dev/null +++ b/src/test/ui/issue-52213.rs @@ -0,0 +1,24 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { + match (&t,) { //~ ERROR cannot infer an appropriate lifetime + ((u,),) => u, + } +} + +fn main() { + let x = { + let y = Box::new((42,)); + transmute_lifetime(&y) + }; + + println!("{}", x); +} diff --git a/src/test/ui/issue-52213.stderr b/src/test/ui/issue-52213.stderr new file mode 100644 index 00000000000..3c650881d7b --- /dev/null +++ b/src/test/ui/issue-52213.stderr @@ -0,0 +1,28 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/issue-52213.rs:12:11 + | +LL | match (&t,) { //~ ERROR cannot infer an appropriate lifetime + | ^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 11:23... + --> $DIR/issue-52213.rs:11:23 + | +LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { + | ^^ + = note: ...so that the types are compatible: + expected (&&(T,),) + found (&&'a (T,),) +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 11:27... + --> $DIR/issue-52213.rs:11:27 + | +LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/issue-52213.rs:13:20 + | +LL | ((u,),) => u, + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issue-5358-1.rs b/src/test/ui/issue-5358-1.rs new file mode 100644 index 00000000000..d8aad54fd3e --- /dev/null +++ b/src/test/ui/issue-5358-1.rs @@ -0,0 +1,23 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Either { Left(T), Right(U) } +struct S(Either); + +fn main() { + match S(Either::Left(5)) { + Either::Right(_) => {} + //~^ ERROR mismatched types + //~| expected type `S` + //~| found type `Either<_, _>` + //~| expected struct `S`, found enum `Either` + _ => {} + } +} diff --git a/src/test/ui/issue-5358-1.stderr b/src/test/ui/issue-5358-1.stderr new file mode 100644 index 00000000000..abaea462fcc --- /dev/null +++ b/src/test/ui/issue-5358-1.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-5358-1.rs:16:9 + | +LL | Either::Right(_) => {} + | ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either` + | + = note: expected type `S` + found type `Either<_, _>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-5439.rs b/src/test/ui/issue-5439.rs new file mode 100644 index 00000000000..4e618f3d858 --- /dev/null +++ b/src/test/ui/issue-5439.rs @@ -0,0 +1,31 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +struct Foo { + foo: isize, +} + +struct Bar { + bar: isize, +} + +impl Bar { + fn make_foo (&self, i: isize) -> Box { + return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named + } +} + +fn main () { + let bar = Bar { bar: 1 }; + let foo = bar.make_foo(2); + println!("{}", foo.foo); +} diff --git a/src/test/ui/issue-5439.stderr b/src/test/ui/issue-5439.stderr new file mode 100644 index 00000000000..87e20f3a03d --- /dev/null +++ b/src/test/ui/issue-5439.stderr @@ -0,0 +1,11 @@ +error[E0560]: struct `Foo` has no field named `nonexistent` + --> $DIR/issue-5439.rs:23:26 + | +LL | return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named + | ^^^^^^^^^^^ `Foo` does not have this field + | + = note: available fields are: `foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0560`. diff --git a/src/test/ui/issue-5883.rs b/src/test/ui/issue-5883.rs new file mode 100644 index 00000000000..a91f5d281dd --- /dev/null +++ b/src/test/ui/issue-5883.rs @@ -0,0 +1,23 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait A {} + +struct Struct { + r: A+'static +} + +fn new_struct(r: A+'static) + -> Struct { //~^ ERROR the size for values of type + //~^ ERROR the size for values of type + Struct { r: r } +} + +fn main() {} diff --git a/src/test/ui/issue-5883.stderr b/src/test/ui/issue-5883.stderr new file mode 100644 index 00000000000..43ce3697d83 --- /dev/null +++ b/src/test/ui/issue-5883.stderr @@ -0,0 +1,24 @@ +error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time + --> $DIR/issue-5883.rs:17:15 + | +LL | fn new_struct(r: A+'static) + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)` + = note: to learn more, visit + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time + --> $DIR/issue-5883.rs:18:8 + | +LL | -> Struct { //~^ ERROR the size for values of type + | ^^^^^^ doesn't have a size known at compile-time + | + = help: within `Struct`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)` + = note: to learn more, visit + = note: required because it appears within the type `Struct` + = note: the return type of a function must have a statically known size + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-5927.rs b/src/test/ui/issue-5927.rs new file mode 100644 index 00000000000..bb802f353af --- /dev/null +++ b/src/test/ui/issue-5927.rs @@ -0,0 +1,18 @@ +// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +fn main() { + let z = match 3 { + x(1) => x(1) //~ ERROR cannot find tuple struct/variant `x` in this scope + //~^ ERROR cannot find function `x` in this scope + }; + assert!(z == 3); +} diff --git a/src/test/ui/issue-5927.stderr b/src/test/ui/issue-5927.stderr new file mode 100644 index 00000000000..f8b9b15678d --- /dev/null +++ b/src/test/ui/issue-5927.stderr @@ -0,0 +1,16 @@ +error[E0531]: cannot find tuple struct/variant `x` in this scope + --> $DIR/issue-5927.rs:14:9 + | +LL | x(1) => x(1) //~ ERROR cannot find tuple struct/variant `x` in this scope + | ^ not found in this scope + +error[E0425]: cannot find function `x` in this scope + --> $DIR/issue-5927.rs:14:17 + | +LL | x(1) => x(1) //~ ERROR cannot find tuple struct/variant `x` in this scope + | ^ not found in this scope + +error: aborting due to 2 previous errors + +Some errors occurred: E0425, E0531. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/issue-5997-enum.rs b/src/test/ui/issue-5997-enum.rs new file mode 100644 index 00000000000..463fdaa1069 --- /dev/null +++ b/src/test/ui/issue-5997-enum.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f() -> bool { + enum E { V(Z) } + //~^ ERROR can't use type parameters from outer function + true +} + +fn main() { + let b = f::(); + assert!(b); +} diff --git a/src/test/ui/issue-5997-enum.stderr b/src/test/ui/issue-5997-enum.stderr new file mode 100644 index 00000000000..9f26f653ebd --- /dev/null +++ b/src/test/ui/issue-5997-enum.stderr @@ -0,0 +1,13 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/issue-5997-enum.rs:12:16 + | +LL | fn f() -> bool { + | - - type variable from outer function + | | + | try adding a local type parameter in this method instead +LL | enum E { V(Z) } + | ^ use of type variable from outer function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/issue-5997-struct.rs b/src/test/ui/issue-5997-struct.rs new file mode 100644 index 00000000000..af9e66b770b --- /dev/null +++ b/src/test/ui/issue-5997-struct.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f() -> bool { + struct S(T); //~ ERROR can't use type parameters from outer function + + true +} + +fn main() { + let b = f::(); + assert!(b); +} diff --git a/src/test/ui/issue-5997-struct.stderr b/src/test/ui/issue-5997-struct.stderr new file mode 100644 index 00000000000..fd6d67bd128 --- /dev/null +++ b/src/test/ui/issue-5997-struct.stderr @@ -0,0 +1,13 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/issue-5997-struct.rs:12:14 + | +LL | fn f() -> bool { + | - - type variable from outer function + | | + | try adding a local type parameter in this method instead +LL | struct S(T); //~ ERROR can't use type parameters from outer function + | ^ use of type variable from outer function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/issue-6458-2.rs b/src/test/ui/issue-6458-2.rs new file mode 100644 index 00000000000..87cf2b3f740 --- /dev/null +++ b/src/test/ui/issue-6458-2.rs @@ -0,0 +1,15 @@ +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + // Unconstrained type: + format!("{:?}", None); + //~^ ERROR type annotations needed [E0282] +} diff --git a/src/test/ui/issue-6458-2.stderr b/src/test/ui/issue-6458-2.stderr new file mode 100644 index 00000000000..e192c2c3be3 --- /dev/null +++ b/src/test/ui/issue-6458-2.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/issue-6458-2.rs:13:21 + | +LL | format!("{:?}", None); + | ^^^^ cannot infer type for `T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-6596-1.rs b/src/test/ui/issue-6596-1.rs new file mode 100644 index 00000000000..ce8a3a80e1f --- /dev/null +++ b/src/test/ui/issue-6596-1.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +macro_rules! e { + ($inp:ident) => ( + $nonexistent + //~^ ERROR unknown macro variable `nonexistent` + ); +} + +fn main() { + e!(foo); +} diff --git a/src/test/ui/issue-6596-1.stderr b/src/test/ui/issue-6596-1.stderr new file mode 100644 index 00000000000..b7055ab19d0 --- /dev/null +++ b/src/test/ui/issue-6596-1.stderr @@ -0,0 +1,11 @@ +error: unknown macro variable `nonexistent` + --> $DIR/issue-6596-1.rs:14:9 + | +LL | $nonexistent + | ^^^^^^^^^^^^ unknown macro variable +... +LL | e!(foo); + | -------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/ui/issue-6596-2.rs b/src/test/ui/issue-6596-2.rs new file mode 100644 index 00000000000..3e18de6178a --- /dev/null +++ b/src/test/ui/issue-6596-2.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(macro_rules)] + +macro_rules! g { + ($inp:ident) => ( + { $inp $nonexistent } + //~^ ERROR unknown macro variable `nonexistent` + //~| ERROR expected one of + ); +} + +fn main() { + g!(foo); +} diff --git a/src/test/ui/issue-6596-2.stderr b/src/test/ui/issue-6596-2.stderr new file mode 100644 index 00000000000..f2ed17f35e6 --- /dev/null +++ b/src/test/ui/issue-6596-2.stderr @@ -0,0 +1,20 @@ +error: unknown macro variable `nonexistent` + --> $DIR/issue-6596-2.rs:15:16 + | +LL | { $inp $nonexistent } + | ^^^^^^^^^^^^ unknown macro variable +... +LL | g!(foo); + | -------- in this macro invocation + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `nonexistent` + --> $DIR/issue-6596-2.rs:15:16 + | +LL | { $inp $nonexistent } + | ^^^^^^^^^^^^ expected one of 8 possible tokens here +... +LL | g!(foo); + | -------- in this macro invocation + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-6642.rs b/src/test/ui/issue-6642.rs new file mode 100644 index 00000000000..1fe10ba7a27 --- /dev/null +++ b/src/test/ui/issue-6642.rs @@ -0,0 +1,19 @@ +// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct A; +impl A { + fn m(&self) { + fn x() { + self.m() //~ ERROR can't capture dynamic environment in a fn item + } + } +} +fn main() {} diff --git a/src/test/ui/issue-6642.stderr b/src/test/ui/issue-6642.stderr new file mode 100644 index 00000000000..1762af52eb0 --- /dev/null +++ b/src/test/ui/issue-6642.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-6642.rs:15:13 + | +LL | self.m() //~ ERROR can't capture dynamic environment in a fn item + | ^^^^ + | + = 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/issue-6738.rs b/src/test/ui/issue-6738.rs new file mode 100644 index 00000000000..447d0e061ee --- /dev/null +++ b/src/test/ui/issue-6738.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { + x: T, +} +impl Foo { + fn add(&mut self, v: Foo){ + self.x += v.x; + //~^ ERROR: binary assignment operation `+=` cannot be applied + } +} +fn main() {} diff --git a/src/test/ui/issue-6738.stderr b/src/test/ui/issue-6738.stderr new file mode 100644 index 00000000000..8c0aff9d9ab --- /dev/null +++ b/src/test/ui/issue-6738.stderr @@ -0,0 +1,13 @@ +error[E0368]: binary assignment operation `+=` cannot be applied to type `T` + --> $DIR/issue-6738.rs:16:9 + | +LL | self.x += v.x; + | ------^^^^^^^ + | | + | cannot use `+=` on type `T` + | + = note: `T` might need a bound for `std::ops::AddAssign` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0368`. diff --git a/src/test/ui/issue-6801.nll.stderr b/src/test/ui/issue-6801.nll.stderr new file mode 100644 index 00000000000..5436397c68e --- /dev/null +++ b/src/test/ui/issue-6801.nll.stderr @@ -0,0 +1,14 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/issue-6801.rs:29:13 + | +LL | let sq = || { *x * *x }; + | -------------- borrow of `x` occurs here +LL | +LL | twice(x); //~ ERROR: cannot move out of + | ^ move out of `x` occurs here +LL | invoke(sq); + | -- 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/issue-6801.rs b/src/test/ui/issue-6801.rs new file mode 100644 index 00000000000..792d27c179b --- /dev/null +++ b/src/test/ui/issue-6801.rs @@ -0,0 +1,31 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Creating a stack closure which references a box and then +// transferring ownership of the box before invoking the stack +// closure results in a crash. + +#![feature(box_syntax)] + +fn twice(x: Box) -> usize { + *x * 2 +} + +fn invoke(f: F) where F: FnOnce() -> usize { + f(); +} + +fn main() { + let x : Box = box 9; + let sq = || { *x * *x }; + + twice(x); //~ ERROR: cannot move out of + invoke(sq); +} diff --git a/src/test/ui/issue-6801.stderr b/src/test/ui/issue-6801.stderr new file mode 100644 index 00000000000..8a1c669f0b2 --- /dev/null +++ b/src/test/ui/issue-6801.stderr @@ -0,0 +1,12 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/issue-6801.rs:29:13 + | +LL | let sq = || { *x * *x }; + | -- borrow of `x` occurs here +LL | +LL | twice(x); //~ ERROR: cannot move out of + | ^ move out of `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/issue-6804.rs b/src/test/ui/issue-6804.rs new file mode 100644 index 00000000000..fffa27ab842 --- /dev/null +++ b/src/test/ui/issue-6804.rs @@ -0,0 +1,31 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Matching against NaN should result in a warning + +#![allow(unused)] +#![deny(illegal_floating_point_literal_pattern)] + +use std::f64::NAN; + +fn main() { + let x = NAN; + match x { + NAN => {}, //~ ERROR floating-point types cannot be used + //~^ WARN this was previously accepted by the compiler but is being phased out + _ => {}, + }; + + match [x, 1.0] { + [NAN, _] => {}, //~ ERROR floating-point types cannot be used + //~^ WARN this was previously accepted by the compiler but is being phased out + _ => {}, + }; +} diff --git a/src/test/ui/issue-6804.stderr b/src/test/ui/issue-6804.stderr new file mode 100644 index 00000000000..45eefbfaf8e --- /dev/null +++ b/src/test/ui/issue-6804.stderr @@ -0,0 +1,25 @@ +error: floating-point types cannot be used in patterns + --> $DIR/issue-6804.rs:21:9 + | +LL | NAN => {}, //~ ERROR floating-point types cannot be used + | ^^^ + | +note: lint level defined here + --> $DIR/issue-6804.rs:14:9 + | +LL | #![deny(illegal_floating_point_literal_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: floating-point types cannot be used in patterns + --> $DIR/issue-6804.rs:27:10 + | +LL | [NAN, _] => {}, //~ ERROR floating-point types cannot be used + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-6936.rs b/src/test/ui/issue-6936.rs new file mode 100644 index 00000000000..8eb16edcbd3 --- /dev/null +++ b/src/test/ui/issue-6936.rs @@ -0,0 +1,44 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct T; + +mod t1 { + type Foo = ::T; + mod Foo {} //~ ERROR the name `Foo` is defined multiple times +} + +mod t2 { + type Foo = ::T; + struct Foo; //~ ERROR the name `Foo` is defined multiple times +} + +mod t3 { + type Foo = ::T; + enum Foo {} //~ ERROR the name `Foo` is defined multiple times +} + +mod t4 { + type Foo = ::T; + fn Foo() {} // ok +} + +mod t5 { + type Bar = T; + mod Bar {} //~ ERROR the name `Bar` is defined multiple times +} + +mod t6 { + type Foo = ::T; + impl Foo {} // ok +} + + +fn main() {} diff --git a/src/test/ui/issue-6936.stderr b/src/test/ui/issue-6936.stderr new file mode 100644 index 00000000000..48fcbf40622 --- /dev/null +++ b/src/test/ui/issue-6936.stderr @@ -0,0 +1,43 @@ +error[E0428]: the name `Foo` is defined multiple times + --> $DIR/issue-6936.rs:15:5 + | +LL | type Foo = ::T; + | --------------- previous definition of the type `Foo` here +LL | mod Foo {} //~ ERROR the name `Foo` is defined multiple times + | ^^^^^^^ `Foo` redefined here + | + = note: `Foo` must be defined only once in the type namespace of this module + +error[E0428]: the name `Foo` is defined multiple times + --> $DIR/issue-6936.rs:20:5 + | +LL | type Foo = ::T; + | --------------- previous definition of the type `Foo` here +LL | struct Foo; //~ ERROR the name `Foo` is defined multiple times + | ^^^^^^^^^^^ `Foo` redefined here + | + = note: `Foo` must be defined only once in the type namespace of this module + +error[E0428]: the name `Foo` is defined multiple times + --> $DIR/issue-6936.rs:25:5 + | +LL | type Foo = ::T; + | --------------- previous definition of the type `Foo` here +LL | enum Foo {} //~ ERROR the name `Foo` is defined multiple times + | ^^^^^^^^ `Foo` redefined here + | + = note: `Foo` must be defined only once in the type namespace of this module + +error[E0428]: the name `Bar` is defined multiple times + --> $DIR/issue-6936.rs:35:5 + | +LL | type Bar = T; + | ---------------- previous definition of the type `Bar` here +LL | mod Bar {} //~ ERROR the name `Bar` is defined multiple times + | ^^^^^^^ `Bar` redefined here + | + = note: `Bar` must be defined only once in the type namespace of this module + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0428`. diff --git a/src/test/ui/issue-7013.rs b/src/test/ui/issue-7013.rs new file mode 100644 index 00000000000..0c19780bcb4 --- /dev/null +++ b/src/test/ui/issue-7013.rs @@ -0,0 +1,38 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +use std::cell::RefCell; +use std::rc::Rc; + +trait Foo { + fn set(&mut self, v: Rc>); +} + +struct B { + v: Option>> +} + +impl Foo for B { + fn set(&mut self, v: Rc>) + { + self.v = Some(v); + } +} + +struct A { + v: Box, +} + +fn main() { + let a = A {v: box B{v: None} as Box}; + //~^ ERROR `std::rc::Rc>` cannot be sent between threads safely +} diff --git a/src/test/ui/issue-7013.stderr b/src/test/ui/issue-7013.stderr new file mode 100644 index 00000000000..fec6e06a699 --- /dev/null +++ b/src/test/ui/issue-7013.stderr @@ -0,0 +1,14 @@ +error[E0277]: `std::rc::Rc>` cannot be sent between threads safely + --> $DIR/issue-7013.rs:36:19 + | +LL | let a = A {v: box B{v: None} as Box}; + | ^^^^^^^^^^^^^^ `std::rc::Rc>` cannot be sent between threads safely + | + = help: within `B`, the trait `std::marker::Send` is not implemented for `std::rc::Rc>` + = note: required because it appears within the type `std::option::Option>>` + = note: required because it appears within the type `B` + = note: required for the cast to the object type `dyn Foo + std::marker::Send` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-7044.rs b/src/test/ui/issue-7044.rs new file mode 100644 index 00000000000..9b72c249356 --- /dev/null +++ b/src/test/ui/issue-7044.rs @@ -0,0 +1,14 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +static X: isize = 0; +struct X; //~ ERROR the name `X` is defined multiple times + +fn main() {} diff --git a/src/test/ui/issue-7044.stderr b/src/test/ui/issue-7044.stderr new file mode 100644 index 00000000000..02707b2d21e --- /dev/null +++ b/src/test/ui/issue-7044.stderr @@ -0,0 +1,13 @@ +error[E0428]: the name `X` is defined multiple times + --> $DIR/issue-7044.rs:12:1 + | +LL | static X: isize = 0; + | -------------------- previous definition of the value `X` here +LL | struct X; //~ ERROR the name `X` is defined multiple times + | ^^^^^^^^^ `X` redefined here + | + = note: `X` must be defined only once in the value 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/issue-7061.rs b/src/test/ui/issue-7061.rs new file mode 100644 index 00000000000..b99f5b707ee --- /dev/null +++ b/src/test/ui/issue-7061.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct BarStruct; + +impl<'a> BarStruct { + fn foo(&'a mut self) -> Box { self } + //~^ ERROR mismatched types + //~| expected type `std::boxed::Box` + //~| found type `&'a mut BarStruct` +} + +fn main() {} diff --git a/src/test/ui/issue-7061.stderr b/src/test/ui/issue-7061.stderr new file mode 100644 index 00000000000..4f142ba95bc --- /dev/null +++ b/src/test/ui/issue-7061.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/issue-7061.rs:14:46 + | +LL | fn foo(&'a mut self) -> Box { self } + | -------------- ^^^^ expected struct `std::boxed::Box`, found mutable reference + | | + | expected `std::boxed::Box` because of return type + | + = note: expected type `std::boxed::Box` + found type `&'a mut BarStruct` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-7092.rs b/src/test/ui/issue-7092.rs new file mode 100644 index 00000000000..26e1597b1db --- /dev/null +++ b/src/test/ui/issue-7092.rs @@ -0,0 +1,25 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Whatever { +} + +fn foo(x: Whatever) { + match x { + Some(field) => +//~^ ERROR mismatched types +//~| expected type `Whatever` +//~| found type `std::option::Option<_>` +//~| expected enum `Whatever`, found enum `std::option::Option` + field.access(), + } +} + +fn main(){} diff --git a/src/test/ui/issue-7092.stderr b/src/test/ui/issue-7092.stderr new file mode 100644 index 00000000000..3c816098289 --- /dev/null +++ b/src/test/ui/issue-7092.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-7092.rs:16:9 + | +LL | Some(field) => + | ^^^^^^^^^^^ expected enum `Whatever`, found enum `std::option::Option` + | + = note: expected type `Whatever` + found type `std::option::Option<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-7246.rs b/src/test/ui/issue-7246.rs new file mode 100644 index 00000000000..7e8d431bf19 --- /dev/null +++ b/src/test/ui/issue-7246.rs @@ -0,0 +1,20 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(unreachable_code)] +#![allow(dead_code)] + +use std::ptr; +pub unsafe fn g() { + return; + if *ptr::null() {}; //~ ERROR unreachable +} + +pub fn main() {} diff --git a/src/test/ui/issue-7246.stderr b/src/test/ui/issue-7246.stderr new file mode 100644 index 00000000000..75c716e5a04 --- /dev/null +++ b/src/test/ui/issue-7246.stderr @@ -0,0 +1,14 @@ +error: unreachable statement + --> $DIR/issue-7246.rs:17:5 + | +LL | if *ptr::null() {}; //~ ERROR unreachable + | ^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-7246.rs:11:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-7364.rs b/src/test/ui/issue-7364.rs new file mode 100644 index 00000000000..801a1301ad7 --- /dev/null +++ b/src/test/ui/issue-7364.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +use std::cell::RefCell; + +// Regression test for issue 7364 +static boxed: Box> = box RefCell::new(0); +//~^ ERROR allocations are not allowed in statics +//~| ERROR `std::cell::RefCell` cannot be shared between threads safely [E0277] + +fn main() { } diff --git a/src/test/ui/issue-7364.stderr b/src/test/ui/issue-7364.stderr new file mode 100644 index 00000000000..b0d732bdb6f --- /dev/null +++ b/src/test/ui/issue-7364.stderr @@ -0,0 +1,21 @@ +error[E0010]: allocations are not allowed in statics + --> $DIR/issue-7364.rs:16:37 + | +LL | static boxed: Box> = box RefCell::new(0); + | ^^^^^^^^^^^^^^^^^^^ allocation not allowed in statics + +error[E0277]: `std::cell::RefCell` cannot be shared between threads safely + --> $DIR/issue-7364.rs:16:1 + | +LL | static boxed: Box> = box RefCell::new(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::RefCell` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique>` + = note: required because it appears within the type `std::boxed::Box>` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to 2 previous errors + +Some errors occurred: E0010, E0277. +For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/ui/issue-7607-1.rs b/src/test/ui/issue-7607-1.rs new file mode 100644 index 00000000000..9bcdd690187 --- /dev/null +++ b/src/test/ui/issue-7607-1.rs @@ -0,0 +1,19 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { + x: isize +} + +impl Fo { //~ ERROR cannot find type `Fo` in this scope + fn foo() {} +} + +fn main() {} diff --git a/src/test/ui/issue-7607-1.stderr b/src/test/ui/issue-7607-1.stderr new file mode 100644 index 00000000000..bebf1c1ae98 --- /dev/null +++ b/src/test/ui/issue-7607-1.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `Fo` in this scope + --> $DIR/issue-7607-1.rs:15:6 + | +LL | impl Fo { //~ ERROR cannot find type `Fo` in this scope + | ^^ did you mean `Fn`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/issue-7867.rs b/src/test/ui/issue-7867.rs new file mode 100644 index 00000000000..016df6cb6ef --- /dev/null +++ b/src/test/ui/issue-7867.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum A { B, C } + +mod foo { pub fn bar() {} } + +fn main() { + match (true, false) { + A::B => (), + //~^ ERROR mismatched types + //~| expected type `(bool, bool)` + //~| found type `A` + //~| expected tuple, found enum `A` + _ => () + } +} diff --git a/src/test/ui/issue-7867.stderr b/src/test/ui/issue-7867.stderr new file mode 100644 index 00000000000..03ab54d112f --- /dev/null +++ b/src/test/ui/issue-7867.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-7867.rs:17:9 + | +LL | A::B => (), + | ^^^^ expected tuple, found enum `A` + | + = note: expected type `(bool, bool)` + found type `A` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-7950.rs b/src/test/ui/issue-7950.rs new file mode 100644 index 00000000000..dd3a48cb155 --- /dev/null +++ b/src/test/ui/issue-7950.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// tests the good error message, not "missing module Foo" or something else unexpected + +struct Foo; + +fn main() { + Foo::bar(); + //~^ ERROR no function or associated item named `bar` found for type `Foo` +} diff --git a/src/test/ui/issue-7950.stderr b/src/test/ui/issue-7950.stderr new file mode 100644 index 00000000000..750127981b1 --- /dev/null +++ b/src/test/ui/issue-7950.stderr @@ -0,0 +1,12 @@ +error[E0599]: no function or associated item named `bar` found for type `Foo` in the current scope + --> $DIR/issue-7950.rs:16:5 + | +LL | struct Foo; + | ----------- function or associated item `bar` not found for this +... +LL | Foo::bar(); + | ^^^^^^^^ function or 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/issue-7970a.rs b/src/test/ui/issue-7970a.rs new file mode 100644 index 00000000000..b97c3037770 --- /dev/null +++ b/src/test/ui/issue-7970a.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! one_arg_macro { + ($fmt:expr) => (print!(concat!($fmt, "\n"))); +} + +fn main() { + one_arg_macro!(); + //~^ ERROR unexpected end of macro invocation +} diff --git a/src/test/ui/issue-7970a.stderr b/src/test/ui/issue-7970a.stderr new file mode 100644 index 00000000000..7ad95717185 --- /dev/null +++ b/src/test/ui/issue-7970a.stderr @@ -0,0 +1,8 @@ +error: unexpected end of macro invocation + --> $DIR/issue-7970a.rs:16:5 + | +LL | one_arg_macro!(); + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-7970b.rs b/src/test/ui/issue-7970b.rs new file mode 100644 index 00000000000..0cff90f281b --- /dev/null +++ b/src/test/ui/issue-7970b.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() {} + +macro_rules! test {} +//~^ ERROR unexpected end of macro invocation diff --git a/src/test/ui/issue-7970b.stderr b/src/test/ui/issue-7970b.stderr new file mode 100644 index 00000000000..b2feb677863 --- /dev/null +++ b/src/test/ui/issue-7970b.stderr @@ -0,0 +1,8 @@ +error: unexpected end of macro invocation + --> $DIR/issue-7970b.rs:13:1 + | +LL | macro_rules! test {} + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-8153.rs b/src/test/ui/issue-8153.rs new file mode 100644 index 00000000000..457918b54d4 --- /dev/null +++ b/src/test/ui/issue-8153.rs @@ -0,0 +1,26 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that duplicate methods in impls are not allowed + +struct Foo; + +trait Bar { + fn bar(&self) -> isize; +} + +impl Bar for Foo { + fn bar(&self) -> isize {1} + fn bar(&self) -> isize {2} //~ ERROR duplicate definitions +} + +fn main() { + println!("{}", Foo.bar()); +} diff --git a/src/test/ui/issue-8153.stderr b/src/test/ui/issue-8153.stderr new file mode 100644 index 00000000000..03fb89f8ccc --- /dev/null +++ b/src/test/ui/issue-8153.stderr @@ -0,0 +1,11 @@ +error[E0201]: duplicate definitions with name `bar`: + --> $DIR/issue-8153.rs:21:5 + | +LL | fn bar(&self) -> isize {1} + | -------------------------- previous definition of `bar` here +LL | fn bar(&self) -> isize {2} //~ ERROR duplicate definitions + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/ui/issue-8208.rs b/src/test/ui/issue-8208.rs new file mode 100644 index 00000000000..670b6bd46e7 --- /dev/null +++ b/src/test/ui/issue-8208.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use self::*; //~ ERROR: unresolved import `self::*` [E0432] + //~^ Cannot glob-import a module into itself. + +mod foo { + use foo::*; //~ ERROR: unresolved import `foo::*` [E0432] + //~^ Cannot glob-import a module into itself. + + mod bar { + use super::bar::*; + //~^ ERROR: unresolved import `super::bar::*` [E0432] + //~| Cannot glob-import a module into itself. + } + +} + +fn main() { +} diff --git a/src/test/ui/issue-8208.stderr b/src/test/ui/issue-8208.stderr new file mode 100644 index 00000000000..73a9a6a51be --- /dev/null +++ b/src/test/ui/issue-8208.stderr @@ -0,0 +1,21 @@ +error[E0432]: unresolved import `self::*` + --> $DIR/issue-8208.rs:11:5 + | +LL | use self::*; //~ ERROR: unresolved import `self::*` [E0432] + | ^^^^^^^ Cannot glob-import a module into itself. + +error[E0432]: unresolved import `foo::*` + --> $DIR/issue-8208.rs:15:9 + | +LL | use foo::*; //~ ERROR: unresolved import `foo::*` [E0432] + | ^^^^^^ Cannot glob-import a module into itself. + +error[E0432]: unresolved import `super::bar::*` + --> $DIR/issue-8208.rs:19:13 + | +LL | use super::bar::*; + | ^^^^^^^^^^^^^ Cannot glob-import a module into itself. + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-8460-const.rs b/src/test/ui/issue-8460-const.rs new file mode 100644 index 00000000000..b0d6cb5df87 --- /dev/null +++ b/src/test/ui/issue-8460-const.rs @@ -0,0 +1,77 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(const_err)] + +use std::{isize, i8, i16, i32, i64}; +use std::thread; + +fn main() { + assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); + //~^ ERROR attempt to divide with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); + //~^ ERROR attempt to divide with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); + //~^ ERROR attempt to divide with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); + //~^ ERROR attempt to divide with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); + //~^ ERROR attempt to divide with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); + //~^ ERROR attempt to divide by zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); + //~^ ERROR attempt to divide by zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); + //~^ ERROR attempt to divide by zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); + //~^ ERROR attempt to divide by zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); + //~^ ERROR attempt to divide by zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with overflow + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with a divisor of zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with a divisor of zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with a divisor of zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with a divisor of zero + //~| ERROR this expression will panic at runtime + assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); + //~^ ERROR attempt to calculate the remainder with a divisor of zero + //~| ERROR this expression will panic at runtime +} diff --git a/src/test/ui/issue-8460-const.stderr b/src/test/ui/issue-8460-const.stderr new file mode 100644 index 00000000000..db35cde7569 --- /dev/null +++ b/src/test/ui/issue-8460-const.stderr @@ -0,0 +1,248 @@ +error: attempt to divide with overflow + --> $DIR/issue-8460-const.rs:17:36 + | +LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-8460-const.rs:11:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:17:36 + | +LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^^^ attempt to divide with overflow + +error: attempt to divide with overflow + --> $DIR/issue-8460-const.rs:20:36 + | +LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:20:36 + | +LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^ attempt to divide with overflow + +error: attempt to divide with overflow + --> $DIR/issue-8460-const.rs:23:36 + | +LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:23:36 + | +LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^ attempt to divide with overflow + +error: attempt to divide with overflow + --> $DIR/issue-8460-const.rs:26:36 + | +LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:26:36 + | +LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^ attempt to divide with overflow + +error: attempt to divide with overflow + --> $DIR/issue-8460-const.rs:29:36 + | +LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:29:36 + | +LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); + | ^^^^^^^^^^^^^ attempt to divide with overflow + +error: attempt to divide by zero + --> $DIR/issue-8460-const.rs:32:36 + | +LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); + | ^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:32:36 + | +LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); + | ^^^^^^^^^^ attempt to divide by zero + +error: attempt to divide by zero + --> $DIR/issue-8460-const.rs:35:36 + | +LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); + | ^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:35:36 + | +LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); + | ^^^^^^^ attempt to divide by zero + +error: attempt to divide by zero + --> $DIR/issue-8460-const.rs:38:36 + | +LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); + | ^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:38:36 + | +LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); + | ^^^^^^^^ attempt to divide by zero + +error: attempt to divide by zero + --> $DIR/issue-8460-const.rs:41:36 + | +LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); + | ^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:41:36 + | +LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); + | ^^^^^^^^ attempt to divide by zero + +error: attempt to divide by zero + --> $DIR/issue-8460-const.rs:44:36 + | +LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); + | ^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:44:36 + | +LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); + | ^^^^^^^^ attempt to divide by zero + +error: attempt to calculate the remainder with overflow + --> $DIR/issue-8460-const.rs:47:36 + | +LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:47:36 + | +LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^^^ attempt to calculate the remainder with overflow + +error: attempt to calculate the remainder with overflow + --> $DIR/issue-8460-const.rs:50:36 + | +LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:50:36 + | +LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^ attempt to calculate the remainder with overflow + +error: attempt to calculate the remainder with overflow + --> $DIR/issue-8460-const.rs:53:36 + | +LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:53:36 + | +LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow + +error: attempt to calculate the remainder with overflow + --> $DIR/issue-8460-const.rs:56:36 + | +LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:56:36 + | +LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow + +error: attempt to calculate the remainder with overflow + --> $DIR/issue-8460-const.rs:59:36 + | +LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:59:36 + | +LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); + | ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow + +error: attempt to calculate the remainder with a divisor of zero + --> $DIR/issue-8460-const.rs:62:36 + | +LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); + | ^^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:62:36 + | +LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); + | ^^^^^^^^^^ attempt to calculate the remainder with a divisor of zero + +error: attempt to calculate the remainder with a divisor of zero + --> $DIR/issue-8460-const.rs:65:36 + | +LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); + | ^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:65:36 + | +LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); + | ^^^^^^^ attempt to calculate the remainder with a divisor of zero + +error: attempt to calculate the remainder with a divisor of zero + --> $DIR/issue-8460-const.rs:68:36 + | +LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); + | ^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:68:36 + | +LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); + | ^^^^^^^^ attempt to calculate the remainder with a divisor of zero + +error: attempt to calculate the remainder with a divisor of zero + --> $DIR/issue-8460-const.rs:71:36 + | +LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); + | ^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:71:36 + | +LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); + | ^^^^^^^^ attempt to calculate the remainder with a divisor of zero + +error: attempt to calculate the remainder with a divisor of zero + --> $DIR/issue-8460-const.rs:74:36 + | +LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); + | ^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/issue-8460-const.rs:74:36 + | +LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); + | ^^^^^^^^ attempt to calculate the remainder with a divisor of zero + +error: aborting due to 40 previous errors + diff --git a/src/test/ui/issue-8640.rs b/src/test/ui/issue-8640.rs new file mode 100644 index 00000000000..c4ca3acf080 --- /dev/null +++ b/src/test/ui/issue-8640.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[allow(unused_imports)] + +mod foo { + use baz::bar; + mod bar {} + //~^ ERROR the name `bar` is defined multiple times +} +mod baz { pub mod bar {} } + +fn main() {} diff --git a/src/test/ui/issue-8640.stderr b/src/test/ui/issue-8640.stderr new file mode 100644 index 00000000000..68fdea6e228 --- /dev/null +++ b/src/test/ui/issue-8640.stderr @@ -0,0 +1,17 @@ +error[E0255]: the name `bar` is defined multiple times + --> $DIR/issue-8640.rs:15:5 + | +LL | use baz::bar; + | -------- previous import of the module `bar` here +LL | mod bar {} + | ^^^^^^^ `bar` redefined here + | + = note: `bar` 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 baz::bar as other_bar; + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0255`. diff --git a/src/test/ui/issue-8727.rs b/src/test/ui/issue-8727.rs new file mode 100644 index 00000000000..fc88a2c81b4 --- /dev/null +++ b/src/test/ui/issue-8727.rs @@ -0,0 +1,25 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Verify the compiler fails with an error on infinite function +// recursions. + +fn generic() { + generic::>(); +} +//~^^^ ERROR reached the recursion limit while instantiating `generic:: at least once to trigger instantiation. + generic::(); +} diff --git a/src/test/ui/issue-8727.stderr b/src/test/ui/issue-8727.stderr new file mode 100644 index 00000000000..28fb71bcc17 --- /dev/null +++ b/src/test/ui/issue-8727.stderr @@ -0,0 +1,21 @@ +warning: function cannot return without recurring + --> $DIR/issue-8727.rs:14:1 + | +LL | fn generic() { + | ^^^^^^^^^^^^^^^ cannot return without recurring +LL | generic::>(); + | ---------------------- recursive call site + | + = note: #[warn(unconditional_recursion)] on by default + = help: a `loop` may express intention better if this is on purpose + +error: reached the recursion limit while instantiating `generic::>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-8727.rs:14:1 + | +LL | / fn generic() { +LL | | generic::>(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-8761.rs b/src/test/ui/issue-8761.rs new file mode 100644 index 00000000000..f8424ea64ef --- /dev/null +++ b/src/test/ui/issue-8761.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + A = 1i64, + //~^ ERROR mismatched types + //~| expected isize, found i64 + B = 2u8 + //~^ ERROR mismatched types + //~| expected isize, found u8 +} + +fn main() {} diff --git a/src/test/ui/issue-8761.stderr b/src/test/ui/issue-8761.stderr new file mode 100644 index 00000000000..b8144df3835 --- /dev/null +++ b/src/test/ui/issue-8761.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-8761.rs:12:9 + | +LL | A = 1i64, + | ^^^^ expected isize, found i64 + +error[E0308]: mismatched types + --> $DIR/issue-8761.rs:15:9 + | +LL | B = 2u8 + | ^^^ expected isize, found u8 + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-8767.rs b/src/test/ui/issue-8767.rs new file mode 100644 index 00000000000..926cae788aa --- /dev/null +++ b/src/test/ui/issue-8767.rs @@ -0,0 +1,15 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +impl B { //~ ERROR cannot find type `B` in this scope +} + +fn main() { +} diff --git a/src/test/ui/issue-8767.stderr b/src/test/ui/issue-8767.stderr new file mode 100644 index 00000000000..d03e20ba270 --- /dev/null +++ b/src/test/ui/issue-8767.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `B` in this scope + --> $DIR/issue-8767.rs:11:6 + | +LL | impl B { //~ ERROR cannot find type `B` in this scope + | ^ 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/issue-9575.rs b/src/test/ui/issue-9575.rs new file mode 100644 index 00000000000..9295eeb1779 --- /dev/null +++ b/src/test/ui/issue-9575.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(start)] + +#[start] +fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { + //~^ start function has wrong type + 0 +} diff --git a/src/test/ui/issue-9575.stderr b/src/test/ui/issue-9575.stderr new file mode 100644 index 00000000000..d52669777bd --- /dev/null +++ b/src/test/ui/issue-9575.stderr @@ -0,0 +1,12 @@ +error[E0308]: start function has wrong type + --> $DIR/issue-9575.rs:14:1 + | +LL | fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn(isize, *const *const u8) -> isize` + found type `fn(isize, *const *const u8, *const u8) -> isize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-9725.rs b/src/test/ui/issue-9725.rs new file mode 100644 index 00000000000..f53122d19c1 --- /dev/null +++ b/src/test/ui/issue-9725.rs @@ -0,0 +1,17 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct A { foo: isize } + +fn main() { + let A { foo, foo } = A { foo: 3 }; + //~^ ERROR: identifier `foo` is bound more than once in the same pattern + //~^^ ERROR: field `foo` bound multiple times +} diff --git a/src/test/ui/issue-9725.stderr b/src/test/ui/issue-9725.stderr new file mode 100644 index 00000000000..1d7fdad82a0 --- /dev/null +++ b/src/test/ui/issue-9725.stderr @@ -0,0 +1,18 @@ +error[E0416]: identifier `foo` is bound more than once in the same pattern + --> $DIR/issue-9725.rs:14:18 + | +LL | let A { foo, foo } = A { foo: 3 }; + | ^^^ used in a pattern more than once + +error[E0025]: field `foo` bound multiple times in the pattern + --> $DIR/issue-9725.rs:14:18 + | +LL | let A { foo, foo } = A { foo: 3 }; + | --- ^^^ multiple uses of `foo` in pattern + | | + | first use of `foo` + +error: aborting due to 2 previous errors + +Some errors occurred: E0025, E0416. +For more information about an error, try `rustc --explain E0025`. diff --git a/src/test/ui/issue-9814.rs b/src/test/ui/issue-9814.rs new file mode 100644 index 00000000000..226734b84d6 --- /dev/null +++ b/src/test/ui/issue-9814.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Verify that single-variant enums can't be de-referenced +// Regression test for issue #9814 + +enum Foo { Bar(isize) } + +fn main() { + let _ = *Foo::Bar(2); //~ ERROR type `Foo` cannot be dereferenced +} diff --git a/src/test/ui/issue-9814.stderr b/src/test/ui/issue-9814.stderr new file mode 100644 index 00000000000..2e85bd46fe6 --- /dev/null +++ b/src/test/ui/issue-9814.stderr @@ -0,0 +1,9 @@ +error[E0614]: type `Foo` cannot be dereferenced + --> $DIR/issue-9814.rs:17:13 + | +LL | let _ = *Foo::Bar(2); //~ ERROR type `Foo` cannot be dereferenced + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0614`. diff --git a/src/test/ui/issue-pr29383.rs b/src/test/ui/issue-pr29383.rs new file mode 100644 index 00000000000..b60c537e1e6 --- /dev/null +++ b/src/test/ui/issue-pr29383.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum E { + A, + B, +} + +fn main() { + match None { + None => {} + Some(E::A(..)) => {} //~ ERROR expected tuple struct/variant, found unit variant `E::A` + Some(E::B(..)) => {} //~ ERROR expected tuple struct/variant, found unit variant `E::B` + } +} diff --git a/src/test/ui/issue-pr29383.stderr b/src/test/ui/issue-pr29383.stderr new file mode 100644 index 00000000000..9b8956da7a2 --- /dev/null +++ b/src/test/ui/issue-pr29383.stderr @@ -0,0 +1,15 @@ +error[E0532]: expected tuple struct/variant, found unit variant `E::A` + --> $DIR/issue-pr29383.rs:19:14 + | +LL | Some(E::A(..)) => {} //~ ERROR expected tuple struct/variant, found unit variant `E::A` + | ^^^^ not a tuple struct/variant + +error[E0532]: expected tuple struct/variant, found unit variant `E::B` + --> $DIR/issue-pr29383.rs:20:14 + | +LL | Some(E::B(..)) => {} //~ ERROR expected tuple struct/variant, found unit variant `E::B` + | ^^^^ not a tuple struct/variant + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0532`. -- cgit 1.4.1-3-g733a5 From f760960088322f576ceeff08810d7090e74b4cd9 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 15 Jul 2018 22:36:05 -0700 Subject: Fix tests --- src/test/compile-fail/issue-15919.rs | 21 +++++++++++++++++++++ src/test/compile-fail/issue-17913.rs | 28 ++++++++++++++++++++++++++++ src/test/compile-fail/issue-28625.rs | 30 ++++++++++++++++++++++++++++++ src/test/compile-fail/issue-32377.rs | 27 +++++++++++++++++++++++++++ src/test/ui/issue-15919.rs | 21 --------------------- src/test/ui/issue-15919.stderr | 4 ---- src/test/ui/issue-17913.rs | 28 ---------------------------- src/test/ui/issue-17913.stderr | 4 ---- src/test/ui/issue-28625.rs | 30 ------------------------------ src/test/ui/issue-28625.stderr | 12 ------------ src/test/ui/issue-32377.rs | 27 --------------------------- src/test/ui/issue-32377.stderr | 12 ------------ 12 files changed, 106 insertions(+), 138 deletions(-) create mode 100644 src/test/compile-fail/issue-15919.rs create mode 100644 src/test/compile-fail/issue-17913.rs create mode 100644 src/test/compile-fail/issue-28625.rs create mode 100644 src/test/compile-fail/issue-32377.rs delete mode 100644 src/test/ui/issue-15919.rs delete mode 100644 src/test/ui/issue-15919.stderr delete mode 100644 src/test/ui/issue-17913.rs delete mode 100644 src/test/ui/issue-17913.stderr delete mode 100644 src/test/ui/issue-28625.rs delete mode 100644 src/test/ui/issue-28625.stderr delete mode 100644 src/test/ui/issue-32377.rs delete mode 100644 src/test/ui/issue-32377.stderr (limited to 'src/test') diff --git a/src/test/compile-fail/issue-15919.rs b/src/test/compile-fail/issue-15919.rs new file mode 100644 index 00000000000..df7e7c102b2 --- /dev/null +++ b/src/test/compile-fail/issue-15919.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern: too big for the current architecture + +#[cfg(target_pointer_width = "32")] +fn main() { + let x = [0usize; 0xffff_ffff]; +} + +#[cfg(target_pointer_width = "64")] +fn main() { + let x = [0usize; 0xffff_ffff_ffff_ffff]; +} diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/compile-fail/issue-17913.rs new file mode 100644 index 00000000000..80e5f2b6e21 --- /dev/null +++ b/src/test/compile-fail/issue-17913.rs @@ -0,0 +1,28 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +// error-pattern: too big for the current architecture + +#![feature(box_syntax)] + +#[cfg(target_pointer_width = "64")] +fn main() { + let n = 0_usize; + let a: Box<_> = box [&n; 0xF000000000000000_usize]; + println!("{}", a[0xFFFFFF_usize]); +} + +#[cfg(target_pointer_width = "32")] +fn main() { + let n = 0_usize; + let a: Box<_> = box [&n; 0xFFFFFFFF_usize]; + println!("{}", a[0xFFFFFF_usize]); +} diff --git a/src/test/compile-fail/issue-28625.rs b/src/test/compile-fail/issue-28625.rs new file mode 100644 index 00000000000..dc9155ed66c --- /dev/null +++ b/src/test/compile-fail/issue-28625.rs @@ -0,0 +1,30 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Bar { + type Bar; +} + +struct ArrayPeano { + data: T::Bar, +} + +fn foo(a: &ArrayPeano) -> &[T] where T: Bar { + unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes +} + +impl Bar for () { + type Bar = (); +} + +fn main() { + let x: ArrayPeano<()> = ArrayPeano { data: () }; + foo(&x); +} diff --git a/src/test/compile-fail/issue-32377.rs b/src/test/compile-fail/issue-32377.rs new file mode 100644 index 00000000000..5091ba4ee1a --- /dev/null +++ b/src/test/compile-fail/issue-32377.rs @@ -0,0 +1,27 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::mem; +use std::marker::PhantomData; + +trait Foo { + type Error; +} + +struct Bar { + stream: PhantomData, +} + +fn foo(x: [usize; 2]) -> Bar { + unsafe { mem::transmute(x) } + //~^ ERROR transmute called with types of different sizes +} + +fn main() {} diff --git a/src/test/ui/issue-15919.rs b/src/test/ui/issue-15919.rs deleted file mode 100644 index df7e7c102b2..00000000000 --- a/src/test/ui/issue-15919.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: too big for the current architecture - -#[cfg(target_pointer_width = "32")] -fn main() { - let x = [0usize; 0xffff_ffff]; -} - -#[cfg(target_pointer_width = "64")] -fn main() { - let x = [0usize; 0xffff_ffff_ffff_ffff]; -} diff --git a/src/test/ui/issue-15919.stderr b/src/test/ui/issue-15919.stderr deleted file mode 100644 index a69e7b43e25..00000000000 --- a/src/test/ui/issue-15919.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: the type `[usize; 18446744073709551615]` is too big for the current architecture - -error: aborting due to previous error - diff --git a/src/test/ui/issue-17913.rs b/src/test/ui/issue-17913.rs deleted file mode 100644 index 80e5f2b6e21..00000000000 --- a/src/test/ui/issue-17913.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -// error-pattern: too big for the current architecture - -#![feature(box_syntax)] - -#[cfg(target_pointer_width = "64")] -fn main() { - let n = 0_usize; - let a: Box<_> = box [&n; 0xF000000000000000_usize]; - println!("{}", a[0xFFFFFF_usize]); -} - -#[cfg(target_pointer_width = "32")] -fn main() { - let n = 0_usize; - let a: Box<_> = box [&n; 0xFFFFFFFF_usize]; - println!("{}", a[0xFFFFFF_usize]); -} diff --git a/src/test/ui/issue-17913.stderr b/src/test/ui/issue-17913.stderr deleted file mode 100644 index ca8a28c0fd7..00000000000 --- a/src/test/ui/issue-17913.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: the type `[&usize; 17293822569102704640]` is too big for the current architecture - -error: aborting due to previous error - diff --git a/src/test/ui/issue-28625.rs b/src/test/ui/issue-28625.rs deleted file mode 100644 index dc9155ed66c..00000000000 --- a/src/test/ui/issue-28625.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Bar { - type Bar; -} - -struct ArrayPeano { - data: T::Bar, -} - -fn foo(a: &ArrayPeano) -> &[T] where T: Bar { - unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes -} - -impl Bar for () { - type Bar = (); -} - -fn main() { - let x: ArrayPeano<()> = ArrayPeano { data: () }; - foo(&x); -} diff --git a/src/test/ui/issue-28625.stderr b/src/test/ui/issue-28625.stderr deleted file mode 100644 index 90b50f193fb..00000000000 --- a/src/test/ui/issue-28625.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0512]: transmute called with types of different sizes - --> $DIR/issue-28625.rs:20:14 - | -LL | unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes - | ^^^^^^^^^^^^^^^^^^^ - | - = note: source type: &ArrayPeano (64 bits) - = note: target type: &[T] (128 bits) - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/issue-32377.rs b/src/test/ui/issue-32377.rs deleted file mode 100644 index 5091ba4ee1a..00000000000 --- a/src/test/ui/issue-32377.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::mem; -use std::marker::PhantomData; - -trait Foo { - type Error; -} - -struct Bar { - stream: PhantomData, -} - -fn foo(x: [usize; 2]) -> Bar { - unsafe { mem::transmute(x) } - //~^ ERROR transmute called with types of different sizes -} - -fn main() {} diff --git a/src/test/ui/issue-32377.stderr b/src/test/ui/issue-32377.stderr deleted file mode 100644 index a0698885caa..00000000000 --- a/src/test/ui/issue-32377.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0512]: transmute called with types of different sizes - --> $DIR/issue-32377.rs:23:14 - | -LL | unsafe { mem::transmute(x) } - | ^^^^^^^^^^^^^^ - | - = note: source type: [usize; 2] (128 bits) - = note: target type: Bar (0 bits) - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0512`. -- cgit 1.4.1-3-g733a5 From 82fd8d74cdc41fd97a93b6354954eb4a927b6147 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Mon, 16 Jul 2018 14:11:37 -0700 Subject: Return tests that have platform dependant output --- src/test/compile-fail/issue-10755.rs | 15 +++++++++++++ src/test/compile-fail/issue-23595-1.rs | 26 +++++++++++++++++++++++ src/test/compile-fail/issue-26548.rs | 22 +++++++++++++++++++ src/test/compile-fail/issue-43733-2.rs | 39 ++++++++++++++++++++++++++++++++++ src/test/ui/issue-10755.rs | 15 ------------- src/test/ui/issue-10755.stderr | 6 ------ src/test/ui/issue-23595-1.rs | 26 ----------------------- src/test/ui/issue-23595-1.stderr | 21 ------------------ src/test/ui/issue-26548.rs | 22 ------------------- src/test/ui/issue-26548.stderr | 9 -------- src/test/ui/issue-43733-2.rs | 39 ---------------------------------- src/test/ui/issue-43733-2.stderr | 23 -------------------- 12 files changed, 102 insertions(+), 161 deletions(-) create mode 100644 src/test/compile-fail/issue-10755.rs create mode 100644 src/test/compile-fail/issue-23595-1.rs create mode 100644 src/test/compile-fail/issue-26548.rs create mode 100644 src/test/compile-fail/issue-43733-2.rs delete mode 100644 src/test/ui/issue-10755.rs delete mode 100644 src/test/ui/issue-10755.stderr delete mode 100644 src/test/ui/issue-23595-1.rs delete mode 100644 src/test/ui/issue-23595-1.stderr delete mode 100644 src/test/ui/issue-26548.rs delete mode 100644 src/test/ui/issue-26548.stderr delete mode 100644 src/test/ui/issue-43733-2.rs delete mode 100644 src/test/ui/issue-43733-2.stderr (limited to 'src/test') diff --git a/src/test/compile-fail/issue-10755.rs b/src/test/compile-fail/issue-10755.rs new file mode 100644 index 00000000000..57915bce456 --- /dev/null +++ b/src/test/compile-fail/issue-10755.rs @@ -0,0 +1,15 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -C linker=llllll -Z linker-flavor=ld +// error-pattern: linker `llllll` not found + +fn main() { +} diff --git a/src/test/compile-fail/issue-23595-1.rs b/src/test/compile-fail/issue-23595-1.rs new file mode 100644 index 00000000000..a3422d859c6 --- /dev/null +++ b/src/test/compile-fail/issue-23595-1.rs @@ -0,0 +1,26 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_type_defaults)] + +use std::ops::{Index}; + +trait Hierarchy { + type Value; + type ChildKey; + type Children = Index; + //~^ ERROR: the value of the associated type `ChildKey` + //~^^ ERROR: the value of the associated type `Children` + //~^^^ ERROR: the value of the associated type `Value` + + fn data(&self) -> Option<(Self::Value, Self::Children)>; +} + +fn main() {} diff --git a/src/test/compile-fail/issue-26548.rs b/src/test/compile-fail/issue-26548.rs new file mode 100644 index 00000000000..fc4f3d1fb53 --- /dev/null +++ b/src/test/compile-fail/issue-26548.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//~^^^^^^^^^^ ERROR cycle detected when computing layout of +//~| NOTE ...which requires computing layout of +//~| NOTE ...which again requires computing layout of +//~| NOTE cycle used when compile_codegen_unit + +trait Mirror { type It: ?Sized; } +impl Mirror for T { type It = Self; } +struct S(Option<::It>); + +fn main() { + let _s = S(None); +} diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/compile-fail/issue-43733-2.rs new file mode 100644 index 00000000000..a5ba9ef9bd3 --- /dev/null +++ b/src/test/compile-fail/issue-43733-2.rs @@ -0,0 +1,39 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(const_fn)] +#![feature(cfg_target_thread_local, thread_local_internals)] + +// On platforms *without* `#[thread_local]`, use +// a custom non-`Sync` type to fake the same error. +#[cfg(not(target_thread_local))] +struct Key { + _data: std::cell::UnsafeCell>, + _flag: std::cell::Cell, +} + +#[cfg(not(target_thread_local))] +impl Key { + const fn new() -> Self { + Key { + _data: std::cell::UnsafeCell::new(None), + _flag: std::cell::Cell::new(false), + } + } +} + +#[cfg(target_thread_local)] +use std::thread::__FastLocalKeyInner as Key; + +static __KEY: Key<()> = Key::new(); +//~^ ERROR `std::cell::UnsafeCell>` cannot be shared between threads +//~| ERROR `std::cell::Cell` cannot be shared between threads safely [E0277] + +fn main() {} diff --git a/src/test/ui/issue-10755.rs b/src/test/ui/issue-10755.rs deleted file mode 100644 index 57915bce456..00000000000 --- a/src/test/ui/issue-10755.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -C linker=llllll -Z linker-flavor=ld -// error-pattern: linker `llllll` not found - -fn main() { -} diff --git a/src/test/ui/issue-10755.stderr b/src/test/ui/issue-10755.stderr deleted file mode 100644 index db64944d44f..00000000000 --- a/src/test/ui/issue-10755.stderr +++ /dev/null @@ -1,6 +0,0 @@ -error: linker `llllll` not found - | - = note: No such file or directory (os error 2) - -error: aborting due to previous error - diff --git a/src/test/ui/issue-23595-1.rs b/src/test/ui/issue-23595-1.rs deleted file mode 100644 index a3422d859c6..00000000000 --- a/src/test/ui/issue-23595-1.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_type_defaults)] - -use std::ops::{Index}; - -trait Hierarchy { - type Value; - type ChildKey; - type Children = Index; - //~^ ERROR: the value of the associated type `ChildKey` - //~^^ ERROR: the value of the associated type `Children` - //~^^^ ERROR: the value of the associated type `Value` - - fn data(&self) -> Option<(Self::Value, Self::Children)>; -} - -fn main() {} diff --git a/src/test/ui/issue-23595-1.stderr b/src/test/ui/issue-23595-1.stderr deleted file mode 100644 index 624534eb8d7..00000000000 --- a/src/test/ui/issue-23595-1.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0191]: the value of the associated type `ChildKey` (from the trait `Hierarchy`) must be specified - --> $DIR/issue-23595-1.rs:18:50 - | -LL | type Children = Index; - | ^^^^^^^^^ missing associated type `ChildKey` value - -error[E0191]: the value of the associated type `Children` (from the trait `Hierarchy`) must be specified - --> $DIR/issue-23595-1.rs:18:50 - | -LL | type Children = Index; - | ^^^^^^^^^ missing associated type `Children` value - -error[E0191]: the value of the associated type `Value` (from the trait `Hierarchy`) must be specified - --> $DIR/issue-23595-1.rs:18:50 - | -LL | type Children = Index; - | ^^^^^^^^^ missing associated type `Value` value - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/ui/issue-26548.rs b/src/test/ui/issue-26548.rs deleted file mode 100644 index fc4f3d1fb53..00000000000 --- a/src/test/ui/issue-26548.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//~^^^^^^^^^^ ERROR cycle detected when computing layout of -//~| NOTE ...which requires computing layout of -//~| NOTE ...which again requires computing layout of -//~| NOTE cycle used when compile_codegen_unit - -trait Mirror { type It: ?Sized; } -impl Mirror for T { type It = Self; } -struct S(Option<::It>); - -fn main() { - let _s = S(None); -} diff --git a/src/test/ui/issue-26548.stderr b/src/test/ui/issue-26548.stderr deleted file mode 100644 index c1db7fe128f..00000000000 --- a/src/test/ui/issue-26548.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0391]: cycle detected when computing layout of `std::option::Option` - | -note: ...which requires computing layout of `S`... - = note: ...which again requires computing layout of `std::option::Option`, completing the cycle -note: cycle used when compile_codegen_unit - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-43733-2.rs b/src/test/ui/issue-43733-2.rs deleted file mode 100644 index a5ba9ef9bd3..00000000000 --- a/src/test/ui/issue-43733-2.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(const_fn)] -#![feature(cfg_target_thread_local, thread_local_internals)] - -// On platforms *without* `#[thread_local]`, use -// a custom non-`Sync` type to fake the same error. -#[cfg(not(target_thread_local))] -struct Key { - _data: std::cell::UnsafeCell>, - _flag: std::cell::Cell, -} - -#[cfg(not(target_thread_local))] -impl Key { - const fn new() -> Self { - Key { - _data: std::cell::UnsafeCell::new(None), - _flag: std::cell::Cell::new(false), - } - } -} - -#[cfg(target_thread_local)] -use std::thread::__FastLocalKeyInner as Key; - -static __KEY: Key<()> = Key::new(); -//~^ ERROR `std::cell::UnsafeCell>` cannot be shared between threads -//~| ERROR `std::cell::Cell` cannot be shared between threads safely [E0277] - -fn main() {} diff --git a/src/test/ui/issue-43733-2.stderr b/src/test/ui/issue-43733-2.stderr deleted file mode 100644 index 8eb150ff833..00000000000 --- a/src/test/ui/issue-43733-2.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0277]: `std::cell::UnsafeCell>` cannot be shared between threads safely - --> $DIR/issue-43733-2.rs:35:1 - | -LL | static __KEY: Key<()> = Key::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell>` cannot be shared between threads safely - | - = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell>` - = note: required because it appears within the type `std::thread::Key<()>` - = note: shared static variables must have a type that implements `Sync` - -error[E0277]: `std::cell::Cell` cannot be shared between threads safely - --> $DIR/issue-43733-2.rs:35:1 - | -LL | static __KEY: Key<()> = Key::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely - | - = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell` - = note: required because it appears within the type `std::thread::Key<()>` - = note: shared static variables must have a type that implements `Sync` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. -- cgit 1.4.1-3-g733a5

= self.child.get(); - //~^ ERROR can't capture dynamic environment - panic!(); - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-3680.rs b/src/test/compile-fail/issue-3680.rs deleted file mode 100644 index e698e6da529..00000000000 --- a/src/test/compile-fail/issue-3680.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - match None { - Err(_) => () - //~^ ERROR mismatched types - //~| expected type `std::option::Option<_>` - //~| found type `std::result::Result<_, _>` - //~| expected enum `std::option::Option`, found enum `std::result::Result` - } -} diff --git a/src/test/compile-fail/issue-36839.rs b/src/test/compile-fail/issue-36839.rs deleted file mode 100644 index 3e34b250672..00000000000 --- a/src/test/compile-fail/issue-36839.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -pub trait Foo { - type Bar; -} - -pub trait Broken { - type Assoc; - fn broken(&self) where Self::Assoc: Foo; -} - -impl Broken for T { - type Assoc = (); - fn broken(&self) where Self::Assoc: Foo { - let _x: ::Bar; - } -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let _m: &Broken = &(); -} diff --git a/src/test/compile-fail/issue-3702-2.rs b/src/test/compile-fail/issue-3702-2.rs deleted file mode 100644 index 325f05841f4..00000000000 --- a/src/test/compile-fail/issue-3702-2.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait ToPrimitive { - fn to_int(&self) -> isize { 0 } -} - -impl ToPrimitive for i32 {} -impl ToPrimitive for isize {} - -trait Add { - fn to_int(&self) -> isize; - fn add_dynamic(&self, other: &Add) -> isize; -} - -impl Add for isize { - fn to_int(&self) -> isize { *self } - fn add_dynamic(&self, other: &Add) -> isize { - self.to_int() + other.to_int() //~ ERROR multiple applicable items in scope - } -} - -fn main() { } diff --git a/src/test/compile-fail/issue-37026.rs b/src/test/compile-fail/issue-37026.rs deleted file mode 100644 index 95fd5d1222e..00000000000 --- a/src/test/compile-fail/issue-37026.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:empty-struct.rs - -extern crate empty_struct; - -fn main() { - let empty_struct::XEmpty2 = (); //~ ERROR mismatched types - let empty_struct::XEmpty6(..) = (); //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-37051.rs b/src/test/compile-fail/issue-37051.rs deleted file mode 100644 index ab08e1899a0..00000000000 --- a/src/test/compile-fail/issue-37051.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs, associated_type_defaults)] -#![allow(warnings)] - -trait State: Sized { - type NextState: State = StateMachineEnded; - fn execute(self) -> Option; -} - -struct StateMachineEnded; - -impl State for StateMachineEnded { - fn execute(self) -> Option { - None - } -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful -} diff --git a/src/test/compile-fail/issue-3707.rs b/src/test/compile-fail/issue-3707.rs deleted file mode 100644 index ad56b125b08..00000000000 --- a/src/test/compile-fail/issue-3707.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Obj { - member: usize -} - -impl Obj { - pub fn boom() -> bool { - return 1+1 == 2 - } - pub fn chirp(&self) { - self.boom(); //~ ERROR no method named `boom` found for type `&Obj` in the current scope - } -} - -fn main() { - let o = Obj { member: 0 }; - o.chirp(); - 1 + 1; -} diff --git a/src/test/compile-fail/issue-37323.rs b/src/test/compile-fail/issue-37323.rs deleted file mode 100644 index 98806cdd1b9..00000000000 --- a/src/test/compile-fail/issue-37323.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -#[derive(Debug)] -struct Point { -} - -struct NestedA<'a, 'b> { - x: &'a NestedB<'b> - //~^ ERROR E0491 -} - -struct NestedB<'a> { - x: &'a i32, -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-37366.rs b/src/test/compile-fail/issue-37366.rs deleted file mode 100644 index 2a4808fb186..00000000000 --- a/src/test/compile-fail/issue-37366.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-emscripten - -#![feature(rustc_attrs, asm)] - -macro_rules! interrupt_handler { - () => { - unsafe fn _interrupt_handler() { - asm!("pop eax" :::: "intel"); - } - } -} -interrupt_handler!{} - -#[rustc_error] -fn main() { //~ ERROR compilation successful -} diff --git a/src/test/compile-fail/issue-37510.rs b/src/test/compile-fail/issue-37510.rs deleted file mode 100644 index 53c91f323d0..00000000000 --- a/src/test/compile-fail/issue-37510.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -fn foo(_: &mut i32) -> bool { true } - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let opt = Some(92); - let mut x = 62; - - if let Some(_) = opt { - - } else if foo(&mut x) { - - } -} diff --git a/src/test/compile-fail/issue-37515.rs b/src/test/compile-fail/issue-37515.rs deleted file mode 100644 index d5733f98193..00000000000 --- a/src/test/compile-fail/issue-37515.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![warn(unused)] - -type Z = for<'x> Send; -//~^ WARN type alias is never used - -#[rustc_error] -fn main() { //~ ERROR compilation successful -} diff --git a/src/test/compile-fail/issue-37534.rs b/src/test/compile-fail/issue-37534.rs deleted file mode 100644 index 70c8f92de63..00000000000 --- a/src/test/compile-fail/issue-37534.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo { } -//~^ ERROR cannot find trait `Hash` in this scope -//~^^ ERROR parameter `T` is never used -//~^^^ WARN default bound relaxed for a type parameter, but this does nothing - -fn main() { } diff --git a/src/test/compile-fail/issue-37550.rs b/src/test/compile-fail/issue-37550.rs deleted file mode 100644 index af1f6ef5ed4..00000000000 --- a/src/test/compile-fail/issue-37550.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(const_fn)] - -const fn x() { - let t = true; - //~^ ERROR let bindings in constant functions are unstable - //~| ERROR statements in constant functions are unstable - let x = || t; - //~^ ERROR let bindings in constant functions are unstable - //~| ERROR statements in constant functions are unstable -} - -fn main() {} diff --git a/src/test/compile-fail/issue-37576.rs b/src/test/compile-fail/issue-37576.rs deleted file mode 100644 index e3c1ada878d..00000000000 --- a/src/test/compile-fail/issue-37576.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - 'test_1: while break 'test_1 {} - while break {} - //~^ ERROR `break` or `continue` with no label - - 'test_2: while let true = break 'test_2 {} - while let true = break {} - //~^ ERROR `break` or `continue` with no label - - loop { 'test_3: while break 'test_3 {} } - loop { while break {} } - //~^ ERROR `break` or `continue` with no label - - loop { - 'test_4: while break 'test_4 {} - break; - } - loop { - while break {} - //~^ ERROR `break` or `continue` with no label - break; - } - - 'test_5: while continue 'test_5 {} - while continue {} - //~^ ERROR `break` or `continue` with no label - - 'test_6: while let true = continue 'test_6 {} - while let true = continue {} - //~^ ERROR `break` or `continue` with no label - - loop { 'test_7: while continue 'test_7 {} } - loop { while continue {} } - //~^ ERROR `break` or `continue` with no label - - loop { - 'test_8: while continue 'test_8 {} - continue; - } - loop { - while continue {} - //~^ ERROR `break` or `continue` with no label - continue; - } -} diff --git a/src/test/compile-fail/issue-3763.rs b/src/test/compile-fail/issue-3763.rs deleted file mode 100644 index 851f5dfeabe..00000000000 --- a/src/test/compile-fail/issue-3763.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -mod my_mod { - pub struct MyStruct { - priv_field: isize - } - pub fn MyStruct () -> MyStruct { - MyStruct {priv_field: 4} - } - impl MyStruct { - fn happyfun(&self) {} - } -} - -fn main() { - let my_struct = my_mod::MyStruct(); - let _woohoo = (&my_struct).priv_field; - //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private - - let _woohoo = (Box::new(my_struct)).priv_field; - //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private - - (&my_struct).happyfun(); //~ ERROR method `happyfun` is private - - (Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private - let nope = my_struct.priv_field; - //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private -} diff --git a/src/test/compile-fail/issue-37665.rs b/src/test/compile-fail/issue-37665.rs deleted file mode 100644 index 81ed4375e77..00000000000 --- a/src/test/compile-fail/issue-37665.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z unpretty=mir -// ignore-cloudabi no std::path - -use std::path::MAIN_SEPARATOR; - -fn main() { - let mut foo : String = "hello".to_string(); - foo.push(MAIN_SEPARATOR); - println!("{}", foo); - let x: () = 0; //~ ERROR: mismatched types -} diff --git a/src/test/compile-fail/issue-37887.rs b/src/test/compile-fail/issue-37887.rs deleted file mode 100644 index f120bbbfc9f..00000000000 --- a/src/test/compile-fail/issue-37887.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - extern crate libc; //~ ERROR use of unstable - use libc::*; //~ ERROR unresolved import -} diff --git a/src/test/compile-fail/issue-38160.rs b/src/test/compile-fail/issue-38160.rs deleted file mode 100644 index 311d0ceb4d3..00000000000 --- a/src/test/compile-fail/issue-38160.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_consts, rustc_attrs)] -#![allow(warnings)] - -trait MyTrait { - const MY_CONST: &'static str; -} - -macro_rules! my_macro { - () => { - struct MyStruct; - - impl MyTrait for MyStruct { - const MY_CONST: &'static str = stringify!(abc); - } - } -} - -my_macro!(); - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-3820.rs b/src/test/compile-fail/issue-3820.rs deleted file mode 100644 index 28de76f18da..00000000000 --- a/src/test/compile-fail/issue-3820.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Thing { - x: isize -} - -impl Thing { - fn mul(&self, c: &isize) -> Thing { - Thing {x: self.x * *c} - } -} - -fn main() { - let u = Thing {x: 2}; - let _v = u.mul(&3); // This is ok - let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing` -} diff --git a/src/test/compile-fail/issue-38293.rs b/src/test/compile-fail/issue-38293.rs deleted file mode 100644 index 1867bafa7e3..00000000000 --- a/src/test/compile-fail/issue-38293.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that `fn foo::bar::{self}` only imports `bar` in the type namespace. - -mod foo { - pub fn f() { } -} -use foo::f::{self}; //~ ERROR unresolved import `foo::f` - -mod bar { - pub fn baz() {} - pub mod baz {} -} -use bar::baz::{self}; - -fn main() { - baz(); //~ ERROR expected function, found module `baz` -} diff --git a/src/test/compile-fail/issue-38381.rs b/src/test/compile-fail/issue-38381.rs deleted file mode 100644 index 6b7dde117df..00000000000 --- a/src/test/compile-fail/issue-38381.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -use std::ops::Deref; - -#[rustc_error] -fn main() { //~ ERROR compilation successful - let _x: fn(&i32) -> <&i32 as Deref>::Target = unimplemented!(); -} diff --git a/src/test/compile-fail/issue-38404.rs b/src/test/compile-fail/issue-38404.rs deleted file mode 100644 index a2b0d0a60c0..00000000000 --- a/src/test/compile-fail/issue-38404.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait A: std::ops::Add + Sized {} -trait B: A {} -trait C: A> {} -//~^ ERROR the trait `B` cannot be made into an object - -fn main() {} diff --git a/src/test/compile-fail/issue-38412.rs b/src/test/compile-fail/issue-38412.rs deleted file mode 100644 index b4feadbacf7..00000000000 --- a/src/test/compile-fail/issue-38412.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let Box(a) = loop { }; - //~^ ERROR expected tuple struct/variant, found struct `Box` - - // (The below is a trick to allow compiler to infer a type for - // variable `a` without attempting to ascribe a type to the - // pattern or otherwise attempting to name the Box type, which - // would run afoul of issue #22207) - let _b: *mut i32 = *a; -} diff --git a/src/test/compile-fail/issue-38458.rs b/src/test/compile-fail/issue-38458.rs deleted file mode 100644 index 56eb5f874cd..00000000000 --- a/src/test/compile-fail/issue-38458.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const x: () = { - return; //~ ERROR return statement outside of function body -}; - -fn main() {} diff --git a/src/test/compile-fail/issue-38604.rs b/src/test/compile-fail/issue-38604.rs deleted file mode 100644 index c1939a7707f..00000000000 --- a/src/test/compile-fail/issue-38604.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Q {} -trait Foo where u32: Q { - fn foo(&self); -} - -impl Q<()> for u32 {} -impl Foo for () { - fn foo(&self) { - println!("foo!"); - } -} - -fn main() { - let _f: Box = //~ ERROR `Foo` cannot be made into an object - Box::new(()); //~ ERROR `Foo` cannot be made into an object -} diff --git a/src/test/compile-fail/issue-38857.rs b/src/test/compile-fail/issue-38857.rs deleted file mode 100644 index b38b1b9fdc6..00000000000 --- a/src/test/compile-fail/issue-38857.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; - //~^ ERROR failed to resolve. Could not find `imp` in `sys` [E0433] - //~^^ ERROR module `sys` is private [E0603] -} diff --git a/src/test/compile-fail/issue-38868.rs b/src/test/compile-fail/issue-38868.rs deleted file mode 100644 index c7e1da7094f..00000000000 --- a/src/test/compile-fail/issue-38868.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub struct List { - head: T, -} - -impl Drop for List { //~ ERROR E0366 - fn drop(&mut self) { - panic!() - } -} - -fn main() { - List { head: 0 }; -} diff --git a/src/test/compile-fail/issue-38919.rs b/src/test/compile-fail/issue-38919.rs deleted file mode 100644 index e6cee4afd59..00000000000 --- a/src/test/compile-fail/issue-38919.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo() { - T::Item; //~ ERROR no associated item named `Item` found for type `T` in the current scope -} - -fn main() { } diff --git a/src/test/compile-fail/issue-38954.rs b/src/test/compile-fail/issue-38954.rs deleted file mode 100644 index 7f01ed3f820..00000000000 --- a/src/test/compile-fail/issue-38954.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn _test(ref _p: str) {} -//~^ ERROR the size for values of type - -fn main() { } diff --git a/src/test/compile-fail/issue-39211.rs b/src/test/compile-fail/issue-39211.rs deleted file mode 100644 index 96ba1c83997..00000000000 --- a/src/test/compile-fail/issue-39211.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(associated_consts)] - -trait VecN { - const DIM: usize; -} -trait Mat { - type Row: VecN; -} - -fn m() { - let a = [3; M::Row::DIM]; //~ ERROR associated type `Row` not found for `M` -} -fn main() { -} diff --git a/src/test/compile-fail/issue-39362.rs b/src/test/compile-fail/issue-39362.rs deleted file mode 100644 index 9d8abbfc65d..00000000000 --- a/src/test/compile-fail/issue-39362.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { - Bar { bar: Bar, id: usize } -} - -enum Bar { - A, B, C, D, E, F -} - -fn test(f: Foo) { - match f { - //~^ ERROR non-exhaustive patterns - //~| patterns - Foo::Bar { bar: Bar::A, .. } => (), - Foo::Bar { bar: Bar::B, .. } => (), - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-39388.rs b/src/test/compile-fail/issue-39388.rs deleted file mode 100644 index 6da04937408..00000000000 --- a/src/test/compile-fail/issue-39388.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused_macros)] - -macro_rules! assign { - (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?` - $($a)* = $($b)* - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-39404.rs b/src/test/compile-fail/issue-39404.rs deleted file mode 100644 index 56bfe27a4ff..00000000000 --- a/src/test/compile-fail/issue-39404.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused)] - -macro_rules! m { ($i) => {} } -//~^ ERROR missing fragment specifier -//~| WARN previously accepted - -fn main() {} diff --git a/src/test/compile-fail/issue-39559-2.rs b/src/test/compile-fail/issue-39559-2.rs deleted file mode 100644 index f01fd1fd8f1..00000000000 --- a/src/test/compile-fail/issue-39559-2.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Dim { - fn dim() -> usize; -} - -enum Dim3 {} - -impl Dim for Dim3 { - fn dim() -> usize { - 3 - } -} - -fn main() { - let array: [usize; Dim3::dim()] - //~^ ERROR E0015 - //~| ERROR E0080 - = [0; Dim3::dim()]; - //~^ ERROR E0015 - //~| ERROR E0080 -} diff --git a/src/test/compile-fail/issue-39559.rs b/src/test/compile-fail/issue-39559.rs deleted file mode 100644 index 2da21fb14bd..00000000000 --- a/src/test/compile-fail/issue-39559.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Dim { - fn dim() -> usize; -} - -enum Dim3 {} - -impl Dim for Dim3 { - fn dim() -> usize { - 3 - } -} - -pub struct Vector { - entries: [T; D::dim()], - //~^ ERROR no function or associated item named `dim` found for type `D` in the current scope - _dummy: D, -} - -fn main() {} diff --git a/src/test/compile-fail/issue-39616.rs b/src/test/compile-fail/issue-39616.rs deleted file mode 100644 index 13b4c0896e7..00000000000 --- a/src/test/compile-fail/issue-39616.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo(a: [0; 1]) {} //~ ERROR expected type, found `0` -//~| ERROR expected one of `)`, `,`, `->`, `where`, or `{`, found `]` -// FIXME(jseyfried): avoid emitting the second error (preexisting) - -fn main() {} diff --git a/src/test/compile-fail/issue-39687.rs b/src/test/compile-fail/issue-39687.rs deleted file mode 100644 index 404465e6a0f..00000000000 --- a/src/test/compile-fail/issue-39687.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(fn_traits)] - -fn main() { - ::call; - //~^ ERROR associated type bindings are not allowed here [E0229] -} diff --git a/src/test/compile-fail/issue-3973.rs b/src/test/compile-fail/issue-3973.rs deleted file mode 100644 index 67a934fccce..00000000000 --- a/src/test/compile-fail/issue-3973.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Point { - x: f64, - y: f64, -} - -trait ToString_ { - fn to_string(&self) -> String; -} - -impl ToString_ for Point { - fn new(x: f64, y: f64) -> Point { - //~^ ERROR method `new` is not a member of trait `ToString_` - Point { x: x, y: y } - } - - fn to_string(&self) -> String { - format!("({}, {})", self.x, self.y) - } -} - -fn main() { - let p = Point::new(0.0, 0.0); - //~^ ERROR no function or associated item named `new` found for type `Point` - println!("{}", p.to_string()); -} diff --git a/src/test/compile-fail/issue-39848.rs b/src/test/compile-fail/issue-39848.rs deleted file mode 100644 index d5ca009d310..00000000000 --- a/src/test/compile-fail/issue-39848.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! get_opt { - ($tgt:expr, $field:ident) => { - if $tgt.has_$field() {} - } -} - -fn main() { - get_opt!(bar, foo); - //~^ ERROR expected `{`, found `foo` -} diff --git a/src/test/compile-fail/issue-3993.rs b/src/test/compile-fail/issue-3993.rs deleted file mode 100644 index fae5eb51272..00000000000 --- a/src/test/compile-fail/issue-3993.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use zoo::fly; //~ ERROR: function `fly` is private - -mod zoo { - fn fly() {} -} - - -fn main() { - fly(); -} diff --git a/src/test/compile-fail/issue-39970.rs b/src/test/compile-fail/issue-39970.rs deleted file mode 100644 index 65ea1baa4a1..00000000000 --- a/src/test/compile-fail/issue-39970.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Array<'a> { - type Element: 'a; -} - -trait Visit { - fn visit() {} -} - -impl<'a> Array<'a> for () { - type Element = &'a (); -} - -impl Visit for () where - //(): for<'a> Array<'a, Element=&'a ()>, // No ICE - (): for<'a> Array<'a, Element=()>, // ICE -{} - -fn main() { - <() as Visit>::visit(); - //~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` -} diff --git a/src/test/compile-fail/issue-39974.rs b/src/test/compile-fail/issue-39974.rs deleted file mode 100644 index 6f6b775a2a3..00000000000 --- a/src/test/compile-fail/issue-39974.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -const LENGTH: f64 = 2; - -struct Thing { - f: [[f64; 2]; LENGTH], - //~^ ERROR mismatched types - //~| expected usize, found f64 -} - -fn main() { - let _t = Thing { f: [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]] }; -} diff --git a/src/test/compile-fail/issue-40000.rs b/src/test/compile-fail/issue-40000.rs deleted file mode 100644 index 7daf4bcbaa4..00000000000 --- a/src/test/compile-fail/issue-40000.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let bar: fn(&mut u32) = |_| {}; - - fn foo(x: Box) {} - let bar = Box::new(|x: &i32| {}) as Box; - foo(bar); //~ ERROR mismatched types - //~| expected concrete lifetime, found bound lifetime parameter -} diff --git a/src/test/compile-fail/issue-40288-2.rs b/src/test/compile-fail/issue-40288-2.rs deleted file mode 100644 index e16a7ecf6b9..00000000000 --- a/src/test/compile-fail/issue-40288-2.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn prove_static(_: &'static T) {} - -fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { - let mut out = [x]; - { - let slice: &mut [_] = &mut out; - slice[0] = y; - } - out[0] - //~^ ERROR 19:5: 19:11: explicit lifetime required in the type of `y` [E0621] -} - -struct Struct { - head: T, - _tail: U -} - -fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T { - let mut out = Struct { head: x, _tail: [()] }; - { - let dst: &mut Struct<_, [()]> = &mut out; - dst.head = y; - } - out.head - //~^ ERROR 34:5: 34:13: explicit lifetime required in the type of `y` [E0621] -} - -fn main() { - prove_static(lifetime_transmute_slice("", &String::from("foo"))); - prove_static(lifetime_transmute_struct("", &String::from("bar"))); -} diff --git a/src/test/compile-fail/issue-40288.rs b/src/test/compile-fail/issue-40288.rs deleted file mode 100644 index b5418e85bec..00000000000 --- a/src/test/compile-fail/issue-40288.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn save_ref<'a>(refr: &'a i32, to: &mut [&'a i32]) { - for val in &mut *to { - *val = refr; - } -} - -fn main() { - let ref init = 0i32; - let ref mut refr = 1i32; - - let mut out = [init]; - - save_ref(&*refr, &mut out); - - // This shouldn't be allowed as `refr` is borrowed - *refr = 3; //~ ERROR cannot assign to `*refr` because it is borrowed - - // Prints 3?! - println!("{:?}", out[0]); -} diff --git a/src/test/compile-fail/issue-40350.rs b/src/test/compile-fail/issue-40350.rs deleted file mode 100644 index 39249ee4718..00000000000 --- a/src/test/compile-fail/issue-40350.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(warnings)] - -enum E { - A = { - enum F { B } - 0 - } -} - -#[rustc_error] -fn main() {} -//~^ ERROR compilation successful - diff --git a/src/test/compile-fail/issue-40510-1.rs b/src/test/compile-fail/issue-40510-1.rs deleted file mode 100644 index 142092ff41e..00000000000 --- a/src/test/compile-fail/issue-40510-1.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(unused)] - -fn f() { - let mut x: Box<()> = Box::new(()); - - || { - &mut x - }; -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-40510-2.rs b/src/test/compile-fail/issue-40510-2.rs deleted file mode 100644 index 0fe56584822..00000000000 --- a/src/test/compile-fail/issue-40510-2.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(unused)] - -fn f() { - let x: Box<()> = Box::new(()); - - || { - &x - }; -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-40510-3.rs b/src/test/compile-fail/issue-40510-3.rs deleted file mode 100644 index afa8f15ee57..00000000000 --- a/src/test/compile-fail/issue-40510-3.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(unused)] - -fn f() { - let mut x: Vec<()> = Vec::new(); - - || { - || { - x.push(()) - } - }; -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-40510-4.rs b/src/test/compile-fail/issue-40510-4.rs deleted file mode 100644 index a39c500225b..00000000000 --- a/src/test/compile-fail/issue-40510-4.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] -#![allow(unused)] - -fn f() { - let x: Vec<()> = Vec::new(); - - || { - || { - x.len() - } - }; -} - -#[rustc_error] -fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-40610.rs b/src/test/compile-fail/issue-40610.rs deleted file mode 100644 index aec20b4ad87..00000000000 --- a/src/test/compile-fail/issue-40610.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f(_: &[f32]) {} - -fn main() { - () + f(&[1.0]); - //~^ ERROR binary operation `+` cannot be applied to type `()` -} diff --git a/src/test/compile-fail/issue-40749.rs b/src/test/compile-fail/issue-40749.rs deleted file mode 100644 index 261ed49d10c..00000000000 --- a/src/test/compile-fail/issue-40749.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - [0; ..10]; - //~^ ERROR mismatched types - //~| expected type `usize` - //~| found type `std::ops::RangeTo<{integer}>` -} diff --git a/src/test/compile-fail/issue-40845.rs b/src/test/compile-fail/issue-40845.rs deleted file mode 100644 index c5604a0427b..00000000000 --- a/src/test/compile-fail/issue-40845.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait T { m!(); } //~ ERROR cannot find macro `m!` in this scope - -struct S; -impl S { m!(); } //~ ERROR cannot find macro `m!` in this scope - -fn main() {} diff --git a/src/test/compile-fail/issue-40861.rs b/src/test/compile-fail/issue-40861.rs deleted file mode 100644 index 75d58c58538..00000000000 --- a/src/test/compile-fail/issue-40861.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f(_: &[f32]) {} - -fn main() { - ()[f(&[1.0])]; - //~^ ERROR cannot index into a value of type `()` -} diff --git a/src/test/compile-fail/issue-41139.rs b/src/test/compile-fail/issue-41139.rs deleted file mode 100644 index 0509a4387ba..00000000000 --- a/src/test/compile-fail/issue-41139.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Trait {} - -fn get_function<'a>() -> &'a Fn() -> Trait { panic!("") } - -fn main() { - let t : &Trait = &get_function()(); - //~^ ERROR cannot move a value of type (dyn Trait + 'static) -} diff --git a/src/test/compile-fail/issue-41229-ref-str.rs b/src/test/compile-fail/issue-41229-ref-str.rs deleted file mode 100644 index 5d7546e1bc4..00000000000 --- a/src/test/compile-fail/issue-41229-ref-str.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub fn example(ref s: str) {} -//~^ ERROR the size for values of type - -fn main() {} diff --git a/src/test/compile-fail/issue-41255.rs b/src/test/compile-fail/issue-41255.rs deleted file mode 100644 index 29912de37eb..00000000000 --- a/src/test/compile-fail/issue-41255.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Matching against float literals should result in a linter error - -#![feature(exclusive_range_pattern)] -#![allow(unused)] -#![forbid(illegal_floating_point_literal_pattern)] - -fn main() { - let x = 42.0; - match x { - 5.0 => {}, //~ ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - 5.0f32 => {}, //~ ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - -5.0 => {}, //~ ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - 1.0 .. 33.0 => {}, //~ ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - //~| ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - 39.0 ..= 70.0 => {}, //~ ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - //~| ERROR floating-point types cannot be used in patterns - //~| WARNING hard error - _ => {}, - }; - let y = 5.0; - // Same for tuples - match (x, 5) { - (3.14, 1) => {}, //~ ERROR floating-point types cannot be used - //~| WARNING hard error - _ => {}, - } - // Or structs - struct Foo { x: f32 }; - match (Foo { x }) { - Foo { x: 2.0 } => {}, //~ ERROR floating-point types cannot be used - //~| WARNING hard error - _ => {}, - } -} diff --git a/src/test/compile-fail/issue-41394.rs b/src/test/compile-fail/issue-41394.rs deleted file mode 100644 index 89f11edaec8..00000000000 --- a/src/test/compile-fail/issue-41394.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { - A = "" + 1 - //~^ ERROR binary operation `+` cannot be applied to type `&str` -} - -enum Bar { - A = Foo::A as isize -} - -fn main() {} diff --git a/src/test/compile-fail/issue-41726.rs b/src/test/compile-fail/issue-41726.rs deleted file mode 100644 index c8cd9209bce..00000000000 --- a/src/test/compile-fail/issue-41726.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::collections::HashMap; -fn main() { - let things: HashMap> = HashMap::new(); - for src in things.keys() { - things[src.as_str()].sort(); //~ ERROR cannot borrow immutable - } -} diff --git a/src/test/compile-fail/issue-41742.rs b/src/test/compile-fail/issue-41742.rs deleted file mode 100644 index 067531e036a..00000000000 --- a/src/test/compile-fail/issue-41742.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::ops::{Index, IndexMut}; - -struct S; -struct H; - -impl S { - fn f(&mut self) {} -} - -impl Index for H { - type Output = S; - fn index(&self, index: u32) -> &S { - unimplemented!() - } -} - -impl IndexMut for H { - fn index_mut(&mut self, index: u32) -> &mut S { - unimplemented!() - } -} - -fn main() { - H["?"].f(); //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-41776.rs b/src/test/compile-fail/issue-41776.rs deleted file mode 100644 index 5f108e0a1ed..00000000000 --- a/src/test/compile-fail/issue-41776.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - include!(line!()); //~ ERROR argument must be a string literal -} diff --git a/src/test/compile-fail/issue-41880.rs b/src/test/compile-fail/issue-41880.rs deleted file mode 100644 index 23a2b78a769..00000000000 --- a/src/test/compile-fail/issue-41880.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn iterate(initial: T, f: F) -> Iterate { - Iterate { - state: initial, - f: f, - } -} - -pub struct Iterate { - state: T, - f: F -} - -impl Iterator for Iterate where F: Fn(&T) -> T { - type Item = T; - - #[inline] - fn next(&mut self) -> Option { - self.state = (self.f)(&self.state); - Some(self.state.clone()) - } - #[inline] - fn size_hint(&self) -> (usize, Option) { (std::usize::MAX, None) } -} - -fn main() { - let a = iterate(0, |x| x+1); - println!("{:?}", a.iter().take(10).collect::>()); - //~^ ERROR no method named `iter` found for type `Iterate<{integer} -} diff --git a/src/test/compile-fail/issue-41974.rs b/src/test/compile-fail/issue-41974.rs deleted file mode 100644 index 5c9077783c7..00000000000 --- a/src/test/compile-fail/issue-41974.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[derive(Copy, Clone)] -struct Flags; - -trait A { -} - -impl Drop for T where T: A { //~ ERROR E0119 - //~^ ERROR E0120 - //~| ERROR E0210 - fn drop(&mut self) { - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-41998.rs b/src/test/compile-fail/issue-41998.rs deleted file mode 100644 index 406aadcd212..00000000000 --- a/src/test/compile-fail/issue-41998.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(rustc_attrs)] - -#[rustc_error] -fn main() { //~ ERROR compilation successful - if ('x' as char) < ('y' as char) { - print!("x"); - } else { - print!("y"); - } -} diff --git a/src/test/compile-fail/issue-4201.rs b/src/test/compile-fail/issue-4201.rs deleted file mode 100644 index b1f668d9c5e..00000000000 --- a/src/test/compile-fail/issue-4201.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let a = if true { - 0 - } else if false { -//~^ ERROR if may be missing an else clause -//~| expected type `()` -//~| found type `{integer}` -//~| expected (), found integral variable - 1 - }; -} diff --git a/src/test/compile-fail/issue-42312.rs b/src/test/compile-fail/issue-42312.rs deleted file mode 100644 index f7705297dfd..00000000000 --- a/src/test/compile-fail/issue-42312.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::ops::Deref; - -pub trait Foo { - fn baz(_: Self::Target) where Self: Deref {} - //~^ ERROR the size for values of type -} - -pub fn f(_: ToString) {} -//~^ ERROR the size for values of type - -fn main() { } diff --git a/src/test/compile-fail/issue-42344.rs b/src/test/compile-fail/issue-42344.rs deleted file mode 100644 index 2f11ff402be..00000000000 --- a/src/test/compile-fail/issue-42344.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -static TAB: [&mut [u8]; 0] = []; - -pub unsafe fn test() { - TAB[0].iter_mut(); //~ ERROR cannot borrow data mutably in a `&` reference [E0389] -} - -pub fn main() {} diff --git a/src/test/compile-fail/issue-4265.rs b/src/test/compile-fail/issue-4265.rs deleted file mode 100644 index 62db68dcbb2..00000000000 --- a/src/test/compile-fail/issue-4265.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo { - baz: usize -} - -impl Foo { - fn bar() { - Foo { baz: 0 }.bar(); - } - - fn bar() { //~ ERROR duplicate definitions - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-42755.rs b/src/test/compile-fail/issue-42755.rs deleted file mode 100644 index 7547c4a17be..00000000000 --- a/src/test/compile-fail/issue-42755.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(macro_vis_matcher)] - -macro_rules! foo { - ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree -} - -foo!(a); diff --git a/src/test/compile-fail/issue-42796.rs b/src/test/compile-fail/issue-42796.rs deleted file mode 100644 index b07c23c3fc7..00000000000 --- a/src/test/compile-fail/issue-42796.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Mirror { - type Image; -} - -impl Mirror for T { - type Image = T; -} - -pub fn poison(victim: String) where >::Image: Copy { - loop { drop(victim); } -} - -fn main() { - let s = "Hello!".to_owned(); - let mut s_copy = s; - s_copy.push_str("World!"); - "0wned!".to_owned(); - println!("{}", s); //~ ERROR use of moved value -} diff --git a/src/test/compile-fail/issue-42880.rs b/src/test/compile-fail/issue-42880.rs deleted file mode 100644 index ebb1ec425d1..00000000000 --- a/src/test/compile-fail/issue-42880.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -type Value = String; - -fn main() { - let f = |&Value::String(_)| (); //~ ERROR no associated item named - - let vec: Vec = Vec::new(); - vec.last().map(f); -} diff --git a/src/test/compile-fail/issue-43023.rs b/src/test/compile-fail/issue-43023.rs deleted file mode 100644 index 6a5f7a1136a..00000000000 --- a/src/test/compile-fail/issue-43023.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct S; - -impl S { - #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions - fn f() { - file!(); - } -} - -trait Tr1 { - #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions - fn f(); -} - -trait Tr2 { - #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions - type F; -} diff --git a/src/test/compile-fail/issue-43105.rs b/src/test/compile-fail/issue-43105.rs deleted file mode 100644 index 8a0471135af..00000000000 --- a/src/test/compile-fail/issue-43105.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn xyz() -> u8 { 42 } - -const NUM: u8 = xyz(); -//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants - -fn main() { - match 1 { - NUM => unimplemented!(), - //~^ ERROR could not evaluate constant pattern - _ => unimplemented!(), - } -} diff --git a/src/test/compile-fail/issue-43162.rs b/src/test/compile-fail/issue-43162.rs deleted file mode 100644 index b236283f757..00000000000 --- a/src/test/compile-fail/issue-43162.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn foo() -> bool { - //~^ ERROR E0308 - break true; //~ ERROR E0268 -} - -fn main() { - break {}; //~ ERROR E0268 -} diff --git a/src/test/compile-fail/issue-4321.rs b/src/test/compile-fail/issue-4321.rs deleted file mode 100644 index d589680b0ec..00000000000 --- a/src/test/compile-fail/issue-4321.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let tup = (true, true); - println!("foo {:}", match tup { //~ ERROR non-exhaustive patterns: `(true, false)` not covered - (false, false) => "foo", - (false, true) => "bar", - (true, true) => "baz" - }); -} diff --git a/src/test/compile-fail/issue-43250.rs b/src/test/compile-fail/issue-43250.rs deleted file mode 100644 index e1d34f339dc..00000000000 --- a/src/test/compile-fail/issue-43250.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let mut y; - const C: u32 = 0; - macro_rules! m { - ($a:expr) => { - let $a = 0; - } - } - m!(y); - //~^ ERROR arbitrary expressions aren't allowed in patterns - m!(C); - //~^ ERROR arbitrary expressions aren't allowed in patterns -} diff --git a/src/test/compile-fail/issue-43355.rs b/src/test/compile-fail/issue-43355.rs deleted file mode 100644 index d793a78799a..00000000000 --- a/src/test/compile-fail/issue-43355.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Trait1 { - type Output; -} - -pub trait Trait2 {} - -pub struct A; - -impl Trait1 for T where T: Trait2 { - type Output = (); -} - -impl Trait1> for A { -//~^ ERROR conflicting implementations of trait -//~| hard error -//~| downstream crates may implement trait `Trait2>` for type `A` - type Output = i32; -} - -fn main() {} diff --git a/src/test/compile-fail/issue-43424.rs b/src/test/compile-fail/issue-43424.rs deleted file mode 100644 index 431fc8a5aa2..00000000000 --- a/src/test/compile-fail/issue-43424.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused)] - -macro_rules! m { - ($attr_path: path) => { - #[$attr_path] - fn f() {} - } -} - -m!(inline); //~ ERROR: unexpected generic arguments in path - -fn main() {} diff --git a/src/test/compile-fail/issue-43431.rs b/src/test/compile-fail/issue-43431.rs deleted file mode 100644 index 1e6366e068a..00000000000 --- a/src/test/compile-fail/issue-43431.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(fn_traits)] - -trait CallSingle { - fn call(&self, a: A) -> B where Self: Sized, Self: Fn(A) -> B; -} - -impl B> CallSingle for F { - fn call(&self, a: A) -> B { - B>::call(self, (a,)) - //~^ ERROR associated type bindings are not allowed here - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-4366-2.rs b/src/test/compile-fail/issue-4366-2.rs deleted file mode 100644 index 33abc196a6b..00000000000 --- a/src/test/compile-fail/issue-4366-2.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ensures that 'use foo:*' doesn't import non-public item - -use m1::*; - -mod foo { - pub fn foo() {} -} -mod a { - pub mod b { - use foo::foo; - type bar = isize; - } - pub mod sub { - use a::b::*; - fn sub() -> bar { 1 } - //~^ ERROR cannot find type `bar` in this scope - } -} - -mod m1 { - fn foo() {} -} - -fn main() { - foo(); //~ ERROR expected function, found module `foo` -} diff --git a/src/test/compile-fail/issue-4366.rs b/src/test/compile-fail/issue-4366.rs deleted file mode 100644 index 47fd426592c..00000000000 --- a/src/test/compile-fail/issue-4366.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// regression test for issue 4366 - -// ensures that 'use foo:*' doesn't import non-public 'use' statements in the -// module 'foo' - -use m1::*; - -mod foo { - pub fn foo() {} -} -mod a { - pub mod b { - use foo::foo; - type bar = isize; - } - pub mod sub { - use a::b::*; - fn sub() -> isize { foo(); 1 } //~ ERROR cannot find function `foo` in this scope - } -} - -mod m1 { - fn foo() {} -} - -fn main() {} diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/compile-fail/issue-43733-2.rs deleted file mode 100644 index a5ba9ef9bd3..00000000000 --- a/src/test/compile-fail/issue-43733-2.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(const_fn)] -#![feature(cfg_target_thread_local, thread_local_internals)] - -// On platforms *without* `#[thread_local]`, use -// a custom non-`Sync` type to fake the same error. -#[cfg(not(target_thread_local))] -struct Key { - _data: std::cell::UnsafeCell>, - _flag: std::cell::Cell, -} - -#[cfg(not(target_thread_local))] -impl Key { - const fn new() -> Self { - Key { - _data: std::cell::UnsafeCell::new(None), - _flag: std::cell::Cell::new(false), - } - } -} - -#[cfg(target_thread_local)] -use std::thread::__FastLocalKeyInner as Key; - -static __KEY: Key<()> = Key::new(); -//~^ ERROR `std::cell::UnsafeCell>` cannot be shared between threads -//~| ERROR `std::cell::Cell` cannot be shared between threads safely [E0277] - -fn main() {} diff --git a/src/test/compile-fail/issue-43733.rs b/src/test/compile-fail/issue-43733.rs deleted file mode 100644 index 7b1364ff41c..00000000000 --- a/src/test/compile-fail/issue-43733.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(const_fn)] -#![feature(thread_local)] -#![feature(cfg_target_thread_local, thread_local_internals)] - -type Foo = std::cell::RefCell; - -#[cfg(target_thread_local)] -#[thread_local] -static __KEY: std::thread::__FastLocalKeyInner = - std::thread::__FastLocalKeyInner::new(); - -#[cfg(not(target_thread_local))] -static __KEY: std::thread::__OsLocalKeyInner = - std::thread::__OsLocalKeyInner::new(); - -fn __getit() -> std::option::Option< - &'static std::cell::UnsafeCell< - std::option::Option>> -{ - __KEY.get() //~ ERROR call to unsafe function is unsafe -} - -static FOO: std::thread::LocalKey = - std::thread::LocalKey::new(__getit, Default::default); -//~^ ERROR call to unsafe function is unsafe - -fn main() { - FOO.with(|foo| println!("{}", foo.borrow())); - std::thread::spawn(|| { - FOO.with(|foo| *foo.borrow_mut() += "foo"); - }).join().unwrap(); - FOO.with(|foo| println!("{}", foo.borrow())); -} diff --git a/src/test/compile-fail/issue-43784-associated-type.rs b/src/test/compile-fail/issue-43784-associated-type.rs deleted file mode 100644 index 94b5c0034a7..00000000000 --- a/src/test/compile-fail/issue-43784-associated-type.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Partial: Copy { -} - -pub trait Complete { - type Assoc: Partial; -} - -impl Partial for T::Assoc where - T: Complete -{ -} - -impl Complete for T { //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied - type Assoc = T; -} diff --git a/src/test/compile-fail/issue-43784-supertrait.rs b/src/test/compile-fail/issue-43784-supertrait.rs deleted file mode 100644 index e70df113da3..00000000000 --- a/src/test/compile-fail/issue-43784-supertrait.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub trait Partial: Copy { -} - -pub trait Complete: Partial { -} - -impl Partial for T where T: Complete {} -impl Complete for T {} //~ ERROR the trait bound `T: std::marker::Copy` is not satisfied diff --git a/src/test/compile-fail/issue-43925.rs b/src/test/compile-fail/issue-43925.rs deleted file mode 100644 index 8ad57647290..00000000000 --- a/src/test/compile-fail/issue-43925.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(attr_literals)] - -#[link(name="foo", cfg("rlib"))] //~ ERROR invalid argument for `cfg(..)` -extern {} - -fn main() {} diff --git a/src/test/compile-fail/issue-43926.rs b/src/test/compile-fail/issue-43926.rs deleted file mode 100644 index 5d510b643a3..00000000000 --- a/src/test/compile-fail/issue-43926.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[link(name="foo", cfg())] //~ ERROR `cfg()` must have an argument -extern {} - -fn main() {} diff --git a/src/test/compile-fail/issue-43988.rs b/src/test/compile-fail/issue-43988.rs deleted file mode 100644 index 6361af76482..00000000000 --- a/src/test/compile-fail/issue-43988.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(stmt_expr_attributes)] - -fn main() { - - #[inline] - let _a = 4; - //~^^ ERROR attribute should be applied to function or closure - - - #[inline(XYZ)] - let _b = 4; - //~^^ ERROR attribute should be applied to function or closure - - #[repr(nothing)] - let _x = 0; - //~^^ ERROR attribute should not be applied to a statement - - #[repr(something_not_real)] - loop { - () - }; - //~^^^^ ERROR attribute should not be applied to an expression - - #[repr] - let _y = "123"; - //~^^ ERROR attribute should not be applied to a statement - //~| WARN `repr` attribute must have a hint - - - fn foo() {} - - #[inline(ABC)] - foo(); - //~^^ ERROR attribute should be applied to function or closure - - let _z = #[repr] 1; - //~^ ERROR attribute should not be applied to an expression - //~| WARN `repr` attribute must have a hint -} diff --git a/src/test/compile-fail/issue-44021.rs b/src/test/compile-fail/issue-44021.rs deleted file mode 100644 index b6ec21b94c7..00000000000 --- a/src/test/compile-fail/issue-44021.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct MyStruct; -impl MyStruct { - fn f() {|x, y} //~ ERROR expected one of `:`, `@`, or `|`, found `}` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-44239.rs b/src/test/compile-fail/issue-44239.rs deleted file mode 100644 index 131c6526642..00000000000 --- a/src/test/compile-fail/issue-44239.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let n = 0; - - struct Foo; - impl Foo { - const N: usize = n; - //~^ ERROR attempt to use a non-constant value - } -} diff --git a/src/test/compile-fail/issue-44373.rs b/src/test/compile-fail/issue-44373.rs deleted file mode 100644 index d744ad11c5c..00000000000 --- a/src/test/compile-fail/issue-44373.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -static FOO: u32 = 50; - -fn main() { - let _val: &'static [&'static u32] = &[&FOO]; //~ ERROR borrowed value does not live long enough -} diff --git a/src/test/compile-fail/issue-44415.rs b/src/test/compile-fail/issue-44415.rs deleted file mode 100644 index ecaf326b050..00000000000 --- a/src/test/compile-fail/issue-44415.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: cycle detected when computing layout of - -#![feature(const_fn)] -#![feature(core_intrinsics)] - -use std::intrinsics; - -struct Foo { - bytes: [u8; unsafe { intrinsics::size_of::() }], - x: usize, -} - -fn main() {} diff --git a/src/test/compile-fail/issue-45087-unreachable-unsafe.rs b/src/test/compile-fail/issue-45087-unreachable-unsafe.rs deleted file mode 100644 index 5af0bf6be56..00000000000 --- a/src/test/compile-fail/issue-45087-unreachable-unsafe.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - return; - *(1 as *mut u32) = 42; - //~^ ERROR dereference of raw pointer is unsafe -} diff --git a/src/test/compile-fail/issue-4517.rs b/src/test/compile-fail/issue-4517.rs deleted file mode 100644 index fbd8972cbfa..00000000000 --- a/src/test/compile-fail/issue-4517.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn bar(int_param: usize) {} - -fn main() { - let foo: [u8; 4] = [1; 4]; - bar(foo); - //~^ ERROR mismatched types - //~| expected type `usize` - //~| found type `[u8; 4]` - //~| expected usize, found array of 4 elements -} diff --git a/src/test/compile-fail/issue-45199.rs b/src/test/compile-fail/issue-45199.rs deleted file mode 100644 index 61e19ffc0d2..00000000000 --- a/src/test/compile-fail/issue-45199.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// revisions: ast mir -//[mir]compile-flags: -Zborrowck=mir - -fn test_drop_replace() { - let b: Box; - //[mir]~^ NOTE consider changing this to `mut b` - b = Box::new(1); //[ast]~ NOTE first assignment - //[mir]~^ NOTE first assignment - b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable - //[mir]~^ ERROR cannot assign twice to immutable variable `b` - //[ast]~| NOTE cannot assign twice to immutable - //[mir]~| NOTE cannot assign twice to immutable -} - -fn test_call() { - let b = Box::new(1); //[ast]~ NOTE first assignment - //[mir]~^ NOTE first assignment - //[mir]~| NOTE consider changing this to `mut b` - b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable - //[mir]~^ ERROR cannot assign twice to immutable variable `b` - //[ast]~| NOTE cannot assign twice to immutable - //[mir]~| NOTE cannot assign twice to immutable -} - -fn test_args(b: Box) { //[ast]~ NOTE first assignment - //[mir]~^ NOTE consider changing this to `mut b` - b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable - //[mir]~^ ERROR cannot assign to immutable argument `b` - //[ast]~| NOTE cannot assign twice to immutable - //[mir]~| NOTE cannot assign to immutable argument -} - -fn main() {} diff --git a/src/test/compile-fail/issue-45729-unsafe-in-generator.rs b/src/test/compile-fail/issue-45729-unsafe-in-generator.rs deleted file mode 100644 index b42ced07583..00000000000 --- a/src/test/compile-fail/issue-45729-unsafe-in-generator.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(generators)] - -fn main() { - let _ = || { - *(1 as *mut u32) = 42; - //~^ ERROR dereference of raw pointer is unsafe - yield; - }; -} diff --git a/src/test/compile-fail/issue-45801.rs b/src/test/compile-fail/issue-45801.rs deleted file mode 100644 index 7823a7d6ba8..00000000000 --- a/src/test/compile-fail/issue-45801.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Params; - -pub trait Plugin { - type Error; -} - -pub trait Pluggable { - fn get_ref>(&mut self) -> Option { - None - } -} - -struct Foo; -impl Plugin for Params { - type Error = (); -} - -impl Pluggable for T {} - -fn handle(req: &mut i32) { - req.get_ref::(); - //~^ ERROR the trait bound `Params: Plugin` is not satisfied -} - -fn main() {} diff --git a/src/test/compile-fail/issue-45965.rs b/src/test/compile-fail/issue-45965.rs deleted file mode 100644 index 0b82f2b32ff..00000000000 --- a/src/test/compile-fail/issue-45965.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let a = |r: f64| if r != 0.0(r != 0.0) { 1.0 } else { 0.0 }; - //~^ ERROR expected function, found `{float}` -} diff --git a/src/test/compile-fail/issue-46023.rs b/src/test/compile-fail/issue-46023.rs deleted file mode 100644 index d51d92570fd..00000000000 --- a/src/test/compile-fail/issue-46023.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// revisions: ast mir -//[mir]compile-flags: -Z emit-end-regions -Z borrowck=mir - -fn main() { - let x = 0; - - (move || { - x = 1; - //[mir]~^ ERROR cannot assign to immutable item `x` [E0594] - //[ast]~^^ ERROR cannot assign to captured outer variable in an `FnMut` closure [E0594] - })() -} diff --git a/src/test/compile-fail/issue-46036.rs b/src/test/compile-fail/issue-46036.rs deleted file mode 100644 index b5cdded4d30..00000000000 --- a/src/test/compile-fail/issue-46036.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Issue 46036: [NLL] false edges on infinite loops -// Infinite loops should create false edges to the cleanup block. -#![feature(nll)] - -struct Foo { x: &'static u32 } - -fn foo() { - let a = 3; - let foo = Foo { x: &a }; //~ ERROR E0597 - loop { } -} - -fn main() { } diff --git a/src/test/compile-fail/issue-46311.rs b/src/test/compile-fail/issue-46311.rs deleted file mode 100644 index 82f55f2c142..00000000000 --- a/src/test/compile-fail/issue-46311.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - 'break: loop { //~ ERROR invalid label name `'break` - } -} diff --git a/src/test/compile-fail/issue-46438.rs b/src/test/compile-fail/issue-46438.rs deleted file mode 100644 index d84b5813385..00000000000 --- a/src/test/compile-fail/issue-46438.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! m { - ($my_type: ty) => { - impl $my_type for u8 {} - } -} - -trait Trait {} - -m!(Tr); - -m!(&'static u8); //~ ERROR expected a trait, found type - -fn main() {} diff --git a/src/test/compile-fail/issue-46604.rs b/src/test/compile-fail/issue-46604.rs deleted file mode 100644 index dc14eca1e67..00000000000 --- a/src/test/compile-fail/issue-46604.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// revisions: ast mir -//[mir]compile-flags: -Z borrowck=mir - -static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 - //[mir]~^ ERROR E0017 -fn write>(buffer: T) { } - -fn main() { - write(&buf); - buf[0]=2; //[ast]~ ERROR E0389 - //[mir]~^ ERROR E0594 -} diff --git a/src/test/compile-fail/issue-46771.rs b/src/test/compile-fail/issue-46771.rs deleted file mode 100644 index f8bcd8861f3..00000000000 --- a/src/test/compile-fail/issue-46771.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - struct Foo; - (1 .. 2).find(|_| Foo(0) == 0); //~ ERROR expected function, found `main::Foo` -} diff --git a/src/test/compile-fail/issue-46843.rs b/src/test/compile-fail/issue-46843.rs deleted file mode 100644 index d88b4e568b0..00000000000 --- a/src/test/compile-fail/issue-46843.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Thing { This, That } - -fn non_const() -> Thing { - Thing::This -} - -pub const Q: i32 = match non_const() { //~ ERROR E0015 - Thing::This => 1, //~ ERROR unimplemented expression type - Thing::That => 0 -}; - -fn main() {} diff --git a/src/test/compile-fail/issue-47309.rs b/src/test/compile-fail/issue-47309.rs deleted file mode 100644 index 1b9ff36f714..00000000000 --- a/src/test/compile-fail/issue-47309.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Make sure that the mono-item collector does not crash when trying to -// instantiate a default impl of a method with lifetime parameters. -// See https://github.com/rust-lang/rust/issues/47309 - -// compile-flags:-Clink-dead-code -// compile-pass - -#![crate_type="rlib"] - -pub trait EnvFuture { - type Item; - - fn boxed_result<'a>(self) where Self: Sized, Self::Item: 'a, { - } -} - -struct Foo; - -impl<'a> EnvFuture for &'a Foo { - type Item = (); -} diff --git a/src/test/compile-fail/issue-4736.rs b/src/test/compile-fail/issue-4736.rs deleted file mode 100644 index 19803079d02..00000000000 --- a/src/test/compile-fail/issue-4736.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct NonCopyable(()); - -fn main() { - let z = NonCopyable{ p: () }; //~ ERROR struct `NonCopyable` has no field named `p` -} diff --git a/src/test/compile-fail/issue-47412.rs b/src/test/compile-fail/issue-47412.rs deleted file mode 100644 index 683ef876f4e..00000000000 --- a/src/test/compile-fail/issue-47412.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[derive(Copy, Clone)] -enum Void {} - -// Tests that we detect unsafe places (specifically, union fields and -// raw pointer dereferences), even when they're matched on while having -// an uninhabited type (equivalent to `std::intrinsics::unreachable()`). - -fn union_field() { - union Union { unit: (), void: Void } - let u = Union { unit: () }; - match u.void {} - //~^ ERROR access to union field is unsafe -} - -fn raw_ptr_deref() { - let ptr = std::ptr::null::(); - match *ptr {} - //~^ ERROR dereference of raw pointer is unsafe -} - -fn main() {} diff --git a/src/test/compile-fail/issue-47715.rs b/src/test/compile-fail/issue-47715.rs deleted file mode 100644 index b6b720f088a..00000000000 --- a/src/test/compile-fail/issue-47715.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo {} - -trait Bar {} - -trait Iterable { - type Item; -} - -struct Container> { - //~^ ERROR `impl Trait` not allowed - field: T -} - -enum Enum> { - //~^ ERROR `impl Trait` not allowed - A(T), -} - -union Union + Copy> { - //~^ ERROR `impl Trait` not allowed - x: T, -} - -type Type> = T; -//~^ ERROR `impl Trait` not allowed - -fn main() { -} diff --git a/src/test/compile-fail/issue-48131.rs b/src/test/compile-fail/issue-48131.rs deleted file mode 100644 index 9eb567a5d3e..00000000000 --- a/src/test/compile-fail/issue-48131.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This note is annotated because the purpose of the test -// is to ensure that certain other notes are not generated. -#![deny(unused_unsafe)] //~ NOTE - -// (test that no note is generated on this unsafe fn) -pub unsafe fn a() { - fn inner() { - unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe` - //~^ NOTE - } - - inner() -} - -pub fn b() { - // (test that no note is generated on this unsafe block) - unsafe { - fn inner() { - unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe` - //~^ NOTE - } - - let () = ::std::mem::uninitialized(); - - inner() - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-48838.rs b/src/test/compile-fail/issue-48838.rs deleted file mode 100644 index ab52a32869f..00000000000 --- a/src/test/compile-fail/issue-48838.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Functions { - Square = |x| x, //~ ERROR mismatched types -} - -fn main() {} diff --git a/src/test/compile-fail/issue-4968.rs b/src/test/compile-fail/issue-4968.rs deleted file mode 100644 index 77588e5c221..00000000000 --- a/src/test/compile-fail/issue-4968.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for issue #4968 - -const A: (isize,isize) = (4,2); -fn main() { - match 42 { A => () } - //~^ ERROR mismatched types - //~| expected type `{integer}` - //~| found type `(isize, isize)` - //~| expected integral variable, found tuple -} diff --git a/src/test/compile-fail/issue-4972.rs b/src/test/compile-fail/issue-4972.rs deleted file mode 100644 index f384dba7c9e..00000000000 --- a/src/test/compile-fail/issue-4972.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_patterns)] -#![feature(box_syntax)] - -trait MyTrait { - fn dummy(&self) {} -} - -pub enum TraitWrapper { - A(Box), -} - -fn get_tw_map(tw: &TraitWrapper) -> &MyTrait { - match *tw { - TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced - } -} - -pub fn main() {} diff --git a/src/test/compile-fail/issue-50471.rs b/src/test/compile-fail/issue-50471.rs deleted file mode 100644 index ce2947144af..00000000000 --- a/src/test/compile-fail/issue-50471.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-pass - -fn main() { - assert!({false}); - - assert!(r"\u{41}" == "A"); - - assert!(r"\u{".is_empty()); -} diff --git a/src/test/compile-fail/issue-50600.rs b/src/test/compile-fail/issue-50600.rs deleted file mode 100644 index 6169a7770bf..00000000000 --- a/src/test/compile-fail/issue-50600.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo ( - fn([u8; |x: u8| {}]), //~ ERROR mismatched types -); - -fn main() {} diff --git a/src/test/compile-fail/issue-5062.rs b/src/test/compile-fail/issue-5062.rs deleted file mode 100644 index ebfa4975d4d..00000000000 --- a/src/test/compile-fail/issue-5062.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { format!("{:?}", None); } - //~^ ERROR type annotations needed [E0282] diff --git a/src/test/compile-fail/issue-5067.rs b/src/test/compile-fail/issue-5067.rs deleted file mode 100644 index 267362f902d..00000000000 --- a/src/test/compile-fail/issue-5067.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(unused_macros)] - -macro_rules! foo { - ( $()* ) => {}; - //~^ ERROR repetition matches empty token tree - ( $()+ ) => {}; - //~^ ERROR repetition matches empty token tree - - ( $(),* ) => {}; // PASS - ( $(),+ ) => {}; // PASS - - ( [$()*] ) => {}; - //~^ ERROR repetition matches empty token tree - ( [$()+] ) => {}; - //~^ ERROR repetition matches empty token tree - - ( [$(),*] ) => {}; // PASS - ( [$(),+] ) => {}; // PASS - - ( $($()* $(),* $(a)* $(a),* )* ) => {}; - //~^ ERROR repetition matches empty token tree - ( $($()* $(),* $(a)* $(a),* )+ ) => {}; - //~^ ERROR repetition matches empty token tree - - ( $(a $(),* $(a)* $(a),* )* ) => {}; // PASS - ( $($(a)+ $(),* $(a)* $(a),* )+ ) => {}; // PASS - - ( $(a $()+)* ) => {}; - //~^ ERROR repetition matches empty token tree - ( $(a $()*)+ ) => {}; - //~^ ERROR repetition matches empty token tree -} - - -// --- Original Issue --- // - -macro_rules! make_vec { - (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]); - //~^ ERROR repetition matches empty token tree -} - -fn main() { - let _ = make_vec![a 1, a 2, a 3]; -} - - -// --- Minified Issue --- // - -macro_rules! m { - ( $()* ) => {} - //~^ ERROR repetition matches empty token tree -} - -m!(); diff --git a/src/test/compile-fail/issue-50688.rs b/src/test/compile-fail/issue-50688.rs deleted file mode 100644 index ff45cf639de..00000000000 --- a/src/test/compile-fail/issue-50688.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - [1; || {}]; //~ ERROR mismatched types -} diff --git a/src/test/compile-fail/issue-5099.rs b/src/test/compile-fail/issue-5099.rs deleted file mode 100644 index 1bb6f34b8e9..00000000000 --- a/src/test/compile-fail/issue-5099.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -trait B < A > { fn a() -> A { this.a } } //~ ERROR cannot find value `this` in this scope - -fn main() {} diff --git a/src/test/compile-fail/issue-5100.rs b/src/test/compile-fail/issue-5100.rs deleted file mode 100644 index 9ef780aac8e..00000000000 --- a/src/test/compile-fail/issue-5100.rs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_patterns)] -#![feature(box_syntax)] - -enum A { B, C } - -fn main() { - match (true, false) { - A::B => (), -//~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `A` -//~| expected tuple, found enum `A` - _ => () - } - - match (true, false) { - (true, false, false) => () -//~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `(_, _, _)` -//~| expected a tuple with 2 elements, found one with 3 elements - } - - match (true, false) { - (true, false, false) => () -//~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `(_, _, _)` -//~| expected a tuple with 2 elements, found one with 3 elements - } - - match (true, false) { - box (true, false) => () -//~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `std::boxed::Box<_>` - } - - match (true, false) { - &(true, false) => () -//~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `&_` -//~| expected tuple, found reference - } - - - let v = [('a', 'b') //~ ERROR expected function, found `(char, char)` - ('c', 'd'), - ('e', 'f')]; - - for &(x,y) in &v {} // should be OK - - // Make sure none of the errors above were fatal - let x: char = true; //~ ERROR mismatched types - //~| expected char, found bool -} diff --git a/src/test/compile-fail/issue-5153.rs b/src/test/compile-fail/issue-5153.rs deleted file mode 100644 index 9b49886961d..00000000000 --- a/src/test/compile-fail/issue-5153.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Foo { - fn foo(self: Box); -} - -impl Foo for isize { - fn foo(self: Box) { } -} - -fn main() { - (&5isize as &Foo).foo(); - //~^ ERROR: no method named `foo` found for type `&dyn Foo` in the current scope -} diff --git a/src/test/compile-fail/issue-5216.rs b/src/test/compile-fail/issue-5216.rs deleted file mode 100644 index 81424577d49..00000000000 --- a/src/test/compile-fail/issue-5216.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f() { } -struct S(Box); -pub static C: S = S(f); //~ ERROR mismatched types - - -fn g() { } -type T = Box; -pub static D: T = g; //~ ERROR mismatched types - -fn main() {} diff --git a/src/test/compile-fail/issue-52213.rs b/src/test/compile-fail/issue-52213.rs deleted file mode 100644 index 810379c63d3..00000000000 --- a/src/test/compile-fail/issue-52213.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { - match (&t,) { //~ ERROR cannot infer an appropriate lifetime - ((u,),) => u, - } -} - -fn main() { - let x = { - let y = Box::new((42,)); - transmute_lifetime(&y) - }; - - println!("{}", x); -} diff --git a/src/test/compile-fail/issue-5358-1.rs b/src/test/compile-fail/issue-5358-1.rs deleted file mode 100644 index d8aad54fd3e..00000000000 --- a/src/test/compile-fail/issue-5358-1.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Either { Left(T), Right(U) } -struct S(Either); - -fn main() { - match S(Either::Left(5)) { - Either::Right(_) => {} - //~^ ERROR mismatched types - //~| expected type `S` - //~| found type `Either<_, _>` - //~| expected struct `S`, found enum `Either` - _ => {} - } -} diff --git a/src/test/compile-fail/issue-5439.rs b/src/test/compile-fail/issue-5439.rs deleted file mode 100644 index 4e618f3d858..00000000000 --- a/src/test/compile-fail/issue-5439.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -struct Foo { - foo: isize, -} - -struct Bar { - bar: isize, -} - -impl Bar { - fn make_foo (&self, i: isize) -> Box { - return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named - } -} - -fn main () { - let bar = Bar { bar: 1 }; - let foo = bar.make_foo(2); - println!("{}", foo.foo); -} diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs deleted file mode 100644 index a91f5d281dd..00000000000 --- a/src/test/compile-fail/issue-5883.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait A {} - -struct Struct { - r: A+'static -} - -fn new_struct(r: A+'static) - -> Struct { //~^ ERROR the size for values of type - //~^ ERROR the size for values of type - Struct { r: r } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-5927.rs b/src/test/compile-fail/issue-5927.rs deleted file mode 100644 index bb802f353af..00000000000 --- a/src/test/compile-fail/issue-5927.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -fn main() { - let z = match 3 { - x(1) => x(1) //~ ERROR cannot find tuple struct/variant `x` in this scope - //~^ ERROR cannot find function `x` in this scope - }; - assert!(z == 3); -} diff --git a/src/test/compile-fail/issue-5997-enum.rs b/src/test/compile-fail/issue-5997-enum.rs deleted file mode 100644 index 463fdaa1069..00000000000 --- a/src/test/compile-fail/issue-5997-enum.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f() -> bool { - enum E { V(Z) } - //~^ ERROR can't use type parameters from outer function - true -} - -fn main() { - let b = f::(); - assert!(b); -} diff --git a/src/test/compile-fail/issue-5997-struct.rs b/src/test/compile-fail/issue-5997-struct.rs deleted file mode 100644 index af9e66b770b..00000000000 --- a/src/test/compile-fail/issue-5997-struct.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn f() -> bool { - struct S(T); //~ ERROR can't use type parameters from outer function - - true -} - -fn main() { - let b = f::(); - assert!(b); -} diff --git a/src/test/compile-fail/issue-6458-2.rs b/src/test/compile-fail/issue-6458-2.rs deleted file mode 100644 index 87cf2b3f740..00000000000 --- a/src/test/compile-fail/issue-6458-2.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - // Unconstrained type: - format!("{:?}", None); - //~^ ERROR type annotations needed [E0282] -} diff --git a/src/test/compile-fail/issue-6596-1.rs b/src/test/compile-fail/issue-6596-1.rs deleted file mode 100644 index e988f404c3c..00000000000 --- a/src/test/compile-fail/issue-6596-1.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: unknown macro variable `nonexistent` - -macro_rules! e { - ($inp:ident) => ( - $nonexistent - ); -} - -fn main() { - e!(foo); -} diff --git a/src/test/compile-fail/issue-6596-2.rs b/src/test/compile-fail/issue-6596-2.rs deleted file mode 100644 index 0158ad4ba4e..00000000000 --- a/src/test/compile-fail/issue-6596-2.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(macro_rules)] - -// error-pattern: unknown macro variable `nonexistent` - -macro_rules! g { - ($inp:ident) => ( - { $inp $nonexistent } - ); -} - -fn main() { - g!(foo); -} diff --git a/src/test/compile-fail/issue-6642.rs b/src/test/compile-fail/issue-6642.rs deleted file mode 100644 index 1fe10ba7a27..00000000000 --- a/src/test/compile-fail/issue-6642.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct A; -impl A { - fn m(&self) { - fn x() { - self.m() //~ ERROR can't capture dynamic environment in a fn item - } - } -} -fn main() {} diff --git a/src/test/compile-fail/issue-6738.rs b/src/test/compile-fail/issue-6738.rs deleted file mode 100644 index 447d0e061ee..00000000000 --- a/src/test/compile-fail/issue-6738.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo { - x: T, -} -impl Foo { - fn add(&mut self, v: Foo){ - self.x += v.x; - //~^ ERROR: binary assignment operation `+=` cannot be applied - } -} -fn main() {} diff --git a/src/test/compile-fail/issue-6801.rs b/src/test/compile-fail/issue-6801.rs deleted file mode 100644 index 792d27c179b..00000000000 --- a/src/test/compile-fail/issue-6801.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Creating a stack closure which references a box and then -// transferring ownership of the box before invoking the stack -// closure results in a crash. - -#![feature(box_syntax)] - -fn twice(x: Box) -> usize { - *x * 2 -} - -fn invoke(f: F) where F: FnOnce() -> usize { - f(); -} - -fn main() { - let x : Box = box 9; - let sq = || { *x * *x }; - - twice(x); //~ ERROR: cannot move out of - invoke(sq); -} diff --git a/src/test/compile-fail/issue-6804.rs b/src/test/compile-fail/issue-6804.rs deleted file mode 100644 index fffa27ab842..00000000000 --- a/src/test/compile-fail/issue-6804.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Matching against NaN should result in a warning - -#![allow(unused)] -#![deny(illegal_floating_point_literal_pattern)] - -use std::f64::NAN; - -fn main() { - let x = NAN; - match x { - NAN => {}, //~ ERROR floating-point types cannot be used - //~^ WARN this was previously accepted by the compiler but is being phased out - _ => {}, - }; - - match [x, 1.0] { - [NAN, _] => {}, //~ ERROR floating-point types cannot be used - //~^ WARN this was previously accepted by the compiler but is being phased out - _ => {}, - }; -} diff --git a/src/test/compile-fail/issue-6936.rs b/src/test/compile-fail/issue-6936.rs deleted file mode 100644 index 8eb16edcbd3..00000000000 --- a/src/test/compile-fail/issue-6936.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct T; - -mod t1 { - type Foo = ::T; - mod Foo {} //~ ERROR the name `Foo` is defined multiple times -} - -mod t2 { - type Foo = ::T; - struct Foo; //~ ERROR the name `Foo` is defined multiple times -} - -mod t3 { - type Foo = ::T; - enum Foo {} //~ ERROR the name `Foo` is defined multiple times -} - -mod t4 { - type Foo = ::T; - fn Foo() {} // ok -} - -mod t5 { - type Bar = T; - mod Bar {} //~ ERROR the name `Bar` is defined multiple times -} - -mod t6 { - type Foo = ::T; - impl Foo {} // ok -} - - -fn main() {} diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs deleted file mode 100644 index 0c19780bcb4..00000000000 --- a/src/test/compile-fail/issue-7013.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -use std::cell::RefCell; -use std::rc::Rc; - -trait Foo { - fn set(&mut self, v: Rc>); -} - -struct B { - v: Option>> -} - -impl Foo for B { - fn set(&mut self, v: Rc>) - { - self.v = Some(v); - } -} - -struct A { - v: Box, -} - -fn main() { - let a = A {v: box B{v: None} as Box}; - //~^ ERROR `std::rc::Rc>` cannot be sent between threads safely -} diff --git a/src/test/compile-fail/issue-7044.rs b/src/test/compile-fail/issue-7044.rs deleted file mode 100644 index 9b72c249356..00000000000 --- a/src/test/compile-fail/issue-7044.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -static X: isize = 0; -struct X; //~ ERROR the name `X` is defined multiple times - -fn main() {} diff --git a/src/test/compile-fail/issue-7061.rs b/src/test/compile-fail/issue-7061.rs deleted file mode 100644 index b99f5b707ee..00000000000 --- a/src/test/compile-fail/issue-7061.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct BarStruct; - -impl<'a> BarStruct { - fn foo(&'a mut self) -> Box { self } - //~^ ERROR mismatched types - //~| expected type `std::boxed::Box` - //~| found type `&'a mut BarStruct` -} - -fn main() {} diff --git a/src/test/compile-fail/issue-7092.rs b/src/test/compile-fail/issue-7092.rs deleted file mode 100644 index 26e1597b1db..00000000000 --- a/src/test/compile-fail/issue-7092.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Whatever { -} - -fn foo(x: Whatever) { - match x { - Some(field) => -//~^ ERROR mismatched types -//~| expected type `Whatever` -//~| found type `std::option::Option<_>` -//~| expected enum `Whatever`, found enum `std::option::Option` - field.access(), - } -} - -fn main(){} diff --git a/src/test/compile-fail/issue-7246.rs b/src/test/compile-fail/issue-7246.rs deleted file mode 100644 index 7e8d431bf19..00000000000 --- a/src/test/compile-fail/issue-7246.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(unreachable_code)] -#![allow(dead_code)] - -use std::ptr; -pub unsafe fn g() { - return; - if *ptr::null() {}; //~ ERROR unreachable -} - -pub fn main() {} diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs deleted file mode 100644 index 801a1301ad7..00000000000 --- a/src/test/compile-fail/issue-7364.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(box_syntax)] - -use std::cell::RefCell; - -// Regression test for issue 7364 -static boxed: Box> = box RefCell::new(0); -//~^ ERROR allocations are not allowed in statics -//~| ERROR `std::cell::RefCell` cannot be shared between threads safely [E0277] - -fn main() { } diff --git a/src/test/compile-fail/issue-7607-1.rs b/src/test/compile-fail/issue-7607-1.rs deleted file mode 100644 index 9bcdd690187..00000000000 --- a/src/test/compile-fail/issue-7607-1.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Foo { - x: isize -} - -impl Fo { //~ ERROR cannot find type `Fo` in this scope - fn foo() {} -} - -fn main() {} diff --git a/src/test/compile-fail/issue-7867.rs b/src/test/compile-fail/issue-7867.rs deleted file mode 100644 index 016df6cb6ef..00000000000 --- a/src/test/compile-fail/issue-7867.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum A { B, C } - -mod foo { pub fn bar() {} } - -fn main() { - match (true, false) { - A::B => (), - //~^ ERROR mismatched types - //~| expected type `(bool, bool)` - //~| found type `A` - //~| expected tuple, found enum `A` - _ => () - } -} diff --git a/src/test/compile-fail/issue-7950.rs b/src/test/compile-fail/issue-7950.rs deleted file mode 100644 index dd3a48cb155..00000000000 --- a/src/test/compile-fail/issue-7950.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// tests the good error message, not "missing module Foo" or something else unexpected - -struct Foo; - -fn main() { - Foo::bar(); - //~^ ERROR no function or associated item named `bar` found for type `Foo` -} diff --git a/src/test/compile-fail/issue-7970a.rs b/src/test/compile-fail/issue-7970a.rs deleted file mode 100644 index b97c3037770..00000000000 --- a/src/test/compile-fail/issue-7970a.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -macro_rules! one_arg_macro { - ($fmt:expr) => (print!(concat!($fmt, "\n"))); -} - -fn main() { - one_arg_macro!(); - //~^ ERROR unexpected end of macro invocation -} diff --git a/src/test/compile-fail/issue-7970b.rs b/src/test/compile-fail/issue-7970b.rs deleted file mode 100644 index 0cff90f281b..00000000000 --- a/src/test/compile-fail/issue-7970b.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() {} - -macro_rules! test {} -//~^ ERROR unexpected end of macro invocation diff --git a/src/test/compile-fail/issue-8153.rs b/src/test/compile-fail/issue-8153.rs deleted file mode 100644 index 457918b54d4..00000000000 --- a/src/test/compile-fail/issue-8153.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that duplicate methods in impls are not allowed - -struct Foo; - -trait Bar { - fn bar(&self) -> isize; -} - -impl Bar for Foo { - fn bar(&self) -> isize {1} - fn bar(&self) -> isize {2} //~ ERROR duplicate definitions -} - -fn main() { - println!("{}", Foo.bar()); -} diff --git a/src/test/compile-fail/issue-8208.rs b/src/test/compile-fail/issue-8208.rs deleted file mode 100644 index 670b6bd46e7..00000000000 --- a/src/test/compile-fail/issue-8208.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use self::*; //~ ERROR: unresolved import `self::*` [E0432] - //~^ Cannot glob-import a module into itself. - -mod foo { - use foo::*; //~ ERROR: unresolved import `foo::*` [E0432] - //~^ Cannot glob-import a module into itself. - - mod bar { - use super::bar::*; - //~^ ERROR: unresolved import `super::bar::*` [E0432] - //~| Cannot glob-import a module into itself. - } - -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-8460-const.rs b/src/test/compile-fail/issue-8460-const.rs deleted file mode 100644 index b0d6cb5df87..00000000000 --- a/src/test/compile-fail/issue-8460-const.rs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(const_err)] - -use std::{isize, i8, i16, i32, i64}; -use std::thread; - -fn main() { - assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); - //~^ ERROR attempt to divide with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); - //~^ ERROR attempt to divide with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); - //~^ ERROR attempt to divide with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); - //~^ ERROR attempt to divide with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); - //~^ ERROR attempt to divide with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); - //~^ ERROR attempt to divide by zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); - //~^ ERROR attempt to divide by zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); - //~^ ERROR attempt to divide by zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); - //~^ ERROR attempt to divide by zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); - //~^ ERROR attempt to divide by zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with overflow - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with a divisor of zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with a divisor of zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with a divisor of zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with a divisor of zero - //~| ERROR this expression will panic at runtime - assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); - //~^ ERROR attempt to calculate the remainder with a divisor of zero - //~| ERROR this expression will panic at runtime -} diff --git a/src/test/compile-fail/issue-8640.rs b/src/test/compile-fail/issue-8640.rs deleted file mode 100644 index c4ca3acf080..00000000000 --- a/src/test/compile-fail/issue-8640.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[allow(unused_imports)] - -mod foo { - use baz::bar; - mod bar {} - //~^ ERROR the name `bar` is defined multiple times -} -mod baz { pub mod bar {} } - -fn main() {} diff --git a/src/test/compile-fail/issue-8727.rs b/src/test/compile-fail/issue-8727.rs deleted file mode 100644 index 18b7948c46c..00000000000 --- a/src/test/compile-fail/issue-8727.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern:reached the recursion limit while instantiating `generic::() { - generic::>(); -} - - -fn main () { - // Use generic at least once to trigger instantiation. - generic::(); -} diff --git a/src/test/compile-fail/issue-8761.rs b/src/test/compile-fail/issue-8761.rs deleted file mode 100644 index f8424ea64ef..00000000000 --- a/src/test/compile-fail/issue-8761.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum Foo { - A = 1i64, - //~^ ERROR mismatched types - //~| expected isize, found i64 - B = 2u8 - //~^ ERROR mismatched types - //~| expected isize, found u8 -} - -fn main() {} diff --git a/src/test/compile-fail/issue-8767.rs b/src/test/compile-fail/issue-8767.rs deleted file mode 100644 index 926cae788aa..00000000000 --- a/src/test/compile-fail/issue-8767.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -impl B { //~ ERROR cannot find type `B` in this scope -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-9575.rs b/src/test/compile-fail/issue-9575.rs deleted file mode 100644 index 9295eeb1779..00000000000 --- a/src/test/compile-fail/issue-9575.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(start)] - -#[start] -fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { - //~^ start function has wrong type - 0 -} diff --git a/src/test/compile-fail/issue-9725.rs b/src/test/compile-fail/issue-9725.rs deleted file mode 100644 index f53122d19c1..00000000000 --- a/src/test/compile-fail/issue-9725.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct A { foo: isize } - -fn main() { - let A { foo, foo } = A { foo: 3 }; - //~^ ERROR: identifier `foo` is bound more than once in the same pattern - //~^^ ERROR: field `foo` bound multiple times -} diff --git a/src/test/compile-fail/issue-9814.rs b/src/test/compile-fail/issue-9814.rs deleted file mode 100644 index 226734b84d6..00000000000 --- a/src/test/compile-fail/issue-9814.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Verify that single-variant enums can't be de-referenced -// Regression test for issue #9814 - -enum Foo { Bar(isize) } - -fn main() { - let _ = *Foo::Bar(2); //~ ERROR type `Foo` cannot be dereferenced -} diff --git a/src/test/compile-fail/issue-pr29383.rs b/src/test/compile-fail/issue-pr29383.rs deleted file mode 100644 index b60c537e1e6..00000000000 --- a/src/test/compile-fail/issue-pr29383.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -enum E { - A, - B, -} - -fn main() { - match None { - None => {} - Some(E::A(..)) => {} //~ ERROR expected tuple struct/variant, found unit variant `E::A` - Some(E::B(..)) => {} //~ ERROR expected tuple struct/variant, found unit variant `E::B` - } -} diff --git a/src/test/ui/issue-10176.rs b/src/test/ui/issue-10176.rs new file mode 100644 index 00000000000..c968844ae21 --- /dev/null +++ b/src/test/ui/issue-10176.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f() -> isize { + (return 1, return 2) +//~^ ERROR mismatched types +//~| expected type `isize` +//~| found type `(!, !)` +//~| expected isize, found tuple +} + +fn main() {} diff --git a/src/test/ui/issue-10176.stderr b/src/test/ui/issue-10176.stderr new file mode 100644 index 00000000000..02e0b899b3f --- /dev/null +++ b/src/test/ui/issue-10176.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/issue-10176.rs:12:5 + | +LL | fn f() -> isize { + | ----- expected `isize` because of return type +LL | (return 1, return 2) + | ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple + | + = note: expected type `isize` + found type `(!, !)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-10200.rs b/src/test/ui/issue-10200.rs new file mode 100644 index 00000000000..8c58ef6261e --- /dev/null +++ b/src/test/ui/issue-10200.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo(bool); +fn foo(_: usize) -> Foo { Foo(false) } + +fn main() { + match Foo(true) { + foo(x) //~ ERROR expected tuple struct/variant, found function `foo` + => () + } +} diff --git a/src/test/ui/issue-10200.stderr b/src/test/ui/issue-10200.stderr new file mode 100644 index 00000000000..4eb07827628 --- /dev/null +++ b/src/test/ui/issue-10200.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected tuple struct/variant, found function `foo` + --> $DIR/issue-10200.rs:16:9 + | +LL | foo(x) //~ ERROR expected tuple struct/variant, found function `foo` + | ^^^ did you mean `Foo`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-10291.nll.stderr b/src/test/ui/issue-10291.nll.stderr new file mode 100644 index 00000000000..1358fe010b4 --- /dev/null +++ b/src/test/ui/issue-10291.nll.stderr @@ -0,0 +1,14 @@ +warning: not reporting region error due to nll + --> $DIR/issue-10291.rs:13:9 + | +LL | x //~ ERROR E0312 + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/issue-10291.rs:12:5 + | +LL | drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ free region requires that `'x` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-10291.rs b/src/test/ui/issue-10291.rs new file mode 100644 index 00000000000..d4e7dc7e9a3 --- /dev/null +++ b/src/test/ui/issue-10291.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn test<'x>(x: &'x isize) { + drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { + x //~ ERROR E0312 + })); +} + +fn main() {} diff --git a/src/test/ui/issue-10291.stderr b/src/test/ui/issue-10291.stderr new file mode 100644 index 00000000000..af5929782f6 --- /dev/null +++ b/src/test/ui/issue-10291.stderr @@ -0,0 +1,23 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/issue-10291.rs:13:9 + | +LL | x //~ ERROR E0312 + | ^ + | +note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 12:65... + --> $DIR/issue-10291.rs:12:65 + | +LL | drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { + | _________________________________________________________________^ +LL | | x //~ ERROR E0312 +LL | | })); + | |_____^ +note: ...but the borrowed content is only valid for the lifetime 'x as defined on the function body at 11:9 + --> $DIR/issue-10291.rs:11:9 + | +LL | fn test<'x>(x: &'x isize) { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/issue-10398.nll.stderr b/src/test/ui/issue-10398.nll.stderr new file mode 100644 index 00000000000..d13e843b94b --- /dev/null +++ b/src/test/ui/issue-10398.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/issue-10398.rs:17:14 + | +LL | let _a = x; + | - value moved here +LL | drop(x); + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-10398.rs b/src/test/ui/issue-10398.rs new file mode 100644 index 00000000000..08e8effc626 --- /dev/null +++ b/src/test/ui/issue-10398.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +fn main() { + let x: Box<_> = box 1; + let f = move|| { + let _a = x; + drop(x); + //~^ ERROR: use of moved value: `x` + }; + f(); +} diff --git a/src/test/ui/issue-10398.stderr b/src/test/ui/issue-10398.stderr new file mode 100644 index 00000000000..e3b816df3f4 --- /dev/null +++ b/src/test/ui/issue-10398.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/issue-10398.rs:17:14 + | +LL | let _a = x; + | -- value moved here +LL | drop(x); + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-10401.rs b/src/test/ui/issue-10401.rs new file mode 100644 index 00000000000..e36193aee25 --- /dev/null +++ b/src/test/ui/issue-10401.rs @@ -0,0 +1,15 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let mut a = "a"; + a += { "b" }; + //~^ ERROR: binary assignment operation `+=` cannot be applied +} diff --git a/src/test/ui/issue-10401.stderr b/src/test/ui/issue-10401.stderr new file mode 100644 index 00000000000..8c91c11a67c --- /dev/null +++ b/src/test/ui/issue-10401.stderr @@ -0,0 +1,16 @@ +error[E0368]: binary assignment operation `+=` cannot be applied to type `&str` + --> $DIR/issue-10401.rs:13:5 + | +LL | a += { "b" }; + | -^^^^^^^^^^^ + | | + | cannot use `+=` on type `&str` + | `+` can't be used to concatenate two `&str` strings +help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left + | +LL | a.to_owned() += { "b" }; + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0368`. diff --git a/src/test/ui/issue-10412.rs b/src/test/ui/issue-10412.rs new file mode 100644 index 00000000000..ee553730a35 --- /dev/null +++ b/src/test/ui/issue-10412.rs @@ -0,0 +1,32 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names + fn serialize(val : &'self T) -> Vec; //~ ERROR lifetimes cannot use keyword names + fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names +} + +impl<'self> Serializable for &'self str { //~ ERROR lifetimes cannot use keyword names + //~^ ERROR lifetimes cannot use keyword names + //~| ERROR missing lifetime specifier + fn serialize(val : &'self str) -> Vec { //~ ERROR lifetimes cannot use keyword names + vec![1] + } + fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names + "hi" + } +} + +fn main() { + println!("hello"); + let x = "foo".to_string(); + let y = x; + println!("{}", y); +} diff --git a/src/test/ui/issue-10412.stderr b/src/test/ui/issue-10412.stderr new file mode 100644 index 00000000000..7f2f2dbf509 --- /dev/null +++ b/src/test/ui/issue-10412.stderr @@ -0,0 +1,51 @@ +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:11:20 + | +LL | trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:12:25 + | +LL | fn serialize(val : &'self T) -> Vec; //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:13:38 + | +LL | fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:16:6 + | +LL | impl<'self> Serializable for &'self str { //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:16:36 + | +LL | impl<'self> Serializable for &'self str { //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:19:25 + | +LL | fn serialize(val : &'self str) -> Vec { //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/issue-10412.rs:22:37 + | +LL | fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error[E0106]: missing lifetime specifier + --> $DIR/issue-10412.rs:16:13 + | +LL | impl<'self> Serializable for &'self str { //~ ERROR lifetimes cannot use keyword names + | ^^^^^^^^^^^^^^^^^ expected lifetime parameter + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/issue-10465.rs b/src/test/ui/issue-10465.rs new file mode 100644 index 00000000000..ed91e935407 --- /dev/null +++ b/src/test/ui/issue-10465.rs @@ -0,0 +1,33 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub mod a { + pub trait A { + fn foo(&self); + } + +} +pub mod b { + use a::A; + + pub struct B; + impl A for B { fn foo(&self) {} } + + pub mod c { + use b::B; + + fn foo(b: &B) { + b.foo(); //~ ERROR: no method named `foo` found + } + } + +} + +fn main() {} diff --git a/src/test/ui/issue-10465.stderr b/src/test/ui/issue-10465.stderr new file mode 100644 index 00000000000..add4b832e83 --- /dev/null +++ b/src/test/ui/issue-10465.stderr @@ -0,0 +1,13 @@ +error[E0599]: no method named `foo` found for type `&b::B` in the current scope + --> $DIR/issue-10465.rs:27:15 + | +LL | b.foo(); //~ ERROR: no method named `foo` found + | ^^^ + | + = help: items from traits can only be used if the trait is in scope + = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + `use a::A;` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-10536.rs b/src/test/ui/issue-10536.rs new file mode 100644 index 00000000000..2b71fb5c67f --- /dev/null +++ b/src/test/ui/issue-10536.rs @@ -0,0 +1,33 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We only want to assert that this doesn't ICE, we don't particularly care +// about whether it nor it fails to compile. + +// error-pattern: + +macro_rules! foo{ + () => {{ + macro_rules! bar{() => (())} + 1 + }} +} + +pub fn main() { + foo!(); + + assert!({one! two()}); + //~^ ERROR macros that expand to items must either be surrounded with braces or followed by a + + // regardless of whether nested macro_rules works, the following should at + // least throw a conventional error. + assert!({one! two}); + //~^ ERROR expected +} diff --git a/src/test/ui/issue-10536.stderr b/src/test/ui/issue-10536.stderr new file mode 100644 index 00000000000..ba404d0dd3f --- /dev/null +++ b/src/test/ui/issue-10536.stderr @@ -0,0 +1,14 @@ +error: macros that expand to items must either be surrounded with braces or followed by a semicolon + --> $DIR/issue-10536.rs:26:22 + | +LL | assert!({one! two()}); + | ^^ + +error: expected `(` or `{`, found `}` + --> $DIR/issue-10536.rs:31:22 + | +LL | assert!({one! two}); + | ^ expected `(` or `{` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-10545.rs b/src/test/ui/issue-10545.rs new file mode 100644 index 00000000000..708eea39a95 --- /dev/null +++ b/src/test/ui/issue-10545.rs @@ -0,0 +1,20 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +mod a { + struct S; + impl S { } +} + +fn foo(_: a::S) { //~ ERROR: struct `S` is private +} + +fn main() {} diff --git a/src/test/ui/issue-10545.stderr b/src/test/ui/issue-10545.stderr new file mode 100644 index 00000000000..28f95dff3bc --- /dev/null +++ b/src/test/ui/issue-10545.stderr @@ -0,0 +1,9 @@ +error[E0603]: struct `S` is private + --> $DIR/issue-10545.rs:17:11 + | +LL | fn foo(_: a::S) { //~ ERROR: struct `S` is private + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/issue-10656.rs b/src/test/ui/issue-10656.rs new file mode 100644 index 00000000000..7fd5a0d1348 --- /dev/null +++ b/src/test/ui/issue-10656.rs @@ -0,0 +1,13 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(missing_docs)] +#![crate_type="lib"] +//~^^ ERROR missing documentation for crate diff --git a/src/test/ui/issue-10656.stderr b/src/test/ui/issue-10656.stderr new file mode 100644 index 00000000000..d67463f0263 --- /dev/null +++ b/src/test/ui/issue-10656.stderr @@ -0,0 +1,15 @@ +error: missing documentation for crate + --> $DIR/issue-10656.rs:11:1 + | +LL | / #![deny(missing_docs)] +LL | | #![crate_type="lib"] + | |____________________^ + | +note: lint level defined here + --> $DIR/issue-10656.rs:11:9 + | +LL | #![deny(missing_docs)] + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-10755.rs b/src/test/ui/issue-10755.rs new file mode 100644 index 00000000000..57915bce456 --- /dev/null +++ b/src/test/ui/issue-10755.rs @@ -0,0 +1,15 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -C linker=llllll -Z linker-flavor=ld +// error-pattern: linker `llllll` not found + +fn main() { +} diff --git a/src/test/ui/issue-10755.stderr b/src/test/ui/issue-10755.stderr new file mode 100644 index 00000000000..db64944d44f --- /dev/null +++ b/src/test/ui/issue-10755.stderr @@ -0,0 +1,6 @@ +error: linker `llllll` not found + | + = note: No such file or directory (os error 2) + +error: aborting due to previous error + diff --git a/src/test/ui/issue-10764.rs b/src/test/ui/issue-10764.rs new file mode 100644 index 00000000000..cd4ec495556 --- /dev/null +++ b/src/test/ui/issue-10764.rs @@ -0,0 +1,15 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f(_: extern "Rust" fn()) {} +extern fn bar() {} + +fn main() { f(bar) } +//~^ ERROR mismatched types diff --git a/src/test/ui/issue-10764.stderr b/src/test/ui/issue-10764.stderr new file mode 100644 index 00000000000..6aacbef0897 --- /dev/null +++ b/src/test/ui/issue-10764.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-10764.rs:14:15 + | +LL | fn main() { f(bar) } + | ^^^ expected "Rust" fn, found "C" fn + | + = note: expected type `fn()` + found type `extern "C" fn() {bar}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-10877.rs b/src/test/ui/issue-10877.rs new file mode 100644 index 00000000000..39f25b837cd --- /dev/null +++ b/src/test/ui/issue-10877.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { x: isize } +extern { + fn foo(1: ()); + //~^ ERROR: patterns aren't allowed in foreign function declarations + fn bar((): isize); + //~^ ERROR: patterns aren't allowed in foreign function declarations + fn baz(Foo { x }: isize); + //~^ ERROR: patterns aren't allowed in foreign function declarations + fn qux((x,y): ()); + //~^ ERROR: patterns aren't allowed in foreign function declarations + fn this_is_actually_ok(a: usize); + fn and_so_is_this(_: usize); +} +fn main() {} diff --git a/src/test/ui/issue-10877.stderr b/src/test/ui/issue-10877.stderr new file mode 100644 index 00000000000..6db0bf6dc65 --- /dev/null +++ b/src/test/ui/issue-10877.stderr @@ -0,0 +1,27 @@ +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/issue-10877.rs:13:12 + | +LL | fn foo(1: ()); + | ^ pattern not allowed in foreign function + +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/issue-10877.rs:15:12 + | +LL | fn bar((): isize); + | ^^ pattern not allowed in foreign function + +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/issue-10877.rs:17:12 + | +LL | fn baz(Foo { x }: isize); + | ^^^^^^^^^ pattern not allowed in foreign function + +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/issue-10877.rs:19:12 + | +LL | fn qux((x,y): ()); + | ^^^^^ pattern not allowed in foreign function + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0130`. diff --git a/src/test/ui/issue-10991.rs b/src/test/ui/issue-10991.rs new file mode 100644 index 00000000000..2d00f339f33 --- /dev/null +++ b/src/test/ui/issue-10991.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let nil = (); + let _t = nil as usize; //~ ERROR: non-primitive cast: `()` as `usize` +} diff --git a/src/test/ui/issue-10991.stderr b/src/test/ui/issue-10991.stderr new file mode 100644 index 00000000000..3ae3bbe06cb --- /dev/null +++ b/src/test/ui/issue-10991.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `()` as `usize` + --> $DIR/issue-10991.rs:13:14 + | +LL | let _t = nil as usize; //~ ERROR: non-primitive cast: `()` as `usize` + | ^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/ui/issue-11154.rs b/src/test/ui/issue-11154.rs new file mode 100644 index 00000000000..1ff68123374 --- /dev/null +++ b/src/test/ui/issue-11154.rs @@ -0,0 +1,15 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -C lto -C prefer-dynamic + +// error-pattern: cannot prefer dynamic linking + +fn main() {} diff --git a/src/test/ui/issue-11154.stderr b/src/test/ui/issue-11154.stderr new file mode 100644 index 00000000000..8eec8b37c85 --- /dev/null +++ b/src/test/ui/issue-11154.stderr @@ -0,0 +1,6 @@ +error: cannot prefer dynamic linking when performing LTO + +note: only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO + +error: aborting due to previous error + diff --git a/src/test/ui/issue-11192.nll.stderr b/src/test/ui/issue-11192.nll.stderr new file mode 100644 index 00000000000..d5a67083a23 --- /dev/null +++ b/src/test/ui/issue-11192.nll.stderr @@ -0,0 +1,18 @@ +error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as mutable + --> $DIR/issue-11192.rs:30:10 + | +LL | let mut test = |foo: &Foo| { + | ----------- mutable borrow occurs here +LL | println!("access {}", foo.x); +LL | ptr = box Foo { x: ptr.x + 1 }; + | --- previous borrow occurs due to use of `ptr` in closure +... +LL | test(&*ptr); + | -----^^^^^- + | | | + | | immutable borrow occurs here + | 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/issue-11192.rs b/src/test/ui/issue-11192.rs new file mode 100644 index 00000000000..7d8a1528aba --- /dev/null +++ b/src/test/ui/issue-11192.rs @@ -0,0 +1,32 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +struct Foo { + x: isize +} + +impl Drop for Foo { + fn drop(&mut self) { + println!("drop {}", self.x); + } +} + +fn main() { + let mut ptr: Box<_> = box Foo { x: 0 }; + let mut test = |foo: &Foo| { + println!("access {}", foo.x); + ptr = box Foo { x: ptr.x + 1 }; + println!("access {}", foo.x); + }; + test(&*ptr); + //~^ ERROR: cannot borrow `*ptr` as immutable +} diff --git a/src/test/ui/issue-11192.stderr b/src/test/ui/issue-11192.stderr new file mode 100644 index 00000000000..e9853ac0ca8 --- /dev/null +++ b/src/test/ui/issue-11192.stderr @@ -0,0 +1,18 @@ +error[E0502]: cannot borrow `*ptr` as immutable because `ptr` is also borrowed as mutable + --> $DIR/issue-11192.rs:30:11 + | +LL | let mut test = |foo: &Foo| { + | ----------- mutable borrow occurs here +LL | println!("access {}", foo.x); +LL | ptr = box Foo { x: ptr.x + 1 }; + | --- previous borrow occurs due to use of `ptr` in closure +... +LL | test(&*ptr); + | ^^^^ immutable borrow occurs here +LL | //~^ ERROR: cannot borrow `*ptr` as immutable +LL | } + | - mutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/issue-11374.rs b/src/test/ui/issue-11374.rs new file mode 100644 index 00000000000..1e444a6bebf --- /dev/null +++ b/src/test/ui/issue-11374.rs @@ -0,0 +1,37 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::io::{self, Read}; +use std::vec; + +pub struct Container<'a> { + reader: &'a mut Read +} + +impl<'a> Container<'a> { + pub fn wrap<'s>(reader: &'s mut io::Read) -> Container<'s> { + Container { reader: reader } + } + + pub fn read_to(&mut self, vec: &mut [u8]) { + self.reader.read(vec); + } +} + +pub fn for_stdin<'a>() -> Container<'a> { + let mut r = io::stdin(); + Container::wrap(&mut r as &mut io::Read) +} + +fn main() { + let mut c = for_stdin(); + let mut v = Vec::new(); + c.read_to(v); //~ ERROR E0308 +} diff --git a/src/test/ui/issue-11374.stderr b/src/test/ui/issue-11374.stderr new file mode 100644 index 00000000000..3465069129b --- /dev/null +++ b/src/test/ui/issue-11374.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-11374.rs:36:15 + | +LL | c.read_to(v); //~ ERROR E0308 + | ^ + | | + | expected &mut [u8], found struct `std::vec::Vec` + | help: consider mutably borrowing here: `&mut v` + | + = note: expected type `&mut [u8]` + found type `std::vec::Vec<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-11493.ast.stderr b/src/test/ui/issue-11493.ast.stderr new file mode 100644 index 00000000000..99b996387e7 --- /dev/null +++ b/src/test/ui/issue-11493.ast.stderr @@ -0,0 +1,16 @@ +error[E0597]: borrowed value does not live long enough (Ast) + --> $DIR/issue-11493.rs:20:35 + | +LL | let y = x.as_ref().unwrap_or(&id(5)); + | ^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-11493.mir.stderr b/src/test/ui/issue-11493.mir.stderr new file mode 100644 index 00000000000..99b996387e7 --- /dev/null +++ b/src/test/ui/issue-11493.mir.stderr @@ -0,0 +1,16 @@ +error[E0597]: borrowed value does not live long enough (Ast) + --> $DIR/issue-11493.rs:20:35 + | +LL | let y = x.as_ref().unwrap_or(&id(5)); + | ^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-11493.rs b/src/test/ui/issue-11493.rs new file mode 100644 index 00000000000..80ecc24543e --- /dev/null +++ b/src/test/ui/issue-11493.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This file must never have a trailing newline +// +// revisions: ast mir +// compile-flags: -Z borrowck=compare + +fn id(x: T) -> T { x } + +fn main() { + let x = Some(3); + let y = x.as_ref().unwrap_or(&id(5)); + //[ast]~^ ERROR borrowed value does not live long enough (Ast) + //[mir]~^^ ERROR borrowed value does not live long enough (Ast) + // This actually passes in mir +} diff --git a/src/test/ui/issue-11515.rs b/src/test/ui/issue-11515.rs new file mode 100644 index 00000000000..7afb8314ea6 --- /dev/null +++ b/src/test/ui/issue-11515.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +struct Test { + func: Box +} + +fn main() { + let closure: Box = Box::new(|| ()); + let test = box Test { func: closure }; //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-11515.stderr b/src/test/ui/issue-11515.stderr new file mode 100644 index 00000000000..25e2a45438e --- /dev/null +++ b/src/test/ui/issue-11515.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-11515.rs:19:33 + | +LL | let test = box Test { func: closure }; //~ ERROR mismatched types + | ^^^^^^^ expected trait `std::ops::FnMut`, found trait `std::ops::Fn` + | + = note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` + found type `std::boxed::Box<(dyn std::ops::Fn() + 'static)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-11681.rs b/src/test/ui/issue-11681.rs new file mode 100644 index 00000000000..71f1d5dcc9a --- /dev/null +++ b/src/test/ui/issue-11681.rs @@ -0,0 +1,29 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This tests verifies that unary structs and enum variants +// are treated as rvalues and their lifetime is not bounded to +// the static scope. + +struct Test; + +impl Drop for Test { + fn drop (&mut self) {} +} + +fn createTest<'a>() -> &'a Test { + let testValue = &Test; //~ ERROR borrowed value does not live long enough + return testValue; +} + + +pub fn main() { + createTest(); +} diff --git a/src/test/ui/issue-11681.stderr b/src/test/ui/issue-11681.stderr new file mode 100644 index 00000000000..ef3d24c6657 --- /dev/null +++ b/src/test/ui/issue-11681.stderr @@ -0,0 +1,18 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-11681.rs:22:20 + | +LL | let testValue = &Test; //~ ERROR borrowed value does not live long enough + | ^^^^ temporary value does not live long enough +LL | return testValue; +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:15... + --> $DIR/issue-11681.rs:21:15 + | +LL | fn createTest<'a>() -> &'a Test { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-11692-1.rs b/src/test/ui/issue-11692-1.rs new file mode 100644 index 00000000000..f577aad04e6 --- /dev/null +++ b/src/test/ui/issue-11692-1.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + print!(test!()); + //~^ ERROR: format argument must be a string literal +} diff --git a/src/test/ui/issue-11692-1.stderr b/src/test/ui/issue-11692-1.stderr new file mode 100644 index 00000000000..daf53af3ace --- /dev/null +++ b/src/test/ui/issue-11692-1.stderr @@ -0,0 +1,8 @@ +error: format argument must be a string literal. + --> $DIR/issue-11692-1.rs:12:12 + | +LL | print!(test!()); + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-11692-2.rs b/src/test/ui/issue-11692-2.rs new file mode 100644 index 00000000000..acac2d151fe --- /dev/null +++ b/src/test/ui/issue-11692-2.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + concat!(test!()); + //~^ ERROR cannot find macro `test!` in this scope +} diff --git a/src/test/ui/issue-11692-2.stderr b/src/test/ui/issue-11692-2.stderr new file mode 100644 index 00000000000..51d6041e922 --- /dev/null +++ b/src/test/ui/issue-11692-2.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `test!` in this scope + --> $DIR/issue-11692-2.rs:12:13 + | +LL | concat!(test!()); + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-11740.rs b/src/test/ui/issue-11740.rs new file mode 100644 index 00000000000..0bda06be9e8 --- /dev/null +++ b/src/test/ui/issue-11740.rs @@ -0,0 +1,38 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +struct Attr { + name: String, + value: String, +} + +struct Element { + attrs: Vec>, +} + +impl Element { + pub unsafe fn get_attr<'a>(&'a self, name: &str) { + self.attrs + .iter() + .find(|attr| { + let attr: &&Box = std::mem::transmute(attr); + true + }); + } +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let element = Element { attrs: Vec::new() }; + let _ = unsafe { element.get_attr("foo") }; +} diff --git a/src/test/ui/issue-11740.stderr b/src/test/ui/issue-11740.stderr new file mode 100644 index 00000000000..a1913e0057c --- /dev/null +++ b/src/test/ui/issue-11740.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/issue-11740.rs:35:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let element = Element { attrs: Vec::new() }; +LL | | let _ = unsafe { element.get_attr("foo") }; +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-11771.rs b/src/test/ui/issue-11771.rs new file mode 100644 index 00000000000..69899105bc3 --- /dev/null +++ b/src/test/ui/issue-11771.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x = (); + 1 + + x //~^ ERROR E0277 + ; + + let x: () = (); + 1 + + x //~^ ERROR E0277 + ; +} diff --git a/src/test/ui/issue-11771.stderr b/src/test/ui/issue-11771.stderr new file mode 100644 index 00000000000..a31c4fa008d --- /dev/null +++ b/src/test/ui/issue-11771.stderr @@ -0,0 +1,19 @@ +error[E0277]: cannot add `()` to `{integer}` + --> $DIR/issue-11771.rs:13:7 + | +LL | 1 + + | ^ no implementation for `{integer} + ()` + | + = help: the trait `std::ops::Add<()>` is not implemented for `{integer}` + +error[E0277]: cannot add `()` to `{integer}` + --> $DIR/issue-11771.rs:18:7 + | +LL | 1 + + | ^ no implementation for `{integer} + ()` + | + = help: the trait `std::ops::Add<()>` is not implemented for `{integer}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-11844.rs b/src/test/ui/issue-11844.rs new file mode 100644 index 00000000000..a6dbe954ec0 --- /dev/null +++ b/src/test/ui/issue-11844.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +fn main() { + let a = Some(box 1); + match a { + Ok(a) => //~ ERROR: mismatched types + println!("{}",a), + None => panic!() + } +} diff --git a/src/test/ui/issue-11844.stderr b/src/test/ui/issue-11844.stderr new file mode 100644 index 00000000000..d773e88d01c --- /dev/null +++ b/src/test/ui/issue-11844.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-11844.rs:16:9 + | +LL | Ok(a) => //~ ERROR: mismatched types + | ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` + | + = note: expected type `std::option::Option>` + found type `std::result::Result<_, _>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-11873.nll.stderr b/src/test/ui/issue-11873.nll.stderr new file mode 100644 index 00000000000..c12cbbfdd53 --- /dev/null +++ b/src/test/ui/issue-11873.nll.stderr @@ -0,0 +1,14 @@ +error[E0505]: cannot move out of `v` because it is borrowed + --> $DIR/issue-11873.rs:14:14 + | +LL | let mut f = || v.push(2); + | ------------ borrow of `v` occurs here +LL | let _w = v; //~ ERROR: cannot move out of `v` + | ^ move out of `v` occurs here +LL | +LL | f(); + | - 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/issue-11873.rs b/src/test/ui/issue-11873.rs new file mode 100644 index 00000000000..4618851529a --- /dev/null +++ b/src/test/ui/issue-11873.rs @@ -0,0 +1,17 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let mut v = vec![1]; + let mut f = || v.push(2); + let _w = v; //~ ERROR: cannot move out of `v` + + f(); +} diff --git a/src/test/ui/issue-11873.stderr b/src/test/ui/issue-11873.stderr new file mode 100644 index 00000000000..f4da011f572 --- /dev/null +++ b/src/test/ui/issue-11873.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `v` because it is borrowed + --> $DIR/issue-11873.rs:14:9 + | +LL | let mut f = || v.push(2); + | -- borrow of `v` occurs here +LL | let _w = v; //~ ERROR: cannot move out of `v` + | ^^ move out of `v` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/issue-12028.rs b/src/test/ui/issue-12028.rs new file mode 100644 index 00000000000..980385ce4cc --- /dev/null +++ b/src/test/ui/issue-12028.rs @@ -0,0 +1,50 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test an example where we fail to infer the type parameter H. This +// is because there is really nothing constraining it. At one time, we +// would infer based on the where clauses in scope, but that no longer +// works. + +trait Hash { + fn hash2(&self, hasher: &H) -> u64; +} + +trait Stream { + fn input(&mut self, bytes: &[u8]); + fn result(&self) -> u64; +} + +trait StreamHasher { + type S : Stream; + fn stream(&self) -> Self::S; +} + +////////////////////////////////////////////////////////////////////////////// + +trait StreamHash: Hash { + fn input_stream(&self, stream: &mut H::S); +} + +impl Hash for u8 { + fn hash2(&self, hasher: &H) -> u64 { + let mut stream = hasher.stream(); + self.input_stream(&mut stream); //~ ERROR type annotations required + Stream::result(&stream) + } +} + +impl StreamHash for u8 { + fn input_stream(&self, stream: &mut H::S) { + Stream::input(stream, &[*self]); + } +} + +fn main() {} diff --git a/src/test/ui/issue-12028.stderr b/src/test/ui/issue-12028.stderr new file mode 100644 index 00000000000..f756e0a29d1 --- /dev/null +++ b/src/test/ui/issue-12028.stderr @@ -0,0 +1,9 @@ +error[E0284]: type annotations required: cannot resolve `<_ as StreamHasher>::S == ::S` + --> $DIR/issue-12028.rs:39:14 + | +LL | self.input_stream(&mut stream); //~ ERROR type annotations required + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0284`. diff --git a/src/test/ui/issue-12041.nll.stderr b/src/test/ui/issue-12041.nll.stderr new file mode 100644 index 00000000000..b880317a2a6 --- /dev/null +++ b/src/test/ui/issue-12041.nll.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `tx` + --> $DIR/issue-12041.rs:18:22 + | +LL | let tx = tx; + | ^^ value moved here in previous iteration of loop + | + = note: move occurs because `tx` has type `std::sync::mpsc::Sender`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-12041.rs b/src/test/ui/issue-12041.rs new file mode 100644 index 00000000000..f0f4bf5ca71 --- /dev/null +++ b/src/test/ui/issue-12041.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::sync::mpsc::channel; +use std::thread; + +fn main() { + let (tx, rx) = channel(); + let _t = thread::spawn(move|| -> () { + loop { + let tx = tx; + //~^ ERROR: use of moved value: `tx` + tx.send(1); + } + }); +} diff --git a/src/test/ui/issue-12041.stderr b/src/test/ui/issue-12041.stderr new file mode 100644 index 00000000000..6172d78b513 --- /dev/null +++ b/src/test/ui/issue-12041.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `tx` + --> $DIR/issue-12041.rs:18:17 + | +LL | let tx = tx; + | ^^ value moved here in previous iteration of loop + | + = note: move occurs because `tx` has type `std::sync::mpsc::Sender`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-12116.rs b/src/test/ui/issue-12116.rs new file mode 100644 index 00000000000..a8d2c552553 --- /dev/null +++ b/src/test/ui/issue-12116.rs @@ -0,0 +1,31 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_patterns)] +#![feature(box_syntax)] +#![allow(dead_code)] +#![allow(unused_variables)] +#![deny(unreachable_patterns)] + +enum IntList { + Cons(isize, Box), + Nil +} + +fn tail(source_list: &IntList) -> IntList { + match source_list { + &IntList::Cons(val, box ref next_list) => tail(next_list), + &IntList::Cons(val, box IntList::Nil) => IntList::Cons(val, box IntList::Nil), +//~^ ERROR unreachable pattern + _ => panic!() + } +} + +fn main() {} diff --git a/src/test/ui/issue-12116.stderr b/src/test/ui/issue-12116.stderr new file mode 100644 index 00000000000..3bf0984b256 --- /dev/null +++ b/src/test/ui/issue-12116.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/issue-12116.rs:25:9 + | +LL | &IntList::Cons(val, box IntList::Nil) => IntList::Cons(val, box IntList::Nil), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-12116.rs:15:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-12127.rs b/src/test/ui/issue-12127.rs new file mode 100644 index 00000000000..5565a9a5761 --- /dev/null +++ b/src/test/ui/issue-12127.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax, unboxed_closures)] + +fn to_fn_once>(f: F) -> F { f } +fn do_it(x: &isize) { } + +fn main() { + let x: Box<_> = box 22; + let f = to_fn_once(move|| do_it(&*x)); + to_fn_once(move|| { + f(); + f(); + //~^ ERROR: use of moved value: `f` + })() +} diff --git a/src/test/ui/issue-12127.stderr b/src/test/ui/issue-12127.stderr new file mode 100644 index 00000000000..afd483823a6 --- /dev/null +++ b/src/test/ui/issue-12127.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `f` + --> $DIR/issue-12127.rs:21:9 + | +LL | f(); + | - value moved here +LL | f(); + | ^ value used here after move + | + = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:18:24: 18:41 x:std::boxed::Box]`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-12369.rs b/src/test/ui/issue-12369.rs new file mode 100644 index 00000000000..1b9af393ccc --- /dev/null +++ b/src/test/ui/issue-12369.rs @@ -0,0 +1,22 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(slice_patterns)] +#![deny(unreachable_patterns)] + +fn main() { + let sl = vec![1,2,3]; + let v: isize = match &*sl { + &[] => 0, + &[a,b,c] => 3, + &[a, ref rest..] => a, + &[10,a, ref rest..] => 10 //~ ERROR: unreachable pattern + }; +} diff --git a/src/test/ui/issue-12369.stderr b/src/test/ui/issue-12369.stderr new file mode 100644 index 00000000000..2e8cd840fb7 --- /dev/null +++ b/src/test/ui/issue-12369.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/issue-12369.rs:20:9 + | +LL | &[10,a, ref rest..] => 10 //~ ERROR: unreachable pattern + | ^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-12369.rs:12:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-12470.nll.stderr b/src/test/ui/issue-12470.nll.stderr new file mode 100644 index 00000000000..09cbfe4f66d --- /dev/null +++ b/src/test/ui/issue-12470.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: `*b` does not live long enough + --> $DIR/issue-12470.rs:38:18 + | +LL | let bb: &B = &*b; //~ ERROR does not live long enough + | ^^^ borrowed value does not live long enough +LL | make_a(bb) +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 36:16... + --> $DIR/issue-12470.rs:36:16 + | +LL | fn make_make_a<'a>() -> A<'a> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-12470.rs b/src/test/ui/issue-12470.rs new file mode 100644 index 00000000000..93785817e14 --- /dev/null +++ b/src/test/ui/issue-12470.rs @@ -0,0 +1,44 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +trait X { + fn get_i(&self) -> isize; +} + + +struct B { + i: isize +} + +impl X for B { + fn get_i(&self) -> isize { + self.i + } +} + +struct A<'a> { + p: &'a (X+'a) +} + +fn make_a<'a>(p: &'a X) -> A<'a> { + A { p: p } +} + +fn make_make_a<'a>() -> A<'a> { + let b: Box = box B {i:1}; + let bb: &B = &*b; //~ ERROR does not live long enough + make_a(bb) +} + +fn main() { + let _a = make_make_a(); +} diff --git a/src/test/ui/issue-12470.stderr b/src/test/ui/issue-12470.stderr new file mode 100644 index 00000000000..91788e96297 --- /dev/null +++ b/src/test/ui/issue-12470.stderr @@ -0,0 +1,18 @@ +error[E0597]: `*b` does not live long enough + --> $DIR/issue-12470.rs:38:19 + | +LL | let bb: &B = &*b; //~ ERROR does not live long enough + | ^^ borrowed value does not live long enough +LL | make_a(bb) +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 36:16... + --> $DIR/issue-12470.rs:36:16 + | +LL | fn make_make_a<'a>() -> A<'a> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-12552.rs b/src/test/ui/issue-12552.rs new file mode 100644 index 00000000000..e4788bac256 --- /dev/null +++ b/src/test/ui/issue-12552.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// this code used to cause an ICE + +fn main() { + let t = Err(0); + match t { + Some(k) => match k { //~ ERROR mismatched types + a => println!("{}", a) + }, + None => () //~ ERROR mismatched types + } +} diff --git a/src/test/ui/issue-12552.stderr b/src/test/ui/issue-12552.stderr new file mode 100644 index 00000000000..9a3d5ef02c6 --- /dev/null +++ b/src/test/ui/issue-12552.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/issue-12552.rs:16:5 + | +LL | Some(k) => match k { //~ ERROR mismatched types + | ^^^^^^^ expected enum `std::result::Result`, found enum `std::option::Option` + | + = note: expected type `std::result::Result<_, {integer}>` + found type `std::option::Option<_>` + +error[E0308]: mismatched types + --> $DIR/issue-12552.rs:19:5 + | +LL | None => () //~ ERROR mismatched types + | ^^^^ expected enum `std::result::Result`, found enum `std::option::Option` + | + = note: expected type `std::result::Result<_, {integer}>` + found type `std::option::Option<_>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-12567.nll.stderr b/src/test/ui/issue-12567.nll.stderr new file mode 100644 index 00000000000..a040f7c3c8d --- /dev/null +++ b/src/test/ui/issue-12567.nll.stderr @@ -0,0 +1,31 @@ +error[E0508]: cannot move out of type `[T]`, a non-copy slice + --> $DIR/issue-12567.rs:14:11 + | +LL | match (l1, l2) { + | ^^^^^^^^ cannot move out of here +help: to prevent move, use ref or ref mut + | +LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[]) + | ^^^^^^ +help: to prevent move, use ref or ref mut + | +LL | (&[hd1, ..], &[ref hd2, ..]) + | ^^^^^^^ + +error[E0508]: cannot move out of type `[T]`, a non-copy slice + --> $DIR/issue-12567.rs:14:11 + | +LL | match (l1, l2) { + | ^^^^^^^^ cannot move out of here +help: to prevent move, use ref or ref mut + | +LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[]) + | ^^^^^^ +help: to prevent move, use ref or ref mut + | +LL | (&[ref hd1, ..], &[hd2, ..]) + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/issue-12567.rs b/src/test/ui/issue-12567.rs new file mode 100644 index 00000000000..30cdd07b399 --- /dev/null +++ b/src/test/ui/issue-12567.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(slice_patterns)] + +fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) { + match (l1, l2) { + (&[], &[]) => println!("both empty"), + (&[], &[hd, ..]) | (&[hd, ..], &[]) + => println!("one empty"), + //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice + //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice + (&[hd1, ..], &[hd2, ..]) + => println!("both nonempty"), + //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice + //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice + } +} + +fn main() {} diff --git a/src/test/ui/issue-12567.stderr b/src/test/ui/issue-12567.stderr new file mode 100644 index 00000000000..60acffdcb06 --- /dev/null +++ b/src/test/ui/issue-12567.stderr @@ -0,0 +1,39 @@ +error[E0508]: cannot move out of type `[T]`, a non-copy slice + --> $DIR/issue-12567.rs:16:16 + | +LL | (&[], &[hd, ..]) | (&[hd, ..], &[]) + | ^--^^^^^ + | || + | |hint: to prevent move, use `ref hd` or `ref mut hd` + | cannot move out of here + +error[E0508]: cannot move out of type `[T]`, a non-copy slice + --> $DIR/issue-12567.rs:16:30 + | +LL | (&[], &[hd, ..]) | (&[hd, ..], &[]) + | ^--^^^^^ + | || + | |hint: to prevent move, use `ref hd` or `ref mut hd` + | cannot move out of here + +error[E0508]: cannot move out of type `[T]`, a non-copy slice + --> $DIR/issue-12567.rs:20:11 + | +LL | (&[hd1, ..], &[hd2, ..]) + | ^---^^^^^ + | || + | |hint: to prevent move, use `ref hd1` or `ref mut hd1` + | cannot move out of here + +error[E0508]: cannot move out of type `[T]`, a non-copy slice + --> $DIR/issue-12567.rs:20:23 + | +LL | (&[hd1, ..], &[hd2, ..]) + | ^---^^^^^ + | || + | |hint: to prevent move, use `ref hd2` or `ref mut hd2` + | cannot move out of here + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/issue-12796.rs b/src/test/ui/issue-12796.rs new file mode 100644 index 00000000000..0c3c82a99f2 --- /dev/null +++ b/src/test/ui/issue-12796.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { + fn outer(&self) { + fn inner(_: &Self) { + //~^ ERROR can't use type parameters from outer function + } + } +} + +fn main() { } diff --git a/src/test/ui/issue-12796.stderr b/src/test/ui/issue-12796.stderr new file mode 100644 index 00000000000..c8bedd3853c --- /dev/null +++ b/src/test/ui/issue-12796.stderr @@ -0,0 +1,11 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/issue-12796.rs:13:22 + | +LL | fn inner(_: &Self) { + | ----- ^^^^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `inner` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/issue-12863.rs b/src/test/ui/issue-12863.rs new file mode 100644 index 00000000000..d3432410c54 --- /dev/null +++ b/src/test/ui/issue-12863.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod foo { pub fn bar() {} } + +fn main() { + match () { + foo::bar => {} //~ ERROR expected unit struct/variant or constant, found function `foo::bar` + } +} diff --git a/src/test/ui/issue-12863.stderr b/src/test/ui/issue-12863.stderr new file mode 100644 index 00000000000..eb2957a8225 --- /dev/null +++ b/src/test/ui/issue-12863.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected unit struct/variant or constant, found function `foo::bar` + --> $DIR/issue-12863.rs:15:9 + | +LL | foo::bar => {} //~ ERROR expected unit struct/variant or constant, found function `foo::bar` + | ^^^^^^^^ not a unit struct/variant or constant + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-12997-1.rs b/src/test/ui/issue-12997-1.rs new file mode 100644 index 00000000000..2d8d7857c99 --- /dev/null +++ b/src/test/ui/issue-12997-1.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --test + +//! Test that makes sure wrongly-typed bench functions aren't ignored + +#[bench] +fn foo() { } //~ ERROR functions used as benches + +#[bench] +fn bar(x: isize, y: isize) { } //~ ERROR functions used as benches diff --git a/src/test/ui/issue-12997-1.stderr b/src/test/ui/issue-12997-1.stderr new file mode 100644 index 00000000000..856538417d9 --- /dev/null +++ b/src/test/ui/issue-12997-1.stderr @@ -0,0 +1,14 @@ +error: functions used as benches must have signature `fn(&mut Bencher) -> impl Termination` + --> $DIR/issue-12997-1.rs:16:1 + | +LL | fn foo() { } //~ ERROR functions used as benches + | ^^^^^^^^^^^^ + +error: functions used as benches must have signature `fn(&mut Bencher) -> impl Termination` + --> $DIR/issue-12997-1.rs:19:1 + | +LL | fn bar(x: isize, y: isize) { } //~ ERROR functions used as benches + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-12997-2.rs b/src/test/ui/issue-12997-2.rs new file mode 100644 index 00000000000..8d3df68577b --- /dev/null +++ b/src/test/ui/issue-12997-2.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --test + +//! Test that makes sure wrongly-typed bench functions are rejected + +#[bench] +fn bar(x: isize) { } +//~^ ERROR mismatched types diff --git a/src/test/ui/issue-12997-2.stderr b/src/test/ui/issue-12997-2.stderr new file mode 100644 index 00000000000..3030ee4779b --- /dev/null +++ b/src/test/ui/issue-12997-2.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-12997-2.rs:16:1 + | +LL | fn bar(x: isize) { } + | ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference + | + = note: expected type `isize` + found type `&mut __test::test::Bencher` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-13033.rs b/src/test/ui/issue-13033.rs new file mode 100644 index 00000000000..f1fd617717a --- /dev/null +++ b/src/test/ui/issue-13033.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn bar(&mut self, other: &mut Foo); +} + +struct Baz; + +impl Foo for Baz { + fn bar(&mut self, other: &Foo) {} + //~^ ERROR method `bar` has an incompatible type for trait + //~| expected type `fn(&mut Baz, &mut dyn Foo)` + //~| found type `fn(&mut Baz, &dyn Foo)` +} + +fn main() {} diff --git a/src/test/ui/issue-13033.stderr b/src/test/ui/issue-13033.stderr new file mode 100644 index 00000000000..2db3cb80a81 --- /dev/null +++ b/src/test/ui/issue-13033.stderr @@ -0,0 +1,15 @@ +error[E0053]: method `bar` has an incompatible type for trait + --> $DIR/issue-13033.rs:18:30 + | +LL | fn bar(&mut self, other: &mut Foo); + | -------- type in trait +... +LL | fn bar(&mut self, other: &Foo) {} + | ^^^^ types differ in mutability + | + = note: expected type `fn(&mut Baz, &mut dyn Foo)` + found type `fn(&mut Baz, &dyn Foo)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/ui/issue-13352.rs b/src/test/ui/issue-13352.rs new file mode 100644 index 00000000000..e9d76c758cd --- /dev/null +++ b/src/test/ui/issue-13352.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-cloudabi no std::process + +fn foo(_: Box) {} + +fn main() { + foo(loop { + std::process::exit(0); + }); + 2_usize + (loop {}); + //~^ ERROR E0277 +} diff --git a/src/test/ui/issue-13352.stderr b/src/test/ui/issue-13352.stderr new file mode 100644 index 00000000000..5324eb21186 --- /dev/null +++ b/src/test/ui/issue-13352.stderr @@ -0,0 +1,11 @@ +error[E0277]: cannot add `()` to `usize` + --> $DIR/issue-13352.rs:19:13 + | +LL | 2_usize + (loop {}); + | ^ no implementation for `usize + ()` + | + = help: the trait `std::ops::Add<()>` is not implemented for `usize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-13359.rs b/src/test/ui/issue-13359.rs new file mode 100644 index 00000000000..e33859e8c19 --- /dev/null +++ b/src/test/ui/issue-13359.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(_s: i16) { } + +fn bar(_s: u32) { } + +fn main() { + foo(1*(1 as isize)); + //~^ ERROR mismatched types + //~| expected i16, found isize + + bar(1*(1 as usize)); + //~^ ERROR mismatched types + //~| expected u32, found usize +} diff --git a/src/test/ui/issue-13359.stderr b/src/test/ui/issue-13359.stderr new file mode 100644 index 00000000000..77f10be982b --- /dev/null +++ b/src/test/ui/issue-13359.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-13359.rs:16:9 + | +LL | foo(1*(1 as isize)); + | ^^^^^^^^^^^^^^ expected i16, found isize + +error[E0308]: mismatched types + --> $DIR/issue-13359.rs:20:9 + | +LL | bar(1*(1 as usize)); + | ^^^^^^^^^^^^^^ expected u32, found usize + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-13404.rs b/src/test/ui/issue-13404.rs new file mode 100644 index 00000000000..0059e92e07f --- /dev/null +++ b/src/test/ui/issue-13404.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use a::f; +use b::f; //~ ERROR: unresolved import `b::f` [E0432] + //~^ no `f` in `b` + +mod a { pub fn f() {} } +mod b { } + +fn main() { + f(); +} diff --git a/src/test/ui/issue-13404.stderr b/src/test/ui/issue-13404.stderr new file mode 100644 index 00000000000..b71d3ceab5b --- /dev/null +++ b/src/test/ui/issue-13404.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `b::f` + --> $DIR/issue-13404.rs:12:5 + | +LL | use b::f; //~ ERROR: unresolved import `b::f` [E0432] + | ^^^^ no `f` in `b` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-13407.rs b/src/test/ui/issue-13407.rs new file mode 100644 index 00000000000..afb2e867f45 --- /dev/null +++ b/src/test/ui/issue-13407.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod A { + struct C; +} + +fn main() { + A::C = 1; + //~^ ERROR: invalid left-hand side expression + //~| ERROR: mismatched types + //~| ERROR: struct `C` is private +} diff --git a/src/test/ui/issue-13407.stderr b/src/test/ui/issue-13407.stderr new file mode 100644 index 00000000000..e5ef50e984a --- /dev/null +++ b/src/test/ui/issue-13407.stderr @@ -0,0 +1,25 @@ +error[E0603]: unit struct `C` is private + --> $DIR/issue-13407.rs:16:5 + | +LL | A::C = 1; + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/issue-13407.rs:16:12 + | +LL | A::C = 1; + | ^ expected struct `A::C`, found integral variable + | + = note: expected type `A::C` + found type `{integer}` + +error[E0070]: invalid left-hand side expression + --> $DIR/issue-13407.rs:16:5 + | +LL | A::C = 1; + | ^^^^^^^^ left-hand of expression not valid + +error: aborting due to 3 previous errors + +Some errors occurred: E0070, E0308, E0603. +For more information about an error, try `rustc --explain E0070`. diff --git a/src/test/ui/issue-13446.rs b/src/test/ui/issue-13446.rs new file mode 100644 index 00000000000..6ad3ec67b29 --- /dev/null +++ b/src/test/ui/issue-13446.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +// Used to cause ICE + +// error-pattern: mismatched types + +static VEC: [u32; 256] = vec![]; + +fn main() {} diff --git a/src/test/ui/issue-13446.stderr b/src/test/ui/issue-13446.stderr new file mode 100644 index 00000000000..68fece30c81 --- /dev/null +++ b/src/test/ui/issue-13446.stderr @@ -0,0 +1,13 @@ +error[E0308]: mismatched types + --> $DIR/issue-13446.rs:16:26 + | +LL | static VEC: [u32; 256] = vec![]; + | ^^^^^^ expected array of 256 elements, found struct `std::vec::Vec` + | + = note: expected type `[u32; 256]` + found type `std::vec::Vec<_>` + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-13466.rs b/src/test/ui/issue-13466.rs new file mode 100644 index 00000000000..abddf6ba7a3 --- /dev/null +++ b/src/test/ui/issue-13466.rs @@ -0,0 +1,30 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for #13466 + +pub fn main() { + // The expected arm type `Option` has one type parameter, while + // the actual arm `Result` has two. typeck should not be + // tricked into looking up a non-existing second type parameter. + let _x: usize = match Some(1) { + Ok(u) => u, + //~^ ERROR mismatched types + //~| expected type `std::option::Option<{integer}>` + //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option`, found enum `std::result::Result` + + Err(e) => panic!(e) + //~^ ERROR mismatched types + //~| expected type `std::option::Option<{integer}>` + //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option`, found enum `std::result::Result` + }; +} diff --git a/src/test/ui/issue-13466.stderr b/src/test/ui/issue-13466.stderr new file mode 100644 index 00000000000..be845fb8e22 --- /dev/null +++ b/src/test/ui/issue-13466.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/issue-13466.rs:18:9 + | +LL | Ok(u) => u, + | ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` + | + = note: expected type `std::option::Option<{integer}>` + found type `std::result::Result<_, _>` + +error[E0308]: mismatched types + --> $DIR/issue-13466.rs:24:9 + | +LL | Err(e) => panic!(e) + | ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` + | + = note: expected type `std::option::Option<{integer}>` + found type `std::result::Result<_, _>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-13482-2.rs b/src/test/ui/issue-13482-2.rs new file mode 100644 index 00000000000..fe7fbb176cc --- /dev/null +++ b/src/test/ui/issue-13482-2.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags:-Z verbose + +fn main() { + let x = [1,2]; + let y = match x { + [] => None, //~ ERROR pattern requires 0 elements but array has 2 + [a,_] => Some(a) + }; +} diff --git a/src/test/ui/issue-13482-2.stderr b/src/test/ui/issue-13482-2.stderr new file mode 100644 index 00000000000..1ecae3b867a --- /dev/null +++ b/src/test/ui/issue-13482-2.stderr @@ -0,0 +1,9 @@ +error[E0527]: pattern requires 0 elements but array has 2 + --> $DIR/issue-13482-2.rs:16:9 + | +LL | [] => None, //~ ERROR pattern requires 0 elements but array has 2 + | ^^ expected 2 elements + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0527`. diff --git a/src/test/ui/issue-13482.rs b/src/test/ui/issue-13482.rs new file mode 100644 index 00000000000..32a63b79a32 --- /dev/null +++ b/src/test/ui/issue-13482.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x = [1,2]; + let y = match x { + [] => None, //~ ERROR pattern requires 0 elements but array has 2 + [a,_] => Some(a) + }; +} diff --git a/src/test/ui/issue-13482.stderr b/src/test/ui/issue-13482.stderr new file mode 100644 index 00000000000..95273bb46bc --- /dev/null +++ b/src/test/ui/issue-13482.stderr @@ -0,0 +1,9 @@ +error[E0527]: pattern requires 0 elements but array has 2 + --> $DIR/issue-13482.rs:14:5 + | +LL | [] => None, //~ ERROR pattern requires 0 elements but array has 2 + | ^^ expected 2 elements + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0527`. diff --git a/src/test/ui/issue-13497-2.rs b/src/test/ui/issue-13497-2.rs new file mode 100644 index 00000000000..31716837493 --- /dev/null +++ b/src/test/ui/issue-13497-2.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn read_lines_borrowed<'a>() -> Vec<&'a str> { + let rawLines: Vec = vec!["foo ".to_string(), " bar".to_string()]; + rawLines //~ ERROR `rawLines` does not live long enough + .iter().map(|l| l.trim()).collect() +} + +fn main() {} diff --git a/src/test/ui/issue-13497-2.stderr b/src/test/ui/issue-13497-2.stderr new file mode 100644 index 00000000000..72770f8c84c --- /dev/null +++ b/src/test/ui/issue-13497-2.stderr @@ -0,0 +1,18 @@ +error[E0597]: `rawLines` does not live long enough + --> $DIR/issue-13497-2.rs:13:5 + | +LL | rawLines //~ ERROR `rawLines` does not live long enough + | ^^^^^^^^ borrowed value does not live long enough +LL | .iter().map(|l| l.trim()).collect() +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 11:24... + --> $DIR/issue-13497-2.rs:11:24 + | +LL | fn read_lines_borrowed<'a>() -> Vec<&'a str> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-13497.rs b/src/test/ui/issue-13497.rs new file mode 100644 index 00000000000..d544a92d9c3 --- /dev/null +++ b/src/test/ui/issue-13497.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn read_lines_borrowed1() -> Vec< + &str //~ ERROR missing lifetime specifier +> { + let rawLines: Vec = vec!["foo ".to_string(), " bar".to_string()]; + rawLines.iter().map(|l| l.trim()).collect() +} + +fn main() {} diff --git a/src/test/ui/issue-13497.stderr b/src/test/ui/issue-13497.stderr new file mode 100644 index 00000000000..ab6d041bd48 --- /dev/null +++ b/src/test/ui/issue-13497.stderr @@ -0,0 +1,12 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-13497.rs:12:5 + | +LL | &str //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/issue-1362.rs b/src/test/ui/issue-1362.rs new file mode 100644 index 00000000000..d51db479599 --- /dev/null +++ b/src/test/ui/issue-1362.rs @@ -0,0 +1,18 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for issue #1362 - without that fix the span will be bogus +// no-reformat +fn main() { + let x: u32 = 20i32; //~ ERROR mismatched types +} +// NOTE: Do not add any extra lines as the line number the error is +// on is significant; an error later in the source file might not +// trigger the bug. diff --git a/src/test/ui/issue-1362.stderr b/src/test/ui/issue-1362.stderr new file mode 100644 index 00000000000..c19e256eb92 --- /dev/null +++ b/src/test/ui/issue-1362.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/issue-1362.rs:14:16 + | +LL | let x: u32 = 20i32; //~ ERROR mismatched types + | ^^^^^ expected u32, found i32 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-13641.rs b/src/test/ui/issue-13641.rs new file mode 100644 index 00000000000..3b690e08f61 --- /dev/null +++ b/src/test/ui/issue-13641.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod a { + struct Foo; + impl Foo { pub fn new() {} } + enum Bar {} + impl Bar { pub fn new() {} } +} + +fn main() { + a::Foo::new(); + //~^ ERROR: struct `Foo` is private + a::Bar::new(); + //~^ ERROR: enum `Bar` is private +} diff --git a/src/test/ui/issue-13641.stderr b/src/test/ui/issue-13641.stderr new file mode 100644 index 00000000000..0f96b5f66b1 --- /dev/null +++ b/src/test/ui/issue-13641.stderr @@ -0,0 +1,15 @@ +error[E0603]: struct `Foo` is private + --> $DIR/issue-13641.rs:19:5 + | +LL | a::Foo::new(); + | ^^^^^^^^^^^ + +error[E0603]: enum `Bar` is private + --> $DIR/issue-13641.rs:21:5 + | +LL | a::Bar::new(); + | ^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/issue-13727.rs b/src/test/ui/issue-13727.rs new file mode 100644 index 00000000000..2e815548e89 --- /dev/null +++ b/src/test/ui/issue-13727.rs @@ -0,0 +1,25 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(overflowing_literals)] +#![deny(unreachable_patterns)] + +fn test(val: u8) { + match val { + 256 => print!("0b1110\n"), + 512 => print!("0b1111\n"), + //~^ ERROR: unreachable pattern + _ => print!("fail\n"), + } +} + +fn main() { + test(1); +} diff --git a/src/test/ui/issue-13727.stderr b/src/test/ui/issue-13727.stderr new file mode 100644 index 00000000000..47b9a0211a9 --- /dev/null +++ b/src/test/ui/issue-13727.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/issue-13727.rs:17:5 + | +LL | 512 => print!("0b1111/n"), + | ^^^ + | +note: lint level defined here + --> $DIR/issue-13727.rs:12:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-13847.rs b/src/test/ui/issue-13847.rs new file mode 100644 index 00000000000..0314f109a7c --- /dev/null +++ b/src/test/ui/issue-13847.rs @@ -0,0 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + return.is_failure //~ ERROR no field `is_failure` on type `!` +} diff --git a/src/test/ui/issue-13847.stderr b/src/test/ui/issue-13847.stderr new file mode 100644 index 00000000000..fad3245034d --- /dev/null +++ b/src/test/ui/issue-13847.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `is_failure` on type `!` + --> $DIR/issue-13847.rs:12:12 + | +LL | return.is_failure //~ ERROR no field `is_failure` on type `!` + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-13853-2.rs b/src/test/ui/issue-13853-2.rs new file mode 100644 index 00000000000..1635a8f69a6 --- /dev/null +++ b/src/test/ui/issue-13853-2.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait FromStructReader<'a> { } +trait ResponseHook { + fn get(&self); +} +fn foo(res : Box) { res.get } //~ ERROR attempted to take value of method +fn main() {} diff --git a/src/test/ui/issue-13853-2.stderr b/src/test/ui/issue-13853-2.stderr new file mode 100644 index 00000000000..c15290fb1d9 --- /dev/null +++ b/src/test/ui/issue-13853-2.stderr @@ -0,0 +1,11 @@ +error[E0615]: attempted to take value of method `get` on type `std::boxed::Box<(dyn ResponseHook + 'static)>` + --> $DIR/issue-13853-2.rs:15:39 + | +LL | fn foo(res : Box) { res.get } //~ ERROR attempted to take value of method + | ^^^ + | + = help: maybe a `()` to call it is missing? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0615`. diff --git a/src/test/ui/issue-13853-5.rs b/src/test/ui/issue-13853-5.rs new file mode 100644 index 00000000000..78b079a7c44 --- /dev/null +++ b/src/test/ui/issue-13853-5.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Deserializer<'a> { } + +trait Deserializable { + fn deserialize_token<'a, D: Deserializer<'a>>(_: D, _: &'a str) -> Self; +} + +impl<'a, T: Deserializable> Deserializable for &'a str { + //~^ ERROR type parameter `T` is not constrained + fn deserialize_token>(_x: D, _y: &'a str) -> &'a str { + } +} + +fn main() {} diff --git a/src/test/ui/issue-13853-5.stderr b/src/test/ui/issue-13853-5.stderr new file mode 100644 index 00000000000..e93b03b43ee --- /dev/null +++ b/src/test/ui/issue-13853-5.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-13853-5.rs:17:10 + | +LL | impl<'a, T: Deserializable> Deserializable for &'a str { + | ^ 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/issue-13853.rs b/src/test/ui/issue-13853.rs new file mode 100644 index 00000000000..86a6bdfd4dd --- /dev/null +++ b/src/test/ui/issue-13853.rs @@ -0,0 +1,48 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Node { + fn zomg(); +} + +trait Graph { + fn nodes<'a, I: Iterator>(&'a self) -> I + where N: 'a; +} + +impl Graph for Vec { + fn nodes<'a, I: Iterator>(&self) -> I + where N: 'a + { + self.iter() //~ ERROR mismatched types + } +} + +struct Stuff; + +impl Node for Stuff { + fn zomg() { + println!("zomg"); + } +} + +fn iterate>(graph: &G) { + for node in graph.iter() { //~ ERROR no method named `iter` found + node.zomg(); + } +} + +pub fn main() { + let graph = Vec::new(); + + graph.push(Stuff); + + iterate(graph); //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-13853.stderr b/src/test/ui/issue-13853.stderr new file mode 100644 index 00000000000..188bfd59301 --- /dev/null +++ b/src/test/ui/issue-13853.stderr @@ -0,0 +1,34 @@ +error[E0308]: mismatched types + --> $DIR/issue-13853.rs:24:9 + | +LL | fn nodes<'a, I: Iterator>(&self) -> I + | - expected `I` because of return type +... +LL | self.iter() //~ ERROR mismatched types + | ^^^^^^^^^^^ expected type parameter, found struct `std::slice::Iter` + | + = note: expected type `I` + found type `std::slice::Iter<'_, N>` + +error[E0599]: no method named `iter` found for type `&G` in the current scope + --> $DIR/issue-13853.rs:37:23 + | +LL | for node in graph.iter() { //~ ERROR no method named `iter` found + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/issue-13853.rs:47:13 + | +LL | iterate(graph); //~ ERROR mismatched types + | ^^^^^ + | | + | expected reference, found struct `std::vec::Vec` + | help: consider borrowing here: `&graph` + | + = note: expected type `&_` + found type `std::vec::Vec` + +error: aborting due to 3 previous errors + +Some errors occurred: E0308, E0599. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-14091-2.rs b/src/test/ui/issue-14091-2.rs new file mode 100644 index 00000000000..a4351733a87 --- /dev/null +++ b/src/test/ui/issue-14091-2.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// + +// Very + +// sensitive +pub struct BytePos(pub u32); + +// to particular + +// line numberings / offsets + +fn main() { + let x = BytePos(1); + + assert!(x, x); + //~^ ERROR cannot apply unary operator `!` to type `BytePos` +} diff --git a/src/test/ui/issue-14091-2.stderr b/src/test/ui/issue-14091-2.stderr new file mode 100644 index 00000000000..ccabd801c85 --- /dev/null +++ b/src/test/ui/issue-14091-2.stderr @@ -0,0 +1,11 @@ +error[E0600]: cannot apply unary operator `!` to type `BytePos` + --> $DIR/issue-14091-2.rs:25:5 + | +LL | assert!(x, x); + | ^^^^^^^^^^^^^^ cannot apply unary operator `!` + | + = note: an implementation of `std::ops::Not` might be missing for `BytePos` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0600`. diff --git a/src/test/ui/issue-14091.rs b/src/test/ui/issue-14091.rs new file mode 100644 index 00000000000..9e436b8e629 --- /dev/null +++ b/src/test/ui/issue-14091.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main(){ + assert!(1,1); + //~^ ERROR mismatched types +} diff --git a/src/test/ui/issue-14091.stderr b/src/test/ui/issue-14091.stderr new file mode 100644 index 00000000000..9db2a0e2a86 --- /dev/null +++ b/src/test/ui/issue-14091.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-14091.rs:12:5 + | +LL | assert!(1,1); + | ^^^^^^^^^^^^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-14221.rs b/src/test/ui/issue-14221.rs new file mode 100644 index 00000000000..d11fe99c07f --- /dev/null +++ b/src/test/ui/issue-14221.rs @@ -0,0 +1,31 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(unreachable_patterns)] +#![allow(unused_variables)] +#![allow(non_snake_case)] + +pub enum E { + A, + B, +} + +pub mod b { + pub fn key(e: ::E) -> &'static str { + match e { + A => "A", +//~^ WARN pattern binding `A` is named the same as one of the variants of the type `E` + B => "B", //~ ERROR: unreachable pattern +//~^ WARN pattern binding `B` is named the same as one of the variants of the type `E` + } + } +} + +fn main() {} diff --git a/src/test/ui/issue-14221.stderr b/src/test/ui/issue-14221.stderr new file mode 100644 index 00000000000..9252a4f304f --- /dev/null +++ b/src/test/ui/issue-14221.stderr @@ -0,0 +1,30 @@ +warning[E0170]: pattern binding `A` is named the same as one of the variants of the type `E` + --> $DIR/issue-14221.rs:23:13 + | +LL | A => "A", + | ^ help: to match on the variant, qualify the path: `E::A` + +warning[E0170]: pattern binding `B` is named the same as one of the variants of the type `E` + --> $DIR/issue-14221.rs:25:13 + | +LL | B => "B", //~ ERROR: unreachable pattern + | ^ help: to match on the variant, qualify the path: `E::B` + +error: unreachable pattern + --> $DIR/issue-14221.rs:25:13 + | +LL | A => "A", + | - matches any value +LL | //~^ WARN pattern binding `A` is named the same as one of the variants of the type `E` +LL | B => "B", //~ ERROR: unreachable pattern + | ^ unreachable pattern + | +note: lint level defined here + --> $DIR/issue-14221.rs:11:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0170`. diff --git a/src/test/ui/issue-14227.rs b/src/test/ui/issue-14227.rs new file mode 100644 index 00000000000..250e78ce246 --- /dev/null +++ b/src/test/ui/issue-14227.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(safe_extern_statics, warnings)] + +extern { + pub static symbol: (); +} +static CRASH: () = symbol; +//~^ ERROR could not evaluate static initializer +//~| tried to read from foreign (extern) static + +fn main() {} diff --git a/src/test/ui/issue-14227.stderr b/src/test/ui/issue-14227.stderr new file mode 100644 index 00000000000..f5f39465b18 --- /dev/null +++ b/src/test/ui/issue-14227.stderr @@ -0,0 +1,9 @@ +error[E0080]: could not evaluate static initializer + --> $DIR/issue-14227.rs:16:20 + | +LL | static CRASH: () = symbol; + | ^^^^^^ tried to read from foreign (extern) static + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/issue-14285.nll.stderr b/src/test/ui/issue-14285.nll.stderr new file mode 100644 index 00000000000..440365cae3e --- /dev/null +++ b/src/test/ui/issue-14285.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/issue-14285.rs:22:7 + | +LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621] + | ^ + +error[E0621]: explicit lifetime required in the type of `a` + --> $DIR/issue-14285.rs:22:7 + | +LL | fn foo<'a>(a: &Foo) -> B<'a> { + | - consider changing the type of `a` to `&'a (dyn Foo + 'a)` +LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621] + | ^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-14285.rs b/src/test/ui/issue-14285.rs new file mode 100644 index 00000000000..dceecee6ca7 --- /dev/null +++ b/src/test/ui/issue-14285.rs @@ -0,0 +1,27 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn dummy(&self) { } +} + +struct A; + +impl Foo for A {} + +struct B<'a>(&'a (Foo+'a)); + +fn foo<'a>(a: &Foo) -> B<'a> { + B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621] +} + +fn main() { + let _test = foo(&A); +} diff --git a/src/test/ui/issue-14285.stderr b/src/test/ui/issue-14285.stderr new file mode 100644 index 00000000000..b5ab7bdb9d1 --- /dev/null +++ b/src/test/ui/issue-14285.stderr @@ -0,0 +1,11 @@ +error[E0621]: explicit lifetime required in the type of `a` + --> $DIR/issue-14285.rs:22:5 + | +LL | fn foo<'a>(a: &Foo) -> B<'a> { + | - consider changing the type of `a` to `&'a (dyn Foo + 'a)` +LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621] + | ^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-14309.rs b/src/test/ui/issue-14309.rs new file mode 100644 index 00000000000..f76fa3e4a8e --- /dev/null +++ b/src/test/ui/issue-14309.rs @@ -0,0 +1,49 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(improper_ctypes)] +#![allow(dead_code)] + +struct A { + x: i32 +} + +#[repr(C, packed)] +struct B { + x: i32, + y: A +} + +#[repr(C)] +struct C { + x: i32 +} + +type A2 = A; +type B2 = B; +type C2 = C; + +#[repr(C)] +struct D { + x: C, + y: A +} + +extern "C" { + fn foo(x: A); //~ ERROR type `A` which is not FFI-safe + fn bar(x: B); //~ ERROR type `A` + fn baz(x: C); + fn qux(x: A2); //~ ERROR type `A` + fn quux(x: B2); //~ ERROR type `A` + fn corge(x: C2); + fn fred(x: D); //~ ERROR type `A` +} + +fn main() { } diff --git a/src/test/ui/issue-14309.stderr b/src/test/ui/issue-14309.stderr new file mode 100644 index 00000000000..e062c633ee6 --- /dev/null +++ b/src/test/ui/issue-14309.stderr @@ -0,0 +1,82 @@ +error: `extern` block uses type `A` which is not FFI-safe: this struct has unspecified layout + --> $DIR/issue-14309.rs:40:15 + | +LL | fn foo(x: A); //~ ERROR type `A` which is not FFI-safe + | ^ + | +note: lint level defined here + --> $DIR/issue-14309.rs:11:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct +note: type defined here + --> $DIR/issue-14309.rs:14:1 + | +LL | / struct A { +LL | | x: i32 +LL | | } + | |_^ + +error: `extern` block uses type `A` which is not FFI-safe: this struct has unspecified layout + --> $DIR/issue-14309.rs:41:15 + | +LL | fn bar(x: B); //~ ERROR type `A` + | ^ + | + = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct +note: type defined here + --> $DIR/issue-14309.rs:14:1 + | +LL | / struct A { +LL | | x: i32 +LL | | } + | |_^ + +error: `extern` block uses type `A` which is not FFI-safe: this struct has unspecified layout + --> $DIR/issue-14309.rs:43:15 + | +LL | fn qux(x: A2); //~ ERROR type `A` + | ^^ + | + = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct +note: type defined here + --> $DIR/issue-14309.rs:14:1 + | +LL | / struct A { +LL | | x: i32 +LL | | } + | |_^ + +error: `extern` block uses type `A` which is not FFI-safe: this struct has unspecified layout + --> $DIR/issue-14309.rs:44:16 + | +LL | fn quux(x: B2); //~ ERROR type `A` + | ^^ + | + = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct +note: type defined here + --> $DIR/issue-14309.rs:14:1 + | +LL | / struct A { +LL | | x: i32 +LL | | } + | |_^ + +error: `extern` block uses type `A` which is not FFI-safe: this struct has unspecified layout + --> $DIR/issue-14309.rs:46:16 + | +LL | fn fred(x: D); //~ ERROR type `A` + | ^ + | + = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct +note: type defined here + --> $DIR/issue-14309.rs:14:1 + | +LL | / struct A { +LL | | x: i32 +LL | | } + | |_^ + +error: aborting due to 5 previous errors + diff --git a/src/test/ui/issue-14366.rs b/src/test/ui/issue-14366.rs new file mode 100644 index 00000000000..0b154d0a3ea --- /dev/null +++ b/src/test/ui/issue-14366.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let _x = "test" as &::std::any::Any; + //~^ ERROR the size for values of type +} diff --git a/src/test/ui/issue-14366.stderr b/src/test/ui/issue-14366.stderr new file mode 100644 index 00000000000..260ca443689 --- /dev/null +++ b/src/test/ui/issue-14366.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-14366.rs:12:14 + | +LL | let _x = "test" as &::std::any::Any; + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit + = note: required for the cast to the object type `dyn std::any::Any` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-1448-2.rs b/src/test/ui/issue-1448-2.rs new file mode 100644 index 00000000000..ddfed3647c2 --- /dev/null +++ b/src/test/ui/issue-1448-2.rs @@ -0,0 +1,17 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for issue #1448 and #1386 + +fn foo(a: u32) -> u32 { a } + +fn main() { + println!("{}", foo(10i32)); //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-1448-2.stderr b/src/test/ui/issue-1448-2.stderr new file mode 100644 index 00000000000..5769b0c3b9f --- /dev/null +++ b/src/test/ui/issue-1448-2.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/issue-1448-2.rs:16:24 + | +LL | println!("{}", foo(10i32)); //~ ERROR mismatched types + | ^^^^^ expected u32, found i32 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-14541.rs b/src/test/ui/issue-14541.rs new file mode 100644 index 00000000000..84c600d2201 --- /dev/null +++ b/src/test/ui/issue-14541.rs @@ -0,0 +1,22 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct vec2 { y: f32 } +struct vec3 { y: f32, z: f32 } + +fn make(v: vec2) { + let vec3 { y: _, z: _ } = v; + //~^ ERROR mismatched types + //~| expected type `vec2` + //~| found type `vec3` + //~| expected struct `vec2`, found struct `vec3` +} + +fn main() { } diff --git a/src/test/ui/issue-14541.stderr b/src/test/ui/issue-14541.stderr new file mode 100644 index 00000000000..fcff500cfda --- /dev/null +++ b/src/test/ui/issue-14541.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-14541.rs:15:9 + | +LL | let vec3 { y: _, z: _ } = v; + | ^^^^^^^^^^^^^^^^^^^ expected struct `vec2`, found struct `vec3` + | + = note: expected type `vec2` + found type `vec3` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-14721.rs b/src/test/ui/issue-14721.rs new file mode 100644 index 00000000000..58e8e10ee37 --- /dev/null +++ b/src/test/ui/issue-14721.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let foo = "str"; + println!("{}", foo.desc); //~ no field `desc` on type `&str` +} diff --git a/src/test/ui/issue-14721.stderr b/src/test/ui/issue-14721.stderr new file mode 100644 index 00000000000..93e51140caa --- /dev/null +++ b/src/test/ui/issue-14721.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `desc` on type `&str` + --> $DIR/issue-14721.rs:13:24 + | +LL | println!("{}", foo.desc); //~ no field `desc` on type `&str` + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-1476.rs b/src/test/ui/issue-1476.rs new file mode 100644 index 00000000000..48bf71f5892 --- /dev/null +++ b/src/test/ui/issue-1476.rs @@ -0,0 +1,13 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + println!("{}", x); //~ ERROR cannot find value `x` in this scope +} diff --git a/src/test/ui/issue-1476.stderr b/src/test/ui/issue-1476.stderr new file mode 100644 index 00000000000..afdda3e15da --- /dev/null +++ b/src/test/ui/issue-1476.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `x` in this scope + --> $DIR/issue-1476.rs:12:20 + | +LL | println!("{}", x); //~ ERROR cannot find value `x` in this scope + | ^ 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/issue-14772.rs b/src/test/ui/issue-14772.rs new file mode 100644 index 00000000000..aaaad67be52 --- /dev/null +++ b/src/test/ui/issue-14772.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: --test + +#[test] +mod foo {} //~ ERROR only functions may be used as tests + +fn main() {} diff --git a/src/test/ui/issue-14772.stderr b/src/test/ui/issue-14772.stderr new file mode 100644 index 00000000000..1116cd38edf --- /dev/null +++ b/src/test/ui/issue-14772.stderr @@ -0,0 +1,8 @@ +error: only functions may be used as tests + --> $DIR/issue-14772.rs:14:1 + | +LL | mod foo {} //~ ERROR only functions may be used as tests + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-14845.rs b/src/test/ui/issue-14845.rs new file mode 100644 index 00000000000..74f0833e8d1 --- /dev/null +++ b/src/test/ui/issue-14845.rs @@ -0,0 +1,22 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +struct X { + a: [u8; 1] +} + +fn main() { + let x = X { a: [0] }; + let _f = &x.a as *mut u8; //~ ERROR casting + + let local: [u8; 1] = [0]; + let _v = &local as *mut u8; //~ ERROR casting +} diff --git a/src/test/ui/issue-14845.stderr b/src/test/ui/issue-14845.stderr new file mode 100644 index 00000000000..a994026946e --- /dev/null +++ b/src/test/ui/issue-14845.stderr @@ -0,0 +1,15 @@ +error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid + --> $DIR/issue-14845.rs:18:14 + | +LL | let _f = &x.a as *mut u8; //~ ERROR casting + | ^^^^^^^^^^^^^^^ + +error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid + --> $DIR/issue-14845.rs:21:14 + | +LL | let _v = &local as *mut u8; //~ ERROR casting + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/ui/issue-14853.rs b/src/test/ui/issue-14853.rs new file mode 100644 index 00000000000..e4da3e4fa43 --- /dev/null +++ b/src/test/ui/issue-14853.rs @@ -0,0 +1,30 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::fmt::Debug; + +trait Str {} + +trait Something: Sized { + fn yay(_: Option, thing: &[T]); +} + +struct X { data: u32 } + +impl Something for X { + fn yay(_:Option, thing: &[T]) { + //~^ ERROR E0276 + } +} + +fn main() { + let arr = &["one", "two", "three"]; + println!("{:?}", Something::yay(None::, arr)); +} diff --git a/src/test/ui/issue-14853.stderr b/src/test/ui/issue-14853.stderr new file mode 100644 index 00000000000..6c2f6bb9c69 --- /dev/null +++ b/src/test/ui/issue-14853.stderr @@ -0,0 +1,12 @@ +error[E0276]: impl has stricter requirements than trait + --> $DIR/issue-14853.rs:22:5 + | +LL | fn yay(_: Option, thing: &[T]); + | ----------------------------------------------- definition of `yay` from trait +... +LL | fn yay(_:Option, thing: &[T]) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0276`. diff --git a/src/test/ui/issue-14915.rs b/src/test/ui/issue-14915.rs new file mode 100644 index 00000000000..810d6656a8f --- /dev/null +++ b/src/test/ui/issue-14915.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] + +fn main() { + let x: Box = box 0; + + println!("{}", x + 1); + //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box` +} diff --git a/src/test/ui/issue-14915.stderr b/src/test/ui/issue-14915.stderr new file mode 100644 index 00000000000..aa418f5df86 --- /dev/null +++ b/src/test/ui/issue-14915.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box` + --> $DIR/issue-14915.rs:16:20 + | +LL | println!("{}", x + 1); + | ^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/ui/issue-15034.nll.stderr b/src/test/ui/issue-15034.nll.stderr new file mode 100644 index 00000000000..19fe83f8f6c --- /dev/null +++ b/src/test/ui/issue-15034.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/issue-15034.rs:27:9 + | +LL | Parser { lexer: lexer } + | ^^^^^^ + +error[E0621]: explicit lifetime required in the type of `lexer` + --> $DIR/issue-15034.rs:27:25 + | +LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { + | ----- consider changing the type of `lexer` to `&'a mut Lexer<'a>` +LL | Parser { lexer: lexer } + | ^^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-15034.rs b/src/test/ui/issue-15034.rs new file mode 100644 index 00000000000..a62e46820d3 --- /dev/null +++ b/src/test/ui/issue-15034.rs @@ -0,0 +1,32 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct Lexer<'a> { + input: &'a str, +} + +impl<'a> Lexer<'a> { + pub fn new(input: &'a str) -> Lexer<'a> { + Lexer { input: input } + } +} + +struct Parser<'a> { + lexer: &'a mut Lexer<'a>, +} + +impl<'a> Parser<'a> { + pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { + Parser { lexer: lexer } + //~^ ERROR 27:25: 27:30: explicit lifetime required in the type of `lexer` [E0621] + } +} + +fn main() {} diff --git a/src/test/ui/issue-15034.stderr b/src/test/ui/issue-15034.stderr new file mode 100644 index 00000000000..3bbf4235a29 --- /dev/null +++ b/src/test/ui/issue-15034.stderr @@ -0,0 +1,11 @@ +error[E0621]: explicit lifetime required in the type of `lexer` + --> $DIR/issue-15034.rs:27:25 + | +LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { + | ----- consider changing the type of `lexer` to `&'a mut Lexer<'a>` +LL | Parser { lexer: lexer } + | ^^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-15094.rs b/src/test/ui/issue-15094.rs new file mode 100644 index 00000000000..1dd6763cbe5 --- /dev/null +++ b/src/test/ui/issue-15094.rs @@ -0,0 +1,36 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(fn_traits, unboxed_closures)] + +use std::{fmt, ops}; + +struct Debuger { + x: T +} + +impl ops::FnOnce<(),> for Debuger { + type Output = (); + fn call_once(self, _args: ()) { + //~^ ERROR `call_once` has an incompatible type for trait + //~| expected type `extern "rust-call" fn + //~| found type `fn + println!("{:?}", self.x); + } +} + +fn make_shower(x: T) -> Debuger { + Debuger { x: x } +} + +pub fn main() { + let show3 = make_shower(3); + show3(); +} diff --git a/src/test/ui/issue-15094.stderr b/src/test/ui/issue-15094.stderr new file mode 100644 index 00000000000..7928a6be350 --- /dev/null +++ b/src/test/ui/issue-15094.stderr @@ -0,0 +1,12 @@ +error[E0053]: method `call_once` has an incompatible type for trait + --> $DIR/issue-15094.rs:21:5 + | +LL | fn call_once(self, _args: ()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "rust-call" fn, found "Rust" fn + | + = note: expected type `extern "rust-call" fn(Debuger, ())` + found type `fn(Debuger, ())` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/ui/issue-15129.rs b/src/test/ui/issue-15129.rs new file mode 100644 index 00000000000..7a7ba46de74 --- /dev/null +++ b/src/test/ui/issue-15129.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub enum T { + T1(()), + T2(()) +} + +pub enum V { + V1(isize), + V2(bool) +} + +fn main() { + match (T::T1(()), V::V2(true)) { + //~^ ERROR non-exhaustive patterns: `(T1(()), V2(_))` not covered + (T::T1(()), V::V1(i)) => (), + (T::T2(()), V::V2(b)) => () + } +} diff --git a/src/test/ui/issue-15129.stderr b/src/test/ui/issue-15129.stderr new file mode 100644 index 00000000000..e65e6516222 --- /dev/null +++ b/src/test/ui/issue-15129.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `(T1(()), V2(_))` not covered + --> $DIR/issue-15129.rs:22:11 + | +LL | match (T::T1(()), V::V2(true)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `(T1(()), V2(_))` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-15167.rs b/src/test/ui/issue-15167.rs new file mode 100644 index 00000000000..d224b8a548c --- /dev/null +++ b/src/test/ui/issue-15167.rs @@ -0,0 +1,36 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// macro f should not be able to inject a reference to 'n'. + +macro_rules! f { () => (n) } +//~^ ERROR cannot find value `n` in this scope +//~| ERROR cannot find value `n` in this scope +//~| ERROR cannot find value `n` in this scope +//~| ERROR cannot find value `n` in this scope + +fn main() -> (){ + for n in 0..1 { + println!("{}", f!()); + } + + if let Some(n) = None { + println!("{}", f!()); + } + + if false { + } else if let Some(n) = None { + println!("{}", f!()); + } + + while let Some(n) = None { + println!("{}", f!()); + } +} diff --git a/src/test/ui/issue-15167.stderr b/src/test/ui/issue-15167.stderr new file mode 100644 index 00000000000..b15c493ad69 --- /dev/null +++ b/src/test/ui/issue-15167.stderr @@ -0,0 +1,39 @@ +error[E0425]: cannot find value `n` in this scope + --> $DIR/issue-15167.rs:13:25 + | +LL | macro_rules! f { () => (n) } + | ^ not found in this scope +... +LL | println!("{}", f!()); + | ---- in this macro invocation + +error[E0425]: cannot find value `n` in this scope + --> $DIR/issue-15167.rs:13:25 + | +LL | macro_rules! f { () => (n) } + | ^ not found in this scope +... +LL | println!("{}", f!()); + | ---- in this macro invocation + +error[E0425]: cannot find value `n` in this scope + --> $DIR/issue-15167.rs:13:25 + | +LL | macro_rules! f { () => (n) } + | ^ not found in this scope +... +LL | println!("{}", f!()); + | ---- in this macro invocation + +error[E0425]: cannot find value `n` in this scope + --> $DIR/issue-15167.rs:13:25 + | +LL | macro_rules! f { () => (n) } + | ^ not found in this scope +... +LL | println!("{}", f!()); + | ---- in this macro invocation + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/issue-15207.rs b/src/test/ui/issue-15207.rs new file mode 100644 index 00000000000..70da8cf4169 --- /dev/null +++ b/src/test/ui/issue-15207.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + loop { + break.push(1) //~ ERROR no method named `push` found for type `!` + ; + } +} diff --git a/src/test/ui/issue-15207.stderr b/src/test/ui/issue-15207.stderr new file mode 100644 index 00000000000..77e52012277 --- /dev/null +++ b/src/test/ui/issue-15207.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `push` found for type `!` in the current scope + --> $DIR/issue-15207.rs:13:15 + | +LL | break.push(1) //~ ERROR no method named `push` found for type `!` + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-15381.rs b/src/test/ui/issue-15381.rs new file mode 100644 index 00000000000..1cdd803971b --- /dev/null +++ b/src/test/ui/issue-15381.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let values: Vec = vec![1,2,3,4,5,6,7,8]; + + for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) { + //~^ ERROR refutable pattern in `for` loop binding: `&[]` not covered + println!("y={}", y); + } +} diff --git a/src/test/ui/issue-15381.stderr b/src/test/ui/issue-15381.stderr new file mode 100644 index 00000000000..7a936a82108 --- /dev/null +++ b/src/test/ui/issue-15381.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in `for` loop binding: `&[]` not covered + --> $DIR/issue-15381.rs:14:9 + | +LL | for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) { + | ^^^^^^^^ pattern `&[]` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/issue-15756.rs b/src/test/ui/issue-15756.rs new file mode 100644 index 00000000000..c123e85a0e0 --- /dev/null +++ b/src/test/ui/issue-15756.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::slice::Chunks; +use std::slice::ChunksMut; + +fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>) +{ + for + &mut something + //~^ ERROR the size for values of type + in arg2 + { + } +} + +fn main() {} diff --git a/src/test/ui/issue-15756.stderr b/src/test/ui/issue-15756.stderr new file mode 100644 index 00000000000..af70f125302 --- /dev/null +++ b/src/test/ui/issue-15756.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `[T]` cannot be known at compilation time + --> $DIR/issue-15756.rs:17:10 + | +LL | &mut something + | ^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[T]` + = note: to learn more, visit + = note: all local variables must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-15783.rs b/src/test/ui/issue-15783.rs new file mode 100644 index 00000000000..37a2f1582bf --- /dev/null +++ b/src/test/ui/issue-15783.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub fn foo(params: Option<&[&str]>) -> usize { + params.unwrap().first().unwrap().len() +} + +fn main() { + let name = "Foo"; + let x = Some(&[name]); + let msg = foo(x); +//~^ ERROR mismatched types +//~| expected type `std::option::Option<&[&str]>` +//~| found type `std::option::Option<&[&str; 1]>` +//~| expected slice, found array of 1 elements + assert_eq!(msg, 3); +} diff --git a/src/test/ui/issue-15783.stderr b/src/test/ui/issue-15783.stderr new file mode 100644 index 00000000000..d565bad2448 --- /dev/null +++ b/src/test/ui/issue-15783.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-15783.rs:18:19 + | +LL | let msg = foo(x); + | ^ expected slice, found array of 1 elements + | + = note: expected type `std::option::Option<&[&str]>` + found type `std::option::Option<&[&str; 1]>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-15896.rs b/src/test/ui/issue-15896.rs new file mode 100644 index 00000000000..35ef9ba2b4b --- /dev/null +++ b/src/test/ui/issue-15896.rs @@ -0,0 +1,28 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for #15896. It used to ICE rustc. + +fn main() { + enum R { REB(()) } + struct Tau { t: usize } + enum E { B(R, Tau) } + + let e = E::B(R::REB(()), Tau { t: 3 }); + let u = match e { + E::B( + Tau{t: x}, + //~^ ERROR mismatched types + //~| expected type `main::R` + //~| found type `main::Tau` + //~| expected enum `main::R`, found struct `main::Tau` + _) => x, + }; +} diff --git a/src/test/ui/issue-15896.stderr b/src/test/ui/issue-15896.stderr new file mode 100644 index 00000000000..b41848c8cdf --- /dev/null +++ b/src/test/ui/issue-15896.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-15896.rs:21:11 + | +LL | Tau{t: x}, + | ^^^^^^^^^ expected enum `main::R`, found struct `main::Tau` + | + = note: expected type `main::R` + found type `main::Tau` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-15919.rs b/src/test/ui/issue-15919.rs new file mode 100644 index 00000000000..df7e7c102b2 --- /dev/null +++ b/src/test/ui/issue-15919.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern: too big for the current architecture + +#[cfg(target_pointer_width = "32")] +fn main() { + let x = [0usize; 0xffff_ffff]; +} + +#[cfg(target_pointer_width = "64")] +fn main() { + let x = [0usize; 0xffff_ffff_ffff_ffff]; +} diff --git a/src/test/ui/issue-15919.stderr b/src/test/ui/issue-15919.stderr new file mode 100644 index 00000000000..a69e7b43e25 --- /dev/null +++ b/src/test/ui/issue-15919.stderr @@ -0,0 +1,4 @@ +error: the type `[usize; 18446744073709551615]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/ui/issue-15965.rs b/src/test/ui/issue-15965.rs new file mode 100644 index 00000000000..76ba5a0f4b3 --- /dev/null +++ b/src/test/ui/issue-15965.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + return + { return () } +//~^ ERROR type annotations needed [E0282] + () + ; +} diff --git a/src/test/ui/issue-15965.stderr b/src/test/ui/issue-15965.stderr new file mode 100644 index 00000000000..216c6460c77 --- /dev/null +++ b/src/test/ui/issue-15965.stderr @@ -0,0 +1,13 @@ +error[E0282]: type annotations needed + --> $DIR/issue-15965.rs:13:9 + | +LL | / { return () } +LL | | //~^ ERROR type annotations needed [E0282] +LL | | () + | |______^ cannot infer type for `_` + | + = note: type must be known at this point + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-16048.rs b/src/test/ui/issue-16048.rs new file mode 100644 index 00000000000..cda83fe54b0 --- /dev/null +++ b/src/test/ui/issue-16048.rs @@ -0,0 +1,38 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait NoLifetime { + fn get<'p, T : Test<'p>>(&self) -> T; + //~^ NOTE lifetimes in impl do not match this method in trait +} + +trait Test<'p> { + fn new(buf: &'p mut [u8]) -> Self; +} + +struct Foo<'a> { + buf: &'a mut [u8], +} + +impl<'a> Test<'a> for Foo<'a> { + fn new(buf: &'a mut [u8]) -> Foo<'a> { + Foo { buf: buf } + } +} + +impl<'a> NoLifetime for Foo<'a> { + fn get<'p, T : Test<'a>>(&self) -> T { + //~^ ERROR E0195 + //~| NOTE lifetimes do not match method in trait + return *self as T; + } +} + +fn main() {} diff --git a/src/test/ui/issue-16048.stderr b/src/test/ui/issue-16048.stderr new file mode 100644 index 00000000000..97883fb2a95 --- /dev/null +++ b/src/test/ui/issue-16048.stderr @@ -0,0 +1,12 @@ +error[E0195]: lifetime parameters or bounds on method `get` do not match the trait declaration + --> $DIR/issue-16048.rs:31:11 + | +LL | fn get<'p, T : Test<'p>>(&self) -> T; + | ------------------ lifetimes in impl do not match this method in trait +... +LL | fn get<'p, T : Test<'a>>(&self) -> T { + | ^^^^^^^^^^^^^^^^^^ 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/issue-16098.rs b/src/test/ui/issue-16098.rs new file mode 100644 index 00000000000..68ac19b383f --- /dev/null +++ b/src/test/ui/issue-16098.rs @@ -0,0 +1,26 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! prob1 { + (0) => { + 0 + }; + ($n:expr) => { + if ($n % 3 == 0) || ($n % 5 == 0) { + $n + prob1!($n - 1); //~ ERROR recursion limit reached while expanding the macro `prob1` + } else { + prob1!($n - 1); + } + }; +} + +fn main() { + println!("Problem 1: {}", prob1!(1000)); +} diff --git a/src/test/ui/issue-16098.stderr b/src/test/ui/issue-16098.stderr new file mode 100644 index 00000000000..31162ca50cc --- /dev/null +++ b/src/test/ui/issue-16098.stderr @@ -0,0 +1,13 @@ +error: recursion limit reached while expanding the macro `prob1` + --> $DIR/issue-16098.rs:17:18 + | +LL | $n + prob1!($n - 1); //~ ERROR recursion limit reached while expanding the macro `prob1` + | ^^^^^^^^^^^^^^ +... +LL | println!("Problem 1: {}", prob1!(1000)); + | ------------ in this macro invocation + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error: aborting due to previous error + diff --git a/src/test/ui/issue-16149.rs b/src/test/ui/issue-16149.rs new file mode 100644 index 00000000000..60117bd88d4 --- /dev/null +++ b/src/test/ui/issue-16149.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern { + static externalValue: isize; +} + +fn main() { + let boolValue = match 42 { + externalValue => true, + //~^ ERROR match bindings cannot shadow statics + _ => false + }; +} diff --git a/src/test/ui/issue-16149.stderr b/src/test/ui/issue-16149.stderr new file mode 100644 index 00000000000..b0b6e9dfcd0 --- /dev/null +++ b/src/test/ui/issue-16149.stderr @@ -0,0 +1,12 @@ +error[E0530]: match bindings cannot shadow statics + --> $DIR/issue-16149.rs:17:9 + | +LL | static externalValue: isize; + | ---------------------------- a static `externalValue` is defined here +... +LL | externalValue => true, + | ^^^^^^^^^^^^^ 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/issue-16250.rs b/src/test/ui/issue-16250.rs new file mode 100644 index 00000000000..f9d01003005 --- /dev/null +++ b/src/test/ui/issue-16250.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(warnings)] + +pub struct Foo; + +extern { + pub fn foo(x: (Foo)); //~ ERROR unspecified layout +} + +fn main() { +} diff --git a/src/test/ui/issue-16250.stderr b/src/test/ui/issue-16250.stderr new file mode 100644 index 00000000000..c826b20b65f --- /dev/null +++ b/src/test/ui/issue-16250.stderr @@ -0,0 +1,21 @@ +error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout + --> $DIR/issue-16250.rs:16:20 + | +LL | pub fn foo(x: (Foo)); //~ ERROR unspecified layout + | ^^^ + | +note: lint level defined here + --> $DIR/issue-16250.rs:11:9 + | +LL | #![deny(warnings)] + | ^^^^^^^^ + = note: #[deny(improper_ctypes)] implied by #[deny(warnings)] + = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct +note: type defined here + --> $DIR/issue-16250.rs:13:1 + | +LL | pub struct Foo; + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-16338.rs b/src/test/ui/issue-16338.rs new file mode 100644 index 00000000000..438073e3b2f --- /dev/null +++ b/src/test/ui/issue-16338.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Slice { + data: *const T, + len: usize, +} + +fn main() { + let Slice { data: data, len: len } = "foo"; + //~^ ERROR mismatched types + //~| found type `Slice<_>` +} diff --git a/src/test/ui/issue-16338.stderr b/src/test/ui/issue-16338.stderr new file mode 100644 index 00000000000..c670f1e3e9c --- /dev/null +++ b/src/test/ui/issue-16338.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-16338.rs:17:9 + | +LL | let Slice { data: data, len: len } = "foo"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found struct `Slice` + | + = note: expected type `str` + found type `Slice<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-16401.rs b/src/test/ui/issue-16401.rs new file mode 100644 index 00000000000..3060bbea43c --- /dev/null +++ b/src/test/ui/issue-16401.rs @@ -0,0 +1,25 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Slice { + data: *const T, + len: usize, +} + +fn main() { + match () { + Slice { data: data, len: len } => (), + //~^ ERROR mismatched types + //~| expected type `()` + //~| found type `Slice<_>` + //~| expected (), found struct `Slice` + _ => unreachable!() + } +} diff --git a/src/test/ui/issue-16401.stderr b/src/test/ui/issue-16401.stderr new file mode 100644 index 00000000000..179415c7621 --- /dev/null +++ b/src/test/ui/issue-16401.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-16401.rs:18:9 + | +LL | Slice { data: data, len: len } => (), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice` + | + = note: expected type `()` + found type `Slice<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-16538.rs b/src/test/ui/issue-16538.rs new file mode 100644 index 00000000000..cc652119377 --- /dev/null +++ b/src/test/ui/issue-16538.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(safe_extern_statics)] + +mod Y { + pub type X = usize; + extern { + pub static x: *const usize; + } + pub fn foo(value: *const X) -> *const X { + value + } +} + +static foo: *const Y::X = Y::foo(Y::x as *const Y::X); +//~^ ERROR `*const usize` cannot be shared between threads safely [E0277] +//~| ERROR E0015 + +fn main() {} diff --git a/src/test/ui/issue-16538.stderr b/src/test/ui/issue-16538.stderr new file mode 100644 index 00000000000..9bc3590ebab --- /dev/null +++ b/src/test/ui/issue-16538.stderr @@ -0,0 +1,19 @@ +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-16538.rs:23:27 + | +LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `*const usize` cannot be shared between threads safely + --> $DIR/issue-16538.rs:23:1 + | +LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const usize` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `*const usize` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to 2 previous errors + +Some errors occurred: E0015, E0277. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-16562.rs b/src/test/ui/issue-16562.rs new file mode 100644 index 00000000000..a400263a243 --- /dev/null +++ b/src/test/ui/issue-16562.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait MatrixShape {} + +struct Col { + data: D, + col: C, +} + +trait Collection { fn len(&self) -> usize; } + +impl Collection for Col { +//~^ ERROR type parameter `T` is not constrained + fn len(&self) -> usize { + unimplemented!() + } +} + +fn main() {} diff --git a/src/test/ui/issue-16562.stderr b/src/test/ui/issue-16562.stderr new file mode 100644 index 00000000000..a4525033e25 --- /dev/null +++ b/src/test/ui/issue-16562.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-16562.rs:20:6 + | +LL | impl Collection for Col { + | ^ 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/issue-16683.nll.stderr b/src/test/ui/issue-16683.nll.stderr new file mode 100644 index 00000000000..d789f580b27 --- /dev/null +++ b/src/test/ui/issue-16683.nll.stderr @@ -0,0 +1,22 @@ +warning: not reporting region error due to nll + --> $DIR/issue-16683.rs:14:9 + | +LL | self.a(); //~ ERROR cannot infer + | ^^^^ + +warning: not reporting region error due to nll + --> $DIR/issue-16683.rs:14:14 + | +LL | self.a(); //~ ERROR cannot infer + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/issue-16683.rs:14:9 + | +LL | fn b(&self) { + | - let's call the lifetime of this reference `'1` +LL | self.a(); //~ ERROR cannot infer + | ^^^^^^^^ argument requires that `'1` must outlive `'a` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-16683.rs b/src/test/ui/issue-16683.rs new file mode 100644 index 00000000000..fcbf8a3d351 --- /dev/null +++ b/src/test/ui/issue-16683.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait T<'a> { + fn a(&'a self) -> &'a bool; + fn b(&self) { + self.a(); //~ ERROR cannot infer + } +} + +fn main() {} diff --git a/src/test/ui/issue-16683.stderr b/src/test/ui/issue-16683.stderr new file mode 100644 index 00000000000..ceb5347ca80 --- /dev/null +++ b/src/test/ui/issue-16683.stderr @@ -0,0 +1,30 @@ +error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements + --> $DIR/issue-16683.rs:14:14 + | +LL | self.a(); //~ ERROR cannot infer + | ^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 13:5... + --> $DIR/issue-16683.rs:13:5 + | +LL | / fn b(&self) { +LL | | self.a(); //~ ERROR cannot infer +LL | | } + | |_____^ +note: ...so that reference does not outlive borrowed content + --> $DIR/issue-16683.rs:14:9 + | +LL | self.a(); //~ ERROR cannot infer + | ^^^^ +note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 11:9... + --> $DIR/issue-16683.rs:11:9 + | +LL | trait T<'a> { + | ^^ + = note: ...so that the types are compatible: + expected &'a Self + found &Self + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issue-16922.nll.stderr b/src/test/ui/issue-16922.nll.stderr new file mode 100644 index 00000000000..902baaf579f --- /dev/null +++ b/src/test/ui/issue-16922.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/issue-16922.rs:14:14 + | +LL | Box::new(value) as Box + | ^^^^^ + +error[E0621]: explicit lifetime required in the type of `value` + --> $DIR/issue-16922.rs:14:5 + | +LL | fn foo(value: &T) -> Box { + | ----- consider changing the type of `value` to `&'static T` +LL | Box::new(value) as Box + | ^^^^^^^^^^^^^^^ lifetime `'static` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-16922.rs b/src/test/ui/issue-16922.rs new file mode 100644 index 00000000000..1768c834cb3 --- /dev/null +++ b/src/test/ui/issue-16922.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::any::Any; + +fn foo(value: &T) -> Box { + Box::new(value) as Box + //~^ ERROR explicit lifetime required in the type of `value` [E0621] +} + +fn main() { + let _ = foo(&5); +} diff --git a/src/test/ui/issue-16922.stderr b/src/test/ui/issue-16922.stderr new file mode 100644 index 00000000000..cf81d4b4d08 --- /dev/null +++ b/src/test/ui/issue-16922.stderr @@ -0,0 +1,11 @@ +error[E0621]: explicit lifetime required in the type of `value` + --> $DIR/issue-16922.rs:14:5 + | +LL | fn foo(value: &T) -> Box { + | ----- consider changing the type of `value` to `&'static T` +LL | Box::new(value) as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/issue-16939.rs b/src/test/ui/issue-16939.rs new file mode 100644 index 00000000000..e16c58b8a6c --- /dev/null +++ b/src/test/ui/issue-16939.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure we don't ICE when making an overloaded call with the +// wrong arity. + +fn _foo (f: F) { + |t| f(t); //~ ERROR E0057 +} + +fn main() {} diff --git a/src/test/ui/issue-16939.stderr b/src/test/ui/issue-16939.stderr new file mode 100644 index 00000000000..23848049370 --- /dev/null +++ b/src/test/ui/issue-16939.stderr @@ -0,0 +1,9 @@ +error[E0057]: this function takes 0 parameters but 1 parameter was supplied + --> $DIR/issue-16939.rs:15:9 + | +LL | |t| f(t); //~ ERROR E0057 + | ^^^^ expected 0 parameters + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/issue-16966.rs b/src/test/ui/issue-16966.rs new file mode 100644 index 00000000000..ecf81c8af17 --- /dev/null +++ b/src/test/ui/issue-16966.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern:type annotations needed +fn main() { + panic!( + std::default::Default::default() + ); +} diff --git a/src/test/ui/issue-16966.stderr b/src/test/ui/issue-16966.stderr new file mode 100644 index 00000000000..f7129a6fe1b --- /dev/null +++ b/src/test/ui/issue-16966.stderr @@ -0,0 +1,13 @@ +error[E0282]: type annotations needed + --> $DIR/issue-16966.rs:13:5 + | +LL | / panic!( +LL | | std::default::Default::default() +LL | | ); + | |______^ cannot infer type for `M` + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-1697.rs b/src/test/ui/issue-1697.rs new file mode 100644 index 00000000000..f8a68264339 --- /dev/null +++ b/src/test/ui/issue-1697.rs @@ -0,0 +1,16 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Testing that we don't fail abnormally after hitting the errors + +use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] + //~^ Maybe a missing `extern crate unresolved;`? + +fn main() {} diff --git a/src/test/ui/issue-1697.stderr b/src/test/ui/issue-1697.stderr new file mode 100644 index 00000000000..28a7fbcaabe --- /dev/null +++ b/src/test/ui/issue-1697.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `unresolved` + --> $DIR/issue-1697.rs:13:5 + | +LL | use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] + | ^^^^^^^^^^ Maybe a missing `extern crate unresolved;`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-16994.rs b/src/test/ui/issue-16994.rs new file mode 100644 index 00000000000..ae4e8ce1df8 --- /dev/null +++ b/src/test/ui/issue-16994.rs @@ -0,0 +1,20 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +fn cb<'a,T>(_x: Box, bool))) -> T>) -> T { + panic!() +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b))); +} diff --git a/src/test/ui/issue-16994.stderr b/src/test/ui/issue-16994.stderr new file mode 100644 index 00000000000..8392b9da411 --- /dev/null +++ b/src/test/ui/issue-16994.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/issue-16994.rs:18:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b))); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-17001.rs b/src/test/ui/issue-17001.rs new file mode 100644 index 00000000000..413e8b464ff --- /dev/null +++ b/src/test/ui/issue-17001.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod foo {} + +fn main() { + let p = foo { x: () }; //~ ERROR expected struct, variant or union type, found module `foo` +} diff --git a/src/test/ui/issue-17001.stderr b/src/test/ui/issue-17001.stderr new file mode 100644 index 00000000000..a8e0cd8591b --- /dev/null +++ b/src/test/ui/issue-17001.stderr @@ -0,0 +1,9 @@ +error[E0574]: expected struct, variant or union type, found module `foo` + --> $DIR/issue-17001.rs:14:13 + | +LL | let p = foo { x: () }; //~ ERROR expected struct, variant or union type, found module `foo` + | ^^^ not a struct, variant or union type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/issue-17025.rs b/src/test/ui/issue-17025.rs new file mode 100644 index 00000000000..f250103b144 --- /dev/null +++ b/src/test/ui/issue-17025.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-test the unsized enum no longer compiles + +enum A { + B(char), + C([Box]), +} + +fn c(c:char) { + A::B(c); + //~^ ERROR cannot move a value of type A: the size of A cannot be statically determined +} + +pub fn main() {} diff --git a/src/test/ui/issue-17033.rs b/src/test/ui/issue-17033.rs new file mode 100644 index 00000000000..1cd43cbb0f8 --- /dev/null +++ b/src/test/ui/issue-17033.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn f<'r>(p: &'r mut fn(p: &mut ())) { + (*p)(()) //~ ERROR mismatched types + //~| expected type `&mut ()` + //~| found type `()` + //~| expected &mut (), found () +} + +fn main() {} diff --git a/src/test/ui/issue-17033.stderr b/src/test/ui/issue-17033.stderr new file mode 100644 index 00000000000..d6884f18881 --- /dev/null +++ b/src/test/ui/issue-17033.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-17033.rs:12:10 + | +LL | (*p)(()) //~ ERROR mismatched types + | ^^ + | | + | expected &mut (), found () + | help: consider mutably borrowing here: `&mut ()` + | + = note: expected type `&mut ()` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-17252.rs b/src/test/ui/issue-17252.rs new file mode 100644 index 00000000000..1c3e6890c8e --- /dev/null +++ b/src/test/ui/issue-17252.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const FOO: usize = FOO; //~ ERROR E0391 + +fn main() { + let _x: [u8; FOO]; // caused stack overflow prior to fix + let _y: usize = 1 + { + const BAR: usize = BAR; + let _z: [u8; BAR]; // caused stack overflow prior to fix + 1 + }; +} diff --git a/src/test/ui/issue-17252.stderr b/src/test/ui/issue-17252.stderr new file mode 100644 index 00000000000..8f97a841666 --- /dev/null +++ b/src/test/ui/issue-17252.stderr @@ -0,0 +1,16 @@ +error[E0391]: cycle detected when processing `FOO` + --> $DIR/issue-17252.rs:11:20 + | +LL | const FOO: usize = FOO; //~ ERROR E0391 + | ^^^ + | + = note: ...which again requires processing `FOO`, completing the cycle +note: cycle used when processing `main::{{constant}}` + --> $DIR/issue-17252.rs:14:18 + | +LL | let _x: [u8; FOO]; // caused stack overflow prior to fix + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-17337.rs b/src/test/ui/issue-17337.rs new file mode 100644 index 00000000000..1208321b529 --- /dev/null +++ b/src/test/ui/issue-17337.rs @@ -0,0 +1,27 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(staged_api)] +#![deny(deprecated)] + +#![unstable(feature = "test_feature", issue = "0")] + +struct Foo; + +impl Foo { + #[unstable(feature = "test_feature", issue = "0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + fn foo(self) {} +} + +fn main() { + Foo + .foo(); //~ ERROR use of deprecated item +} diff --git a/src/test/ui/issue-17337.stderr b/src/test/ui/issue-17337.stderr new file mode 100644 index 00000000000..03215473745 --- /dev/null +++ b/src/test/ui/issue-17337.stderr @@ -0,0 +1,14 @@ +error: use of deprecated item 'Foo::foo': text + --> $DIR/issue-17337.rs:26:6 + | +LL | .foo(); //~ ERROR use of deprecated item + | ^^^ + | +note: lint level defined here + --> $DIR/issue-17337.rs:12:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-17373.rs b/src/test/ui/issue-17373.rs new file mode 100644 index 00000000000..f6e6a8a0852 --- /dev/null +++ b/src/test/ui/issue-17373.rs @@ -0,0 +1,14 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + *return //~ ERROR type `!` cannot be dereferenced + ; +} diff --git a/src/test/ui/issue-17373.stderr b/src/test/ui/issue-17373.stderr new file mode 100644 index 00000000000..38e93e65bdc --- /dev/null +++ b/src/test/ui/issue-17373.stderr @@ -0,0 +1,9 @@ +error[E0614]: type `!` cannot be dereferenced + --> $DIR/issue-17373.rs:12:5 + | +LL | *return //~ ERROR type `!` cannot be dereferenced + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0614`. diff --git a/src/test/ui/issue-17385.nll.stderr b/src/test/ui/issue-17385.nll.stderr new file mode 100644 index 00000000000..c3387e58fcf --- /dev/null +++ b/src/test/ui/issue-17385.nll.stderr @@ -0,0 +1,77 @@ +error[E0382]: use of moved value: `foo` + --> $DIR/issue-17385.rs:28:5 + | +LL | drop(foo); + | --- value moved here +LL | / match foo { //~ ERROR use of moved value +LL | | X(1) => (), +LL | | _ => unreachable!() +LL | | } + | |_____^ value used here after move + | + = note: move occurs because `foo` has type `X`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `foo` + --> $DIR/issue-17385.rs:28:5 + | +LL | drop(foo); + | --- value moved here +LL | / match foo { //~ ERROR use of moved value +LL | | X(1) => (), +LL | | _ => unreachable!() +LL | | } + | |_____^ value borrowed here after move + | + = note: move occurs because `foo` has type `X`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `foo.0` + --> $DIR/issue-17385.rs:29:11 + | +LL | drop(foo); + | --- value moved here +LL | match foo { //~ ERROR use of moved value +LL | X(1) => (), + | ^ value used here after move + | + = note: move occurs because `foo` has type `X`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `e` + --> $DIR/issue-17385.rs:35:5 + | +LL | drop(e); + | - value moved here +LL | / match e { //~ ERROR use of moved value +LL | | Enum::Variant1 => unreachable!(), +LL | | Enum::Variant2 => () +LL | | } + | |_____^ value used here after move + | + = note: move occurs because `e` has type `Enum`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `e` + --> $DIR/issue-17385.rs:35:5 + | +LL | drop(e); + | - value moved here +LL | / match e { //~ ERROR use of moved value +LL | | Enum::Variant1 => unreachable!(), +LL | | Enum::Variant2 => () +LL | | } + | |_____^ value borrowed here after move + | + = note: move occurs because `e` has type `Enum`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `e` + --> $DIR/issue-17385.rs:36:9 + | +LL | drop(e); + | - value moved here +LL | match e { //~ ERROR use of moved value +LL | Enum::Variant1 => unreachable!(), + | ^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `e` has type `Enum`, which does not implement the `Copy` trait + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-17385.rs b/src/test/ui/issue-17385.rs new file mode 100644 index 00000000000..eb293c79247 --- /dev/null +++ b/src/test/ui/issue-17385.rs @@ -0,0 +1,39 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct X(isize); + +enum Enum { + Variant1, + Variant2 +} + +impl Drop for X { + fn drop(&mut self) {} +} +impl Drop for Enum { + fn drop(&mut self) {} +} + +fn main() { + let foo = X(1); + drop(foo); + match foo { //~ ERROR use of moved value + X(1) => (), + _ => unreachable!() + } + + let e = Enum::Variant2; + drop(e); + match e { //~ ERROR use of moved value + Enum::Variant1 => unreachable!(), + Enum::Variant2 => () + } +} diff --git a/src/test/ui/issue-17385.stderr b/src/test/ui/issue-17385.stderr new file mode 100644 index 00000000000..01d6d1a2720 --- /dev/null +++ b/src/test/ui/issue-17385.stderr @@ -0,0 +1,23 @@ +error[E0382]: use of moved value: `foo` + --> $DIR/issue-17385.rs:28:11 + | +LL | drop(foo); + | --- value moved here +LL | match foo { //~ ERROR use of moved value + | ^^^ value used here after move + | + = note: move occurs because `foo` has type `X`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `e` + --> $DIR/issue-17385.rs:35:11 + | +LL | drop(e); + | - value moved here +LL | match e { //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `e` has type `Enum`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-17405.rs b/src/test/ui/issue-17405.rs new file mode 100644 index 00000000000..5a6bd5ed588 --- /dev/null +++ b/src/test/ui/issue-17405.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + Bar(isize) +} + +fn main() { + match Foo::Bar(1) { + Foo { i } => () //~ ERROR expected struct, variant or union type, found enum `Foo` + } +} diff --git a/src/test/ui/issue-17405.stderr b/src/test/ui/issue-17405.stderr new file mode 100644 index 00000000000..bcccfd301b7 --- /dev/null +++ b/src/test/ui/issue-17405.stderr @@ -0,0 +1,9 @@ +error[E0574]: expected struct, variant or union type, found enum `Foo` + --> $DIR/issue-17405.rs:17:9 + | +LL | Foo { i } => () //~ ERROR expected struct, variant or union type, found enum `Foo` + | ^^^ not a struct, variant or union type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/issue-17431-1.rs b/src/test/ui/issue-17431-1.rs new file mode 100644 index 00000000000..260cc366fae --- /dev/null +++ b/src/test/ui/issue-17431-1.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo { foo: Option> } +//~^ ERROR recursive type `Foo` has infinite size + +impl Foo { fn bar(&self) {} } + +fn main() {} diff --git a/src/test/ui/issue-17431-1.stderr b/src/test/ui/issue-17431-1.stderr new file mode 100644 index 00000000000..fb27693c85e --- /dev/null +++ b/src/test/ui/issue-17431-1.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/issue-17431-1.rs:11:1 + | +LL | struct Foo { foo: Option> } + | ^^^^^^^^^^ ------------------------ recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17431-2.rs b/src/test/ui/issue-17431-2.rs new file mode 100644 index 00000000000..f39fb0e31c6 --- /dev/null +++ b/src/test/ui/issue-17431-2.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Baz { q: Option } +//~^ ERROR recursive type `Baz` has infinite size + +struct Foo { q: Option } +//~^ ERROR recursive type `Foo` has infinite size + +impl Foo { fn bar(&self) {} } + +fn main() {} diff --git a/src/test/ui/issue-17431-2.stderr b/src/test/ui/issue-17431-2.stderr new file mode 100644 index 00000000000..7e87babe93e --- /dev/null +++ b/src/test/ui/issue-17431-2.stderr @@ -0,0 +1,23 @@ +error[E0072]: recursive type `Baz` has infinite size + --> $DIR/issue-17431-2.rs:11:1 + | +LL | struct Baz { q: Option } + | ^^^^^^^^^^ -------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Baz` representable + +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/issue-17431-2.rs:14:1 + | +LL | struct Foo { q: Option } + | ^^^^^^^^^^ -------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17431-3.rs b/src/test/ui/issue-17431-3.rs new file mode 100644 index 00000000000..9ba085591f0 --- /dev/null +++ b/src/test/ui/issue-17431-3.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::sync::Mutex; + +struct Foo { foo: Mutex> } +//~^ ERROR recursive type `Foo` has infinite size + +impl Foo { fn bar(&self) {} } + +fn main() {} diff --git a/src/test/ui/issue-17431-3.stderr b/src/test/ui/issue-17431-3.stderr new file mode 100644 index 00000000000..c12a4c11c2c --- /dev/null +++ b/src/test/ui/issue-17431-3.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/issue-17431-3.rs:13:1 + | +LL | struct Foo { foo: Mutex> } + | ^^^^^^^^^^ ----------------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17431-4.rs b/src/test/ui/issue-17431-4.rs new file mode 100644 index 00000000000..665c3cf8fe6 --- /dev/null +++ b/src/test/ui/issue-17431-4.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::marker; + +struct Foo { foo: Option>>, marker: marker::PhantomData } +//~^ ERROR recursive type `Foo` has infinite size + +impl Foo { fn bar(&self) {} } + +fn main() {} diff --git a/src/test/ui/issue-17431-4.stderr b/src/test/ui/issue-17431-4.stderr new file mode 100644 index 00000000000..acfd688b622 --- /dev/null +++ b/src/test/ui/issue-17431-4.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/issue-17431-4.rs:13:1 + | +LL | struct Foo { foo: Option>>, marker: marker::PhantomData } + | ^^^^^^^^^^^^^ --------------------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17431-5.rs b/src/test/ui/issue-17431-5.rs new file mode 100644 index 00000000000..85ed4d5d634 --- /dev/null +++ b/src/test/ui/issue-17431-5.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::marker; + +struct Foo { foo: Bar } + +struct Bar { x: Bar , marker: marker::PhantomData } +//~^ ERROR recursive type `Bar` has infinite size + +impl Foo { fn foo(&self) {} } + +fn main() { +} diff --git a/src/test/ui/issue-17431-5.stderr b/src/test/ui/issue-17431-5.stderr new file mode 100644 index 00000000000..ddfea58a857 --- /dev/null +++ b/src/test/ui/issue-17431-5.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Bar` has infinite size + --> $DIR/issue-17431-5.rs:15:1 + | +LL | struct Bar { x: Bar , marker: marker::PhantomData } + | ^^^^^^^^^^^^^ ----------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17431-6.rs b/src/test/ui/issue-17431-6.rs new file mode 100644 index 00000000000..4c1e82c3d6a --- /dev/null +++ b/src/test/ui/issue-17431-6.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::sync::Mutex; + +enum Foo { X(Mutex>) } +//~^ ERROR recursive type `Foo` has infinite size + +impl Foo { fn bar(self) {} } + +fn main() {} diff --git a/src/test/ui/issue-17431-6.stderr b/src/test/ui/issue-17431-6.stderr new file mode 100644 index 00000000000..ab2cc439f17 --- /dev/null +++ b/src/test/ui/issue-17431-6.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/issue-17431-6.rs:13:1 + | +LL | enum Foo { X(Mutex>) } + | ^^^^^^^^ ------------------ recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17431-7.rs b/src/test/ui/issue-17431-7.rs new file mode 100644 index 00000000000..71b85da29fc --- /dev/null +++ b/src/test/ui/issue-17431-7.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { Voo(Option>) } +//~^ ERROR recursive type `Foo` has infinite size + +impl Foo { fn bar(&self) {} } + +fn main() { } diff --git a/src/test/ui/issue-17431-7.stderr b/src/test/ui/issue-17431-7.stderr new file mode 100644 index 00000000000..7f9118860b9 --- /dev/null +++ b/src/test/ui/issue-17431-7.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/issue-17431-7.rs:11:1 + | +LL | enum Foo { Voo(Option>) } + | ^^^^^^^^ ------------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-17444.rs b/src/test/ui/issue-17444.rs new file mode 100644 index 00000000000..dafcff23838 --- /dev/null +++ b/src/test/ui/issue-17444.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Test { + Foo = 0 +} + +fn main() { + let _x = Test::Foo as *const isize; + //~^ ERROR casting `Test` as `*const isize` is invalid +} diff --git a/src/test/ui/issue-17444.stderr b/src/test/ui/issue-17444.stderr new file mode 100644 index 00000000000..3f87d806e7e --- /dev/null +++ b/src/test/ui/issue-17444.stderr @@ -0,0 +1,9 @@ +error[E0606]: casting `Test` as `*const isize` is invalid + --> $DIR/issue-17444.rs:16:14 + | +LL | let _x = Test::Foo as *const isize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/ui/issue-17458.rs b/src/test/ui/issue-17458.rs new file mode 100644 index 00000000000..f5b7a0c13b7 --- /dev/null +++ b/src/test/ui/issue-17458.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +static X: usize = 0 as *const usize as usize; +//~^ ERROR: raw pointers cannot be cast to integers in statics + +fn main() { + assert_eq!(X, 0); +} diff --git a/src/test/ui/issue-17458.stderr b/src/test/ui/issue-17458.stderr new file mode 100644 index 00000000000..7a43813fa6d --- /dev/null +++ b/src/test/ui/issue-17458.stderr @@ -0,0 +1,9 @@ +error[E0018]: raw pointers cannot be cast to integers in statics + --> $DIR/issue-17458.rs:11:19 + | +LL | static X: usize = 0 as *const usize as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0018`. diff --git a/src/test/ui/issue-17545.nll.stderr b/src/test/ui/issue-17545.nll.stderr new file mode 100644 index 00000000000..50a4b3f7f3e --- /dev/null +++ b/src/test/ui/issue-17545.nll.stderr @@ -0,0 +1,17 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-17545.rs:17:10 + | +LL | &id(()), //~ ERROR borrowed value does not live long enough + | ^^^^^^ temporary value does not live long enough +LL | )); + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 15:12... + --> $DIR/issue-17545.rs:15:12 + | +LL | pub fn foo<'a, F: Fn(&'a ())>(bar: F) { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-17545.rs b/src/test/ui/issue-17545.rs new file mode 100644 index 00000000000..9264305e6ea --- /dev/null +++ b/src/test/ui/issue-17545.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(fn_traits)] + +fn id(x: T) -> T { x } + +pub fn foo<'a, F: Fn(&'a ())>(bar: F) { + bar.call(( + &id(()), //~ ERROR borrowed value does not live long enough + )); +} +fn main() {} diff --git a/src/test/ui/issue-17545.stderr b/src/test/ui/issue-17545.stderr new file mode 100644 index 00000000000..ce698665583 --- /dev/null +++ b/src/test/ui/issue-17545.stderr @@ -0,0 +1,18 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-17545.rs:17:10 + | +LL | &id(()), //~ ERROR borrowed value does not live long enough + | ^^^^^^ temporary value does not live long enough +LL | )); + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 15:12... + --> $DIR/issue-17545.rs:15:12 + | +LL | pub fn foo<'a, F: Fn(&'a ())>(bar: F) { + | ^^ + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-17546.rs b/src/test/ui/issue-17546.rs new file mode 100644 index 00000000000..fe125b973d9 --- /dev/null +++ b/src/test/ui/issue-17546.rs @@ -0,0 +1,50 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use foo::MyEnum::Result; +use foo::NoResult; // Through a re-export + +mod foo { + pub use self::MyEnum::NoResult; + + pub enum MyEnum { + Result, + NoResult + } + + fn new() -> NoResult { + //~^ ERROR expected type, found variant `NoResult` + unimplemented!() + } +} + +mod bar { + use foo::MyEnum::Result; + use foo; + + fn new() -> Result { + //~^ ERROR expected type, found variant `Result` + unimplemented!() + } +} + +fn new() -> Result { + //~^ ERROR expected type, found variant `Result` + unimplemented!() +} + +fn newer() -> NoResult { + //~^ ERROR expected type, found variant `NoResult` + unimplemented!() +} + +fn main() { + let _ = new(); +} diff --git a/src/test/ui/issue-17546.stderr b/src/test/ui/issue-17546.stderr new file mode 100644 index 00000000000..39f7d5fcc04 --- /dev/null +++ b/src/test/ui/issue-17546.stderr @@ -0,0 +1,55 @@ +error[E0573]: expected type, found variant `NoResult` + --> $DIR/issue-17546.rs:22:17 + | +LL | fn new() -> NoResult { + | --------^^^^^^^^^^^^^^^^ + | | + | did you mean `Result`? + | help: you can try using the variant's enum: `foo::MyEnum` + +error[E0573]: expected type, found variant `Result` + --> $DIR/issue-17546.rs:32:17 + | +LL | fn new() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use std::fmt::Result; + | +LL | use std::io::Result; + | +LL | use std::prelude::v1::Result; + | +LL | use std::result::Result; + | +and 1 other candidates + +error[E0573]: expected type, found variant `Result` + --> $DIR/issue-17546.rs:38:13 + | +LL | fn new() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use std::fmt::Result; + | +LL | use std::io::Result; + | +LL | use std::prelude::v1::Result; + | +LL | use std::result::Result; + | +and 1 other candidates + +error[E0573]: expected type, found variant `NoResult` + --> $DIR/issue-17546.rs:43:15 + | +LL | fn newer() -> NoResult { + | --------^^^^^^^^^^^^^^^^^^^^^ + | | + | did you mean `Result`? + | help: you can try using the variant's enum: `foo::MyEnum` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/ui/issue-17551.rs b/src/test/ui/issue-17551.rs new file mode 100644 index 00000000000..b55863f0dda --- /dev/null +++ b/src/test/ui/issue-17551.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::marker; + +struct B(marker::PhantomData); + +fn main() { + let foo = B(marker::PhantomData); //~ ERROR type annotations needed + let closure = || foo; +} diff --git a/src/test/ui/issue-17551.stderr b/src/test/ui/issue-17551.stderr new file mode 100644 index 00000000000..0cdee0337d8 --- /dev/null +++ b/src/test/ui/issue-17551.stderr @@ -0,0 +1,11 @@ +error[E0282]: type annotations needed + --> $DIR/issue-17551.rs:16:15 + | +LL | let foo = B(marker::PhantomData); //~ ERROR type annotations needed + | --- ^ cannot infer type for `T` + | | + | consider giving `foo` a type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-17651.rs b/src/test/ui/issue-17651.rs new file mode 100644 index 00000000000..cbd0da4b53c --- /dev/null +++ b/src/test/ui/issue-17651.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that moves of unsized values within closures are caught +// and rejected. + +fn main() { + (|| Box::new(*(&[0][..])))(); + //~^ ERROR the size for values of type +} diff --git a/src/test/ui/issue-17651.stderr b/src/test/ui/issue-17651.stderr new file mode 100644 index 00000000000..d21b3060315 --- /dev/null +++ b/src/test/ui/issue-17651.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time + --> $DIR/issue-17651.rs:15:9 + | +LL | (|| Box::new(*(&[0][..])))(); + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[{integer}]` + = note: to learn more, visit + = note: required by `>::new` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-17718-const-bad-values.rs b/src/test/ui/issue-17718-const-bad-values.rs new file mode 100644 index 00000000000..17ec77d77ee --- /dev/null +++ b/src/test/ui/issue-17718-const-bad-values.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const C1: &'static mut [usize] = &mut []; +//~^ ERROR: references in constants may only refer to immutable values + +static mut S: usize = 3; +const C2: &'static mut usize = unsafe { &mut S }; +//~^ ERROR: constants cannot refer to statics +//~| ERROR: references in constants may only refer to immutable values +//~| ERROR: references in constants may only refer to immutable values + +fn main() {} diff --git a/src/test/ui/issue-17718-const-bad-values.stderr b/src/test/ui/issue-17718-const-bad-values.stderr new file mode 100644 index 00000000000..0ab7f965b63 --- /dev/null +++ b/src/test/ui/issue-17718-const-bad-values.stderr @@ -0,0 +1,28 @@ +error[E0017]: references in constants may only refer to immutable values + --> $DIR/issue-17718-const-bad-values.rs:11:34 + | +LL | const C1: &'static mut [usize] = &mut []; + | ^^^^^^^ constants require immutable values + +error[E0013]: constants cannot refer to statics, use a constant instead + --> $DIR/issue-17718-const-bad-values.rs:15:41 + | +LL | const C2: &'static mut usize = unsafe { &mut S }; + | ^^^^^^ + +error[E0017]: references in constants may only refer to immutable values + --> $DIR/issue-17718-const-bad-values.rs:15:41 + | +LL | const C2: &'static mut usize = unsafe { &mut S }; + | ^^^^^^ constants require immutable values + +error[E0017]: references in constants may only refer to immutable values + --> $DIR/issue-17718-const-bad-values.rs:15:32 + | +LL | const C2: &'static mut usize = unsafe { &mut S }; + | ^^^^^^^^^^^^^^^^^ constants require immutable values + +error: aborting due to 4 previous errors + +Some errors occurred: E0013, E0017. +For more information about an error, try `rustc --explain E0013`. diff --git a/src/test/ui/issue-17718-const-borrow.rs b/src/test/ui/issue-17718-const-borrow.rs new file mode 100644 index 00000000000..07123c69492 --- /dev/null +++ b/src/test/ui/issue-17718-const-borrow.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::cell::UnsafeCell; + +const A: UnsafeCell = UnsafeCell::new(1); +const B: &'static UnsafeCell = &A; +//~^ ERROR: cannot borrow a constant which may contain interior mutability + +struct C { a: UnsafeCell } +const D: C = C { a: UnsafeCell::new(1) }; +const E: &'static UnsafeCell = &D.a; +//~^ ERROR: cannot borrow a constant which may contain interior mutability +const F: &'static C = &D; +//~^ ERROR: cannot borrow a constant which may contain interior mutability + +fn main() {} diff --git a/src/test/ui/issue-17718-const-borrow.stderr b/src/test/ui/issue-17718-const-borrow.stderr new file mode 100644 index 00000000000..3b0217060f7 --- /dev/null +++ b/src/test/ui/issue-17718-const-borrow.stderr @@ -0,0 +1,21 @@ +error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead + --> $DIR/issue-17718-const-borrow.rs:14:39 + | +LL | const B: &'static UnsafeCell = &A; + | ^^ + +error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead + --> $DIR/issue-17718-const-borrow.rs:19:39 + | +LL | const E: &'static UnsafeCell = &D.a; + | ^^^^ + +error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead + --> $DIR/issue-17718-const-borrow.rs:21:23 + | +LL | const F: &'static C = &D; + | ^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0492`. diff --git a/src/test/ui/issue-17718-const-naming.rs b/src/test/ui/issue-17718-const-naming.rs new file mode 100644 index 00000000000..4857c2fb446 --- /dev/null +++ b/src/test/ui/issue-17718-const-naming.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![warn(unused)] +#[deny(warnings)] + +const foo: isize = 3; +//~^ ERROR: should have an upper case name such as +//~^^ ERROR: constant item is never used + +fn main() {} diff --git a/src/test/ui/issue-17718-const-naming.stderr b/src/test/ui/issue-17718-const-naming.stderr new file mode 100644 index 00000000000..9636db31390 --- /dev/null +++ b/src/test/ui/issue-17718-const-naming.stderr @@ -0,0 +1,28 @@ +error: constant item is never used: `foo` + --> $DIR/issue-17718-const-naming.rs:14:1 + | +LL | const foo: isize = 3; + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-17718-const-naming.rs:12:8 + | +LL | #[deny(warnings)] + | ^^^^^^^^ + = note: #[deny(dead_code)] implied by #[deny(warnings)] + +error: constant `foo` should have an upper case name such as `FOO` + --> $DIR/issue-17718-const-naming.rs:14:1 + | +LL | const foo: isize = 3; + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-17718-const-naming.rs:12:8 + | +LL | #[deny(warnings)] + | ^^^^^^^^ + = note: #[deny(non_upper_case_globals)] implied by #[deny(warnings)] + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-17718-constants-not-static.rs b/src/test/ui/issue-17718-constants-not-static.rs new file mode 100644 index 00000000000..9b7ed463499 --- /dev/null +++ b/src/test/ui/issue-17718-constants-not-static.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn id(x: T) -> T { x } + +const FOO: usize = 3; + +fn foo() -> &'static usize { &id(FOO) } +//~^ ERROR: borrowed value does not live long enough + +fn main() { +} diff --git a/src/test/ui/issue-17718-constants-not-static.stderr b/src/test/ui/issue-17718-constants-not-static.stderr new file mode 100644 index 00000000000..61d8399aba9 --- /dev/null +++ b/src/test/ui/issue-17718-constants-not-static.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-17718-constants-not-static.rs:15:31 + | +LL | fn foo() -> &'static usize { &id(FOO) } + | ^^^^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-17718-patterns.rs b/src/test/ui/issue-17718-patterns.rs new file mode 100644 index 00000000000..b9f5e98b6fa --- /dev/null +++ b/src/test/ui/issue-17718-patterns.rs @@ -0,0 +1,22 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +static A1: usize = 1; +static mut A2: usize = 1; +const A3: usize = 1; + +fn main() { + match 1 { + A1 => {} //~ ERROR: match bindings cannot shadow statics + A2 => {} //~ ERROR: match bindings cannot shadow statics + A3 => {} + _ => {} + } +} diff --git a/src/test/ui/issue-17718-patterns.stderr b/src/test/ui/issue-17718-patterns.stderr new file mode 100644 index 00000000000..13cab9a08b1 --- /dev/null +++ b/src/test/ui/issue-17718-patterns.stderr @@ -0,0 +1,21 @@ +error[E0530]: match bindings cannot shadow statics + --> $DIR/issue-17718-patterns.rs:17:9 + | +LL | static A1: usize = 1; + | --------------------- a static `A1` is defined here +... +LL | A1 => {} //~ ERROR: match bindings cannot shadow statics + | ^^ cannot be named the same as a static + +error[E0530]: match bindings cannot shadow statics + --> $DIR/issue-17718-patterns.rs:18:9 + | +LL | static mut A2: usize = 1; + | ------------------------- a static `A2` is defined here +... +LL | A2 => {} //~ ERROR: match bindings cannot shadow statics + | ^^ cannot be named the same as a static + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/ui/issue-17718-references.rs b/src/test/ui/issue-17718-references.rs new file mode 100644 index 00000000000..586cfebcd16 --- /dev/null +++ b/src/test/ui/issue-17718-references.rs @@ -0,0 +1,34 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(warnings)] + +struct Struct { a: usize } + +const C: usize = 1; +static S: usize = 1; + +const T1: &'static usize = &C; +const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics +static T3: &'static usize = &C; +static T4: &'static usize = &S; + +const T5: usize = C; +const T6: usize = S; //~ ERROR: constants cannot refer to statics +static T7: usize = C; +static T8: usize = S; + +const T9: Struct = Struct { a: C }; +const T10: Struct = Struct { a: S }; +//~^ ERROR: constants cannot refer to statics +static T11: Struct = Struct { a: C }; +static T12: Struct = Struct { a: S }; + +fn main() {} diff --git a/src/test/ui/issue-17718-references.stderr b/src/test/ui/issue-17718-references.stderr new file mode 100644 index 00000000000..6e89a83b308 --- /dev/null +++ b/src/test/ui/issue-17718-references.stderr @@ -0,0 +1,21 @@ +error[E0013]: constants cannot refer to statics, use a constant instead + --> $DIR/issue-17718-references.rs:19:28 + | +LL | const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics + | ^^ + +error[E0013]: constants cannot refer to statics, use a constant instead + --> $DIR/issue-17718-references.rs:24:19 + | +LL | const T6: usize = S; //~ ERROR: constants cannot refer to statics + | ^ + +error[E0013]: constants cannot refer to statics, use a constant instead + --> $DIR/issue-17718-references.rs:29:33 + | +LL | const T10: Struct = Struct { a: S }; + | ^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0013`. diff --git a/src/test/ui/issue-17718-static-move.rs b/src/test/ui/issue-17718-static-move.rs new file mode 100644 index 00000000000..a5a7117956f --- /dev/null +++ b/src/test/ui/issue-17718-static-move.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; +const INIT: Foo = Foo; +static FOO: Foo = INIT; + +fn main() { + let _a = FOO; //~ ERROR: cannot move out of static item +} diff --git a/src/test/ui/issue-17718-static-move.stderr b/src/test/ui/issue-17718-static-move.stderr new file mode 100644 index 00000000000..a6384cfce8f --- /dev/null +++ b/src/test/ui/issue-17718-static-move.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of static item + --> $DIR/issue-17718-static-move.rs:16:14 + | +LL | let _a = FOO; //~ ERROR: cannot move out of static item + | ^^^ + | | + | cannot move out of static item + | help: consider using a reference instead: `&FOO` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/issue-17718-static-sync.rs b/src/test/ui/issue-17718-static-sync.rs new file mode 100644 index 00000000000..c5349d4e82b --- /dev/null +++ b/src/test/ui/issue-17718-static-sync.rs @@ -0,0 +1,22 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(optin_builtin_traits)] + +use std::marker::Sync; + +struct Foo; +impl !Sync for Foo {} + +static FOO: usize = 3; +static BAR: Foo = Foo; +//~^ ERROR: `Foo` cannot be shared between threads safely [E0277] + +fn main() {} diff --git a/src/test/ui/issue-17718-static-sync.stderr b/src/test/ui/issue-17718-static-sync.stderr new file mode 100644 index 00000000000..d6816826a00 --- /dev/null +++ b/src/test/ui/issue-17718-static-sync.stderr @@ -0,0 +1,12 @@ +error[E0277]: `Foo` cannot be shared between threads safely + --> $DIR/issue-17718-static-sync.rs:19:1 + | +LL | static BAR: Foo = Foo; + | ^^^^^^^^^^^^^^^^^^^^^^ `Foo` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `Foo` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-17728.nll.stderr b/src/test/ui/issue-17728.nll.stderr new file mode 100644 index 00000000000..b9931e45bd2 --- /dev/null +++ b/src/test/ui/issue-17728.nll.stderr @@ -0,0 +1,25 @@ +warning: not reporting region error due to nll + --> $DIR/issue-17728.rs:23:49 + | +LL | let maybe_room = room.direction_to_room.get(&direction); + | ^^^ + +error[E0308]: match arms have incompatible types + --> $DIR/issue-17728.rs:110:5 + | +LL | / match to_parse { //~ ERROR match arms have incompatible types +LL | | "w" | "west" => RoomDirection::West, +LL | | "e" | "east" => RoomDirection::East, +LL | | "n" | "north" => RoomDirection::North, +... | +LL | | _ => None + | | ---- match arm with an incompatible type +LL | | } + | |_____^ expected enum `RoomDirection`, found enum `std::option::Option` + | + = note: expected type `RoomDirection` + found type `std::option::Option<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-17728.rs b/src/test/ui/issue-17728.rs new file mode 100644 index 00000000000..8516a8ea52e --- /dev/null +++ b/src/test/ui/issue-17728.rs @@ -0,0 +1,132 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::fmt::{Debug, Formatter, Error}; +use std::collections::HashMap; + +trait HasInventory { + fn getInventory<'s>(&'s self) -> &'s mut Inventory; + fn addToInventory(&self, item: &Item); + fn removeFromInventory(&self, itemName: &str) -> bool; +} + +trait TraversesWorld { + fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> { + let direction = str_to_direction(directionStr); + let maybe_room = room.direction_to_room.get(&direction); + match maybe_room { + Some(entry) => Ok(entry), + //~^ ERROR 25:28: 25:37: lifetime mismatch [E0623] + _ => Err("Direction does not exist in room.") + } + } +} + + +#[derive(Debug, Eq, PartialEq, Hash)] +enum RoomDirection { + West, + East, + North, + South, + Up, + Down, + In, + Out, + + None +} + +struct Room { + description: String, + items: Vec, + direction_to_room: HashMap, +} + +impl Room { + fn new(description: &'static str) -> Room { + Room { + description: description.to_string(), + items: Vec::new(), + direction_to_room: HashMap::new() + } + } + + fn add_direction(&mut self, direction: RoomDirection, room: Room) { + self.direction_to_room.insert(direction, room); + } +} + +struct Item { + name: String, +} + +struct Inventory { + items: Vec, +} + +impl Inventory { + fn new() -> Inventory { + Inventory { + items: Vec::new() + } + } +} + +struct Player { + name: String, + inventory: Inventory, +} + +impl Player { + fn new(name: &'static str) -> Player { + Player { + name: name.to_string(), + inventory: Inventory::new() + } + } +} + +impl TraversesWorld for Player { +} + +impl Debug for Player { + fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> { + formatter.write_str("Player{ name:"); + formatter.write_str(&self.name); + formatter.write_str(" }"); + Ok(()) + } +} + +fn str_to_direction(to_parse: &str) -> RoomDirection { + match to_parse { //~ ERROR match arms have incompatible types + "w" | "west" => RoomDirection::West, + "e" | "east" => RoomDirection::East, + "n" | "north" => RoomDirection::North, + "s" | "south" => RoomDirection::South, + "in" => RoomDirection::In, + "out" => RoomDirection::Out, + "up" => RoomDirection::Up, + "down" => RoomDirection::Down, + _ => None + } +} + +fn main() { + let mut player = Player::new("Test player"); + let mut room = Room::new("A test room"); + println!("Made a player: {:?}", player); + println!("Direction parse: {:?}", str_to_direction("east")); + match player.attemptTraverse(&room, "west") { + Ok(_) => println!("Was able to move west"), + Err(msg) => println!("Not able to move west: {}", msg) + }; +} diff --git a/src/test/ui/issue-17728.stderr b/src/test/ui/issue-17728.stderr new file mode 100644 index 00000000000..e46c48c4c39 --- /dev/null +++ b/src/test/ui/issue-17728.stderr @@ -0,0 +1,31 @@ +error[E0623]: lifetime mismatch + --> $DIR/issue-17728.rs:25:28 + | +LL | fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> { + | ----- ------------------- + | | + | this parameter and the return type are declared with different lifetimes... +... +LL | Some(entry) => Ok(entry), + | ^^^^^^^^^ ...but data from `room` is returned here + +error[E0308]: match arms have incompatible types + --> $DIR/issue-17728.rs:110:5 + | +LL | / match to_parse { //~ ERROR match arms have incompatible types +LL | | "w" | "west" => RoomDirection::West, +LL | | "e" | "east" => RoomDirection::East, +LL | | "n" | "north" => RoomDirection::North, +... | +LL | | _ => None + | | ---- match arm with an incompatible type +LL | | } + | |_____^ expected enum `RoomDirection`, found enum `std::option::Option` + | + = note: expected type `RoomDirection` + found type `std::option::Option<_>` + +error: aborting due to 2 previous errors + +Some errors occurred: E0308, E0623. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-17740.rs b/src/test/ui/issue-17740.rs new file mode 100644 index 00000000000..1d5ef4360dc --- /dev/null +++ b/src/test/ui/issue-17740.rs @@ -0,0 +1,28 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo<'a> { + data: &'a[u8], +} + +impl <'a> Foo<'a>{ + fn bar(self: &mut Foo) { + //~^ mismatched method receiver + //~| expected type `Foo<'a>` + //~| found type `Foo<'_>` + //~| lifetime mismatch + //~| mismatched method receiver + //~| expected type `Foo<'a>` + //~| found type `Foo<'_>` + //~| lifetime mismatch + } +} + +fn main() {} diff --git a/src/test/ui/issue-17740.stderr b/src/test/ui/issue-17740.stderr new file mode 100644 index 00000000000..e4f5485953c --- /dev/null +++ b/src/test/ui/issue-17740.stderr @@ -0,0 +1,53 @@ +error[E0308]: mismatched method receiver + --> $DIR/issue-17740.rs:16:18 + | +LL | fn bar(self: &mut Foo) { + | ^^^^^^^^ lifetime mismatch + | + = note: expected type `Foo<'a>` + found type `Foo<'_>` +note: the anonymous lifetime #2 defined on the method body at 16:5... + --> $DIR/issue-17740.rs:16:5 + | +LL | / fn bar(self: &mut Foo) { +LL | | //~^ mismatched method receiver +LL | | //~| expected type `Foo<'a>` +LL | | //~| found type `Foo<'_>` +... | +LL | | //~| lifetime mismatch +LL | | } + | |_____^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 15:7 + --> $DIR/issue-17740.rs:15:7 + | +LL | impl <'a> Foo<'a>{ + | ^^ + +error[E0308]: mismatched method receiver + --> $DIR/issue-17740.rs:16:18 + | +LL | fn bar(self: &mut Foo) { + | ^^^^^^^^ lifetime mismatch + | + = note: expected type `Foo<'a>` + found type `Foo<'_>` +note: the lifetime 'a as defined on the impl at 15:7... + --> $DIR/issue-17740.rs:15:7 + | +LL | impl <'a> Foo<'a>{ + | ^^ +note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 16:5 + --> $DIR/issue-17740.rs:16:5 + | +LL | / fn bar(self: &mut Foo) { +LL | | //~^ mismatched method receiver +LL | | //~| expected type `Foo<'a>` +LL | | //~| found type `Foo<'_>` +... | +LL | | //~| lifetime mismatch +LL | | } + | |_____^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-17758.nll.stderr b/src/test/ui/issue-17758.nll.stderr new file mode 100644 index 00000000000..124fc6f0b39 --- /dev/null +++ b/src/test/ui/issue-17758.nll.stderr @@ -0,0 +1,22 @@ +warning: not reporting region error due to nll + --> $DIR/issue-17758.rs:17:9 + | +LL | self.foo(); + | ^^^^ + +warning: not reporting region error due to nll + --> $DIR/issue-17758.rs:17:14 + | +LL | self.foo(); + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/issue-17758.rs:17:9 + | +LL | fn bar(&self) { + | - let's call the lifetime of this reference `'1` +LL | self.foo(); + | ^^^^^^^^^^ argument requires that `'1` must outlive `'a` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-17758.rs b/src/test/ui/issue-17758.rs new file mode 100644 index 00000000000..a47f5c16a46 --- /dev/null +++ b/src/test/ui/issue-17758.rs @@ -0,0 +1,22 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that regionck suggestions in a provided method of a trait +// don't ICE + +trait Foo<'a> { + fn foo(&'a self); + fn bar(&self) { + self.foo(); + //~^ ERROR cannot infer + } +} + +fn main() {} diff --git a/src/test/ui/issue-17758.stderr b/src/test/ui/issue-17758.stderr new file mode 100644 index 00000000000..3d78b2e2d7f --- /dev/null +++ b/src/test/ui/issue-17758.stderr @@ -0,0 +1,31 @@ +error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements + --> $DIR/issue-17758.rs:17:14 + | +LL | self.foo(); + | ^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5... + --> $DIR/issue-17758.rs:16:5 + | +LL | / fn bar(&self) { +LL | | self.foo(); +LL | | //~^ ERROR cannot infer +LL | | } + | |_____^ +note: ...so that reference does not outlive borrowed content + --> $DIR/issue-17758.rs:17:9 + | +LL | self.foo(); + | ^^^^ +note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 14:11... + --> $DIR/issue-17758.rs:14:11 + | +LL | trait Foo<'a> { + | ^^ + = note: ...so that the types are compatible: + expected &'a Self + found &Self + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issue-17800.rs b/src/test/ui/issue-17800.rs new file mode 100644 index 00000000000..f7cae91aa93 --- /dev/null +++ b/src/test/ui/issue-17800.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum MyOption { + MySome(T), + MyNone, +} + +fn main() { + match MyOption::MySome(42) { + MyOption::MySome { x: 42 } => (), + //~^ ERROR variant `MyOption::MySome` does not have a field named `x` + //~| ERROR pattern does not mention field `0` + _ => (), + } +} diff --git a/src/test/ui/issue-17800.stderr b/src/test/ui/issue-17800.stderr new file mode 100644 index 00000000000..2cc562fbd7a --- /dev/null +++ b/src/test/ui/issue-17800.stderr @@ -0,0 +1,18 @@ +error[E0026]: variant `MyOption::MySome` does not have a field named `x` + --> $DIR/issue-17800.rs:18:28 + | +LL | MyOption::MySome { x: 42 } => (), + | ^^^^^ variant `MyOption::MySome` does not have this field + +error[E0027]: pattern does not mention field `0` + --> $DIR/issue-17800.rs:18:9 + | +LL | MyOption::MySome { x: 42 } => (), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing field `0` + | + = note: trying to match a tuple variant with a struct variant pattern + +error: aborting due to 2 previous errors + +Some errors occurred: E0026, E0027. +For more information about an error, try `rustc --explain E0026`. diff --git a/src/test/ui/issue-17904-2.rs b/src/test/ui/issue-17904-2.rs new file mode 100644 index 00000000000..a15ccb71aa7 --- /dev/null +++ b/src/test/ui/issue-17904-2.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that we can parse a unit struct with a where clause, even if +// it leads to an error later on since `T` is unused. + +struct Foo where T: Copy; //~ ERROR parameter `T` is never used + +fn main() {} diff --git a/src/test/ui/issue-17904-2.stderr b/src/test/ui/issue-17904-2.stderr new file mode 100644 index 00000000000..00013d4d52b --- /dev/null +++ b/src/test/ui/issue-17904-2.stderr @@ -0,0 +1,11 @@ +error[E0392]: parameter `T` is never used + --> $DIR/issue-17904-2.rs:14:12 + | +LL | struct Foo where T: Copy; //~ ERROR parameter `T` is never used + | ^ unused type parameter + | + = help: consider removing `T` or using a marker such as `std::marker::PhantomData` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/issue-17905.rs b/src/test/ui/issue-17905.rs new file mode 100644 index 00000000000..f11d482ea16 --- /dev/null +++ b/src/test/ui/issue-17905.rs @@ -0,0 +1,26 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Debug)] +struct Pair (T, V); + +impl Pair< + &str, //~ ERROR missing lifetime specifier + isize +> { + fn say(self: &Pair<&str, isize>) { + println!("{}", self); + } +} + +fn main() { + let result = &Pair("shane", 1); + result.say(); +} diff --git a/src/test/ui/issue-17905.stderr b/src/test/ui/issue-17905.stderr new file mode 100644 index 00000000000..1a7aba17480 --- /dev/null +++ b/src/test/ui/issue-17905.stderr @@ -0,0 +1,9 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-17905.rs:15:5 + | +LL | &str, //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/issue-17913.rs b/src/test/ui/issue-17913.rs new file mode 100644 index 00000000000..80e5f2b6e21 --- /dev/null +++ b/src/test/ui/issue-17913.rs @@ -0,0 +1,28 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +// error-pattern: too big for the current architecture + +#![feature(box_syntax)] + +#[cfg(target_pointer_width = "64")] +fn main() { + let n = 0_usize; + let a: Box<_> = box [&n; 0xF000000000000000_usize]; + println!("{}", a[0xFFFFFF_usize]); +} + +#[cfg(target_pointer_width = "32")] +fn main() { + let n = 0_usize; + let a: Box<_> = box [&n; 0xFFFFFFFF_usize]; + println!("{}", a[0xFFFFFF_usize]); +} diff --git a/src/test/ui/issue-17913.stderr b/src/test/ui/issue-17913.stderr new file mode 100644 index 00000000000..ca8a28c0fd7 --- /dev/null +++ b/src/test/ui/issue-17913.stderr @@ -0,0 +1,4 @@ +error: the type `[&usize; 17293822569102704640]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/ui/issue-17933.rs b/src/test/ui/issue-17933.rs new file mode 100644 index 00000000000..049a0665c54 --- /dev/null +++ b/src/test/ui/issue-17933.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub static X: usize = 1; + +fn main() { + match 1 { + self::X => { }, + //~^ ERROR expected unit struct/variant or constant, found static `self::X` + _ => { }, + } +} diff --git a/src/test/ui/issue-17933.stderr b/src/test/ui/issue-17933.stderr new file mode 100644 index 00000000000..ec0f4785c8f --- /dev/null +++ b/src/test/ui/issue-17933.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected unit struct/variant or constant, found static `self::X` + --> $DIR/issue-17933.rs:15:9 + | +LL | self::X => { }, + | ^^^^^^^ not a unit struct/variant or constant + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-17954.ast.nll.stderr b/src/test/ui/issue-17954.ast.nll.stderr new file mode 100644 index 00000000000..f731e8eeae6 --- /dev/null +++ b/src/test/ui/issue-17954.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `FOO` does not live long enough + --> $DIR/issue-17954.rs:20:13 + | +LL | let a = &FOO; + | ^^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-17954.ast.stderr b/src/test/ui/issue-17954.ast.stderr new file mode 100644 index 00000000000..677d2cbfffc --- /dev/null +++ b/src/test/ui/issue-17954.ast.stderr @@ -0,0 +1,14 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-17954.rs:20:14 + | +LL | let a = &FOO; + | ^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-17954.mir.stderr b/src/test/ui/issue-17954.mir.stderr new file mode 100644 index 00000000000..f731e8eeae6 --- /dev/null +++ b/src/test/ui/issue-17954.mir.stderr @@ -0,0 +1,14 @@ +error[E0597]: `FOO` does not live long enough + --> $DIR/issue-17954.rs:20:13 + | +LL | let a = &FOO; + | ^^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-17954.rs b/src/test/ui/issue-17954.rs new file mode 100644 index 00000000000..4211057610b --- /dev/null +++ b/src/test/ui/issue-17954.rs @@ -0,0 +1,33 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions: ast mir +//[mir]compile-flags: -Z borrowck=mir + +#![feature(thread_local)] + +#[thread_local] +static FOO: u8 = 3; + +fn main() { + let a = &FOO; + //[mir]~^ ERROR `FOO` does not live long enough [E0597] + //[mir]~| does not live long enough + //[mir]~| NOTE borrowed value must be valid for the static lifetime + //[ast]~^^^^ ERROR borrowed value does not live long enough + //[ast]~| does not live long enough + //[ast]~| NOTE borrowed value must be valid for the static lifetime + + std::thread::spawn(move || { + println!("{}", a); + }); +} +//[mir]~^ borrowed value only lives until here +//[ast]~^^ temporary value only lives until here diff --git a/src/test/ui/issue-17959.rs b/src/test/ui/issue-17959.rs new file mode 100644 index 00000000000..37c8173c4f6 --- /dev/null +++ b/src/test/ui/issue-17959.rs @@ -0,0 +1,31 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate core; + +use core::ops::Drop; + +trait Bar {} + +struct G { + _ptr: *const T +} + +impl Drop for G { +//~^ ERROR: The requirement `T: std::marker::Sized` is added only by the Drop impl. [E0367] + fn drop(&mut self) { + if !self._ptr.is_null() { + } + } +} + +fn main() { + let x:G; +} diff --git a/src/test/ui/issue-17959.stderr b/src/test/ui/issue-17959.stderr new file mode 100644 index 00000000000..626b670ae35 --- /dev/null +++ b/src/test/ui/issue-17959.stderr @@ -0,0 +1,23 @@ +error[E0367]: The requirement `T: std::marker::Sized` is added only by the Drop impl. + --> $DIR/issue-17959.rs:21:1 + | +LL | / impl Drop for G { +LL | | //~^ ERROR: The requirement `T: std::marker::Sized` is added only by the Drop impl. [E0367] +LL | | fn drop(&mut self) { +LL | | if !self._ptr.is_null() { +LL | | } +LL | | } +LL | | } + | |_^ + | +note: The same requirement must be part of the struct/enum definition + --> $DIR/issue-17959.rs:17:1 + | +LL | / struct G { +LL | | _ptr: *const T +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0367`. diff --git a/src/test/ui/issue-17994.rs b/src/test/ui/issue-17994.rs new file mode 100644 index 00000000000..25141b9b825 --- /dev/null +++ b/src/test/ui/issue-17994.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Tr {} +type Huh where T: Tr = isize; //~ ERROR type parameter `T` is unused +fn main() {} diff --git a/src/test/ui/issue-17994.stderr b/src/test/ui/issue-17994.stderr new file mode 100644 index 00000000000..77bcc469538 --- /dev/null +++ b/src/test/ui/issue-17994.stderr @@ -0,0 +1,9 @@ +error[E0091]: type parameter `T` is unused + --> $DIR/issue-17994.rs:12:10 + | +LL | type Huh where T: Tr = isize; //~ ERROR type parameter `T` is unused + | ^ unused type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0091`. diff --git a/src/test/ui/issue-17999.rs b/src/test/ui/issue-17999.rs new file mode 100644 index 00000000000..88945f80eae --- /dev/null +++ b/src/test/ui/issue-17999.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(unused_variables)] + +fn main() { + for _ in 1..101 { + let x = (); //~ ERROR: unused variable: `x` + match () { + a => {} //~ ERROR: unused variable: `a` + } + } +} diff --git a/src/test/ui/issue-17999.stderr b/src/test/ui/issue-17999.stderr new file mode 100644 index 00000000000..1a24015da54 --- /dev/null +++ b/src/test/ui/issue-17999.stderr @@ -0,0 +1,20 @@ +error: unused variable: `x` + --> $DIR/issue-17999.rs:15:13 + | +LL | let x = (); //~ ERROR: unused variable: `x` + | ^ help: consider using `_x` instead + | +note: lint level defined here + --> $DIR/issue-17999.rs:11:9 + | +LL | #![deny(unused_variables)] + | ^^^^^^^^^^^^^^^^ + +error: unused variable: `a` + --> $DIR/issue-17999.rs:17:13 + | +LL | a => {} //~ ERROR: unused variable: `a` + | ^ help: consider using `_a` instead + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-18058.rs b/src/test/ui/issue-18058.rs new file mode 100644 index 00000000000..4c815e689d4 --- /dev/null +++ b/src/test/ui/issue-18058.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +impl Undefined {} +//~^ ERROR cannot find type `Undefined` in this scope + +fn main() {} diff --git a/src/test/ui/issue-18058.stderr b/src/test/ui/issue-18058.stderr new file mode 100644 index 00000000000..ded375a9332 --- /dev/null +++ b/src/test/ui/issue-18058.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `Undefined` in this scope + --> $DIR/issue-18058.rs:11:6 + | +LL | impl Undefined {} + | ^^^^^^^^^ 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/issue-18107.rs b/src/test/ui/issue-18107.rs new file mode 100644 index 00000000000..260038b7add --- /dev/null +++ b/src/test/ui/issue-18107.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait AbstractRenderer {} + +fn _create_render(_: &()) -> + AbstractRenderer +//~^ ERROR the size for values of type +{ + match 0 { + _ => unimplemented!() + } +} + +fn main() { +} diff --git a/src/test/ui/issue-18107.stderr b/src/test/ui/issue-18107.stderr new file mode 100644 index 00000000000..4a273ab6735 --- /dev/null +++ b/src/test/ui/issue-18107.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `(dyn AbstractRenderer + 'static)` cannot be known at compilation time + --> $DIR/issue-18107.rs:14:5 + | +LL | AbstractRenderer + | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn AbstractRenderer + 'static)` + = note: to learn more, visit + = note: the return type of a function must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-18118-2.rs b/src/test/ui/issue-18118-2.rs new file mode 100644 index 00000000000..6efe532b5fd --- /dev/null +++ b/src/test/ui/issue-18118-2.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub fn main() { + const z: &'static isize = { + static p: isize = 3; + &p + //~^ ERROR constants cannot refer to statics, use a constant instead + }; +} diff --git a/src/test/ui/issue-18118-2.stderr b/src/test/ui/issue-18118-2.stderr new file mode 100644 index 00000000000..c0b306140c5 --- /dev/null +++ b/src/test/ui/issue-18118-2.stderr @@ -0,0 +1,9 @@ +error[E0013]: constants cannot refer to statics, use a constant instead + --> $DIR/issue-18118-2.rs:14:9 + | +LL | &p + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0013`. diff --git a/src/test/ui/issue-18118.nll.stderr b/src/test/ui/issue-18118.nll.stderr new file mode 100644 index 00000000000..7acab8426f6 --- /dev/null +++ b/src/test/ui/issue-18118.nll.stderr @@ -0,0 +1,67 @@ +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:15:17 + | +LL | let p = 3; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:15:17 + | +LL | let p = 3; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:18:9 + | +LL | &p //~ ERROR `p` does not live long enough + | ^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:12:5 + | +LL | / const z: &'static isize = { +LL | | //~^ ERROR let bindings in constants are unstable +LL | | //~| ERROR statements in constants are unstable +LL | | let p = 3; +... | +LL | | //~^ ERROR let bindings in constants are unstable +LL | | }; + | |______^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:12:5 + | +LL | / const z: &'static isize = { +LL | | //~^ ERROR let bindings in constants are unstable +LL | | //~| ERROR statements in constants are unstable +LL | | let p = 3; +... | +LL | | //~^ ERROR let bindings in constants are unstable +LL | | }; + | |______^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0597]: `p` does not live long enough + --> $DIR/issue-18118.rs:18:9 + | +LL | &p //~ ERROR `p` does not live long enough + | ^^ borrowed value does not live long enough +LL | //~^ ERROR let bindings in constants are unstable +LL | }; + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 6 previous errors + +Some errors occurred: E0597, E0658. +For more information about an error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-18118.rs b/src/test/ui/issue-18118.rs new file mode 100644 index 00000000000..7194c159c1e --- /dev/null +++ b/src/test/ui/issue-18118.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub fn main() { + const z: &'static isize = { + //~^ ERROR let bindings in constants are unstable + //~| ERROR statements in constants are unstable + let p = 3; + //~^ ERROR let bindings in constants are unstable + //~| ERROR statements in constants are unstable + &p //~ ERROR `p` does not live long enough + //~^ ERROR let bindings in constants are unstable + }; +} diff --git a/src/test/ui/issue-18118.stderr b/src/test/ui/issue-18118.stderr new file mode 100644 index 00000000000..2d83b86e5f4 --- /dev/null +++ b/src/test/ui/issue-18118.stderr @@ -0,0 +1,67 @@ +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:15:17 + | +LL | let p = 3; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:15:17 + | +LL | let p = 3; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:18:9 + | +LL | &p //~ ERROR `p` does not live long enough + | ^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:12:5 + | +LL | / const z: &'static isize = { +LL | | //~^ ERROR let bindings in constants are unstable +LL | | //~| ERROR statements in constants are unstable +LL | | let p = 3; +... | +LL | | //~^ ERROR let bindings in constants are unstable +LL | | }; + | |______^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue-18118.rs:12:5 + | +LL | / const z: &'static isize = { +LL | | //~^ ERROR let bindings in constants are unstable +LL | | //~| ERROR statements in constants are unstable +LL | | let p = 3; +... | +LL | | //~^ ERROR let bindings in constants are unstable +LL | | }; + | |______^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0597]: `p` does not live long enough + --> $DIR/issue-18118.rs:18:10 + | +LL | &p //~ ERROR `p` does not live long enough + | ^ borrowed value does not live long enough +LL | //~^ ERROR let bindings in constants are unstable +LL | }; + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 6 previous errors + +Some errors occurred: E0597, E0658. +For more information about an error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-18119.rs b/src/test/ui/issue-18119.rs new file mode 100644 index 00000000000..412f7566f47 --- /dev/null +++ b/src/test/ui/issue-18119.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const X: u8 = 1; +static Y: u8 = 1; +fn foo() {} + +impl X {} +//~^ ERROR expected type, found constant `X` +impl Y {} +//~^ ERROR expected type, found static `Y` +impl foo {} +//~^ ERROR expected type, found function `foo` + +fn main() {} diff --git a/src/test/ui/issue-18119.stderr b/src/test/ui/issue-18119.stderr new file mode 100644 index 00000000000..e0e2d089b7b --- /dev/null +++ b/src/test/ui/issue-18119.stderr @@ -0,0 +1,21 @@ +error[E0573]: expected type, found constant `X` + --> $DIR/issue-18119.rs:15:6 + | +LL | impl X {} + | ^ not a type + +error[E0573]: expected type, found static `Y` + --> $DIR/issue-18119.rs:17:6 + | +LL | impl Y {} + | ^ not a type + +error[E0573]: expected type, found function `foo` + --> $DIR/issue-18119.rs:19:6 + | +LL | impl foo {} + | ^^^ not a type + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/ui/issue-18159.rs b/src/test/ui/issue-18159.rs new file mode 100644 index 00000000000..8991eded3d6 --- /dev/null +++ b/src/test/ui/issue-18159.rs @@ -0,0 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x; //~ ERROR type annotations needed +} diff --git a/src/test/ui/issue-18159.stderr b/src/test/ui/issue-18159.stderr new file mode 100644 index 00000000000..894660f1ebf --- /dev/null +++ b/src/test/ui/issue-18159.stderr @@ -0,0 +1,12 @@ +error[E0282]: type annotations needed + --> $DIR/issue-18159.rs:12:9 + | +LL | let x; //~ ERROR type annotations needed + | ^ + | | + | cannot infer type for `_` + | consider giving `x` a type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-18294.rs b/src/test/ui/issue-18294.rs new file mode 100644 index 00000000000..efc1ba1635c --- /dev/null +++ b/src/test/ui/issue-18294.rs @@ -0,0 +1,15 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + const X: u32 = 1; + const Y: usize = &X as *const u32 as usize; //~ ERROR E0018 + println!("{}", Y); +} diff --git a/src/test/ui/issue-18294.stderr b/src/test/ui/issue-18294.stderr new file mode 100644 index 00000000000..151deefb2b7 --- /dev/null +++ b/src/test/ui/issue-18294.stderr @@ -0,0 +1,9 @@ +error[E0018]: raw pointers cannot be cast to integers in constants + --> $DIR/issue-18294.rs:13:22 + | +LL | const Y: usize = &X as *const u32 as usize; //~ ERROR E0018 + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0018`. diff --git a/src/test/ui/issue-18389.rs b/src/test/ui/issue-18389.rs new file mode 100644 index 00000000000..aad3d52153a --- /dev/null +++ b/src/test/ui/issue-18389.rs @@ -0,0 +1,28 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::any::Any; +use std::any::TypeId; + +trait Private { + fn call(&self, p: P, r: R); +} +pub trait Public: Private< +//~^ ERROR private trait `Private<::P, ::R>` in public interface + ::P, + ::R +> { + type P; + type R; + + fn call_inner(&self); +} + +fn main() {} diff --git a/src/test/ui/issue-18389.stderr b/src/test/ui/issue-18389.stderr new file mode 100644 index 00000000000..6f067301d04 --- /dev/null +++ b/src/test/ui/issue-18389.stderr @@ -0,0 +1,15 @@ +error[E0445]: private trait `Private<::P, ::R>` in public interface + --> $DIR/issue-18389.rs:17:1 + | +LL | / pub trait Public: Private< +LL | | //~^ ERROR private trait `Private<::P, ::R>` in public interface +LL | | ::P, +LL | | ::R +... | +LL | | fn call_inner(&self); +LL | | } + | |_^ can't leak private trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0445`. diff --git a/src/test/ui/issue-18400.rs b/src/test/ui/issue-18400.rs new file mode 100644 index 00000000000..dd17189aeea --- /dev/null +++ b/src/test/ui/issue-18400.rs @@ -0,0 +1,36 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Set { + fn contains(&self, _: T) -> bool; + fn set(&mut self, _: T); +} + +impl<'a, T, S> Set<&'a [T]> for S where + T: Copy, + S: Set, +{ + fn contains(&self, bits: &[T]) -> bool { + bits.iter().all(|&bit| self.contains(bit)) + } + + fn set(&mut self, bits: &[T]) { + for &bit in bits { + self.set(bit) + } + } +} + +fn main() { + let bits: &[_] = &[0, 1]; + + 0.contains(bits); + //~^ ERROR overflow +} diff --git a/src/test/ui/issue-18400.stderr b/src/test/ui/issue-18400.stderr new file mode 100644 index 00000000000..2426d429ca1 --- /dev/null +++ b/src/test/ui/issue-18400.stderr @@ -0,0 +1,75 @@ +error[E0275]: overflow evaluating the requirement `_: std::marker::Sized` + --> $DIR/issue-18400.rs:34:7 + | +LL | 0.contains(bits); + | ^^^^^^^^ + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + = note: required because of the requirements on the impl of `Set<&[_]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[_]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[_]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[_]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[_]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[_]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[_]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[_]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[_]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/issue-18423.rs b/src/test/ui/issue-18423.rs new file mode 100644 index 00000000000..5945a7a1c9a --- /dev/null +++ b/src/test/ui/issue-18423.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that `Box` cannot be used with a lifetime parameter. + +struct Foo<'a> { + x: Box<'a, isize> //~ ERROR wrong number of lifetime parameters +} + +pub fn main() { +} diff --git a/src/test/ui/issue-18423.stderr b/src/test/ui/issue-18423.stderr new file mode 100644 index 00000000000..25406198193 --- /dev/null +++ b/src/test/ui/issue-18423.stderr @@ -0,0 +1,9 @@ +error[E0107]: wrong number of lifetime parameters: expected 0, found 1 + --> $DIR/issue-18423.rs:14:8 + | +LL | x: Box<'a, isize> //~ ERROR wrong number of lifetime parameters + | ^^^^^^^^^^^^^^ unexpected lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/ui/issue-18446.rs b/src/test/ui/issue-18446.rs new file mode 100644 index 00000000000..60afea5a621 --- /dev/null +++ b/src/test/ui/issue-18446.rs @@ -0,0 +1,29 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that name clashes between the method in an impl for the type +// and the method in the trait when both are in the same scope. + +trait T { + fn foo(&self); +} + +impl<'a> T + 'a { + fn foo(&self) {} +} + +impl T for i32 { + fn foo(&self) {} +} + +fn main() { + let x: &T = &0i32; + x.foo(); //~ ERROR multiple applicable items in scope [E0034] +} diff --git a/src/test/ui/issue-18446.stderr b/src/test/ui/issue-18446.stderr new file mode 100644 index 00000000000..d1914fc14f8 --- /dev/null +++ b/src/test/ui/issue-18446.stderr @@ -0,0 +1,21 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/issue-18446.rs:28:7 + | +LL | x.foo(); //~ ERROR multiple applicable items in scope [E0034] + | ^^^ multiple `foo` found + | +note: candidate #1 is defined in an impl for the type `dyn T` + --> $DIR/issue-18446.rs:19:5 + | +LL | fn foo(&self) {} + | ^^^^^^^^^^^^^ +note: candidate #2 is defined in the trait `T` + --> $DIR/issue-18446.rs:15:5 + | +LL | fn foo(&self); + | ^^^^^^^^^^^^^^ + = help: to disambiguate the method call, write `T::foo(&x)` instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/ui/issue-18532.rs b/src/test/ui/issue-18532.rs new file mode 100644 index 00000000000..2be5fdcac4e --- /dev/null +++ b/src/test/ui/issue-18532.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that overloaded call parameter checking does not ICE +// when a type error or unconstrained type variable propagates +// into it. + +fn main() { + (return)((),()); //~ ERROR expected function, found `!` +} diff --git a/src/test/ui/issue-18532.stderr b/src/test/ui/issue-18532.stderr new file mode 100644 index 00000000000..8f10cb0f7b0 --- /dev/null +++ b/src/test/ui/issue-18532.stderr @@ -0,0 +1,9 @@ +error[E0618]: expected function, found `!` + --> $DIR/issue-18532.rs:16:5 + | +LL | (return)((),()); //~ ERROR expected function, found `!` + | ^^^^^^^^^^^^^^^ not a function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-18566.nll.stderr b/src/test/ui/issue-18566.nll.stderr new file mode 100644 index 00000000000..b5ed33d07c5 --- /dev/null +++ b/src/test/ui/issue-18566.nll.stderr @@ -0,0 +1,13 @@ +error[E0499]: cannot borrow `*s` as mutable more than once at a time + --> $DIR/issue-18566.rs:33:19 + | +LL | MyPtr(s).poke(s); + | --------------^- + | | | | + | | | second mutable borrow occurs here + | | first mutable borrow occurs here + | 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/issue-18566.rs b/src/test/ui/issue-18566.rs new file mode 100644 index 00000000000..41e82d0cd89 --- /dev/null +++ b/src/test/ui/issue-18566.rs @@ -0,0 +1,35 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::Deref; + +struct MyPtr<'a>(&'a mut usize); +impl<'a> Deref for MyPtr<'a> { + type Target = usize; + + fn deref<'b>(&'b self) -> &'b usize { self.0 } +} + +trait Tr { + fn poke(&self, s: &mut usize); +} + +impl Tr for usize { + fn poke(&self, s: &mut usize) { + *s = 2; + } +} + +fn main() { + let s = &mut 1; + + MyPtr(s).poke(s); + //~^ ERROR cannot borrow `*s` as mutable more than once at a time +} diff --git a/src/test/ui/issue-18566.stderr b/src/test/ui/issue-18566.stderr new file mode 100644 index 00000000000..e07fde114f2 --- /dev/null +++ b/src/test/ui/issue-18566.stderr @@ -0,0 +1,12 @@ +error[E0499]: cannot borrow `*s` as mutable more than once at a time + --> $DIR/issue-18566.rs:33:19 + | +LL | MyPtr(s).poke(s); + | - ^- first borrow ends here + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/issue-18611.rs b/src/test/ui/issue-18611.rs new file mode 100644 index 00000000000..a3ad76e1be0 --- /dev/null +++ b/src/test/ui/issue-18611.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn add_state(op: ::State) { +//~^ ERROR `isize: HasState` is not satisfied +} + +trait HasState { + type State; +} + +fn main() {} diff --git a/src/test/ui/issue-18611.stderr b/src/test/ui/issue-18611.stderr new file mode 100644 index 00000000000..d890a322f0c --- /dev/null +++ b/src/test/ui/issue-18611.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `isize: HasState` is not satisfied + --> $DIR/issue-18611.rs:11:1 + | +LL | / fn add_state(op: ::State) { +LL | | //~^ ERROR `isize: HasState` is not satisfied +LL | | } + | |_^ the trait `HasState` is not implemented for `isize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-1871.rs b/src/test/ui/issue-1871.rs new file mode 100644 index 00000000000..e4d132c8641 --- /dev/null +++ b/src/test/ui/issue-1871.rs @@ -0,0 +1,22 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Tests that we don't generate a spurious error about f.honk's type +// being undeterminable +fn main() { + let f = 42; + + let _g = if f < 5 { + f.honk() //~ ERROR no method named `honk` found + } + else { + () + }; +} diff --git a/src/test/ui/issue-1871.stderr b/src/test/ui/issue-1871.stderr new file mode 100644 index 00000000000..0546848df9b --- /dev/null +++ b/src/test/ui/issue-1871.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `honk` found for type `{integer}` in the current scope + --> $DIR/issue-1871.rs:17:9 + | +LL | f.honk() //~ ERROR no method named `honk` found + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-18783.nll.stderr b/src/test/ui/issue-18783.nll.stderr new file mode 100644 index 00000000000..6bb7b4229d7 --- /dev/null +++ b/src/test/ui/issue-18783.nll.stderr @@ -0,0 +1,33 @@ +error[E0499]: cannot borrow `y` as mutable more than once at a time + --> $DIR/issue-18783.rs:17:21 + | +LL | c.push(Box::new(|| y = 0)); + | -- - previous borrow occurs due to use of `y` in closure + | | + | first mutable borrow occurs here +LL | c.push(Box::new(|| y = 0)); + | ^^ - borrow occurs due to use of `y` in closure + | | + | second mutable borrow occurs here +LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time +LL | } + | - borrow later used here, when `c` is dropped + +error[E0499]: cannot borrow `y` as mutable more than once at a time + --> $DIR/issue-18783.rs:26:29 + | +LL | Push::push(&c, Box::new(|| y = 0)); + | -- - previous borrow occurs due to use of `y` in closure + | | + | first mutable borrow occurs here +LL | Push::push(&c, Box::new(|| y = 0)); + | ^^ - borrow occurs due to use of `y` in closure + | | + | second mutable borrow occurs here +LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time +LL | } + | - borrow later used here, when `c` is dropped + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/issue-18783.rs b/src/test/ui/issue-18783.rs new file mode 100644 index 00000000000..9a7b3781f1e --- /dev/null +++ b/src/test/ui/issue-18783.rs @@ -0,0 +1,38 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::cell::RefCell; + +fn main() { + let mut y = 1; + let c = RefCell::new(vec![]); + c.push(Box::new(|| y = 0)); + c.push(Box::new(|| y = 0)); +//~^ ERROR cannot borrow `y` as mutable more than once at a time +} + +fn ufcs() { + let mut y = 1; + let c = RefCell::new(vec![]); + + Push::push(&c, Box::new(|| y = 0)); + Push::push(&c, Box::new(|| y = 0)); +//~^ ERROR cannot borrow `y` as mutable more than once at a time +} + +trait Push<'c> { + fn push<'f: 'c>(&self, push: Box); +} + +impl<'c> Push<'c> for RefCell>> { + fn push<'f: 'c>(&self, fun: Box) { + self.borrow_mut().push(fun) + } +} diff --git a/src/test/ui/issue-18783.stderr b/src/test/ui/issue-18783.stderr new file mode 100644 index 00000000000..64d2809a36a --- /dev/null +++ b/src/test/ui/issue-18783.stderr @@ -0,0 +1,33 @@ +error[E0499]: cannot borrow `y` as mutable more than once at a time + --> $DIR/issue-18783.rs:17:21 + | +LL | c.push(Box::new(|| y = 0)); + | -- - previous borrow occurs due to use of `y` in closure + | | + | first mutable borrow occurs here +LL | c.push(Box::new(|| y = 0)); + | ^^ - borrow occurs due to use of `y` in closure + | | + | second mutable borrow occurs here +LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `y` as mutable more than once at a time + --> $DIR/issue-18783.rs:26:29 + | +LL | Push::push(&c, Box::new(|| y = 0)); + | -- - previous borrow occurs due to use of `y` in closure + | | + | first mutable borrow occurs here +LL | Push::push(&c, Box::new(|| y = 0)); + | ^^ - borrow occurs due to use of `y` in closure + | | + | second mutable borrow occurs here +LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time +LL | } + | - first borrow ends here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/issue-18919.rs b/src/test/ui/issue-18919.rs new file mode 100644 index 00000000000..cc87a0977a0 --- /dev/null +++ b/src/test/ui/issue-18919.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +type FuncType<'f> = Fn(&isize) -> isize + 'f; + +fn ho_func(f: Option) { + //~^ ERROR the size for values of type +} + +fn main() {} diff --git a/src/test/ui/issue-18919.stderr b/src/test/ui/issue-18919.stderr new file mode 100644 index 00000000000..012a1eb4d21 --- /dev/null +++ b/src/test/ui/issue-18919.stderr @@ -0,0 +1,15 @@ +error[E0277]: the size for values of type `dyn for<'r> std::ops::Fn(&'r isize) -> isize` cannot be known at compilation time + --> $DIR/issue-18919.rs:13:1 + | +LL | / fn ho_func(f: Option) { +LL | | //~^ ERROR the size for values of type +LL | | } + | |_^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::ops::Fn(&'r isize) -> isize` + = note: to learn more, visit + = note: required by `std::option::Option` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-18937.rs b/src/test/ui/issue-18937.rs new file mode 100644 index 00000000000..f7f84e6452d --- /dev/null +++ b/src/test/ui/issue-18937.rs @@ -0,0 +1,50 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for #18937. + +use std::fmt; + +#[derive(Debug)] +struct MyString<'a>(&'a String); + +struct B { + list: Vec>, +} + +trait A<'a> { + fn foo(&mut self, f: F) + where F: fmt::Debug + 'a, + Self: Sized; +} + +impl<'a> A<'a> for B { + fn foo(&mut self, f: F) //~ ERROR impl has stricter + where F: fmt::Debug + 'static, + { + self.list.push(Box::new(f)); + } +} + +fn main() { + let mut b = B { list: Vec::new() }; + + // Create a borrowed pointer, put it in `b`, then drop what's borrowing it + let a = "hello".to_string(); + b.foo(MyString(&a)); + + // Drop the data which `b` has a reference to + drop(a); + + // Use the data, probably segfaulting + for b in b.list.iter() { + println!("{:?}", b); + } +} diff --git a/src/test/ui/issue-18937.stderr b/src/test/ui/issue-18937.stderr new file mode 100644 index 00000000000..7b4c35e0dbe --- /dev/null +++ b/src/test/ui/issue-18937.stderr @@ -0,0 +1,18 @@ +error[E0276]: impl has stricter requirements than trait + --> $DIR/issue-18937.rs:29:5 + | +LL | / fn foo(&mut self, f: F) +LL | | where F: fmt::Debug + 'a, +LL | | Self: Sized; + | |__________________________- definition of `foo` from trait +... +LL | / fn foo(&mut self, f: F) //~ ERROR impl has stricter +LL | | where F: fmt::Debug + 'static, +LL | | { +LL | | self.list.push(Box::new(f)); +LL | | } + | |_____^ impl has extra requirement `F: 'static` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0276`. diff --git a/src/test/ui/issue-18959.rs b/src/test/ui/issue-18959.rs new file mode 100644 index 00000000000..7a6d012a3b6 --- /dev/null +++ b/src/test/ui/issue-18959.rs @@ -0,0 +1,30 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Foo { fn foo(&self, ext_thing: &T); } +pub trait Bar: Foo { } +impl Bar for T { } + +pub struct Thing; +impl Foo for Thing { + fn foo(&self, _: &T) {} +} + +#[inline(never)] +fn foo(b: &Bar) { + //~^ ERROR E0038 + b.foo(&0) +} + +fn main() { + let mut thing = Thing; + let test: &Bar = &mut thing; + foo(test); +} diff --git a/src/test/ui/issue-18959.stderr b/src/test/ui/issue-18959.stderr new file mode 100644 index 00000000000..42a1c2d4d03 --- /dev/null +++ b/src/test/ui/issue-18959.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/issue-18959.rs:21:1 + | +LL | fn foo(b: &Bar) { + | ^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: method `foo` has generic type parameters + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/issue-1900.rs b/src/test/ui/issue-1900.rs new file mode 100644 index 00000000000..e41bb0030ae --- /dev/null +++ b/src/test/ui/issue-1900.rs @@ -0,0 +1,12 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { } +//~^ ERROR `main` function is not allowed to have generic parameters diff --git a/src/test/ui/issue-1900.stderr b/src/test/ui/issue-1900.stderr new file mode 100644 index 00000000000..512a923fadd --- /dev/null +++ b/src/test/ui/issue-1900.stderr @@ -0,0 +1,9 @@ +error[E0131]: `main` function is not allowed to have generic parameters + --> $DIR/issue-1900.rs:11:8 + | +LL | fn main() { } + | ^^^ `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/issue-19086.rs b/src/test/ui/issue-19086.rs new file mode 100644 index 00000000000..ba571ce17fd --- /dev/null +++ b/src/test/ui/issue-19086.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use Foo::FooB; + +enum Foo { + FooB { x: i32, y: i32 } +} + +fn main() { + let f = FooB { x: 3, y: 4 }; + match f { + FooB(a, b) => println!("{} {}", a, b), + //~^ ERROR expected tuple struct/variant, found struct variant `FooB` + } +} diff --git a/src/test/ui/issue-19086.stderr b/src/test/ui/issue-19086.stderr new file mode 100644 index 00000000000..b71d40065c3 --- /dev/null +++ b/src/test/ui/issue-19086.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected tuple struct/variant, found struct variant `FooB` + --> $DIR/issue-19086.rs:20:9 + | +LL | FooB(a, b) => println!("{} {}", a, b), + | ^^^^ did you mean `FooB { /* fields */ }`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/issue-19244-1.rs b/src/test/ui/issue-19244-1.rs new file mode 100644 index 00000000000..df34aab4b8f --- /dev/null +++ b/src/test/ui/issue-19244-1.rs @@ -0,0 +1,16 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const TUP: (usize,) = (42,); + +fn main() { + let a: [isize; TUP.1]; + //~^ ERROR no field `1` on type `(usize,)` +} diff --git a/src/test/ui/issue-19244-1.stderr b/src/test/ui/issue-19244-1.stderr new file mode 100644 index 00000000000..28e66b2d974 --- /dev/null +++ b/src/test/ui/issue-19244-1.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `1` on type `(usize,)` + --> $DIR/issue-19244-1.rs:14:24 + | +LL | let a: [isize; TUP.1]; + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-19244-2.rs b/src/test/ui/issue-19244-2.rs new file mode 100644 index 00000000000..864f8f6b54e --- /dev/null +++ b/src/test/ui/issue-19244-2.rs @@ -0,0 +1,17 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct MyStruct { field: usize } +const STRUCT: MyStruct = MyStruct { field: 42 }; + +fn main() { + let a: [isize; STRUCT.nonexistent_field]; + //~^ no field `nonexistent_field` on type `MyStruct` +} diff --git a/src/test/ui/issue-19244-2.stderr b/src/test/ui/issue-19244-2.stderr new file mode 100644 index 00000000000..3969c77f24d --- /dev/null +++ b/src/test/ui/issue-19244-2.stderr @@ -0,0 +1,11 @@ +error[E0609]: no field `nonexistent_field` on type `MyStruct` + --> $DIR/issue-19244-2.rs:15:27 + | +LL | let a: [isize; STRUCT.nonexistent_field]; + | ^^^^^^^^^^^^^^^^^ unknown field + | + = note: available fields are: `field` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-19380.rs b/src/test/ui/issue-19380.rs new file mode 100644 index 00000000000..322952ffef1 --- /dev/null +++ b/src/test/ui/issue-19380.rs @@ -0,0 +1,28 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Qiz { + fn qiz(); +} + +struct Foo; +impl Qiz for Foo { + fn qiz() {} +} + +struct Bar { + foos: &'static [&'static (Qiz + 'static)] +//~^ ERROR E0038 +} + +const FOO : Foo = Foo; +const BAR : Bar = Bar { foos: &[&FOO]}; + +fn main() { } diff --git a/src/test/ui/issue-19380.stderr b/src/test/ui/issue-19380.stderr new file mode 100644 index 00000000000..a251d3b2990 --- /dev/null +++ b/src/test/ui/issue-19380.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `Qiz` cannot be made into an object + --> $DIR/issue-19380.rs:21:3 + | +LL | foos: &'static [&'static (Qiz + 'static)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Qiz` cannot be made into an object + | + = note: method `qiz` has no receiver + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/issue-19482.rs b/src/test/ui/issue-19482.rs new file mode 100644 index 00000000000..b54f008f8ce --- /dev/null +++ b/src/test/ui/issue-19482.rs @@ -0,0 +1,23 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that a partially specified trait object with unspecified associated +// type does not type-check. + +trait Foo { + type A; + + fn dummy(&self) { } +} + +fn bar(x: &Foo) {} +//~^ ERROR the associated type `A` (from the trait `Foo`) must be specified + +pub fn main() {} diff --git a/src/test/ui/issue-19482.stderr b/src/test/ui/issue-19482.stderr new file mode 100644 index 00000000000..5e2d427ab72 --- /dev/null +++ b/src/test/ui/issue-19482.stderr @@ -0,0 +1,9 @@ +error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified + --> $DIR/issue-19482.rs:20:12 + | +LL | fn bar(x: &Foo) {} + | ^^^ missing associated type `A` value + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/ui/issue-19521.rs b/src/test/ui/issue-19521.rs new file mode 100644 index 00000000000..93d95ca0b0f --- /dev/null +++ b/src/test/ui/issue-19521.rs @@ -0,0 +1,13 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + "".homura()(); //~ ERROR no method named `homura` found +} diff --git a/src/test/ui/issue-19521.stderr b/src/test/ui/issue-19521.stderr new file mode 100644 index 00000000000..8f81bcbd4c4 --- /dev/null +++ b/src/test/ui/issue-19521.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `homura` found for type `&'static str` in the current scope + --> $DIR/issue-19521.rs:12:8 + | +LL | "".homura()(); //~ ERROR no method named `homura` found + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-19538.rs b/src/test/ui/issue-19538.rs new file mode 100644 index 00000000000..a6190500582 --- /dev/null +++ b/src/test/ui/issue-19538.rs @@ -0,0 +1,30 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn foo(&self, val: T); +} + +trait Bar: Foo { } + +pub struct Thing; + +impl Foo for Thing { + fn foo(&self, val: T) { } +} + +impl Bar for Thing { } + +fn main() { + let mut thing = Thing; + let test: &mut Bar = &mut thing; + //~^ ERROR E0038 + //~| ERROR E0038 +} diff --git a/src/test/ui/issue-19538.stderr b/src/test/ui/issue-19538.stderr new file mode 100644 index 00000000000..3cd73ad9d45 --- /dev/null +++ b/src/test/ui/issue-19538.stderr @@ -0,0 +1,20 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/issue-19538.rs:27:15 + | +LL | let test: &mut Bar = &mut thing; + | ^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: method `foo` has generic type parameters + +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/issue-19538.rs:27:26 + | +LL | let test: &mut Bar = &mut thing; + | ^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: method `foo` has generic type parameters + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&mut dyn Bar>` for `&mut Thing` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/issue-19601.rs b/src/test/ui/issue-19601.rs new file mode 100644 index 00000000000..02b4932cea8 --- /dev/null +++ b/src/test/ui/issue-19601.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +trait A {} +struct B where B: A> { t: T } + +#[rustc_error] +fn main() { //~ ERROR compilation successful +} diff --git a/src/test/ui/issue-19601.stderr b/src/test/ui/issue-19601.stderr new file mode 100644 index 00000000000..594d76605fe --- /dev/null +++ b/src/test/ui/issue-19601.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/issue-19601.rs:18:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-19660.rs b/src/test/ui/issue-19660.rs new file mode 100644 index 00000000000..c4b871a28c5 --- /dev/null +++ b/src/test/ui/issue-19660.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern: requires `copy` lang_item + +#![feature(lang_items, start, no_core)] +#![no_core] + +#[lang = "sized"] +trait Sized { } + +struct S; + +#[start] +fn main(_: isize, _: *const *const u8) -> isize { + let _ = S; + 0 +} diff --git a/src/test/ui/issue-19660.stderr b/src/test/ui/issue-19660.stderr new file mode 100644 index 00000000000..f5d903f38eb --- /dev/null +++ b/src/test/ui/issue-19660.stderr @@ -0,0 +1,4 @@ +error: requires `copy` lang_item + +error: aborting due to previous error + diff --git a/src/test/ui/issue-19692.rs b/src/test/ui/issue-19692.rs new file mode 100644 index 00000000000..ca1715445e5 --- /dev/null +++ b/src/test/ui/issue-19692.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Homura; + +fn akemi(homura: Homura) { + let Some(ref madoka) = Some(homura.kaname()); //~ ERROR no method named `kaname` found + madoka.clone(); +} + +fn main() { } diff --git a/src/test/ui/issue-19692.stderr b/src/test/ui/issue-19692.stderr new file mode 100644 index 00000000000..33361ff8488 --- /dev/null +++ b/src/test/ui/issue-19692.stderr @@ -0,0 +1,12 @@ +error[E0599]: no method named `kaname` found for type `Homura` in the current scope + --> $DIR/issue-19692.rs:14:40 + | +LL | struct Homura; + | -------------- method `kaname` not found for this +... +LL | let Some(ref madoka) = Some(homura.kaname()); //~ ERROR no method named `kaname` found + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-19734.rs b/src/test/ui/issue-19734.rs new file mode 100644 index 00000000000..a3820d20aac --- /dev/null +++ b/src/test/ui/issue-19734.rs @@ -0,0 +1,18 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() {} + +struct Type; + +impl Type { + undef!(); + //~^ ERROR cannot find macro `undef!` in this scope +} diff --git a/src/test/ui/issue-19734.stderr b/src/test/ui/issue-19734.stderr new file mode 100644 index 00000000000..1d07f4dedc3 --- /dev/null +++ b/src/test/ui/issue-19734.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `undef!` in this scope + --> $DIR/issue-19734.rs:16:5 + | +LL | undef!(); + | ^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-19883.rs b/src/test/ui/issue-19883.rs new file mode 100644 index 00000000000..9b6a87702a9 --- /dev/null +++ b/src/test/ui/issue-19883.rs @@ -0,0 +1,26 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait From { + type Output; + + fn from(src: Src) -> >::Output; +} + +trait To: Sized { + fn to>(self) -> + >::Dst + //~^ ERROR cannot find associated type `Dst` in trait `From` + { + From::from(self) + } +} + +fn main() {} diff --git a/src/test/ui/issue-19883.stderr b/src/test/ui/issue-19883.stderr new file mode 100644 index 00000000000..b4262b4cdb3 --- /dev/null +++ b/src/test/ui/issue-19883.stderr @@ -0,0 +1,9 @@ +error[E0576]: cannot find associated type `Dst` in trait `From` + --> $DIR/issue-19883.rs:19:30 + | +LL | >::Dst + | ^^^ not found in `From` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0576`. diff --git a/src/test/ui/issue-19982.rs b/src/test/ui/issue-19982.rs new file mode 100644 index 00000000000..9dbca997341 --- /dev/null +++ b/src/test/ui/issue-19982.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(unboxed_closures)] + +struct Foo; + +impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier + +fn main() {} diff --git a/src/test/ui/issue-19982.stderr b/src/test/ui/issue-19982.stderr new file mode 100644 index 00000000000..9f13ba640a9 --- /dev/null +++ b/src/test/ui/issue-19982.stderr @@ -0,0 +1,9 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-19982.rs:15:10 + | +LL | impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/issue-19991.rs b/src/test/ui/issue-19991.rs new file mode 100644 index 00000000000..e07dfaf9fe5 --- /dev/null +++ b/src/test/ui/issue-19991.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test if the sugared if-let construct correctly prints "missing an else clause" when an else +// clause does not exist, instead of the unsympathetic "match arms have incompatible types" + +fn main() { + if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause + //~| expected type `()` + //~| found type `{integer}` + //~| expected (), found integral variable + 765 + }; +} diff --git a/src/test/ui/issue-19991.stderr b/src/test/ui/issue-19991.stderr new file mode 100644 index 00000000000..45b2ef8b280 --- /dev/null +++ b/src/test/ui/issue-19991.stderr @@ -0,0 +1,17 @@ +error[E0317]: if may be missing an else clause + --> $DIR/issue-19991.rs:15:5 + | +LL | / if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause +LL | | //~| expected type `()` +LL | | //~| found type `{integer}` +LL | | //~| expected (), found integral variable +LL | | 765 +LL | | }; + | |_____^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0317`. diff --git a/src/test/ui/issue-20005.rs b/src/test/ui/issue-20005.rs new file mode 100644 index 00000000000..8db09182fa3 --- /dev/null +++ b/src/test/ui/issue-20005.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait From { + type Result; + + fn from(src: Src) -> Self::Result; +} + +trait To { + fn to( //~ ERROR the size for values of type + self + ) -> >::Result where Dst: From { + From::from(self) + } +} + +fn main() {} diff --git a/src/test/ui/issue-20005.stderr b/src/test/ui/issue-20005.stderr new file mode 100644 index 00000000000..2fdfa4ba6f8 --- /dev/null +++ b/src/test/ui/issue-20005.stderr @@ -0,0 +1,22 @@ +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/issue-20005.rs:18:5 + | +LL | / fn to( //~ ERROR the size for values of type +LL | | self +LL | | ) -> >::Result where Dst: From { +LL | | From::from(self) +LL | | } + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Self` + = note: to learn more, visit + = help: consider adding a `where Self: std::marker::Sized` bound +note: required by `From` + --> $DIR/issue-20005.rs:11:1 + | +LL | trait From { + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-20162.rs b/src/test/ui/issue-20162.rs new file mode 100644 index 00000000000..b2f3a2da516 --- /dev/null +++ b/src/test/ui/issue-20162.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct X { x: i32 } + +fn main() { + let mut b: Vec = vec![]; + b.sort(); + //~^ ERROR `X: std::cmp::Ord` is not satisfied +} diff --git a/src/test/ui/issue-20162.stderr b/src/test/ui/issue-20162.stderr new file mode 100644 index 00000000000..0fb7009d574 --- /dev/null +++ b/src/test/ui/issue-20162.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `X: std::cmp::Ord` is not satisfied + --> $DIR/issue-20162.rs:15:7 + | +LL | b.sort(); + | ^^^^ the trait `std::cmp::Ord` is not implemented for `X` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-20225.rs b/src/test/ui/issue-20225.rs new file mode 100644 index 00000000000..da98f21e461 --- /dev/null +++ b/src/test/ui/issue-20225.rs @@ -0,0 +1,35 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(fn_traits, unboxed_closures)] + +struct Foo; + +impl<'a, T> Fn<(&'a T,)> for Foo { + extern "rust-call" fn call(&self, (_,): (T,)) {} + //~^ ERROR: has an incompatible type for trait + //~| expected reference +} + +impl<'a, T> FnMut<(&'a T,)> for Foo { + extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} + //~^ ERROR: has an incompatible type for trait + //~| expected reference +} + +impl<'a, T> FnOnce<(&'a T,)> for Foo { + type Output = (); + + extern "rust-call" fn call_once(self, (_,): (T,)) {} + //~^ ERROR: has an incompatible type for trait + //~| expected reference +} + +fn main() {} diff --git a/src/test/ui/issue-20225.stderr b/src/test/ui/issue-20225.stderr new file mode 100644 index 00000000000..7813dc5c11d --- /dev/null +++ b/src/test/ui/issue-20225.stderr @@ -0,0 +1,30 @@ +error[E0053]: method `call` has an incompatible type for trait + --> $DIR/issue-20225.rs:16:3 + | +LL | extern "rust-call" fn call(&self, (_,): (T,)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter + | + = note: expected type `extern "rust-call" fn(&Foo, (&'a T,))` + found type `extern "rust-call" fn(&Foo, (T,))` + +error[E0053]: method `call_mut` has an incompatible type for trait + --> $DIR/issue-20225.rs:22:3 + | +LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter + | + = note: expected type `extern "rust-call" fn(&mut Foo, (&'a T,))` + found type `extern "rust-call" fn(&mut Foo, (T,))` + +error[E0053]: method `call_once` has an incompatible type for trait + --> $DIR/issue-20225.rs:30:3 + | +LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter + | + = note: expected type `extern "rust-call" fn(Foo, (&'a T,))` + found type `extern "rust-call" fn(Foo, (T,))` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/ui/issue-20261.rs b/src/test/ui/issue-20261.rs new file mode 100644 index 00000000000..bb4dbdcd0cb --- /dev/null +++ b/src/test/ui/issue-20261.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + // NB: this (almost) typechecks when default binding modes are enabled. + for (ref i,) in [].iter() { + i.clone(); + //~^ ERROR type annotations needed + } +} diff --git a/src/test/ui/issue-20261.stderr b/src/test/ui/issue-20261.stderr new file mode 100644 index 00000000000..a4a2aec8969 --- /dev/null +++ b/src/test/ui/issue-20261.stderr @@ -0,0 +1,13 @@ +error[E0282]: type annotations needed + --> $DIR/issue-20261.rs:14:11 + | +LL | for (ref i,) in [].iter() { + | -------- consider giving `__next` a type +LL | i.clone(); + | ^^^^^ cannot infer type for `_` + | + = note: type must be known at this point + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-20313.rs b/src/test/ui/issue-20313.rs new file mode 100644 index 00000000000..dfb23c05036 --- /dev/null +++ b/src/test/ui/issue-20313.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern { + #[link_name = "llvm.sqrt.f32"] + fn sqrt(x: f32) -> f32; //~ ERROR linking to LLVM intrinsics is experimental +} + +fn main(){ +} diff --git a/src/test/ui/issue-20313.stderr b/src/test/ui/issue-20313.stderr new file mode 100644 index 00000000000..95afda1b514 --- /dev/null +++ b/src/test/ui/issue-20313.stderr @@ -0,0 +1,11 @@ +error[E0658]: linking to LLVM intrinsics is experimental (see issue #29602) + --> $DIR/issue-20313.rs:13:5 + | +LL | fn sqrt(x: f32) -> f32; //~ ERROR linking to LLVM intrinsics is experimental + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(link_llvm_intrinsics)] 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/issue-20413.rs b/src/test/ui/issue-20413.rs new file mode 100644 index 00000000000..a48c03aa178 --- /dev/null +++ b/src/test/ui/issue-20413.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn answer(self); +} + +struct NoData; +//~^ ERROR: parameter `T` is never used + +impl Foo for T where NoData: Foo { +//~^ ERROR: overflow evaluating the requirement + fn answer(self) { + let val: NoData = NoData; + } +} + +fn main() {} diff --git a/src/test/ui/issue-20413.stderr b/src/test/ui/issue-20413.stderr new file mode 100644 index 00000000000..bfb2665e867 --- /dev/null +++ b/src/test/ui/issue-20413.stderr @@ -0,0 +1,94 @@ +error[E0392]: parameter `T` is never used + --> $DIR/issue-20413.rs:15:15 + | +LL | struct NoData; + | ^ unused type parameter + | + = help: consider removing `T` or using a marker such as `std::marker::PhantomData` + +error[E0275]: overflow evaluating the requirement `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: std::marker::Sized` + --> $DIR/issue-20413.rs:18:1 + | +LL | / impl Foo for T where NoData: Foo { +LL | | //~^ ERROR: overflow evaluating the requirement +LL | | fn answer(self) { +LL | | let val: NoData = NoData; +LL | | } +LL | | } + | |_^ + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>>` + = note: required because of the requirements on the impl of `Foo` for `NoData>` + = note: required because of the requirements on the impl of `Foo` for `NoData` +note: required by `Foo` + --> $DIR/issue-20413.rs:11:1 + | +LL | trait Foo { + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0275, E0392. +For more information about an error, try `rustc --explain E0275`. diff --git a/src/test/ui/issue-20433.rs b/src/test/ui/issue-20433.rs new file mode 100644 index 00000000000..f760cd59968 --- /dev/null +++ b/src/test/ui/issue-20433.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() {} + +struct The; + +impl The { + fn iceman(c: Vec<[i32]>) {} + //~^ ERROR the size for values of type +} diff --git a/src/test/ui/issue-20433.stderr b/src/test/ui/issue-20433.stderr new file mode 100644 index 00000000000..38dd4e5e7fe --- /dev/null +++ b/src/test/ui/issue-20433.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `[i32]` cannot be known at compilation time + --> $DIR/issue-20433.rs:16:5 + | +LL | fn iceman(c: Vec<[i32]>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[i32]` + = note: to learn more, visit + = note: required by `std::vec::Vec` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-20605.rs b/src/test/ui/issue-20605.rs new file mode 100644 index 00000000000..60d012ab134 --- /dev/null +++ b/src/test/ui/issue-20605.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn changer<'a>(mut things: Box>) { + for item in *things { *item = 0 } +//~^ ERROR the size for values of type +} + +fn main() {} diff --git a/src/test/ui/issue-20605.stderr b/src/test/ui/issue-20605.stderr new file mode 100644 index 00000000000..10e90faf2df --- /dev/null +++ b/src/test/ui/issue-20605.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `dyn std::iter::Iterator` cannot be known at compilation time + --> $DIR/issue-20605.rs:12:17 + | +LL | for item in *things { *item = 0 } + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator` + = note: to learn more, visit + = note: required by `std::iter::IntoIterator::into_iter` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-20616-1.rs b/src/test/ui/issue-20616-1.rs new file mode 100644 index 00000000000..3e29383d62c --- /dev/null +++ b/src/test/ui/issue-20616-1.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +type Type_1<'a T> = &'a T; //~ error: expected one of `,`, `:`, or `>`, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-1.stderr b/src/test/ui/issue-20616-1.stderr new file mode 100644 index 00000000000..1ee965d2186 --- /dev/null +++ b/src/test/ui/issue-20616-1.stderr @@ -0,0 +1,8 @@ +error: expected one of `,`, `:`, or `>`, found `T` + --> $DIR/issue-20616-1.rs:19:16 + | +LL | type Type_1<'a T> = &'a T; //~ error: expected one of `,`, `:`, or `>`, found `T` + | ^ expected one of `,`, `:`, or `>` here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-2.rs b/src/test/ui/issue-20616-2.rs new file mode 100644 index 00000000000..1ec7a74559a --- /dev/null +++ b/src/test/ui/issue-20616-2.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +type Type_2 = Type_1_<'static ()>; //~ error: expected one of `,` or `>`, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-2.stderr b/src/test/ui/issue-20616-2.stderr new file mode 100644 index 00000000000..1c103b21a18 --- /dev/null +++ b/src/test/ui/issue-20616-2.stderr @@ -0,0 +1,8 @@ +error: expected one of `,` or `>`, found `(` + --> $DIR/issue-20616-2.rs:22:31 + | +LL | type Type_2 = Type_1_<'static ()>; //~ error: expected one of `,` or `>`, found `(` + | ^ expected one of `,` or `>` here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-3.rs b/src/test/ui/issue-20616-3.rs new file mode 100644 index 00000000000..885fd246547 --- /dev/null +++ b/src/test/ui/issue-20616-3.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +type Type_3 = Box; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-3.stderr b/src/test/ui/issue-20616-3.stderr new file mode 100644 index 00000000000..b4b40b3637d --- /dev/null +++ b/src/test/ui/issue-20616-3.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-3.rs:25:24 + | +LL | type Type_3 = Box; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` + | ^ expected one of `>`, identifier, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-4.rs b/src/test/ui/issue-20616-4.rs new file mode 100644 index 00000000000..0dbe92fc1bc --- /dev/null +++ b/src/test/ui/issue-20616-4.rs @@ -0,0 +1,47 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +type Type_4 = Type_1_<'static,, T>; +//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-4.stderr b/src/test/ui/issue-20616-4.stderr new file mode 100644 index 00000000000..0a734e4fdcd --- /dev/null +++ b/src/test/ui/issue-20616-4.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-4.rs:28:34 + | +LL | type Type_4 = Type_1_<'static,, T>; + | ^ expected one of `>`, identifier, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-5.rs b/src/test/ui/issue-20616-5.rs new file mode 100644 index 00000000000..794e5178f4b --- /dev/null +++ b/src/test/ui/issue-20616-5.rs @@ -0,0 +1,47 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +type Type_5<'a> = Type_1_<'a, (),,>; +//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-5.stderr b/src/test/ui/issue-20616-5.stderr new file mode 100644 index 00000000000..504be1632ba --- /dev/null +++ b/src/test/ui/issue-20616-5.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-5.rs:34:34 + | +LL | type Type_5<'a> = Type_1_<'a, (),,>; + | ^ expected one of `>`, identifier, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-6.rs b/src/test/ui/issue-20616-6.rs new file mode 100644 index 00000000000..fe91751a4a0 --- /dev/null +++ b/src/test/ui/issue-20616-6.rs @@ -0,0 +1,47 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +type Type_6 = Type_5_<'a,,>; +//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-6.stderr b/src/test/ui/issue-20616-6.stderr new file mode 100644 index 00000000000..41dea4137af --- /dev/null +++ b/src/test/ui/issue-20616-6.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-6.rs:37:26 + | +LL | type Type_6 = Type_5_<'a,,>; + | ^ expected one of `>`, identifier, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-7.rs b/src/test/ui/issue-20616-7.rs new file mode 100644 index 00000000000..184ad027102 --- /dev/null +++ b/src/test/ui/issue-20616-7.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +type Type_7 = Box<(),,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected ident, found `,` + + +//type Type_9 = Box; // error: expected ident, found `,` diff --git a/src/test/ui/issue-20616-7.stderr b/src/test/ui/issue-20616-7.stderr new file mode 100644 index 00000000000..caf66895fab --- /dev/null +++ b/src/test/ui/issue-20616-7.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-7.rs:40:22 + | +LL | type Type_7 = Box<(),,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` + | ^ expected one of `>`, identifier, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-8.rs b/src/test/ui/issue-20616-8.rs new file mode 100644 index 00000000000..5cdec33e94b --- /dev/null +++ b/src/test/ui/issue-20616-8.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, identifier, or lifetime, found `,` + + +//type Type_9 = Box; // error: expected identifier, found `,` diff --git a/src/test/ui/issue-20616-8.stderr b/src/test/ui/issue-20616-8.stderr new file mode 100644 index 00000000000..6d840fc562b --- /dev/null +++ b/src/test/ui/issue-20616-8.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, or lifetime, found `,` + --> $DIR/issue-20616-8.rs:43:16 + | +LL | type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, identifier, or lifetime, found `,` + | ^ expected one of `>`, identifier, or lifetime here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20616-9.rs b/src/test/ui/issue-20616-9.rs new file mode 100644 index 00000000000..7995addb692 --- /dev/null +++ b/src/test/ui/issue-20616-9.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We need all these 9 issue-20616-N.rs files +// because we can only catch one parsing error at a time + + + +type Type_1_<'a, T> = &'a T; + + +//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` + + +//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` + + +//type Type_3 = Box; // error: expected type, found `,` + + +//type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` + + +type Type_5_<'a> = Type_1_<'a, ()>; + + +//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,` + + +//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` + + +//type Type_7 = Box<(),,>; // error: expected type, found `,` + + +//type Type_8<'a,,> = &'a (); // error: expected identifier, found `,` + + +type Type_9 = Box; //~ error: expected one of `>`, identifier, or lifetime, found `,` diff --git a/src/test/ui/issue-20616-9.stderr b/src/test/ui/issue-20616-9.stderr new file mode 100644 index 00000000000..f9cc4e0b480 --- /dev/null +++ b/src/test/ui/issue-20616-9.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, or lifetime, found `,` + --> $DIR/issue-20616-9.rs:46:15 + | +LL | type Type_9 = Box; //~ error: expected one of `>`, identifier, or lifetime, found `,` + | ^ expected one of `>`, identifier, or lifetime here + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20714.rs b/src/test/ui/issue-20714.rs new file mode 100644 index 00000000000..cb322f00723 --- /dev/null +++ b/src/test/ui/issue-20714.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct G; + +fn main() { + let g = G(); //~ ERROR: expected function, found `G` +} diff --git a/src/test/ui/issue-20714.stderr b/src/test/ui/issue-20714.stderr new file mode 100644 index 00000000000..1ea85ee440e --- /dev/null +++ b/src/test/ui/issue-20714.stderr @@ -0,0 +1,12 @@ +error[E0618]: expected function, found `G` + --> $DIR/issue-20714.rs:14:13 + | +LL | struct G; + | --------- `G` defined here +... +LL | let g = G(); //~ ERROR: expected function, found `G` + | ^^^ not a function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-20772.rs b/src/test/ui/issue-20772.rs new file mode 100644 index 00000000000..d67c76a1525 --- /dev/null +++ b/src/test/ui/issue-20772.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait T : Iterator +//~^ ERROR cycle detected +//~| ERROR associated type `Item` not found for `Self` +{} + +fn main() {} diff --git a/src/test/ui/issue-20772.stderr b/src/test/ui/issue-20772.stderr new file mode 100644 index 00000000000..b898962c9cc --- /dev/null +++ b/src/test/ui/issue-20772.stderr @@ -0,0 +1,21 @@ +error[E0391]: cycle detected when computing the supertraits of `T` + --> $DIR/issue-20772.rs:11:1 + | +LL | / trait T : Iterator +LL | | //~^ ERROR cycle detected +LL | | //~| ERROR associated type `Item` not found for `Self` +LL | | {} + | |__^ + | + = note: ...which again requires computing the supertraits of `T`, completing the cycle + +error[E0220]: associated type `Item` not found for `Self` + --> $DIR/issue-20772.rs:11:25 + | +LL | trait T : Iterator + | ^^^^^^^^^^ associated type `Item` not found + +error: aborting due to 2 previous errors + +Some errors occurred: E0220, E0391. +For more information about an error, try `rustc --explain E0220`. diff --git a/src/test/ui/issue-20801.nll.stderr b/src/test/ui/issue-20801.nll.stderr new file mode 100644 index 00000000000..39b1405991a --- /dev/null +++ b/src/test/ui/issue-20801.nll.stderr @@ -0,0 +1,8 @@ +error: internal compiler error: Accessing `(*_8)` with the kind `Write(Move)` shouldn't be possible + --> $DIR/issue-20801.rs:45:22 + | +LL | let d = unsafe { *const_ptr() }; + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-20801.rs b/src/test/ui/issue-20801.rs new file mode 100644 index 00000000000..d3b97a9c058 --- /dev/null +++ b/src/test/ui/issue-20801.rs @@ -0,0 +1,47 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// We used to ICE when moving out of a `*mut T` or `*const T`. + +struct T(u8); + +static mut GLOBAL_MUT_T: T = T(0); + +static GLOBAL_T: T = T(0); + +fn imm_ref() -> &'static T { + unsafe { &GLOBAL_T } +} + +fn mut_ref() -> &'static mut T { + unsafe { &mut GLOBAL_MUT_T } +} + +fn mut_ptr() -> *mut T { + unsafe { 0 as *mut T } +} + +fn const_ptr() -> *const T { + unsafe { 0 as *const T } +} + +pub fn main() { + let a = unsafe { *mut_ref() }; + //~^ ERROR cannot move out of borrowed content + + let b = unsafe { *imm_ref() }; + //~^ ERROR cannot move out of borrowed content + + let c = unsafe { *mut_ptr() }; + //~^ ERROR cannot move out of dereference of raw pointer + + let d = unsafe { *const_ptr() }; + //~^ ERROR cannot move out of dereference of raw pointer +} diff --git a/src/test/ui/issue-20801.stderr b/src/test/ui/issue-20801.stderr new file mode 100644 index 00000000000..3989957b7b4 --- /dev/null +++ b/src/test/ui/issue-20801.stderr @@ -0,0 +1,27 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/issue-20801.rs:36:22 + | +LL | let a = unsafe { *mut_ref() }; + | ^^^^^^^^^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/issue-20801.rs:39:22 + | +LL | let b = unsafe { *imm_ref() }; + | ^^^^^^^^^^ cannot move out of borrowed content + +error[E0507]: cannot move out of dereference of raw pointer + --> $DIR/issue-20801.rs:42:22 + | +LL | let c = unsafe { *mut_ptr() }; + | ^^^^^^^^^^ cannot move out of dereference of raw pointer + +error[E0507]: cannot move out of dereference of raw pointer + --> $DIR/issue-20801.rs:45:22 + | +LL | let d = unsafe { *const_ptr() }; + | ^^^^^^^^^^^^ cannot move out of dereference of raw pointer + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/issue-20825.rs b/src/test/ui/issue-20825.rs new file mode 100644 index 00000000000..cbb987cd512 --- /dev/null +++ b/src/test/ui/issue-20825.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Subscriber { + type Input; +} + +pub trait Processor: Subscriber { + //~^ ERROR cycle detected + type Input; +} + +fn main() {} diff --git a/src/test/ui/issue-20825.stderr b/src/test/ui/issue-20825.stderr new file mode 100644 index 00000000000..e49e3668536 --- /dev/null +++ b/src/test/ui/issue-20825.stderr @@ -0,0 +1,11 @@ +error[E0391]: cycle detected when computing the supertraits of `Processor` + --> $DIR/issue-20825.rs:15:1 + | +LL | pub trait Processor: Subscriber { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which again requires computing the supertraits of `Processor`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-20831-debruijn.rs b/src/test/ui/issue-20831-debruijn.rs new file mode 100644 index 00000000000..3f00f561ae9 --- /dev/null +++ b/src/test/ui/issue-20831-debruijn.rs @@ -0,0 +1,49 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for #20831: debruijn index account was thrown off +// by the (anonymous) lifetime in `::Output` +// below. Note that changing to a named lifetime made the problem go +// away. + +use std::cell::RefCell; +use std::ops::{Shl, Shr}; + +pub trait Subscriber { + type Input; +} + +pub trait Publisher<'a> { + type Output; + fn subscribe(&mut self, _: Box + 'a>); +} + +pub trait Processor<'a> : Subscriber + Publisher<'a> { } + +impl<'a, P> Processor<'a> for P where P : Subscriber + Publisher<'a> { } + +struct MyStruct<'a> { + sub: Box + 'a> +} + +impl<'a> Publisher<'a> for MyStruct<'a> { + type Output = u64; + fn subscribe(&mut self, t : Box::Output> + 'a>) { + // Not obvious, but there is an implicit lifetime here -------^ + //~^^ ERROR cannot infer + // + // The fact that `Publisher` is using an implicit lifetime is + // what was causing the debruijn accounting to be off, so + // leave it that way! + self.sub = t; + } +} + +fn main() {} diff --git a/src/test/ui/issue-20831-debruijn.stderr b/src/test/ui/issue-20831-debruijn.stderr new file mode 100644 index 00000000000..fc9a0fdbe54 --- /dev/null +++ b/src/test/ui/issue-20831-debruijn.stderr @@ -0,0 +1,35 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/issue-20831-debruijn.rs:38:5 + | +LL | / fn subscribe(&mut self, t : Box::Output> + 'a>) { +LL | | // Not obvious, but there is an implicit lifetime here -------^ +LL | | //~^^ ERROR cannot infer +LL | | // +... | +LL | | self.sub = t; +LL | | } + | |_____^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 38:5... + --> $DIR/issue-20831-debruijn.rs:38:5 + | +LL | / fn subscribe(&mut self, t : Box::Output> + 'a>) { +LL | | // Not obvious, but there is an implicit lifetime here -------^ +LL | | //~^^ ERROR cannot infer +LL | | // +... | +LL | | self.sub = t; +LL | | } + | |_____^ +note: ...but the lifetime must also be valid for the lifetime 'a as defined on the impl at 36:6... + --> $DIR/issue-20831-debruijn.rs:36:6 + | +LL | impl<'a> Publisher<'a> for MyStruct<'a> { + | ^^ + = note: ...so that the types are compatible: + expected Publisher<'_> + found Publisher<'_> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issue-20939.rs b/src/test/ui/issue-20939.rs new file mode 100644 index 00000000000..5282ce4bb88 --- /dev/null +++ b/src/test/ui/issue-20939.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo {} + +impl<'a> Foo for Foo+'a {} +//~^ ERROR the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` + +fn main() {} diff --git a/src/test/ui/issue-20939.stderr b/src/test/ui/issue-20939.stderr new file mode 100644 index 00000000000..c8f7e58540b --- /dev/null +++ b/src/test/ui/issue-20939.stderr @@ -0,0 +1,9 @@ +error[E0371]: the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` + --> $DIR/issue-20939.rs:13:1 + | +LL | impl<'a> Foo for Foo+'a {} + | ^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Foo + 'a)` automatically implements trait `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0371`. diff --git a/src/test/ui/issue-2111.rs b/src/test/ui/issue-2111.rs new file mode 100644 index 00000000000..8180ce52bdb --- /dev/null +++ b/src/test/ui/issue-2111.rs @@ -0,0 +1,22 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(a: Option, b: Option) { + match (a,b) { + //~^ ERROR: non-exhaustive patterns: `(None, None)` not covered + (Some(a), Some(b)) if a == b => { } + (Some(_), None) | + (None, Some(_)) => { } + } +} + +fn main() { + foo(None, None); +} diff --git a/src/test/ui/issue-2111.stderr b/src/test/ui/issue-2111.stderr new file mode 100644 index 00000000000..5aa1b02779b --- /dev/null +++ b/src/test/ui/issue-2111.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `(None, None)` not covered + --> $DIR/issue-2111.rs:12:9 + | +LL | match (a,b) { + | ^^^^^ pattern `(None, None)` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/issue-21160.rs b/src/test/ui/issue-21160.rs new file mode 100644 index 00000000000..0de0ab2269b --- /dev/null +++ b/src/test/ui/issue-21160.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Bar; + +impl Bar { + fn hash(&self, _: T) {} +} + +#[derive(Hash)] +struct Foo(Bar); +//~^ error: `Bar: std::hash::Hash` is not satisfied + +fn main() {} diff --git a/src/test/ui/issue-21160.stderr b/src/test/ui/issue-21160.stderr new file mode 100644 index 00000000000..75ed9988b89 --- /dev/null +++ b/src/test/ui/issue-21160.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Bar: std::hash::Hash` is not satisfied + --> $DIR/issue-21160.rs:18:12 + | +LL | struct Foo(Bar); + | ^^^ the trait `std::hash::Hash` is not implemented for `Bar` + | + = note: required by `std::hash::Hash::hash` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-21174.rs b/src/test/ui/issue-21174.rs new file mode 100644 index 00000000000..9d9b7e48043 --- /dev/null +++ b/src/test/ui/issue-21174.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait<'a> { + type A; + type B; +} + +fn foo<'a, T: Trait<'a>>(value: T::A) { + let new: T::B = unsafe { std::mem::transmute(value) }; +//~^ ERROR: transmute called with types of different sizes +} + +fn main() { } diff --git a/src/test/ui/issue-21174.stderr b/src/test/ui/issue-21174.stderr new file mode 100644 index 00000000000..391ed1e7698 --- /dev/null +++ b/src/test/ui/issue-21174.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-21174.rs:17:30 + | +LL | let new: T::B = unsafe { std::mem::transmute(value) }; + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: >::A (size can vary because of ::A) + = note: target type: >::B (size can vary because of ::B) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/issue-21177.rs b/src/test/ui/issue-21177.rs new file mode 100644 index 00000000000..9da57877a09 --- /dev/null +++ b/src/test/ui/issue-21177.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { + type A; + type B; +} + +fn foo>() { } +//~^ ERROR cycle detected +//~| ERROR associated type `B` not found for `T` + +fn main() { } diff --git a/src/test/ui/issue-21177.stderr b/src/test/ui/issue-21177.stderr new file mode 100644 index 00000000000..c924fb2ee94 --- /dev/null +++ b/src/test/ui/issue-21177.stderr @@ -0,0 +1,23 @@ +error[E0391]: cycle detected when computing the bounds for type parameter `T` + --> $DIR/issue-21177.rs:16:21 + | +LL | fn foo>() { } + | ^^^^ + | + = note: ...which again requires computing the bounds for type parameter `T`, completing the cycle +note: cycle used when processing `foo` + --> $DIR/issue-21177.rs:16:21 + | +LL | fn foo>() { } + | ^^^^ + +error[E0220]: associated type `B` not found for `T` + --> $DIR/issue-21177.rs:16:21 + | +LL | fn foo>() { } + | ^^^^ associated type `B` not found + +error: aborting due to 2 previous errors + +Some errors occurred: E0220, E0391. +For more information about an error, try `rustc --explain E0220`. diff --git a/src/test/ui/issue-21332.rs b/src/test/ui/issue-21332.rs new file mode 100644 index 00000000000..db3334834d4 --- /dev/null +++ b/src/test/ui/issue-21332.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S; + +impl Iterator for S { + type Item = i32; + fn next(&mut self) -> Result { Ok(7) } + //~^ ERROR method `next` has an incompatible type for trait + //~| expected enum `std::option::Option`, found enum `std::result::Result` +} + +fn main() {} diff --git a/src/test/ui/issue-21332.stderr b/src/test/ui/issue-21332.stderr new file mode 100644 index 00000000000..b5fbb71f8ca --- /dev/null +++ b/src/test/ui/issue-21332.stderr @@ -0,0 +1,12 @@ +error[E0053]: method `next` has an incompatible type for trait + --> $DIR/issue-21332.rs:15:5 + | +LL | fn next(&mut self) -> Result { Ok(7) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` + | + = note: expected type `fn(&mut S) -> std::option::Option` + found type `fn(&mut S) -> std::result::Result` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/ui/issue-21356.rs b/src/test/ui/issue-21356.rs new file mode 100644 index 00000000000..f66c09291cc --- /dev/null +++ b/src/test/ui/issue-21356.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused_macros)] + +macro_rules! test { ($wrong:t_ty ..) => () } + //~^ ERROR: invalid fragment specifier `t_ty` + +fn main() {} diff --git a/src/test/ui/issue-21356.stderr b/src/test/ui/issue-21356.stderr new file mode 100644 index 00000000000..5787476c2f2 --- /dev/null +++ b/src/test/ui/issue-21356.stderr @@ -0,0 +1,10 @@ +error: invalid fragment specifier `t_ty` + --> $DIR/issue-21356.rs:13:22 + | +LL | macro_rules! test { ($wrong:t_ty ..) => () } + | ^^^^^^^^^^^ + | + = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `literal`, `path`, `meta`, `tt`, `item` and `vis` + +error: aborting due to previous error + diff --git a/src/test/ui/issue-21449.rs b/src/test/ui/issue-21449.rs new file mode 100644 index 00000000000..cc44cf88f09 --- /dev/null +++ b/src/test/ui/issue-21449.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod MyMod {} + +fn main() { + let myVar = MyMod { T: 0 }; + //~^ ERROR expected struct, variant or union type, found module `MyMod` +} diff --git a/src/test/ui/issue-21449.stderr b/src/test/ui/issue-21449.stderr new file mode 100644 index 00000000000..d84b3b99c1f --- /dev/null +++ b/src/test/ui/issue-21449.stderr @@ -0,0 +1,9 @@ +error[E0574]: expected struct, variant or union type, found module `MyMod` + --> $DIR/issue-21449.rs:14:17 + | +LL | let myVar = MyMod { T: 0 }; + | ^^^^^ not a struct, variant or union type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/issue-2149.rs b/src/test/ui/issue-2149.rs new file mode 100644 index 00000000000..256c5d8e6f7 --- /dev/null +++ b/src/test/ui/issue-2149.rs @@ -0,0 +1,25 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait vec_monad { + fn bind(&self, f: F) where F: FnMut(A) -> Vec; +} + +impl vec_monad for Vec { + fn bind(&self, mut f: F) where F: FnMut(A) -> Vec { + let mut r = panic!(); + for elt in self { r = r + f(*elt); } + //~^ ERROR E0277 + } +} +fn main() { + ["hi"].bind(|x| [x] ); + //~^ ERROR no method named `bind` found for type `[&str; 1]` in the current scope +} diff --git a/src/test/ui/issue-2149.stderr b/src/test/ui/issue-2149.stderr new file mode 100644 index 00000000000..4ae9032cd1a --- /dev/null +++ b/src/test/ui/issue-2149.stderr @@ -0,0 +1,22 @@ +error[E0277]: cannot add `std::vec::Vec` to `()` + --> $DIR/issue-2149.rs:18:33 + | +LL | for elt in self { r = r + f(*elt); } + | ^ no implementation for `() + std::vec::Vec` + | + = help: the trait `std::ops::Add>` is not implemented for `()` + +error[E0599]: no method named `bind` found for type `[&str; 1]` in the current scope + --> $DIR/issue-2149.rs:23:12 + | +LL | ["hi"].bind(|x| [x] ); + | ^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `bind`, perhaps you need to implement it: + candidate #1: `vec_monad` + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0599. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-2150.rs b/src/test/ui/issue-2150.rs new file mode 100644 index 00000000000..8b109b0a5c0 --- /dev/null +++ b/src/test/ui/issue-2150.rs @@ -0,0 +1,22 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(unreachable_code)] +#![allow(unused_variables)] +#![allow(dead_code)] + +fn fail_len(v: Vec ) -> usize { + let mut i = 3; + panic!(); + for x in &v { i += 1; } + //~^ ERROR: unreachable statement + return i; +} +fn main() {} diff --git a/src/test/ui/issue-2150.stderr b/src/test/ui/issue-2150.stderr new file mode 100644 index 00000000000..c1944efab8b --- /dev/null +++ b/src/test/ui/issue-2150.stderr @@ -0,0 +1,14 @@ +error: unreachable statement + --> $DIR/issue-2150.rs:18:5 + | +LL | for x in &v { i += 1; } + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-2150.rs:11:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-2151.rs b/src/test/ui/issue-2151.rs new file mode 100644 index 00000000000..3cf971f3f8d --- /dev/null +++ b/src/test/ui/issue-2151.rs @@ -0,0 +1,14 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x = panic!(); + x.clone(); //~ ERROR type annotations needed +} diff --git a/src/test/ui/issue-2151.stderr b/src/test/ui/issue-2151.stderr new file mode 100644 index 00000000000..592c4f424b0 --- /dev/null +++ b/src/test/ui/issue-2151.stderr @@ -0,0 +1,13 @@ +error[E0282]: type annotations needed + --> $DIR/issue-2151.rs:13:5 + | +LL | let x = panic!(); + | - consider giving `x` a type +LL | x.clone(); //~ ERROR type annotations needed + | ^ cannot infer type for `_` + | + = note: type must be known at this point + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-21554.rs b/src/test/ui/issue-21554.rs new file mode 100644 index 00000000000..1b87862a056 --- /dev/null +++ b/src/test/ui/issue-21554.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Inches(i32); + +fn main() { + Inches as f32; + //~^ ERROR casting +} diff --git a/src/test/ui/issue-21554.stderr b/src/test/ui/issue-21554.stderr new file mode 100644 index 00000000000..be7762f1aa2 --- /dev/null +++ b/src/test/ui/issue-21554.stderr @@ -0,0 +1,9 @@ +error[E0606]: casting `fn(i32) -> Inches {Inches::{{constructor}}}` as `f32` is invalid + --> $DIR/issue-21554.rs:14:5 + | +LL | Inches as f32; + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/ui/issue-21701.rs b/src/test/ui/issue-21701.rs new file mode 100644 index 00000000000..f24de2ffe6b --- /dev/null +++ b/src/test/ui/issue-21701.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(t: U) { + let y = t(); +//~^ ERROR: expected function, found `U` +} + +struct Bar; + +pub fn some_func() { + let f = Bar(); +//~^ ERROR: expected function, found `Bar` +} + +fn main() { + foo(|| { 1 }); +} diff --git a/src/test/ui/issue-21701.stderr b/src/test/ui/issue-21701.stderr new file mode 100644 index 00000000000..9fb9a7b51f2 --- /dev/null +++ b/src/test/ui/issue-21701.stderr @@ -0,0 +1,20 @@ +error[E0618]: expected function, found `U` + --> $DIR/issue-21701.rs:12:13 + | +LL | fn foo(t: U) { + | - `U` defined here +LL | let y = t(); + | ^^^ not a function + +error[E0618]: expected function, found `Bar` + --> $DIR/issue-21701.rs:19:13 + | +LL | struct Bar; + | ----------- `Bar` defined here +... +LL | let f = Bar(); + | ^^^^^ not a function + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-21763.rs b/src/test/ui/issue-21763.rs new file mode 100644 index 00000000000..b4f952c87d4 --- /dev/null +++ b/src/test/ui/issue-21763.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for HashMap only impl'ing Send/Sync if its contents do + +use std::collections::HashMap; +use std::rc::Rc; + +fn foo() {} + +fn main() { + foo::, Rc<()>>>(); + //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely +} diff --git a/src/test/ui/issue-21763.stderr b/src/test/ui/issue-21763.stderr new file mode 100644 index 00000000000..91db16e0f6d --- /dev/null +++ b/src/test/ui/issue-21763.stderr @@ -0,0 +1,20 @@ +error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely + --> $DIR/issue-21763.rs:19:5 + | +LL | foo::, Rc<()>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely + | + = help: within `std::collections::HashMap, std::rc::Rc<()>>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>` + = note: required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)` + = note: required because it appears within the type `std::marker::PhantomData<(std::rc::Rc<()>, std::rc::Rc<()>)>` + = note: required because it appears within the type `std::collections::hash::table::RawTable, std::rc::Rc<()>>` + = note: required because it appears within the type `std::collections::HashMap, std::rc::Rc<()>>` +note: required by `foo` + --> $DIR/issue-21763.rs:16:1 + | +LL | fn foo() {} + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-21837.rs b/src/test/ui/issue-21837.rs new file mode 100644 index 00000000000..86506de1ea9 --- /dev/null +++ b/src/test/ui/issue-21837.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Bound {} +pub struct Foo(T); + +pub trait Trait1 {} +impl Trait1 for Foo {} + +pub trait Trait2 {} +impl Trait2 for Foo {} //~ ERROR the trait bound `T: Bound` is not satisfied + +fn main() {} diff --git a/src/test/ui/issue-21837.stderr b/src/test/ui/issue-21837.stderr new file mode 100644 index 00000000000..bbdebeefdd6 --- /dev/null +++ b/src/test/ui/issue-21837.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: Bound` is not satisfied + --> $DIR/issue-21837.rs:18:9 + | +LL | impl Trait2 for Foo {} //~ ERROR the trait bound `T: Bound` is not satisfied + | ^^^^^^ the trait `Bound` is not implemented for `T` + | + = help: consider adding a `where T: Bound` bound +note: required by `Foo` + --> $DIR/issue-21837.rs:12:1 + | +LL | pub struct Foo(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-21946.rs b/src/test/ui/issue-21946.rs new file mode 100644 index 00000000000..0d652be5c26 --- /dev/null +++ b/src/test/ui/issue-21946.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + type A; +} + +struct FooStruct; + +impl Foo for FooStruct { +//~^ ERROR overflow evaluating the requirement `::A` + type A = ::A; +} + +fn main() {} diff --git a/src/test/ui/issue-21946.stderr b/src/test/ui/issue-21946.stderr new file mode 100644 index 00000000000..ebb0c0c9ce0 --- /dev/null +++ b/src/test/ui/issue-21946.stderr @@ -0,0 +1,9 @@ +error[E0275]: overflow evaluating the requirement `::A` + --> $DIR/issue-21946.rs:17:6 + | +LL | impl Foo for FooStruct { + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/issue-21974.rs b/src/test/ui/issue-21974.rs new file mode 100644 index 00000000000..6ddfa4c8e3e --- /dev/null +++ b/src/test/ui/issue-21974.rs @@ -0,0 +1,28 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that (for now) we report an ambiguity error here, because +// specific trait relationships are ignored for the purposes of trait +// matching. This behavior should likely be improved such that this +// test passes. See #21974 for more details. + +trait Foo { + fn foo(self); +} + +fn foo<'a,'b,T>(x: &'a T, y: &'b T) //~ ERROR type annotations required + where &'a T : Foo, + &'b T : Foo +{ + x.foo(); + y.foo(); +} + +fn main() { } diff --git a/src/test/ui/issue-21974.stderr b/src/test/ui/issue-21974.stderr new file mode 100644 index 00000000000..4cc28c9ceb5 --- /dev/null +++ b/src/test/ui/issue-21974.stderr @@ -0,0 +1,21 @@ +error[E0283]: type annotations required: cannot resolve `&'a T: Foo` + --> $DIR/issue-21974.rs:20:1 + | +LL | / fn foo<'a,'b,T>(x: &'a T, y: &'b T) //~ ERROR type annotations required +LL | | where &'a T : Foo, +LL | | &'b T : Foo +LL | | { +LL | | x.foo(); +LL | | y.foo(); +LL | | } + | |_^ + | +note: required by `Foo` + --> $DIR/issue-21974.rs:16:1 + | +LL | trait Foo { + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/issue-22034.rs b/src/test/ui/issue-22034.rs new file mode 100644 index 00000000000..5271ea79917 --- /dev/null +++ b/src/test/ui/issue-22034.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(libc)] + +extern crate libc; + +fn main() { + let ptr: *mut () = 0 as *mut _; + let _: &mut Fn() = unsafe { + &mut *(ptr as *mut Fn()) + //~^ ERROR `(): std::ops::Fn<()>` is not satisfied + }; +} diff --git a/src/test/ui/issue-22034.stderr b/src/test/ui/issue-22034.stderr new file mode 100644 index 00000000000..bac62a1301a --- /dev/null +++ b/src/test/ui/issue-22034.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `(): std::ops::Fn<()>` is not satisfied + --> $DIR/issue-22034.rs:18:16 + | +LL | &mut *(ptr as *mut Fn()) + | ^^^ the trait `std::ops::Fn<()>` is not implemented for `()` + | + = note: required for the cast to the object type `dyn std::ops::Fn()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-22037.rs b/src/test/ui/issue-22037.rs new file mode 100644 index 00000000000..ffa881b49c5 --- /dev/null +++ b/src/test/ui/issue-22037.rs @@ -0,0 +1,27 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait A { + type Output; + fn a(&self) -> ::X; + //~^ ERROR cannot find associated type `X` in trait `A` +} + +impl A for u32 { + type Output = u32; + fn a(&self) -> u32 { + 0 + } +} + +fn main() { + let a: u32 = 0; + let b: u32 = a.a(); +} diff --git a/src/test/ui/issue-22037.stderr b/src/test/ui/issue-22037.stderr new file mode 100644 index 00000000000..ae739afc704 --- /dev/null +++ b/src/test/ui/issue-22037.stderr @@ -0,0 +1,9 @@ +error[E0576]: cannot find associated type `X` in trait `A` + --> $DIR/issue-22037.rs:13:33 + | +LL | fn a(&self) -> ::X; + | ^ not found in `A` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0576`. diff --git a/src/test/ui/issue-22289.rs b/src/test/ui/issue-22289.rs new file mode 100644 index 00000000000..c23fc4f3344 --- /dev/null +++ b/src/test/ui/issue-22289.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + 0 as &std::any::Any; //~ ERROR non-primitive cast +} diff --git a/src/test/ui/issue-22289.stderr b/src/test/ui/issue-22289.stderr new file mode 100644 index 00000000000..202b25f1a5b --- /dev/null +++ b/src/test/ui/issue-22289.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `i32` as `&(dyn std::any::Any + 'static)` + --> $DIR/issue-22289.rs:12:5 + | +LL | 0 as &std::any::Any; //~ ERROR non-primitive cast + | ^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/ui/issue-22312.rs b/src/test/ui/issue-22312.rs new file mode 100644 index 00000000000..2128c420630 --- /dev/null +++ b/src/test/ui/issue-22312.rs @@ -0,0 +1,27 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::Index; + +pub trait Array2D: Index { + fn rows(&self) -> usize; + fn columns(&self) -> usize; + fn get<'a>(&'a self, y: usize, x: usize) -> Option<&'a >::Output> { + if y >= self.rows() || x >= self.columns() { + return None; + } + let i = y * self.columns() + x; + let indexer = &(*self as &Index>::Output>); + //~^ERROR non-primitive cast + Some(indexer.index(i)) + } +} + +fn main() {} diff --git a/src/test/ui/issue-22312.stderr b/src/test/ui/issue-22312.stderr new file mode 100644 index 00000000000..abd712e5c29 --- /dev/null +++ b/src/test/ui/issue-22312.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `Self` as `&dyn std::ops::Index>::Output>` + --> $DIR/issue-22312.rs:21:24 + | +LL | let indexer = &(*self as &Index>::Output>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/ui/issue-22384.rs b/src/test/ui/issue-22384.rs new file mode 100644 index 00000000000..ae7fb01e057 --- /dev/null +++ b/src/test/ui/issue-22384.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { + fn foo(); +} + +fn main() { + <::foobar as Trait>::foo(); + //~^ ERROR cannot find associated type `foobar` in trait `Copy` +} diff --git a/src/test/ui/issue-22384.stderr b/src/test/ui/issue-22384.stderr new file mode 100644 index 00000000000..b8cc1e643e5 --- /dev/null +++ b/src/test/ui/issue-22384.stderr @@ -0,0 +1,9 @@ +error[E0576]: cannot find associated type `foobar` in trait `Copy` + --> $DIR/issue-22384.rs:16:21 + | +LL | <::foobar as Trait>::foo(); + | ^^^^^^ not found in `Copy` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0576`. diff --git a/src/test/ui/issue-22434.rs b/src/test/ui/issue-22434.rs new file mode 100644 index 00000000000..6effd02bac8 --- /dev/null +++ b/src/test/ui/issue-22434.rs @@ -0,0 +1,18 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Foo { + type A; +} + +type I<'a> = &'a (Foo + 'a); +//~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified + +fn main() {} diff --git a/src/test/ui/issue-22434.stderr b/src/test/ui/issue-22434.stderr new file mode 100644 index 00000000000..914da801ad4 --- /dev/null +++ b/src/test/ui/issue-22434.stderr @@ -0,0 +1,9 @@ +error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified + --> $DIR/issue-22434.rs:15:19 + | +LL | type I<'a> = &'a (Foo + 'a); + | ^^^^^^^^ missing associated type `A` value + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/ui/issue-22468.rs b/src/test/ui/issue-22468.rs new file mode 100644 index 00000000000..50e5dd2955d --- /dev/null +++ b/src/test/ui/issue-22468.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let foo = "bar"; + let x = foo("baz"); + //~^ ERROR: expected function, found `&str` +} + +fn foo(file: &str) -> bool { + true +} diff --git a/src/test/ui/issue-22468.stderr b/src/test/ui/issue-22468.stderr new file mode 100644 index 00000000000..034a076fbfe --- /dev/null +++ b/src/test/ui/issue-22468.stderr @@ -0,0 +1,11 @@ +error[E0618]: expected function, found `&str` + --> $DIR/issue-22468.rs:13:13 + | +LL | let foo = "bar"; + | --- `&str` defined here +LL | let x = foo("baz"); + | ^^^^^^^^^^ not a function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-22599.rs b/src/test/ui/issue-22599.rs new file mode 100644 index 00000000000..b9ea3583296 --- /dev/null +++ b/src/test/ui/issue-22599.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(unused_variables)] + +fn f(_: i32) {} + +fn main() { + let mut v = 0; + f(v); + v = match 0 { a => 0 }; //~ ERROR: unused variable: `a` + f(v); +} diff --git a/src/test/ui/issue-22599.stderr b/src/test/ui/issue-22599.stderr new file mode 100644 index 00000000000..19c9b94a430 --- /dev/null +++ b/src/test/ui/issue-22599.stderr @@ -0,0 +1,14 @@ +error: unused variable: `a` + --> $DIR/issue-22599.rs:18:19 + | +LL | v = match 0 { a => 0 }; //~ ERROR: unused variable: `a` + | ^ help: consider using `_a` instead + | +note: lint level defined here + --> $DIR/issue-22599.rs:11:9 + | +LL | #![deny(unused_variables)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-22603.rs b/src/test/ui/issue-22603.rs new file mode 100644 index 00000000000..d08f916b870 --- /dev/null +++ b/src/test/ui/issue-22603.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(unboxed_closures, fn_traits, rustc_attrs)] + +struct Foo; + +impl FnOnce<(A,)> for Foo { + type Output = (); + extern "rust-call" fn call_once(self, (_,): (A,)) { + } +} +#[rustc_error] +fn main() { //~ ERROR compilation successful + println!("{:?}", Foo("bar")); +} diff --git a/src/test/ui/issue-22603.stderr b/src/test/ui/issue-22603.stderr new file mode 100644 index 00000000000..b50a5a25a7a --- /dev/null +++ b/src/test/ui/issue-22603.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/issue-22603.rs:21:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | println!("{:?}", Foo("bar")); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-22673.rs b/src/test/ui/issue-22673.rs new file mode 100644 index 00000000000..2396007c3df --- /dev/null +++ b/src/test/ui/issue-22673.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Expr : PartialEq { + //~^ ERROR: cycle detected + type Item; +} + +fn main() {} diff --git a/src/test/ui/issue-22673.stderr b/src/test/ui/issue-22673.stderr new file mode 100644 index 00000000000..7e5b80c3711 --- /dev/null +++ b/src/test/ui/issue-22673.stderr @@ -0,0 +1,11 @@ +error[E0391]: cycle detected when computing the supertraits of `Expr` + --> $DIR/issue-22673.rs:11:1 + | +LL | trait Expr : PartialEq { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which again requires computing the supertraits of `Expr`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-22684.rs b/src/test/ui/issue-22684.rs new file mode 100644 index 00000000000..a791758ad17 --- /dev/null +++ b/src/test/ui/issue-22684.rs @@ -0,0 +1,28 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod foo { + pub struct Foo; + impl Foo { + fn bar(&self) {} + } + + pub trait Baz { + fn bar(&self) -> bool { true } + } + impl Baz for Foo {} +} + +fn main() { + use foo::Baz; + + // Check that `bar` resolves to the trait method, not the inherent impl method. + let _: () = foo::Foo.bar(); //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-22684.stderr b/src/test/ui/issue-22684.stderr new file mode 100644 index 00000000000..2c868bc8778 --- /dev/null +++ b/src/test/ui/issue-22684.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-22684.rs:27:17 + | +LL | let _: () = foo::Foo.bar(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^ expected (), found bool + | + = note: expected type `()` + found type `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-22706.rs b/src/test/ui/issue-22706.rs new file mode 100644 index 00000000000..3d9ec0a6581 --- /dev/null +++ b/src/test/ui/issue-22706.rs @@ -0,0 +1,13 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn is_copy::Copy>() {} +//~^ ERROR type parameters are not allowed on this type [E0109] +fn main() {} diff --git a/src/test/ui/issue-22706.stderr b/src/test/ui/issue-22706.stderr new file mode 100644 index 00000000000..2bbb3e5acad --- /dev/null +++ b/src/test/ui/issue-22706.stderr @@ -0,0 +1,9 @@ +error[E0109]: type parameters are not allowed on this type + --> $DIR/issue-22706.rs:11:29 + | +LL | fn is_copy::Copy>() {} + | ^^^ type parameter not allowed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/issue-22789.rs b/src/test/ui/issue-22789.rs new file mode 100644 index 00000000000..cba1c367bb9 --- /dev/null +++ b/src/test/ui/issue-22789.rs @@ -0,0 +1,17 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(unboxed_closures, fn_traits, rustc_attrs)] + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let k = |x: i32| { x + 1 }; + Fn::call(&k, (0,)); +} diff --git a/src/test/ui/issue-22789.stderr b/src/test/ui/issue-22789.stderr new file mode 100644 index 00000000000..afeae9c78ef --- /dev/null +++ b/src/test/ui/issue-22789.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/issue-22789.rs:14:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let k = |x: i32| { x + 1 }; +LL | | Fn::call(&k, (0,)); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-2281-part1.rs b/src/test/ui/issue-2281-part1.rs new file mode 100644 index 00000000000..e3fd9c48a52 --- /dev/null +++ b/src/test/ui/issue-2281-part1.rs @@ -0,0 +1,11 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { println!("{}", foobar); } //~ ERROR cannot find value `foobar` in this scope diff --git a/src/test/ui/issue-2281-part1.stderr b/src/test/ui/issue-2281-part1.stderr new file mode 100644 index 00000000000..e88cfe2b2ac --- /dev/null +++ b/src/test/ui/issue-2281-part1.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `foobar` in this scope + --> $DIR/issue-2281-part1.rs:11:28 + | +LL | fn main() { println!("{}", foobar); } //~ ERROR cannot find value `foobar` in this scope + | ^^^^^^ 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/issue-22874.rs b/src/test/ui/issue-22874.rs new file mode 100644 index 00000000000..e0a87b3a174 --- /dev/null +++ b/src/test/ui/issue-22874.rs @@ -0,0 +1,20 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Table { + rows: [[String]], + //~^ ERROR the size for values of type +} + +fn f(table: &Table) -> &[String] { + &table.rows[0] +} + +fn main() {} diff --git a/src/test/ui/issue-22874.stderr b/src/test/ui/issue-22874.stderr new file mode 100644 index 00000000000..64c77a6a666 --- /dev/null +++ b/src/test/ui/issue-22874.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `[std::string::String]` cannot be known at compilation time + --> $DIR/issue-22874.rs:12:5 + | +LL | rows: [[String]], + | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[std::string::String]` + = note: to learn more, visit + = note: slice and array elements must have `Sized` type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-22933-1.rs b/src/test/ui/issue-22933-1.rs new file mode 100644 index 00000000000..afb972faaca --- /dev/null +++ b/src/test/ui/issue-22933-1.rs @@ -0,0 +1,35 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +struct CNFParser { + token: char, +} + +impl CNFParser { + fn is_whitespace(c: char) -> bool { + c == ' ' || c == '\n' + } + + fn consume_whitespace(&mut self) { + self.consume_while(&(CNFParser::is_whitespace)) + } + + fn consume_while(&mut self, p: &Fn(char) -> bool) { + while p(self.token) { + return + } + } +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-22933-1.stderr b/src/test/ui/issue-22933-1.stderr new file mode 100644 index 00000000000..eaebebe3b11 --- /dev/null +++ b/src/test/ui/issue-22933-1.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-22933-1.rs:35:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-22933-3.rs b/src/test/ui/issue-22933-3.rs new file mode 100644 index 00000000000..62adae41adf --- /dev/null +++ b/src/test/ui/issue-22933-3.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const FOO: [u32; u8::MIN as usize] = []; +//~^ ERROR no associated item named `MIN` found for type `u8` + +fn main() {} diff --git a/src/test/ui/issue-22933-3.stderr b/src/test/ui/issue-22933-3.stderr new file mode 100644 index 00000000000..3d4d2df4d32 --- /dev/null +++ b/src/test/ui/issue-22933-3.stderr @@ -0,0 +1,9 @@ +error[E0599]: no associated item named `MIN` found for type `u8` in the current scope + --> $DIR/issue-22933-3.rs:11:18 + | +LL | const FOO: [u32; u8::MIN as usize] = []; + | ^^^^^^^ associated item not found in `u8` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-23024.rs b/src/test/ui/issue-23024.rs new file mode 100644 index 00000000000..5d9b49f486c --- /dev/null +++ b/src/test/ui/issue-23024.rs @@ -0,0 +1,23 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(box_syntax)] +use std::any::Any; + +fn main() +{ + fn h(x:i32) -> i32 {3*x} + let mut vfnfer:Vec> = vec![]; + vfnfer.push(box h); + println!("{:?}",(vfnfer[0] as Fn)(3)); + //~^ ERROR the precise format of `Fn`-family traits' + //~| ERROR wrong number of type arguments: expected 1, found 0 [E0243] + //~| ERROR the value of the associated type `Output` (from the trait `std::ops::FnOnce`) +} diff --git a/src/test/ui/issue-23024.stderr b/src/test/ui/issue-23024.stderr new file mode 100644 index 00000000000..39c79d8f14e --- /dev/null +++ b/src/test/ui/issue-23024.stderr @@ -0,0 +1,24 @@ +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/issue-23024.rs:19:35 + | +LL | println!("{:?}",(vfnfer[0] as Fn)(3)); + | ^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error[E0243]: wrong number of type arguments: expected 1, found 0 + --> $DIR/issue-23024.rs:19:35 + | +LL | println!("{:?}",(vfnfer[0] as Fn)(3)); + | ^^ expected 1 type argument + +error[E0191]: the value of the associated type `Output` (from the trait `std::ops::FnOnce`) must be specified + --> $DIR/issue-23024.rs:19:35 + | +LL | println!("{:?}",(vfnfer[0] as Fn)(3)); + | ^^ missing associated type `Output` value + +error: aborting due to 3 previous errors + +Some errors occurred: E0191, E0243, E0658. +For more information about an error, try `rustc --explain E0191`. diff --git a/src/test/ui/issue-23046.rs b/src/test/ui/issue-23046.rs new file mode 100644 index 00000000000..670706b7a9a --- /dev/null +++ b/src/test/ui/issue-23046.rs @@ -0,0 +1,30 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub enum Expr<'var, VAR> { + Let(Box>, + Box Fn(Expr<'v, VAR>) -> Expr<'v, VAR> + 'var>) +} + +pub fn add<'var, VAR> + (a: Expr<'var, VAR>, b: Expr<'var, VAR>) -> Expr<'var, VAR> { + loop {} +} + +pub fn let_<'var, VAR, F: for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR>> + (a: Expr<'var, VAR>, b: F) -> Expr<'var, VAR> { + loop {} +} + +fn main() { + let ex = |x| { //~ ERROR type annotations needed + let_(add(x,x), |y| { + let_(add(x, x), |x|x)})}; +} diff --git a/src/test/ui/issue-23046.stderr b/src/test/ui/issue-23046.stderr new file mode 100644 index 00000000000..3e5b4ec91d7 --- /dev/null +++ b/src/test/ui/issue-23046.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/issue-23046.rs:27:15 + | +LL | let ex = |x| { //~ ERROR type annotations needed + | ^ consider giving this closure parameter a type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-23073.rs b/src/test/ui/issue-23073.rs new file mode 100644 index 00000000000..2d219177a80 --- /dev/null +++ b/src/test/ui/issue-23073.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_type_defaults)] + +trait Foo { type T; } +trait Bar { + type Foo: Foo; + type FooT = <::Foo>::T; //~ ERROR ambiguous associated type +} + +fn main() {} diff --git a/src/test/ui/issue-23073.stderr b/src/test/ui/issue-23073.stderr new file mode 100644 index 00000000000..44b2128af0a --- /dev/null +++ b/src/test/ui/issue-23073.stderr @@ -0,0 +1,11 @@ +error[E0223]: ambiguous associated type + --> $DIR/issue-23073.rs:16:17 + | +LL | type FooT = <::Foo>::T; //~ ERROR ambiguous associated type + | ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<::Foo as Trait>::T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0223`. diff --git a/src/test/ui/issue-23080-2.rs b/src/test/ui/issue-23080-2.rs new file mode 100644 index 00000000000..fc365a4b9aa --- /dev/null +++ b/src/test/ui/issue-23080-2.rs @@ -0,0 +1,27 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-tidy-linelength + +//~^^^^^^^^^^^^ ERROR + +#![feature(optin_builtin_traits)] + +unsafe auto trait Trait { +//~^ ERROR E0380 + type Output; +} + +fn call_method(x: T) {} + +fn main() { + // ICE + call_method(()); +} diff --git a/src/test/ui/issue-23080-2.stderr b/src/test/ui/issue-23080-2.stderr new file mode 100644 index 00000000000..dda7fbd69cf --- /dev/null +++ b/src/test/ui/issue-23080-2.stderr @@ -0,0 +1,18 @@ +error[E0380]: auto traits cannot have methods or associated items + --> $DIR/issue-23080-2.rs:17:1 + | +LL | / unsafe auto trait Trait { +LL | | //~^ ERROR E0380 +LL | | type Output; +LL | | } + | |_^ + +error[E0275]: overflow evaluating the requirement `<() as Trait>::Output` + | + = note: required because of the requirements on the impl of `Trait` for `()` + = note: required because of the requirements on the impl of `Trait` for `()` + +error: aborting due to 2 previous errors + +Some errors occurred: E0275, E0380. +For more information about an error, try `rustc --explain E0275`. diff --git a/src/test/ui/issue-23080.rs b/src/test/ui/issue-23080.rs new file mode 100644 index 00000000000..153b6fd07e6 --- /dev/null +++ b/src/test/ui/issue-23080.rs @@ -0,0 +1,29 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-tidy-linelength + +#![feature(optin_builtin_traits)] + +unsafe auto trait Trait { +//~^ ERROR E0380 + fn method(&self) { + println!("Hello"); + } +} + +fn call_method(x: T) { + x.method(); +} + +fn main() { + // ICE + call_method(()); +} diff --git a/src/test/ui/issue-23080.stderr b/src/test/ui/issue-23080.stderr new file mode 100644 index 00000000000..43e6f296033 --- /dev/null +++ b/src/test/ui/issue-23080.stderr @@ -0,0 +1,14 @@ +error[E0380]: auto traits cannot have methods or associated items + --> $DIR/issue-23080.rs:15:1 + | +LL | / unsafe auto trait Trait { +LL | | //~^ ERROR E0380 +LL | | fn method(&self) { +LL | | println!("Hello"); +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0380`. diff --git a/src/test/ui/issue-23122-1.rs b/src/test/ui/issue-23122-1.rs new file mode 100644 index 00000000000..36d8450848d --- /dev/null +++ b/src/test/ui/issue-23122-1.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Next { + type Next: Next; +} + +struct GetNext { t: T } + +impl Next for GetNext { + //~^ ERROR overflow evaluating the requirement + type Next = as Next>::Next; +} + +fn main() {} diff --git a/src/test/ui/issue-23122-1.stderr b/src/test/ui/issue-23122-1.stderr new file mode 100644 index 00000000000..a0e5386c111 --- /dev/null +++ b/src/test/ui/issue-23122-1.stderr @@ -0,0 +1,9 @@ +error[E0275]: overflow evaluating the requirement ` as Next>::Next` + --> $DIR/issue-23122-1.rs:17:15 + | +LL | impl Next for GetNext { + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/issue-23122-2.rs b/src/test/ui/issue-23122-2.rs new file mode 100644 index 00000000000..faaf78f894b --- /dev/null +++ b/src/test/ui/issue-23122-2.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Next { + type Next: Next; +} + +struct GetNext { t: T } + +impl Next for GetNext { + //~^ ERROR overflow evaluating the requirement + type Next = as Next>::Next; +} + +fn main() {} diff --git a/src/test/ui/issue-23122-2.stderr b/src/test/ui/issue-23122-2.stderr new file mode 100644 index 00000000000..c43f8d77823 --- /dev/null +++ b/src/test/ui/issue-23122-2.stderr @@ -0,0 +1,11 @@ +error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next` + --> $DIR/issue-23122-2.rs:17:15 + | +LL | impl Next for GetNext { + | ^^^^ + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/issue-23253.rs b/src/test/ui/issue-23253.rs new file mode 100644 index 00000000000..626604a87a7 --- /dev/null +++ b/src/test/ui/issue-23253.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { Bar } + +fn main() { + Foo::Bar.a; + //~^ no field `a` on type `Foo` +} diff --git a/src/test/ui/issue-23253.stderr b/src/test/ui/issue-23253.stderr new file mode 100644 index 00000000000..f14ee510bd8 --- /dev/null +++ b/src/test/ui/issue-23253.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `a` on type `Foo` + --> $DIR/issue-23253.rs:14:14 + | +LL | Foo::Bar.a; + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-23281.rs b/src/test/ui/issue-23281.rs new file mode 100644 index 00000000000..5de00eb8f68 --- /dev/null +++ b/src/test/ui/issue-23281.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-tidy-linelength + +pub struct Struct; + +impl Struct { + pub fn function(funs: Vec ()>) {} + //~^ ERROR the size for values of type +} + +fn main() {} diff --git a/src/test/ui/issue-23281.stderr b/src/test/ui/issue-23281.stderr new file mode 100644 index 00000000000..ee5a9930df2 --- /dev/null +++ b/src/test/ui/issue-23281.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `(dyn std::ops::Fn() + 'static)` cannot be known at compilation time + --> $DIR/issue-23281.rs:16:5 + | +LL | pub fn function(funs: Vec ()>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() + 'static)` + = note: to learn more, visit + = note: required by `std::vec::Vec` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-2330.rs b/src/test/ui/issue-2330.rs new file mode 100644 index 00000000000..f1a282695ac --- /dev/null +++ b/src/test/ui/issue-2330.rs @@ -0,0 +1,23 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum chan { } + +trait channel { + fn send(&self, v: T); +} + +// `chan` is not a trait, it's an enum +impl chan for isize { //~ ERROR expected trait, found enum `chan` + fn send(&self, v: isize) { panic!() } +} + +fn main() { +} diff --git a/src/test/ui/issue-2330.stderr b/src/test/ui/issue-2330.stderr new file mode 100644 index 00000000000..6b1d5e3b219 --- /dev/null +++ b/src/test/ui/issue-2330.stderr @@ -0,0 +1,9 @@ +error[E0404]: expected trait, found enum `chan` + --> $DIR/issue-2330.rs:18:6 + | +LL | impl chan for isize { //~ ERROR expected trait, found enum `chan` + | ^^^^ not a trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0404`. diff --git a/src/test/ui/issue-23589.rs b/src/test/ui/issue-23589.rs new file mode 100644 index 00000000000..1c1d42da029 --- /dev/null +++ b/src/test/ui/issue-23589.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let v: Vec(&str) = vec!['1', '2']; + //~^ ERROR parenthesized parameters may only be used with a trait +} diff --git a/src/test/ui/issue-23589.stderr b/src/test/ui/issue-23589.stderr new file mode 100644 index 00000000000..f0c07b380b4 --- /dev/null +++ b/src/test/ui/issue-23589.stderr @@ -0,0 +1,9 @@ +error[E0214]: parenthesized parameters may only be used with a trait + --> $DIR/issue-23589.rs:12:15 + | +LL | let v: Vec(&str) = vec!['1', '2']; + | ^^^^^^ only traits may use parentheses + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0214`. diff --git a/src/test/ui/issue-23595-1.rs b/src/test/ui/issue-23595-1.rs new file mode 100644 index 00000000000..a3422d859c6 --- /dev/null +++ b/src/test/ui/issue-23595-1.rs @@ -0,0 +1,26 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_type_defaults)] + +use std::ops::{Index}; + +trait Hierarchy { + type Value; + type ChildKey; + type Children = Index; + //~^ ERROR: the value of the associated type `ChildKey` + //~^^ ERROR: the value of the associated type `Children` + //~^^^ ERROR: the value of the associated type `Value` + + fn data(&self) -> Option<(Self::Value, Self::Children)>; +} + +fn main() {} diff --git a/src/test/ui/issue-23595-1.stderr b/src/test/ui/issue-23595-1.stderr new file mode 100644 index 00000000000..624534eb8d7 --- /dev/null +++ b/src/test/ui/issue-23595-1.stderr @@ -0,0 +1,21 @@ +error[E0191]: the value of the associated type `ChildKey` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:18:50 + | +LL | type Children = Index; + | ^^^^^^^^^ missing associated type `ChildKey` value + +error[E0191]: the value of the associated type `Children` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:18:50 + | +LL | type Children = Index; + | ^^^^^^^^^ missing associated type `Children` value + +error[E0191]: the value of the associated type `Value` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:18:50 + | +LL | type Children = Index; + | ^^^^^^^^^ missing associated type `Value` value + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/ui/issue-23595-2.rs b/src/test/ui/issue-23595-2.rs new file mode 100644 index 00000000000..6a3ce03fce5 --- /dev/null +++ b/src/test/ui/issue-23595-2.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_type_defaults)] + +pub struct C {a:AType} + +pub trait A { + type B = C; + //~^ ERROR: associated type `anything_here_kills_it` not found for `Self` +} + +fn main() {} diff --git a/src/test/ui/issue-23595-2.stderr b/src/test/ui/issue-23595-2.stderr new file mode 100644 index 00000000000..5ddaab6abfe --- /dev/null +++ b/src/test/ui/issue-23595-2.stderr @@ -0,0 +1,9 @@ +error[E0220]: associated type `anything_here_kills_it` not found for `Self` + --> $DIR/issue-23595-2.rs:16:16 + | +LL | type B = C; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated type `anything_here_kills_it` not found + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0220`. diff --git a/src/test/ui/issue-23966.rs b/src/test/ui/issue-23966.rs new file mode 100644 index 00000000000..544d3c8af20 --- /dev/null +++ b/src/test/ui/issue-23966.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + "".chars().fold(|_, _| (), ()); + //~^ ERROR E0277 +} diff --git a/src/test/ui/issue-23966.stderr b/src/test/ui/issue-23966.stderr new file mode 100644 index 00000000000..07d2cfbf55f --- /dev/null +++ b/src/test/ui/issue-23966.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `(): std::ops::FnMut<(_, char)>` is not satisfied + --> $DIR/issue-23966.rs:12:16 + | +LL | "".chars().fold(|_, _| (), ()); + | ^^^^ the trait `std::ops::FnMut<(_, char)>` is not implemented for `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-24013.rs b/src/test/ui/issue-24013.rs new file mode 100644 index 00000000000..a7232781f6f --- /dev/null +++ b/src/test/ui/issue-24013.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + use std::mem::{transmute, swap}; + let a = 1; + let b = 2; + unsafe {swap::<&mut _>(transmute(&a), transmute(&b))}; + //~^ ERROR type annotations needed +} diff --git a/src/test/ui/issue-24013.stderr b/src/test/ui/issue-24013.stderr new file mode 100644 index 00000000000..324e705e5a1 --- /dev/null +++ b/src/test/ui/issue-24013.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/issue-24013.rs:15:20 + | +LL | unsafe {swap::<&mut _>(transmute(&a), transmute(&b))}; + | ^^^^^^ cannot infer type for `_` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-24204.rs b/src/test/ui/issue-24204.rs new file mode 100644 index 00000000000..2a012da0083 --- /dev/null +++ b/src/test/ui/issue-24204.rs @@ -0,0 +1,27 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(dead_code)] + +trait MultiDispatch { + type O; +} + +trait Trait: Sized { + type A: MultiDispatch; + type B; + + fn new(u: U) -> >::O where Self::A : MultiDispatch; +} + +fn test>(b: i32) -> T where T::A: MultiDispatch { T::new(b) } +//~^ ERROR type mismatch resolving + +fn main() {} diff --git a/src/test/ui/issue-24204.stderr b/src/test/ui/issue-24204.stderr new file mode 100644 index 00000000000..809db284032 --- /dev/null +++ b/src/test/ui/issue-24204.stderr @@ -0,0 +1,17 @@ +error[E0271]: type mismatch resolving `<::A as MultiDispatch>::O == T` + --> $DIR/issue-24204.rs:24:1 + | +LL | fn test>(b: i32) -> T where T::A: MultiDispatch { T::new(b) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found type parameter + | + = note: expected type `<::A as MultiDispatch>::O` + found type `T` +note: required by `Trait` + --> $DIR/issue-24204.rs:17:1 + | +LL | trait Trait: Sized { + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/issue-24267-flow-exit.nll.stderr b/src/test/ui/issue-24267-flow-exit.nll.stderr new file mode 100644 index 00000000000..cf3553c6b0d --- /dev/null +++ b/src/test/ui/issue-24267-flow-exit.nll.stderr @@ -0,0 +1,15 @@ +error[E0381]: borrow of possibly uninitialized variable: `x` + --> $DIR/issue-24267-flow-exit.rs:22:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error[E0381]: borrow of possibly uninitialized variable: `x` + --> $DIR/issue-24267-flow-exit.rs:28:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/issue-24267-flow-exit.rs b/src/test/ui/issue-24267-flow-exit.rs new file mode 100644 index 00000000000..4aca6bf38e1 --- /dev/null +++ b/src/test/ui/issue-24267-flow-exit.rs @@ -0,0 +1,29 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Ensure that we reject code when a nonlocal exit (`break`, +// `continue`) causes us to pop over a needed assignment. + +pub fn main() { + foo1(); + foo2(); +} + +pub fn foo1() { + let x: i32; + loop { x = break; } + println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` +} + +pub fn foo2() { + let x: i32; + for _ in 0..10 { x = continue; } + println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` +} diff --git a/src/test/ui/issue-24267-flow-exit.stderr b/src/test/ui/issue-24267-flow-exit.stderr new file mode 100644 index 00000000000..7d1d5ac7df6 --- /dev/null +++ b/src/test/ui/issue-24267-flow-exit.stderr @@ -0,0 +1,15 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/issue-24267-flow-exit.rs:22:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/issue-24267-flow-exit.rs:28:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/issue-24322.rs b/src/test/ui/issue-24322.rs new file mode 100644 index 00000000000..bb726aca921 --- /dev/null +++ b/src/test/ui/issue-24322.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct B; + +impl B { + fn func(&self) -> u32 { 42 } +} + +fn main() { + let x: &fn(&B) -> u32 = &B::func; //~ ERROR mismatched types +} diff --git a/src/test/ui/issue-24322.stderr b/src/test/ui/issue-24322.stderr new file mode 100644 index 00000000000..d2cad8d3464 --- /dev/null +++ b/src/test/ui/issue-24322.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-24322.rs:18:29 + | +LL | let x: &fn(&B) -> u32 = &B::func; //~ ERROR mismatched types + | ^^^^^^^^ expected fn pointer, found fn item + | + = note: expected type `&for<'r> fn(&'r B) -> u32` + found type `&for<'r> fn(&'r B) -> u32 {B::func}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-24352.rs b/src/test/ui/issue-24352.rs new file mode 100644 index 00000000000..4b077314056 --- /dev/null +++ b/src/test/ui/issue-24352.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + 1.0f64 - 1.0; + 1.0f64 - 1 //~ ERROR E0277 +} diff --git a/src/test/ui/issue-24352.stderr b/src/test/ui/issue-24352.stderr new file mode 100644 index 00000000000..8a4169055e7 --- /dev/null +++ b/src/test/ui/issue-24352.stderr @@ -0,0 +1,11 @@ +error[E0277]: cannot subtract `{integer}` from `f64` + --> $DIR/issue-24352.rs:13:12 + | +LL | 1.0f64 - 1 //~ ERROR E0277 + | ^ no implementation for `f64 - {integer}` + | + = help: the trait `std::ops::Sub<{integer}>` is not implemented for `f64` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-24357.nll.stderr b/src/test/ui/issue-24357.nll.stderr new file mode 100644 index 00000000000..f601a6fbc88 --- /dev/null +++ b/src/test/ui/issue-24357.nll.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `x` + --> $DIR/issue-24357.rs:16:12 + | +LL | let f = move || { let y = x; }; + | ---------------------- value moved here +LL | //~^ NOTE value moved (into closure) here +LL | let z = x; + | ^ value used here after move + | + = note: move occurs because `x` has type `NoCopy`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-24357.rs b/src/test/ui/issue-24357.rs new file mode 100644 index 00000000000..016ce93a0bd --- /dev/null +++ b/src/test/ui/issue-24357.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct NoCopy; +fn main() { + let x = NoCopy; + let f = move || { let y = x; }; + //~^ NOTE value moved (into closure) here + let z = x; + //~^ ERROR use of moved value: `x` + //~| NOTE value used here after move + //~| NOTE move occurs because `x` has type `NoCopy` +} diff --git a/src/test/ui/issue-24357.stderr b/src/test/ui/issue-24357.stderr new file mode 100644 index 00000000000..be531ec8567 --- /dev/null +++ b/src/test/ui/issue-24357.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `x` + --> $DIR/issue-24357.rs:16:8 + | +LL | let f = move || { let y = x; }; + | ------- value moved (into closure) here +LL | //~^ NOTE value moved (into closure) here +LL | let z = x; + | ^ value used here after move + | + = note: move occurs because `x` has type `NoCopy`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-24363.rs b/src/test/ui/issue-24363.rs new file mode 100644 index 00000000000..619ad74ad00 --- /dev/null +++ b/src/test/ui/issue-24363.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + 1.create_a_type_error[ //~ `{integer}` is a primitive type and therefore doesn't have fields + ()+() //~ ERROR binary operation `+` cannot be applied + // ^ ensure that we typeck the inner expression ^ + ]; +} diff --git a/src/test/ui/issue-24363.stderr b/src/test/ui/issue-24363.stderr new file mode 100644 index 00000000000..2695d6acea8 --- /dev/null +++ b/src/test/ui/issue-24363.stderr @@ -0,0 +1,18 @@ +error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields + --> $DIR/issue-24363.rs:12:7 + | +LL | 1.create_a_type_error[ //~ `{integer}` is a primitive type and therefore doesn't have fields + | ^^^^^^^^^^^^^^^^^^^ + +error[E0369]: binary operation `+` cannot be applied to type `()` + --> $DIR/issue-24363.rs:13:9 + | +LL | ()+() //~ ERROR binary operation `+` cannot be applied + | ^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `()` + +error: aborting due to 2 previous errors + +Some errors occurred: E0369, E0610. +For more information about an error, try `rustc --explain E0369`. diff --git a/src/test/ui/issue-24365.rs b/src/test/ui/issue-24365.rs new file mode 100644 index 00000000000..72df6fb5999 --- /dev/null +++ b/src/test/ui/issue-24365.rs @@ -0,0 +1,29 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub enum Attribute { + Code {attr_name_idx: u16}, +} + +pub enum Foo { + Bar +} + +fn test(a: Foo) { + println!("{}", a.b); //~ no field `b` on type `Foo` +} + +fn main() { + let x = Attribute::Code { + attr_name_idx: 42, + }; + let z = (&x).attr_name_idx; //~ no field `attr_name_idx` on type `&Attribute` + let y = x.attr_name_idx; //~ no field `attr_name_idx` on type `Attribute` +} diff --git a/src/test/ui/issue-24365.stderr b/src/test/ui/issue-24365.stderr new file mode 100644 index 00000000000..0ad4674ca86 --- /dev/null +++ b/src/test/ui/issue-24365.stderr @@ -0,0 +1,21 @@ +error[E0609]: no field `b` on type `Foo` + --> $DIR/issue-24365.rs:20:22 + | +LL | println!("{}", a.b); //~ no field `b` on type `Foo` + | ^ + +error[E0609]: no field `attr_name_idx` on type `&Attribute` + --> $DIR/issue-24365.rs:27:18 + | +LL | let z = (&x).attr_name_idx; //~ no field `attr_name_idx` on type `&Attribute` + | ^^^^^^^^^^^^^ + +error[E0609]: no field `attr_name_idx` on type `Attribute` + --> $DIR/issue-24365.rs:28:15 + | +LL | let y = x.attr_name_idx; //~ no field `attr_name_idx` on type `Attribute` + | ^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/ui/issue-24446.rs b/src/test/ui/issue-24446.rs new file mode 100644 index 00000000000..a9c7978642d --- /dev/null +++ b/src/test/ui/issue-24446.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + static foo: Fn() -> u32 = || -> u32 { + //~^ ERROR mismatched types + //~| ERROR the size for values of type + 0 + }; +} diff --git a/src/test/ui/issue-24446.stderr b/src/test/ui/issue-24446.stderr new file mode 100644 index 00000000000..2c13dd36558 --- /dev/null +++ b/src/test/ui/issue-24446.stderr @@ -0,0 +1,33 @@ +error[E0308]: mismatched types + --> $DIR/issue-24446.rs:12:31 + | +LL | static foo: Fn() -> u32 = || -> u32 { + | _______________________________^ +LL | | //~^ ERROR mismatched types +LL | | //~| ERROR the size for values of type +LL | | 0 +LL | | }; + | |_____^ expected trait std::ops::Fn, found closure + | + = note: expected type `(dyn std::ops::Fn() -> u32 + 'static)` + found type `[closure@$DIR/issue-24446.rs:12:31: 16:6]` + +error[E0277]: the size for values of type `(dyn std::ops::Fn() -> u32 + 'static)` cannot be known at compilation time + --> $DIR/issue-24446.rs:12:31 + | +LL | static foo: Fn() -> u32 = || -> u32 { + | _______________________________^ +LL | | //~^ ERROR mismatched types +LL | | //~| ERROR the size for values of type +LL | | 0 +LL | | }; + | |_____^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() -> u32 + 'static)` + = note: to learn more, visit + = note: constant expressions must have a statically known size + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-24682.rs b/src/test/ui/issue-24682.rs new file mode 100644 index 00000000000..0e872f71df4 --- /dev/null +++ b/src/test/ui/issue-24682.rs @@ -0,0 +1,31 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait A: Sized { + type N; + fn x() -> + Self< + N= //~ ERROR associated type bindings are not allowed here + Self::N> { + loop {} + } + fn y(&self) -> + std + //~ ERROR associated type bindings are not allowed here + ::option::Option<()> + { None } + fn z(&self) -> + u32 //~ ERROR associated type bindings are not allowed here + { 42 } + +} + +fn main() { +} diff --git a/src/test/ui/issue-24682.stderr b/src/test/ui/issue-24682.stderr new file mode 100644 index 00000000000..1e16cb72a09 --- /dev/null +++ b/src/test/ui/issue-24682.stderr @@ -0,0 +1,22 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-24682.rs:15:11 + | +LL | / N= //~ ERROR associated type bindings are not allowed here +LL | | Self::N> { + | |_________________^ associated type not allowed here + +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-24682.rs:21:13 + | +LL | //~ ERROR associated type bindings are not allowed here + | ^^^^ associated type not allowed here + +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-24682.rs:25:13 + | +LL | u32 //~ ERROR associated type bindings are not allowed here + | ^^^^ associated type not allowed here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0229`. diff --git a/src/test/ui/issue-24819.rs b/src/test/ui/issue-24819.rs new file mode 100644 index 00000000000..52f5f1cd079 --- /dev/null +++ b/src/test/ui/issue-24819.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::collections::HashSet; + +fn main() { + let mut v = Vec::new(); + foo(&mut v); + //~^ ERROR mismatched types + //~| expected struct `std::collections::HashSet`, found struct `std::vec::Vec` +} + +fn foo(h: &mut HashSet) { +} diff --git a/src/test/ui/issue-24819.stderr b/src/test/ui/issue-24819.stderr new file mode 100644 index 00000000000..33034b7072b --- /dev/null +++ b/src/test/ui/issue-24819.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-24819.rs:15:9 + | +LL | foo(&mut v); + | ^^^^^^ expected struct `std::collections::HashSet`, found struct `std::vec::Vec` + | + = note: expected type `&mut std::collections::HashSet` + found type `&mut std::vec::Vec<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-24883.rs b/src/test/ui/issue-24883.rs new file mode 100644 index 00000000000..097f2a5630c --- /dev/null +++ b/src/test/ui/issue-24883.rs @@ -0,0 +1,28 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +mod a { + pub mod b { pub struct Foo; } + + pub mod c { + use super::b; + pub struct Bar(pub b::Foo); + } + + pub use self::c::*; +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let _ = a::c::Bar(a::b::Foo); + let _ = a::Bar(a::b::Foo); +} diff --git a/src/test/ui/issue-24883.stderr b/src/test/ui/issue-24883.stderr new file mode 100644 index 00000000000..4b17747f109 --- /dev/null +++ b/src/test/ui/issue-24883.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/issue-24883.rs:25:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let _ = a::c::Bar(a::b::Foo); +LL | | let _ = a::Bar(a::b::Foo); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-25076.rs b/src/test/ui/issue-25076.rs new file mode 100644 index 00000000000..1c255b4e631 --- /dev/null +++ b/src/test/ui/issue-25076.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S; + +trait InOut { type Out; } + +fn do_fold>(init: B, f: F) {} + +fn bot() -> T { loop {} } + +fn main() { + do_fold(bot(), ()); //~ ERROR `(): InOut<_>` is not satisfied +} diff --git a/src/test/ui/issue-25076.stderr b/src/test/ui/issue-25076.stderr new file mode 100644 index 00000000000..13ee70fdd9b --- /dev/null +++ b/src/test/ui/issue-25076.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `(): InOut<_>` is not satisfied + --> $DIR/issue-25076.rs:20:5 + | +LL | do_fold(bot(), ()); //~ ERROR `(): InOut<_>` is not satisfied + | ^^^^^^^ the trait `InOut<_>` is not implemented for `()` + | +note: required by `do_fold` + --> $DIR/issue-25076.rs:15:1 + | +LL | fn do_fold>(init: B, f: F) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-25368.rs b/src/test/ui/issue-25368.rs new file mode 100644 index 00000000000..e70c0050221 --- /dev/null +++ b/src/test/ui/issue-25368.rs @@ -0,0 +1,23 @@ +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::sync::mpsc::channel; +use std::thread::spawn; +use std::marker::PhantomData; + +struct Foo {foo: PhantomData} + +fn main() { + let (tx, rx) = channel(); + + spawn(move || { + tx.send(Foo{ foo: PhantomData }); //~ ERROR E0282 + }); +} diff --git a/src/test/ui/issue-25368.stderr b/src/test/ui/issue-25368.stderr new file mode 100644 index 00000000000..56cbef7b89c --- /dev/null +++ b/src/test/ui/issue-25368.stderr @@ -0,0 +1,12 @@ +error[E0282]: type annotations needed + --> $DIR/issue-25368.rs:21:17 + | +LL | let (tx, rx) = channel(); + | -------- consider giving the pattern a type +... +LL | tx.send(Foo{ foo: PhantomData }); //~ ERROR E0282 + | ^^^ cannot infer type for `T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issue-25386.rs b/src/test/ui/issue-25386.rs new file mode 100644 index 00000000000..b2775db5e75 --- /dev/null +++ b/src/test/ui/issue-25386.rs @@ -0,0 +1,38 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod stuff { + pub struct Item { + c_object: Box, + } + pub struct CObj { + name: Option, + } + impl Item { + pub fn new() -> Item { + Item { + c_object: Box::new(CObj { name: None }), + } + } + } +} + +macro_rules! check_ptr_exist { + ($var:expr, $member:ident) => ( + (*$var.c_object).$member.is_some() + //~^ ERROR field `name` of struct `stuff::CObj` is private + //~^^ ERROR field `c_object` of struct `stuff::Item` is private + ); +} + +fn main() { + let item = stuff::Item::new(); + println!("{}", check_ptr_exist!(item, name)); +} diff --git a/src/test/ui/issue-25386.stderr b/src/test/ui/issue-25386.stderr new file mode 100644 index 00000000000..986961d36c9 --- /dev/null +++ b/src/test/ui/issue-25386.stderr @@ -0,0 +1,21 @@ +error[E0616]: field `c_object` of struct `stuff::Item` is private + --> $DIR/issue-25386.rs:29:11 + | +LL | (*$var.c_object).$member.is_some() + | ^^^^^^^^^^^^^ +... +LL | println!("{}", check_ptr_exist!(item, name)); + | ---------------------------- in this macro invocation + +error[E0616]: field `name` of struct `stuff::CObj` is private + --> $DIR/issue-25386.rs:29:9 + | +LL | (*$var.c_object).$member.is_some() + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | println!("{}", check_ptr_exist!(item, name)); + | ---------------------------- in this macro invocation + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/ui/issue-25396.rs b/src/test/ui/issue-25396.rs new file mode 100644 index 00000000000..7cfcbc5471a --- /dev/null +++ b/src/test/ui/issue-25396.rs @@ -0,0 +1,37 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use foo::baz; +use bar::baz; //~ ERROR the name `baz` is defined multiple times + +use foo::Quux; +use bar::Quux; //~ ERROR the name `Quux` is defined multiple times + +use foo::blah; +use bar::blah; //~ ERROR the name `blah` is defined multiple times + +use foo::WOMP; +use bar::WOMP; //~ ERROR the name `WOMP` is defined multiple times + +fn main() {} + +mod foo { + pub mod baz {} + pub trait Quux { } + pub type blah = (f64, u32); + pub const WOMP: u8 = 5; +} + +mod bar { + pub mod baz {} + pub type Quux = i32; + pub struct blah { x: i8 } + pub const WOMP: i8 = -5; +} diff --git a/src/test/ui/issue-25396.stderr b/src/test/ui/issue-25396.stderr new file mode 100644 index 00000000000..1946f391672 --- /dev/null +++ b/src/test/ui/issue-25396.stderr @@ -0,0 +1,59 @@ +error[E0252]: the name `baz` is defined multiple times + --> $DIR/issue-25396.rs:12:5 + | +LL | use foo::baz; + | -------- previous import of the module `baz` here +LL | use bar::baz; //~ ERROR the name `baz` is defined multiple times + | ^^^^^^^^ `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 the name `baz` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0252]: the name `Quux` is defined multiple times + --> $DIR/issue-25396.rs:15:5 + | +LL | use foo::Quux; + | --------- previous import of the trait `Quux` here +LL | use bar::Quux; //~ ERROR the name `Quux` is defined multiple times + | ^^^^^^^^^ `Quux` reimported here + | + = note: `Quux` 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::Quux as OtherQuux; //~ ERROR the name `Quux` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0252]: the name `blah` is defined multiple times + --> $DIR/issue-25396.rs:18:5 + | +LL | use foo::blah; + | --------- previous import of the type `blah` here +LL | use bar::blah; //~ ERROR the name `blah` is defined multiple times + | ^^^^^^^^^ `blah` reimported here + | + = note: `blah` 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::blah as other_blah; //~ ERROR the name `blah` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0252]: the name `WOMP` is defined multiple times + --> $DIR/issue-25396.rs:21:5 + | +LL | use foo::WOMP; + | --------- previous import of the value `WOMP` here +LL | use bar::WOMP; //~ ERROR the name `WOMP` is defined multiple times + | ^^^^^^^^^ `WOMP` reimported here + | + = note: `WOMP` 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::WOMP as OtherWOMP; //~ ERROR the name `WOMP` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0252`. diff --git a/src/test/ui/issue-25439.rs b/src/test/ui/issue-25439.rs new file mode 100644 index 00000000000..6e33fd5ae71 --- /dev/null +++ b/src/test/ui/issue-25439.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Helper<'a, F: 'a>(&'a F); + +fn fix(f: F) -> i32 where F: Fn(Helper, i32) -> i32 { + f(Helper(&f), 8) +} + +fn main() { + fix(|_, x| x); //~ ERROR closure/generator type that references itself [E0644] +} diff --git a/src/test/ui/issue-25439.stderr b/src/test/ui/issue-25439.stderr new file mode 100644 index 00000000000..467bb1ad28e --- /dev/null +++ b/src/test/ui/issue-25439.stderr @@ -0,0 +1,13 @@ +error[E0644]: closure/generator type that references itself + --> $DIR/issue-25439.rs:18:9 + | +LL | fix(|_, x| x); //~ ERROR closure/generator type that references itself [E0644] + | ^^^^^^^^ cyclic type of infinite size + | + = note: closures cannot capture themselves or take themselves as argument; + this error may be the result of a recent compiler bug-fix, + see https://github.com/rust-lang/rust/issues/46062 for more details + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0644`. diff --git a/src/test/ui/issue-25579.ast.nll.stderr b/src/test/ui/issue-25579.ast.nll.stderr new file mode 100644 index 00000000000..9f698e4d582 --- /dev/null +++ b/src/test/ui/issue-25579.ast.nll.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/issue-25579.rs:31:1 + | +LL | / fn main() { //[mir]~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-25579.ast.stderr b/src/test/ui/issue-25579.ast.stderr new file mode 100644 index 00000000000..49b483d7503 --- /dev/null +++ b/src/test/ui/issue-25579.ast.stderr @@ -0,0 +1,21 @@ +error[E0499]: cannot borrow `l.0` as mutable more than once at a time + --> $DIR/issue-25579.rs:24:32 + | +LL | &mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] + | ^^^^^^^^^^^^ mutable borrow starts here in previous iteration of loop +... +LL | } + | - mutable borrow ends here + +error[E0506]: cannot assign to `l` because it is borrowed + --> $DIR/issue-25579.rs:25:13 + | +LL | &mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] + | ------------ borrow of `l` occurs here +LL | l = &mut **expr; //[ast]~ ERROR [E0506] + | ^^^^^^^^^^^^^^^ assignment to borrowed `l` occurs here + +error: aborting due to 2 previous errors + +Some errors occurred: E0499, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/issue-25579.mir.stderr b/src/test/ui/issue-25579.mir.stderr new file mode 100644 index 00000000000..9f698e4d582 --- /dev/null +++ b/src/test/ui/issue-25579.mir.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/issue-25579.rs:31:1 + | +LL | / fn main() { //[mir]~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-25579.rs b/src/test/ui/issue-25579.rs new file mode 100644 index 00000000000..71c1d63cf5a --- /dev/null +++ b/src/test/ui/issue-25579.rs @@ -0,0 +1,32 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions: ast mir +//[mir]compile-flags: -Z borrowck=mir + +#![feature(rustc_attrs)] + +enum Sexpression { + Num(()), + Cons(&'static mut Sexpression) +} + +fn causes_error_in_ast(mut l: &mut Sexpression) { + loop { match l { + &mut Sexpression::Num(ref mut n) => {}, + &mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] + l = &mut **expr; //[ast]~ ERROR [E0506] + } + }} +} + +#[rustc_error] +fn main() { //[mir]~ ERROR compilation successful +} diff --git a/src/test/ui/issue-25700.rs b/src/test/ui/issue-25700.rs new file mode 100644 index 00000000000..477c3237f84 --- /dev/null +++ b/src/test/ui/issue-25700.rs @@ -0,0 +1,24 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S(Option<&'static T>); + +trait Tr { type Out; } +impl Tr for T { type Out = T; } + +impl Copy for S where S: Tr {} +impl Clone for S where S: Tr { + fn clone(&self) -> Self { *self } +} +fn main() { + let t = S::<()>(None); + drop(t); + drop(t); //~ ERROR use of moved value +} diff --git a/src/test/ui/issue-25700.stderr b/src/test/ui/issue-25700.stderr new file mode 100644 index 00000000000..786620ab750 --- /dev/null +++ b/src/test/ui/issue-25700.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `t` + --> $DIR/issue-25700.rs:23:10 + | +LL | drop(t); + | - value moved here +LL | drop(t); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `t` has type `S<()>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/issue-2590.nll.stderr b/src/test/ui/issue-2590.nll.stderr new file mode 100644 index 00000000000..fa2df26498a --- /dev/null +++ b/src/test/ui/issue-2590.nll.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/issue-2590.rs:22:9 + | +LL | self.tokens //~ ERROR cannot move out of borrowed content + | ^^^^^^^^^^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/issue-2590.rs b/src/test/ui/issue-2590.rs new file mode 100644 index 00000000000..d7e438d1049 --- /dev/null +++ b/src/test/ui/issue-2590.rs @@ -0,0 +1,26 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +struct parser { + tokens: Vec , +} + +trait parse { + fn parse(&self) -> Vec ; +} + +impl parse for parser { + fn parse(&self) -> Vec { + self.tokens //~ ERROR cannot move out of borrowed content + } +} + +fn main() {} diff --git a/src/test/ui/issue-2590.stderr b/src/test/ui/issue-2590.stderr new file mode 100644 index 00000000000..59ec66d42cd --- /dev/null +++ b/src/test/ui/issue-2590.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/issue-2590.rs:22:9 + | +LL | self.tokens //~ ERROR cannot move out of borrowed content + | ^^^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/issue-25901.rs b/src/test/ui/issue-25901.rs new file mode 100644 index 00000000000..72fb2a682eb --- /dev/null +++ b/src/test/ui/issue-25901.rs @@ -0,0 +1,24 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct A; +struct B; + +static S: &'static B = &A; +//~^ ERROR calls in statics are limited to constant functions + +use std::ops::Deref; + +impl Deref for A { + type Target = B; + fn deref(&self)->&B { static B_: B = B; &B_ } +} + +fn main(){} diff --git a/src/test/ui/issue-25901.stderr b/src/test/ui/issue-25901.stderr new file mode 100644 index 00000000000..8c20df5a230 --- /dev/null +++ b/src/test/ui/issue-25901.stderr @@ -0,0 +1,9 @@ +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-25901.rs:14:24 + | +LL | static S: &'static B = &A; + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-26094.rs b/src/test/ui/issue-26094.rs new file mode 100644 index 00000000000..99add95e806 --- /dev/null +++ b/src/test/ui/issue-26094.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! some_macro { + ($other: expr) => ({ + $other(None) + //~^ this function takes 0 parameters but 1 parameter was supplied + }) +} + +fn some_function() {} + +fn main() { + some_macro!(some_function); + //~^ in this expansion of some_macro! +} diff --git a/src/test/ui/issue-26094.stderr b/src/test/ui/issue-26094.stderr new file mode 100644 index 00000000000..bf902e16c0c --- /dev/null +++ b/src/test/ui/issue-26094.stderr @@ -0,0 +1,15 @@ +error[E0061]: this function takes 0 parameters but 1 parameter was supplied + --> $DIR/issue-26094.rs:13:9 + | +LL | $other(None) + | ^^^^^^^^^^^^ expected 0 parameters +... +LL | fn some_function() {} + | ------------------ defined here +... +LL | some_macro!(some_function); + | --------------------------- in this macro invocation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/issue-26158.rs b/src/test/ui/issue-26158.rs new file mode 100644 index 00000000000..54f5313aed1 --- /dev/null +++ b/src/test/ui/issue-26158.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(slice_patterns)] + +fn main() { + let x: &[u32] = &[]; + let &[[ref _a, ref _b..]..] = x; //~ ERROR refutable pattern +} diff --git a/src/test/ui/issue-26158.stderr b/src/test/ui/issue-26158.stderr new file mode 100644 index 00000000000..07b968c8e78 --- /dev/null +++ b/src/test/ui/issue-26158.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `&[]` not covered + --> $DIR/issue-26158.rs:15:9 + | +LL | let &[[ref _a, ref _b..]..] = x; //~ ERROR refutable pattern + | ^^^^^^^^^^^^^^^^^^^^^^^ pattern `&[]` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/issue-26217.nll.stderr b/src/test/ui/issue-26217.nll.stderr new file mode 100644 index 00000000000..94e3692d53d --- /dev/null +++ b/src/test/ui/issue-26217.nll.stderr @@ -0,0 +1,15 @@ +warning: not reporting region error due to nll + --> $DIR/issue-26217.rs:14:5 + | +LL | foo::<&'a i32>(); + | ^^^^^^^^^^^^^^ + +error[E0131]: `main` function is not allowed to have generic parameters + --> $DIR/issue-26217.rs:13:8 + | +LL | fn main<'a>() { + | ^^^^ `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/issue-26217.rs b/src/test/ui/issue-26217.rs new file mode 100644 index 00000000000..06a8fe52588 --- /dev/null +++ b/src/test/ui/issue-26217.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() where for<'a> T: 'a {} + +fn main<'a>() { + foo::<&'a i32>(); + //~^ ERROR the type `&'a i32` does not fulfill the required lifetime +} diff --git a/src/test/ui/issue-26217.stderr b/src/test/ui/issue-26217.stderr new file mode 100644 index 00000000000..f581826440e --- /dev/null +++ b/src/test/ui/issue-26217.stderr @@ -0,0 +1,11 @@ +error[E0477]: the type `&'a i32` does not fulfill the required lifetime + --> $DIR/issue-26217.rs:14:5 + | +LL | foo::<&'a i32>(); + | ^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/issue-26237.rs b/src/test/ui/issue-26237.rs new file mode 100644 index 00000000000..22772e596b1 --- /dev/null +++ b/src/test/ui/issue-26237.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! macro_panic { + ($not_a_function:expr, $some_argument:ident) => { + $not_a_function($some_argument) + //~^ ERROR expected function, found `{integer}` + } +} + +fn main() { + let mut value_a = 0; + let mut value_b = 0; + macro_panic!(value_a, value_b); + //~^ in this expansion of macro_panic! +} diff --git a/src/test/ui/issue-26237.stderr b/src/test/ui/issue-26237.stderr new file mode 100644 index 00000000000..ae6fda8b932 --- /dev/null +++ b/src/test/ui/issue-26237.stderr @@ -0,0 +1,15 @@ +error[E0618]: expected function, found `{integer}` + --> $DIR/issue-26237.rs:13:9 + | +LL | $not_a_function($some_argument) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a function +... +LL | let mut value_a = 0; + | ----------- `{integer}` defined here +LL | let mut value_b = 0; +LL | macro_panic!(value_a, value_b); + | ------------------------------- in this macro invocation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/issue-26262.rs b/src/test/ui/issue-26262.rs new file mode 100644 index 00000000000..8d79fd4570d --- /dev/null +++ b/src/test/ui/issue-26262.rs @@ -0,0 +1,32 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Check that projections don't count as constraining type parameters. + +struct S(T); + +trait Tr { type Assoc; fn test(); } + +impl S { +//~^ ERROR the type parameter `T` is not constrained + fn foo(self, _: T) { + T::test(); + } +} + +trait Trait1 { type Bar; } +trait Trait2<'x> { type Foo; } + +impl<'a,T: Trait2<'a>> Trait1<>::Foo> for T { +//~^ ERROR the lifetime parameter `'a` is not constrained + type Bar = &'a (); +} + +fn main() {} diff --git a/src/test/ui/issue-26262.stderr b/src/test/ui/issue-26262.stderr new file mode 100644 index 00000000000..2e0a211d061 --- /dev/null +++ b/src/test/ui/issue-26262.stderr @@ -0,0 +1,15 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-26262.rs:17:6 + | +LL | impl S { + | ^ unconstrained type parameter + +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-26262.rs:27:6 + | +LL | impl<'a,T: Trait2<'a>> Trait1<>::Foo> for T { + | ^^ unconstrained lifetime parameter + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/issue-26459.rs b/src/test/ui/issue-26459.rs new file mode 100644 index 00000000000..8be3d88bd5c --- /dev/null +++ b/src/test/ui/issue-26459.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + match 'a' { + char{ch} => true + //~^ ERROR expected struct, variant or union type, found builtin type `char` + }; +} diff --git a/src/test/ui/issue-26459.stderr b/src/test/ui/issue-26459.stderr new file mode 100644 index 00000000000..d497c1c9209 --- /dev/null +++ b/src/test/ui/issue-26459.stderr @@ -0,0 +1,9 @@ +error[E0574]: expected struct, variant or union type, found builtin type `char` + --> $DIR/issue-26459.rs:13:9 + | +LL | char{ch} => true + | ^^^^ not a struct, variant or union type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/issue-26548.rs b/src/test/ui/issue-26548.rs new file mode 100644 index 00000000000..fc4f3d1fb53 --- /dev/null +++ b/src/test/ui/issue-26548.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//~^^^^^^^^^^ ERROR cycle detected when computing layout of +//~| NOTE ...which requires computing layout of +//~| NOTE ...which again requires computing layout of +//~| NOTE cycle used when compile_codegen_unit + +trait Mirror { type It: ?Sized; } +impl Mirror for T { type It = Self; } +struct S(Option<::It>); + +fn main() { + let _s = S(None); +} diff --git a/src/test/ui/issue-26548.stderr b/src/test/ui/issue-26548.stderr new file mode 100644 index 00000000000..c1db7fe128f --- /dev/null +++ b/src/test/ui/issue-26548.stderr @@ -0,0 +1,9 @@ +error[E0391]: cycle detected when computing layout of `std::option::Option` + | +note: ...which requires computing layout of `S`... + = note: ...which again requires computing layout of `std::option::Option`, completing the cycle +note: cycle used when compile_codegen_unit + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/issue-26614.rs b/src/test/ui/issue-26614.rs new file mode 100644 index 00000000000..c128fb3b479 --- /dev/null +++ b/src/test/ui/issue-26614.rs @@ -0,0 +1,27 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(warnings)] + +trait Mirror { + type It; +} + +impl Mirror for T { + type It = Self; +} + + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let c: ::It = 5; + const CCCC: ::It = 5; +} diff --git a/src/test/ui/issue-26614.stderr b/src/test/ui/issue-26614.stderr new file mode 100644 index 00000000000..1752d80fde3 --- /dev/null +++ b/src/test/ui/issue-26614.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/issue-26614.rs:24:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let c: ::It = 5; +LL | | const CCCC: ::It = 5; +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-26812.rs b/src/test/ui/issue-26812.rs new file mode 100644 index 00000000000..1dd00881078 --- /dev/null +++ b/src/test/ui/issue-26812.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(default_type_parameter_fallback)] + +fn avg(_: T) {} +//~^ ERROR type parameters with a default cannot use forward declared identifiers + +fn main() {} diff --git a/src/test/ui/issue-26812.stderr b/src/test/ui/issue-26812.stderr new file mode 100644 index 00000000000..82cc17b7665 --- /dev/null +++ b/src/test/ui/issue-26812.stderr @@ -0,0 +1,9 @@ +error[E0128]: type parameters with a default cannot use forward declared identifiers + --> $DIR/issue-26812.rs:13:10 + | +LL | fn avg(_: T) {} + | ^^^^^^^ defaulted type 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/issue-26905.rs b/src/test/ui/issue-26905.rs new file mode 100644 index 00000000000..3b8fac832a4 --- /dev/null +++ b/src/test/ui/issue-26905.rs @@ -0,0 +1,34 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(unsize, coerce_unsized)] + +// Verfies that non-PhantomData ZSTs still cause coercions to fail. +// They might have additional semantics that we don't want to bulldoze. + +use std::marker::{Unsize, PhantomData}; +use std::ops::CoerceUnsized; + +struct NotPhantomData(PhantomData); + +struct MyRc { + _ptr: *const T, + _boo: NotPhantomData, +} + +impl, U: ?Sized> CoerceUnsized> for MyRc{ } //~ERROR + +fn main() { + let data = [1, 2, 3]; + let iter = data.iter(); + let x = MyRc { _ptr: &iter, _boo: NotPhantomData(PhantomData) }; + let _y: MyRc> = x; +} + diff --git a/src/test/ui/issue-26905.stderr b/src/test/ui/issue-26905.stderr new file mode 100644 index 00000000000..f18b58a8330 --- /dev/null +++ b/src/test/ui/issue-26905.stderr @@ -0,0 +1,12 @@ +error[E0375]: implementing the trait `CoerceUnsized` requires multiple coercions + --> $DIR/issue-26905.rs:26:40 + | +LL | impl, U: ?Sized> CoerceUnsized> for MyRc{ } //~ERROR + | ^^^^^^^^^^^^^^^^^^^^^^ 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: _ptr (*const T to *const U), _boo (NotPhantomData to NotPhantomData) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0375`. diff --git a/src/test/ui/issue-26930.rs b/src/test/ui/issue-26930.rs new file mode 100644 index 00000000000..6c98f3e8560 --- /dev/null +++ b/src/test/ui/issue-26930.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +extern crate core; +use core as core_export; +use self::x::*; +mod x {} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/ui/issue-26930.stderr b/src/test/ui/issue-26930.stderr new file mode 100644 index 00000000000..f962f4c58c4 --- /dev/null +++ b/src/test/ui/issue-26930.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/issue-26930.rs:20:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/issue-26948.rs b/src/test/ui/issue-26948.rs new file mode 100644 index 00000000000..c63cb5defb7 --- /dev/null +++ b/src/test/ui/issue-26948.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + enum Foo { A { x: u32 } } + let orig = Foo::A { x: 5 }; + Foo::A { x: 6, ..orig }; + //~^ ERROR functional record update syntax requires a struct +} diff --git a/src/test/ui/issue-26948.stderr b/src/test/ui/issue-26948.stderr new file mode 100644 index 00000000000..982ce1d6c7b --- /dev/null +++ b/src/test/ui/issue-26948.stderr @@ -0,0 +1,9 @@ +error[E0436]: functional record update syntax requires a struct + --> $DIR/issue-26948.rs:14:22 + | +LL | Foo::A { x: 6, ..orig }; + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0436`. diff --git a/src/test/ui/issue-27008.rs b/src/test/ui/issue-27008.rs new file mode 100644 index 00000000000..f80135848e0 --- /dev/null +++ b/src/test/ui/issue-27008.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S; + +fn main() { + let b = [0; S]; + //~^ ERROR mismatched types + //~| expected type `usize` + //~| found type `S` + //~| expected usize, found struct `S` +} diff --git a/src/test/ui/issue-27008.stderr b/src/test/ui/issue-27008.stderr new file mode 100644 index 00000000000..79831463664 --- /dev/null +++ b/src/test/ui/issue-27008.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-27008.rs:14:17 + | +LL | let b = [0; S]; + | ^ expected usize, found struct `S` + | + = note: expected type `usize` + found type `S` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-27033.rs b/src/test/ui/issue-27033.rs new file mode 100644 index 00000000000..b8552aaee90 --- /dev/null +++ b/src/test/ui/issue-27033.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + match Some(1) { + None @ _ => {} //~ ERROR match bindings cannot shadow unit variants + }; + const C: u8 = 1; + match 1 { + C @ 2 => { //~ ERROR match bindings cannot shadow constant + println!("{}", C); + } + _ => {} + }; +} diff --git a/src/test/ui/issue-27033.stderr b/src/test/ui/issue-27033.stderr new file mode 100644 index 00000000000..ba573c3eb6d --- /dev/null +++ b/src/test/ui/issue-27033.stderr @@ -0,0 +1,18 @@ +error[E0530]: match bindings cannot shadow unit variants + --> $DIR/issue-27033.rs:13:9 + | +LL | None @ _ => {} //~ ERROR match bindings cannot shadow unit variants + | ^^^^ cannot be named the same as a unit variant + +error[E0530]: match bindings cannot shadow constants + --> $DIR/issue-27033.rs:17:9 + | +LL | const C: u8 = 1; + | ---------------- a constant `C` is defined here +LL | match 1 { +LL | C @ 2 => { //~ ERROR match bindings cannot shadow constant + | ^ cannot be named the same as a constant + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/ui/issue-27042.rs b/src/test/ui/issue-27042.rs new file mode 100644 index 00000000000..23afa4b6296 --- /dev/null +++ b/src/test/ui/issue-27042.rs @@ -0,0 +1,26 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for #27042. Test that a loop's label is included in its span. + +fn main() { + let _: i32 = + 'a: // in this case, the citation is just the `break`: + loop { break }; //~ ERROR mismatched types + let _: i32 = + 'b: //~ ERROR mismatched types + while true { break }; // but here we cite the whole loop + let _: i32 = + 'c: //~ ERROR mismatched types + for _ in None { break }; // but here we cite the whole loop + let _: i32 = + 'd: //~ ERROR mismatched types + while let Some(_) = None { break }; +} diff --git a/src/test/ui/issue-27042.stderr b/src/test/ui/issue-27042.stderr new file mode 100644 index 00000000000..48113445582 --- /dev/null +++ b/src/test/ui/issue-27042.stderr @@ -0,0 +1,42 @@ +error[E0308]: mismatched types + --> $DIR/issue-27042.rs:16:16 + | +LL | loop { break }; //~ ERROR mismatched types + | ^^^^^ expected (), found i32 + | + = note: expected type `()` + found type `i32` + +error[E0308]: mismatched types + --> $DIR/issue-27042.rs:18:9 + | +LL | / 'b: //~ ERROR mismatched types +LL | | while true { break }; // but here we cite the whole loop + | |____________________________^ expected i32, found () + | + = note: expected type `i32` + found type `()` + +error[E0308]: mismatched types + --> $DIR/issue-27042.rs:21:9 + | +LL | / 'c: //~ ERROR mismatched types +LL | | for _ in None { break }; // but here we cite the whole loop + | |_______________________________^ expected i32, found () + | + = note: expected type `i32` + found type `()` + +error[E0308]: mismatched types + --> $DIR/issue-27042.rs:24:9 + | +LL | / 'd: //~ ERROR mismatched types +LL | | while let Some(_) = None { break }; + | |__________________________________________^ expected i32, found () + | + = note: expected type `i32` + found type `()` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-27060-2.rs b/src/test/ui/issue-27060-2.rs new file mode 100644 index 00000000000..619616adda6 --- /dev/null +++ b/src/test/ui/issue-27060-2.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[repr(packed)] +pub struct Bad { + data: T, //~ ERROR the size for values of type +} + +fn main() {} diff --git a/src/test/ui/issue-27060-2.stderr b/src/test/ui/issue-27060-2.stderr new file mode 100644 index 00000000000..bb284138ebf --- /dev/null +++ b/src/test/ui/issue-27060-2.stderr @@ -0,0 +1,14 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/issue-27060-2.rs:13:5 + | +LL | data: T, //~ ERROR the size for values of type + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit + = help: consider adding a `where T: std::marker::Sized` bound + = note: only the last field of a struct may have a dynamically sized type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-27078.rs b/src/test/ui/issue-27078.rs new file mode 100644 index 00000000000..294c288a970 --- /dev/null +++ b/src/test/ui/issue-27078.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(associated_consts)] + +trait Foo { + const BAR: i32; + fn foo(self) -> &'static i32 { + //~^ ERROR the size for values of type + &::BAR + } +} + +fn main() {} diff --git a/src/test/ui/issue-27078.stderr b/src/test/ui/issue-27078.stderr new file mode 100644 index 00000000000..1a729c00fc1 --- /dev/null +++ b/src/test/ui/issue-27078.stderr @@ -0,0 +1,14 @@ +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/issue-27078.rs:15:12 + | +LL | fn foo(self) -> &'static i32 { + | ^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Self` + = note: to learn more, visit + = help: consider adding a `where Self: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-2718-a.rs b/src/test/ui/issue-2718-a.rs new file mode 100644 index 00000000000..6de28cbbf35 --- /dev/null +++ b/src/test/ui/issue-2718-a.rs @@ -0,0 +1,22 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct send_packet { + p: T +} + +mod pingpong { + use send_packet; + pub type ping = send_packet; + pub struct pong(send_packet); + //~^ ERROR recursive type `pingpong::pong` has infinite size +} + +fn main() {} diff --git a/src/test/ui/issue-2718-a.stderr b/src/test/ui/issue-2718-a.stderr new file mode 100644 index 00000000000..a60e5d04455 --- /dev/null +++ b/src/test/ui/issue-2718-a.stderr @@ -0,0 +1,14 @@ +error[E0072]: recursive type `pingpong::pong` has infinite size + --> $DIR/issue-2718-a.rs:18:5 + | +LL | pub struct pong(send_packet); + | ^^^^^^^^^^^^^^^^-----------------^^ + | | | + | | recursive without indirection + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `pingpong::pong` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/issue-27340.rs b/src/test/ui/issue-27340.rs new file mode 100644 index 00000000000..ce3fa487d4e --- /dev/null +++ b/src/test/ui/issue-27340.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; +#[derive(Copy, Clone)] +//~^ ERROR the trait `Copy` may not be implemented for this type +struct Bar(Foo); + +fn main() {} diff --git a/src/test/ui/issue-27340.stderr b/src/test/ui/issue-27340.stderr new file mode 100644 index 00000000000..bae47b3d2a3 --- /dev/null +++ b/src/test/ui/issue-27340.stderr @@ -0,0 +1,12 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/issue-27340.rs:12:10 + | +LL | #[derive(Copy, Clone)] + | ^^^^ +LL | //~^ ERROR the trait `Copy` may not be implemented for this type +LL | struct Bar(Foo); + | --- this field does not implement `Copy` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/ui/issue-27433.rs b/src/test/ui/issue-27433.rs new file mode 100644 index 00000000000..782b2057438 --- /dev/null +++ b/src/test/ui/issue-27433.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let foo = 42u32; + const FOO : u32 = foo; + //~^ ERROR can't capture dynamic environment +} diff --git a/src/test/ui/issue-27433.stderr b/src/test/ui/issue-27433.stderr new file mode 100644 index 00000000000..0fc04b082e5 --- /dev/null +++ b/src/test/ui/issue-27433.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/issue-27433.rs:13:23 + | +LL | const FOO : u32 = foo; + | ^^^ + | + = 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/issue-27592.nll.stderr b/src/test/ui/issue-27592.nll.stderr new file mode 100644 index 00000000000..0b55117cad2 --- /dev/null +++ b/src/test/ui/issue-27592.nll.stderr @@ -0,0 +1,19 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-27592.rs:26:33 + | +LL | write(|| format_args!("{}", String::from("Hello world"))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-27592.rs:26:27 + | +LL | write(|| format_args!("{}", String::from("Hello world"))); + | ^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-27592.rs b/src/test/ui/issue-27592.rs new file mode 100644 index 00000000000..731d4fb2bf6 --- /dev/null +++ b/src/test/ui/issue-27592.rs @@ -0,0 +1,29 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for issue #27592. + +fn write<'a, F: ::std::ops::FnOnce()->::std::fmt::Arguments<'a> + 'a>(fcn: F) { + use std::fmt::Write; + let _ = match fcn() { a => write!(&mut Stream, "{}", a), }; +} + +struct Stream; +impl ::std::fmt::Write for Stream { + fn write_str(&mut self, _s: &str) -> ::std::fmt::Result { + Ok( () ) + } +} + +fn main() { + write(|| format_args!("{}", String::from("Hello world"))); + //~^ ERROR borrowed value does not live long enough + //~| ERROR borrowed value does not live long enough +} diff --git a/src/test/ui/issue-27592.stderr b/src/test/ui/issue-27592.stderr new file mode 100644 index 00000000000..74b0541c01b --- /dev/null +++ b/src/test/ui/issue-27592.stderr @@ -0,0 +1,21 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-27592.rs:26:27 + | +LL | write(|| format_args!("{}", String::from("Hello world"))); + | ^^^^ -- temporary value needs to live until here + | | | + | | temporary value dropped here while still borrowed + | temporary value does not live long enough + +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-27592.rs:26:33 + | +LL | write(|| format_args!("{}", String::from("Hello world"))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^-- temporary value needs to live until here + | | | + | | temporary value dropped here while still borrowed + | temporary value does not live long enough + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issue-27815.rs b/src/test/ui/issue-27815.rs new file mode 100644 index 00000000000..d9840abf0ca --- /dev/null +++ b/src/test/ui/issue-27815.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod A {} + +fn main() { + let u = A { x: 1 }; //~ ERROR expected struct, variant or union type, found module `A` + let v = u32 { x: 1 }; //~ ERROR expected struct, variant or union type, found builtin type `u32` + match () { + A { x: 1 } => {} + //~^ ERROR expected struct, variant or union type, found module `A` + u32 { x: 1 } => {} + //~^ ERROR expected struct, variant or union type, found builtin type `u32` + } +} diff --git a/src/test/ui/issue-27815.stderr b/src/test/ui/issue-27815.stderr new file mode 100644 index 00000000000..987feaee9eb --- /dev/null +++ b/src/test/ui/issue-27815.stderr @@ -0,0 +1,27 @@ +error[E0574]: expected struct, variant or union type, found module `A` + --> $DIR/issue-27815.rs:14:13 + | +LL | let u = A { x: 1 }; //~ ERROR expected struct, variant or union type, found module `A` + | ^ not a struct, variant or union type + +error[E0574]: expected struct, variant or union type, found builtin type `u32` + --> $DIR/issue-27815.rs:15:13 + | +LL | let v = u32 { x: 1 }; //~ ERROR expected struct, variant or union type, found builtin type `u32` + | ^^^ not a struct, variant or union type + +error[E0574]: expected struct, variant or union type, found module `A` + --> $DIR/issue-27815.rs:17:9 + | +LL | A { x: 1 } => {} + | ^ not a struct, variant or union type + +error[E0574]: expected struct, variant or union type, found builtin type `u32` + --> $DIR/issue-27815.rs:19:9 + | +LL | u32 { x: 1 } => {} + | ^^^ not a struct, variant or union type + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/issue-27895.rs b/src/test/ui/issue-27895.rs new file mode 100644 index 00000000000..6063755c04f --- /dev/null +++ b/src/test/ui/issue-27895.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let i = 5; + let index = 6; + + match i { + 0..=index => println!("winner"), + //~^ ERROR runtime values cannot be referenced in patterns + _ => println!("hello"), + } +} diff --git a/src/test/ui/issue-27895.stderr b/src/test/ui/issue-27895.stderr new file mode 100644 index 00000000000..395c806fbdb --- /dev/null +++ b/src/test/ui/issue-27895.stderr @@ -0,0 +1,9 @@ +error[E0080]: runtime values cannot be referenced in patterns + --> $DIR/issue-27895.rs:16:13 + | +LL | 0..=index => println!("winner"), + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/issue-28098.rs b/src/test/ui/issue-28098.rs new file mode 100644 index 00000000000..5dded2b1e16 --- /dev/null +++ b/src/test/ui/issue-28098.rs @@ -0,0 +1,35 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let _ = Iterator::next(&mut ()); + //~^ ERROR `(): std::iter::Iterator` is not satisfied + + for _ in false {} + //~^ ERROR `bool: std::iter::Iterator` is not satisfied + + let _ = Iterator::next(&mut ()); + //~^ ERROR `(): std::iter::Iterator` is not satisfied + + other() +} + +pub fn other() { + // check errors are still reported globally + + let _ = Iterator::next(&mut ()); + //~^ ERROR `(): std::iter::Iterator` is not satisfied + + let _ = Iterator::next(&mut ()); + //~^ ERROR `(): std::iter::Iterator` is not satisfied + + for _ in false {} + //~^ ERROR `bool: std::iter::Iterator` is not satisfied +} diff --git a/src/test/ui/issue-28098.stderr b/src/test/ui/issue-28098.stderr new file mode 100644 index 00000000000..3a6e1aea288 --- /dev/null +++ b/src/test/ui/issue-28098.stderr @@ -0,0 +1,57 @@ +error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied + --> $DIR/issue-28098.rs:12:13 + | +LL | let _ = Iterator::next(&mut ()); + | ^^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `()` + = note: required by `std::iter::Iterator::next` + +error[E0277]: the trait bound `bool: std::iter::Iterator` is not satisfied + --> $DIR/issue-28098.rs:15:14 + | +LL | for _ in false {} + | ^^^^^ `bool` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `bool` + = note: required by `std::iter::IntoIterator::into_iter` + +error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied + --> $DIR/issue-28098.rs:18:13 + | +LL | let _ = Iterator::next(&mut ()); + | ^^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `()` + = note: required by `std::iter::Iterator::next` + +error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied + --> $DIR/issue-28098.rs:27:13 + | +LL | let _ = Iterator::next(&mut ()); + | ^^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `()` + = note: required by `std::iter::Iterator::next` + +error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied + --> $DIR/issue-28098.rs:30:13 + | +LL | let _ = Iterator::next(&mut ()); + | ^^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `()` + = note: required by `std::iter::Iterator::next` + +error[E0277]: the trait bound `bool: std::iter::Iterator` is not satisfied + --> $DIR/issue-28098.rs:33:14 + | +LL | for _ in false {} + | ^^^^^ `bool` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `bool` + = note: required by `std::iter::IntoIterator::into_iter` + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-28105.rs b/src/test/ui/issue-28105.rs new file mode 100644 index 00000000000..8e58d1aaf24 --- /dev/null +++ b/src/test/ui/issue-28105.rs @@ -0,0 +1,18 @@ +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure that a continue span actually contains the keyword. + +fn main() { + continue //~ ERROR `continue` outside of loop + ; + break //~ ERROR `break` outside of loop + ; +} diff --git a/src/test/ui/issue-28105.stderr b/src/test/ui/issue-28105.stderr new file mode 100644 index 00000000000..eb05dbea2be --- /dev/null +++ b/src/test/ui/issue-28105.stderr @@ -0,0 +1,15 @@ +error[E0268]: `continue` outside of loop + --> $DIR/issue-28105.rs:14:5 + | +LL | continue //~ ERROR `continue` outside of loop + | ^^^^^^^^ cannot break outside of a loop + +error[E0268]: `break` outside of loop + --> $DIR/issue-28105.rs:16:5 + | +LL | break //~ ERROR `break` outside of loop + | ^^^^^ cannot break outside of a loop + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0268`. diff --git a/src/test/ui/issue-28109.rs b/src/test/ui/issue-28109.rs new file mode 100644 index 00000000000..0d372d30015 --- /dev/null +++ b/src/test/ui/issue-28109.rs @@ -0,0 +1,22 @@ +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Make sure that label for continue and break is spanned correctly + +fn main() { + loop { + continue + 'b //~ ERROR use of undeclared label + ; + break + 'c //~ ERROR use of undeclared label + ; + } +} diff --git a/src/test/ui/issue-28109.stderr b/src/test/ui/issue-28109.stderr new file mode 100644 index 00000000000..902fe2390b9 --- /dev/null +++ b/src/test/ui/issue-28109.stderr @@ -0,0 +1,15 @@ +error[E0426]: use of undeclared label `'b` + --> $DIR/issue-28109.rs:16:9 + | +LL | 'b //~ ERROR use of undeclared label + | ^^ undeclared label `'b` + +error[E0426]: use of undeclared label `'c` + --> $DIR/issue-28109.rs:19:9 + | +LL | 'c //~ ERROR use of undeclared label + | ^^ undeclared label `'c` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/ui/issue-28113.rs b/src/test/ui/issue-28113.rs new file mode 100644 index 00000000000..7d2541966a4 --- /dev/null +++ b/src/test/ui/issue-28113.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(warnings)] + +const X: u8 = + || -> u8 { 5 }() + //~^ ERROR calls in constants are limited to constant functions +; + +fn main() {} diff --git a/src/test/ui/issue-28113.stderr b/src/test/ui/issue-28113.stderr new file mode 100644 index 00000000000..633257f1a4b --- /dev/null +++ b/src/test/ui/issue-28113.stderr @@ -0,0 +1,9 @@ +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-28113.rs:14:5 + | +LL | || -> u8 { 5 }() + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/issue-2823.rs b/src/test/ui/issue-2823.rs new file mode 100644 index 00000000000..631bcb7bd9e --- /dev/null +++ b/src/test/ui/issue-2823.rs @@ -0,0 +1,24 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct C { + x: isize, +} + +impl Drop for C { + fn drop(&mut self) { + println!("dropping: {}", self.x); + } +} + +fn main() { + let c = C{ x: 2}; + let _d = c.clone(); //~ ERROR no method named `clone` found +} diff --git a/src/test/ui/issue-2823.stderr b/src/test/ui/issue-2823.stderr new file mode 100644 index 00000000000..5a5cae7aab4 --- /dev/null +++ b/src/test/ui/issue-2823.stderr @@ -0,0 +1,16 @@ +error[E0599]: no method named `clone` found for type `C` in the current scope + --> $DIR/issue-2823.rs:23:16 + | +LL | struct C { + | -------- method `clone` not found for this +... +LL | let _d = c.clone(); //~ ERROR no method named `clone` found + | ^^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-28324.rs b/src/test/ui/issue-28324.rs new file mode 100644 index 00000000000..af73db2b4d2 --- /dev/null +++ b/src/test/ui/issue-28324.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(safe_extern_statics)] + +extern { + static error_message_count: u32; +} + +pub static BAZ: u32 = *&error_message_count; +//~^ ERROR could not evaluate static initializer +//~| tried to read from foreign (extern) static + +fn main() {} diff --git a/src/test/ui/issue-28324.stderr b/src/test/ui/issue-28324.stderr new file mode 100644 index 00000000000..c62d8bddf00 --- /dev/null +++ b/src/test/ui/issue-28324.stderr @@ -0,0 +1,9 @@ +error[E0080]: could not evaluate static initializer + --> $DIR/issue-28324.rs:17:23 + | +LL | pub static BAZ: u32 = *&error_message_count; + | ^^^^^^^^^^^^^^^^^^^^^ tried to read from foreign (extern) static + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/issue-28344.rs b/src/test/ui/issue-28344.rs new file mode 100644 index 00000000000..d28c3146404 --- /dev/null +++ b/src/test/ui/issue-28344.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::BitXor; + +fn main() { + let x: u8 = BitXor::bitor(0 as u8, 0 as u8); + //~^ ERROR must be specified + //~| no function or associated item named + + let g = BitXor::bitor; + //~^ ERROR must be specified + //~| no function or associated item named +} diff --git a/src/test/ui/issue-28344.stderr b/src/test/ui/issue-28344.stderr new file mode 100644 index 00000000000..7ef2e906422 --- /dev/null +++ b/src/test/ui/issue-28344.stderr @@ -0,0 +1,32 @@ +error[E0191]: the value of the associated type `Output` (from the trait `std::ops::BitXor`) must be specified + --> $DIR/issue-28344.rs:14:17 + | +LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); + | ^^^^^^^^^^^^^ missing associated type `Output` value + +error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope + --> $DIR/issue-28344.rs:14:17 + | +LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); + | ^^^^^^^^^^^^^ function or associated item not found in `dyn std::ops::BitXor<_>` + | + = help: did you mean `bitxor`? + +error[E0191]: the value of the associated type `Output` (from the trait `std::ops::BitXor`) must be specified + --> $DIR/issue-28344.rs:18:13 + | +LL | let g = BitXor::bitor; + | ^^^^^^^^^^^^^ missing associated type `Output` value + +error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope + --> $DIR/issue-28344.rs:18:13 + | +LL | let g = BitXor::bitor; + | ^^^^^^^^^^^^^ function or associated item not found in `dyn std::ops::BitXor<_>` + | + = help: did you mean `bitxor`? + +error: aborting due to 4 previous errors + +Some errors occurred: E0191, E0599. +For more information about an error, try `rustc --explain E0191`. diff --git a/src/test/ui/issue-28433.rs b/src/test/ui/issue-28433.rs new file mode 100644 index 00000000000..9253a490733 --- /dev/null +++ b/src/test/ui/issue-28433.rs @@ -0,0 +1,23 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z continue-parse-after-error + +enum bird { + pub duck, + //~^ ERROR: expected identifier, found keyword `pub` + //~| ERROR: expected + goose +} + + +fn main() { + let y = bird::goose; +} diff --git a/src/test/ui/issue-28433.stderr b/src/test/ui/issue-28433.stderr new file mode 100644 index 00000000000..bde01ef3746 --- /dev/null +++ b/src/test/ui/issue-28433.stderr @@ -0,0 +1,14 @@ +error: expected identifier, found keyword `pub` + --> $DIR/issue-28433.rs:14:5 + | +LL | pub duck, + | ^^^ expected identifier, found keyword + +error: expected one of `(`, `,`, `=`, `{`, or `}`, found `duck` + --> $DIR/issue-28433.rs:14:9 + | +LL | pub duck, + | ^^^^ expected one of `(`, `,`, `=`, `{`, or `}` here + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issue-28472.rs b/src/test/ui/issue-28472.rs new file mode 100644 index 00000000000..837de8eddcf --- /dev/null +++ b/src/test/ui/issue-28472.rs @@ -0,0 +1,24 @@ +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Check that the visibility modifier is included in the span of foreign items. + +extern { + fn foo(); + + pub //~ ERROR the name `foo` is defined multiple times + fn foo(); + + pub //~ ERROR the name `foo` is defined multiple times + static mut foo: u32; +} + +fn main() { +} diff --git a/src/test/ui/issue-28472.stderr b/src/test/ui/issue-28472.stderr new file mode 100644 index 00000000000..37c04a7a774 --- /dev/null +++ b/src/test/ui/issue-28472.stderr @@ -0,0 +1,27 @@ +error[E0428]: the name `foo` is defined multiple times + --> $DIR/issue-28472.rs:16:3 + | +LL | fn foo(); + | --------- previous definition of the value `foo` here +LL | +LL | / pub //~ ERROR the name `foo` is defined multiple times +LL | | fn foo(); + | |___________^ `foo` redefined here + | + = note: `foo` must be defined only once in the value namespace of this module + +error[E0428]: the name `foo` is defined multiple times + --> $DIR/issue-28472.rs:19:3 + | +LL | fn foo(); + | --------- previous definition of the value `foo` here +... +LL | / pub //~ ERROR the name `foo` is defined multiple times +LL | | static mut foo: u32; + | |______________________^ `foo` redefined here + | + = note: `foo` must be defined only once in the value namespace of this module + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0428`. diff --git a/src/test/ui/issue-2849.rs b/src/test/ui/issue-2849.rs new file mode 100644 index 00000000000..203b28bd5e4 --- /dev/null +++ b/src/test/ui/issue-2849.rs @@ -0,0 +1,18 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum foo { alpha, beta(isize) } + +fn main() { + match foo::alpha { + foo::alpha | foo::beta(i) => {} + //~^ ERROR variable `i` is not bound in all patterns + } +} diff --git a/src/test/ui/issue-2849.stderr b/src/test/ui/issue-2849.stderr new file mode 100644 index 00000000000..ffd15a58880 --- /dev/null +++ b/src/test/ui/issue-2849.stderr @@ -0,0 +1,11 @@ +error[E0408]: variable `i` is not bound in all patterns + --> $DIR/issue-2849.rs:15:7 + | +LL | foo::alpha | foo::beta(i) => {} + | ^^^^^^^^^^ - variable not in all patterns + | | + | pattern doesn't bind `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0408`. diff --git a/src/test/ui/issue-28576.rs b/src/test/ui/issue-28576.rs new file mode 100644 index 00000000000..bd7186708a6 --- /dev/null +++ b/src/test/ui/issue-28576.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub trait Foo { + type Assoc; +} + +pub trait Bar: Foo { + fn new(&self, b: & + Bar //~ ERROR the trait `Bar` cannot be made into an object + + ); +} + +fn main() {} diff --git a/src/test/ui/issue-28576.stderr b/src/test/ui/issue-28576.stderr new file mode 100644 index 00000000000..80f0f1ba1b1 --- /dev/null +++ b/src/test/ui/issue-28576.stderr @@ -0,0 +1,12 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/issue-28576.rs:17:12 + | +LL | / Bar //~ ERROR the trait `Bar` cannot be made into an object +LL | | + | |________________________^ the trait `Bar` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/issue-28586.rs b/src/test/ui/issue-28586.rs new file mode 100644 index 00000000000..b8571d2e85e --- /dev/null +++ b/src/test/ui/issue-28586.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Regression test for issue #28586 + +pub trait Foo {} +impl Foo for [u8; usize::BYTES] {} +//~^ ERROR no associated item named `BYTES` found for type `usize` + +fn main() { } diff --git a/src/test/ui/issue-28586.stderr b/src/test/ui/issue-28586.stderr new file mode 100644 index 00000000000..9820d64909e --- /dev/null +++ b/src/test/ui/issue-28586.stderr @@ -0,0 +1,9 @@ +error[E0599]: no associated item named `BYTES` found for type `usize` in the current scope + --> $DIR/issue-28586.rs:14:19 + | +LL | impl Foo for [u8; usize::BYTES] {} + | ^^^^^^^^^^^^ associated item not found in `usize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-28625.rs b/src/test/ui/issue-28625.rs new file mode 100644 index 00000000000..dc9155ed66c --- /dev/null +++ b/src/test/ui/issue-28625.rs @@ -0,0 +1,30 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Bar { + type Bar; +} + +struct ArrayPeano { + data: T::Bar, +} + +fn foo(a: &ArrayPeano) -> &[T] where T: Bar { + unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes +} + +impl Bar for () { + type Bar = (); +} + +fn main() { + let x: ArrayPeano<()> = ArrayPeano { data: () }; + foo(&x); +} diff --git a/src/test/ui/issue-28625.stderr b/src/test/ui/issue-28625.stderr new file mode 100644 index 00000000000..90b50f193fb --- /dev/null +++ b/src/test/ui/issue-28625.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-28625.rs:20:14 + | +LL | unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: &ArrayPeano (64 bits) + = note: target type: &[T] (128 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/issue-28992-empty.rs b/src/test/ui/issue-28992-empty.rs new file mode 100644 index 00000000000..536784508b7 --- /dev/null +++ b/src/test/ui/issue-28992-empty.rs @@ -0,0 +1,26 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Can't use constants as tuple struct patterns + + +const C1: i32 = 0; + +struct S; + +impl S { + const C2: i32 = 0; +} + +fn main() { + if let C1(..) = 0 {} //~ ERROR expected tuple struct/variant, found constant `C1` + if let S::C2(..) = 0 {} + //~^ ERROR expected tuple struct/variant, found associated constant `::C2` +} diff --git a/src/test/ui/issue-28992-empty.stderr b/src/test/ui/issue-28992-empty.stderr new file mode 100644 index 00000000000..9b5e42f8eb9 --- /dev/null +++ b/src/test/ui/issue-28992-empty.stderr @@ -0,0 +1,16 @@ +error[E0532]: expected tuple struct/variant, found constant `C1` + --> $DIR/issue-28992-empty.rs:23:12 + | +LL | if let C1(..) = 0 {} //~ ERROR expected tuple struct/variant, found constant `C1` + | ^^ not a tuple struct/variant + +error[E0164]: expected tuple struct/variant, found associated constant `::C2` + --> $DIR/issue-28992-empty.rs:24:12 + | +LL | if let S::C2(..) = 0 {} + | ^^^^^^^^^ not a tuple variant or struct + +error: aborting due to 2 previous errors + +Some errors occurred: E0164, E0532. +For more information about an error, try `rustc --explain E0164`. diff --git a/src/test/ui/issue-29084.rs b/src/test/ui/issue-29084.rs new file mode 100644 index 00000000000..6cb6bbf1893 --- /dev/null +++ b/src/test/ui/issue-29084.rs @@ -0,0 +1,25 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! foo { + ($d:expr) => {{ + fn bar(d: u8) { } + bar(&mut $d); + //~^ ERROR mismatched types + //~| expected u8, found &mut u8 + //~| expected type `u8` + //~| found type `&mut u8` + }} +} + +fn main() { + foo!(0u8); + //~^ in this expansion of foo! +} diff --git a/src/test/ui/issue-29084.stderr b/src/test/ui/issue-29084.stderr new file mode 100644 index 00000000000..3f1f18dabd0 --- /dev/null +++ b/src/test/ui/issue-29084.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-29084.rs:14:13 + | +LL | bar(&mut $d); + | ^^^^^^^ expected u8, found &mut u8 +... +LL | foo!(0u8); + | ---------- in this macro invocation + | + = note: expected type `u8` + found type `&mut u8` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-29147.rs b/src/test/ui/issue-29147.rs new file mode 100644 index 00000000000..0ecaa409412 --- /dev/null +++ b/src/test/ui/issue-29147.rs @@ -0,0 +1,32 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![recursion_limit="1024"] + +pub struct S0(T,T); +pub struct S1(Option>>>,Option>>>); +pub struct S2(Option>>>,Option>>>); +pub struct S3(Option>>>,Option>>>); +pub struct S4(Option>>>,Option>>>); +pub struct S5(Option>>>,Option>>>,Option); + +trait Foo { fn xxx(&self); } +trait Bar {} // anything local or #[fundamental] + +impl Foo for T where T: Bar, T: Sync { + fn xxx(&self) {} +} + +impl Foo for S5 { fn xxx(&self) {} } +impl Foo for S5 { fn xxx(&self) {} } + +fn main() { + let _ = >::xxx; //~ ERROR cannot resolve `S5<_>: Foo` +} diff --git a/src/test/ui/issue-29147.stderr b/src/test/ui/issue-29147.stderr new file mode 100644 index 00000000000..d0ad0c99aa0 --- /dev/null +++ b/src/test/ui/issue-29147.stderr @@ -0,0 +1,15 @@ +error[E0283]: type annotations required: cannot resolve `S5<_>: Foo` + --> $DIR/issue-29147.rs:31:13 + | +LL | let _ = >::xxx; //~ ERROR cannot resolve `S5<_>: Foo` + | ^^^^^^^^^^^^ + | +note: required by `Foo::xxx` + --> $DIR/issue-29147.rs:20:13 + | +LL | trait Foo { fn xxx(&self); } + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/issue-29161.rs b/src/test/ui/issue-29161.rs new file mode 100644 index 00000000000..97ba222fe45 --- /dev/null +++ b/src/test/ui/issue-29161.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod a { + struct A; + + impl Default for A { + pub fn default() -> A { //~ ERROR unnecessary visibility qualifier + A + } + } +} + + +fn main() { + a::A::default(); + //~^ ERROR struct `A` is private + } diff --git a/src/test/ui/issue-29161.stderr b/src/test/ui/issue-29161.stderr new file mode 100644 index 00000000000..fb6a41d2eca --- /dev/null +++ b/src/test/ui/issue-29161.stderr @@ -0,0 +1,16 @@ +error[E0449]: unnecessary visibility qualifier + --> $DIR/issue-29161.rs:15:9 + | +LL | pub fn default() -> A { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0603]: struct `A` is private + --> $DIR/issue-29161.rs:23:5 + | +LL | a::A::default(); + | ^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0449, E0603. +For more information about an error, try `rustc --explain E0449`. diff --git a/src/test/ui/issue-29184.rs b/src/test/ui/issue-29184.rs new file mode 100644 index 00000000000..98fe12c1b9d --- /dev/null +++ b/src/test/ui/issue-29184.rs @@ -0,0 +1,13 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x: typeof(92) = 92; //~ ERROR `typeof` is a reserved keyword +} diff --git a/src/test/ui/issue-29184.stderr b/src/test/ui/issue-29184.stderr new file mode 100644 index 00000000000..72d7bb8d5f6 --- /dev/null +++ b/src/test/ui/issue-29184.stderr @@ -0,0 +1,9 @@ +error[E0516]: `typeof` is a reserved keyword but unimplemented + --> $DIR/issue-29184.rs:12:12 + | +LL | let x: typeof(92) = 92; //~ ERROR `typeof` is a reserved keyword + | ^^^^^^^^^^ reserved keyword + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0516`. diff --git a/src/test/ui/issue-2937.rs b/src/test/ui/issue-2937.rs new file mode 100644 index 00000000000..0d684ec5ae1 --- /dev/null +++ b/src/test/ui/issue-2937.rs @@ -0,0 +1,16 @@ +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use m::f as x; //~ ERROR unresolved import `m::f` [E0432] + //~^ no `f` in `m` + +mod m {} + +fn main() {} diff --git a/src/test/ui/issue-2937.stderr b/src/test/ui/issue-2937.stderr new file mode 100644 index 00000000000..8c0125c7522 --- /dev/null +++ b/src/test/ui/issue-2937.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `m::f` + --> $DIR/issue-2937.rs:11:5 + | +LL | use m::f as x; //~ ERROR unresolved import `m::f` [E0432] + | ^^^^^^^^^ no `f` in `m` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/issue-2951.rs b/src/test/ui/issue-2951.rs new file mode 100644 index 00000000000..11ff7ab2476 --- /dev/null +++ b/src/test/ui/issue-2951.rs @@ -0,0 +1,21 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(x: T, y: U) { + let mut xx = x; + xx = y; + //~^ ERROR mismatched types + //~| expected type `T` + //~| found type `U` + //~| expected type parameter, found a different type parameter +} + +fn main() { +} diff --git a/src/test/ui/issue-2951.stderr b/src/test/ui/issue-2951.stderr new file mode 100644 index 00000000000..8c166807c46 --- /dev/null +++ b/src/test/ui/issue-2951.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-2951.rs:13:10 + | +LL | xx = y; + | ^ expected type parameter, found a different type parameter + | + = note: expected type `T` + found type `U` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issue-29857.rs b/src/test/ui/issue-29857.rs new file mode 100644 index 00000000000..661579f52b6 --- /dev/null +++ b/src/test/ui/issue-29857.rs @@ -0,0 +1,31 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + + +#![feature(rustc_attrs)] + +use std::marker::PhantomData; + +pub trait Foo