]> git.lizzy.rs Git - rust.git/commitdiff
Move some `compile-fail` tests to `ui`
authorEsteban Küber <esteban@kuber.com.ar>
Sun, 15 Jul 2018 21:11:54 +0000 (14:11 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 16 Jul 2018 00:10:52 +0000 (17:10 -0700)
1704 files changed:
src/test/compile-fail/issue-10176.rs [deleted file]
src/test/compile-fail/issue-10200.rs [deleted file]
src/test/compile-fail/issue-10291.rs [deleted file]
src/test/compile-fail/issue-10398.rs [deleted file]
src/test/compile-fail/issue-10401.rs [deleted file]
src/test/compile-fail/issue-10412.rs [deleted file]
src/test/compile-fail/issue-10465.rs [deleted file]
src/test/compile-fail/issue-10536.rs [deleted file]
src/test/compile-fail/issue-10545.rs [deleted file]
src/test/compile-fail/issue-10656.rs [deleted file]
src/test/compile-fail/issue-10755.rs [deleted file]
src/test/compile-fail/issue-10764.rs [deleted file]
src/test/compile-fail/issue-10877.rs [deleted file]
src/test/compile-fail/issue-10991.rs [deleted file]
src/test/compile-fail/issue-11154.rs [deleted file]
src/test/compile-fail/issue-11192.rs [deleted file]
src/test/compile-fail/issue-11374.rs [deleted file]
src/test/compile-fail/issue-11493.rs [deleted file]
src/test/compile-fail/issue-11515.rs [deleted file]
src/test/compile-fail/issue-11681.rs [deleted file]
src/test/compile-fail/issue-11692-1.rs [deleted file]
src/test/compile-fail/issue-11692-2.rs [deleted file]
src/test/compile-fail/issue-11740.rs [deleted file]
src/test/compile-fail/issue-11771.rs [deleted file]
src/test/compile-fail/issue-11844.rs [deleted file]
src/test/compile-fail/issue-11873.rs [deleted file]
src/test/compile-fail/issue-12028.rs [deleted file]
src/test/compile-fail/issue-12041.rs [deleted file]
src/test/compile-fail/issue-12116.rs [deleted file]
src/test/compile-fail/issue-12127.rs [deleted file]
src/test/compile-fail/issue-12369.rs [deleted file]
src/test/compile-fail/issue-12470.rs [deleted file]
src/test/compile-fail/issue-12552.rs [deleted file]
src/test/compile-fail/issue-12567.rs [deleted file]
src/test/compile-fail/issue-12796.rs [deleted file]
src/test/compile-fail/issue-12863.rs [deleted file]
src/test/compile-fail/issue-12997-1.rs [deleted file]
src/test/compile-fail/issue-12997-2.rs [deleted file]
src/test/compile-fail/issue-13033.rs [deleted file]
src/test/compile-fail/issue-13352.rs [deleted file]
src/test/compile-fail/issue-13359.rs [deleted file]
src/test/compile-fail/issue-13404.rs [deleted file]
src/test/compile-fail/issue-13407.rs [deleted file]
src/test/compile-fail/issue-13446.rs [deleted file]
src/test/compile-fail/issue-13466.rs [deleted file]
src/test/compile-fail/issue-13482-2.rs [deleted file]
src/test/compile-fail/issue-13482.rs [deleted file]
src/test/compile-fail/issue-13497-2.rs [deleted file]
src/test/compile-fail/issue-13497.rs [deleted file]
src/test/compile-fail/issue-1362.rs [deleted file]
src/test/compile-fail/issue-13641.rs [deleted file]
src/test/compile-fail/issue-13727.rs [deleted file]
src/test/compile-fail/issue-13847.rs [deleted file]
src/test/compile-fail/issue-13853-2.rs [deleted file]
src/test/compile-fail/issue-13853-5.rs [deleted file]
src/test/compile-fail/issue-13853.rs [deleted file]
src/test/compile-fail/issue-14091-2.rs [deleted file]
src/test/compile-fail/issue-14091.rs [deleted file]
src/test/compile-fail/issue-14221.rs [deleted file]
src/test/compile-fail/issue-14227.rs [deleted file]
src/test/compile-fail/issue-14285.rs [deleted file]
src/test/compile-fail/issue-14309.rs [deleted file]
src/test/compile-fail/issue-14366.rs [deleted file]
src/test/compile-fail/issue-1448-2.rs [deleted file]
src/test/compile-fail/issue-14541.rs [deleted file]
src/test/compile-fail/issue-14721.rs [deleted file]
src/test/compile-fail/issue-1476.rs [deleted file]
src/test/compile-fail/issue-14772.rs [deleted file]
src/test/compile-fail/issue-14845.rs [deleted file]
src/test/compile-fail/issue-14853.rs [deleted file]
src/test/compile-fail/issue-14915.rs [deleted file]
src/test/compile-fail/issue-15034.rs [deleted file]
src/test/compile-fail/issue-15094.rs [deleted file]
src/test/compile-fail/issue-15129.rs [deleted file]
src/test/compile-fail/issue-15167.rs [deleted file]
src/test/compile-fail/issue-15207.rs [deleted file]
src/test/compile-fail/issue-15381.rs [deleted file]
src/test/compile-fail/issue-15756.rs [deleted file]
src/test/compile-fail/issue-15783.rs [deleted file]
src/test/compile-fail/issue-15896.rs [deleted file]
src/test/compile-fail/issue-15919.rs [deleted file]
src/test/compile-fail/issue-15965.rs [deleted file]
src/test/compile-fail/issue-16048.rs [deleted file]
src/test/compile-fail/issue-16098.rs [deleted file]
src/test/compile-fail/issue-16149.rs [deleted file]
src/test/compile-fail/issue-16250.rs [deleted file]
src/test/compile-fail/issue-16338.rs [deleted file]
src/test/compile-fail/issue-16401.rs [deleted file]
src/test/compile-fail/issue-16538.rs [deleted file]
src/test/compile-fail/issue-16562.rs [deleted file]
src/test/compile-fail/issue-16683.rs [deleted file]
src/test/compile-fail/issue-16922.rs [deleted file]
src/test/compile-fail/issue-16939.rs [deleted file]
src/test/compile-fail/issue-16966.rs [deleted file]
src/test/compile-fail/issue-1697.rs [deleted file]
src/test/compile-fail/issue-16994.rs [deleted file]
src/test/compile-fail/issue-17001.rs [deleted file]
src/test/compile-fail/issue-17025.rs [deleted file]
src/test/compile-fail/issue-17033.rs [deleted file]
src/test/compile-fail/issue-17252.rs [deleted file]
src/test/compile-fail/issue-17337.rs [deleted file]
src/test/compile-fail/issue-17373.rs [deleted file]
src/test/compile-fail/issue-17385.rs [deleted file]
src/test/compile-fail/issue-17405.rs [deleted file]
src/test/compile-fail/issue-17431-1.rs [deleted file]
src/test/compile-fail/issue-17431-2.rs [deleted file]
src/test/compile-fail/issue-17431-3.rs [deleted file]
src/test/compile-fail/issue-17431-4.rs [deleted file]
src/test/compile-fail/issue-17431-5.rs [deleted file]
src/test/compile-fail/issue-17431-6.rs [deleted file]
src/test/compile-fail/issue-17431-7.rs [deleted file]
src/test/compile-fail/issue-17444.rs [deleted file]
src/test/compile-fail/issue-17458.rs [deleted file]
src/test/compile-fail/issue-17545.rs [deleted file]
src/test/compile-fail/issue-17546.rs [deleted file]
src/test/compile-fail/issue-17551.rs [deleted file]
src/test/compile-fail/issue-17651.rs [deleted file]
src/test/compile-fail/issue-17718-const-bad-values.rs [deleted file]
src/test/compile-fail/issue-17718-const-borrow.rs [deleted file]
src/test/compile-fail/issue-17718-const-naming.rs [deleted file]
src/test/compile-fail/issue-17718-constants-not-static.rs [deleted file]
src/test/compile-fail/issue-17718-patterns.rs [deleted file]
src/test/compile-fail/issue-17718-references.rs [deleted file]
src/test/compile-fail/issue-17718-static-move.rs [deleted file]
src/test/compile-fail/issue-17718-static-sync.rs [deleted file]
src/test/compile-fail/issue-17728.rs [deleted file]
src/test/compile-fail/issue-17740.rs [deleted file]
src/test/compile-fail/issue-17758.rs [deleted file]
src/test/compile-fail/issue-17800.rs [deleted file]
src/test/compile-fail/issue-17904-2.rs [deleted file]
src/test/compile-fail/issue-17905.rs [deleted file]
src/test/compile-fail/issue-17913.rs [deleted file]
src/test/compile-fail/issue-17933.rs [deleted file]
src/test/compile-fail/issue-17954.rs [deleted file]
src/test/compile-fail/issue-17959.rs [deleted file]
src/test/compile-fail/issue-17994.rs [deleted file]
src/test/compile-fail/issue-17999.rs [deleted file]
src/test/compile-fail/issue-18058.rs [deleted file]
src/test/compile-fail/issue-18107.rs [deleted file]
src/test/compile-fail/issue-18118-2.rs [deleted file]
src/test/compile-fail/issue-18118.rs [deleted file]
src/test/compile-fail/issue-18119.rs [deleted file]
src/test/compile-fail/issue-18159.rs [deleted file]
src/test/compile-fail/issue-18294.rs [deleted file]
src/test/compile-fail/issue-18389.rs [deleted file]
src/test/compile-fail/issue-18400.rs [deleted file]
src/test/compile-fail/issue-18423.rs [deleted file]
src/test/compile-fail/issue-18446.rs [deleted file]
src/test/compile-fail/issue-18532.rs [deleted file]
src/test/compile-fail/issue-18566.rs [deleted file]
src/test/compile-fail/issue-18611.rs [deleted file]
src/test/compile-fail/issue-1871.rs [deleted file]
src/test/compile-fail/issue-18783.rs [deleted file]
src/test/compile-fail/issue-18919.rs [deleted file]
src/test/compile-fail/issue-18937.rs [deleted file]
src/test/compile-fail/issue-18959.rs [deleted file]
src/test/compile-fail/issue-1900.rs [deleted file]
src/test/compile-fail/issue-19086.rs [deleted file]
src/test/compile-fail/issue-19244-1.rs [deleted file]
src/test/compile-fail/issue-19244-2.rs [deleted file]
src/test/compile-fail/issue-19380.rs [deleted file]
src/test/compile-fail/issue-19482.rs [deleted file]
src/test/compile-fail/issue-19521.rs [deleted file]
src/test/compile-fail/issue-19538.rs [deleted file]
src/test/compile-fail/issue-19601.rs [deleted file]
src/test/compile-fail/issue-19660.rs [deleted file]
src/test/compile-fail/issue-19692.rs [deleted file]
src/test/compile-fail/issue-19734.rs [deleted file]
src/test/compile-fail/issue-19883.rs [deleted file]
src/test/compile-fail/issue-19982.rs [deleted file]
src/test/compile-fail/issue-19991.rs [deleted file]
src/test/compile-fail/issue-20005.rs [deleted file]
src/test/compile-fail/issue-20162.rs [deleted file]
src/test/compile-fail/issue-20225.rs [deleted file]
src/test/compile-fail/issue-20261.rs [deleted file]
src/test/compile-fail/issue-20313.rs [deleted file]
src/test/compile-fail/issue-20413.rs [deleted file]
src/test/compile-fail/issue-20433.rs [deleted file]
src/test/compile-fail/issue-20605.rs [deleted file]
src/test/compile-fail/issue-20616-1.rs [deleted file]
src/test/compile-fail/issue-20616-2.rs [deleted file]
src/test/compile-fail/issue-20616-3.rs [deleted file]
src/test/compile-fail/issue-20616-4.rs [deleted file]
src/test/compile-fail/issue-20616-5.rs [deleted file]
src/test/compile-fail/issue-20616-6.rs [deleted file]
src/test/compile-fail/issue-20616-7.rs [deleted file]
src/test/compile-fail/issue-20616-8.rs [deleted file]
src/test/compile-fail/issue-20616-9.rs [deleted file]
src/test/compile-fail/issue-20714.rs [deleted file]
src/test/compile-fail/issue-20772.rs [deleted file]
src/test/compile-fail/issue-20801.rs [deleted file]
src/test/compile-fail/issue-20825.rs [deleted file]
src/test/compile-fail/issue-20831-debruijn.rs [deleted file]
src/test/compile-fail/issue-20939.rs [deleted file]
src/test/compile-fail/issue-2111.rs [deleted file]
src/test/compile-fail/issue-21160.rs [deleted file]
src/test/compile-fail/issue-21174.rs [deleted file]
src/test/compile-fail/issue-21177.rs [deleted file]
src/test/compile-fail/issue-21332.rs [deleted file]
src/test/compile-fail/issue-21356.rs [deleted file]
src/test/compile-fail/issue-21449.rs [deleted file]
src/test/compile-fail/issue-2149.rs [deleted file]
src/test/compile-fail/issue-2150.rs [deleted file]
src/test/compile-fail/issue-2151.rs [deleted file]
src/test/compile-fail/issue-21554.rs [deleted file]
src/test/compile-fail/issue-21701.rs [deleted file]
src/test/compile-fail/issue-21763.rs [deleted file]
src/test/compile-fail/issue-21837.rs [deleted file]
src/test/compile-fail/issue-21946.rs [deleted file]
src/test/compile-fail/issue-21974.rs [deleted file]
src/test/compile-fail/issue-22034.rs [deleted file]
src/test/compile-fail/issue-22037.rs [deleted file]
src/test/compile-fail/issue-22289.rs [deleted file]
src/test/compile-fail/issue-22312.rs [deleted file]
src/test/compile-fail/issue-22384.rs [deleted file]
src/test/compile-fail/issue-22434.rs [deleted file]
src/test/compile-fail/issue-22468.rs [deleted file]
src/test/compile-fail/issue-22599.rs [deleted file]
src/test/compile-fail/issue-22603.rs [deleted file]
src/test/compile-fail/issue-22673.rs [deleted file]
src/test/compile-fail/issue-22684.rs [deleted file]
src/test/compile-fail/issue-22706.rs [deleted file]
src/test/compile-fail/issue-22789.rs [deleted file]
src/test/compile-fail/issue-2281-part1.rs [deleted file]
src/test/compile-fail/issue-22874.rs [deleted file]
src/test/compile-fail/issue-22933-1.rs [deleted file]
src/test/compile-fail/issue-22933-3.rs [deleted file]
src/test/compile-fail/issue-23024.rs [deleted file]
src/test/compile-fail/issue-23046.rs [deleted file]
src/test/compile-fail/issue-23073.rs [deleted file]
src/test/compile-fail/issue-23080-2.rs [deleted file]
src/test/compile-fail/issue-23080.rs [deleted file]
src/test/compile-fail/issue-23122-1.rs [deleted file]
src/test/compile-fail/issue-23122-2.rs [deleted file]
src/test/compile-fail/issue-23253.rs [deleted file]
src/test/compile-fail/issue-23281.rs [deleted file]
src/test/compile-fail/issue-2330.rs [deleted file]
src/test/compile-fail/issue-23589.rs [deleted file]
src/test/compile-fail/issue-23595-1.rs [deleted file]
src/test/compile-fail/issue-23595-2.rs [deleted file]
src/test/compile-fail/issue-23966.rs [deleted file]
src/test/compile-fail/issue-24013.rs [deleted file]
src/test/compile-fail/issue-24204.rs [deleted file]
src/test/compile-fail/issue-24267-flow-exit.rs [deleted file]
src/test/compile-fail/issue-24322.rs [deleted file]
src/test/compile-fail/issue-24352.rs [deleted file]
src/test/compile-fail/issue-24357.rs [deleted file]
src/test/compile-fail/issue-24363.rs [deleted file]
src/test/compile-fail/issue-24365.rs [deleted file]
src/test/compile-fail/issue-24446.rs [deleted file]
src/test/compile-fail/issue-24682.rs [deleted file]
src/test/compile-fail/issue-24819.rs [deleted file]
src/test/compile-fail/issue-24883.rs [deleted file]
src/test/compile-fail/issue-25076.rs [deleted file]
src/test/compile-fail/issue-25368.rs [deleted file]
src/test/compile-fail/issue-25386.rs [deleted file]
src/test/compile-fail/issue-25396.rs [deleted file]
src/test/compile-fail/issue-25439.rs [deleted file]
src/test/compile-fail/issue-25579.rs [deleted file]
src/test/compile-fail/issue-25700.rs [deleted file]
src/test/compile-fail/issue-2590.rs [deleted file]
src/test/compile-fail/issue-25901.rs [deleted file]
src/test/compile-fail/issue-26094.rs [deleted file]
src/test/compile-fail/issue-26158.rs [deleted file]
src/test/compile-fail/issue-26217.rs [deleted file]
src/test/compile-fail/issue-26237.rs [deleted file]
src/test/compile-fail/issue-26262.rs [deleted file]
src/test/compile-fail/issue-26459.rs [deleted file]
src/test/compile-fail/issue-26548.rs [deleted file]
src/test/compile-fail/issue-26614.rs [deleted file]
src/test/compile-fail/issue-26812.rs [deleted file]
src/test/compile-fail/issue-26905.rs [deleted file]
src/test/compile-fail/issue-26930.rs [deleted file]
src/test/compile-fail/issue-26948.rs [deleted file]
src/test/compile-fail/issue-27008.rs [deleted file]
src/test/compile-fail/issue-27033.rs [deleted file]
src/test/compile-fail/issue-27042.rs [deleted file]
src/test/compile-fail/issue-27060-2.rs [deleted file]
src/test/compile-fail/issue-27078.rs [deleted file]
src/test/compile-fail/issue-2718-a.rs [deleted file]
src/test/compile-fail/issue-27340.rs [deleted file]
src/test/compile-fail/issue-27433.rs [deleted file]
src/test/compile-fail/issue-27592.rs [deleted file]
src/test/compile-fail/issue-27815.rs [deleted file]
src/test/compile-fail/issue-27895.rs [deleted file]
src/test/compile-fail/issue-28098.rs [deleted file]
src/test/compile-fail/issue-28105.rs [deleted file]
src/test/compile-fail/issue-28109.rs [deleted file]
src/test/compile-fail/issue-28113.rs [deleted file]
src/test/compile-fail/issue-2823.rs [deleted file]
src/test/compile-fail/issue-28324.rs [deleted file]
src/test/compile-fail/issue-28344.rs [deleted file]
src/test/compile-fail/issue-28433.rs [deleted file]
src/test/compile-fail/issue-28472.rs [deleted file]
src/test/compile-fail/issue-2849.rs [deleted file]
src/test/compile-fail/issue-28576.rs [deleted file]
src/test/compile-fail/issue-28586.rs [deleted file]
src/test/compile-fail/issue-28625.rs [deleted file]
src/test/compile-fail/issue-28992-empty.rs [deleted file]
src/test/compile-fail/issue-29084.rs [deleted file]
src/test/compile-fail/issue-29147.rs [deleted file]
src/test/compile-fail/issue-29161.rs [deleted file]
src/test/compile-fail/issue-29184.rs [deleted file]
src/test/compile-fail/issue-2937.rs [deleted file]
src/test/compile-fail/issue-2951.rs [deleted file]
src/test/compile-fail/issue-29857.rs [deleted file]
src/test/compile-fail/issue-29861.rs [deleted file]
src/test/compile-fail/issue-2995.rs [deleted file]
src/test/compile-fail/issue-30079.rs [deleted file]
src/test/compile-fail/issue-3008-3.rs [deleted file]
src/test/compile-fail/issue-3021-b.rs [deleted file]
src/test/compile-fail/issue-3021-c.rs [deleted file]
src/test/compile-fail/issue-3021-d.rs [deleted file]
src/test/compile-fail/issue-3021.rs [deleted file]
src/test/compile-fail/issue-30225.rs [deleted file]
src/test/compile-fail/issue-30236.rs [deleted file]
src/test/compile-fail/issue-30240-b.rs [deleted file]
src/test/compile-fail/issue-30240.rs [deleted file]
src/test/compile-fail/issue-30355.rs [deleted file]
src/test/compile-fail/issue-3038.rs [deleted file]
src/test/compile-fail/issue-30438-a.rs [deleted file]
src/test/compile-fail/issue-30438-b.rs [deleted file]
src/test/compile-fail/issue-30438-c.rs [deleted file]
src/test/compile-fail/issue-30560.rs [deleted file]
src/test/compile-fail/issue-30589.rs [deleted file]
src/test/compile-fail/issue-3080.rs [deleted file]
src/test/compile-fail/issue-3096-1.rs [deleted file]
src/test/compile-fail/issue-3096-2.rs [deleted file]
src/test/compile-fail/issue-3099-a.rs [deleted file]
src/test/compile-fail/issue-3099-b.rs [deleted file]
src/test/compile-fail/issue-3099.rs [deleted file]
src/test/compile-fail/issue-31011.rs [deleted file]
src/test/compile-fail/issue-31109.rs [deleted file]
src/test/compile-fail/issue-31173.rs [deleted file]
src/test/compile-fail/issue-31212.rs [deleted file]
src/test/compile-fail/issue-31495.rs [deleted file]
src/test/compile-fail/issue-31511.rs [deleted file]
src/test/compile-fail/issue-3154.rs [deleted file]
src/test/compile-fail/issue-31561.rs [deleted file]
src/test/compile-fail/issue-31769.rs [deleted file]
src/test/compile-fail/issue-31804.rs [deleted file]
src/test/compile-fail/issue-31845.rs [deleted file]
src/test/compile-fail/issue-31910.rs [deleted file]
src/test/compile-fail/issue-31924-non-snake-ffi.rs [deleted file]
src/test/compile-fail/issue-32004.rs [deleted file]
src/test/compile-fail/issue-32086.rs [deleted file]
src/test/compile-fail/issue-32119.rs [deleted file]
src/test/compile-fail/issue-3214.rs [deleted file]
src/test/compile-fail/issue-32201.rs [deleted file]
src/test/compile-fail/issue-32222.rs [deleted file]
src/test/compile-fail/issue-32323.rs [deleted file]
src/test/compile-fail/issue-32377.rs [deleted file]
src/test/compile-fail/issue-32655.rs [deleted file]
src/test/compile-fail/issue-32709.rs [deleted file]
src/test/compile-fail/issue-32782.rs [deleted file]
src/test/compile-fail/issue-32797.rs [deleted file]
src/test/compile-fail/issue-32829.rs [deleted file]
src/test/compile-fail/issue-32833.rs [deleted file]
src/test/compile-fail/issue-32922.rs [deleted file]
src/test/compile-fail/issue-32963.rs [deleted file]
src/test/compile-fail/issue-32995-2.rs [deleted file]
src/test/compile-fail/issue-32995.rs [deleted file]
src/test/compile-fail/issue-33241.rs [deleted file]
src/test/compile-fail/issue-33293.rs [deleted file]
src/test/compile-fail/issue-3344.rs [deleted file]
src/test/compile-fail/issue-33464.rs [deleted file]
src/test/compile-fail/issue-33504.rs [deleted file]
src/test/compile-fail/issue-33571.rs [deleted file]
src/test/compile-fail/issue-33819.rs [deleted file]
src/test/compile-fail/issue-34028.rs [deleted file]
src/test/compile-fail/issue-34171.rs [deleted file]
src/test/compile-fail/issue-34222-1.rs [deleted file]
src/test/compile-fail/issue-34334.rs [deleted file]
src/test/compile-fail/issue-34349.rs [deleted file]
src/test/compile-fail/issue-34373.rs [deleted file]
src/test/compile-fail/issue-34418.rs [deleted file]
src/test/compile-fail/issue-3477.rs [deleted file]
src/test/compile-fail/issue-34839.rs [deleted file]
src/test/compile-fail/issue-35075.rs [deleted file]
src/test/compile-fail/issue-3521-2.rs [deleted file]
src/test/compile-fail/issue-3521.rs [deleted file]
src/test/compile-fail/issue-35450.rs [deleted file]
src/test/compile-fail/issue-35570.rs [deleted file]
src/test/compile-fail/issue-35668.rs [deleted file]
src/test/compile-fail/issue-35988.rs [deleted file]
src/test/compile-fail/issue-3601.rs [deleted file]
src/test/compile-fail/issue-36082.rs [deleted file]
src/test/compile-fail/issue-36116.rs [deleted file]
src/test/compile-fail/issue-36299.rs [deleted file]
src/test/compile-fail/issue-36379.rs [deleted file]
src/test/compile-fail/issue-36617.rs [deleted file]
src/test/compile-fail/issue-36638.rs [deleted file]
src/test/compile-fail/issue-3668-2.rs [deleted file]
src/test/compile-fail/issue-3668.rs [deleted file]
src/test/compile-fail/issue-3680.rs [deleted file]
src/test/compile-fail/issue-36839.rs [deleted file]
src/test/compile-fail/issue-3702-2.rs [deleted file]
src/test/compile-fail/issue-37026.rs [deleted file]
src/test/compile-fail/issue-37051.rs [deleted file]
src/test/compile-fail/issue-3707.rs [deleted file]
src/test/compile-fail/issue-37323.rs [deleted file]
src/test/compile-fail/issue-37366.rs [deleted file]
src/test/compile-fail/issue-37510.rs [deleted file]
src/test/compile-fail/issue-37515.rs [deleted file]
src/test/compile-fail/issue-37534.rs [deleted file]
src/test/compile-fail/issue-37550.rs [deleted file]
src/test/compile-fail/issue-37576.rs [deleted file]
src/test/compile-fail/issue-3763.rs [deleted file]
src/test/compile-fail/issue-37665.rs [deleted file]
src/test/compile-fail/issue-37887.rs [deleted file]
src/test/compile-fail/issue-38160.rs [deleted file]
src/test/compile-fail/issue-3820.rs [deleted file]
src/test/compile-fail/issue-38293.rs [deleted file]
src/test/compile-fail/issue-38381.rs [deleted file]
src/test/compile-fail/issue-38404.rs [deleted file]
src/test/compile-fail/issue-38412.rs [deleted file]
src/test/compile-fail/issue-38458.rs [deleted file]
src/test/compile-fail/issue-38604.rs [deleted file]
src/test/compile-fail/issue-38857.rs [deleted file]
src/test/compile-fail/issue-38868.rs [deleted file]
src/test/compile-fail/issue-38919.rs [deleted file]
src/test/compile-fail/issue-38954.rs [deleted file]
src/test/compile-fail/issue-39211.rs [deleted file]
src/test/compile-fail/issue-39362.rs [deleted file]
src/test/compile-fail/issue-39388.rs [deleted file]
src/test/compile-fail/issue-39404.rs [deleted file]
src/test/compile-fail/issue-39559-2.rs [deleted file]
src/test/compile-fail/issue-39559.rs [deleted file]
src/test/compile-fail/issue-39616.rs [deleted file]
src/test/compile-fail/issue-39687.rs [deleted file]
src/test/compile-fail/issue-3973.rs [deleted file]
src/test/compile-fail/issue-39848.rs [deleted file]
src/test/compile-fail/issue-3993.rs [deleted file]
src/test/compile-fail/issue-39970.rs [deleted file]
src/test/compile-fail/issue-39974.rs [deleted file]
src/test/compile-fail/issue-40000.rs [deleted file]
src/test/compile-fail/issue-40288-2.rs [deleted file]
src/test/compile-fail/issue-40288.rs [deleted file]
src/test/compile-fail/issue-40350.rs [deleted file]
src/test/compile-fail/issue-40510-1.rs [deleted file]
src/test/compile-fail/issue-40510-2.rs [deleted file]
src/test/compile-fail/issue-40510-3.rs [deleted file]
src/test/compile-fail/issue-40510-4.rs [deleted file]
src/test/compile-fail/issue-40610.rs [deleted file]
src/test/compile-fail/issue-40749.rs [deleted file]
src/test/compile-fail/issue-40845.rs [deleted file]
src/test/compile-fail/issue-40861.rs [deleted file]
src/test/compile-fail/issue-41139.rs [deleted file]
src/test/compile-fail/issue-41229-ref-str.rs [deleted file]
src/test/compile-fail/issue-41255.rs [deleted file]
src/test/compile-fail/issue-41394.rs [deleted file]
src/test/compile-fail/issue-41726.rs [deleted file]
src/test/compile-fail/issue-41742.rs [deleted file]
src/test/compile-fail/issue-41776.rs [deleted file]
src/test/compile-fail/issue-41880.rs [deleted file]
src/test/compile-fail/issue-41974.rs [deleted file]
src/test/compile-fail/issue-41998.rs [deleted file]
src/test/compile-fail/issue-4201.rs [deleted file]
src/test/compile-fail/issue-42312.rs [deleted file]
src/test/compile-fail/issue-42344.rs [deleted file]
src/test/compile-fail/issue-4265.rs [deleted file]
src/test/compile-fail/issue-42755.rs [deleted file]
src/test/compile-fail/issue-42796.rs [deleted file]
src/test/compile-fail/issue-42880.rs [deleted file]
src/test/compile-fail/issue-43023.rs [deleted file]
src/test/compile-fail/issue-43105.rs [deleted file]
src/test/compile-fail/issue-43162.rs [deleted file]
src/test/compile-fail/issue-4321.rs [deleted file]
src/test/compile-fail/issue-43250.rs [deleted file]
src/test/compile-fail/issue-43355.rs [deleted file]
src/test/compile-fail/issue-43424.rs [deleted file]
src/test/compile-fail/issue-43431.rs [deleted file]
src/test/compile-fail/issue-4366-2.rs [deleted file]
src/test/compile-fail/issue-4366.rs [deleted file]
src/test/compile-fail/issue-43733-2.rs [deleted file]
src/test/compile-fail/issue-43733.rs [deleted file]
src/test/compile-fail/issue-43784-associated-type.rs [deleted file]
src/test/compile-fail/issue-43784-supertrait.rs [deleted file]
src/test/compile-fail/issue-43925.rs [deleted file]
src/test/compile-fail/issue-43926.rs [deleted file]
src/test/compile-fail/issue-43988.rs [deleted file]
src/test/compile-fail/issue-44021.rs [deleted file]
src/test/compile-fail/issue-44239.rs [deleted file]
src/test/compile-fail/issue-44373.rs [deleted file]
src/test/compile-fail/issue-44415.rs [deleted file]
src/test/compile-fail/issue-45087-unreachable-unsafe.rs [deleted file]
src/test/compile-fail/issue-4517.rs [deleted file]
src/test/compile-fail/issue-45199.rs [deleted file]
src/test/compile-fail/issue-45729-unsafe-in-generator.rs [deleted file]
src/test/compile-fail/issue-45801.rs [deleted file]
src/test/compile-fail/issue-45965.rs [deleted file]
src/test/compile-fail/issue-46023.rs [deleted file]
src/test/compile-fail/issue-46036.rs [deleted file]
src/test/compile-fail/issue-46311.rs [deleted file]
src/test/compile-fail/issue-46438.rs [deleted file]
src/test/compile-fail/issue-46604.rs [deleted file]
src/test/compile-fail/issue-46771.rs [deleted file]
src/test/compile-fail/issue-46843.rs [deleted file]
src/test/compile-fail/issue-47309.rs [deleted file]
src/test/compile-fail/issue-4736.rs [deleted file]
src/test/compile-fail/issue-47412.rs [deleted file]
src/test/compile-fail/issue-47715.rs [deleted file]
src/test/compile-fail/issue-48131.rs [deleted file]
src/test/compile-fail/issue-48838.rs [deleted file]
src/test/compile-fail/issue-4968.rs [deleted file]
src/test/compile-fail/issue-4972.rs [deleted file]
src/test/compile-fail/issue-50471.rs [deleted file]
src/test/compile-fail/issue-50600.rs [deleted file]
src/test/compile-fail/issue-5062.rs [deleted file]
src/test/compile-fail/issue-5067.rs [deleted file]
src/test/compile-fail/issue-50688.rs [deleted file]
src/test/compile-fail/issue-5099.rs [deleted file]
src/test/compile-fail/issue-5100.rs [deleted file]
src/test/compile-fail/issue-5153.rs [deleted file]
src/test/compile-fail/issue-5216.rs [deleted file]
src/test/compile-fail/issue-52213.rs [deleted file]
src/test/compile-fail/issue-5358-1.rs [deleted file]
src/test/compile-fail/issue-5439.rs [deleted file]
src/test/compile-fail/issue-5883.rs [deleted file]
src/test/compile-fail/issue-5927.rs [deleted file]
src/test/compile-fail/issue-5997-enum.rs [deleted file]
src/test/compile-fail/issue-5997-struct.rs [deleted file]
src/test/compile-fail/issue-6458-2.rs [deleted file]
src/test/compile-fail/issue-6596-1.rs [deleted file]
src/test/compile-fail/issue-6596-2.rs [deleted file]
src/test/compile-fail/issue-6642.rs [deleted file]
src/test/compile-fail/issue-6738.rs [deleted file]
src/test/compile-fail/issue-6801.rs [deleted file]
src/test/compile-fail/issue-6804.rs [deleted file]
src/test/compile-fail/issue-6936.rs [deleted file]
src/test/compile-fail/issue-7013.rs [deleted file]
src/test/compile-fail/issue-7044.rs [deleted file]
src/test/compile-fail/issue-7061.rs [deleted file]
src/test/compile-fail/issue-7092.rs [deleted file]
src/test/compile-fail/issue-7246.rs [deleted file]
src/test/compile-fail/issue-7364.rs [deleted file]
src/test/compile-fail/issue-7607-1.rs [deleted file]
src/test/compile-fail/issue-7867.rs [deleted file]
src/test/compile-fail/issue-7950.rs [deleted file]
src/test/compile-fail/issue-7970a.rs [deleted file]
src/test/compile-fail/issue-7970b.rs [deleted file]
src/test/compile-fail/issue-8153.rs [deleted file]
src/test/compile-fail/issue-8208.rs [deleted file]
src/test/compile-fail/issue-8460-const.rs [deleted file]
src/test/compile-fail/issue-8640.rs [deleted file]
src/test/compile-fail/issue-8727.rs [deleted file]
src/test/compile-fail/issue-8761.rs [deleted file]
src/test/compile-fail/issue-8767.rs [deleted file]
src/test/compile-fail/issue-9575.rs [deleted file]
src/test/compile-fail/issue-9725.rs [deleted file]
src/test/compile-fail/issue-9814.rs [deleted file]
src/test/compile-fail/issue-pr29383.rs [deleted file]
src/test/ui/issue-10176.rs [new file with mode: 0644]
src/test/ui/issue-10176.stderr [new file with mode: 0644]
src/test/ui/issue-10200.rs [new file with mode: 0644]
src/test/ui/issue-10200.stderr [new file with mode: 0644]
src/test/ui/issue-10291.nll.stderr [new file with mode: 0644]
src/test/ui/issue-10291.rs [new file with mode: 0644]
src/test/ui/issue-10291.stderr [new file with mode: 0644]
src/test/ui/issue-10398.nll.stderr [new file with mode: 0644]
src/test/ui/issue-10398.rs [new file with mode: 0644]
src/test/ui/issue-10398.stderr [new file with mode: 0644]
src/test/ui/issue-10401.rs [new file with mode: 0644]
src/test/ui/issue-10401.stderr [new file with mode: 0644]
src/test/ui/issue-10412.rs [new file with mode: 0644]
src/test/ui/issue-10412.stderr [new file with mode: 0644]
src/test/ui/issue-10465.rs [new file with mode: 0644]
src/test/ui/issue-10465.stderr [new file with mode: 0644]
src/test/ui/issue-10536.rs [new file with mode: 0644]
src/test/ui/issue-10536.stderr [new file with mode: 0644]
src/test/ui/issue-10545.rs [new file with mode: 0644]
src/test/ui/issue-10545.stderr [new file with mode: 0644]
src/test/ui/issue-10656.rs [new file with mode: 0644]
src/test/ui/issue-10656.stderr [new file with mode: 0644]
src/test/ui/issue-10755.rs [new file with mode: 0644]
src/test/ui/issue-10755.stderr [new file with mode: 0644]
src/test/ui/issue-10764.rs [new file with mode: 0644]
src/test/ui/issue-10764.stderr [new file with mode: 0644]
src/test/ui/issue-10877.rs [new file with mode: 0644]
src/test/ui/issue-10877.stderr [new file with mode: 0644]
src/test/ui/issue-10991.rs [new file with mode: 0644]
src/test/ui/issue-10991.stderr [new file with mode: 0644]
src/test/ui/issue-11154.rs [new file with mode: 0644]
src/test/ui/issue-11154.stderr [new file with mode: 0644]
src/test/ui/issue-11192.nll.stderr [new file with mode: 0644]
src/test/ui/issue-11192.rs [new file with mode: 0644]
src/test/ui/issue-11192.stderr [new file with mode: 0644]
src/test/ui/issue-11374.rs [new file with mode: 0644]
src/test/ui/issue-11374.stderr [new file with mode: 0644]
src/test/ui/issue-11493.ast.stderr [new file with mode: 0644]
src/test/ui/issue-11493.mir.stderr [new file with mode: 0644]
src/test/ui/issue-11493.rs [new file with mode: 0644]
src/test/ui/issue-11515.rs [new file with mode: 0644]
src/test/ui/issue-11515.stderr [new file with mode: 0644]
src/test/ui/issue-11681.rs [new file with mode: 0644]
src/test/ui/issue-11681.stderr [new file with mode: 0644]
src/test/ui/issue-11692-1.rs [new file with mode: 0644]
src/test/ui/issue-11692-1.stderr [new file with mode: 0644]
src/test/ui/issue-11692-2.rs [new file with mode: 0644]
src/test/ui/issue-11692-2.stderr [new file with mode: 0644]
src/test/ui/issue-11740.rs [new file with mode: 0644]
src/test/ui/issue-11740.stderr [new file with mode: 0644]
src/test/ui/issue-11771.rs [new file with mode: 0644]
src/test/ui/issue-11771.stderr [new file with mode: 0644]
src/test/ui/issue-11844.rs [new file with mode: 0644]
src/test/ui/issue-11844.stderr [new file with mode: 0644]
src/test/ui/issue-11873.nll.stderr [new file with mode: 0644]
src/test/ui/issue-11873.rs [new file with mode: 0644]
src/test/ui/issue-11873.stderr [new file with mode: 0644]
src/test/ui/issue-12028.rs [new file with mode: 0644]
src/test/ui/issue-12028.stderr [new file with mode: 0644]
src/test/ui/issue-12041.nll.stderr [new file with mode: 0644]
src/test/ui/issue-12041.rs [new file with mode: 0644]
src/test/ui/issue-12041.stderr [new file with mode: 0644]
src/test/ui/issue-12116.rs [new file with mode: 0644]
src/test/ui/issue-12116.stderr [new file with mode: 0644]
src/test/ui/issue-12127.rs [new file with mode: 0644]
src/test/ui/issue-12127.stderr [new file with mode: 0644]
src/test/ui/issue-12369.rs [new file with mode: 0644]
src/test/ui/issue-12369.stderr [new file with mode: 0644]
src/test/ui/issue-12470.nll.stderr [new file with mode: 0644]
src/test/ui/issue-12470.rs [new file with mode: 0644]
src/test/ui/issue-12470.stderr [new file with mode: 0644]
src/test/ui/issue-12552.rs [new file with mode: 0644]
src/test/ui/issue-12552.stderr [new file with mode: 0644]
src/test/ui/issue-12567.nll.stderr [new file with mode: 0644]
src/test/ui/issue-12567.rs [new file with mode: 0644]
src/test/ui/issue-12567.stderr [new file with mode: 0644]
src/test/ui/issue-12796.rs [new file with mode: 0644]
src/test/ui/issue-12796.stderr [new file with mode: 0644]
src/test/ui/issue-12863.rs [new file with mode: 0644]
src/test/ui/issue-12863.stderr [new file with mode: 0644]
src/test/ui/issue-12997-1.rs [new file with mode: 0644]
src/test/ui/issue-12997-1.stderr [new file with mode: 0644]
src/test/ui/issue-12997-2.rs [new file with mode: 0644]
src/test/ui/issue-12997-2.stderr [new file with mode: 0644]
src/test/ui/issue-13033.rs [new file with mode: 0644]
src/test/ui/issue-13033.stderr [new file with mode: 0644]
src/test/ui/issue-13352.rs [new file with mode: 0644]
src/test/ui/issue-13352.stderr [new file with mode: 0644]
src/test/ui/issue-13359.rs [new file with mode: 0644]
src/test/ui/issue-13359.stderr [new file with mode: 0644]
src/test/ui/issue-13404.rs [new file with mode: 0644]
src/test/ui/issue-13404.stderr [new file with mode: 0644]
src/test/ui/issue-13407.rs [new file with mode: 0644]
src/test/ui/issue-13407.stderr [new file with mode: 0644]
src/test/ui/issue-13446.rs [new file with mode: 0644]
src/test/ui/issue-13446.stderr [new file with mode: 0644]
src/test/ui/issue-13466.rs [new file with mode: 0644]
src/test/ui/issue-13466.stderr [new file with mode: 0644]
src/test/ui/issue-13482-2.rs [new file with mode: 0644]
src/test/ui/issue-13482-2.stderr [new file with mode: 0644]
src/test/ui/issue-13482.rs [new file with mode: 0644]
src/test/ui/issue-13482.stderr [new file with mode: 0644]
src/test/ui/issue-13497-2.rs [new file with mode: 0644]
src/test/ui/issue-13497-2.stderr [new file with mode: 0644]
src/test/ui/issue-13497.rs [new file with mode: 0644]
src/test/ui/issue-13497.stderr [new file with mode: 0644]
src/test/ui/issue-1362.rs [new file with mode: 0644]
src/test/ui/issue-1362.stderr [new file with mode: 0644]
src/test/ui/issue-13641.rs [new file with mode: 0644]
src/test/ui/issue-13641.stderr [new file with mode: 0644]
src/test/ui/issue-13727.rs [new file with mode: 0644]
src/test/ui/issue-13727.stderr [new file with mode: 0644]
src/test/ui/issue-13847.rs [new file with mode: 0644]
src/test/ui/issue-13847.stderr [new file with mode: 0644]
src/test/ui/issue-13853-2.rs [new file with mode: 0644]
src/test/ui/issue-13853-2.stderr [new file with mode: 0644]
src/test/ui/issue-13853-5.rs [new file with mode: 0644]
src/test/ui/issue-13853-5.stderr [new file with mode: 0644]
src/test/ui/issue-13853.rs [new file with mode: 0644]
src/test/ui/issue-13853.stderr [new file with mode: 0644]
src/test/ui/issue-14091-2.rs [new file with mode: 0644]
src/test/ui/issue-14091-2.stderr [new file with mode: 0644]
src/test/ui/issue-14091.rs [new file with mode: 0644]
src/test/ui/issue-14091.stderr [new file with mode: 0644]
src/test/ui/issue-14221.rs [new file with mode: 0644]
src/test/ui/issue-14221.stderr [new file with mode: 0644]
src/test/ui/issue-14227.rs [new file with mode: 0644]
src/test/ui/issue-14227.stderr [new file with mode: 0644]
src/test/ui/issue-14285.nll.stderr [new file with mode: 0644]
src/test/ui/issue-14285.rs [new file with mode: 0644]
src/test/ui/issue-14285.stderr [new file with mode: 0644]
src/test/ui/issue-14309.rs [new file with mode: 0644]
src/test/ui/issue-14309.stderr [new file with mode: 0644]
src/test/ui/issue-14366.rs [new file with mode: 0644]
src/test/ui/issue-14366.stderr [new file with mode: 0644]
src/test/ui/issue-1448-2.rs [new file with mode: 0644]
src/test/ui/issue-1448-2.stderr [new file with mode: 0644]
src/test/ui/issue-14541.rs [new file with mode: 0644]
src/test/ui/issue-14541.stderr [new file with mode: 0644]
src/test/ui/issue-14721.rs [new file with mode: 0644]
src/test/ui/issue-14721.stderr [new file with mode: 0644]
src/test/ui/issue-1476.rs [new file with mode: 0644]
src/test/ui/issue-1476.stderr [new file with mode: 0644]
src/test/ui/issue-14772.rs [new file with mode: 0644]
src/test/ui/issue-14772.stderr [new file with mode: 0644]
src/test/ui/issue-14845.rs [new file with mode: 0644]
src/test/ui/issue-14845.stderr [new file with mode: 0644]
src/test/ui/issue-14853.rs [new file with mode: 0644]
src/test/ui/issue-14853.stderr [new file with mode: 0644]
src/test/ui/issue-14915.rs [new file with mode: 0644]
src/test/ui/issue-14915.stderr [new file with mode: 0644]
src/test/ui/issue-15034.nll.stderr [new file with mode: 0644]
src/test/ui/issue-15034.rs [new file with mode: 0644]
src/test/ui/issue-15034.stderr [new file with mode: 0644]
src/test/ui/issue-15094.rs [new file with mode: 0644]
src/test/ui/issue-15094.stderr [new file with mode: 0644]
src/test/ui/issue-15129.rs [new file with mode: 0644]
src/test/ui/issue-15129.stderr [new file with mode: 0644]
src/test/ui/issue-15167.rs [new file with mode: 0644]
src/test/ui/issue-15167.stderr [new file with mode: 0644]
src/test/ui/issue-15207.rs [new file with mode: 0644]
src/test/ui/issue-15207.stderr [new file with mode: 0644]
src/test/ui/issue-15381.rs [new file with mode: 0644]
src/test/ui/issue-15381.stderr [new file with mode: 0644]
src/test/ui/issue-15756.rs [new file with mode: 0644]
src/test/ui/issue-15756.stderr [new file with mode: 0644]
src/test/ui/issue-15783.rs [new file with mode: 0644]
src/test/ui/issue-15783.stderr [new file with mode: 0644]
src/test/ui/issue-15896.rs [new file with mode: 0644]
src/test/ui/issue-15896.stderr [new file with mode: 0644]
src/test/ui/issue-15919.rs [new file with mode: 0644]
src/test/ui/issue-15919.stderr [new file with mode: 0644]
src/test/ui/issue-15965.rs [new file with mode: 0644]
src/test/ui/issue-15965.stderr [new file with mode: 0644]
src/test/ui/issue-16048.rs [new file with mode: 0644]
src/test/ui/issue-16048.stderr [new file with mode: 0644]
src/test/ui/issue-16098.rs [new file with mode: 0644]
src/test/ui/issue-16098.stderr [new file with mode: 0644]
src/test/ui/issue-16149.rs [new file with mode: 0644]
src/test/ui/issue-16149.stderr [new file with mode: 0644]
src/test/ui/issue-16250.rs [new file with mode: 0644]
src/test/ui/issue-16250.stderr [new file with mode: 0644]
src/test/ui/issue-16338.rs [new file with mode: 0644]
src/test/ui/issue-16338.stderr [new file with mode: 0644]
src/test/ui/issue-16401.rs [new file with mode: 0644]
src/test/ui/issue-16401.stderr [new file with mode: 0644]
src/test/ui/issue-16538.rs [new file with mode: 0644]
src/test/ui/issue-16538.stderr [new file with mode: 0644]
src/test/ui/issue-16562.rs [new file with mode: 0644]
src/test/ui/issue-16562.stderr [new file with mode: 0644]
src/test/ui/issue-16683.nll.stderr [new file with mode: 0644]
src/test/ui/issue-16683.rs [new file with mode: 0644]
src/test/ui/issue-16683.stderr [new file with mode: 0644]
src/test/ui/issue-16922.nll.stderr [new file with mode: 0644]
src/test/ui/issue-16922.rs [new file with mode: 0644]
src/test/ui/issue-16922.stderr [new file with mode: 0644]
src/test/ui/issue-16939.rs [new file with mode: 0644]
src/test/ui/issue-16939.stderr [new file with mode: 0644]
src/test/ui/issue-16966.rs [new file with mode: 0644]
src/test/ui/issue-16966.stderr [new file with mode: 0644]
src/test/ui/issue-1697.rs [new file with mode: 0644]
src/test/ui/issue-1697.stderr [new file with mode: 0644]
src/test/ui/issue-16994.rs [new file with mode: 0644]
src/test/ui/issue-16994.stderr [new file with mode: 0644]
src/test/ui/issue-17001.rs [new file with mode: 0644]
src/test/ui/issue-17001.stderr [new file with mode: 0644]
src/test/ui/issue-17025.rs [new file with mode: 0644]
src/test/ui/issue-17033.rs [new file with mode: 0644]
src/test/ui/issue-17033.stderr [new file with mode: 0644]
src/test/ui/issue-17252.rs [new file with mode: 0644]
src/test/ui/issue-17252.stderr [new file with mode: 0644]
src/test/ui/issue-17337.rs [new file with mode: 0644]
src/test/ui/issue-17337.stderr [new file with mode: 0644]
src/test/ui/issue-17373.rs [new file with mode: 0644]
src/test/ui/issue-17373.stderr [new file with mode: 0644]
src/test/ui/issue-17385.nll.stderr [new file with mode: 0644]
src/test/ui/issue-17385.rs [new file with mode: 0644]
src/test/ui/issue-17385.stderr [new file with mode: 0644]
src/test/ui/issue-17405.rs [new file with mode: 0644]
src/test/ui/issue-17405.stderr [new file with mode: 0644]
src/test/ui/issue-17431-1.rs [new file with mode: 0644]
src/test/ui/issue-17431-1.stderr [new file with mode: 0644]
src/test/ui/issue-17431-2.rs [new file with mode: 0644]
src/test/ui/issue-17431-2.stderr [new file with mode: 0644]
src/test/ui/issue-17431-3.rs [new file with mode: 0644]
src/test/ui/issue-17431-3.stderr [new file with mode: 0644]
src/test/ui/issue-17431-4.rs [new file with mode: 0644]
src/test/ui/issue-17431-4.stderr [new file with mode: 0644]
src/test/ui/issue-17431-5.rs [new file with mode: 0644]
src/test/ui/issue-17431-5.stderr [new file with mode: 0644]
src/test/ui/issue-17431-6.rs [new file with mode: 0644]
src/test/ui/issue-17431-6.stderr [new file with mode: 0644]
src/test/ui/issue-17431-7.rs [new file with mode: 0644]
src/test/ui/issue-17431-7.stderr [new file with mode: 0644]
src/test/ui/issue-17444.rs [new file with mode: 0644]
src/test/ui/issue-17444.stderr [new file with mode: 0644]
src/test/ui/issue-17458.rs [new file with mode: 0644]
src/test/ui/issue-17458.stderr [new file with mode: 0644]
src/test/ui/issue-17545.nll.stderr [new file with mode: 0644]
src/test/ui/issue-17545.rs [new file with mode: 0644]
src/test/ui/issue-17545.stderr [new file with mode: 0644]
src/test/ui/issue-17546.rs [new file with mode: 0644]
src/test/ui/issue-17546.stderr [new file with mode: 0644]
src/test/ui/issue-17551.rs [new file with mode: 0644]
src/test/ui/issue-17551.stderr [new file with mode: 0644]
src/test/ui/issue-17651.rs [new file with mode: 0644]
src/test/ui/issue-17651.stderr [new file with mode: 0644]
src/test/ui/issue-17718-const-bad-values.rs [new file with mode: 0644]
src/test/ui/issue-17718-const-bad-values.stderr [new file with mode: 0644]
src/test/ui/issue-17718-const-borrow.rs [new file with mode: 0644]
src/test/ui/issue-17718-const-borrow.stderr [new file with mode: 0644]
src/test/ui/issue-17718-const-naming.rs [new file with mode: 0644]
src/test/ui/issue-17718-const-naming.stderr [new file with mode: 0644]
src/test/ui/issue-17718-constants-not-static.rs [new file with mode: 0644]
src/test/ui/issue-17718-constants-not-static.stderr [new file with mode: 0644]
src/test/ui/issue-17718-patterns.rs [new file with mode: 0644]
src/test/ui/issue-17718-patterns.stderr [new file with mode: 0644]
src/test/ui/issue-17718-references.rs [new file with mode: 0644]
src/test/ui/issue-17718-references.stderr [new file with mode: 0644]
src/test/ui/issue-17718-static-move.rs [new file with mode: 0644]
src/test/ui/issue-17718-static-move.stderr [new file with mode: 0644]
src/test/ui/issue-17718-static-sync.rs [new file with mode: 0644]
src/test/ui/issue-17718-static-sync.stderr [new file with mode: 0644]
src/test/ui/issue-17728.nll.stderr [new file with mode: 0644]
src/test/ui/issue-17728.rs [new file with mode: 0644]
src/test/ui/issue-17728.stderr [new file with mode: 0644]
src/test/ui/issue-17740.rs [new file with mode: 0644]
src/test/ui/issue-17740.stderr [new file with mode: 0644]
src/test/ui/issue-17758.nll.stderr [new file with mode: 0644]
src/test/ui/issue-17758.rs [new file with mode: 0644]
src/test/ui/issue-17758.stderr [new file with mode: 0644]
src/test/ui/issue-17800.rs [new file with mode: 0644]
src/test/ui/issue-17800.stderr [new file with mode: 0644]
src/test/ui/issue-17904-2.rs [new file with mode: 0644]
src/test/ui/issue-17904-2.stderr [new file with mode: 0644]
src/test/ui/issue-17905.rs [new file with mode: 0644]
src/test/ui/issue-17905.stderr [new file with mode: 0644]
src/test/ui/issue-17913.rs [new file with mode: 0644]
src/test/ui/issue-17913.stderr [new file with mode: 0644]
src/test/ui/issue-17933.rs [new file with mode: 0644]
src/test/ui/issue-17933.stderr [new file with mode: 0644]
src/test/ui/issue-17954.ast.nll.stderr [new file with mode: 0644]
src/test/ui/issue-17954.ast.stderr [new file with mode: 0644]
src/test/ui/issue-17954.mir.stderr [new file with mode: 0644]
src/test/ui/issue-17954.rs [new file with mode: 0644]
src/test/ui/issue-17959.rs [new file with mode: 0644]
src/test/ui/issue-17959.stderr [new file with mode: 0644]
src/test/ui/issue-17994.rs [new file with mode: 0644]
src/test/ui/issue-17994.stderr [new file with mode: 0644]
src/test/ui/issue-17999.rs [new file with mode: 0644]
src/test/ui/issue-17999.stderr [new file with mode: 0644]
src/test/ui/issue-18058.rs [new file with mode: 0644]
src/test/ui/issue-18058.stderr [new file with mode: 0644]
src/test/ui/issue-18107.rs [new file with mode: 0644]
src/test/ui/issue-18107.stderr [new file with mode: 0644]
src/test/ui/issue-18118-2.rs [new file with mode: 0644]
src/test/ui/issue-18118-2.stderr [new file with mode: 0644]
src/test/ui/issue-18118.nll.stderr [new file with mode: 0644]
src/test/ui/issue-18118.rs [new file with mode: 0644]
src/test/ui/issue-18118.stderr [new file with mode: 0644]
src/test/ui/issue-18119.rs [new file with mode: 0644]
src/test/ui/issue-18119.stderr [new file with mode: 0644]
src/test/ui/issue-18159.rs [new file with mode: 0644]
src/test/ui/issue-18159.stderr [new file with mode: 0644]
src/test/ui/issue-18294.rs [new file with mode: 0644]
src/test/ui/issue-18294.stderr [new file with mode: 0644]
src/test/ui/issue-18389.rs [new file with mode: 0644]
src/test/ui/issue-18389.stderr [new file with mode: 0644]
src/test/ui/issue-18400.rs [new file with mode: 0644]
src/test/ui/issue-18400.stderr [new file with mode: 0644]
src/test/ui/issue-18423.rs [new file with mode: 0644]
src/test/ui/issue-18423.stderr [new file with mode: 0644]
src/test/ui/issue-18446.rs [new file with mode: 0644]
src/test/ui/issue-18446.stderr [new file with mode: 0644]
src/test/ui/issue-18532.rs [new file with mode: 0644]
src/test/ui/issue-18532.stderr [new file with mode: 0644]
src/test/ui/issue-18566.nll.stderr [new file with mode: 0644]
src/test/ui/issue-18566.rs [new file with mode: 0644]
src/test/ui/issue-18566.stderr [new file with mode: 0644]
src/test/ui/issue-18611.rs [new file with mode: 0644]
src/test/ui/issue-18611.stderr [new file with mode: 0644]
src/test/ui/issue-1871.rs [new file with mode: 0644]
src/test/ui/issue-1871.stderr [new file with mode: 0644]
src/test/ui/issue-18783.nll.stderr [new file with mode: 0644]
src/test/ui/issue-18783.rs [new file with mode: 0644]
src/test/ui/issue-18783.stderr [new file with mode: 0644]
src/test/ui/issue-18919.rs [new file with mode: 0644]
src/test/ui/issue-18919.stderr [new file with mode: 0644]
src/test/ui/issue-18937.rs [new file with mode: 0644]
src/test/ui/issue-18937.stderr [new file with mode: 0644]
src/test/ui/issue-18959.rs [new file with mode: 0644]
src/test/ui/issue-18959.stderr [new file with mode: 0644]
src/test/ui/issue-1900.rs [new file with mode: 0644]
src/test/ui/issue-1900.stderr [new file with mode: 0644]
src/test/ui/issue-19086.rs [new file with mode: 0644]
src/test/ui/issue-19086.stderr [new file with mode: 0644]
src/test/ui/issue-19244-1.rs [new file with mode: 0644]
src/test/ui/issue-19244-1.stderr [new file with mode: 0644]
src/test/ui/issue-19244-2.rs [new file with mode: 0644]
src/test/ui/issue-19244-2.stderr [new file with mode: 0644]
src/test/ui/issue-19380.rs [new file with mode: 0644]
src/test/ui/issue-19380.stderr [new file with mode: 0644]
src/test/ui/issue-19482.rs [new file with mode: 0644]
src/test/ui/issue-19482.stderr [new file with mode: 0644]
src/test/ui/issue-19521.rs [new file with mode: 0644]
src/test/ui/issue-19521.stderr [new file with mode: 0644]
src/test/ui/issue-19538.rs [new file with mode: 0644]
src/test/ui/issue-19538.stderr [new file with mode: 0644]
src/test/ui/issue-19601.rs [new file with mode: 0644]
src/test/ui/issue-19601.stderr [new file with mode: 0644]
src/test/ui/issue-19660.rs [new file with mode: 0644]
src/test/ui/issue-19660.stderr [new file with mode: 0644]
src/test/ui/issue-19692.rs [new file with mode: 0644]
src/test/ui/issue-19692.stderr [new file with mode: 0644]
src/test/ui/issue-19734.rs [new file with mode: 0644]
src/test/ui/issue-19734.stderr [new file with mode: 0644]
src/test/ui/issue-19883.rs [new file with mode: 0644]
src/test/ui/issue-19883.stderr [new file with mode: 0644]
src/test/ui/issue-19982.rs [new file with mode: 0644]
src/test/ui/issue-19982.stderr [new file with mode: 0644]
src/test/ui/issue-19991.rs [new file with mode: 0644]
src/test/ui/issue-19991.stderr [new file with mode: 0644]
src/test/ui/issue-20005.rs [new file with mode: 0644]
src/test/ui/issue-20005.stderr [new file with mode: 0644]
src/test/ui/issue-20162.rs [new file with mode: 0644]
src/test/ui/issue-20162.stderr [new file with mode: 0644]
src/test/ui/issue-20225.rs [new file with mode: 0644]
src/test/ui/issue-20225.stderr [new file with mode: 0644]
src/test/ui/issue-20261.rs [new file with mode: 0644]
src/test/ui/issue-20261.stderr [new file with mode: 0644]
src/test/ui/issue-20313.rs [new file with mode: 0644]
src/test/ui/issue-20313.stderr [new file with mode: 0644]
src/test/ui/issue-20413.rs [new file with mode: 0644]
src/test/ui/issue-20413.stderr [new file with mode: 0644]
src/test/ui/issue-20433.rs [new file with mode: 0644]
src/test/ui/issue-20433.stderr [new file with mode: 0644]
src/test/ui/issue-20605.rs [new file with mode: 0644]
src/test/ui/issue-20605.stderr [new file with mode: 0644]
src/test/ui/issue-20616-1.rs [new file with mode: 0644]
src/test/ui/issue-20616-1.stderr [new file with mode: 0644]
src/test/ui/issue-20616-2.rs [new file with mode: 0644]
src/test/ui/issue-20616-2.stderr [new file with mode: 0644]
src/test/ui/issue-20616-3.rs [new file with mode: 0644]
src/test/ui/issue-20616-3.stderr [new file with mode: 0644]
src/test/ui/issue-20616-4.rs [new file with mode: 0644]
src/test/ui/issue-20616-4.stderr [new file with mode: 0644]
src/test/ui/issue-20616-5.rs [new file with mode: 0644]
src/test/ui/issue-20616-5.stderr [new file with mode: 0644]
src/test/ui/issue-20616-6.rs [new file with mode: 0644]
src/test/ui/issue-20616-6.stderr [new file with mode: 0644]
src/test/ui/issue-20616-7.rs [new file with mode: 0644]
src/test/ui/issue-20616-7.stderr [new file with mode: 0644]
src/test/ui/issue-20616-8.rs [new file with mode: 0644]
src/test/ui/issue-20616-8.stderr [new file with mode: 0644]
src/test/ui/issue-20616-9.rs [new file with mode: 0644]
src/test/ui/issue-20616-9.stderr [new file with mode: 0644]
src/test/ui/issue-20714.rs [new file with mode: 0644]
src/test/ui/issue-20714.stderr [new file with mode: 0644]
src/test/ui/issue-20772.rs [new file with mode: 0644]
src/test/ui/issue-20772.stderr [new file with mode: 0644]
src/test/ui/issue-20801.nll.stderr [new file with mode: 0644]
src/test/ui/issue-20801.rs [new file with mode: 0644]
src/test/ui/issue-20801.stderr [new file with mode: 0644]
src/test/ui/issue-20825.rs [new file with mode: 0644]
src/test/ui/issue-20825.stderr [new file with mode: 0644]
src/test/ui/issue-20831-debruijn.rs [new file with mode: 0644]
src/test/ui/issue-20831-debruijn.stderr [new file with mode: 0644]
src/test/ui/issue-20939.rs [new file with mode: 0644]
src/test/ui/issue-20939.stderr [new file with mode: 0644]
src/test/ui/issue-2111.rs [new file with mode: 0644]
src/test/ui/issue-2111.stderr [new file with mode: 0644]
src/test/ui/issue-21160.rs [new file with mode: 0644]
src/test/ui/issue-21160.stderr [new file with mode: 0644]
src/test/ui/issue-21174.rs [new file with mode: 0644]
src/test/ui/issue-21174.stderr [new file with mode: 0644]
src/test/ui/issue-21177.rs [new file with mode: 0644]
src/test/ui/issue-21177.stderr [new file with mode: 0644]
src/test/ui/issue-21332.rs [new file with mode: 0644]
src/test/ui/issue-21332.stderr [new file with mode: 0644]
src/test/ui/issue-21356.rs [new file with mode: 0644]
src/test/ui/issue-21356.stderr [new file with mode: 0644]
src/test/ui/issue-21449.rs [new file with mode: 0644]
src/test/ui/issue-21449.stderr [new file with mode: 0644]
src/test/ui/issue-2149.rs [new file with mode: 0644]
src/test/ui/issue-2149.stderr [new file with mode: 0644]
src/test/ui/issue-2150.rs [new file with mode: 0644]
src/test/ui/issue-2150.stderr [new file with mode: 0644]
src/test/ui/issue-2151.rs [new file with mode: 0644]
src/test/ui/issue-2151.stderr [new file with mode: 0644]
src/test/ui/issue-21554.rs [new file with mode: 0644]
src/test/ui/issue-21554.stderr [new file with mode: 0644]
src/test/ui/issue-21701.rs [new file with mode: 0644]
src/test/ui/issue-21701.stderr [new file with mode: 0644]
src/test/ui/issue-21763.rs [new file with mode: 0644]
src/test/ui/issue-21763.stderr [new file with mode: 0644]
src/test/ui/issue-21837.rs [new file with mode: 0644]
src/test/ui/issue-21837.stderr [new file with mode: 0644]
src/test/ui/issue-21946.rs [new file with mode: 0644]
src/test/ui/issue-21946.stderr [new file with mode: 0644]
src/test/ui/issue-21974.rs [new file with mode: 0644]
src/test/ui/issue-21974.stderr [new file with mode: 0644]
src/test/ui/issue-22034.rs [new file with mode: 0644]
src/test/ui/issue-22034.stderr [new file with mode: 0644]
src/test/ui/issue-22037.rs [new file with mode: 0644]
src/test/ui/issue-22037.stderr [new file with mode: 0644]
src/test/ui/issue-22289.rs [new file with mode: 0644]
src/test/ui/issue-22289.stderr [new file with mode: 0644]
src/test/ui/issue-22312.rs [new file with mode: 0644]
src/test/ui/issue-22312.stderr [new file with mode: 0644]
src/test/ui/issue-22384.rs [new file with mode: 0644]
src/test/ui/issue-22384.stderr [new file with mode: 0644]
src/test/ui/issue-22434.rs [new file with mode: 0644]
src/test/ui/issue-22434.stderr [new file with mode: 0644]
src/test/ui/issue-22468.rs [new file with mode: 0644]
src/test/ui/issue-22468.stderr [new file with mode: 0644]
src/test/ui/issue-22599.rs [new file with mode: 0644]
src/test/ui/issue-22599.stderr [new file with mode: 0644]
src/test/ui/issue-22603.rs [new file with mode: 0644]
src/test/ui/issue-22603.stderr [new file with mode: 0644]
src/test/ui/issue-22673.rs [new file with mode: 0644]
src/test/ui/issue-22673.stderr [new file with mode: 0644]
src/test/ui/issue-22684.rs [new file with mode: 0644]
src/test/ui/issue-22684.stderr [new file with mode: 0644]
src/test/ui/issue-22706.rs [new file with mode: 0644]
src/test/ui/issue-22706.stderr [new file with mode: 0644]
src/test/ui/issue-22789.rs [new file with mode: 0644]
src/test/ui/issue-22789.stderr [new file with mode: 0644]
src/test/ui/issue-2281-part1.rs [new file with mode: 0644]
src/test/ui/issue-2281-part1.stderr [new file with mode: 0644]
src/test/ui/issue-22874.rs [new file with mode: 0644]
src/test/ui/issue-22874.stderr [new file with mode: 0644]
src/test/ui/issue-22933-1.rs [new file with mode: 0644]
src/test/ui/issue-22933-1.stderr [new file with mode: 0644]
src/test/ui/issue-22933-3.rs [new file with mode: 0644]
src/test/ui/issue-22933-3.stderr [new file with mode: 0644]
src/test/ui/issue-23024.rs [new file with mode: 0644]
src/test/ui/issue-23024.stderr [new file with mode: 0644]
src/test/ui/issue-23046.rs [new file with mode: 0644]
src/test/ui/issue-23046.stderr [new file with mode: 0644]
src/test/ui/issue-23073.rs [new file with mode: 0644]
src/test/ui/issue-23073.stderr [new file with mode: 0644]
src/test/ui/issue-23080-2.rs [new file with mode: 0644]
src/test/ui/issue-23080-2.stderr [new file with mode: 0644]
src/test/ui/issue-23080.rs [new file with mode: 0644]
src/test/ui/issue-23080.stderr [new file with mode: 0644]
src/test/ui/issue-23122-1.rs [new file with mode: 0644]
src/test/ui/issue-23122-1.stderr [new file with mode: 0644]
src/test/ui/issue-23122-2.rs [new file with mode: 0644]
src/test/ui/issue-23122-2.stderr [new file with mode: 0644]
src/test/ui/issue-23253.rs [new file with mode: 0644]
src/test/ui/issue-23253.stderr [new file with mode: 0644]
src/test/ui/issue-23281.rs [new file with mode: 0644]
src/test/ui/issue-23281.stderr [new file with mode: 0644]
src/test/ui/issue-2330.rs [new file with mode: 0644]
src/test/ui/issue-2330.stderr [new file with mode: 0644]
src/test/ui/issue-23589.rs [new file with mode: 0644]
src/test/ui/issue-23589.stderr [new file with mode: 0644]
src/test/ui/issue-23595-1.rs [new file with mode: 0644]
src/test/ui/issue-23595-1.stderr [new file with mode: 0644]
src/test/ui/issue-23595-2.rs [new file with mode: 0644]
src/test/ui/issue-23595-2.stderr [new file with mode: 0644]
src/test/ui/issue-23966.rs [new file with mode: 0644]
src/test/ui/issue-23966.stderr [new file with mode: 0644]
src/test/ui/issue-24013.rs [new file with mode: 0644]
src/test/ui/issue-24013.stderr [new file with mode: 0644]
src/test/ui/issue-24204.rs [new file with mode: 0644]
src/test/ui/issue-24204.stderr [new file with mode: 0644]
src/test/ui/issue-24267-flow-exit.nll.stderr [new file with mode: 0644]
src/test/ui/issue-24267-flow-exit.rs [new file with mode: 0644]
src/test/ui/issue-24267-flow-exit.stderr [new file with mode: 0644]
src/test/ui/issue-24322.rs [new file with mode: 0644]
src/test/ui/issue-24322.stderr [new file with mode: 0644]
src/test/ui/issue-24352.rs [new file with mode: 0644]
src/test/ui/issue-24352.stderr [new file with mode: 0644]
src/test/ui/issue-24357.nll.stderr [new file with mode: 0644]
src/test/ui/issue-24357.rs [new file with mode: 0644]
src/test/ui/issue-24357.stderr [new file with mode: 0644]
src/test/ui/issue-24363.rs [new file with mode: 0644]
src/test/ui/issue-24363.stderr [new file with mode: 0644]
src/test/ui/issue-24365.rs [new file with mode: 0644]
src/test/ui/issue-24365.stderr [new file with mode: 0644]
src/test/ui/issue-24446.rs [new file with mode: 0644]
src/test/ui/issue-24446.stderr [new file with mode: 0644]
src/test/ui/issue-24682.rs [new file with mode: 0644]
src/test/ui/issue-24682.stderr [new file with mode: 0644]
src/test/ui/issue-24819.rs [new file with mode: 0644]
src/test/ui/issue-24819.stderr [new file with mode: 0644]
src/test/ui/issue-24883.rs [new file with mode: 0644]
src/test/ui/issue-24883.stderr [new file with mode: 0644]
src/test/ui/issue-25076.rs [new file with mode: 0644]
src/test/ui/issue-25076.stderr [new file with mode: 0644]
src/test/ui/issue-25368.rs [new file with mode: 0644]
src/test/ui/issue-25368.stderr [new file with mode: 0644]
src/test/ui/issue-25386.rs [new file with mode: 0644]
src/test/ui/issue-25386.stderr [new file with mode: 0644]
src/test/ui/issue-25396.rs [new file with mode: 0644]
src/test/ui/issue-25396.stderr [new file with mode: 0644]
src/test/ui/issue-25439.rs [new file with mode: 0644]
src/test/ui/issue-25439.stderr [new file with mode: 0644]
src/test/ui/issue-25579.ast.nll.stderr [new file with mode: 0644]
src/test/ui/issue-25579.ast.stderr [new file with mode: 0644]
src/test/ui/issue-25579.mir.stderr [new file with mode: 0644]
src/test/ui/issue-25579.rs [new file with mode: 0644]
src/test/ui/issue-25700.rs [new file with mode: 0644]
src/test/ui/issue-25700.stderr [new file with mode: 0644]
src/test/ui/issue-2590.nll.stderr [new file with mode: 0644]
src/test/ui/issue-2590.rs [new file with mode: 0644]
src/test/ui/issue-2590.stderr [new file with mode: 0644]
src/test/ui/issue-25901.rs [new file with mode: 0644]
src/test/ui/issue-25901.stderr [new file with mode: 0644]
src/test/ui/issue-26094.rs [new file with mode: 0644]
src/test/ui/issue-26094.stderr [new file with mode: 0644]
src/test/ui/issue-26158.rs [new file with mode: 0644]
src/test/ui/issue-26158.stderr [new file with mode: 0644]
src/test/ui/issue-26217.nll.stderr [new file with mode: 0644]
src/test/ui/issue-26217.rs [new file with mode: 0644]
src/test/ui/issue-26217.stderr [new file with mode: 0644]
src/test/ui/issue-26237.rs [new file with mode: 0644]
src/test/ui/issue-26237.stderr [new file with mode: 0644]
src/test/ui/issue-26262.rs [new file with mode: 0644]
src/test/ui/issue-26262.stderr [new file with mode: 0644]
src/test/ui/issue-26459.rs [new file with mode: 0644]
src/test/ui/issue-26459.stderr [new file with mode: 0644]
src/test/ui/issue-26548.rs [new file with mode: 0644]
src/test/ui/issue-26548.stderr [new file with mode: 0644]
src/test/ui/issue-26614.rs [new file with mode: 0644]
src/test/ui/issue-26614.stderr [new file with mode: 0644]
src/test/ui/issue-26812.rs [new file with mode: 0644]
src/test/ui/issue-26812.stderr [new file with mode: 0644]
src/test/ui/issue-26905.rs [new file with mode: 0644]
src/test/ui/issue-26905.stderr [new file with mode: 0644]
src/test/ui/issue-26930.rs [new file with mode: 0644]
src/test/ui/issue-26930.stderr [new file with mode: 0644]
src/test/ui/issue-26948.rs [new file with mode: 0644]
src/test/ui/issue-26948.stderr [new file with mode: 0644]
src/test/ui/issue-27008.rs [new file with mode: 0644]
src/test/ui/issue-27008.stderr [new file with mode: 0644]
src/test/ui/issue-27033.rs [new file with mode: 0644]
src/test/ui/issue-27033.stderr [new file with mode: 0644]
src/test/ui/issue-27042.rs [new file with mode: 0644]
src/test/ui/issue-27042.stderr [new file with mode: 0644]
src/test/ui/issue-27060-2.rs [new file with mode: 0644]
src/test/ui/issue-27060-2.stderr [new file with mode: 0644]
src/test/ui/issue-27078.rs [new file with mode: 0644]
src/test/ui/issue-27078.stderr [new file with mode: 0644]
src/test/ui/issue-2718-a.rs [new file with mode: 0644]
src/test/ui/issue-2718-a.stderr [new file with mode: 0644]
src/test/ui/issue-27340.rs [new file with mode: 0644]
src/test/ui/issue-27340.stderr [new file with mode: 0644]
src/test/ui/issue-27433.rs [new file with mode: 0644]
src/test/ui/issue-27433.stderr [new file with mode: 0644]
src/test/ui/issue-27592.nll.stderr [new file with mode: 0644]
src/test/ui/issue-27592.rs [new file with mode: 0644]
src/test/ui/issue-27592.stderr [new file with mode: 0644]
src/test/ui/issue-27815.rs [new file with mode: 0644]
src/test/ui/issue-27815.stderr [new file with mode: 0644]
src/test/ui/issue-27895.rs [new file with mode: 0644]
src/test/ui/issue-27895.stderr [new file with mode: 0644]
src/test/ui/issue-28098.rs [new file with mode: 0644]
src/test/ui/issue-28098.stderr [new file with mode: 0644]
src/test/ui/issue-28105.rs [new file with mode: 0644]
src/test/ui/issue-28105.stderr [new file with mode: 0644]
src/test/ui/issue-28109.rs [new file with mode: 0644]
src/test/ui/issue-28109.stderr [new file with mode: 0644]
src/test/ui/issue-28113.rs [new file with mode: 0644]
src/test/ui/issue-28113.stderr [new file with mode: 0644]
src/test/ui/issue-2823.rs [new file with mode: 0644]
src/test/ui/issue-2823.stderr [new file with mode: 0644]
src/test/ui/issue-28324.rs [new file with mode: 0644]
src/test/ui/issue-28324.stderr [new file with mode: 0644]
src/test/ui/issue-28344.rs [new file with mode: 0644]
src/test/ui/issue-28344.stderr [new file with mode: 0644]
src/test/ui/issue-28433.rs [new file with mode: 0644]
src/test/ui/issue-28433.stderr [new file with mode: 0644]
src/test/ui/issue-28472.rs [new file with mode: 0644]
src/test/ui/issue-28472.stderr [new file with mode: 0644]
src/test/ui/issue-2849.rs [new file with mode: 0644]
src/test/ui/issue-2849.stderr [new file with mode: 0644]
src/test/ui/issue-28576.rs [new file with mode: 0644]
src/test/ui/issue-28576.stderr [new file with mode: 0644]
src/test/ui/issue-28586.rs [new file with mode: 0644]
src/test/ui/issue-28586.stderr [new file with mode: 0644]
src/test/ui/issue-28625.rs [new file with mode: 0644]
src/test/ui/issue-28625.stderr [new file with mode: 0644]
src/test/ui/issue-28992-empty.rs [new file with mode: 0644]
src/test/ui/issue-28992-empty.stderr [new file with mode: 0644]
src/test/ui/issue-29084.rs [new file with mode: 0644]
src/test/ui/issue-29084.stderr [new file with mode: 0644]
src/test/ui/issue-29147.rs [new file with mode: 0644]
src/test/ui/issue-29147.stderr [new file with mode: 0644]
src/test/ui/issue-29161.rs [new file with mode: 0644]
src/test/ui/issue-29161.stderr [new file with mode: 0644]
src/test/ui/issue-29184.rs [new file with mode: 0644]
src/test/ui/issue-29184.stderr [new file with mode: 0644]
src/test/ui/issue-2937.rs [new file with mode: 0644]
src/test/ui/issue-2937.stderr [new file with mode: 0644]
src/test/ui/issue-2951.rs [new file with mode: 0644]
src/test/ui/issue-2951.stderr [new file with mode: 0644]
src/test/ui/issue-29857.rs [new file with mode: 0644]
src/test/ui/issue-29857.stderr [new file with mode: 0644]
src/test/ui/issue-29861.rs [new file with mode: 0644]
src/test/ui/issue-29861.stderr [new file with mode: 0644]
src/test/ui/issue-2995.rs [new file with mode: 0644]
src/test/ui/issue-2995.stderr [new file with mode: 0644]
src/test/ui/issue-30079.rs [new file with mode: 0644]
src/test/ui/issue-30079.stderr [new file with mode: 0644]
src/test/ui/issue-3008-3.rs [new file with mode: 0644]
src/test/ui/issue-3008-3.stderr [new file with mode: 0644]
src/test/ui/issue-3021-b.rs [new file with mode: 0644]
src/test/ui/issue-3021-b.stderr [new file with mode: 0644]
src/test/ui/issue-3021-c.rs [new file with mode: 0644]
src/test/ui/issue-3021-c.stderr [new file with mode: 0644]
src/test/ui/issue-3021-d.rs [new file with mode: 0644]
src/test/ui/issue-3021-d.stderr [new file with mode: 0644]
src/test/ui/issue-3021.rs [new file with mode: 0644]
src/test/ui/issue-3021.stderr [new file with mode: 0644]
src/test/ui/issue-30225.rs [new file with mode: 0644]
src/test/ui/issue-30225.stderr [new file with mode: 0644]
src/test/ui/issue-30236.rs [new file with mode: 0644]
src/test/ui/issue-30236.stderr [new file with mode: 0644]
src/test/ui/issue-30240-b.rs [new file with mode: 0644]
src/test/ui/issue-30240-b.stderr [new file with mode: 0644]
src/test/ui/issue-30240.rs [new file with mode: 0644]
src/test/ui/issue-30240.stderr [new file with mode: 0644]
src/test/ui/issue-30355.nll.stderr [new file with mode: 0644]
src/test/ui/issue-30355.rs [new file with mode: 0644]
src/test/ui/issue-30355.stderr [new file with mode: 0644]
src/test/ui/issue-3038.rs [new file with mode: 0644]
src/test/ui/issue-3038.stderr [new file with mode: 0644]
src/test/ui/issue-30438-a.nll.stderr [new file with mode: 0644]
src/test/ui/issue-30438-a.rs [new file with mode: 0644]
src/test/ui/issue-30438-a.stderr [new file with mode: 0644]
src/test/ui/issue-30438-b.rs [new file with mode: 0644]
src/test/ui/issue-30438-b.stderr [new file with mode: 0644]
src/test/ui/issue-30438-c.nll.stderr [new file with mode: 0644]
src/test/ui/issue-30438-c.rs [new file with mode: 0644]
src/test/ui/issue-30438-c.stderr [new file with mode: 0644]
src/test/ui/issue-30560.rs [new file with mode: 0644]
src/test/ui/issue-30560.stderr [new file with mode: 0644]
src/test/ui/issue-30589.rs [new file with mode: 0644]
src/test/ui/issue-30589.stderr [new file with mode: 0644]
src/test/ui/issue-3080.rs [new file with mode: 0644]
src/test/ui/issue-3080.stderr [new file with mode: 0644]
src/test/ui/issue-3096-1.rs [new file with mode: 0644]
src/test/ui/issue-3096-1.stderr [new file with mode: 0644]
src/test/ui/issue-3096-2.rs [new file with mode: 0644]
src/test/ui/issue-3096-2.stderr [new file with mode: 0644]
src/test/ui/issue-3099-a.rs [new file with mode: 0644]
src/test/ui/issue-3099-a.stderr [new file with mode: 0644]
src/test/ui/issue-3099-b.rs [new file with mode: 0644]
src/test/ui/issue-3099-b.stderr [new file with mode: 0644]
src/test/ui/issue-3099.rs [new file with mode: 0644]
src/test/ui/issue-3099.stderr [new file with mode: 0644]
src/test/ui/issue-31011.rs [new file with mode: 0644]
src/test/ui/issue-31011.stderr [new file with mode: 0644]
src/test/ui/issue-31109.rs [new file with mode: 0644]
src/test/ui/issue-31109.stderr [new file with mode: 0644]
src/test/ui/issue-31173.rs [new file with mode: 0644]
src/test/ui/issue-31173.stderr [new file with mode: 0644]
src/test/ui/issue-31212.rs [new file with mode: 0644]
src/test/ui/issue-31212.stderr [new file with mode: 0644]
src/test/ui/issue-31495.rs [new file with mode: 0644]
src/test/ui/issue-31511.rs [new file with mode: 0644]
src/test/ui/issue-31511.stderr [new file with mode: 0644]
src/test/ui/issue-3154.nll.stderr [new file with mode: 0644]
src/test/ui/issue-3154.rs [new file with mode: 0644]
src/test/ui/issue-3154.stderr [new file with mode: 0644]
src/test/ui/issue-31561.rs [new file with mode: 0644]
src/test/ui/issue-31561.stderr [new file with mode: 0644]
src/test/ui/issue-31769.rs [new file with mode: 0644]
src/test/ui/issue-31769.stderr [new file with mode: 0644]
src/test/ui/issue-31804.rs [new file with mode: 0644]
src/test/ui/issue-31804.stderr [new file with mode: 0644]
src/test/ui/issue-31845.rs [new file with mode: 0644]
src/test/ui/issue-31845.stderr [new file with mode: 0644]
src/test/ui/issue-31910.rs [new file with mode: 0644]
src/test/ui/issue-31910.stderr [new file with mode: 0644]
src/test/ui/issue-31924-non-snake-ffi.rs [new file with mode: 0644]
src/test/ui/issue-31924-non-snake-ffi.stderr [new file with mode: 0644]
src/test/ui/issue-32004.rs [new file with mode: 0644]
src/test/ui/issue-32004.stderr [new file with mode: 0644]
src/test/ui/issue-32086.rs [new file with mode: 0644]
src/test/ui/issue-32086.stderr [new file with mode: 0644]
src/test/ui/issue-32119.rs [new file with mode: 0644]
src/test/ui/issue-32119.stderr [new file with mode: 0644]
src/test/ui/issue-3214.rs [new file with mode: 0644]
src/test/ui/issue-3214.stderr [new file with mode: 0644]
src/test/ui/issue-32201.rs [new file with mode: 0644]
src/test/ui/issue-32201.stderr [new file with mode: 0644]
src/test/ui/issue-32222.rs [new file with mode: 0644]
src/test/ui/issue-32222.stderr [new file with mode: 0644]
src/test/ui/issue-32323.rs [new file with mode: 0644]
src/test/ui/issue-32323.stderr [new file with mode: 0644]
src/test/ui/issue-32377.rs [new file with mode: 0644]
src/test/ui/issue-32377.stderr [new file with mode: 0644]
src/test/ui/issue-32655.rs [new file with mode: 0644]
src/test/ui/issue-32655.stderr [new file with mode: 0644]
src/test/ui/issue-32709.rs [new file with mode: 0644]
src/test/ui/issue-32709.stderr [new file with mode: 0644]
src/test/ui/issue-32782.rs [new file with mode: 0644]
src/test/ui/issue-32782.stderr [new file with mode: 0644]
src/test/ui/issue-32797.rs [new file with mode: 0644]
src/test/ui/issue-32797.stderr [new file with mode: 0644]
src/test/ui/issue-32829.rs [new file with mode: 0644]
src/test/ui/issue-32829.stderr [new file with mode: 0644]
src/test/ui/issue-32833.rs [new file with mode: 0644]
src/test/ui/issue-32833.stderr [new file with mode: 0644]
src/test/ui/issue-32922.rs [new file with mode: 0644]
src/test/ui/issue-32922.stderr [new file with mode: 0644]
src/test/ui/issue-32963.rs [new file with mode: 0644]
src/test/ui/issue-32963.stderr [new file with mode: 0644]
src/test/ui/issue-32995-2.rs [new file with mode: 0644]
src/test/ui/issue-32995-2.stderr [new file with mode: 0644]
src/test/ui/issue-32995.rs [new file with mode: 0644]
src/test/ui/issue-32995.stderr [new file with mode: 0644]
src/test/ui/issue-33241.rs [new file with mode: 0644]
src/test/ui/issue-33241.stderr [new file with mode: 0644]
src/test/ui/issue-33293.rs [new file with mode: 0644]
src/test/ui/issue-33293.stderr [new file with mode: 0644]
src/test/ui/issue-3344.rs [new file with mode: 0644]
src/test/ui/issue-3344.stderr [new file with mode: 0644]
src/test/ui/issue-33464.rs [new file with mode: 0644]
src/test/ui/issue-33464.stderr [new file with mode: 0644]
src/test/ui/issue-33504.rs [new file with mode: 0644]
src/test/ui/issue-33504.stderr [new file with mode: 0644]
src/test/ui/issue-33571.rs [new file with mode: 0644]
src/test/ui/issue-33571.stderr [new file with mode: 0644]
src/test/ui/issue-33819.nll.stderr [new file with mode: 0644]
src/test/ui/issue-33819.rs [new file with mode: 0644]
src/test/ui/issue-33819.stderr [new file with mode: 0644]
src/test/ui/issue-34028.rs [new file with mode: 0644]
src/test/ui/issue-34028.stderr [new file with mode: 0644]
src/test/ui/issue-34171.rs [new file with mode: 0644]
src/test/ui/issue-34171.stderr [new file with mode: 0644]
src/test/ui/issue-34222-1.rs [new file with mode: 0644]
src/test/ui/issue-34222-1.stderr [new file with mode: 0644]
src/test/ui/issue-34334.rs [new file with mode: 0644]
src/test/ui/issue-34334.stderr [new file with mode: 0644]
src/test/ui/issue-34349.rs [new file with mode: 0644]
src/test/ui/issue-34349.stderr [new file with mode: 0644]
src/test/ui/issue-34373.rs [new file with mode: 0644]
src/test/ui/issue-34373.stderr [new file with mode: 0644]
src/test/ui/issue-34418.rs [new file with mode: 0644]
src/test/ui/issue-34418.stderr [new file with mode: 0644]
src/test/ui/issue-3477.rs [new file with mode: 0644]
src/test/ui/issue-3477.stderr [new file with mode: 0644]
src/test/ui/issue-34839.rs [new file with mode: 0644]
src/test/ui/issue-34839.stderr [new file with mode: 0644]
src/test/ui/issue-35075.rs [new file with mode: 0644]
src/test/ui/issue-35075.stderr [new file with mode: 0644]
src/test/ui/issue-3521-2.rs [new file with mode: 0644]
src/test/ui/issue-3521-2.stderr [new file with mode: 0644]
src/test/ui/issue-3521.rs [new file with mode: 0644]
src/test/ui/issue-3521.stderr [new file with mode: 0644]
src/test/ui/issue-35450.rs [new file with mode: 0644]
src/test/ui/issue-35450.stderr [new file with mode: 0644]
src/test/ui/issue-35570.rs [new file with mode: 0644]
src/test/ui/issue-35570.stderr [new file with mode: 0644]
src/test/ui/issue-35668.rs [new file with mode: 0644]
src/test/ui/issue-35668.stderr [new file with mode: 0644]
src/test/ui/issue-35988.rs [new file with mode: 0644]
src/test/ui/issue-35988.stderr [new file with mode: 0644]
src/test/ui/issue-3601.rs [new file with mode: 0644]
src/test/ui/issue-3601.stderr [new file with mode: 0644]
src/test/ui/issue-36082.ast.nll.stderr [new file with mode: 0644]
src/test/ui/issue-36082.ast.stderr [new file with mode: 0644]
src/test/ui/issue-36082.mir.stderr [new file with mode: 0644]
src/test/ui/issue-36082.rs [new file with mode: 0644]
src/test/ui/issue-36116.rs [new file with mode: 0644]
src/test/ui/issue-36116.stderr [new file with mode: 0644]
src/test/ui/issue-36299.rs [new file with mode: 0644]
src/test/ui/issue-36299.stderr [new file with mode: 0644]
src/test/ui/issue-36379.rs [new file with mode: 0644]
src/test/ui/issue-36379.stderr [new file with mode: 0644]
src/test/ui/issue-36617.rs [new file with mode: 0644]
src/test/ui/issue-36617.stderr [new file with mode: 0644]
src/test/ui/issue-36638.rs [new file with mode: 0644]
src/test/ui/issue-36638.stderr [new file with mode: 0644]
src/test/ui/issue-3668-2.rs [new file with mode: 0644]
src/test/ui/issue-3668-2.stderr [new file with mode: 0644]
src/test/ui/issue-3668.rs [new file with mode: 0644]
src/test/ui/issue-3668.stderr [new file with mode: 0644]
src/test/ui/issue-3680.rs [new file with mode: 0644]
src/test/ui/issue-3680.stderr [new file with mode: 0644]
src/test/ui/issue-36839.rs [new file with mode: 0644]
src/test/ui/issue-36839.stderr [new file with mode: 0644]
src/test/ui/issue-3702-2.rs [new file with mode: 0644]
src/test/ui/issue-3702-2.stderr [new file with mode: 0644]
src/test/ui/issue-37026.rs [new file with mode: 0644]
src/test/ui/issue-37026.stderr [new file with mode: 0644]
src/test/ui/issue-37051.rs [new file with mode: 0644]
src/test/ui/issue-37051.stderr [new file with mode: 0644]
src/test/ui/issue-3707.rs [new file with mode: 0644]
src/test/ui/issue-3707.stderr [new file with mode: 0644]
src/test/ui/issue-37323.rs [new file with mode: 0644]
src/test/ui/issue-37323.stderr [new file with mode: 0644]
src/test/ui/issue-37366.rs [new file with mode: 0644]
src/test/ui/issue-37366.stderr [new file with mode: 0644]
src/test/ui/issue-37510.rs [new file with mode: 0644]
src/test/ui/issue-37510.stderr [new file with mode: 0644]
src/test/ui/issue-37515.rs [new file with mode: 0644]
src/test/ui/issue-37515.stderr [new file with mode: 0644]
src/test/ui/issue-37534.rs [new file with mode: 0644]
src/test/ui/issue-37534.stderr [new file with mode: 0644]
src/test/ui/issue-37550.rs [new file with mode: 0644]
src/test/ui/issue-37550.stderr [new file with mode: 0644]
src/test/ui/issue-37576.rs [new file with mode: 0644]
src/test/ui/issue-37576.stderr [new file with mode: 0644]
src/test/ui/issue-3763.rs [new file with mode: 0644]
src/test/ui/issue-3763.stderr [new file with mode: 0644]
src/test/ui/issue-37665.rs [new file with mode: 0644]
src/test/ui/issue-37665.stderr [new file with mode: 0644]
src/test/ui/issue-37887.rs [new file with mode: 0644]
src/test/ui/issue-37887.stderr [new file with mode: 0644]
src/test/ui/issue-38160.rs [new file with mode: 0644]
src/test/ui/issue-38160.stderr [new file with mode: 0644]
src/test/ui/issue-3820.rs [new file with mode: 0644]
src/test/ui/issue-3820.stderr [new file with mode: 0644]
src/test/ui/issue-38293.rs [new file with mode: 0644]
src/test/ui/issue-38293.stderr [new file with mode: 0644]
src/test/ui/issue-38381.rs [new file with mode: 0644]
src/test/ui/issue-38381.stderr [new file with mode: 0644]
src/test/ui/issue-38404.rs [new file with mode: 0644]
src/test/ui/issue-38404.stderr [new file with mode: 0644]
src/test/ui/issue-38412.rs [new file with mode: 0644]
src/test/ui/issue-38412.stderr [new file with mode: 0644]
src/test/ui/issue-38458.rs [new file with mode: 0644]
src/test/ui/issue-38458.stderr [new file with mode: 0644]
src/test/ui/issue-38604.rs [new file with mode: 0644]
src/test/ui/issue-38604.stderr [new file with mode: 0644]
src/test/ui/issue-38857.rs [new file with mode: 0644]
src/test/ui/issue-38857.stderr [new file with mode: 0644]
src/test/ui/issue-38868.rs [new file with mode: 0644]
src/test/ui/issue-38868.stderr [new file with mode: 0644]
src/test/ui/issue-38919.rs [new file with mode: 0644]
src/test/ui/issue-38919.stderr [new file with mode: 0644]
src/test/ui/issue-38954.rs [new file with mode: 0644]
src/test/ui/issue-38954.stderr [new file with mode: 0644]
src/test/ui/issue-39211.rs [new file with mode: 0644]
src/test/ui/issue-39211.stderr [new file with mode: 0644]
src/test/ui/issue-39362.rs [new file with mode: 0644]
src/test/ui/issue-39362.stderr [new file with mode: 0644]
src/test/ui/issue-39388.rs [new file with mode: 0644]
src/test/ui/issue-39388.stderr [new file with mode: 0644]
src/test/ui/issue-39404.rs [new file with mode: 0644]
src/test/ui/issue-39404.stderr [new file with mode: 0644]
src/test/ui/issue-39559-2.rs [new file with mode: 0644]
src/test/ui/issue-39559-2.stderr [new file with mode: 0644]
src/test/ui/issue-39559.rs [new file with mode: 0644]
src/test/ui/issue-39559.stderr [new file with mode: 0644]
src/test/ui/issue-39616.rs [new file with mode: 0644]
src/test/ui/issue-39616.stderr [new file with mode: 0644]
src/test/ui/issue-39687.rs [new file with mode: 0644]
src/test/ui/issue-39687.stderr [new file with mode: 0644]
src/test/ui/issue-3973.rs [new file with mode: 0644]
src/test/ui/issue-3973.stderr [new file with mode: 0644]
src/test/ui/issue-39848.rs [new file with mode: 0644]
src/test/ui/issue-39848.stderr [new file with mode: 0644]
src/test/ui/issue-3993.rs [new file with mode: 0644]
src/test/ui/issue-3993.stderr [new file with mode: 0644]
src/test/ui/issue-39970.rs [new file with mode: 0644]
src/test/ui/issue-39970.stderr [new file with mode: 0644]
src/test/ui/issue-39974.rs [new file with mode: 0644]
src/test/ui/issue-39974.stderr [new file with mode: 0644]
src/test/ui/issue-40000.rs [new file with mode: 0644]
src/test/ui/issue-40000.stderr [new file with mode: 0644]
src/test/ui/issue-40288-2.nll.stderr [new file with mode: 0644]
src/test/ui/issue-40288-2.rs [new file with mode: 0644]
src/test/ui/issue-40288-2.stderr [new file with mode: 0644]
src/test/ui/issue-40288.nll.stderr [new file with mode: 0644]
src/test/ui/issue-40288.rs [new file with mode: 0644]
src/test/ui/issue-40288.stderr [new file with mode: 0644]
src/test/ui/issue-40350.rs [new file with mode: 0644]
src/test/ui/issue-40350.stderr [new file with mode: 0644]
src/test/ui/issue-40510-1.nll.stderr [new file with mode: 0644]
src/test/ui/issue-40510-1.rs [new file with mode: 0644]
src/test/ui/issue-40510-1.stderr [new file with mode: 0644]
src/test/ui/issue-40510-2.rs [new file with mode: 0644]
src/test/ui/issue-40510-2.stderr [new file with mode: 0644]
src/test/ui/issue-40510-3.nll.stderr [new file with mode: 0644]
src/test/ui/issue-40510-3.rs [new file with mode: 0644]
src/test/ui/issue-40510-3.stderr [new file with mode: 0644]
src/test/ui/issue-40510-4.rs [new file with mode: 0644]
src/test/ui/issue-40510-4.stderr [new file with mode: 0644]
src/test/ui/issue-40610.rs [new file with mode: 0644]
src/test/ui/issue-40610.stderr [new file with mode: 0644]
src/test/ui/issue-40749.rs [new file with mode: 0644]
src/test/ui/issue-40749.stderr [new file with mode: 0644]
src/test/ui/issue-40845.rs [new file with mode: 0644]
src/test/ui/issue-40845.stderr [new file with mode: 0644]
src/test/ui/issue-40861.rs [new file with mode: 0644]
src/test/ui/issue-40861.stderr [new file with mode: 0644]
src/test/ui/issue-41139.nll.stderr [new file with mode: 0644]
src/test/ui/issue-41139.rs [new file with mode: 0644]
src/test/ui/issue-41139.stderr [new file with mode: 0644]
src/test/ui/issue-41229-ref-str.rs [new file with mode: 0644]
src/test/ui/issue-41229-ref-str.stderr [new file with mode: 0644]
src/test/ui/issue-41255.rs [new file with mode: 0644]
src/test/ui/issue-41255.stderr [new file with mode: 0644]
src/test/ui/issue-41394.rs [new file with mode: 0644]
src/test/ui/issue-41394.stderr [new file with mode: 0644]
src/test/ui/issue-41726.nll.stderr [new file with mode: 0644]
src/test/ui/issue-41726.rs [new file with mode: 0644]
src/test/ui/issue-41726.stderr [new file with mode: 0644]
src/test/ui/issue-41742.rs [new file with mode: 0644]
src/test/ui/issue-41742.stderr [new file with mode: 0644]
src/test/ui/issue-41776.rs [new file with mode: 0644]
src/test/ui/issue-41776.stderr [new file with mode: 0644]
src/test/ui/issue-41880.rs [new file with mode: 0644]
src/test/ui/issue-41880.stderr [new file with mode: 0644]
src/test/ui/issue-41974.rs [new file with mode: 0644]
src/test/ui/issue-41974.stderr [new file with mode: 0644]
src/test/ui/issue-41998.rs [new file with mode: 0644]
src/test/ui/issue-41998.stderr [new file with mode: 0644]
src/test/ui/issue-4201.rs [new file with mode: 0644]
src/test/ui/issue-4201.stderr [new file with mode: 0644]
src/test/ui/issue-42312.rs [new file with mode: 0644]
src/test/ui/issue-42312.stderr [new file with mode: 0644]
src/test/ui/issue-42344.nll.stderr [new file with mode: 0644]
src/test/ui/issue-42344.rs [new file with mode: 0644]
src/test/ui/issue-42344.stderr [new file with mode: 0644]
src/test/ui/issue-4265.rs [new file with mode: 0644]
src/test/ui/issue-4265.stderr [new file with mode: 0644]
src/test/ui/issue-42755.rs [new file with mode: 0644]
src/test/ui/issue-42755.stderr [new file with mode: 0644]
src/test/ui/issue-42796.nll.stderr [new file with mode: 0644]
src/test/ui/issue-42796.rs [new file with mode: 0644]
src/test/ui/issue-42796.stderr [new file with mode: 0644]
src/test/ui/issue-42880.rs [new file with mode: 0644]
src/test/ui/issue-42880.stderr [new file with mode: 0644]
src/test/ui/issue-43023.rs [new file with mode: 0644]
src/test/ui/issue-43023.stderr [new file with mode: 0644]
src/test/ui/issue-43105.rs [new file with mode: 0644]
src/test/ui/issue-43105.stderr [new file with mode: 0644]
src/test/ui/issue-43162.rs [new file with mode: 0644]
src/test/ui/issue-43162.stderr [new file with mode: 0644]
src/test/ui/issue-4321.rs [new file with mode: 0644]
src/test/ui/issue-4321.stderr [new file with mode: 0644]
src/test/ui/issue-43250.rs [new file with mode: 0644]
src/test/ui/issue-43250.stderr [new file with mode: 0644]
src/test/ui/issue-43355.rs [new file with mode: 0644]
src/test/ui/issue-43355.stderr [new file with mode: 0644]
src/test/ui/issue-43424.rs [new file with mode: 0644]
src/test/ui/issue-43424.stderr [new file with mode: 0644]
src/test/ui/issue-43431.rs [new file with mode: 0644]
src/test/ui/issue-43431.stderr [new file with mode: 0644]
src/test/ui/issue-4366-2.rs [new file with mode: 0644]
src/test/ui/issue-4366-2.stderr [new file with mode: 0644]
src/test/ui/issue-4366.rs [new file with mode: 0644]
src/test/ui/issue-4366.stderr [new file with mode: 0644]
src/test/ui/issue-43733-2.rs [new file with mode: 0644]
src/test/ui/issue-43733-2.stderr [new file with mode: 0644]
src/test/ui/issue-43733.rs [new file with mode: 0644]
src/test/ui/issue-43733.stderr [new file with mode: 0644]
src/test/ui/issue-43784-associated-type.rs [new file with mode: 0644]
src/test/ui/issue-43784-associated-type.stderr [new file with mode: 0644]
src/test/ui/issue-43784-supertrait.rs [new file with mode: 0644]
src/test/ui/issue-43784-supertrait.stderr [new file with mode: 0644]
src/test/ui/issue-43925.rs [new file with mode: 0644]
src/test/ui/issue-43925.stderr [new file with mode: 0644]
src/test/ui/issue-43926.rs [new file with mode: 0644]
src/test/ui/issue-43926.stderr [new file with mode: 0644]
src/test/ui/issue-43988.rs [new file with mode: 0644]
src/test/ui/issue-43988.stderr [new file with mode: 0644]
src/test/ui/issue-44021.rs [new file with mode: 0644]
src/test/ui/issue-44021.stderr [new file with mode: 0644]
src/test/ui/issue-44239.rs [new file with mode: 0644]
src/test/ui/issue-44239.stderr [new file with mode: 0644]
src/test/ui/issue-44373.rs [new file with mode: 0644]
src/test/ui/issue-44373.stderr [new file with mode: 0644]
src/test/ui/issue-44415.rs [new file with mode: 0644]
src/test/ui/issue-44415.stderr [new file with mode: 0644]
src/test/ui/issue-45087-unreachable-unsafe.rs [new file with mode: 0644]
src/test/ui/issue-45087-unreachable-unsafe.stderr [new file with mode: 0644]
src/test/ui/issue-4517.rs [new file with mode: 0644]
src/test/ui/issue-4517.stderr [new file with mode: 0644]
src/test/ui/issue-45199.ast.nll.stderr [new file with mode: 0644]
src/test/ui/issue-45199.ast.stderr [new file with mode: 0644]
src/test/ui/issue-45199.mir.stderr [new file with mode: 0644]
src/test/ui/issue-45199.rs [new file with mode: 0644]
src/test/ui/issue-45729-unsafe-in-generator.rs [new file with mode: 0644]
src/test/ui/issue-45729-unsafe-in-generator.stderr [new file with mode: 0644]
src/test/ui/issue-45801.rs [new file with mode: 0644]
src/test/ui/issue-45801.stderr [new file with mode: 0644]
src/test/ui/issue-45965.rs [new file with mode: 0644]
src/test/ui/issue-45965.stderr [new file with mode: 0644]
src/test/ui/issue-46023.ast.nll.stderr [new file with mode: 0644]
src/test/ui/issue-46023.ast.stderr [new file with mode: 0644]
src/test/ui/issue-46023.mir.stderr [new file with mode: 0644]
src/test/ui/issue-46023.rs [new file with mode: 0644]
src/test/ui/issue-46036.rs [new file with mode: 0644]
src/test/ui/issue-46036.stderr [new file with mode: 0644]
src/test/ui/issue-46311.rs [new file with mode: 0644]
src/test/ui/issue-46311.stderr [new file with mode: 0644]
src/test/ui/issue-46438.rs [new file with mode: 0644]
src/test/ui/issue-46438.stderr [new file with mode: 0644]
src/test/ui/issue-46604.ast.nll.stderr [new file with mode: 0644]
src/test/ui/issue-46604.ast.stderr [new file with mode: 0644]
src/test/ui/issue-46604.mir.stderr [new file with mode: 0644]
src/test/ui/issue-46604.rs [new file with mode: 0644]
src/test/ui/issue-46771.rs [new file with mode: 0644]
src/test/ui/issue-46771.stderr [new file with mode: 0644]
src/test/ui/issue-46843.rs [new file with mode: 0644]
src/test/ui/issue-46843.stderr [new file with mode: 0644]
src/test/ui/issue-47309.rs [new file with mode: 0644]
src/test/ui/issue-4736.rs [new file with mode: 0644]
src/test/ui/issue-4736.stderr [new file with mode: 0644]
src/test/ui/issue-47412.rs [new file with mode: 0644]
src/test/ui/issue-47412.stderr [new file with mode: 0644]
src/test/ui/issue-47715.rs [new file with mode: 0644]
src/test/ui/issue-47715.stderr [new file with mode: 0644]
src/test/ui/issue-48131.rs [new file with mode: 0644]
src/test/ui/issue-48131.stderr [new file with mode: 0644]
src/test/ui/issue-48838.rs [new file with mode: 0644]
src/test/ui/issue-48838.stderr [new file with mode: 0644]
src/test/ui/issue-4968.rs [new file with mode: 0644]
src/test/ui/issue-4968.stderr [new file with mode: 0644]
src/test/ui/issue-4972.rs [new file with mode: 0644]
src/test/ui/issue-4972.stderr [new file with mode: 0644]
src/test/ui/issue-50471.rs [new file with mode: 0644]
src/test/ui/issue-50600.rs [new file with mode: 0644]
src/test/ui/issue-50600.stderr [new file with mode: 0644]
src/test/ui/issue-5062.rs [new file with mode: 0644]
src/test/ui/issue-5062.stderr [new file with mode: 0644]
src/test/ui/issue-5067.rs [new file with mode: 0644]
src/test/ui/issue-5067.stderr [new file with mode: 0644]
src/test/ui/issue-50688.rs [new file with mode: 0644]
src/test/ui/issue-50688.stderr [new file with mode: 0644]
src/test/ui/issue-5099.rs [new file with mode: 0644]
src/test/ui/issue-5099.stderr [new file with mode: 0644]
src/test/ui/issue-5100.rs [new file with mode: 0644]
src/test/ui/issue-5100.stderr [new file with mode: 0644]
src/test/ui/issue-5153.rs [new file with mode: 0644]
src/test/ui/issue-5153.stderr [new file with mode: 0644]
src/test/ui/issue-5216.rs [new file with mode: 0644]
src/test/ui/issue-5216.stderr [new file with mode: 0644]
src/test/ui/issue-52213.nll.stderr [new file with mode: 0644]
src/test/ui/issue-52213.rs [new file with mode: 0644]
src/test/ui/issue-52213.stderr [new file with mode: 0644]
src/test/ui/issue-5358-1.rs [new file with mode: 0644]
src/test/ui/issue-5358-1.stderr [new file with mode: 0644]
src/test/ui/issue-5439.rs [new file with mode: 0644]
src/test/ui/issue-5439.stderr [new file with mode: 0644]
src/test/ui/issue-5883.rs [new file with mode: 0644]
src/test/ui/issue-5883.stderr [new file with mode: 0644]
src/test/ui/issue-5927.rs [new file with mode: 0644]
src/test/ui/issue-5927.stderr [new file with mode: 0644]
src/test/ui/issue-5997-enum.rs [new file with mode: 0644]
src/test/ui/issue-5997-enum.stderr [new file with mode: 0644]
src/test/ui/issue-5997-struct.rs [new file with mode: 0644]
src/test/ui/issue-5997-struct.stderr [new file with mode: 0644]
src/test/ui/issue-6458-2.rs [new file with mode: 0644]
src/test/ui/issue-6458-2.stderr [new file with mode: 0644]
src/test/ui/issue-6596-1.rs [new file with mode: 0644]
src/test/ui/issue-6596-1.stderr [new file with mode: 0644]
src/test/ui/issue-6596-2.rs [new file with mode: 0644]
src/test/ui/issue-6596-2.stderr [new file with mode: 0644]
src/test/ui/issue-6642.rs [new file with mode: 0644]
src/test/ui/issue-6642.stderr [new file with mode: 0644]
src/test/ui/issue-6738.rs [new file with mode: 0644]
src/test/ui/issue-6738.stderr [new file with mode: 0644]
src/test/ui/issue-6801.nll.stderr [new file with mode: 0644]
src/test/ui/issue-6801.rs [new file with mode: 0644]
src/test/ui/issue-6801.stderr [new file with mode: 0644]
src/test/ui/issue-6804.rs [new file with mode: 0644]
src/test/ui/issue-6804.stderr [new file with mode: 0644]
src/test/ui/issue-6936.rs [new file with mode: 0644]
src/test/ui/issue-6936.stderr [new file with mode: 0644]
src/test/ui/issue-7013.rs [new file with mode: 0644]
src/test/ui/issue-7013.stderr [new file with mode: 0644]
src/test/ui/issue-7044.rs [new file with mode: 0644]
src/test/ui/issue-7044.stderr [new file with mode: 0644]
src/test/ui/issue-7061.rs [new file with mode: 0644]
src/test/ui/issue-7061.stderr [new file with mode: 0644]
src/test/ui/issue-7092.rs [new file with mode: 0644]
src/test/ui/issue-7092.stderr [new file with mode: 0644]
src/test/ui/issue-7246.rs [new file with mode: 0644]
src/test/ui/issue-7246.stderr [new file with mode: 0644]
src/test/ui/issue-7364.rs [new file with mode: 0644]
src/test/ui/issue-7364.stderr [new file with mode: 0644]
src/test/ui/issue-7607-1.rs [new file with mode: 0644]
src/test/ui/issue-7607-1.stderr [new file with mode: 0644]
src/test/ui/issue-7867.rs [new file with mode: 0644]
src/test/ui/issue-7867.stderr [new file with mode: 0644]
src/test/ui/issue-7950.rs [new file with mode: 0644]
src/test/ui/issue-7950.stderr [new file with mode: 0644]
src/test/ui/issue-7970a.rs [new file with mode: 0644]
src/test/ui/issue-7970a.stderr [new file with mode: 0644]
src/test/ui/issue-7970b.rs [new file with mode: 0644]
src/test/ui/issue-7970b.stderr [new file with mode: 0644]
src/test/ui/issue-8153.rs [new file with mode: 0644]
src/test/ui/issue-8153.stderr [new file with mode: 0644]
src/test/ui/issue-8208.rs [new file with mode: 0644]
src/test/ui/issue-8208.stderr [new file with mode: 0644]
src/test/ui/issue-8460-const.rs [new file with mode: 0644]
src/test/ui/issue-8460-const.stderr [new file with mode: 0644]
src/test/ui/issue-8640.rs [new file with mode: 0644]
src/test/ui/issue-8640.stderr [new file with mode: 0644]
src/test/ui/issue-8727.rs [new file with mode: 0644]
src/test/ui/issue-8727.stderr [new file with mode: 0644]
src/test/ui/issue-8761.rs [new file with mode: 0644]
src/test/ui/issue-8761.stderr [new file with mode: 0644]
src/test/ui/issue-8767.rs [new file with mode: 0644]
src/test/ui/issue-8767.stderr [new file with mode: 0644]
src/test/ui/issue-9575.rs [new file with mode: 0644]
src/test/ui/issue-9575.stderr [new file with mode: 0644]
src/test/ui/issue-9725.rs [new file with mode: 0644]
src/test/ui/issue-9725.stderr [new file with mode: 0644]
src/test/ui/issue-9814.rs [new file with mode: 0644]
src/test/ui/issue-9814.stderr [new file with mode: 0644]
src/test/ui/issue-pr29383.rs [new file with mode: 0644]
src/test/ui/issue-pr29383.stderr [new file with mode: 0644]

diff --git a/src/test/compile-fail/issue-10176.rs b/src/test/compile-fail/issue-10176.rs
deleted file mode 100644 (file)
index c968844..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8c58ef6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d4e7dc7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn test<'x>(x: &'x isize) {
-    drop::<Box<for<'z> 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 (file)
index 08e8eff..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e36193a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ee55373..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u8>; //~ ERROR lifetimes cannot use keyword names
-    fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names
-}
-
-impl<'self> Serializable<str> 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<u8> { //~ 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 (file)
index ed91e93..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3b0ea55..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 708eea3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0b335a5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 57915bc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index cd4ec49..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 39f25b8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2d00f33..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1ff6812..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7d8a152..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1e444a6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3045c06..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>(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 (file)
index 7afb831..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(box_syntax)]
-
-struct Test {
-    func: Box<FnMut()+'static>
-}
-
-fn main() {
-    let closure: Box<Fn()+'static> = 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 (file)
index 71f1d5d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f577aad..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index acac2d1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0bda06b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Box<Attr>>,
-}
-
-impl Element {
-    pub unsafe fn get_attr<'a>(&'a self, name: &str) {
-        self.attrs
-            .iter()
-            .find(|attr| {
-                      let attr: &&Box<Attr> = 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 (file)
index 6989910..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a6dbe95..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 4618851..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 980385c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<H> {
-    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<H: StreamHasher>: Hash<H> {
-    fn input_stream(&self, stream: &mut H::S);
-}
-
-impl<H: StreamHasher> Hash<H> 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<H: StreamHasher> StreamHash<H> 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 (file)
index f0f4bf5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a8d2c55..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<IntList>),
-    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 (file)
index 5565a9a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<A,F:FnOnce<A>>(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 (file)
index 1b9af39..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9378581..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<B> = 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 (file)
index e4788ba..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 30cdd07..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0c3c82a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d343241..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2d8d785..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8d3df68..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f1fd617..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e9d76c7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<FnMut()>) {}
-
-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 (file)
index e33859e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0059e92..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index afb2e86..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6ad3ec6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index abddf6b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>` has one type parameter, while
-    // the actual arm `Result<T, E>` 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 (file)
index fe7fbb1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 32a63b7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3171683..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String> = 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 (file)
index d544a92..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String> = 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 (file)
index d51db47..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3b690e0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2e81554..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0314f10..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1635a8f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<ResponseHook>) { 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 (file)
index 78b079a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<D: Deserializer<'a>>(_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 (file)
index 86a6bdf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Node {
-    fn zomg();
-}
-
-trait Graph<N: Node> {
-    fn nodes<'a, I: Iterator<Item=&'a N>>(&'a self) -> I
-        where N: 'a;
-}
-
-impl<N: Node> Graph<N> for Vec<N> {
-    fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I
-        where N: 'a
-    {
-        self.iter() //~ ERROR mismatched types
-    }
-}
-
-struct Stuff;
-
-impl Node for Stuff {
-    fn zomg() {
-        println!("zomg");
-    }
-}
-
-fn iterate<N: Node, G: Graph<N>>(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 (file)
index d3823a8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9c594ef..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d11fe99..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 250e78c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dceecee..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f76fa3e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0b154d0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ddfed36..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 84c600d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 58e8e10..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 48bf71f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index aaaad67..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 74f0833..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e4da3e4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Debug>(_: Option<Self>, thing: &[T]);
-}
-
-struct X { data: u32 }
-
-impl Something for X {
-    fn yay<T: Str>(_:Option<X>, thing: &[T]) {
-    //~^ ERROR E0276
-    }
-}
-
-fn main() {
-    let arr = &["one", "two", "three"];
-    println!("{:?}", Something::yay(None::<X>, arr));
-}
diff --git a/src/test/compile-fail/issue-14915.rs b/src/test/compile-fail/issue-14915.rs
deleted file mode 100644 (file)
index 810d665..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<isize> = box 0;
-
-    println!("{}", x + 1);
-    //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
-}
diff --git a/src/test/compile-fail/issue-15034.rs b/src/test/compile-fail/issue-15034.rs
deleted file mode 100644 (file)
index a62e468..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1dd6763..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {
-    x: T
-}
-
-impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
-    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<T>(x: T) -> Debuger<T> {
-    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 (file)
index 7a7ba46..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d224b8a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 70da8cf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1cdd803..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
-    let values: Vec<u8> = 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 (file)
index c123e85..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 37a2f15..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 35ef9ba..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index df7e7c1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 76ba5a0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index cda83fe..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 68ac19b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 60117bd..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f9d0100..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 438073e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Slice<T> {
-    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 (file)
index 3060bbe..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Slice<T> {
-    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 (file)
index cc65211..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a400263..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait MatrixShape {}
-
-struct Col<D, C> {
-    data: D,
-    col: C,
-}
-
-trait Collection { fn len(&self) -> usize; }
-
-impl<T, M: MatrixShape> Collection for Col<M, usize> {
-//~^ 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 (file)
index fcbf8a3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1768c83..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::any::Any;
-
-fn foo<T: Any>(value: &T) -> Box<Any> {
-    Box::new(value) as Box<Any>
-    //~^ 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 (file)
index e16c58b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: Fn()> (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 (file)
index ecf81c8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f8a6826..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ae4e8ce..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Fn((&'a i32, &'a (Vec<&'static i32>, 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 (file)
index 413e8b4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f250103..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<A>]),
-}
-
-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 (file)
index 1cd43cb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1c3e689..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1208321..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f6e6a8a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index eb293c7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5a6bd5e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 260cc36..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Foo { foo: Option<Option<Foo>> }
-//~^ 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 (file)
index f39fb0e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Baz { q: Option<Foo> }
-//~^ ERROR recursive type `Baz` has infinite size
-
-struct Foo { q: Option<Baz> }
-//~^ 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 (file)
index 9ba0855..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Option<Foo>> }
-//~^ 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 (file)
index 665c3cf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::marker;
-
-struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> }
-//~^ ERROR recursive type `Foo` has infinite size
-
-impl<T> Foo<T> { 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 (file)
index 85ed4d5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::marker;
-
-struct Foo { foo: Bar<Foo> }
-
-struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> }
-//~^ 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 (file)
index 4c1e82c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Option<Foo>>) }
-//~^ 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 (file)
index 71b85da..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum Foo { Voo(Option<Option<Foo>>) }
-//~^ 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 (file)
index dafcff2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f5b7a0c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9264305..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(fn_traits)]
-
-fn id<T>(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 (file)
index fe125b9..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<MyEnum, String> {
-        //~^ ERROR expected type, found variant `NoResult`
-        unimplemented!()
-    }
-}
-
-mod bar {
-    use foo::MyEnum::Result;
-    use foo;
-
-    fn new() -> Result<foo::MyEnum, String> {
-        //~^ ERROR expected type, found variant `Result`
-        unimplemented!()
-    }
-}
-
-fn new() -> Result<foo::MyEnum, String> {
-    //~^ ERROR expected type, found variant `Result`
-    unimplemented!()
-}
-
-fn newer() -> NoResult<foo::MyEnum, String> {
-    //~^ 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 (file)
index b55863f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::marker;
-
-struct B<T>(marker::PhantomData<T>);
-
-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 (file)
index cbd0da4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 17ec77d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 07123c6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::cell::UnsafeCell;
-
-const A: UnsafeCell<usize> = UnsafeCell::new(1);
-const B: &'static UnsafeCell<usize> = &A;
-//~^ ERROR: cannot borrow a constant which may contain interior mutability
-
-struct C { a: UnsafeCell<usize> }
-const D: C = C { a: UnsafeCell::new(1) };
-const E: &'static UnsafeCell<usize> = &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 (file)
index 4857c2f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9b7ed46..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn id<T>(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 (file)
index b9f5e98..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 586cfeb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a5a7117..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c5349d4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8516a8e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Item>,
-    direction_to_room: HashMap<RoomDirection, Room>,
-}
-
-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<Item>,
-}
-
-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 (file)
index 1d5ef43..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a47f5c1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f7cae91..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum MyOption<T> {
-    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 (file)
index a15ccb7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> 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 (file)
index f11d482..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#[derive(Debug)]
-struct Pair<T, V> (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 (file)
index 80e5f2b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 049a066..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 4211057..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 37c8173..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: ?Sized> {
-    _ptr: *const T
-}
-
-impl<T> Drop for G<T> {
-//~^ 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<Bar>;
-}
diff --git a/src/test/compile-fail/issue-17994.rs b/src/test/compile-fail/issue-17994.rs
deleted file mode 100644 (file)
index 25141b9..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Tr {}
-type Huh<T> 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 (file)
index 88945f8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 4c815e6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 260038b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6efe532..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7194c15..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 412f756..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8991ede..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index efc1ba1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index aad3d52..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<P, R> {
-    fn call(&self, p: P, r: R);
-}
-pub trait Public: Private<
-//~^ ERROR private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
-    <Self as Public>::P,
-    <Self as Public>::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 (file)
index dd17189..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Set<T> {
-    fn contains(&self, _: T) -> bool;
-    fn set(&mut self, _: T);
-}
-
-impl<'a, T, S> Set<&'a [T]> for S where
-    T: Copy,
-    S: Set<T>,
-{
-    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 (file)
index 5945a7a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 60afea5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2be5fdc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 41e82d0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a3ad76e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn add_state(op: <isize as HasState>::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 (file)
index e4d132c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9a7b378..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<FnMut() + 'f>);
-}
-
-impl<'c> Push<'c> for RefCell<Vec<Box<FnMut() + 'c>>> {
-    fn push<'f: 'c>(&self, fun: Box<FnMut() + 'f>) {
-        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 (file)
index cc87a09..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<FuncType>) {
-    //~^ 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 (file)
index f7f84e6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Box<fmt::Debug>>,
-}
-
-trait A<'a> {
-    fn foo<F>(&mut self, f: F)
-        where F: fmt::Debug + 'a,
-              Self: Sized;
-}
-
-impl<'a> A<'a> for B {
-    fn foo<F>(&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 (file)
index 7a6d012..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
-pub trait Bar: Foo { }
-impl<T: Foo> Bar for T { }
-
-pub struct Thing;
-impl Foo for Thing {
-    fn foo<T>(&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 (file)
index ccdd9db..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>() { }
diff --git a/src/test/compile-fail/issue-19086.rs b/src/test/compile-fail/issue-19086.rs
deleted file mode 100644 (file)
index ba571ce..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index df34aab..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 864f8f6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 322952f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b54f008..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 93d95ca..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a619050..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Foo {
-    fn foo<T>(&self, val: T);
-}
-
-trait Bar: Foo { }
-
-pub struct Thing;
-
-impl Foo for Thing {
-    fn foo<T>(&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 (file)
index 02b4932..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(rustc_attrs)]
-#![allow(warnings)]
-
-trait A<T> {}
-struct B<T> where B<T>: A<B<T>> { 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 (file)
index c4b871a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ca17154..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a3820d2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9b6a877..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait From<Src> {
-    type Output;
-
-    fn from(src: Src) -> <Self as From<Src>>::Output;
-}
-
-trait To: Sized {
-    fn to<Dst: From<Self>>(self) ->
-        <Dst as From<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 (file)
index 9dbca99..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e07dfaf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8db0918..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait From<Src> {
-    type Result;
-
-    fn from(src: Src) -> Self::Result;
-}
-
-trait To {
-    fn to<Dst>(  //~ ERROR the size for values of type
-        self
-    ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
-        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 (file)
index b2f3a2d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<X> = 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 (file)
index da98f21..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index bb4dbdc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dfb23c0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a48c03a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Foo {
-  fn answer(self);
-}
-
-struct NoData<T>;
-//~^ ERROR: parameter `T` is never used
-
-impl<T> Foo for T where NoData<T>: Foo {
-//~^ ERROR: overflow evaluating the requirement
-  fn answer(self) {
-    let val: NoData<T> = 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 (file)
index f760cd5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 60d012a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn changer<'a>(mut things: Box<Iterator<Item=&'a mut u8>>) {
-    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 (file)
index 3e29383..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 1ec7a74..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 885fd24..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0dbe92f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 794e517..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index fe91751..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 184ad02..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 5cdec33..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 7995add..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
-
-
-//type Type_4<T> = 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<T,,> = Box<T>; //~ 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 (file)
index cb322f0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d67c76a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait T : Iterator<Item=Self::Item>
-//~^ 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 (file)
index d3b97a9..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index cbb987c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Input = Self::Input> {
-    //~^ 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 (file)
index 3f00f56..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 `<Self as Publisher>::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<Subscriber<Input=Self::Output> + '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<Subscriber<Input=u64> + 'a>
-}
-
-impl<'a> Publisher<'a> for MyStruct<'a> {
-    type Output = u64;
-    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::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 (file)
index 5282ce4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8180ce5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn foo(a: Option<usize>, b: Option<usize>) {
-  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 (file)
index 0de0ab2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Bar;
-
-impl Bar {
-    fn hash<T>(&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 (file)
index 9d9b7e4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9da5787..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Trait<A = T::B>>() { }
-//~^ 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 (file)
index db33348..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<i32, i32> { 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 (file)
index f66c092..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index cc44cf8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 256c5d8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait vec_monad<A> {
-    fn bind<B, F>(&self, f: F) where F: FnMut(A) -> Vec<B>;
-}
-
-impl<A> vec_monad<A> for Vec<A> {
-    fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
-        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 (file)
index 8b109b0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<isize> ) -> 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 (file)
index 3cf971f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1b87862..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f24de2f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn foo<U>(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 (file)
index b4f952c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Send>() {}
-
-fn main() {
-    foo::<HashMap<Rc<()>, 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 (file)
index 86506de..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Bound {}
-pub struct Foo<T: Bound>(T);
-
-pub trait Trait1 {}
-impl<T: Bound> Trait1 for Foo<T> {}
-
-pub trait Trait2 {}
-impl<T> Trait2 for Foo<T> {} //~ 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 (file)
index 0d652be..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 `<FooStruct as Foo>::A`
-    type A = <FooStruct as Foo>::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 (file)
index 6ddfa4c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5271ea7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ffa881b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait A {
-    type Output;
-    fn a(&self) -> <Self as A>::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 (file)
index c23fc4f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2128c42..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<usize> {
-    fn rows(&self) -> usize;
-    fn columns(&self) -> usize;
-    fn get<'a>(&'a self, y: usize, x: usize) -> Option<&'a <Self as Index<usize>>::Output> {
-        if y >= self.rows() || x >= self.columns() {
-            return None;
-        }
-        let i = y * self.columns() + x;
-        let indexer = &(*self as &Index<usize, Output = <Self as Index<usize>>::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 (file)
index ae7fb01..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Trait {
-    fn foo();
-}
-
-fn main() {
-    <<i32 as Copy>::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 (file)
index 6effd02..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 50e5dd2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b9ea358..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d08f916..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<A> 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 (file)
index 2396007..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Expr : PartialEq<Self::Item> {
-    //~^ 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 (file)
index a791758..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3d9ec0a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn is_copy<T: ::std::marker<i32>::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 (file)
index cba1c36..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e3fd9c4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e0a87b3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index afb972f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 62adae4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5d9b49f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Box<Any>> = 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 (file)
index 670706b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub enum Expr<'var, VAR> {
-    Let(Box<Expr<'var, VAR>>,
-        Box<for<'v> 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 (file)
index 2d21917..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 = <<Self as Bar>::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 (file)
index fc365a4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Trait>(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 (file)
index 153b6fd..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Trait>(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 (file)
index 36d8450..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: Next> { t: T }
-
-impl<T: Next> Next for GetNext<T> {
-    //~^ ERROR overflow evaluating the requirement
-    type Next = <GetNext<T> 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 (file)
index faaf78f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: Next> { t: T }
-
-impl<T: Next> Next for GetNext<T> {
-    //~^ ERROR overflow evaluating the requirement
-    type Next = <GetNext<T::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 (file)
index 626604a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5de00eb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Fn() -> ()>) {}
-    //~^ 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 (file)
index f1a2826..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum chan { }
-
-trait channel<T> {
-    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 (file)
index 1c1d42d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a3422d8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Self::ChildKey, Output=Hierarchy>;
-    //~^ 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 (file)
index 6a3ce03..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(associated_type_defaults)]
-
-pub struct C<AType: A> {a:AType}
-
-pub trait A {
-    type B = C<Self::anything_here_kills_it>;
-    //~^ 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 (file)
index 544d3c8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a723278..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2a012da..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(dead_code)]
-
-trait MultiDispatch<T> {
-    type O;
-}
-
-trait Trait: Sized {
-    type A: MultiDispatch<Self::B, O = Self>;
-    type B;
-
-    fn new<U>(u: U) -> <Self::A as MultiDispatch<U>>::O where Self::A : MultiDispatch<U>;
-}
-
-fn test<T: Trait<B=i32>>(b: i32) -> T where T::A: MultiDispatch<i32> { 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 (file)
index 4aca6bf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index bb726ac..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 4b07731..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 016ce93..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 619ad74..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 72df6fb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a9c7978..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0e872f7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
-           <N=()> //~ ERROR associated type bindings are not allowed here
-           ::option::Option<()>
-    { None }
-    fn z(&self) ->
-        u32<N=()> //~ 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 (file)
index 52f5f1c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u32>) {
-}
diff --git a/src/test/compile-fail/issue-24883.rs b/src/test/compile-fail/issue-24883.rs
deleted file mode 100644 (file)
index 097f2a5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1c255b4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct S;
-
-trait InOut<T> { type Out; }
-
-fn do_fold<B, F: InOut<B, Out=B>>(init: B, f: F) {}
-
-fn bot<T>() -> 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 (file)
index e70c005..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {foo: PhantomData<T>}
-
-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 (file)
index b2775db..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<CObj>,
-    }
-    pub struct CObj {
-        name: Option<String>,
-    }
-    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 (file)
index 7cfcbc5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6e33fd5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: F) -> i32 where F: Fn(Helper<F>, 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 (file)
index 71c1d63..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 477c323..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct S<T: 'static>(Option<&'static T>);
-
-trait Tr { type Out; }
-impl<T> Tr for T { type Out = T; }
-
-impl<T: 'static> Copy for S<T> where S<T>: Tr<Out=T> {}
-impl<T: 'static> Clone for S<T> where S<T>: Tr<Out=T> {
-    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 (file)
index d7e438d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-struct parser {
-    tokens: Vec<isize> ,
-}
-
-trait parse {
-    fn parse(&self) -> Vec<isize> ;
-}
-
-impl parse for parser {
-    fn parse(&self) -> Vec<isize> {
-        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 (file)
index 72fb2a6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 99add95..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 54f5313..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 06a8fe5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn foo<T>() 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 (file)
index 22772e5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8d79fd4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>(T);
-
-trait Tr { type Assoc; fn test(); }
-
-impl<T: Tr> S<T::Assoc> {
-//~^ ERROR the type parameter `T` is not constrained
-    fn foo(self, _: T) {
-        T::test();
-    }
-}
-
-trait Trait1<T> { type Bar; }
-trait Trait2<'x> { type Foo; }
-
-impl<'a,T: Trait2<'a>> Trait1<<T as Trait2<'a>>::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 (file)
index 8be3d88..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index aab674f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: ?Sized> Mirror for T { type It = Self; }
-struct S(Option<<S as Mirror>::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 (file)
index c128fb3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> Mirror for T {
-    type It = Self;
-}
-
-
-#[rustc_error]
-fn main() { //~ ERROR compilation successful
-    let c: <u32 as Mirror>::It = 5;
-    const CCCC: <u32 as Mirror>::It = 5;
-}
diff --git a/src/test/compile-fail/issue-26812.rs b/src/test/compile-fail/issue-26812.rs
deleted file mode 100644 (file)
index 1dd0088..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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=T::Item>(_: 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 (file)
index 3b8fac8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: ?Sized>(PhantomData<T>);
-
-struct MyRc<T: ?Sized> {
-    _ptr: *const T,
-    _boo: NotPhantomData<T>,
-}
-
-impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<MyRc<U>> for MyRc<T>{ } //~ERROR
-
-fn main() {
-    let data = [1, 2, 3];
-    let iter = data.iter();
-    let x = MyRc { _ptr: &iter, _boo: NotPhantomData(PhantomData) };
-    let _y: MyRc<Iterator<Item=&u32>> = x;
-}
-
diff --git a/src/test/compile-fail/issue-26930.rs b/src/test/compile-fail/issue-26930.rs
deleted file mode 100644 (file)
index 6c98f3e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c63cb5d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f801358..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b8552aa..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 23afa4b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 619616a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#[repr(packed)]
-pub struct Bad<T: ?Sized> {
-    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 (file)
index 294c288..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
-        &<Self>::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 (file)
index 6de28cb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub struct send_packet<T> {
-    p: T
-}
-
-mod pingpong {
-    use send_packet;
-    pub type ping = send_packet<pong>;
-    pub struct pong(send_packet<ping>);
-    //~^ 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 (file)
index ce3fa48..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 782b205..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 731d4fb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d9840ab..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6063755..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5dded2b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8e58d1a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0d372d3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7d25419..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 631bcb7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index af73db2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d28c314..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9253a49..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 837de8e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 203b28b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index bd71867..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Foo<RHS=Self> {
-    type Assoc;
-}
-
-pub trait Bar: Foo<Assoc=()> {
-    fn new(&self, b: &
-           Bar //~ ERROR the trait `Bar` cannot be made into an object
-              <Assoc=()>
-    );
-}
-
-fn main() {}
diff --git a/src/test/compile-fail/issue-28586.rs b/src/test/compile-fail/issue-28586.rs
deleted file mode 100644 (file)
index b8571d2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dc9155e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Bar {
-    type Bar;
-}
-
-struct ArrayPeano<T: Bar> {
-    data: T::Bar,
-}
-
-fn foo<T>(a: &ArrayPeano<T>) -> &[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 (file)
index 5367845..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 `<S>::C2`
-}
diff --git a/src/test/compile-fail/issue-29084.rs b/src/test/compile-fail/issue-29084.rs
deleted file mode 100644 (file)
index 6cb6bbf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0ecaa40..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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,T);
-pub struct S1<T>(Option<Box<S0<S0<T>>>>,Option<Box<S0<S0<T>>>>);
-pub struct S2<T>(Option<Box<S1<S1<T>>>>,Option<Box<S1<S1<T>>>>);
-pub struct S3<T>(Option<Box<S2<S2<T>>>>,Option<Box<S2<S2<T>>>>);
-pub struct S4<T>(Option<Box<S3<S3<T>>>>,Option<Box<S3<S3<T>>>>);
-pub struct S5<T>(Option<Box<S4<S4<T>>>>,Option<Box<S4<S4<T>>>>,Option<T>);
-
-trait Foo { fn xxx(&self); }
-trait Bar {} // anything local or #[fundamental]
-
-impl<T> Foo for T where T: Bar, T: Sync {
-    fn xxx(&self) {}
-}
-
-impl Foo for S5<u32> { fn xxx(&self) {} }
-impl Foo for S5<u64> { fn xxx(&self) {} }
-
-fn main() {
-    let _ = <S5<_>>::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 (file)
index 97ba222..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 98fe12c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0d684ec..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 11ff7ab..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn foo<T, U>(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 (file)
index 661579f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<P> {}
-
-impl <P, T: Foo<P>> Foo<P> for Option<T> {}
-
-pub struct Qux<T> (PhantomData<*mut T>);
-
-impl<T> Foo<*mut T> for Option<Qux<T>> {}
-
-pub trait Bar {
-    type Output: 'static;
-}
-
-impl<T: 'static, W: Bar<Output = T>> 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 (file)
index 79514ad..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 = <T as MakeRef<'a>>::Ref;
-}
-
-fn foo() -> <String as MakeRef2>::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 (file)
index d735e18..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 04ae8f6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 66bfab0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::marker;
-
-enum E1 { V1(E2<E1>), }
-enum E2<T> { V2(E2<E1>, marker::PhantomData<T>), }
-//~^ 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 (file)
index 2b0a24c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 55975cc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn siphash<T>() {
-
-    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 (file)
index c23e12e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f93a333..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7acbbfb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<U,V> : Sized {
-    fn foo(self, u: Option<U>, v: Option<V>) {}
-}
-
-struct A;
-struct B;
-
-impl Foo<A, B> for () {}      // impl A
-impl Foo<u32, u32> 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 (file)
index 45a5cd0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index cf6935b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 60fb307..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ee19d04..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1eec62d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 441815d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<usize> 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 (file)
index 981b196..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<usize> 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 (file)
index 2b4d0dc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 <Test<'z> 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 (file)
index 0b1afd7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 61721fe..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index fb16dad..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 62c2639..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2d1ad9a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index db60d70..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 956d218..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 4276653..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 716b0bb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>(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 (file)
index 74121e3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index fb1e3cc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u8>) {
-    let mut found_e = false;
-
-    let temp: Vec<u8> = 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 (file)
index 8dc58ee..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 794b8bb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dd1af2f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 519e9d0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f8645c4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2bd45de..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index cea52b1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 514255e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7524049..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-enum Enum<T: Trait> {
-    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 (file)
index d9ce115..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7e1f4c2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dd236b7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e630a01..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9a769c3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn foo<T>() {
-    struct foo {
-        x: T, //~ ERROR can't use type parameters from outer function
-    }
-
-    impl<T> Drop for foo<T> {
-        //~^ 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 (file)
index bf9f8ec..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b3b34f4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e5cb813..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>>() -> <T as 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 (file)
index 5091ba4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<U: Foo> {
-    stream: PhantomData<U::Error>,
-}
-
-fn foo<U: Foo>(x: [usize; 2]) -> Bar<U> {
-    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 (file)
index 25ecd5d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0953881..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<i32, ()> {
-    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 (file)
index 696ea0e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2c54ed3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9ac7088..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 41383e9..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 317a471..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 24db822..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
-
-fn main() {
-    size_of_copy::<Misc+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 (file)
index 18424fc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(unused)]
-
-fn main() {
-    { fn f<X: ::std::marker()::Send>() {} }
-    //~^ 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 (file)
index ffbd0c0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Send + ::std::marker()::Sync> = Box::new(1);
-    //~^ ERROR parenthesized parameters may only be used with a trait
-    //~| WARN previously accepted
-}
-
-fn foo<X:Default>() {
-    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 (file)
index 6a411b4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>() -> 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 (file)
index bed577b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 73532cb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b7dbaf2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1e19943..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5dfc41c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 499e7e5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 117ab18..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 30dd34a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6c85414..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a752a36..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5917531..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: 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 (file)
index 4d7238a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(warnings)]
-
-trait Trait<T> {
-    fn foo(_: T) {}
-}
-
-pub struct Foo<T = Box<Trait<DefaultFoo>>>;  //~ 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 (file)
index 6bc0add..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0bad737..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index be7e782..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9943cfb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Bar<T> {
-    inner: Foo<T> //~ ERROR cannot find type `Foo` in this scope
-}
-
-enum Baz<T> {
-    Foo(Foo<T>) //~ 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 (file)
index 1742cb4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 78af11a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5f54f26..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 092bf00..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {}
-trait Trait2<'a> {
-  type Ty;
-}
-
-fn _ice(param: Box<for <'a> 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 (file)
index 17fd77b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Item=&'a T> {
-    a.iter().map(|a| a*a)
-    //~^ ERROR binary operation `*` cannot be applied to type `&T`
-}
-
-fn main() {
-    let a = (0..30).collect::<Vec<_>>();
-
-    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 (file)
index 5909322..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum E {
-    V([Box<E>]),
-    //~^ 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 (file)
index cc69a76..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String>
-}
-
-struct ElementData {
-    kind: Box<ElementKind>
-}
-
-enum ElementKind {
-    HTMLImageElement(HTMLImageData)
-}
-
-enum NodeKind {
-    Element(ElementData)
-}
-
-struct NodeData {
-    kind: Box<NodeKind>,
-}
-
-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 (file)
index ed6a2f8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3afbfa6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {
-    _a: T,
-}
-
-struct S<T>(T);
-
-fn f() {
-    let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>); //~ WARN unnecessary path disambiguator
-    let g: Foo::<i32> = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator
-
-    m!(S::<u8>); // 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 (file)
index 88ac74c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b207658..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9f5eeb1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5e43536..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>(Self);
-//~^ ERROR expected identifier, found keyword `Self`
-
-trait Bar<Self> {}
-//~^ 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 (file)
index fe46877..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 00f6441..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct P { child: Option<Box<P>> }
-trait PTrait {
-   fn getChildOption(&self) -> Option<Box<P>>;
-}
-
-impl PTrait for P {
-   fn getChildOption(&self) -> Option<Box<P>> {
-       static childVal: Box<P> = 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 (file)
index e698e6d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 3e34b25..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> Broken for T {
-    type Assoc = ();
-    fn broken(&self) where Self::Assoc: Foo {
-        let _x: <Self::Assoc as Foo>::Bar;
-    }
-}
-
-#[rustc_error]
-fn main() { //~ ERROR compilation successful
-    let _m: &Broken<Assoc=()> = &();
-}
diff --git a/src/test/compile-fail/issue-3702-2.rs b/src/test/compile-fail/issue-3702-2.rs
deleted file mode 100644 (file)
index 325f058..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 95fd5d1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ab08e18..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Self::NextState>;
-}
-
-struct StateMachineEnded;
-
-impl State for StateMachineEnded {
-    fn execute(self) -> Option<Self::NextState> {
-        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 (file)
index ad56b12..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 98806cd..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2a4808f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 53c91f3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d5733f9..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 70c8f92..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Foo<T: ?Hash> { }
-//~^ 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 (file)
index af1f6ef..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e3c1ada..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 851f5df..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 81ed437..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f120bbb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 311d0ce..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 28de76f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1867baf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6b7dde1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a2b0d0a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait A<T>: std::ops::Add<Self> + Sized {}
-trait B<T>: A<T> {}
-trait C<T>: A<B<T, Output=usize>> {}
-//~^ 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 (file)
index b4feadb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 56eb5f8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c1939a7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Q<T:?Sized> {}
-trait Foo where u32: Q<Self> {
-    fn foo(&self);
-}
-
-impl Q<()> for u32 {}
-impl Foo for () {
-    fn foo(&self) {
-        println!("foo!");
-    }
-}
-
-fn main() {
-    let _f: Box<Foo> = //~ 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 (file)
index b38b1b9..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c7e1da7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub struct List<T> {
-    head: T,
-}
-
-impl Drop for List<i32> { //~ 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 (file)
index e6cee4a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn foo<T: Iterator>() {
-    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 (file)
index 7f01ed3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 96ba1c8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<M: Mat>() {
-    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 (file)
index 9d8abbf..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6da0493..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 56bfe27..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f01fd1f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2da21fb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T, D: Dim> {
-    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 (file)
index 13b4c08..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 404465e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(fn_traits)]
-
-fn main() {
-    <fn() as Fn()>::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 (file)
index 67a934f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d5ca009..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index fae5eb5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 65ea1ba..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6f6b775..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7daf4bc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Fn(&i32)>) {}
-    let bar = Box::new(|x: &i32| {}) as Box<Fn(_)>;
-    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 (file)
index e16a7ec..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn prove_static<T: 'static + ?Sized>(_: &'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<T, U: ?Sized> {
-    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 (file)
index b5418e8..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 39249ee..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 142092f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0fe5658..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index afa8f15..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a39c500..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index aec20b4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 261ed49..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c5604a0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 75d58c5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0509a43..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5d7546e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 29912de..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 89f11ed..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c8cd920..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String, Vec<String>> = 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 (file)
index 067531e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u32> for H {
-    type Output = S;
-    fn index(&self, index: u32) -> &S {
-        unimplemented!()
-    }
-}
-
-impl IndexMut<u32> 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 (file)
index 5f108e0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 23a2b78..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn iterate<T, F>(initial: T, f: F) -> Iterate<T, F> {
-    Iterate {
-        state: initial,
-        f: f,
-    }
-}
-
-pub struct Iterate<T, F> {
-    state: T,
-    f: F
-}
-
-impl<T: Clone, F> Iterator for Iterate<T, F> where F: Fn(&T) -> T {
-    type Item = T;
-
-    #[inline]
-    fn next(&mut self) -> Option<Self::Item> {
-        self.state = (self.f)(&self.state);
-        Some(self.state.clone())
-    }
-    #[inline]
-    fn size_hint(&self) -> (usize, Option<usize>) { (std::usize::MAX, None) }
-}
-
-fn main() {
-    let a = iterate(0, |x| x+1);
-    println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
-    //~^ 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 (file)
index 5c90777..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> 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 (file)
index 406aadc..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b1f668d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f770529..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 2f11ff4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 62db68d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7547c4a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b07c23c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Mirror<Smoke> {
-    type Image;
-}
-
-impl<T, Smoke> Mirror<Smoke> for T {
-    type Image = T;
-}
-
-pub fn poison<S>(victim: String) where <String as Mirror<S>>::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 (file)
index ebb1ec4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Value> = 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 (file)
index 6a5f7a1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8a04711..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b236283..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d589680..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e1d34f3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d793a78..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Trait1<X> {
-    type Output;
-}
-
-pub trait Trait2<X> {}
-
-pub struct A;
-
-impl<X, T> Trait1<X> for T where T: Trait2<X> {
-    type Output = ();
-}
-
-impl<X> Trait1<Box<X>> for A {
-//~^ ERROR conflicting implementations of trait
-//~| hard error
-//~| downstream crates may implement trait `Trait2<std::boxed::Box<_>>` 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 (file)
index 431fc8a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u8>); //~ 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 (file)
index 1e6366e..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(fn_traits)]
-
-trait CallSingle<A, B> {
-    fn call(&self, a: A) -> B where Self: Sized, Self: Fn(A) -> B;
-}
-
-impl<A, B, F: Fn(A) -> B> CallSingle<A, B> for F {
-    fn call(&self, a: A) -> B {
-        <Self as Fn(A) -> 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 (file)
index 33abc19..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 47fd426..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index a5ba9ef..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {
-    _data: std::cell::UnsafeCell<Option<T>>,
-    _flag: std::cell::Cell<bool>,
-}
-
-#[cfg(not(target_thread_local))]
-impl<T> Key<T> {
-    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<std::option::Option<()>>` cannot be shared between threads
-//~| ERROR `std::cell::Cell<bool>` 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 (file)
index 7b1364f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String>;
-
-#[cfg(target_thread_local)]
-#[thread_local]
-static __KEY: std::thread::__FastLocalKeyInner<Foo> =
-    std::thread::__FastLocalKeyInner::new();
-
-#[cfg(not(target_thread_local))]
-static __KEY: std::thread::__OsLocalKeyInner<Foo> =
-    std::thread::__OsLocalKeyInner::new();
-
-fn __getit() -> std::option::Option<
-    &'static std::cell::UnsafeCell<
-        std::option::Option<Foo>>>
-{
-    __KEY.get() //~ ERROR call to unsafe function is unsafe
-}
-
-static FOO: std::thread::LocalKey<Foo> =
-    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 (file)
index 94b5c00..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Partial<X: ?Sized>: Copy {
-}
-
-pub trait Complete {
-    type Assoc: Partial<Self>;
-}
-
-impl<T> Partial<T> for T::Assoc where
-    T: Complete
-{
-}
-
-impl<T> 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 (file)
index e70df11..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> Partial for T where T: Complete {}
-impl<T> 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 (file)
index 8ad5764..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 5d510b6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6361af7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b6ec21b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 131c652..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d744ad1..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ecaf326..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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::<Foo>() }],
-    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 (file)
index 5af0bf6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index fbd8972..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 61e19ff..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<isize>;
-    //[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<i32>) {  //[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 (file)
index b42ced0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7823a7d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Params;
-
-pub trait Plugin<E: ?Sized> {
-    type Error;
-}
-
-pub trait Pluggable {
-    fn get_ref<P: Plugin<Self>>(&mut self) -> Option<P::Error> {
-        None
-    }
-}
-
-struct Foo;
-impl Plugin<Foo> for Params {
-    type Error = ();
-}
-
-impl<T: Copy> Pluggable for T {}
-
-fn handle(req: &mut i32) {
-    req.get_ref::<Params>();
-    //~^ ERROR the trait bound `Params: Plugin<i32>` 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 (file)
index 0b82f2b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d51d925..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b5cdded..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 82f55f2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d84b581..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dc14eca..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: AsRef<[u8]>>(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 (file)
index f8bcd88..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d88b4e5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1b9ff36..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1980307..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 683ef87..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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::<Void>();
-    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 (file)
index b6b720f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Foo {}
-
-trait Bar<T> {}
-
-trait Iterable {
-    type Item;
-}
-
-struct Container<T: Iterable<Item = impl Foo>> {
-    //~^ ERROR `impl Trait` not allowed
-    field: T
-}
-
-enum Enum<T: Iterable<Item = impl Foo>> {
-    //~^ ERROR `impl Trait` not allowed
-    A(T),
-}
-
-union Union<T: Iterable<Item = impl Foo> + Copy> {
-    //~^ ERROR `impl Trait` not allowed
-    x: T,
-}
-
-type Type<T: Iterable<Item = impl Foo>> = 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 (file)
index 9eb567a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ab52a32..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 77588e5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f384dba..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<MyTrait+'static>),
-}
-
-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 (file)
index ce29471..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 6169a77..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ebfa497..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 267362f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index ff45cf6..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1bb6f34..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9ef780a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9b49886..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Foo {
-    fn foo(self: Box<Self>);
-}
-
-impl Foo for isize {
-    fn foo(self: Box<isize>) { }
-}
-
-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 (file)
index 8142457..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f() { }
-struct S(Box<FnMut()>);
-pub static C: S = S(f); //~ ERROR mismatched types
-
-
-fn g() { }
-type T = Box<FnMut()>;
-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 (file)
index 810379c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index d8aad54..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum Either<T, U> { Left(T), Right(U) }
-struct S(Either<usize, usize>);
-
-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 (file)
index 4e618f3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Foo> {
-        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 (file)
index a91f5d2..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index bb802f3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 463fdaa..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f<Z>() -> bool {
-    enum E { V(Z) }
-    //~^ ERROR can't use type parameters from outer function
-    true
-}
-
-fn main() {
-    let b = f::<isize>();
-    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 (file)
index af9e66b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f<T>() -> bool {
-    struct S(T); //~ ERROR can't use type parameters from outer function
-
-    true
-}
-
-fn main() {
-    let b = f::<isize>();
-    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 (file)
index 87cf2b3..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index e988f40..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0158ad4..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 1fe10ba..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 447d0e0..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Foo<T> {
-    x: T,
-}
-impl<T> Foo<T> {
-    fn add(&mut self, v: Foo<T>){
-        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 (file)
index 792d27c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>) -> usize {
-     *x * 2
-}
-
-fn invoke<F>(f: F) where F: FnOnce() -> usize {
-     f();
-}
-
-fn main() {
-      let x  : Box<usize>  = 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 (file)
index fffa27a..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 8eb16ed..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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> = 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 (file)
index 0c19780..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<RefCell<A>>);
-}
-
-struct B {
-    v: Option<Rc<RefCell<A>>>
-}
-
-impl Foo for B {
-    fn set(&mut self, v: Rc<RefCell<A>>)
-    {
-        self.v = Some(v);
-    }
-}
-
-struct A {
-    v: Box<Foo + Send>,
-}
-
-fn main() {
-    let a = A {v: box B{v: None} as Box<Foo+Send>};
-    //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>>` 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 (file)
index 9b72c24..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b99f5b7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<BarStruct> { self }
-    //~^ ERROR mismatched types
-    //~| expected type `std::boxed::Box<BarStruct>`
-    //~| 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 (file)
index 26e1597..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 7e8d431..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 801a130..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<RefCell<isize>> = box RefCell::new(0);
-//~^ ERROR allocations are not allowed in statics
-//~| ERROR `std::cell::RefCell<isize>` 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 (file)
index 9bcdd69..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 016df6c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index dd3a48c..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b97c303..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0cff90f..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 457918b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 670b6bd..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b0d6cb5..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index c4ca3ac..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 18b7948..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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::<std::option::Option<
-
-// Verify the compiler fails with an error on infinite function
-// recursions.
-
-fn generic<T>() {
-    generic::<Option<T>>();
-}
-
-
-fn main () {
-    // Use generic<T> at least once to trigger instantiation.
-    generic::<i32>();
-}
diff --git a/src/test/compile-fail/issue-8761.rs b/src/test/compile-fail/issue-8761.rs
deleted file mode 100644 (file)
index f8424ea..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 926cae7..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 9295eeb..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index f53122d..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 226734b..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index b60c537..0000000
+++ /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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c968844
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..02e0b89
--- /dev/null
@@ -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 (file)
index 0000000..8c58ef6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4eb0782
--- /dev/null
@@ -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 (file)
index 0000000..1358fe0
--- /dev/null
@@ -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::<Box<for<'z> 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 (file)
index 0000000..d4e7dc7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn test<'x>(x: &'x isize) {
+    drop::<Box<for<'z> 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 (file)
index 0000000..af59297
--- /dev/null
@@ -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::<Box<for<'z> 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 (file)
index 0000000..d13e843
--- /dev/null
@@ -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<i32>`, 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 (file)
index 0000000..08e8eff
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e3b816d
--- /dev/null
@@ -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<i32>`, 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 (file)
index 0000000..e36193a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8c91c11
--- /dev/null
@@ -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 (file)
index 0000000..ee55373
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u8>; //~ ERROR lifetimes cannot use keyword names
+    fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names
+}
+
+impl<'self> Serializable<str> 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<u8> { //~ 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 (file)
index 0000000..7f2f2db
--- /dev/null
@@ -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<u8>; //~ 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<str> 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<str> 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<u8> { //~ 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<str> 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 (file)
index 0000000..ed91e93
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..add4b83
--- /dev/null
@@ -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 (file)
index 0000000..2b71fb5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ba404d0
--- /dev/null
@@ -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 (file)
index 0000000..708eea3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..28f95df
--- /dev/null
@@ -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 (file)
index 0000000..7fd5a0d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d67463f
--- /dev/null
@@ -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 (file)
index 0000000..57915bc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..db64944
--- /dev/null
@@ -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 (file)
index 0000000..cd4ec49
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6aacbef
--- /dev/null
@@ -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 (file)
index 0000000..39f25b8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6db0bf6
--- /dev/null
@@ -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 (file)
index 0000000..2d00f33
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3ae3bbe
--- /dev/null
@@ -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 (file)
index 0000000..1ff6812
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8eec8b3
--- /dev/null
@@ -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 (file)
index 0000000..d5a6708
--- /dev/null
@@ -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 (file)
index 0000000..7d8a152
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e9853ac
--- /dev/null
@@ -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 (file)
index 0000000..1e444a6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3465069
--- /dev/null
@@ -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 (file)
index 0000000..99b9963
--- /dev/null
@@ -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 (file)
index 0000000..99b9963
--- /dev/null
@@ -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 (file)
index 0000000..80ecc24
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>(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 (file)
index 0000000..7afb831
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(box_syntax)]
+
+struct Test {
+    func: Box<FnMut()+'static>
+}
+
+fn main() {
+    let closure: Box<Fn()+'static> = 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 (file)
index 0000000..25e2a45
--- /dev/null
@@ -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 (file)
index 0000000..71f1d5d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ef3d24c
--- /dev/null
@@ -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 (file)
index 0000000..f577aad
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..daf53af
--- /dev/null
@@ -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 (file)
index 0000000..acac2d1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..51d6041
--- /dev/null
@@ -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 (file)
index 0000000..0bda06b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Box<Attr>>,
+}
+
+impl Element {
+    pub unsafe fn get_attr<'a>(&'a self, name: &str) {
+        self.attrs
+            .iter()
+            .find(|attr| {
+                      let attr: &&Box<Attr> = 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 (file)
index 0000000..a1913e0
--- /dev/null
@@ -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 (file)
index 0000000..6989910
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a31c4fa
--- /dev/null
@@ -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 (file)
index 0000000..a6dbe95
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d773e88
--- /dev/null
@@ -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<std::boxed::Box<{integer}>>`
+              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 (file)
index 0000000..c12cbbf
--- /dev/null
@@ -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 (file)
index 0000000..4618851
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f4da011
--- /dev/null
@@ -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 (file)
index 0000000..980385c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<H> {
+    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<H: StreamHasher>: Hash<H> {
+    fn input_stream(&self, stream: &mut H::S);
+}
+
+impl<H: StreamHasher> Hash<H> 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<H: StreamHasher> StreamHash<H> 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 (file)
index 0000000..f756e0a
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0284]: type annotations required: cannot resolve `<_ as StreamHasher>::S == <H as StreamHasher>::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 (file)
index 0000000..b880317
--- /dev/null
@@ -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<i32>`, 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 (file)
index 0000000..f0f4bf5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6172d78
--- /dev/null
@@ -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<i32>`, 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 (file)
index 0000000..a8d2c55
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<IntList>),
+    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 (file)
index 0000000..3bf0984
--- /dev/null
@@ -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 (file)
index 0000000..5565a9a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<A,F:FnOnce<A>>(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 (file)
index 0000000..afd4838
--- /dev/null
@@ -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<isize>]`, 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 (file)
index 0000000..1b9af39
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2e8cd84
--- /dev/null
@@ -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 (file)
index 0000000..09cbfe4
--- /dev/null
@@ -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 (file)
index 0000000..9378581
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<B> = 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 (file)
index 0000000..91788e9
--- /dev/null
@@ -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 (file)
index 0000000..e4788ba
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9a3d5ef
--- /dev/null
@@ -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 (file)
index 0000000..a040f7c
--- /dev/null
@@ -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 (file)
index 0000000..30cdd07
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..60acffd
--- /dev/null
@@ -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 (file)
index 0000000..0c3c82a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c8bedd3
--- /dev/null
@@ -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<Self>`
+
+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 (file)
index 0000000..d343241
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..eb2957a
--- /dev/null
@@ -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 (file)
index 0000000..2d8d785
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8565384
--- /dev/null
@@ -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 (file)
index 0000000..8d3df68
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3030ee4
--- /dev/null
@@ -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 (file)
index 0000000..f1fd617
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2db3cb8
--- /dev/null
@@ -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 (file)
index 0000000..e9d76c7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<FnMut()>) {}
+
+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 (file)
index 0000000..5324eb2
--- /dev/null
@@ -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 (file)
index 0000000..e33859e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..77f10be
--- /dev/null
@@ -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 (file)
index 0000000..0059e92
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b71d3ce
--- /dev/null
@@ -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 (file)
index 0000000..afb2e86
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e5ef50e
--- /dev/null
@@ -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 (file)
index 0000000..6ad3ec6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..68fece3
--- /dev/null
@@ -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 (file)
index 0000000..abddf6b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>` has one type parameter, while
+    // the actual arm `Result<T, E>` 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 (file)
index 0000000..be845fb
--- /dev/null
@@ -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 (file)
index 0000000..fe7fbb1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1ecae3b
--- /dev/null
@@ -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 (file)
index 0000000..32a63b7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..95273bb
--- /dev/null
@@ -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 (file)
index 0000000..3171683
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String> = 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 (file)
index 0000000..72770f8
--- /dev/null
@@ -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 (file)
index 0000000..d544a92
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String> = 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 (file)
index 0000000..ab6d041
--- /dev/null
@@ -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 (file)
index 0000000..d51db47
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c19e256
--- /dev/null
@@ -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 (file)
index 0000000..3b690e0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0f96b5f
--- /dev/null
@@ -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 (file)
index 0000000..2e81554
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..47b9a02
--- /dev/null
@@ -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 (file)
index 0000000..0314f10
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..fad3245
--- /dev/null
@@ -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 (file)
index 0000000..1635a8f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<ResponseHook>) { 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 (file)
index 0000000..c15290f
--- /dev/null
@@ -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<ResponseHook>) { 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 (file)
index 0000000..78b079a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<D: Deserializer<'a>>(_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 (file)
index 0000000..e93b03b
--- /dev/null
@@ -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 (file)
index 0000000..86a6bdf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Node {
+    fn zomg();
+}
+
+trait Graph<N: Node> {
+    fn nodes<'a, I: Iterator<Item=&'a N>>(&'a self) -> I
+        where N: 'a;
+}
+
+impl<N: Node> Graph<N> for Vec<N> {
+    fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I
+        where N: 'a
+    {
+        self.iter() //~ ERROR mismatched types
+    }
+}
+
+struct Stuff;
+
+impl Node for Stuff {
+    fn zomg() {
+        println!("zomg");
+    }
+}
+
+fn iterate<N: Node, G: Graph<N>>(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 (file)
index 0000000..188bfd5
--- /dev/null
@@ -0,0 +1,34 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-13853.rs:24:9
+   |
+LL |     fn nodes<'a, I: Iterator<Item=&'a N>>(&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<Stuff>`
+
+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 (file)
index 0000000..a435173
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ccabd80
--- /dev/null
@@ -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 (file)
index 0000000..9e436b8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9db2a0e
--- /dev/null
@@ -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 (file)
index 0000000..d11fe99
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9252a4f
--- /dev/null
@@ -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 (file)
index 0000000..250e78c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f5f3946
--- /dev/null
@@ -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 (file)
index 0000000..440365c
--- /dev/null
@@ -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 (file)
index 0000000..dceecee
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b5ab7bd
--- /dev/null
@@ -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 (file)
index 0000000..f76fa3e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e062c63
--- /dev/null
@@ -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 (file)
index 0000000..0b154d0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..260ca44
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..ddfed36
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..5769b0c
--- /dev/null
@@ -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 (file)
index 0000000..84c600d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..fcff500
--- /dev/null
@@ -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 (file)
index 0000000..58e8e10
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..93e5114
--- /dev/null
@@ -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 (file)
index 0000000..48bf71f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..afdda3e
--- /dev/null
@@ -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 (file)
index 0000000..aaaad67
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1116cd3
--- /dev/null
@@ -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 (file)
index 0000000..74f0833
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a994026
--- /dev/null
@@ -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 (file)
index 0000000..e4da3e4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Debug>(_: Option<Self>, thing: &[T]);
+}
+
+struct X { data: u32 }
+
+impl Something for X {
+    fn yay<T: Str>(_:Option<X>, thing: &[T]) {
+    //~^ ERROR E0276
+    }
+}
+
+fn main() {
+    let arr = &["one", "two", "three"];
+    println!("{:?}", Something::yay(None::<X>, arr));
+}
diff --git a/src/test/ui/issue-14853.stderr b/src/test/ui/issue-14853.stderr
new file mode 100644 (file)
index 0000000..6c2f6bb
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0276]: impl has stricter requirements than trait
+  --> $DIR/issue-14853.rs:22:5
+   |
+LL |     fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
+   |     ----------------------------------------------- definition of `yay` from trait
+...
+LL |     fn yay<T: Str>(_:Option<X>, 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 (file)
index 0000000..810d665
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<isize> = box 0;
+
+    println!("{}", x + 1);
+    //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
+}
diff --git a/src/test/ui/issue-14915.stderr b/src/test/ui/issue-14915.stderr
new file mode 100644 (file)
index 0000000..aa418f5
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
+  --> $DIR/issue-14915.rs:16:20
+   |
+LL |     println!("{}", x + 1);
+   |                    ^^^^^
+   |
+   = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box<isize>`
+
+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 (file)
index 0000000..19fe83f
--- /dev/null
@@ -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 (file)
index 0000000..a62e468
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3bbf423
--- /dev/null
@@ -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 (file)
index 0000000..1dd6763
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {
+    x: T
+}
+
+impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
+    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<T>(x: T) -> Debuger<T> {
+    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 (file)
index 0000000..7928a6b
--- /dev/null
@@ -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<T>, ())`
+              found type `fn(Debuger<T>, ())`
+
+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 (file)
index 0000000..7a7ba46
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e65e651
--- /dev/null
@@ -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 (file)
index 0000000..d224b8a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b15c493
--- /dev/null
@@ -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 (file)
index 0000000..70da8cf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..77e5201
--- /dev/null
@@ -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 (file)
index 0000000..1cdd803
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let values: Vec<u8> = 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 (file)
index 0000000..7a936a8
--- /dev/null
@@ -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 (file)
index 0000000..c123e85
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..af70f12
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..37a2f15
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d565bad
--- /dev/null
@@ -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 (file)
index 0000000..35ef9ba
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b41848c
--- /dev/null
@@ -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 (file)
index 0000000..df7e7c1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a69e7b4
--- /dev/null
@@ -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 (file)
index 0000000..76ba5a0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..216c646
--- /dev/null
@@ -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 (file)
index 0000000..cda83fe
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..97883fb
--- /dev/null
@@ -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 (file)
index 0000000..68ac19b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..31162ca
--- /dev/null
@@ -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 (file)
index 0000000..60117bd
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b0b6e9d
--- /dev/null
@@ -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 (file)
index 0000000..f9d0100
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c826b20
--- /dev/null
@@ -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 (file)
index 0000000..438073e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Slice<T> {
+    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 (file)
index 0000000..c670f1e
--- /dev/null
@@ -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 (file)
index 0000000..3060bbe
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Slice<T> {
+    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 (file)
index 0000000..179415c
--- /dev/null
@@ -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 (file)
index 0000000..cc65211
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9bc3590
--- /dev/null
@@ -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 (file)
index 0000000..a400263
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait MatrixShape {}
+
+struct Col<D, C> {
+    data: D,
+    col: C,
+}
+
+trait Collection { fn len(&self) -> usize; }
+
+impl<T, M: MatrixShape> Collection for Col<M, usize> {
+//~^ 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 (file)
index 0000000..a452503
--- /dev/null
@@ -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<T, M: MatrixShape> Collection for Col<M, usize> {
+   |      ^ 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 (file)
index 0000000..d789f58
--- /dev/null
@@ -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 (file)
index 0000000..fcbf8a3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ceb5347
--- /dev/null
@@ -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 (file)
index 0000000..902baaf
--- /dev/null
@@ -0,0 +1,17 @@
+warning: not reporting region error due to nll
+  --> $DIR/issue-16922.rs:14:14
+   |
+LL |     Box::new(value) as Box<Any>
+   |              ^^^^^
+
+error[E0621]: explicit lifetime required in the type of `value`
+  --> $DIR/issue-16922.rs:14:5
+   |
+LL | fn foo<T: Any>(value: &T) -> Box<Any> {
+   |                ----- consider changing the type of `value` to `&'static T`
+LL |     Box::new(value) as Box<Any>
+   |     ^^^^^^^^^^^^^^^ 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 (file)
index 0000000..1768c83
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::any::Any;
+
+fn foo<T: Any>(value: &T) -> Box<Any> {
+    Box::new(value) as Box<Any>
+    //~^ 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 (file)
index 0000000..cf81d4b
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0621]: explicit lifetime required in the type of `value`
+  --> $DIR/issue-16922.rs:14:5
+   |
+LL | fn foo<T: Any>(value: &T) -> Box<Any> {
+   |                ----- consider changing the type of `value` to `&'static T`
+LL |     Box::new(value) as Box<Any>
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 (file)
index 0000000..e16c58b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: Fn()> (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 (file)
index 0000000..2384804
--- /dev/null
@@ -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 (file)
index 0000000..ecf81c8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f7129a6
--- /dev/null
@@ -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 (file)
index 0000000..f8a6826
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..28a7fbc
--- /dev/null
@@ -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 (file)
index 0000000..ae4e8ce
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Fn((&'a i32, &'a (Vec<&'static i32>, 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 (file)
index 0000000..8392b9d
--- /dev/null
@@ -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 (file)
index 0000000..413e8b4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a8e0cd8
--- /dev/null
@@ -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 (file)
index 0000000..f250103
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<A>]),
+}
+
+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 (file)
index 0000000..1cd43cb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d6884f1
--- /dev/null
@@ -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 (file)
index 0000000..1c3e689
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8f97a84
--- /dev/null
@@ -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 (file)
index 0000000..1208321
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0321547
--- /dev/null
@@ -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 (file)
index 0000000..f6e6a8a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..38e93e6
--- /dev/null
@@ -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 (file)
index 0000000..c3387e5
--- /dev/null
@@ -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 (file)
index 0000000..eb293c7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..01d6d1a
--- /dev/null
@@ -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 (file)
index 0000000..5a6bd5e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bcccfd3
--- /dev/null
@@ -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 (file)
index 0000000..260cc36
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Foo { foo: Option<Option<Foo>> }
+//~^ 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 (file)
index 0000000..fb27693
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `Foo` has infinite size
+  --> $DIR/issue-17431-1.rs:11:1
+   |
+LL | struct Foo { foo: Option<Option<Foo>> }
+   | ^^^^^^^^^^   ------------------------ 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 (file)
index 0000000..f39fb0e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Baz { q: Option<Foo> }
+//~^ ERROR recursive type `Baz` has infinite size
+
+struct Foo { q: Option<Baz> }
+//~^ 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 (file)
index 0000000..7e87bab
--- /dev/null
@@ -0,0 +1,23 @@
+error[E0072]: recursive type `Baz` has infinite size
+  --> $DIR/issue-17431-2.rs:11:1
+   |
+LL | struct Baz { q: Option<Foo> }
+   | ^^^^^^^^^^   -------------- 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<Baz> }
+   | ^^^^^^^^^^   -------------- 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 (file)
index 0000000..9ba0855
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Option<Foo>> }
+//~^ 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 (file)
index 0000000..c12a4c1
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `Foo` has infinite size
+  --> $DIR/issue-17431-3.rs:13:1
+   |
+LL | struct Foo { foo: Mutex<Option<Foo>> }
+   | ^^^^^^^^^^   ----------------------- 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 (file)
index 0000000..665c3cf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::marker;
+
+struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> }
+//~^ ERROR recursive type `Foo` has infinite size
+
+impl<T> Foo<T> { 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 (file)
index 0000000..acfd688
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `Foo` has infinite size
+  --> $DIR/issue-17431-4.rs:13:1
+   |
+LL | struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> }
+   | ^^^^^^^^^^^^^   --------------------------- 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 (file)
index 0000000..85ed4d5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::marker;
+
+struct Foo { foo: Bar<Foo> }
+
+struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> }
+//~^ 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 (file)
index 0000000..ddfea58
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `Bar` has infinite size
+  --> $DIR/issue-17431-5.rs:15:1
+   |
+LL | struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> }
+   | ^^^^^^^^^^^^^   ----------- 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 (file)
index 0000000..4c1e82c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Option<Foo>>) }
+//~^ 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 (file)
index 0000000..ab2cc43
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `Foo` has infinite size
+  --> $DIR/issue-17431-6.rs:13:1
+   |
+LL | enum Foo { X(Mutex<Option<Foo>>) }
+   | ^^^^^^^^     ------------------ 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 (file)
index 0000000..71b85da
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Foo { Voo(Option<Option<Foo>>) }
+//~^ 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 (file)
index 0000000..7f91188
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `Foo` has infinite size
+  --> $DIR/issue-17431-7.rs:11:1
+   |
+LL | enum Foo { Voo(Option<Option<Foo>>) }
+   | ^^^^^^^^       ------------------- 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 (file)
index 0000000..dafcff2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3f87d80
--- /dev/null
@@ -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 (file)
index 0000000..f5b7a0c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7a43813
--- /dev/null
@@ -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 (file)
index 0000000..50a4b3f
--- /dev/null
@@ -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 (file)
index 0000000..9264305
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(fn_traits)]
+
+fn id<T>(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 (file)
index 0000000..ce69866
--- /dev/null
@@ -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 (file)
index 0000000..fe125b9
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<MyEnum, String> {
+        //~^ ERROR expected type, found variant `NoResult`
+        unimplemented!()
+    }
+}
+
+mod bar {
+    use foo::MyEnum::Result;
+    use foo;
+
+    fn new() -> Result<foo::MyEnum, String> {
+        //~^ ERROR expected type, found variant `Result`
+        unimplemented!()
+    }
+}
+
+fn new() -> Result<foo::MyEnum, String> {
+    //~^ ERROR expected type, found variant `Result`
+    unimplemented!()
+}
+
+fn newer() -> NoResult<foo::MyEnum, String> {
+    //~^ 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 (file)
index 0000000..39f7d5f
--- /dev/null
@@ -0,0 +1,55 @@
+error[E0573]: expected type, found variant `NoResult`
+  --> $DIR/issue-17546.rs:22:17
+   |
+LL |     fn new() -> NoResult<MyEnum, String> {
+   |                 --------^^^^^^^^^^^^^^^^
+   |                 |
+   |                 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<foo::MyEnum, String> {
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<foo::MyEnum, String> {
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<foo::MyEnum, String> {
+   |               --------^^^^^^^^^^^^^^^^^^^^^
+   |               |
+   |               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 (file)
index 0000000..b55863f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::marker;
+
+struct B<T>(marker::PhantomData<T>);
+
+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 (file)
index 0000000..0cdee03
--- /dev/null
@@ -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 (file)
index 0000000..cbd0da4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d21b306
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = note: required by `<std::boxed::Box<T>>::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 (file)
index 0000000..17ec77d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0ab7f96
--- /dev/null
@@ -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 (file)
index 0000000..07123c6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::cell::UnsafeCell;
+
+const A: UnsafeCell<usize> = UnsafeCell::new(1);
+const B: &'static UnsafeCell<usize> = &A;
+//~^ ERROR: cannot borrow a constant which may contain interior mutability
+
+struct C { a: UnsafeCell<usize> }
+const D: C = C { a: UnsafeCell::new(1) };
+const E: &'static UnsafeCell<usize> = &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 (file)
index 0000000..3b02170
--- /dev/null
@@ -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<usize> = &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<usize> = &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 (file)
index 0000000..4857c2f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9636db3
--- /dev/null
@@ -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 (file)
index 0000000..9b7ed46
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn id<T>(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 (file)
index 0000000..61d8399
--- /dev/null
@@ -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 (file)
index 0000000..b9f5e98
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..13cab9a
--- /dev/null
@@ -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 (file)
index 0000000..586cfeb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6e89a83
--- /dev/null
@@ -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 (file)
index 0000000..a5a7117
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a6384cf
--- /dev/null
@@ -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 (file)
index 0000000..c5349d4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d681682
--- /dev/null
@@ -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 (file)
index 0000000..b9931e4
--- /dev/null
@@ -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 (file)
index 0000000..8516a8e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Item>,
+    direction_to_room: HashMap<RoomDirection, Room>,
+}
+
+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<Item>,
+}
+
+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 (file)
index 0000000..e46c48c
--- /dev/null
@@ -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 (file)
index 0000000..1d5ef43
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e4f5485
--- /dev/null
@@ -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 (file)
index 0000000..124fc6f
--- /dev/null
@@ -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 (file)
index 0000000..a47f5c1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3d78b2e
--- /dev/null
@@ -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 (file)
index 0000000..f7cae91
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum MyOption<T> {
+    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 (file)
index 0000000..2cc562f
--- /dev/null
@@ -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 (file)
index 0000000..a15ccb7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> 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 (file)
index 0000000..00013d4
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0392]: parameter `T` is never used
+  --> $DIR/issue-17904-2.rs:14:12
+   |
+LL | struct Foo<T> 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 (file)
index 0000000..f11d482
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[derive(Debug)]
+struct Pair<T, V> (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 (file)
index 0000000..1a7aba1
--- /dev/null
@@ -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 (file)
index 0000000..80e5f2b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ca8a28c
--- /dev/null
@@ -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 (file)
index 0000000..049a066
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ec0f478
--- /dev/null
@@ -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 (file)
index 0000000..f731e8e
--- /dev/null
@@ -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 (file)
index 0000000..677d2cb
--- /dev/null
@@ -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 (file)
index 0000000..f731e8e
--- /dev/null
@@ -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 (file)
index 0000000..4211057
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..37c8173
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: ?Sized> {
+    _ptr: *const T
+}
+
+impl<T> Drop for G<T> {
+//~^ 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<Bar>;
+}
diff --git a/src/test/ui/issue-17959.stderr b/src/test/ui/issue-17959.stderr
new file mode 100644 (file)
index 0000000..626b670
--- /dev/null
@@ -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<T> Drop for G<T> {
+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<T: ?Sized> {
+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 (file)
index 0000000..25141b9
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Tr {}
+type Huh<T> 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 (file)
index 0000000..77bcc46
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0091]: type parameter `T` is unused
+  --> $DIR/issue-17994.rs:12:10
+   |
+LL | type Huh<T> 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 (file)
index 0000000..88945f8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1a24015
--- /dev/null
@@ -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 (file)
index 0000000..4c815e6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ded375a
--- /dev/null
@@ -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 (file)
index 0000000..260038b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4a273ab
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..6efe532
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c0b3061
--- /dev/null
@@ -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 (file)
index 0000000..7acab84
--- /dev/null
@@ -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 (file)
index 0000000..7194c15
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2d83b86
--- /dev/null
@@ -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 (file)
index 0000000..412f756
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e0e2d08
--- /dev/null
@@ -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 (file)
index 0000000..8991ede
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..894660f
--- /dev/null
@@ -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 (file)
index 0000000..efc1ba1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..151deef
--- /dev/null
@@ -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 (file)
index 0000000..aad3d52
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<P, R> {
+    fn call(&self, p: P, r: R);
+}
+pub trait Public: Private<
+//~^ ERROR private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
+    <Self as Public>::P,
+    <Self as Public>::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 (file)
index 0000000..6f06730
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0445]: private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
+  --> $DIR/issue-18389.rs:17:1
+   |
+LL | / pub trait Public: Private<
+LL | | //~^ ERROR private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
+LL | |     <Self as Public>::P,
+LL | |     <Self as Public>::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 (file)
index 0000000..dd17189
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Set<T> {
+    fn contains(&self, _: T) -> bool;
+    fn set(&mut self, _: T);
+}
+
+impl<'a, T, S> Set<&'a [T]> for S where
+    T: Copy,
+    S: Set<T>,
+{
+    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 (file)
index 0000000..2426d42
--- /dev/null
@@ -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 (file)
index 0000000..5945a7a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2540619
--- /dev/null
@@ -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 (file)
index 0000000..60afea5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d1914fc
--- /dev/null
@@ -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 (file)
index 0000000..2be5fdc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8f10cb0
--- /dev/null
@@ -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 (file)
index 0000000..b5ed33d
--- /dev/null
@@ -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 (file)
index 0000000..41e82d0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e07fde1
--- /dev/null
@@ -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 (file)
index 0000000..a3ad76e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn add_state(op: <isize as HasState>::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 (file)
index 0000000..d890a32
--- /dev/null
@@ -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: <isize as HasState>::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 (file)
index 0000000..e4d132c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0546848
--- /dev/null
@@ -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 (file)
index 0000000..6bb7b42
--- /dev/null
@@ -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 (file)
index 0000000..9a7b378
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<FnMut() + 'f>);
+}
+
+impl<'c> Push<'c> for RefCell<Vec<Box<FnMut() + 'c>>> {
+    fn push<'f: 'c>(&self, fun: Box<FnMut() + 'f>) {
+        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 (file)
index 0000000..64d2809
--- /dev/null
@@ -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 (file)
index 0000000..cc87a09
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<FuncType>) {
+    //~^ 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 (file)
index 0000000..012a1eb
--- /dev/null
@@ -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<FuncType>) {
+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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..f7f84e6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Box<fmt::Debug>>,
+}
+
+trait A<'a> {
+    fn foo<F>(&mut self, f: F)
+        where F: fmt::Debug + 'a,
+              Self: Sized;
+}
+
+impl<'a> A<'a> for B {
+    fn foo<F>(&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 (file)
index 0000000..7b4c35e
--- /dev/null
@@ -0,0 +1,18 @@
+error[E0276]: impl has stricter requirements than trait
+  --> $DIR/issue-18937.rs:29:5
+   |
+LL | /     fn foo<F>(&mut self, f: F)
+LL | |         where F: fmt::Debug + 'a,
+LL | |               Self: Sized;
+   | |__________________________- definition of `foo` from trait
+...
+LL | /     fn foo<F>(&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 (file)
index 0000000..7a6d012
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
+pub trait Bar: Foo { }
+impl<T: Foo> Bar for T { }
+
+pub struct Thing;
+impl Foo for Thing {
+    fn foo<T>(&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 (file)
index 0000000..42a1c2d
--- /dev/null
@@ -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 (file)
index 0000000..e41bb00
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main<T>() { }
+//~^ 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 (file)
index 0000000..512a923
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0131]: `main` function is not allowed to have generic parameters
+  --> $DIR/issue-1900.rs:11:8
+   |
+LL | fn main<T>() { }
+   |        ^^^ `main` cannot have generic parameters
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0131`.
diff --git a/src/test/ui/issue-19086.rs b/src/test/ui/issue-19086.rs
new file mode 100644 (file)
index 0000000..ba571ce
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b71d400
--- /dev/null
@@ -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 (file)
index 0000000..df34aab
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..28e66b2
--- /dev/null
@@ -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 (file)
index 0000000..864f8f6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3969c77
--- /dev/null
@@ -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 (file)
index 0000000..322952f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a251d3b
--- /dev/null
@@ -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 (file)
index 0000000..b54f008
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..5e2d427
--- /dev/null
@@ -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 (file)
index 0000000..93d95ca
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8f81bcb
--- /dev/null
@@ -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 (file)
index 0000000..a619050
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+    fn foo<T>(&self, val: T);
+}
+
+trait Bar: Foo { }
+
+pub struct Thing;
+
+impl Foo for Thing {
+    fn foo<T>(&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 (file)
index 0000000..3cd73ad
--- /dev/null
@@ -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 (file)
index 0000000..02b4932
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(rustc_attrs)]
+#![allow(warnings)]
+
+trait A<T> {}
+struct B<T> where B<T>: A<B<T>> { 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 (file)
index 0000000..594d766
--- /dev/null
@@ -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 (file)
index 0000000..c4b871a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f5d903f
--- /dev/null
@@ -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 (file)
index 0000000..ca17154
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..33361ff
--- /dev/null
@@ -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 (file)
index 0000000..a3820d2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1d07f4d
--- /dev/null
@@ -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 (file)
index 0000000..9b6a877
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait From<Src> {
+    type Output;
+
+    fn from(src: Src) -> <Self as From<Src>>::Output;
+}
+
+trait To: Sized {
+    fn to<Dst: From<Self>>(self) ->
+        <Dst as From<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 (file)
index 0000000..b4262b4
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0576]: cannot find associated type `Dst` in trait `From`
+  --> $DIR/issue-19883.rs:19:30
+   |
+LL |         <Dst as From<Self>>::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 (file)
index 0000000..9dbca99
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9f13ba6
--- /dev/null
@@ -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 (file)
index 0000000..e07dfaf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..45b2ef8
--- /dev/null
@@ -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 (file)
index 0000000..8db0918
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait From<Src> {
+    type Result;
+
+    fn from(src: Src) -> Self::Result;
+}
+
+trait To {
+    fn to<Dst>(  //~ ERROR the size for values of type
+        self
+    ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
+        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 (file)
index 0000000..2fdfa4b
--- /dev/null
@@ -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<Dst>(  //~ ERROR the size for values of type
+LL | |         self
+LL | |     ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
+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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = help: consider adding a `where Self: std::marker::Sized` bound
+note: required by `From`
+  --> $DIR/issue-20005.rs:11:1
+   |
+LL | trait From<Src> {
+   | ^^^^^^^^^^^^^^^
+
+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 (file)
index 0000000..b2f3a2d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<X> = 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 (file)
index 0000000..0fb7009
--- /dev/null
@@ -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 (file)
index 0000000..da98f21
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7813dc5
--- /dev/null
@@ -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 (file)
index 0000000..bb4dbdc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a4a2aec
--- /dev/null
@@ -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 (file)
index 0000000..dfb23c0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..95afda1
--- /dev/null
@@ -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 (file)
index 0000000..a48c03a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+  fn answer(self);
+}
+
+struct NoData<T>;
+//~^ ERROR: parameter `T` is never used
+
+impl<T> Foo for T where NoData<T>: Foo {
+//~^ ERROR: overflow evaluating the requirement
+  fn answer(self) {
+    let val: NoData<T> = NoData;
+  }
+}
+
+fn main() {}
diff --git a/src/test/ui/issue-20413.stderr b/src/test/ui/issue-20413.stderr
new file mode 100644 (file)
index 0000000..bfb2665
--- /dev/null
@@ -0,0 +1,94 @@
+error[E0392]: parameter `T` is never used
+  --> $DIR/issue-20413.rs:15:15
+   |
+LL | struct NoData<T>;
+   |               ^ unused type parameter
+   |
+   = help: consider removing `T` or using a marker such as `std::marker::PhantomData`
+
+error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: std::marker::Sized`
+  --> $DIR/issue-20413.rs:18:1
+   |
+LL | / impl<T> Foo for T where NoData<T>: Foo {
+LL | | //~^ ERROR: overflow evaluating the requirement
+LL | |   fn answer(self) {
+LL | |     let val: NoData<T> = 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<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<T>>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<T>>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<T>>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<T>>`
+   = note: required because of the requirements on the impl of `Foo` for `NoData<T>`
+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 (file)
index 0000000..f760cd5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..38dd4e5
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..60d012a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn changer<'a>(mut things: Box<Iterator<Item=&'a mut u8>>) {
+    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 (file)
index 0000000..10e90fa
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0277]: the size for values of type `dyn std::iter::Iterator<Item=&mut u8>` 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<Item=&mut u8>`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..3e29383
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..1ee965d
--- /dev/null
@@ -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 (file)
index 0000000..1ec7a74
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..1c103b2
--- /dev/null
@@ -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 (file)
index 0000000..885fd24
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..b4b40b3
--- /dev/null
@@ -0,0 +1,8 @@
+error: expected one of `>`, identifier, lifetime, or type, found `,`
+  --> $DIR/issue-20616-3.rs:25:24
+   |
+LL | type Type_3<T> = Box<T,,>; //~ 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 (file)
index 0000000..0dbe92f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..0a734e4
--- /dev/null
@@ -0,0 +1,8 @@
+error: expected one of `>`, identifier, lifetime, or type, found `,`
+  --> $DIR/issue-20616-4.rs:28:34
+   |
+LL | type Type_4<T> = 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 (file)
index 0000000..794e517
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..504be16
--- /dev/null
@@ -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 (file)
index 0000000..fe91751
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..41dea41
--- /dev/null
@@ -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 (file)
index 0000000..184ad02
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..caf6689
--- /dev/null
@@ -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 (file)
index 0000000..5cdec33
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; // 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 (file)
index 0000000..6d840fc
--- /dev/null
@@ -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 (file)
index 0000000..7995add
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> = Box<T,,>; // error: expected type, found `,`
+
+
+//type Type_4<T> = 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<T,,> = Box<T>; //~ 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 (file)
index 0000000..f9cc4e0
--- /dev/null
@@ -0,0 +1,8 @@
+error: expected one of `>`, identifier, or lifetime, found `,`
+  --> $DIR/issue-20616-9.rs:46:15
+   |
+LL | type Type_9<T,,> = Box<T>; //~ 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 (file)
index 0000000..cb322f0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1ea85ee
--- /dev/null
@@ -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 (file)
index 0000000..d67c76a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait T : Iterator<Item=Self::Item>
+//~^ 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 (file)
index 0000000..b898962
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0391]: cycle detected when computing the supertraits of `T`
+  --> $DIR/issue-20772.rs:11:1
+   |
+LL | / trait T : Iterator<Item=Self::Item>
+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<Item=Self::Item>
+   |                         ^^^^^^^^^^ 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 (file)
index 0000000..39b1405
--- /dev/null
@@ -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 (file)
index 0000000..d3b97a9
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3989957
--- /dev/null
@@ -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 (file)
index 0000000..cbb987c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Input = Self::Input> {
+    //~^ 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 (file)
index 0000000..e49e366
--- /dev/null
@@ -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<Input = Self::Input> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 (file)
index 0000000..3f00f56
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 `<Self as Publisher>::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<Subscriber<Input=Self::Output> + '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<Subscriber<Input=u64> + 'a>
+}
+
+impl<'a> Publisher<'a> for MyStruct<'a> {
+    type Output = u64;
+    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::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 (file)
index 0000000..fc9a0fd
--- /dev/null
@@ -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<Subscriber<Input=<Self as Publisher>::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<Subscriber<Input=<Self as Publisher>::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 (file)
index 0000000..5282ce4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c8f7e58
--- /dev/null
@@ -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 (file)
index 0000000..8180ce5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo(a: Option<usize>, b: Option<usize>) {
+  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 (file)
index 0000000..5aa1b02
--- /dev/null
@@ -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 (file)
index 0000000..0de0ab2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Bar;
+
+impl Bar {
+    fn hash<T>(&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 (file)
index 0000000..75ed998
--- /dev/null
@@ -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 (file)
index 0000000..9d9b7e4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..391ed1e
--- /dev/null
@@ -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: <T as Trait<'a>>::A (size can vary because of <T as Trait>::A)
+   = note: target type: <T as Trait<'a>>::B (size can vary because of <T as Trait>::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 (file)
index 0000000..9da5787
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Trait<A = T::B>>() { }
+//~^ 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 (file)
index 0000000..c924fb2
--- /dev/null
@@ -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<T: Trait<A = T::B>>() { }
+   |                     ^^^^
+   |
+   = 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<T: Trait<A = T::B>>() { }
+   |                     ^^^^
+
+error[E0220]: associated type `B` not found for `T`
+  --> $DIR/issue-21177.rs:16:21
+   |
+LL | fn foo<T: Trait<A = T::B>>() { }
+   |                     ^^^^ 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 (file)
index 0000000..db33348
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<i32, i32> { 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 (file)
index 0000000..b5fbb71
--- /dev/null
@@ -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<i32, i32> { Ok(7) }
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
+   |
+   = note: expected type `fn(&mut S) -> std::option::Option<i32>`
+              found type `fn(&mut S) -> std::result::Result<i32, i32>`
+
+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 (file)
index 0000000..f66c092
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..5787476
--- /dev/null
@@ -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 (file)
index 0000000..cc44cf8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d84b3b9
--- /dev/null
@@ -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 (file)
index 0000000..256c5d8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait vec_monad<A> {
+    fn bind<B, F>(&self, f: F) where F: FnMut(A) -> Vec<B>;
+}
+
+impl<A> vec_monad<A> for Vec<A> {
+    fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
+        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 (file)
index 0000000..4ae9032
--- /dev/null
@@ -0,0 +1,22 @@
+error[E0277]: cannot add `std::vec::Vec<B>` to `()`
+  --> $DIR/issue-2149.rs:18:33
+   |
+LL |         for elt in self { r = r + f(*elt); }
+   |                                 ^ no implementation for `() + std::vec::Vec<B>`
+   |
+   = help: the trait `std::ops::Add<std::vec::Vec<B>>` 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 (file)
index 0000000..8b109b0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<isize> ) -> 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 (file)
index 0000000..c1944ef
--- /dev/null
@@ -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 (file)
index 0000000..3cf971f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..592c4f4
--- /dev/null
@@ -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 (file)
index 0000000..1b87862
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..be7762f
--- /dev/null
@@ -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 (file)
index 0000000..f24de2f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo<U>(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 (file)
index 0000000..9fb9a7b
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0618]: expected function, found `U`
+  --> $DIR/issue-21701.rs:12:13
+   |
+LL | fn foo<U>(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 (file)
index 0000000..b4f952c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Send>() {}
+
+fn main() {
+    foo::<HashMap<Rc<()>, 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 (file)
index 0000000..91db16e
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
+  --> $DIR/issue-21763.rs:19:5
+   |
+LL |     foo::<HashMap<Rc<()>, Rc<()>>>();
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
+   |
+   = help: within `std::collections::HashMap<std::rc::Rc<()>, 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<()>, std::rc::Rc<()>>`
+   = note: required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`
+note: required by `foo`
+  --> $DIR/issue-21763.rs:16:1
+   |
+LL | fn foo<T: Send>() {}
+   | ^^^^^^^^^^^^^^^^^
+
+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 (file)
index 0000000..86506de
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Bound {}
+pub struct Foo<T: Bound>(T);
+
+pub trait Trait1 {}
+impl<T: Bound> Trait1 for Foo<T> {}
+
+pub trait Trait2 {}
+impl<T> Trait2 for Foo<T> {} //~ 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 (file)
index 0000000..bbdebee
--- /dev/null
@@ -0,0 +1,16 @@
+error[E0277]: the trait bound `T: Bound` is not satisfied
+  --> $DIR/issue-21837.rs:18:9
+   |
+LL | impl<T> Trait2 for Foo<T> {} //~ 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: Bound>(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 (file)
index 0000000..0d652be
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 `<FooStruct as Foo>::A`
+    type A = <FooStruct as Foo>::A;
+}
+
+fn main() {}
diff --git a/src/test/ui/issue-21946.stderr b/src/test/ui/issue-21946.stderr
new file mode 100644 (file)
index 0000000..ebb0c0c
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::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 (file)
index 0000000..6ddfa4c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4cc28c9
--- /dev/null
@@ -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 (file)
index 0000000..5271ea7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bac62a1
--- /dev/null
@@ -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 (file)
index 0000000..ffa881b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait A {
+    type Output;
+    fn a(&self) -> <Self as A>::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 (file)
index 0000000..ae739af
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0576]: cannot find associated type `X` in trait `A`
+  --> $DIR/issue-22037.rs:13:33
+   |
+LL |     fn a(&self) -> <Self as A>::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 (file)
index 0000000..c23fc4f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..202b25f
--- /dev/null
@@ -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 (file)
index 0000000..2128c42
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<usize> {
+    fn rows(&self) -> usize;
+    fn columns(&self) -> usize;
+    fn get<'a>(&'a self, y: usize, x: usize) -> Option<&'a <Self as Index<usize>>::Output> {
+        if y >= self.rows() || x >= self.columns() {
+            return None;
+        }
+        let i = y * self.columns() + x;
+        let indexer = &(*self as &Index<usize, Output = <Self as Index<usize>>::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 (file)
index 0000000..abd712e
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0605]: non-primitive cast: `Self` as `&dyn std::ops::Index<usize, Output=<Self as std::ops::Index<usize>>::Output>`
+  --> $DIR/issue-22312.rs:21:24
+   |
+LL |         let indexer = &(*self as &Index<usize, Output = <Self as Index<usize>>::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 (file)
index 0000000..ae7fb01
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Trait {
+    fn foo();
+}
+
+fn main() {
+    <<i32 as Copy>::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 (file)
index 0000000..b8cc1e6
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0576]: cannot find associated type `foobar` in trait `Copy`
+  --> $DIR/issue-22384.rs:16:21
+   |
+LL |     <<i32 as Copy>::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 (file)
index 0000000..6effd02
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..914da80
--- /dev/null
@@ -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 (file)
index 0000000..50e5dd2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..034a076
--- /dev/null
@@ -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 (file)
index 0000000..b9ea358
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..19c9b94
--- /dev/null
@@ -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 (file)
index 0000000..d08f916
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<A> 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 (file)
index 0000000..b50a5a2
--- /dev/null
@@ -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 (file)
index 0000000..2396007
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Expr : PartialEq<Self::Item> {
+    //~^ 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 (file)
index 0000000..7e5b80c
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0391]: cycle detected when computing the supertraits of `Expr`
+  --> $DIR/issue-22673.rs:11:1
+   |
+LL | trait Expr : PartialEq<Self::Item> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 (file)
index 0000000..a791758
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2c868bc
--- /dev/null
@@ -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 (file)
index 0000000..3d9ec0a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn is_copy<T: ::std::marker<i32>::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 (file)
index 0000000..2bbb3e5
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0109]: type parameters are not allowed on this type
+  --> $DIR/issue-22706.rs:11:29
+   |
+LL | fn is_copy<T: ::std::marker<i32>::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 (file)
index 0000000..cba1c36
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..afeae9c
--- /dev/null
@@ -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 (file)
index 0000000..e3fd9c4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e88cfe2
--- /dev/null
@@ -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 (file)
index 0000000..e0a87b3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..64c77a6
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..afb972f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..eaebebe
--- /dev/null
@@ -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 (file)
index 0000000..62adae4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3d4d2df
--- /dev/null
@@ -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 (file)
index 0000000..5d9b49f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Box<Any>> = 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 (file)
index 0000000..39c79d8
--- /dev/null
@@ -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 (file)
index 0000000..670706b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub enum Expr<'var, VAR> {
+    Let(Box<Expr<'var, VAR>>,
+        Box<for<'v> 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 (file)
index 0000000..3e5b4ec
--- /dev/null
@@ -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 (file)
index 0000000..2d21917
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 = <<Self as Bar>::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 (file)
index 0000000..44b2128
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0223]: ambiguous associated type
+  --> $DIR/issue-23073.rs:16:17
+   |
+LL |     type FooT = <<Self as Bar>::Foo>::T; //~ ERROR ambiguous associated type
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
+   |
+   = note: specify the type using the syntax `<<Self as Bar>::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 (file)
index 0000000..fc365a4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Trait>(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 (file)
index 0000000..dda7fbd
--- /dev/null
@@ -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 (file)
index 0000000..153b6fd
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Trait>(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 (file)
index 0000000..43e6f29
--- /dev/null
@@ -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 (file)
index 0000000..36d8450
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: Next> { t: T }
+
+impl<T: Next> Next for GetNext<T> {
+    //~^ ERROR overflow evaluating the requirement
+    type Next = <GetNext<T> 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 (file)
index 0000000..a0e5386
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next`
+  --> $DIR/issue-23122-1.rs:17:15
+   |
+LL | impl<T: Next> Next for GetNext<T> {
+   |               ^^^^
+
+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 (file)
index 0000000..faaf78f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: Next> { t: T }
+
+impl<T: Next> Next for GetNext<T> {
+    //~^ ERROR overflow evaluating the requirement
+    type Next = <GetNext<T::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 (file)
index 0000000..c43f8d7
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T 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 as Next>::Next`
+  --> $DIR/issue-23122-2.rs:17:15
+   |
+LL | impl<T: Next> Next for GetNext<T> {
+   |               ^^^^
+   |
+   = 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 (file)
index 0000000..626604a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f14ee51
--- /dev/null
@@ -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 (file)
index 0000000..5de00eb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Fn() -> ()>) {}
+    //~^ 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 (file)
index 0000000..ee5a993
--- /dev/null
@@ -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<Fn() -> ()>) {}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..f1a2826
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum chan { }
+
+trait channel<T> {
+    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 (file)
index 0000000..6b1d5e3
--- /dev/null
@@ -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 (file)
index 0000000..1c1d42d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f0c07b3
--- /dev/null
@@ -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 (file)
index 0000000..a3422d8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Self::ChildKey, Output=Hierarchy>;
+    //~^ 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 (file)
index 0000000..624534e
--- /dev/null
@@ -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<Self::ChildKey, Output=Hierarchy>;
+   |                                                  ^^^^^^^^^ 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<Self::ChildKey, Output=Hierarchy>;
+   |                                                  ^^^^^^^^^ 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<Self::ChildKey, Output=Hierarchy>;
+   |                                                  ^^^^^^^^^ 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 (file)
index 0000000..6a3ce03
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(associated_type_defaults)]
+
+pub struct C<AType: A> {a:AType}
+
+pub trait A {
+    type B = C<Self::anything_here_kills_it>;
+    //~^ 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 (file)
index 0000000..5ddaab6
--- /dev/null
@@ -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<Self::anything_here_kills_it>;
+   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 (file)
index 0000000..544d3c8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..07d2cfb
--- /dev/null
@@ -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 (file)
index 0000000..a723278
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..324e705
--- /dev/null
@@ -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 (file)
index 0000000..2a012da
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(dead_code)]
+
+trait MultiDispatch<T> {
+    type O;
+}
+
+trait Trait: Sized {
+    type A: MultiDispatch<Self::B, O = Self>;
+    type B;
+
+    fn new<U>(u: U) -> <Self::A as MultiDispatch<U>>::O where Self::A : MultiDispatch<U>;
+}
+
+fn test<T: Trait<B=i32>>(b: i32) -> T where T::A: MultiDispatch<i32> { 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 (file)
index 0000000..809db28
--- /dev/null
@@ -0,0 +1,17 @@
+error[E0271]: type mismatch resolving `<<T as Trait>::A as MultiDispatch<i32>>::O == T`
+  --> $DIR/issue-24204.rs:24:1
+   |
+LL | fn test<T: Trait<B=i32>>(b: i32) -> T where T::A: MultiDispatch<i32> { T::new(b) }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found type parameter
+   |
+   = note: expected type `<<T as Trait>::A as MultiDispatch<i32>>::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 (file)
index 0000000..cf3553c
--- /dev/null
@@ -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 (file)
index 0000000..4aca6bf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7d1d5ac
--- /dev/null
@@ -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 (file)
index 0000000..bb726ac
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d2cad8d
--- /dev/null
@@ -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 (file)
index 0000000..4b07731
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8a41690
--- /dev/null
@@ -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 (file)
index 0000000..f601a6f
--- /dev/null
@@ -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 (file)
index 0000000..016ce93
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..be531ec
--- /dev/null
@@ -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 (file)
index 0000000..619ad74
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2695d6a
--- /dev/null
@@ -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 (file)
index 0000000..72df6fb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0ad4674
--- /dev/null
@@ -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 (file)
index 0000000..a9c7978
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2c13dd3
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..0e872f7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
+           <N=()> //~ ERROR associated type bindings are not allowed here
+           ::option::Option<()>
+    { None }
+    fn z(&self) ->
+        u32<N=()> //~ 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 (file)
index 0000000..1e16cb7
--- /dev/null
@@ -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 |            <N=()> //~ 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<N=()> //~ 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 (file)
index 0000000..52f5f1c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u32>) {
+}
diff --git a/src/test/ui/issue-24819.stderr b/src/test/ui/issue-24819.stderr
new file mode 100644 (file)
index 0000000..33034b7
--- /dev/null
@@ -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<u32>`
+              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 (file)
index 0000000..097f2a5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4b17747
--- /dev/null
@@ -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 (file)
index 0000000..1c255b4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct S;
+
+trait InOut<T> { type Out; }
+
+fn do_fold<B, F: InOut<B, Out=B>>(init: B, f: F) {}
+
+fn bot<T>() -> 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 (file)
index 0000000..13ee70f
--- /dev/null
@@ -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<B, F: InOut<B, Out=B>>(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 (file)
index 0000000..e70c005
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {foo: PhantomData<T>}
+
+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 (file)
index 0000000..56cbef7
--- /dev/null
@@ -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 (file)
index 0000000..b2775db
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<CObj>,
+    }
+    pub struct CObj {
+        name: Option<String>,
+    }
+    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 (file)
index 0000000..986961d
--- /dev/null
@@ -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 (file)
index 0000000..7cfcbc5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1946f39
--- /dev/null
@@ -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 (file)
index 0000000..6e33fd5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: F) -> i32 where F: Fn(Helper<F>, 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 (file)
index 0000000..467bb1a
--- /dev/null
@@ -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 (file)
index 0000000..9f698e4
--- /dev/null
@@ -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 (file)
index 0000000..49b483d
--- /dev/null
@@ -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 (file)
index 0000000..9f698e4
--- /dev/null
@@ -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 (file)
index 0000000..71c1d63
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..477c323
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct S<T: 'static>(Option<&'static T>);
+
+trait Tr { type Out; }
+impl<T> Tr for T { type Out = T; }
+
+impl<T: 'static> Copy for S<T> where S<T>: Tr<Out=T> {}
+impl<T: 'static> Clone for S<T> where S<T>: Tr<Out=T> {
+    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 (file)
index 0000000..786620a
--- /dev/null
@@ -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 (file)
index 0000000..fa2df26
--- /dev/null
@@ -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 (file)
index 0000000..d7e438d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+
+struct parser {
+    tokens: Vec<isize> ,
+}
+
+trait parse {
+    fn parse(&self) -> Vec<isize> ;
+}
+
+impl parse for parser {
+    fn parse(&self) -> Vec<isize> {
+        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 (file)
index 0000000..59ec66d
--- /dev/null
@@ -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 (file)
index 0000000..72fb2a6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8c20df5
--- /dev/null
@@ -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 (file)
index 0000000..99add95
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bf902e1
--- /dev/null
@@ -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 (file)
index 0000000..54f5313
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..07b968c
--- /dev/null
@@ -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 (file)
index 0000000..94e3692
--- /dev/null
@@ -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 (file)
index 0000000..06a8fe5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo<T>() 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 (file)
index 0000000..f581826
--- /dev/null
@@ -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 (file)
index 0000000..22772e5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ae6fda8
--- /dev/null
@@ -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 (file)
index 0000000..8d79fd4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>(T);
+
+trait Tr { type Assoc; fn test(); }
+
+impl<T: Tr> S<T::Assoc> {
+//~^ ERROR the type parameter `T` is not constrained
+    fn foo(self, _: T) {
+        T::test();
+    }
+}
+
+trait Trait1<T> { type Bar; }
+trait Trait2<'x> { type Foo; }
+
+impl<'a,T: Trait2<'a>> Trait1<<T as Trait2<'a>>::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 (file)
index 0000000..2e0a211
--- /dev/null
@@ -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<T: Tr> S<T::Assoc> {
+   |      ^ 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<<T as Trait2<'a>>::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 (file)
index 0000000..8be3d88
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d497c1c
--- /dev/null
@@ -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 (file)
index 0000000..fc4f3d1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: ?Sized> Mirror for T { type It = Self; }
+struct S(Option<<S as Mirror>::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 (file)
index 0000000..c1db7fe
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0391]: cycle detected when computing layout of `std::option::Option<S>`
+   |
+note: ...which requires computing layout of `S`...
+   = note: ...which again requires computing layout of `std::option::Option<S>`, 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 (file)
index 0000000..c128fb3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> Mirror for T {
+    type It = Self;
+}
+
+
+#[rustc_error]
+fn main() { //~ ERROR compilation successful
+    let c: <u32 as Mirror>::It = 5;
+    const CCCC: <u32 as Mirror>::It = 5;
+}
diff --git a/src/test/ui/issue-26614.stderr b/src/test/ui/issue-26614.stderr
new file mode 100644 (file)
index 0000000..1752d80
--- /dev/null
@@ -0,0 +1,11 @@
+error: compilation successful
+  --> $DIR/issue-26614.rs:24:1
+   |
+LL | / fn main() { //~ ERROR compilation successful
+LL | |     let c: <u32 as Mirror>::It = 5;
+LL | |     const CCCC: <u32 as Mirror>::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 (file)
index 0000000..1dd0088
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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=T::Item>(_: 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 (file)
index 0000000..82cc17b
--- /dev/null
@@ -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=T::Item>(_: 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 (file)
index 0000000..3b8fac8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: ?Sized>(PhantomData<T>);
+
+struct MyRc<T: ?Sized> {
+    _ptr: *const T,
+    _boo: NotPhantomData<T>,
+}
+
+impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<MyRc<U>> for MyRc<T>{ } //~ERROR
+
+fn main() {
+    let data = [1, 2, 3];
+    let iter = data.iter();
+    let x = MyRc { _ptr: &iter, _boo: NotPhantomData(PhantomData) };
+    let _y: MyRc<Iterator<Item=&u32>> = x;
+}
+
diff --git a/src/test/ui/issue-26905.stderr b/src/test/ui/issue-26905.stderr
new file mode 100644 (file)
index 0000000..f18b58a
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0375]: implementing the trait `CoerceUnsized` requires multiple coercions
+  --> $DIR/issue-26905.rs:26:40
+   |
+LL | impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<MyRc<U>> for MyRc<T>{ } //~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<T> to NotPhantomData<U>)
+
+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 (file)
index 0000000..6c98f3e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f962f4c
--- /dev/null
@@ -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 (file)
index 0000000..c63cb5d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..982ce1d
--- /dev/null
@@ -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 (file)
index 0000000..f801358
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7983146
--- /dev/null
@@ -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 (file)
index 0000000..b8552aa
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ba573c3
--- /dev/null
@@ -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 (file)
index 0000000..23afa4b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4811344
--- /dev/null
@@ -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 (file)
index 0000000..619616a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[repr(packed)]
+pub struct Bad<T: ?Sized> {
+    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 (file)
index 0000000..bb28413
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..294c288
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
+        &<Self>::BAR
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/issue-27078.stderr b/src/test/ui/issue-27078.stderr
new file mode 100644 (file)
index 0000000..1a729c0
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..6de28cb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub struct send_packet<T> {
+    p: T
+}
+
+mod pingpong {
+    use send_packet;
+    pub type ping = send_packet<pong>;
+    pub struct pong(send_packet<ping>);
+    //~^ 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 (file)
index 0000000..a60e5d0
--- /dev/null
@@ -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<ping>);
+   |     ^^^^^^^^^^^^^^^^-----------------^^
+   |     |               |
+   |     |               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 (file)
index 0000000..ce3fa48
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bae47b3
--- /dev/null
@@ -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 (file)
index 0000000..782b205
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0fc04b0
--- /dev/null
@@ -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 (file)
index 0000000..0b55117
--- /dev/null
@@ -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 (file)
index 0000000..731d4fb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..74b0541
--- /dev/null
@@ -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 (file)
index 0000000..d9840ab
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..987feae
--- /dev/null
@@ -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 (file)
index 0000000..6063755
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..395c806
--- /dev/null
@@ -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 (file)
index 0000000..5dded2b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3a6e1ae
--- /dev/null
@@ -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 (file)
index 0000000..8e58d1a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..eb05dbe
--- /dev/null
@@ -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 (file)
index 0000000..0d372d3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..902fe23
--- /dev/null
@@ -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 (file)
index 0000000..7d25419
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..633257f
--- /dev/null
@@ -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 (file)
index 0000000..631bcb7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..5a5cae7
--- /dev/null
@@ -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 (file)
index 0000000..af73db2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c62d8bd
--- /dev/null
@@ -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 (file)
index 0000000..d28c314
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7ef2e90
--- /dev/null
@@ -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 (file)
index 0000000..9253a49
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bde01ef
--- /dev/null
@@ -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 (file)
index 0000000..837de8e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..37c04a7
--- /dev/null
@@ -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 (file)
index 0000000..203b28b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ffd15a5
--- /dev/null
@@ -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 (file)
index 0000000..bd71867
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Foo<RHS=Self> {
+    type Assoc;
+}
+
+pub trait Bar: Foo<Assoc=()> {
+    fn new(&self, b: &
+           Bar //~ ERROR the trait `Bar` cannot be made into an object
+              <Assoc=()>
+    );
+}
+
+fn main() {}
diff --git a/src/test/ui/issue-28576.stderr b/src/test/ui/issue-28576.stderr
new file mode 100644 (file)
index 0000000..80f0f1b
--- /dev/null
@@ -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 | |               <Assoc=()>
+   | |________________________^ 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 (file)
index 0000000..b8571d2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9820d64
--- /dev/null
@@ -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 (file)
index 0000000..dc9155e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Bar {
+    type Bar;
+}
+
+struct ArrayPeano<T: Bar> {
+    data: T::Bar,
+}
+
+fn foo<T>(a: &ArrayPeano<T>) -> &[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 (file)
index 0000000..90b50f1
--- /dev/null
@@ -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<T> (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 (file)
index 0000000..5367845
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 `<S>::C2`
+}
diff --git a/src/test/ui/issue-28992-empty.stderr b/src/test/ui/issue-28992-empty.stderr
new file mode 100644 (file)
index 0000000..9b5e42f
--- /dev/null
@@ -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 `<S>::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 (file)
index 0000000..6cb6bbf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3f1f18d
--- /dev/null
@@ -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 (file)
index 0000000..0ecaa40
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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,T);
+pub struct S1<T>(Option<Box<S0<S0<T>>>>,Option<Box<S0<S0<T>>>>);
+pub struct S2<T>(Option<Box<S1<S1<T>>>>,Option<Box<S1<S1<T>>>>);
+pub struct S3<T>(Option<Box<S2<S2<T>>>>,Option<Box<S2<S2<T>>>>);
+pub struct S4<T>(Option<Box<S3<S3<T>>>>,Option<Box<S3<S3<T>>>>);
+pub struct S5<T>(Option<Box<S4<S4<T>>>>,Option<Box<S4<S4<T>>>>,Option<T>);
+
+trait Foo { fn xxx(&self); }
+trait Bar {} // anything local or #[fundamental]
+
+impl<T> Foo for T where T: Bar, T: Sync {
+    fn xxx(&self) {}
+}
+
+impl Foo for S5<u32> { fn xxx(&self) {} }
+impl Foo for S5<u64> { fn xxx(&self) {} }
+
+fn main() {
+    let _ = <S5<_>>::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 (file)
index 0000000..d0ad0c9
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0283]: type annotations required: cannot resolve `S5<_>: Foo`
+  --> $DIR/issue-29147.rs:31:13
+   |
+LL |     let _ = <S5<_>>::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 (file)
index 0000000..97ba222
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..fb6a41d
--- /dev/null
@@ -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 (file)
index 0000000..98fe12c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..72d7bb8
--- /dev/null
@@ -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 (file)
index 0000000..0d684ec
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8c0125c
--- /dev/null
@@ -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 (file)
index 0000000..11ff7ab
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo<T, U>(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 (file)
index 0000000..8c16680
--- /dev/null
@@ -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 (file)
index 0000000..661579f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<P> {}
+
+impl <P, T: Foo<P>> Foo<P> for Option<T> {}
+
+pub struct Qux<T> (PhantomData<*mut T>);
+
+impl<T> Foo<*mut T> for Option<Qux<T>> {}
+
+pub trait Bar {
+    type Output: 'static;
+}
+
+impl<T: 'static, W: Bar<Output = T>> 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 (file)
index 0000000..d5ba942
--- /dev/null
@@ -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 (file)
index 0000000..79514ad
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 = <T as MakeRef<'a>>::Ref;
+}
+
+fn foo() -> <String as MakeRef2>::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 (file)
index 0000000..2745333
--- /dev/null
@@ -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 (file)
index 0000000..d735e18
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b52bbbe
--- /dev/null
@@ -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 (file)
index 0000000..04ae8f6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..dadaf3d
--- /dev/null
@@ -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 <https://github.com/rust-lang/rust/issues/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 (file)
index 0000000..66bfab0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::marker;
+
+enum E1 { V1(E2<E1>), }
+enum E2<T> { V2(E2<E1>, marker::PhantomData<T>), }
+//~^ 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 (file)
index 0000000..22c0871
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0072]: recursive type `E2` has infinite size
+  --> $DIR/issue-3008-3.rs:14:1
+   |
+LL | enum E2<T> { V2(E2<E1>, marker::PhantomData<T>), }
+   | ^^^^^^^^^^      ------ 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 (file)
index 0000000..2b0a24c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..dfc80e5
--- /dev/null
@@ -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 (file)
index 0000000..55975cc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn siphash<T>() {
+
+    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 (file)
index 0000000..4a250e7
--- /dev/null
@@ -0,0 +1,25 @@
+error[E0401]: can't use type parameters from outer function
+  --> $DIR/issue-3021-c.rs:14:24
+   |
+LL | fn siphash<T>() {
+   |            - 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<T>`
+
+error[E0401]: can't use type parameters from outer function
+  --> $DIR/issue-3021-c.rs:14:30
+   |
+LL | fn siphash<T>() {
+   |            - 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<T>`
+
+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 (file)
index 0000000..c23e12e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ab5ad94
--- /dev/null
@@ -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 (file)
index 0000000..f93a333
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..312b9f3
--- /dev/null
@@ -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 (file)
index 0000000..7acbbfb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<U,V> : Sized {
+    fn foo(self, u: Option<U>, v: Option<V>) {}
+}
+
+struct A;
+struct B;
+
+impl Foo<A, B> for () {}      // impl A
+impl Foo<u32, u32> 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 (file)
index 0000000..b3bbf23
--- /dev/null
@@ -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 (file)
index 0000000..45a5cd0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3a9f075
--- /dev/null
@@ -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 (file)
index 0000000..cf6935b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..535d1a9
--- /dev/null
@@ -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 (file)
index 0000000..60fb307
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9acb53f
--- /dev/null
@@ -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 (file)
index 0000000..e565ad5
--- /dev/null
@@ -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 (file)
index 0000000..ee19d04
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7e84368
--- /dev/null
@@ -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 (file)
index 0000000..1eec62d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..17ad993
--- /dev/null
@@ -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 (file)
index 0000000..2d27cd5
--- /dev/null
@@ -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 (file)
index 0000000..441815d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<usize> 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 (file)
index 0000000..5f4a51a
--- /dev/null
@@ -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 (file)
index 0000000..981b196
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<usize> 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 (file)
index 0000000..651ff9f
--- /dev/null
@@ -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 (file)
index 0000000..0bfac13
--- /dev/null
@@ -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 <Test<'z> 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 (file)
index 0000000..2b4d0dc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 <Test<'z> 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 (file)
index 0000000..dc6e1c5
--- /dev/null
@@ -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 <Test<'z> 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 (file)
index 0000000..0b1afd7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..cb38c0d
--- /dev/null
@@ -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 (file)
index 0000000..61721fe
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8174af8
--- /dev/null
@@ -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 (file)
index 0000000..fb16dad
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3a966e3
--- /dev/null
@@ -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 (file)
index 0000000..62c2639
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..783e831
--- /dev/null
@@ -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 (file)
index 0000000..2d1ad9a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6031f25
--- /dev/null
@@ -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 (file)
index 0000000..db60d70
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6a19459
--- /dev/null
@@ -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 (file)
index 0000000..956d218
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..226d99e
--- /dev/null
@@ -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 (file)
index 0000000..4276653
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a5f29e7
--- /dev/null
@@ -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 (file)
index 0000000..716b0bb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>(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 (file)
index 0000000..c2e7c98
--- /dev/null
@@ -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 (file)
index 0000000..74121e3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c66a4f0
--- /dev/null
@@ -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 (file)
index 0000000..fb1e3cc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u8>) {
+    let mut found_e = false;
+
+    let temp: Vec<u8> = 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 (file)
index 0000000..e2630b5
--- /dev/null
@@ -0,0 +1,23 @@
+error[E0271]: type mismatch resolving `<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [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<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [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<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:16:39: 19:6 found_e:_]>> : std::iter::Iterator`
+           `&mut std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [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 (file)
index 0000000..8dc58ee
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..17cf2e8
--- /dev/null
@@ -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 (file)
index 0000000..794b8bb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..dd1af2f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7d4c942
--- /dev/null
@@ -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 (file)
index 0000000..4420f9d
--- /dev/null
@@ -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 (file)
index 0000000..519e9d0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..cc0cfd7
--- /dev/null
@@ -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 (file)
index 0000000..f8645c4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4608a95
--- /dev/null
@@ -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 (file)
index 0000000..2bd45de
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1f1904e
--- /dev/null
@@ -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 (file)
index 0000000..cea52b1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e0ac2f6
--- /dev/null
@@ -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 (file)
index 0000000..514255e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9fb8f2e
--- /dev/null
@@ -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 (file)
index 0000000..7524049
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+
+enum Enum<T: Trait> {
+    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 (file)
index 0000000..da5aa15
--- /dev/null
@@ -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 (file)
index 0000000..d9ce115
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2aaaa15
--- /dev/null
@@ -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 (file)
index 0000000..7e1f4c2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c409d4b
--- /dev/null
@@ -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 (file)
index 0000000..dd236b7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..28d2170
--- /dev/null
@@ -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 (file)
index 0000000..e630a01
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..04276ec
--- /dev/null
@@ -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 (file)
index 0000000..9a769c3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo<T>() {
+    struct foo {
+        x: T, //~ ERROR can't use type parameters from outer function
+    }
+
+    impl<T> Drop for foo<T> {
+        //~^ 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 (file)
index 0000000..1298e4a
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0401]: can't use type parameters from outer function
+  --> $DIR/issue-3214.rs:13:12
+   |
+LL | fn foo<T>() {
+   |    --- - 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<T> Drop for foo<T> {
+   |                      ^^^^^^ 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 (file)
index 0000000..bf9f8ec
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..986c2f0
--- /dev/null
@@ -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 (file)
index 0000000..b3b34f4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ba2c539
--- /dev/null
@@ -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 (file)
index 0000000..e5cb813
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>>() -> <T as 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 (file)
index 0000000..09ac155
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-32323.rs:15:49
+   |
+LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
+   |                                                 ^^ expected associated type, found ()
+   |
+   = note: expected type `<T as Tr<'a>>::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 (file)
index 0000000..5091ba4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<U: Foo> {
+    stream: PhantomData<U::Error>,
+}
+
+fn foo<U: Foo>(x: [usize; 2]) -> Bar<U> {
+    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 (file)
index 0000000..a069888
--- /dev/null
@@ -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<U> (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 (file)
index 0000000..25ecd5d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a132380
--- /dev/null
@@ -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 (file)
index 0000000..0953881
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<i32, ()> {
+    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 (file)
index 0000000..8da4be2
--- /dev/null
@@ -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 (file)
index 0000000..696ea0e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8b48600
--- /dev/null
@@ -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 (file)
index 0000000..2c54ed3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8e1430e
--- /dev/null
@@ -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 (file)
index 0000000..9ac7088
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..fc7d356
--- /dev/null
@@ -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 (file)
index 0000000..41383e9
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..11af5d5
--- /dev/null
@@ -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 (file)
index 0000000..317a471
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c1e80b0
--- /dev/null
@@ -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 (file)
index 0000000..24db822
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
+
+fn main() {
+    size_of_copy::<Misc+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 (file)
index 0000000..dff7c9f
--- /dev/null
@@ -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::<Misc+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::<Misc+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<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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 (file)
index 0000000..18424fc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(unused)]
+
+fn main() {
+    { fn f<X: ::std::marker()::Send>() {} }
+    //~^ 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 (file)
index 0000000..68eda14
--- /dev/null
@@ -0,0 +1,30 @@
+error: parenthesized parameters may only be used with a trait
+  --> $DIR/issue-32995-2.rs:14:28
+   |
+LL |     { fn f<X: ::std::marker()::Send>() {} }
+   |                            ^^
+   |
+   = 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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 (file)
index 0000000..ffbd0c0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Send + ::std::marker()::Sync> = Box::new(1);
+    //~^ ERROR parenthesized parameters may only be used with a trait
+    //~| WARN previously accepted
+}
+
+fn foo<X:Default>() {
+    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 (file)
index 0000000..f427964
--- /dev/null
@@ -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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/42238>
+
+error: parenthesized parameters may only be used with a trait
+  --> $DIR/issue-32995.rs:34:37
+   |
+LL |     let o : Box<Send + ::std::marker()::Sync> = 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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 (file)
index 0000000..6a411b4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>() -> 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 (file)
index 0000000..1b6577d
--- /dev/null
@@ -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 (file)
index 0000000..bed577b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e94979b
--- /dev/null
@@ -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 (file)
index 0000000..73532cb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..eb6caa7
--- /dev/null
@@ -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<std::cmp::Ordering>`
+
+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 (file)
index 0000000..b7dbaf2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b70fff0
--- /dev/null
@@ -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 (file)
index 0000000..1e19943
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ecf8076
--- /dev/null
@@ -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 (file)
index 0000000..5dfc41c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..be45f37
--- /dev/null
@@ -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 (file)
index 0000000..8872820
--- /dev/null
@@ -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 (file)
index 0000000..499e7e5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bb8a542
--- /dev/null
@@ -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 (file)
index 0000000..117ab18
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b715fa8
--- /dev/null
@@ -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 (file)
index 0000000..30dd34a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..cb8cfbd
--- /dev/null
@@ -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 (file)
index 0000000..6c85414
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ef68d41
--- /dev/null
@@ -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 (file)
index 0000000..a752a36
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..240df19
--- /dev/null
@@ -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 (file)
index 0000000..5917531
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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: 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 (file)
index 0000000..8683962
--- /dev/null
@@ -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 (file)
index 0000000..4d7238a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(warnings)]
+
+trait Trait<T> {
+    fn foo(_: T) {}
+}
+
+pub struct Foo<T = Box<Trait<DefaultFoo>>>;  //~ 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 (file)
index 0000000..ea80111
--- /dev/null
@@ -0,0 +1,16 @@
+error[E0391]: cycle detected when processing `Foo::T`
+  --> $DIR/issue-34373.rs:17:30
+   |
+LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;  //~ 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 (file)
index 0000000..6bc0add
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4cb5ec1
--- /dev/null
@@ -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 (file)
index 0000000..0bad737
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4207828
--- /dev/null
@@ -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 (file)
index 0000000..be7e782
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..538cc7a
--- /dev/null
@@ -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 (file)
index 0000000..9943cfb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Bar<T> {
+    inner: Foo<T> //~ ERROR cannot find type `Foo` in this scope
+}
+
+enum Baz<T> {
+    Foo(Foo<T>) //~ 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 (file)
index 0000000..9b2f17f
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0412]: cannot find type `Foo` in this scope
+  --> $DIR/issue-35075.rs:12:12
+   |
+LL |     inner: Foo<T> //~ 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<T>) //~ 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 (file)
index 0000000..1742cb4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..07c37fa
--- /dev/null
@@ -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 (file)
index 0000000..78af11a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f4a1ef5
--- /dev/null
@@ -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 (file)
index 0000000..5f54f26
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b8fc7d2
--- /dev/null
@@ -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 (file)
index 0000000..092bf00
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {}
+trait Trait2<'a> {
+  type Ty;
+}
+
+fn _ice(param: Box<for <'a> 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 (file)
index 0000000..349693f
--- /dev/null
@@ -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 (file)
index 0000000..17fd77b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Item=&'a T> {
+    a.iter().map(|a| a*a)
+    //~^ ERROR binary operation `*` cannot be applied to type `&T`
+}
+
+fn main() {
+    let a = (0..30).collect::<Vec<_>>();
+
+    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 (file)
index 0000000..51d6b04
--- /dev/null
@@ -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 (file)
index 0000000..5909322
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum E {
+    V([Box<E>]),
+    //~^ 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 (file)
index 0000000..35452fc
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0277]: the size for values of type `[std::boxed::Box<E>]` cannot be known at compilation time
+  --> $DIR/issue-35988.rs:12:7
+   |
+LL |     V([Box<E>]),
+   |       ^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `std::marker::Sized` is not implemented for `[std::boxed::Box<E>]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..cc69a76
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String>
+}
+
+struct ElementData {
+    kind: Box<ElementKind>
+}
+
+enum ElementKind {
+    HTMLImageElement(HTMLImageData)
+}
+
+enum NodeKind {
+    Element(ElementData)
+}
+
+struct NodeData {
+    kind: Box<NodeKind>,
+}
+
+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 (file)
index 0000000..6c28ccb
--- /dev/null
@@ -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 (file)
index 0000000..cf280bd
--- /dev/null
@@ -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 (file)
index 0000000..b79958d
--- /dev/null
@@ -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 (file)
index 0000000..cf280bd
--- /dev/null
@@ -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 (file)
index 0000000..ed6a2f8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3afbfa6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {
+    _a: T,
+}
+
+struct S<T>(T);
+
+fn f() {
+    let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>); //~ WARN unnecessary path disambiguator
+    let g: Foo::<i32> = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator
+
+    m!(S::<u8>); // 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 (file)
index 0000000..df69dcb
--- /dev/null
@@ -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::<i32>); //~ WARN unnecessary path disambiguator
+   |                                                  ^^ try removing `::`
+
+warning: unnecessary path disambiguator
+  --> $DIR/issue-36116.rs:31:15
+   |
+LL |     let g: Foo::<i32> = 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 (file)
index 0000000..88ac74c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..faa2025
--- /dev/null
@@ -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 (file)
index 0000000..b207658
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b06591f
--- /dev/null
@@ -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 (file)
index 0000000..9f5eeb1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..efd5823
--- /dev/null
@@ -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 (file)
index 0000000..5e43536
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>(Self);
+//~^ ERROR expected identifier, found keyword `Self`
+
+trait Bar<Self> {}
+//~^ 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 (file)
index 0000000..d111fb4
--- /dev/null
@@ -0,0 +1,14 @@
+error: expected identifier, found keyword `Self`
+  --> $DIR/issue-36638.rs:13:12
+   |
+LL | struct Foo<Self>(Self);
+   |            ^^^^ expected identifier, found keyword
+
+error: expected identifier, found keyword `Self`
+  --> $DIR/issue-36638.rs:16:11
+   |
+LL | trait Bar<Self> {}
+   |           ^^^^ 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 (file)
index 0000000..fe46877
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e78a279
--- /dev/null
@@ -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 (file)
index 0000000..00f6441
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct P { child: Option<Box<P>> }
+trait PTrait {
+   fn getChildOption(&self) -> Option<Box<P>>;
+}
+
+impl PTrait for P {
+   fn getChildOption(&self) -> Option<Box<P>> {
+       static childVal: Box<P> = 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 (file)
index 0000000..73eaf57
--- /dev/null
@@ -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<P> = 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 (file)
index 0000000..e698e6d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4fea478
--- /dev/null
@@ -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 (file)
index 0000000..3e34b25
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> Broken for T {
+    type Assoc = ();
+    fn broken(&self) where Self::Assoc: Foo {
+        let _x: <Self::Assoc as Foo>::Bar;
+    }
+}
+
+#[rustc_error]
+fn main() { //~ ERROR compilation successful
+    let _m: &Broken<Assoc=()> = &();
+}
diff --git a/src/test/ui/issue-36839.stderr b/src/test/ui/issue-36839.stderr
new file mode 100644 (file)
index 0000000..dd78668
--- /dev/null
@@ -0,0 +1,10 @@
+error: compilation successful
+  --> $DIR/issue-36839.rs:30:1
+   |
+LL | / fn main() { //~ ERROR compilation successful
+LL | |     let _m: &Broken<Assoc=()> = &();
+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 (file)
index 0000000..325f058
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9ec400d
--- /dev/null
@@ -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 (file)
index 0000000..95fd5d1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c53ec5b
--- /dev/null
@@ -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 (file)
index 0000000..ab08e18
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Self::NextState>;
+}
+
+struct StateMachineEnded;
+
+impl State for StateMachineEnded {
+    fn execute(self) -> Option<Self::NextState> {
+        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 (file)
index 0000000..b040408
--- /dev/null
@@ -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 (file)
index 0000000..ad56b12
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c6d28fe
--- /dev/null
@@ -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 (file)
index 0000000..98806cd
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a83923a
--- /dev/null
@@ -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 (file)
index 0000000..2a4808f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8667fec
--- /dev/null
@@ -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 (file)
index 0000000..53c91f3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..48db0d5
--- /dev/null
@@ -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 (file)
index 0000000..d5733f9
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..68e983f
--- /dev/null
@@ -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 (file)
index 0000000..70c8f92
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Foo<T: ?Hash> { }
+//~^ 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 (file)
index 0000000..c4fc9db
--- /dev/null
@@ -0,0 +1,28 @@
+error[E0405]: cannot find trait `Hash` in this scope
+  --> $DIR/issue-37534.rs:11:16
+   |
+LL | struct Foo<T: ?Hash> { }
+   |                ^^^^ 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<T: ?Hash> { }
+   |            ^
+
+error[E0392]: parameter `T` is never used
+  --> $DIR/issue-37534.rs:11:12
+   |
+LL | struct Foo<T: ?Hash> { }
+   |            ^ 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 (file)
index 0000000..af1f6ef
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7468510
--- /dev/null
@@ -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 (file)
index 0000000..e3c1ada
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b663c8b
--- /dev/null
@@ -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 (file)
index 0000000..851f5df
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0dd7d68
--- /dev/null
@@ -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 (file)
index 0000000..81ed437
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..cdf9129
--- /dev/null
@@ -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 (file)
index 0000000..f120bbb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8448466
--- /dev/null
@@ -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 (file)
index 0000000..311d0ce
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1277d84
--- /dev/null
@@ -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 (file)
index 0000000..28de76f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..cdd14e9
--- /dev/null
@@ -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 (file)
index 0000000..1867baf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..73f5425
--- /dev/null
@@ -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 (file)
index 0000000..6b7dde1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..baa6338
--- /dev/null
@@ -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 (file)
index 0000000..a2b0d0a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait A<T>: std::ops::Add<Self> + Sized {}
+trait B<T>: A<T> {}
+trait C<T>: A<B<T, Output=usize>> {}
+//~^ 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 (file)
index 0000000..ac55be7
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0038]: the trait `B` cannot be made into an object
+  --> $DIR/issue-38404.rs:13:15
+   |
+LL | trait C<T>: A<B<T, Output=usize>> {}
+   |               ^^^^^^^^^^^^^^^^^^ 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 (file)
index 0000000..b4feadb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9685143
--- /dev/null
@@ -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 (file)
index 0000000..56eb5f8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d870da6
--- /dev/null
@@ -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 (file)
index 0000000..c1939a7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Q<T:?Sized> {}
+trait Foo where u32: Q<Self> {
+    fn foo(&self);
+}
+
+impl Q<()> for u32 {}
+impl Foo for () {
+    fn foo(&self) {
+        println!("foo!");
+    }
+}
+
+fn main() {
+    let _f: Box<Foo> = //~ 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 (file)
index 0000000..78aee91
--- /dev/null
@@ -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<Foo> = //~ 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<std::boxed::Box<dyn Foo>>` 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 (file)
index 0000000..b38b1b9
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..985927c
--- /dev/null
@@ -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 (file)
index 0000000..c7e1da7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub struct List<T> {
+    head: T,
+}
+
+impl Drop for List<i32> { //~ 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 (file)
index 0000000..3a8ffe7
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0366]: Implementations of Drop cannot be specialized
+  --> $DIR/issue-38868.rs:15:1
+   |
+LL | / impl Drop for List<i32> { //~ 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<T> {
+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 (file)
index 0000000..e6cee4a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo<T: Iterator>() {
+    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 (file)
index 0000000..b80367d
--- /dev/null
@@ -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 (file)
index 0000000..7f01ed3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f9c3803
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+
+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 (file)
index 0000000..96ba1c8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<M: Mat>() {
+    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 (file)
index 0000000..6859c6c
--- /dev/null
@@ -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 (file)
index 0000000..9d8abbf
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3e61355
--- /dev/null
@@ -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 (file)
index 0000000..6da0493
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a38d38a
--- /dev/null
@@ -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 (file)
index 0000000..56bfe27
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..435a03c
--- /dev/null
@@ -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 <https://github.com/rust-lang/rust/issues/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 (file)
index 0000000..f01fd1f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..91520a7
--- /dev/null
@@ -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 `<Dim3 as Dim>::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 `<Dim3 as Dim>::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 (file)
index 0000000..2da21fb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T, D: Dim> {
+    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 (file)
index 0000000..2ce6dfd
--- /dev/null
@@ -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 (file)
index 0000000..13b4c08
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..eebf47a
--- /dev/null
@@ -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 (file)
index 0000000..404465e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(fn_traits)]
+
+fn main() {
+    <fn() as Fn()>::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 (file)
index 0000000..9f8d091
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+  --> $DIR/issue-39687.rs:14:16
+   |
+LL |     <fn() as Fn()>::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 (file)
index 0000000..67a934f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9be0761
--- /dev/null
@@ -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 (file)
index 0000000..d5ca009
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9ca39db
--- /dev/null
@@ -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 (file)
index 0000000..fae5eb5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4b569f2
--- /dev/null
@@ -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 (file)
index 0000000..65ea1ba
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..397d7b8
--- /dev/null
@@ -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 (file)
index 0000000..6f6b775
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ddd149c
--- /dev/null
@@ -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 (file)
index 0000000..7daf4bc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Fn(&i32)>) {}
+    let bar = Box::new(|x: &i32| {}) as Box<Fn(_)>;
+    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 (file)
index 0000000..26e52a7
--- /dev/null
@@ -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<dyn std::ops::Fn(_)>`
+
+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 (file)
index 0000000..fcff5c6
--- /dev/null
@@ -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 (file)
index 0000000..e16a7ec
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn prove_static<T: 'static + ?Sized>(_: &'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<T, U: ?Sized> {
+    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 (file)
index 0000000..d2313ef
--- /dev/null
@@ -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 (file)
index 0000000..bd4efa1
--- /dev/null
@@ -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 (file)
index 0000000..b5418e8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e69c3bc
--- /dev/null
@@ -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 (file)
index 0000000..39249ee
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ad85bf2
--- /dev/null
@@ -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 (file)
index 0000000..73a8d58
--- /dev/null
@@ -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 (file)
index 0000000..142092f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1f5a41f
--- /dev/null
@@ -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 (file)
index 0000000..0fe5658
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..03998af
--- /dev/null
@@ -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 (file)
index 0000000..4133c69
--- /dev/null
@@ -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 (file)
index 0000000..afa8f15
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..c77b5cc
--- /dev/null
@@ -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 (file)
index 0000000..a39c500
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1f3cd00
--- /dev/null
@@ -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 (file)
index 0000000..aec20b4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..faf1a4d
--- /dev/null
@@ -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 (file)
index 0000000..261ed49
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b76d469
--- /dev/null
@@ -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 (file)
index 0000000..c5604a0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2e8f008
--- /dev/null
@@ -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 (file)
index 0000000..75d58c5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..dbde40f
--- /dev/null
@@ -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 (file)
index 0000000..3f79c66
--- /dev/null
@@ -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 (file)
index 0000000..0509a43
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9d0e19d
--- /dev/null
@@ -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 (file)
index 0000000..5d7546e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..889da66
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+
+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 (file)
index 0000000..29912de
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..03100b6
--- /dev/null
@@ -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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 (file)
index 0000000..89f11ed
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9e4afb3
--- /dev/null
@@ -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 (file)
index 0000000..feeb63e
--- /dev/null
@@ -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 (file)
index 0000000..c8cd920
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String, Vec<String>> = 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 (file)
index 0000000..1723095
--- /dev/null
@@ -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 (file)
index 0000000..067531e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u32> for H {
+    type Output = S;
+    fn index(&self, index: u32) -> &S {
+        unimplemented!()
+    }
+}
+
+impl IndexMut<u32> 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 (file)
index 0000000..314b44f
--- /dev/null
@@ -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 (file)
index 0000000..5f108e0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9742f09
--- /dev/null
@@ -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 (file)
index 0000000..23a2b78
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn iterate<T, F>(initial: T, f: F) -> Iterate<T, F> {
+    Iterate {
+        state: initial,
+        f: f,
+    }
+}
+
+pub struct Iterate<T, F> {
+    state: T,
+    f: F
+}
+
+impl<T: Clone, F> Iterator for Iterate<T, F> where F: Fn(&T) -> T {
+    type Item = T;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        self.state = (self.f)(&self.state);
+        Some(self.state.clone())
+    }
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) { (std::usize::MAX, None) }
+}
+
+fn main() {
+    let a = iterate(0, |x| x+1);
+    println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
+    //~^ 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 (file)
index 0000000..fa9fdbd
--- /dev/null
@@ -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<T, F> {
+   | ------------------------ method `iter` not found for this
+...
+LL |     println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
+   |                        ^^^^
+
+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 (file)
index 0000000..5c90777
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> 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 (file)
index 0000000..eca40ed
--- /dev/null
@@ -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<T> Drop for T where T: A { //~ ERROR E0119
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `alloc`:
+           - impl<T> std::ops::Drop for std::boxed::Box<T>
+             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<T> 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<T>`)
+  --> $DIR/issue-41974.rs:17:1
+   |
+LL | impl<T> 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 (file)
index 0000000..406aadc
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e757c7f
--- /dev/null
@@ -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 (file)
index 0000000..b1f668d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..40de077
--- /dev/null
@@ -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 (file)
index 0000000..f770529
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ae6496c
--- /dev/null
@@ -0,0 +1,22 @@
+error[E0277]: the size for values of type `<Self as std::ops::Deref>::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 `<Self as std::ops::Deref>::Target`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = help: consider adding a `where <Self as std::ops::Deref>::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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+
+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 (file)
index 0000000..02f6ffe
--- /dev/null
@@ -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 (file)
index 0000000..2f11ff4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..92bbe70
--- /dev/null
@@ -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 (file)
index 0000000..62db68d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8f22c67
--- /dev/null
@@ -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 (file)
index 0000000..7547c4a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9143906
--- /dev/null
@@ -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 (file)
index 0000000..fda7cf9
--- /dev/null
@@ -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 (file)
index 0000000..b07c23c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Mirror<Smoke> {
+    type Image;
+}
+
+impl<T, Smoke> Mirror<Smoke> for T {
+    type Image = T;
+}
+
+pub fn poison<S>(victim: String) where <String as Mirror<S>>::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 (file)
index 0000000..9c2481b
--- /dev/null
@@ -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 (file)
index 0000000..ebb1ec4
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Value> = 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 (file)
index 0000000..cf1c302
--- /dev/null
@@ -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 (file)
index 0000000..6a5f7a1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2aa1efa
--- /dev/null
@@ -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 (file)
index 0000000..8a04711
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..18da931
--- /dev/null
@@ -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 (file)
index 0000000..b236283
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..4b3b463
--- /dev/null
@@ -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 (file)
index 0000000..d589680
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..db52cd5
--- /dev/null
@@ -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 (file)
index 0000000..e1d34f3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a05d4d4
--- /dev/null
@@ -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 (file)
index 0000000..d793a78
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Trait1<X> {
+    type Output;
+}
+
+pub trait Trait2<X> {}
+
+pub struct A;
+
+impl<X, T> Trait1<X> for T where T: Trait2<X> {
+    type Output = ();
+}
+
+impl<X> Trait1<Box<X>> for A {
+//~^ ERROR conflicting implementations of trait
+//~| hard error
+//~| downstream crates may implement trait `Trait2<std::boxed::Box<_>>` 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 (file)
index 0000000..dbcf1b5
--- /dev/null
@@ -0,0 +1,16 @@
+error: conflicting implementations of trait `Trait1<std::boxed::Box<_>>` for type `A`: (E0119)
+  --> $DIR/issue-43355.rs:23:1
+   |
+LL | impl<X, T> Trait1<X> for T where T: Trait2<X> {
+   | --------------------------------------------- first implementation here
+...
+LL | impl<X> Trait1<Box<X>> 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 <https://github.com/rust-lang/rust/issues/46205>
+   = note: downstream crates may implement trait `Trait2<std::boxed::Box<_>>` 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 (file)
index 0000000..431fc8a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<u8>); //~ 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 (file)
index 0000000..3a9a316
--- /dev/null
@@ -0,0 +1,8 @@
+error: unexpected generic arguments in path
+  --> $DIR/issue-43424.rs:20:4
+   |
+LL | m!(inline<u8>); //~ 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 (file)
index 0000000..1e6366e
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(fn_traits)]
+
+trait CallSingle<A, B> {
+    fn call(&self, a: A) -> B where Self: Sized, Self: Fn(A) -> B;
+}
+
+impl<A, B, F: Fn(A) -> B> CallSingle<A, B> for F {
+    fn call(&self, a: A) -> B {
+        <Self as Fn(A) -> 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 (file)
index 0000000..3eb8fac
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+  --> $DIR/issue-43431.rs:19:27
+   |
+LL |         <Self as Fn(A) -> 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 (file)
index 0000000..33abc19
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1c9a9eb
--- /dev/null
@@ -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 (file)
index 0000000..47fd426
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e78aec9
--- /dev/null
@@ -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 (file)
index 0000000..a5ba9ef
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> {
+    _data: std::cell::UnsafeCell<Option<T>>,
+    _flag: std::cell::Cell<bool>,
+}
+
+#[cfg(not(target_thread_local))]
+impl<T> Key<T> {
+    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<std::option::Option<()>>` cannot be shared between threads
+//~| ERROR `std::cell::Cell<bool>` 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 (file)
index 0000000..8eb150f
--- /dev/null
@@ -0,0 +1,23 @@
+error[E0277]: `std::cell::UnsafeCell<std::option::Option<()>>` cannot be shared between threads safely
+  --> $DIR/issue-43733-2.rs:35:1
+   |
+LL | static __KEY: Key<()> = Key::new();
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<std::option::Option<()>>` cannot be shared between threads safely
+   |
+   = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<std::option::Option<()>>`
+   = 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<bool>` cannot be shared between threads safely
+  --> $DIR/issue-43733-2.rs:35:1
+   |
+LL | static __KEY: Key<()> = Key::new();
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::Cell<bool>` cannot be shared between threads safely
+   |
+   = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<bool>`
+   = 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 (file)
index 0000000..7b1364f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<String>;
+
+#[cfg(target_thread_local)]
+#[thread_local]
+static __KEY: std::thread::__FastLocalKeyInner<Foo> =
+    std::thread::__FastLocalKeyInner::new();
+
+#[cfg(not(target_thread_local))]
+static __KEY: std::thread::__OsLocalKeyInner<Foo> =
+    std::thread::__OsLocalKeyInner::new();
+
+fn __getit() -> std::option::Option<
+    &'static std::cell::UnsafeCell<
+        std::option::Option<Foo>>>
+{
+    __KEY.get() //~ ERROR call to unsafe function is unsafe
+}
+
+static FOO: std::thread::LocalKey<Foo> =
+    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 (file)
index 0000000..5f91d3d
--- /dev/null
@@ -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 (file)
index 0000000..94b5c00
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Partial<X: ?Sized>: Copy {
+}
+
+pub trait Complete {
+    type Assoc: Partial<Self>;
+}
+
+impl<T> Partial<T> for T::Assoc where
+    T: Complete
+{
+}
+
+impl<T> 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 (file)
index 0000000..798d8c6
--- /dev/null
@@ -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<T> 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 (file)
index 0000000..e70df11
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> Partial for T where T: Complete {}
+impl<T> 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 (file)
index 0000000..8646b31
--- /dev/null
@@ -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<T> 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 (file)
index 0000000..8ad5764
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..995289a
--- /dev/null
@@ -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 (file)
index 0000000..5d510b6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9719a87
--- /dev/null
@@ -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 (file)
index 0000000..6361af7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7237851
--- /dev/null
@@ -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 <https://doc.rust-lang.org/reference/type-layout.html>
+
+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 <https://doc.rust-lang.org/reference/type-layout.html>
+
+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 (file)
index 0000000..b6ec21b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2c74531
--- /dev/null
@@ -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 (file)
index 0000000..131c652
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..43d4968
--- /dev/null
@@ -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 (file)
index 0000000..d744ad1
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..17a634b
--- /dev/null
@@ -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 (file)
index 0000000..5d29551
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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::<Foo>() }],
+    x: usize,
+}
+
+fn main() {}
diff --git a/src/test/ui/issue-44415.stderr b/src/test/ui/issue-44415.stderr
new file mode 100644 (file)
index 0000000..ac2072c
--- /dev/null
@@ -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::<Foo>() }],
+   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = 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::<Foo>() }],
+   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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 (file)
index 0000000..5af0bf6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..8a96783
--- /dev/null
@@ -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 (file)
index 0000000..fbd8972
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..ca96c39
--- /dev/null
@@ -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 (file)
index 0000000..ce39776
--- /dev/null
@@ -0,0 +1,36 @@
+error[E0384]: cannot assign twice to immutable variable `b`
+  --> $DIR/issue-45199.rs:19:5
+   |
+LL |     let b: Box<isize>;
+   |         - 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<i32>) {  //[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 (file)
index 0000000..ff8f78b
--- /dev/null
@@ -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<i32>) {  //[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 (file)
index 0000000..ce39776
--- /dev/null
@@ -0,0 +1,36 @@
+error[E0384]: cannot assign twice to immutable variable `b`
+  --> $DIR/issue-45199.rs:19:5
+   |
+LL |     let b: Box<isize>;
+   |         - 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<i32>) {  //[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 (file)
index 0000000..61e19ff
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<isize>;
+    //[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<i32>) {  //[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 (file)
index 0000000..b42ced0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3fad520
--- /dev/null
@@ -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 (file)
index 0000000..7823a7d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Params;
+
+pub trait Plugin<E: ?Sized> {
+    type Error;
+}
+
+pub trait Pluggable {
+    fn get_ref<P: Plugin<Self>>(&mut self) -> Option<P::Error> {
+        None
+    }
+}
+
+struct Foo;
+impl Plugin<Foo> for Params {
+    type Error = ();
+}
+
+impl<T: Copy> Pluggable for T {}
+
+fn handle(req: &mut i32) {
+    req.get_ref::<Params>();
+    //~^ ERROR the trait bound `Params: Plugin<i32>` 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 (file)
index 0000000..91c14be
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0277]: the trait bound `Params: Plugin<i32>` is not satisfied
+  --> $DIR/issue-45801.rs:31:9
+   |
+LL |     req.get_ref::<Params>();
+   |         ^^^^^^^ the trait `Plugin<i32>` is not implemented for `Params`
+   |
+   = help: the following implementations were found:
+             <Params as Plugin<Foo>>
+
+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 (file)
index 0000000..0b82f2b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2b3870f
--- /dev/null
@@ -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 (file)
index 0000000..2fc2924
--- /dev/null
@@ -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 (file)
index 0000000..42fe73d
--- /dev/null
@@ -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 (file)
index 0000000..2fc2924
--- /dev/null
@@ -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 (file)
index 0000000..d51d925
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b5cdded
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e0df49f
--- /dev/null
@@ -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 (file)
index 0000000..82f55f2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..790399c
--- /dev/null
@@ -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 (file)
index 0000000..d84b581
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b0d6229
--- /dev/null
@@ -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 (file)
index 0000000..b947bec
--- /dev/null
@@ -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 (file)
index 0000000..713ba47
--- /dev/null
@@ -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 (file)
index 0000000..b947bec
--- /dev/null
@@ -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 (file)
index 0000000..dc14eca
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T: AsRef<[u8]>>(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 (file)
index 0000000..f8bcd88
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..0d57d61
--- /dev/null
@@ -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 (file)
index 0000000..d88b4e5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9b752f4
--- /dev/null
@@ -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 (file)
index 0000000..1b9ff36
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1980307
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6c0acc0
--- /dev/null
@@ -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 (file)
index 0000000..683ef87
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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::<Void>();
+    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 (file)
index 0000000..6ca4040
--- /dev/null
@@ -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 (file)
index 0000000..b6b720f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {}
+
+trait Bar<T> {}
+
+trait Iterable {
+    type Item;
+}
+
+struct Container<T: Iterable<Item = impl Foo>> {
+    //~^ ERROR `impl Trait` not allowed
+    field: T
+}
+
+enum Enum<T: Iterable<Item = impl Foo>> {
+    //~^ ERROR `impl Trait` not allowed
+    A(T),
+}
+
+union Union<T: Iterable<Item = impl Foo> + Copy> {
+    //~^ ERROR `impl Trait` not allowed
+    x: T,
+}
+
+type Type<T: Iterable<Item = impl Foo>> = 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 (file)
index 0000000..29b6afe
--- /dev/null
@@ -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<T: Iterable<Item = impl Foo>> {
+   |                                     ^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/issue-47715.rs:24:30
+   |
+LL | enum Enum<T: Iterable<Item = impl Foo>> {
+   |                              ^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/issue-47715.rs:29:32
+   |
+LL | union Union<T: Iterable<Item = impl Foo> + 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: Iterable<Item = impl Foo>> = 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 (file)
index 0000000..9eb567a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d0ba1a1
--- /dev/null
@@ -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 (file)
index 0000000..ab52a32
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2c7e682
--- /dev/null
@@ -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 (file)
index 0000000..77588e5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a9d58ed
--- /dev/null
@@ -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 (file)
index 0000000..f384dba
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<MyTrait+'static>),
+}
+
+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 (file)
index 0000000..e9c1bdb
--- /dev/null
@@ -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 (file)
index 0000000..ce29471
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6169a77
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..a72dbac
--- /dev/null
@@ -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 (file)
index 0000000..ebfa497
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..988c5c1
--- /dev/null
@@ -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 (file)
index 0000000..267362f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2ea3ea5
--- /dev/null
@@ -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 (file)
index 0000000..ff45cf6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..094b0e1
--- /dev/null
@@ -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 (file)
index 0000000..1bb6f34
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..26a26f7
--- /dev/null
@@ -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 (file)
index 0000000..9ef780a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..6f5a849
--- /dev/null
@@ -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 (file)
index 0000000..9b49886
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {
+    fn foo(self: Box<Self>);
+}
+
+impl Foo for isize {
+    fn foo(self: Box<isize>) { }
+}
+
+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 (file)
index 0000000..6f8dce1
--- /dev/null
@@ -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 (file)
index 0000000..8142457
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn f() { }
+struct S(Box<FnMut()>);
+pub static C: S = S(f); //~ ERROR mismatched types
+
+
+fn g() { }
+type T = Box<FnMut()>;
+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 (file)
index 0000000..7ea3297
--- /dev/null
@@ -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 (file)
index 0000000..c288cf9
--- /dev/null
@@ -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 (file)
index 0000000..810379c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3c65088
--- /dev/null
@@ -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 (file)
index 0000000..d8aad54
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Either<T, U> { Left(T), Right(U) }
+struct S(Either<usize, usize>);
+
+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 (file)
index 0000000..abaea46
--- /dev/null
@@ -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 (file)
index 0000000..4e618f3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<Foo> {
+        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 (file)
index 0000000..87e20f3
--- /dev/null
@@ -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 (file)
index 0000000..a91f5d2
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..43ce369
--- /dev/null
@@ -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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
+   = 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 (file)
index 0000000..bb802f3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f8b9b15
--- /dev/null
@@ -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 (file)
index 0000000..463fdaa
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn f<Z>() -> bool {
+    enum E { V(Z) }
+    //~^ ERROR can't use type parameters from outer function
+    true
+}
+
+fn main() {
+    let b = f::<isize>();
+    assert!(b);
+}
diff --git a/src/test/ui/issue-5997-enum.stderr b/src/test/ui/issue-5997-enum.stderr
new file mode 100644 (file)
index 0000000..9f26f65
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0401]: can't use type parameters from outer function
+  --> $DIR/issue-5997-enum.rs:12:16
+   |
+LL | fn f<Z>() -> 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 (file)
index 0000000..af9e66b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn f<T>() -> bool {
+    struct S(T); //~ ERROR can't use type parameters from outer function
+
+    true
+}
+
+fn main() {
+    let b = f::<isize>();
+    assert!(b);
+}
diff --git a/src/test/ui/issue-5997-struct.stderr b/src/test/ui/issue-5997-struct.stderr
new file mode 100644 (file)
index 0000000..fd6d67b
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0401]: can't use type parameters from outer function
+  --> $DIR/issue-5997-struct.rs:12:14
+   |
+LL | fn f<T>() -> 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 (file)
index 0000000..87cf2b3
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..e192c2c
--- /dev/null
@@ -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 (file)
index 0000000..ce8a3a8
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b7055ab
--- /dev/null
@@ -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 (file)
index 0000000..3e18de6
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..f2ed17f
--- /dev/null
@@ -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 (file)
index 0000000..1fe10ba
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1762af5
--- /dev/null
@@ -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 (file)
index 0000000..447d0e0
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Foo<T> {
+    x: T,
+}
+impl<T> Foo<T> {
+    fn add(&mut self, v: Foo<T>){
+        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 (file)
index 0000000..8c0aff9
--- /dev/null
@@ -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 (file)
index 0000000..5436397
--- /dev/null
@@ -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 (file)
index 0000000..792d27c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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>) -> usize {
+     *x * 2
+}
+
+fn invoke<F>(f: F) where F: FnOnce() -> usize {
+     f();
+}
+
+fn main() {
+      let x  : Box<usize>  = 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 (file)
index 0000000..8a1c669
--- /dev/null
@@ -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 (file)
index 0000000..fffa27a
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..45eefbf
--- /dev/null
@@ -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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 (file)
index 0000000..8eb16ed
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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> = 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 (file)
index 0000000..48fcbf4
--- /dev/null
@@ -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> = 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 (file)
index 0000000..0c19780
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<RefCell<A>>);
+}
+
+struct B {
+    v: Option<Rc<RefCell<A>>>
+}
+
+impl Foo for B {
+    fn set(&mut self, v: Rc<RefCell<A>>)
+    {
+        self.v = Some(v);
+    }
+}
+
+struct A {
+    v: Box<Foo + Send>,
+}
+
+fn main() {
+    let a = A {v: box B{v: None} as Box<Foo+Send>};
+    //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>>` 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 (file)
index 0000000..fec6e06
--- /dev/null
@@ -0,0 +1,14 @@
+error[E0277]: `std::rc::Rc<std::cell::RefCell<A>>` cannot be sent between threads safely
+  --> $DIR/issue-7013.rs:36:19
+   |
+LL |     let a = A {v: box B{v: None} as Box<Foo+Send>};
+   |                   ^^^^^^^^^^^^^^ `std::rc::Rc<std::cell::RefCell<A>>` cannot be sent between threads safely
+   |
+   = help: within `B`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::RefCell<A>>`
+   = note: required because it appears within the type `std::option::Option<std::rc::Rc<std::cell::RefCell<A>>>`
+   = 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 (file)
index 0000000..9b72c24
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..02707b2
--- /dev/null
@@ -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 (file)
index 0000000..b99f5b7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<BarStruct> { self }
+    //~^ ERROR mismatched types
+    //~| expected type `std::boxed::Box<BarStruct>`
+    //~| 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 (file)
index 0000000..4f142ba
--- /dev/null
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-7061.rs:14:46
+   |
+LL |     fn foo(&'a mut self) -> Box<BarStruct> { self }
+   |                             --------------   ^^^^ expected struct `std::boxed::Box`, found mutable reference
+   |                             |
+   |                             expected `std::boxed::Box<BarStruct>` because of return type
+   |
+   = note: expected type `std::boxed::Box<BarStruct>`
+              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 (file)
index 0000000..26e1597
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..3c81609
--- /dev/null
@@ -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 (file)
index 0000000..7e8d431
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..75c716e
--- /dev/null
@@ -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 (file)
index 0000000..801a130
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<RefCell<isize>> = box RefCell::new(0);
+//~^ ERROR allocations are not allowed in statics
+//~| ERROR `std::cell::RefCell<isize>` 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 (file)
index 0000000..b0d732b
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0010]: allocations are not allowed in statics
+  --> $DIR/issue-7364.rs:16:37
+   |
+LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0);
+   |                                     ^^^^^^^^^^^^^^^^^^^ allocation not allowed in statics
+
+error[E0277]: `std::cell::RefCell<isize>` cannot be shared between threads safely
+  --> $DIR/issue-7364.rs:16:1
+   |
+LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::RefCell<isize>` cannot be shared between threads safely
+   |
+   = help: the trait `std::marker::Sync` is not implemented for `std::cell::RefCell<isize>`
+   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<std::cell::RefCell<isize>>`
+   = note: required because it appears within the type `std::boxed::Box<std::cell::RefCell<isize>>`
+   = 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 (file)
index 0000000..9bcdd69
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..bebf1c1
--- /dev/null
@@ -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 (file)
index 0000000..016df6c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..03ab54d
--- /dev/null
@@ -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 (file)
index 0000000..dd3a48c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7501279
--- /dev/null
@@ -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 (file)
index 0000000..b97c303
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..7ad9571
--- /dev/null
@@ -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 (file)
index 0000000..0cff90f
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b2feb67
--- /dev/null
@@ -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 (file)
index 0000000..457918b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..03fb89f
--- /dev/null
@@ -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 (file)
index 0000000..670b6bd
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..73a9a6a
--- /dev/null
@@ -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 (file)
index 0000000..b0d6cb5
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..db35cde
--- /dev/null
@@ -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 (file)
index 0000000..c4ca3ac
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..68fdea6
--- /dev/null
@@ -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 (file)
index 0000000..fc88a2c
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T>() {
+    generic::<Option<T>>();
+}
+//~^^^ ERROR reached the recursion limit while instantiating `generic::<std::option::Option<
+//~| WARN function cannot return without recurring
+
+
+
+fn main () {
+    // Use generic<T> at least once to trigger instantiation.
+    generic::<i32>();
+}
diff --git a/src/test/ui/issue-8727.stderr b/src/test/ui/issue-8727.stderr
new file mode 100644 (file)
index 0000000..28fb71b
--- /dev/null
@@ -0,0 +1,21 @@
+warning: function cannot return without recurring
+  --> $DIR/issue-8727.rs:14:1
+   |
+LL | fn generic<T>() {
+   | ^^^^^^^^^^^^^^^ cannot return without recurring
+LL |     generic::<Option<T>>();
+   |     ---------------------- 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::<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<i32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+  --> $DIR/issue-8727.rs:14:1
+   |
+LL | / fn generic<T>() {
+LL | |     generic::<Option<T>>();
+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 (file)
index 0000000..f8424ea
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..b8144df
--- /dev/null
@@ -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 (file)
index 0000000..926cae7
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d03e20b
--- /dev/null
@@ -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 (file)
index 0000000..9295eeb
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..d526697
--- /dev/null
@@ -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 (file)
index 0000000..f53122d
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..1d7fdad
--- /dev/null
@@ -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 (file)
index 0000000..226734b
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..2e85bd4
--- /dev/null
@@ -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 (file)
index 0000000..b60c537
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..9b8956d
--- /dev/null
@@ -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`.