diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-fail/bug-811.rs | 24 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-lsh-1.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-lsh-2.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-lsh-3.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-rsh-1.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-rsh-2.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-rsh-3.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-rsh-5.rs | 9 | ||||
| -rw-r--r-- | src/test/run-fail/overflowing-rsh-6.rs | 10 | ||||
| -rw-r--r-- | src/test/run-fail/panic-macro-any.rs | 7 | ||||
| -rw-r--r-- | src/test/run-fail/unwind-unique.rs | 10 | ||||
| -rw-r--r-- | src/test/ui-fulldeps/pprust-expr-roundtrip.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/array-slice-vec/bounds-check-no-overflow.rs (renamed from src/test/run-fail/bounds-check-no-overflow.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/array-slice-vec/dst-raw-slice.rs (renamed from src/test/run-fail/dst-raw-slice.rs) | 4 | ||||
| -rw-r--r-- | src/test/ui/binop/binop-fail-3.rs (renamed from src/test/run-fail/binop-fail-3.rs) | 4 | ||||
| -rw-r--r-- | src/test/ui/binop/binop-panic.rs (renamed from src/test/run-fail/binop-panic.rs) | 4 | ||||
| -rw-r--r-- | src/test/ui/borrowck/borrowck-local-borrow.rs (renamed from src/test/run-fail/borrowck-local-borrow.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/chalkify/basic.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/chalkify/builtin-copy-clone.rs | 44 | ||||
| -rw-r--r-- | src/test/ui/chalkify/chalk_initial_program.rs | 16 | ||||
| -rw-r--r-- | src/test/ui/chalkify/chalk_initial_program.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/chalkify/generic_impls.rs | 18 | ||||
| -rw-r--r-- | src/test/ui/chalkify/generic_impls.stderr | 27 | ||||
| -rw-r--r-- | src/test/ui/chalkify/impl_wf.rs | 47 | ||||
| -rw-r--r-- | src/test/ui/chalkify/impl_wf.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/chalkify/inherent_impl.rs | 42 | ||||
| -rw-r--r-- | src/test/ui/chalkify/inherent_impl_min.rs | 27 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_env1.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_env2.rs | 16 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_env3.rs | 16 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_impl.rs | 17 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_struct.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_trait.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_trait_higher_rank.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/chalkify/lower_trait_where_clause.rs | 16 | ||||
| -rw-r--r-- | src/test/ui/chalkify/println.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/chalkify/projection.rs | 25 | ||||
| -rw-r--r-- | src/test/ui/chalkify/recursive_where_clause_on_type.rs | 35 | ||||
| -rw-r--r-- | src/test/ui/chalkify/recursive_where_clause_on_type.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/chalkify/super_trait.rs | 19 | ||||
| -rw-r--r-- | src/test/ui/chalkify/trait_implied_bound.rs | 18 | ||||
| -rw-r--r-- | src/test/ui/chalkify/type_implied_bound.rs | 29 | ||||
| -rw-r--r-- | src/test/ui/chalkify/type_inference.rs | 28 | ||||
| -rw-r--r-- | src/test/ui/chalkify/type_inference.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/chalkify/type_wf.rs | 32 | ||||
| -rw-r--r-- | src/test/ui/closures/diverging-closure.rs (renamed from src/test/run-fail/diverging-closure.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/consts/promoted_div_by_zero.rs (renamed from src/test/run-fail/promoted_div_by_zero.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/fn/expr-fn-panic.rs (renamed from src/test/run-fail/expr-fn-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/generator/generator-resume-after-panic.rs (renamed from src/test/run-fail/generator-resume-after-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-capacity-overflow.rs (renamed from src/test/run-fail/hashmap-capacity-overflow.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr (renamed from src/test/ui/hashmap-iter-value-lifetime.nll.stderr) | 0 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-iter-value-lifetime.rs (renamed from src/test/ui/hashmap-iter-value-lifetime.rs) | 0 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-iter-value-lifetime.stderr (renamed from src/test/ui/hashmap-iter-value-lifetime.stderr) | 0 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-lifetimes.nll.stderr (renamed from src/test/ui/hashmap-lifetimes.nll.stderr) | 0 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-lifetimes.rs (renamed from src/test/ui/hashmap-lifetimes.rs) | 0 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-lifetimes.stderr (renamed from src/test/ui/hashmap-lifetimes.stderr) | 0 | ||||
| -rw-r--r-- | src/test/ui/hashmap/hashmap-memory.rs (renamed from src/test/ui/hashmap-memory.rs) | 0 | ||||
| -rw-r--r-- | src/test/ui/if/expr-if-panic-fn.rs (renamed from src/test/run-fail/expr-if-panic-fn.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/if/expr-if-panic.rs (renamed from src/test/run-fail/expr-if-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/if/if-check-panic.rs (renamed from src/test/run-fail/if-check-panic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/if/if-cond-bot.rs (renamed from src/test/run-fail/if-cond-bot.rs) | 4 | ||||
| -rw-r--r-- | src/test/ui/imports/glob-use-std.rs (renamed from src/test/run-fail/glob-use-std.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-12920.rs (renamed from src/test/run-fail/issue-12920.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-13202.rs (renamed from src/test/run-fail/issue-13202.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-18576.rs (renamed from src/test/run-fail/issue-18576.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-20971.rs (renamed from src/test/run-fail/issue-20971.rs) | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-23354-2.rs (renamed from src/test/run-fail/issue-23354-2.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-23354.rs (renamed from src/test/run-fail/issue-23354.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-2444.rs (renamed from src/test/run-fail/issue-2444.rs) | 8 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-2470-bounds-check-overflow.rs (renamed from src/test/run-fail/bug-2470-bounds-check-overflow.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-2761.rs (renamed from src/test/run-fail/issue-2761.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-28934.rs (renamed from src/test/run-fail/issue-28934.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-29798.rs (renamed from src/test/run-fail/issue-29798.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-3029.rs (renamed from src/test/run-fail/issue-3029.rs) | 6 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-30380.rs (renamed from src/test/run-fail/issue-30380.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44216-add-instant.rs (renamed from src/test/run-fail/issue-44216-add-instant.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44216-add-system-time.rs (renamed from src/test/run-fail/issue-44216-add-system-time.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44216-sub-instant.rs (renamed from src/test/run-fail/issue-44216-sub-instant.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44216-sub-system-time.rs (renamed from src/test/run-fail/issue-44216-sub-system-time.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-51345-2.rs (renamed from src/test/run-fail/issue-51345.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-6458-1.rs (renamed from src/test/run-fail/issue-6458-1.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-811.rs | 26 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-948.rs (renamed from src/test/run-fail/issue-948.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/loops/for-each-loop-panic.rs (renamed from src/test/run-fail/for-each-loop-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-as-macro.rs (renamed from src/test/run-fail/assert-as-macro.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-eq-macro-panic.rs (renamed from src/test/run-fail/assert-eq-macro-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-macro-explicit.rs (renamed from src/test/run-fail/assert-macro-explicit.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-macro-fmt.rs (renamed from src/test/run-fail/assert-macro-fmt.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-macro-owned.rs (renamed from src/test/run-fail/assert-macro-owned.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-macro-static.rs (renamed from src/test/run-fail/assert-macro-static.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/assert-ne-macro-panic.rs (renamed from src/test/run-fail/assert-ne-macro-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/die-macro-2.rs (renamed from src/test/run-fail/die-macro.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/die-macro-expr.rs (renamed from src/test/run-fail/die-macro-expr.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/die-macro-pure.rs (renamed from src/test/run-fail/die-macro-pure.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/unimplemented-macro-panic.rs (renamed from src/test/run-fail/unimplemented-macro-panic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/macros/unreachable-fmt-msg.rs (renamed from src/test/run-fail/unreachable-fmt-msg.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/macros/unreachable-macro-panic.rs (renamed from src/test/run-fail/unreachable-macro-panic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/macros/unreachable-static-msg.rs (renamed from src/test/run-fail/unreachable-static-msg.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/macros/unreachable.rs (renamed from src/test/run-fail/unreachable.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/match/expr-match-panic-fn.rs (renamed from src/test/run-fail/expr-match-panic-fn.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/match/expr-match-panic.rs (renamed from src/test/run-fail/expr-match-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/match/match-bot-panic.rs (renamed from src/test/run-fail/match-bot-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/match/match-disc-bot.rs (renamed from src/test/run-fail/match-disc-bot.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/match/match-wildcards.rs (renamed from src/test/run-fail/match-wildcards.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/meta-revision-bad.rs (renamed from src/test/run-fail/meta-revision-bad.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/meta-revision-ok.rs (renamed from src/test/run-fail/meta-revision-ok.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_codegen_calls_converging_drops.rs (renamed from src/test/run-fail/mir_codegen_calls_converging_drops.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs (renamed from src/test/run-fail/mir_codegen_calls_converging_drops_2.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_codegen_calls_diverging.rs (renamed from src/test/run-fail/mir_codegen_calls_diverging.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_codegen_calls_diverging_drops.rs (renamed from src/test/run-fail/mir_codegen_calls_diverging_drops.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_drop_panics.rs (renamed from src/test/run-fail/mir_drop_panics.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_dynamic_drops_1.rs (renamed from src/test/run-fail/mir_dynamic_drops_1.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_dynamic_drops_2.rs (renamed from src/test/run-fail/mir_dynamic_drops_2.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_dynamic_drops_3.rs (renamed from src/test/run-fail/mir_dynamic_drops_3.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_indexing_oob_1.rs (renamed from src/test/run-fail/mir_indexing_oob_1.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_indexing_oob_2.rs (renamed from src/test/run-fail/mir_indexing_oob_2.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/mir/mir_indexing_oob_3.rs (renamed from src/test/run-fail/mir_indexing_oob_3.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/never_type/return-never-coerce.rs (renamed from src/test/run-fail/return-never-coerce.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/divide-by-zero.rs (renamed from src/test/run-fail/divide-by-zero.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/mod-zero.rs (renamed from src/test/run-fail/mod-zero.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-add.rs (renamed from src/test/run-fail/overflowing-add.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs (renamed from src/test/run-fail/overflowing-lsh-4.rs) | 6 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-mul.rs (renamed from src/test/run-fail/overflowing-mul.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-neg.rs (renamed from src/test/run-fail/overflowing-neg.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs (renamed from src/test/run-fail/overflowing-pow-signed.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs (renamed from src/test/run-fail/overflowing-pow-unsigned.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs (renamed from src/test/run-fail/overflowing-rsh-4.rs) | 6 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/overflowing-sub.rs (renamed from src/test/run-fail/overflowing-sub.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/numbers-arithmetic/promoted_overflow.rs (renamed from src/test/run-fail/promoted_overflow.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/panic-runtime/unwind-interleaved.rs (renamed from src/test/run-fail/unwind-interleaved.rs) | 4 | ||||
| -rw-r--r-- | src/test/ui/panic-runtime/unwind-rec.rs (renamed from src/test/run-fail/unwind-rec.rs) | 5 | ||||
| -rw-r--r-- | src/test/ui/panic-runtime/unwind-rec2.rs (renamed from src/test/run-fail/unwind-rec2.rs) | 5 | ||||
| -rw-r--r-- | src/test/ui/panic-runtime/unwind-unique.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/panics/args-panic.rs (renamed from src/test/run-fail/args-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/doublepanic.rs (renamed from src/test/run-fail/doublepanic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/explicit-panic-msg.rs (renamed from src/test/run-fail/explicit-panic-msg.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/explicit-panic.rs (renamed from src/test/run-fail/explicit-panic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/fmt-panic.rs (renamed from src/test/run-fail/fmt-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/main-panic.rs (renamed from src/test/run-fail/main-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-arg.rs (renamed from src/test/run-fail/panic-arg.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-macro-any-wrapped.rs (renamed from src/test/run-fail/panic-macro-any-wrapped.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-macro-any.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-macro-explicit.rs (renamed from src/test/run-fail/panic-macro-explicit.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-macro-fmt.rs (renamed from src/test/run-fail/panic-macro-fmt.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-macro-owned.rs (renamed from src/test/run-fail/panic-macro-owned.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-macro-static.rs (renamed from src/test/run-fail/panic-macro-static.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-main.rs (renamed from src/test/run-fail/panic-main.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-parens.rs (renamed from src/test/run-fail/panic-parens.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-set-handler.rs (renamed from src/test/run-fail/panic-set-handler.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-set-unset-handler.rs (renamed from src/test/run-fail/panic-set-unset-handler.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-take-handler-nop.rs (renamed from src/test/run-fail/panic-take-handler-nop.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-task-name-none.rs (renamed from src/test/run-fail/panic-task-name-none.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-task-name-owned.rs (renamed from src/test/run-fail/panic-task-name-owned.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/panics/panic.rs (renamed from src/test/run-fail/panic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/result-get-panic.rs (renamed from src/test/run-fail/result-get-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/test-panic.rs (renamed from src/test/run-fail/test-panic.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/test-should-fail-bad-message.rs (renamed from src/test/run-fail/test-should-fail-bad-message.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/panics/test-should-panic-bad-message.rs (renamed from src/test/run-fail/test-should-panic-bad-message.rs) | 5 | ||||
| -rw-r--r-- | src/test/ui/panics/test-should-panic-no-message.rs (renamed from src/test/run-fail/test-should-panic-no-message.rs) | 5 | ||||
| -rw-r--r-- | src/test/ui/panics/unique-panic.rs (renamed from src/test/run-fail/unique-panic.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/panics/while-body-panics.rs (renamed from src/test/run-fail/while-body-panics.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/panics/while-panic.rs (renamed from src/test/run-fail/while-panic.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/process/tls-exit-status.rs (renamed from src/test/run-fail/tls-exit-status.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs (renamed from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs (renamed from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-never.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs (renamed from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs (renamed from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-str.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/str/str-overrun.rs (renamed from src/test/run-fail/str-overrun.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/structs/rhs-type.rs (renamed from src/test/run-fail/rhs-type.rs) | 3 | ||||
| -rw-r--r-- | src/test/ui/test-attrs/run-unexported-tests.rs (renamed from src/test/run-fail/run-unexported-tests.rs) | 2 | ||||
| -rw-r--r-- | src/test/ui/threads-sendsync/task-spawn-barefn.rs (renamed from src/test/run-fail/task-spawn-barefn.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/threads-sendsync/test-tasks-invalid-value.rs (renamed from src/test/run-fail/test-tasks-invalid-value.rs) | 1 | ||||
| -rw-r--r-- | src/test/ui/vec/vec-overrun.rs (renamed from src/test/run-fail/vec-overrun.rs) | 3 |
191 files changed, 1117 insertions, 140 deletions
diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs deleted file mode 100644 index e36ec0f5901..00000000000 --- a/src/test/run-fail/bug-811.rs +++ /dev/null @@ -1,24 +0,0 @@ -// error-pattern:quux - -use std::marker::PhantomData; - -fn test00_start(ch: chan_t<isize>, message: isize) { - send(ch, message); -} - -type task_id = isize; -type port_id = isize; - -struct chan_t<T> { - task: task_id, - port: port_id, - marker: PhantomData<*mut T>, -} - -fn send<T: Send>(_ch: chan_t<T>, _data: T) { - panic!(); -} - -fn main() { - panic!("quux"); -} diff --git a/src/test/run-fail/overflowing-lsh-1.rs b/src/test/run-fail/overflowing-lsh-1.rs deleted file mode 100644 index 977cfea0fe0..00000000000 --- a/src/test/run-fail/overflowing-lsh-1.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = 1_i32 << 32; -} diff --git a/src/test/run-fail/overflowing-lsh-2.rs b/src/test/run-fail/overflowing-lsh-2.rs deleted file mode 100644 index 3517dacde3a..00000000000 --- a/src/test/run-fail/overflowing-lsh-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = 1 << -1; -} diff --git a/src/test/run-fail/overflowing-lsh-3.rs b/src/test/run-fail/overflowing-lsh-3.rs deleted file mode 100644 index 4a575c3fa7f..00000000000 --- a/src/test/run-fail/overflowing-lsh-3.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = 1_u64 << 64; -} diff --git a/src/test/run-fail/overflowing-rsh-1.rs b/src/test/run-fail/overflowing-rsh-1.rs deleted file mode 100644 index 4592b2b6260..00000000000 --- a/src/test/run-fail/overflowing-rsh-1.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = -1_i32 >> 32; -} diff --git a/src/test/run-fail/overflowing-rsh-2.rs b/src/test/run-fail/overflowing-rsh-2.rs deleted file mode 100644 index 066267b770d..00000000000 --- a/src/test/run-fail/overflowing-rsh-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = -1_i32 >> -1; -} diff --git a/src/test/run-fail/overflowing-rsh-3.rs b/src/test/run-fail/overflowing-rsh-3.rs deleted file mode 100644 index 67e78482866..00000000000 --- a/src/test/run-fail/overflowing-rsh-3.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = -1_i64 >> 64; -} diff --git a/src/test/run-fail/overflowing-rsh-5.rs b/src/test/run-fail/overflowing-rsh-5.rs deleted file mode 100644 index 20ef324a82a..00000000000 --- a/src/test/run-fail/overflowing-rsh-5.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _n = 1i64 >> [64][0]; -} diff --git a/src/test/run-fail/overflowing-rsh-6.rs b/src/test/run-fail/overflowing-rsh-6.rs deleted file mode 100644 index 589a98bab04..00000000000 --- a/src/test/run-fail/overflowing-rsh-6.rs +++ /dev/null @@ -1,10 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] -#![feature(const_indexing)] - -fn main() { - let _n = 1i64 >> [64][0]; -} diff --git a/src/test/run-fail/panic-macro-any.rs b/src/test/run-fail/panic-macro-any.rs deleted file mode 100644 index 72d42e5b799..00000000000 --- a/src/test/run-fail/panic-macro-any.rs +++ /dev/null @@ -1,7 +0,0 @@ -// error-pattern:panicked at 'Box<Any>' - -#![feature(box_syntax)] - -fn main() { - panic!(box 413 as Box<::std::any::Any + Send>); -} diff --git a/src/test/run-fail/unwind-unique.rs b/src/test/run-fail/unwind-unique.rs deleted file mode 100644 index 7b761faad95..00000000000 --- a/src/test/run-fail/unwind-unique.rs +++ /dev/null @@ -1,10 +0,0 @@ -// error-pattern:fail - -fn failfn() { - panic!(); -} - -fn main() { - Box::new(0); - failfn(); -} diff --git a/src/test/ui-fulldeps/pprust-expr-roundtrip.rs b/src/test/ui-fulldeps/pprust-expr-roundtrip.rs index 365ae301c0f..a3d31d25774 100644 --- a/src/test/ui-fulldeps/pprust-expr-roundtrip.rs +++ b/src/test/ui-fulldeps/pprust-expr-roundtrip.rs @@ -32,6 +32,7 @@ use rustc_parse::new_parser_from_source_str; use rustc_session::parse::ParseSess; use rustc_span::source_map::{Spanned, DUMMY_SP, FileName}; use rustc_span::source_map::FilePathMapping; +use rustc_span::symbol::Ident; use rustc_ast::ast::*; use rustc_ast::mut_visit::{self, MutVisitor, visit_clobber}; use rustc_ast::ptr::P; diff --git a/src/test/run-fail/bounds-check-no-overflow.rs b/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs index 3943f87f7fe..3caf5f44995 100644 --- a/src/test/run-fail/bounds-check-no-overflow.rs +++ b/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds +// ignore-emscripten no processes use std::usize; use std::mem::size_of; diff --git a/src/test/run-fail/dst-raw-slice.rs b/src/test/ui/array-slice-vec/dst-raw-slice.rs index 2575de7cc58..371d16f093a 100644 --- a/src/test/run-fail/dst-raw-slice.rs +++ b/src/test/ui/array-slice-vec/dst-raw-slice.rs @@ -1,5 +1,9 @@ // Test bounds checking for DST raw slices + +// run-fail // error-pattern:index out of bounds +// ignore-emscripten no processes + #[allow(unconditional_panic)] fn main() { let a: *const [_] = &[1, 2, 3]; diff --git a/src/test/run-fail/binop-fail-3.rs b/src/test/ui/binop/binop-fail-3.rs index a7696fffda0..49f635e0c11 100644 --- a/src/test/run-fail/binop-fail-3.rs +++ b/src/test/ui/binop/binop-fail-3.rs @@ -1,9 +1,11 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn foo() -> ! { panic!("quux"); } -#[allow(resolve_trait_on_defaulted_unit)] fn main() { foo() == foo(); // these types wind up being defaulted to () } diff --git a/src/test/run-fail/binop-panic.rs b/src/test/ui/binop/binop-panic.rs index dba5cecc67e..44cdfffeeb7 100644 --- a/src/test/run-fail/binop-panic.rs +++ b/src/test/ui/binop/binop-panic.rs @@ -1,8 +1,12 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } + fn main() { 3_usize == my_err("bye".to_string()); } diff --git a/src/test/run-fail/borrowck-local-borrow.rs b/src/test/ui/borrowck/borrowck-local-borrow.rs index d07f76b6252..ea4589338c4 100644 --- a/src/test/run-fail/borrowck-local-borrow.rs +++ b/src/test/ui/borrowck/borrowck-local-borrow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panic 1 +// ignore-emscripten no processes // revisions: migrate mir //[mir]compile-flags: -Z borrowck=mir diff --git a/src/test/ui/chalkify/basic.rs b/src/test/ui/chalkify/basic.rs new file mode 100644 index 00000000000..dbd60fc8bb1 --- /dev/null +++ b/src/test/ui/chalkify/basic.rs @@ -0,0 +1,12 @@ +// check-pass +// compile-flags: -Z chalk + +trait Foo {} + +struct Bar {} + +impl Foo for Bar {} + +fn main() -> () { + let _ = Bar {}; +} diff --git a/src/test/ui/chalkify/builtin-copy-clone.rs b/src/test/ui/chalkify/builtin-copy-clone.rs new file mode 100644 index 00000000000..d403514b553 --- /dev/null +++ b/src/test/ui/chalkify/builtin-copy-clone.rs @@ -0,0 +1,44 @@ +// run-pass +// compile-flags: -Z chalk + +// Test that `Clone` is correctly implemented for builtin types. + +#[derive(Copy, Clone)] +struct S(i32); + +fn test_clone<T: Clone>(arg: T) { + let _ = arg.clone(); +} + +fn test_copy<T: Copy>(arg: T) { + let _ = arg; + let _ = arg; +} + +fn test_copy_clone<T: Copy + Clone>(arg: T) { + test_copy(arg); + test_clone(arg); +} + +fn foo() { } + +fn main() { + test_copy_clone(foo); + let f: fn() = foo; + test_copy_clone(f); + // FIXME: add closures when they're considered WF + test_copy_clone([1; 56]); + test_copy_clone((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + test_copy_clone((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, true, 'a', 1.1)); + test_copy_clone(()); + test_copy_clone(((1, 1), (1, 1, 1), (1.1, 1, 1, 'a'), ())); + + let a = ( + (S(1), S(0)), + ( + (S(0), S(0), S(1)), + S(0) + ) + ); + test_copy_clone(a); +} diff --git a/src/test/ui/chalkify/chalk_initial_program.rs b/src/test/ui/chalkify/chalk_initial_program.rs new file mode 100644 index 00000000000..df25bad622b --- /dev/null +++ b/src/test/ui/chalkify/chalk_initial_program.rs @@ -0,0 +1,16 @@ +// compile-flags: -Z chalk + +trait Foo { } + +impl Foo for i32 { } + +impl Foo for u32 { } + +fn gimme<F: Foo>() { } + +// Note: this also tests that `std::process::Termination` is implemented for `()`. +fn main() { + gimme::<i32>(); + gimme::<u32>(); + gimme::<f32>(); //~ERROR the trait bound `f32: Foo` is not satisfied +} diff --git a/src/test/ui/chalkify/chalk_initial_program.stderr b/src/test/ui/chalkify/chalk_initial_program.stderr new file mode 100644 index 00000000000..f2e13a6a469 --- /dev/null +++ b/src/test/ui/chalkify/chalk_initial_program.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `f32: Foo` is not satisfied + --> $DIR/chalk_initial_program.rs:15:13 + | +LL | fn gimme<F: Foo>() { } + | --- required by this bound in `gimme` +... +LL | gimme::<f32>(); + | ^^^ the trait `Foo` is not implemented for `f32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/chalkify/generic_impls.rs b/src/test/ui/chalkify/generic_impls.rs new file mode 100644 index 00000000000..d70c6f8055d --- /dev/null +++ b/src/test/ui/chalkify/generic_impls.rs @@ -0,0 +1,18 @@ +// compile-flags: -Z chalk + +trait Foo { } + +impl<T> Foo for (T, u32) { } + +fn gimme<F: Foo>() { } + +fn foo<T>() { + gimme::<(T, u32)>(); + gimme::<(Option<T>, u32)>(); + gimme::<(Option<T>, f32)>(); //~ ERROR +} + +fn main() { + gimme::<(i32, u32)>(); + gimme::<(i32, f32)>(); //~ ERROR +} diff --git a/src/test/ui/chalkify/generic_impls.stderr b/src/test/ui/chalkify/generic_impls.stderr new file mode 100644 index 00000000000..4ac57a2f13f --- /dev/null +++ b/src/test/ui/chalkify/generic_impls.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `(std::option::Option<T>, f32): Foo` is not satisfied + --> $DIR/generic_impls.rs:12:13 + | +LL | fn gimme<F: Foo>() { } + | --- required by this bound in `gimme` +... +LL | gimme::<(Option<T>, f32)>(); + | ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(std::option::Option<T>, f32)` + | + = help: the following implementations were found: + <(T, u32) as Foo> + +error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied + --> $DIR/generic_impls.rs:17:13 + | +LL | fn gimme<F: Foo>() { } + | --- required by this bound in `gimme` +... +LL | gimme::<(i32, f32)>(); + | ^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)` + | + = help: the following implementations were found: + <(T, u32) as Foo> + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/chalkify/impl_wf.rs b/src/test/ui/chalkify/impl_wf.rs new file mode 100644 index 00000000000..8aa87642292 --- /dev/null +++ b/src/test/ui/chalkify/impl_wf.rs @@ -0,0 +1,47 @@ +// compile-flags: -Z chalk + +trait Foo: Sized { } + +trait Bar { + type Item: Foo; +} + +impl Foo for i32 { } + +// FIXME(chalk): blocked on better handling of builtin traits for non-struct +// application types (or a workaround) +/* +impl Foo for str { } +//^ ERROR the size for values of type `str` cannot be known at compilation time +*/ + +// Implicit `T: Sized` bound. +impl<T> Foo for Option<T> { } + +impl Bar for () { + type Item = i32; +} + +impl<T> Bar for Option<T> { + type Item = Option<T>; +} + +// FIXME(chalk): the ordering of these two errors differs between CI and local +// We need to figure out why its non-deterministic +/* +impl Bar for f32 { +//^ ERROR the trait bound `f32: Foo` is not satisfied + type Item = f32; + //^ ERROR the trait bound `f32: Foo` is not satisfied +} +*/ + +trait Baz<U: ?Sized> where U: Foo { } + +impl Baz<i32> for i32 { } + +impl Baz<f32> for f32 { } +//~^ ERROR the trait bound `f32: Foo` is not satisfied + +fn main() { +} diff --git a/src/test/ui/chalkify/impl_wf.stderr b/src/test/ui/chalkify/impl_wf.stderr new file mode 100644 index 00000000000..befd688741c --- /dev/null +++ b/src/test/ui/chalkify/impl_wf.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `f32: Foo` is not satisfied + --> $DIR/impl_wf.rs:43:6 + | +LL | trait Baz<U: ?Sized> where U: Foo { } + | --- required by this bound in `Baz` +... +LL | impl Baz<f32> for f32 { } + | ^^^^^^^^ the trait `Foo` is not implemented for `f32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/chalkify/inherent_impl.rs b/src/test/ui/chalkify/inherent_impl.rs new file mode 100644 index 00000000000..44e120c1eeb --- /dev/null +++ b/src/test/ui/chalkify/inherent_impl.rs @@ -0,0 +1,42 @@ +// run-pass +// compile-flags: -Z chalk + +trait Foo { } + +impl Foo for i32 { } + +struct S<T: Foo> { + x: T, +} + +fn only_foo<T: Foo>(_x: &T) { } + +impl<T> S<T> { + // Test that we have the correct environment inside an inherent method. + fn dummy_foo(&self) { + only_foo(&self.x) + } +} + +trait Bar { } +impl Bar for u32 { } + +fn only_bar<T: Bar>() { } + +impl<T> S<T> { + // Test that the environment of `dummy_bar` adds up with the environment + // of the inherent impl. + fn dummy_bar<U: Bar>(&self) { + only_foo(&self.x); + only_bar::<U>(); + } +} + +fn main() { + let s = S { + x: 5, + }; + + s.dummy_foo(); + s.dummy_bar::<u32>(); +} diff --git a/src/test/ui/chalkify/inherent_impl_min.rs b/src/test/ui/chalkify/inherent_impl_min.rs new file mode 100644 index 00000000000..774c46e401c --- /dev/null +++ b/src/test/ui/chalkify/inherent_impl_min.rs @@ -0,0 +1,27 @@ +// run-pass +// compile-flags: -Z chalk + +trait Foo { } + +impl Foo for i32 { } + +struct S<T: Foo> { + x: T, +} + +fn only_foo<T: Foo>(_x: &T) { } + +impl<T> S<T> { + // Test that we have the correct environment inside an inherent method. + fn dummy_foo(&self) { + only_foo(&self.x) + } +} + +fn main() { + let s = S { + x: 5, + }; + + s.dummy_foo(); +} diff --git a/src/test/ui/chalkify/lower_env1.rs b/src/test/ui/chalkify/lower_env1.rs new file mode 100644 index 00000000000..e3c75695921 --- /dev/null +++ b/src/test/ui/chalkify/lower_env1.rs @@ -0,0 +1,14 @@ +// check-pass +// compile-flags: -Z chalk + +#![allow(dead_code)] + +trait Foo { } + +trait Bar where Self: Foo { } + +fn bar<T: Bar + ?Sized>() { +} + +fn main() { +} diff --git a/src/test/ui/chalkify/lower_env2.rs b/src/test/ui/chalkify/lower_env2.rs new file mode 100644 index 00000000000..b5432ce0e30 --- /dev/null +++ b/src/test/ui/chalkify/lower_env2.rs @@ -0,0 +1,16 @@ +// check-pass +// compile-flags: -Z chalk + +#![allow(dead_code)] + +trait Foo { } + +struct S<'a, T: ?Sized> where T: Foo { + data: &'a T, +} + +fn bar<T: Foo>(_x: S<'_, T>) { // note that we have an implicit `T: Sized` bound +} + +fn main() { +} diff --git a/src/test/ui/chalkify/lower_env3.rs b/src/test/ui/chalkify/lower_env3.rs new file mode 100644 index 00000000000..673f08d78ab --- /dev/null +++ b/src/test/ui/chalkify/lower_env3.rs @@ -0,0 +1,16 @@ +// check-pass +// compile-flags: -Z chalk + +#![allow(dead_code)] + +trait Foo { + fn foo(&self); +} + +impl<T> Foo for T where T: Clone { + fn foo(&self) { + } +} + +fn main() { +} diff --git a/src/test/ui/chalkify/lower_impl.rs b/src/test/ui/chalkify/lower_impl.rs new file mode 100644 index 00000000000..f586cf08391 --- /dev/null +++ b/src/test/ui/chalkify/lower_impl.rs @@ -0,0 +1,17 @@ +// check-pass +// compile-flags: -Z chalk + +trait Foo { } + +impl<T: 'static> Foo for T where T: Iterator<Item = i32> { } + +trait Bar { + type Assoc; +} + +impl<T> Bar for T where T: Iterator<Item = i32> { + type Assoc = Vec<T>; +} + +fn main() { +} diff --git a/src/test/ui/chalkify/lower_struct.rs b/src/test/ui/chalkify/lower_struct.rs new file mode 100644 index 00000000000..94a0716d383 --- /dev/null +++ b/src/test/ui/chalkify/lower_struct.rs @@ -0,0 +1,8 @@ +// check-pass +// compile-flags: -Z chalk + +struct Foo<'a, T> where Box<T>: Clone { + _x: std::marker::PhantomData<&'a T>, +} + +fn main() { } diff --git a/src/test/ui/chalkify/lower_trait.rs b/src/test/ui/chalkify/lower_trait.rs new file mode 100644 index 00000000000..d8f6180ceb3 --- /dev/null +++ b/src/test/ui/chalkify/lower_trait.rs @@ -0,0 +1,11 @@ +// check-pass +// compile-flags: -Z chalk + +trait Bar { } + +trait Foo<S, T: ?Sized> { + type Assoc: Bar + ?Sized; +} + +fn main() { +} diff --git a/src/test/ui/chalkify/lower_trait_higher_rank.rs b/src/test/ui/chalkify/lower_trait_higher_rank.rs new file mode 100644 index 00000000000..a48979491a1 --- /dev/null +++ b/src/test/ui/chalkify/lower_trait_higher_rank.rs @@ -0,0 +1,9 @@ +// check-pass +// compile-flags: -Z chalk + +trait Foo<F: ?Sized> where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8 +{ +} + +fn main() { +} diff --git a/src/test/ui/chalkify/lower_trait_where_clause.rs b/src/test/ui/chalkify/lower_trait_where_clause.rs new file mode 100644 index 00000000000..19cff8db7cb --- /dev/null +++ b/src/test/ui/chalkify/lower_trait_where_clause.rs @@ -0,0 +1,16 @@ +// check-pass +// compile-flags: -Z chalk + +use std::borrow::Borrow; + +trait Foo<'a, 'b, T, U> +where + T: Borrow<U> + ?Sized, + U: ?Sized + 'b, + 'a: 'b, + Box<T>:, // NOTE(#53696) this checks an empty list of bounds. +{ +} + +fn main() { +} diff --git a/src/test/ui/chalkify/println.rs b/src/test/ui/chalkify/println.rs new file mode 100644 index 00000000000..cf36aef8afa --- /dev/null +++ b/src/test/ui/chalkify/println.rs @@ -0,0 +1,7 @@ +// check-pass +// compile-flags: -Z chalk + +fn main() { + // FIXME(chalk): Require `RegionOutlives`/`TypeOutlives`/`Subtype` support + //println!("hello"); +} diff --git a/src/test/ui/chalkify/projection.rs b/src/test/ui/chalkify/projection.rs new file mode 100644 index 00000000000..d6a8dd7a4a2 --- /dev/null +++ b/src/test/ui/chalkify/projection.rs @@ -0,0 +1,25 @@ +// run-pass +// compile-flags: -Z chalk + +trait Foo { } + +trait Bar { + type Item: Foo; +} + +impl Foo for i32 { } +impl Bar for i32 { + type Item = i32; +} + +fn only_foo<T: Foo>() { } + +fn only_bar<T: Bar>() { + // `T` implements `Bar` hence `<T as Bar>::Item` must also implement `Bar` + only_foo::<T::Item>() +} + +fn main() { + only_bar::<i32>(); + only_foo::<<i32 as Bar>::Item>(); +} diff --git a/src/test/ui/chalkify/recursive_where_clause_on_type.rs b/src/test/ui/chalkify/recursive_where_clause_on_type.rs new file mode 100644 index 00000000000..6ee13f5e7a1 --- /dev/null +++ b/src/test/ui/chalkify/recursive_where_clause_on_type.rs @@ -0,0 +1,35 @@ +// FIXME(chalk): should fail, see comments +// check-pass +// compile-flags: -Z chalk + +#![feature(trivial_bounds)] + +trait Bar { + fn foo(); +} +trait Foo: Bar { } + +struct S where S: Foo; +//~^ WARN Trait bound S: Foo does not depend on any type or lifetime parameters + +impl Foo for S { +} + +fn bar<T: Bar>() { + T::foo(); +} + +fn foo<T: Foo>() { + bar::<T>() +} + +fn main() { + // For some reason, the error is duplicated... + + // FIXME(chalk): this order of this duplicate error seems non-determistic + // and causes test to fail + /* + foo::<S>() // ERROR the type `S` is not well-formed (chalk) + //^ ERROR the type `S` is not well-formed (chalk) + */ +} diff --git a/src/test/ui/chalkify/recursive_where_clause_on_type.stderr b/src/test/ui/chalkify/recursive_where_clause_on_type.stderr new file mode 100644 index 00000000000..a5b7ef7fdb2 --- /dev/null +++ b/src/test/ui/chalkify/recursive_where_clause_on_type.stderr @@ -0,0 +1,10 @@ +warning: Trait bound S: Foo does not depend on any type or lifetime parameters + --> $DIR/recursive_where_clause_on_type.rs:12:19 + | +LL | struct S where S: Foo; + | ^^^ + | + = note: `#[warn(trivial_bounds)]` on by default + +warning: 1 warning emitted + diff --git a/src/test/ui/chalkify/super_trait.rs b/src/test/ui/chalkify/super_trait.rs new file mode 100644 index 00000000000..eeff9fd9b80 --- /dev/null +++ b/src/test/ui/chalkify/super_trait.rs @@ -0,0 +1,19 @@ +// run-pass +// compile-flags: -Z chalk + +trait Foo { } +trait Bar: Foo { } + +impl Foo for i32 { } +impl Bar for i32 { } + +fn only_foo<T: Foo>() { } + +fn only_bar<T: Bar>() { + // `T` implements `Bar` hence `T` must also implement `Foo` + only_foo::<T>() +} + +fn main() { + only_bar::<i32>() +} diff --git a/src/test/ui/chalkify/trait_implied_bound.rs b/src/test/ui/chalkify/trait_implied_bound.rs new file mode 100644 index 00000000000..8a2e1cf5990 --- /dev/null +++ b/src/test/ui/chalkify/trait_implied_bound.rs @@ -0,0 +1,18 @@ +// run-pass +// compile-flags: -Z chalk + +trait Foo { } +trait Bar<U> where U: Foo { } + +impl Foo for i32 { } +impl Bar<i32> for i32 { } + +fn only_foo<T: Foo>() { } + +fn only_bar<U, T: Bar<U>>() { + only_foo::<U>() +} + +fn main() { + only_bar::<i32, i32>() +} diff --git a/src/test/ui/chalkify/type_implied_bound.rs b/src/test/ui/chalkify/type_implied_bound.rs new file mode 100644 index 00000000000..8673f5319bd --- /dev/null +++ b/src/test/ui/chalkify/type_implied_bound.rs @@ -0,0 +1,29 @@ +// run-pass +// compile-flags: -Z chalk + +trait Eq { } +trait Hash: Eq { } + +impl Eq for i32 { } +impl Hash for i32 { } + +struct Set<T: Hash> { + _x: T, +} + +fn only_eq<T: Eq>() { } + +fn take_a_set<T>(_: &Set<T>) { + // `Set<T>` is an input type of `take_a_set`, hence we know that + // `T` must implement `Hash`, and we know in turn that `T` must + // implement `Eq`. + only_eq::<T>() +} + +fn main() { + let set = Set { + _x: 5, + }; + + take_a_set(&set); +} diff --git a/src/test/ui/chalkify/type_inference.rs b/src/test/ui/chalkify/type_inference.rs new file mode 100644 index 00000000000..5175c5d062a --- /dev/null +++ b/src/test/ui/chalkify/type_inference.rs @@ -0,0 +1,28 @@ +// compile-flags: -Z chalk + +trait Foo { } +impl Foo for i32 { } + +trait Bar { } +impl Bar for i32 { } +impl Bar for u32 { } + +fn only_foo<T: Foo>(_x: T) { } + +fn only_bar<T: Bar>(_x: T) { } + +fn main() { + let x = 5.0; + + // The only type which implements `Foo` is `i32`, so the chalk trait solver + // is expecting a variable of type `i32`. This behavior differs from the + // old-style trait solver. I guess this will change, that's why I'm + // adding that test. + // FIXME(chalk): partially blocked on float/int special casing + only_foo(x); //~ ERROR the trait bound `f64: Foo` is not satisfied + + // Here we have two solutions so we get back the behavior of the old-style + // trait solver. + // FIXME(chalk): blocked on float/int special casing + //only_bar(x); // ERROR the trait bound `{float}: Bar` is not satisfied +} diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr new file mode 100644 index 00000000000..ee9e67c6c78 --- /dev/null +++ b/src/test/ui/chalkify/type_inference.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `f64: Foo` is not satisfied + --> $DIR/type_inference.rs:22:5 + | +LL | fn only_foo<T: Foo>(_x: T) { } + | --- required by this bound in `only_foo` +... +LL | only_foo(x); + | ^^^^^^^^ the trait `Foo` 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/chalkify/type_wf.rs b/src/test/ui/chalkify/type_wf.rs new file mode 100644 index 00000000000..396baf814a0 --- /dev/null +++ b/src/test/ui/chalkify/type_wf.rs @@ -0,0 +1,32 @@ +// FIXME(chalk): should have an error, see below +// check-pass +// compile-flags: -Z chalk + +trait Foo { } + +struct S<T: Foo> { + x: T, +} + +impl Foo for i32 { } +impl<T> Foo for Option<T> { } + +fn main() { + let s = S { + x: 5, + }; + + // FIXME(chalk): blocked on float/int special handling. Needs to know that {float}: !i32 + /* + let s = S { // ERROR the trait bound `{float}: Foo` is not satisfied + x: 5.0, + }; + */ + + // FIXME(chalk): blocked on float/int special handling. Needs to know that {float}: Sized + /* + let s = S { + x: Some(5.0), + }; + */ +} diff --git a/src/test/run-fail/diverging-closure.rs b/src/test/ui/closures/diverging-closure.rs index a92e07a21fe..1213a883ef0 100644 --- a/src/test/run-fail/diverging-closure.rs +++ b/src/test/ui/closures/diverging-closure.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:oops +// ignore-emscripten no processes fn main() { let func = || -> ! { diff --git a/src/test/run-fail/promoted_div_by_zero.rs b/src/test/ui/consts/promoted_div_by_zero.rs index dc6719ce025..b4503f691ff 100644 --- a/src/test/run-fail/promoted_div_by_zero.rs +++ b/src/test/ui/consts/promoted_div_by_zero.rs @@ -1,6 +1,8 @@ #![allow(unconditional_panic, const_err)] +// run-fail // error-pattern: attempt to divide by zero +// ignore-emscripten no processes fn main() { let x = &(1 / (1 - 1)); diff --git a/src/test/run-fail/expr-fn-panic.rs b/src/test/ui/fn/expr-fn-panic.rs index 0532c32ec70..123b57f97a4 100644 --- a/src/test/run-fail/expr-fn-panic.rs +++ b/src/test/ui/fn/expr-fn-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn f() -> ! { panic!() diff --git a/src/test/run-fail/generator-resume-after-panic.rs b/src/test/ui/generator/generator-resume-after-panic.rs index 1a7c2e80629..55704f40e9f 100644 --- a/src/test/run-fail/generator-resume-after-panic.rs +++ b/src/test/ui/generator/generator-resume-after-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:generator resumed after panicking +// ignore-emscripten no processes // Test that we get the correct message for resuming a panicked generator. diff --git a/src/test/run-fail/hashmap-capacity-overflow.rs b/src/test/ui/hashmap/hashmap-capacity-overflow.rs index 038f2756ff3..5f88683f4ad 100644 --- a/src/test/run-fail/hashmap-capacity-overflow.rs +++ b/src/test/ui/hashmap/hashmap-capacity-overflow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:capacity overflow +// ignore-emscripten no processes use std::collections::hash_map::HashMap; use std::usize; diff --git a/src/test/ui/hashmap-iter-value-lifetime.nll.stderr b/src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr index 312a91adca6..312a91adca6 100644 --- a/src/test/ui/hashmap-iter-value-lifetime.nll.stderr +++ b/src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr diff --git a/src/test/ui/hashmap-iter-value-lifetime.rs b/src/test/ui/hashmap/hashmap-iter-value-lifetime.rs index 260ea8c7ae1..260ea8c7ae1 100644 --- a/src/test/ui/hashmap-iter-value-lifetime.rs +++ b/src/test/ui/hashmap/hashmap-iter-value-lifetime.rs diff --git a/src/test/ui/hashmap-iter-value-lifetime.stderr b/src/test/ui/hashmap/hashmap-iter-value-lifetime.stderr index f7626b13bad..f7626b13bad 100644 --- a/src/test/ui/hashmap-iter-value-lifetime.stderr +++ b/src/test/ui/hashmap/hashmap-iter-value-lifetime.stderr diff --git a/src/test/ui/hashmap-lifetimes.nll.stderr b/src/test/ui/hashmap/hashmap-lifetimes.nll.stderr index aa8e890c168..aa8e890c168 100644 --- a/src/test/ui/hashmap-lifetimes.nll.stderr +++ b/src/test/ui/hashmap/hashmap-lifetimes.nll.stderr diff --git a/src/test/ui/hashmap-lifetimes.rs b/src/test/ui/hashmap/hashmap-lifetimes.rs index 295bf3b0e66..295bf3b0e66 100644 --- a/src/test/ui/hashmap-lifetimes.rs +++ b/src/test/ui/hashmap/hashmap-lifetimes.rs diff --git a/src/test/ui/hashmap-lifetimes.stderr b/src/test/ui/hashmap/hashmap-lifetimes.stderr index 497c7d1216c..497c7d1216c 100644 --- a/src/test/ui/hashmap-lifetimes.stderr +++ b/src/test/ui/hashmap/hashmap-lifetimes.stderr diff --git a/src/test/ui/hashmap-memory.rs b/src/test/ui/hashmap/hashmap-memory.rs index 3129eb0da82..3129eb0da82 100644 --- a/src/test/ui/hashmap-memory.rs +++ b/src/test/ui/hashmap/hashmap-memory.rs diff --git a/src/test/run-fail/expr-if-panic-fn.rs b/src/test/ui/if/expr-if-panic-fn.rs index 660b1396e38..36e49785a49 100644 --- a/src/test/run-fail/expr-if-panic-fn.rs +++ b/src/test/ui/if/expr-if-panic-fn.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn f() -> ! { panic!() diff --git a/src/test/run-fail/expr-if-panic.rs b/src/test/ui/if/expr-if-panic.rs index 36aaf459a56..520ee0870ee 100644 --- a/src/test/run-fail/expr-if-panic.rs +++ b/src/test/ui/if/expr-if-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn main() { let _x = if false { diff --git a/src/test/run-fail/if-check-panic.rs b/src/test/ui/if/if-check-panic.rs index f9a4b8fcb38..037cd427ccf 100644 --- a/src/test/run-fail/if-check-panic.rs +++ b/src/test/ui/if/if-check-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:Number is odd +// ignore-emscripten no processes + fn even(x: usize) -> bool { if x < 2 { return false; diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/ui/if/if-cond-bot.rs index c680cad258f..bcd11467852 100644 --- a/src/test/run-fail/if-cond-bot.rs +++ b/src/test/ui/if/if-cond-bot.rs @@ -1,8 +1,12 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } + fn main() { if my_err("bye".to_string()) { } diff --git a/src/test/run-fail/glob-use-std.rs b/src/test/ui/imports/glob-use-std.rs index d19a782986b..ef06cc570d5 100644 --- a/src/test/run-fail/glob-use-std.rs +++ b/src/test/ui/imports/glob-use-std.rs @@ -1,6 +1,8 @@ // Issue #7580 +// run-fail // error-pattern:panic works +// ignore-emscripten no processes use std::*; diff --git a/src/test/run-fail/issue-12920.rs b/src/test/ui/issues/issue-12920.rs index 0819e992d13..a0cfea055be 100644 --- a/src/test/run-fail/issue-12920.rs +++ b/src/test/ui/issues/issue-12920.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes pub fn main() { panic!(); diff --git a/src/test/run-fail/issue-13202.rs b/src/test/ui/issues/issue-13202.rs index cf3a6b3d986..16debb5b6c4 100644 --- a/src/test/run-fail/issue-13202.rs +++ b/src/test/ui/issues/issue-13202.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:bad input +// ignore-emscripten no processes fn main() { Some("foo").unwrap_or(panic!("bad input")).to_string(); diff --git a/src/test/run-fail/issue-18576.rs b/src/test/ui/issues/issue-18576.rs index ca9d1e5f5e7..389cf108b05 100644 --- a/src/test/run-fail/issue-18576.rs +++ b/src/test/ui/issues/issue-18576.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:stop +// ignore-emscripten no processes // #18576 // Make sure that calling an extern function pointer in an unreachable @@ -10,4 +12,5 @@ fn main() { let pointer = other; pointer(); } + extern "C" fn other() {} diff --git a/src/test/run-fail/issue-20971.rs b/src/test/ui/issues/issue-20971.rs index 6c2de783c01..2e10418178c 100644 --- a/src/test/run-fail/issue-20971.rs +++ b/src/test/ui/issues/issue-20971.rs @@ -1,6 +1,8 @@ // Regression test for Issue #20971. +// run-fail // error-pattern:Hello, world! +// ignore-emscripten no processes pub trait Parser { type Input; @@ -12,7 +14,7 @@ impl Parser for () { fn parse(&mut self, input: ()) {} } -pub fn many() -> Box<Parser<Input = <() as Parser>::Input> + 'static> { +pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> { panic!("Hello, world!") } diff --git a/src/test/run-fail/issue-23354-2.rs b/src/test/ui/issues/issue-23354-2.rs index 8f7baff56dc..c291d8a5eaf 100644 --- a/src/test/run-fail/issue-23354-2.rs +++ b/src/test/ui/issues/issue-23354-2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panic evaluated +// ignore-emscripten no processes #[allow(unused_variables)] fn main() { diff --git a/src/test/run-fail/issue-23354.rs b/src/test/ui/issues/issue-23354.rs index 4c2fb022a6b..8b7c2eef2fc 100644 --- a/src/test/run-fail/issue-23354.rs +++ b/src/test/ui/issues/issue-23354.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panic evaluated +// ignore-emscripten no processes #[allow(unused_variables)] fn main() { diff --git a/src/test/run-fail/issue-2444.rs b/src/test/ui/issues/issue-2444.rs index 17f89e4d20d..ac0d0506a34 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/ui/issues/issue-2444.rs @@ -1,12 +1,14 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes use std::sync::Arc; -enum e<T> { - ee(Arc<T>), +enum Err<T> { + Errr(Arc<T>), } -fn foo() -> e<isize> { +fn foo() -> Err<isize> { panic!(); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/ui/issues/issue-2470-bounds-check-overflow.rs index b4e3f246991..f0e8e185e56 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/ui/issues/issue-2470-bounds-check-overflow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds +// ignore-emscripten no processes use std::mem; diff --git a/src/test/run-fail/issue-2761.rs b/src/test/ui/issues/issue-2761.rs index 84d90930d2d..3ba098abbe6 100644 --- a/src/test/run-fail/issue-2761.rs +++ b/src/test/ui/issues/issue-2761.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:custom message +// ignore-emscripten no processes fn main() { assert!(false, "custom message"); diff --git a/src/test/run-fail/issue-28934.rs b/src/test/ui/issues/issue-28934.rs index 5915372b692..1e48878f632 100644 --- a/src/test/run-fail/issue-28934.rs +++ b/src/test/ui/issues/issue-28934.rs @@ -1,7 +1,9 @@ // Regression test: issue had to do with "givens" in region inference, // which were not being considered during the contraction phase. +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes struct Parser<'i: 't, 't>(&'i u8, &'t u8); diff --git a/src/test/run-fail/issue-29798.rs b/src/test/ui/issues/issue-29798.rs index b06aa5fc728..5eff5d1915b 100644 --- a/src/test/run-fail/issue-29798.rs +++ b/src/test/ui/issues/issue-29798.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 5 +// ignore-emscripten no processes const fn test(x: usize) -> i32 { [42;5][x] diff --git a/src/test/run-fail/issue-3029.rs b/src/test/ui/issues/issue-3029.rs index face808b68f..a5d30960a4c 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/ui/issues/issue-3029.rs @@ -1,9 +1,11 @@ +// run-fail +// error-pattern:so long +// ignore-emscripten no processes + #![allow(unused_allocation)] #![allow(unreachable_code)] #![allow(unused_variables)] - -// error-pattern:so long fn main() { let mut x = Vec::new(); let y = vec![3]; diff --git a/src/test/run-fail/issue-30380.rs b/src/test/ui/issues/issue-30380.rs index 036071a89c7..48b329c5de1 100644 --- a/src/test/run-fail/issue-30380.rs +++ b/src/test/ui/issues/issue-30380.rs @@ -1,7 +1,9 @@ // check that panics in destructors during assignment do not leave // destroyed values lying around for other destructors to observe. +// run-fail // error-pattern:panicking destructors ftw! +// ignore-emscripten no processes struct Observer<'a>(&'a mut FilledOnDrop); diff --git a/src/test/run-fail/issue-44216-add-instant.rs b/src/test/ui/issues/issue-44216-add-instant.rs index 76ad0a3d41b..c2f3598f645 100644 --- a/src/test/run-fail/issue-44216-add-instant.rs +++ b/src/test/ui/issues/issue-44216-add-instant.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Instant, Duration}; diff --git a/src/test/run-fail/issue-44216-add-system-time.rs b/src/test/ui/issues/issue-44216-add-system-time.rs index aa861f7d599..9a88cb7c189 100644 --- a/src/test/run-fail/issue-44216-add-system-time.rs +++ b/src/test/ui/issues/issue-44216-add-system-time.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Duration, SystemTime}; diff --git a/src/test/run-fail/issue-44216-sub-instant.rs b/src/test/ui/issues/issue-44216-sub-instant.rs index 8bc1f47ae2d..2decd88bbc0 100644 --- a/src/test/run-fail/issue-44216-sub-instant.rs +++ b/src/test/ui/issues/issue-44216-sub-instant.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Instant, Duration}; diff --git a/src/test/run-fail/issue-44216-sub-system-time.rs b/src/test/ui/issues/issue-44216-sub-system-time.rs index 37ab0e7c3f9..e58a31a41a5 100644 --- a/src/test/run-fail/issue-44216-sub-system-time.rs +++ b/src/test/ui/issues/issue-44216-sub-system-time.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Duration, SystemTime}; diff --git a/src/test/run-fail/issue-51345.rs b/src/test/ui/issues/issue-51345-2.rs index c62f98ea78d..52f342a8500 100644 --- a/src/test/run-fail/issue-51345.rs +++ b/src/test/ui/issues/issue-51345-2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern: thread 'main' panicked at 'explicit panic' +// ignore-emscripten no processes fn main() { let mut vec = vec![]; diff --git a/src/test/run-fail/issue-6458-1.rs b/src/test/ui/issues/issue-6458-1.rs index 550bb2b832f..184e4832b90 100644 --- a/src/test/run-fail/issue-6458-1.rs +++ b/src/test/ui/issues/issue-6458-1.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn foo<T>(t: T) {} fn main() { diff --git a/src/test/ui/issues/issue-811.rs b/src/test/ui/issues/issue-811.rs new file mode 100644 index 00000000000..f929d388819 --- /dev/null +++ b/src/test/ui/issues/issue-811.rs @@ -0,0 +1,26 @@ +// run-fail +// error-pattern:quux +// ignore-emscripten no processes + +use std::marker::PhantomData; + +fn test00_start(ch: Chan<isize>, message: isize) { + send(ch, message); +} + +type TaskId = isize; +type PortId = isize; + +struct Chan<T> { + task: TaskId, + port: PortId, + marker: PhantomData<*mut T>, +} + +fn send<T: Send>(_ch: Chan<T>, _data: T) { + panic!(); +} + +fn main() { + panic!("quux"); +} diff --git a/src/test/run-fail/issue-948.rs b/src/test/ui/issues/issue-948.rs index 8f1c6587f03..b9bbeb3951e 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/ui/issues/issue-948.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:beep boop +// ignore-emscripten no processes #![allow(unused_variables)] diff --git a/src/test/run-fail/for-each-loop-panic.rs b/src/test/ui/loops/for-each-loop-panic.rs index d24e81e152c..5156999f4db 100644 --- a/src/test/run-fail/for-each-loop-panic.rs +++ b/src/test/ui/loops/for-each-loop-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:moop +// ignore-emscripten no processes fn main() { for _ in 0_usize..10_usize { diff --git a/src/test/run-fail/assert-as-macro.rs b/src/test/ui/macros/assert-as-macro.rs index f715e21f781..23c05480813 100644 --- a/src/test/run-fail/assert-as-macro.rs +++ b/src/test/ui/macros/assert-as-macro.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:assertion failed: 1 == 2 +// ignore-emscripten no processes fn main() { assert!(1 == 2); diff --git a/src/test/run-fail/assert-eq-macro-panic.rs b/src/test/ui/macros/assert-eq-macro-panic.rs index 863fec12d74..5e505c30b35 100644 --- a/src/test/run-fail/assert-eq-macro-panic.rs +++ b/src/test/ui/macros/assert-eq-macro-panic.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:assertion failed: `(left == right)` // error-pattern: left: `14` // error-pattern:right: `15` +// ignore-emscripten no processes fn main() { assert_eq!(14, 15); diff --git a/src/test/run-fail/assert-macro-explicit.rs b/src/test/ui/macros/assert-macro-explicit.rs index 3689323c999..578ef563278 100644 --- a/src/test/run-fail/assert-macro-explicit.rs +++ b/src/test/ui/macros/assert-macro-explicit.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'assertion failed: false' +// ignore-emscripten no processes fn main() { assert!(false); diff --git a/src/test/run-fail/assert-macro-fmt.rs b/src/test/ui/macros/assert-macro-fmt.rs index 9fbfb085c2f..b8d319d85f4 100644 --- a/src/test/run-fail/assert-macro-fmt.rs +++ b/src/test/ui/macros/assert-macro-fmt.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-assert-fmt 42 rust' +// ignore-emscripten no processes fn main() { assert!(false, "test-assert-fmt {} {}", 42, "rust"); diff --git a/src/test/run-fail/assert-macro-owned.rs b/src/test/ui/macros/assert-macro-owned.rs index bd58d35eb71..b50fe65c015 100644 --- a/src/test/run-fail/assert-macro-owned.rs +++ b/src/test/ui/macros/assert-macro-owned.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-assert-owned' +// ignore-emscripten no processes fn main() { assert!(false, "test-assert-owned".to_string()); diff --git a/src/test/run-fail/assert-macro-static.rs b/src/test/ui/macros/assert-macro-static.rs index 650aaeab4f6..dc5274a7e88 100644 --- a/src/test/run-fail/assert-macro-static.rs +++ b/src/test/ui/macros/assert-macro-static.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-assert-static' +// ignore-emscripten no processes fn main() { assert!(false, "test-assert-static"); diff --git a/src/test/run-fail/assert-ne-macro-panic.rs b/src/test/ui/macros/assert-ne-macro-panic.rs index f55ef2b3ff5..4f507d7b54d 100644 --- a/src/test/run-fail/assert-ne-macro-panic.rs +++ b/src/test/ui/macros/assert-ne-macro-panic.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:assertion failed: `(left != right)` // error-pattern: left: `14` // error-pattern:right: `14` +// ignore-emscripten no processes fn main() { assert_ne!(14, 14); diff --git a/src/test/run-fail/die-macro.rs b/src/test/ui/macros/die-macro-2.rs index 846b9ea24d3..ebbce528a18 100644 --- a/src/test/run-fail/die-macro.rs +++ b/src/test/ui/macros/die-macro-2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:test +// ignore-emscripten no processes fn main() { panic!("test"); diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/ui/macros/die-macro-expr.rs index 70413f97896..c4b5f68ddf9 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/ui/macros/die-macro-expr.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:test +// ignore-emscripten no processes fn main() { let __isize: isize = panic!("test"); diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/ui/macros/die-macro-pure.rs index cec0742d503..588fbe61b0e 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/ui/macros/die-macro-pure.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:test +// ignore-emscripten no processes fn f() { panic!("test"); diff --git a/src/test/run-fail/unimplemented-macro-panic.rs b/src/test/ui/macros/unimplemented-macro-panic.rs index 4d9cb740fc6..e7169903f8e 100644 --- a/src/test/run-fail/unimplemented-macro-panic.rs +++ b/src/test/ui/macros/unimplemented-macro-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:not implemented +// ignore-emscripten no processes + fn main() { unimplemented!() } diff --git a/src/test/run-fail/unreachable-fmt-msg.rs b/src/test/ui/macros/unreachable-fmt-msg.rs index ac2a52163b4..eb17ed92711 100644 --- a/src/test/run-fail/unreachable-fmt-msg.rs +++ b/src/test/ui/macros/unreachable-fmt-msg.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code: 6 is not prime +// ignore-emscripten no processes + fn main() { unreachable!("{} is not {}", 6u32, "prime"); } diff --git a/src/test/run-fail/unreachable-macro-panic.rs b/src/test/ui/macros/unreachable-macro-panic.rs index 597a0144722..55e2102e2cc 100644 --- a/src/test/run-fail/unreachable-macro-panic.rs +++ b/src/test/ui/macros/unreachable-macro-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code +// ignore-emscripten no processes + fn main() { unreachable!() } diff --git a/src/test/run-fail/unreachable-static-msg.rs b/src/test/ui/macros/unreachable-static-msg.rs index 40a2881cc57..55edf3af7d9 100644 --- a/src/test/run-fail/unreachable-static-msg.rs +++ b/src/test/ui/macros/unreachable-static-msg.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code: uhoh +// ignore-emscripten no processes + fn main() { unreachable!("uhoh") } diff --git a/src/test/run-fail/unreachable.rs b/src/test/ui/macros/unreachable.rs index 597a0144722..55e2102e2cc 100644 --- a/src/test/run-fail/unreachable.rs +++ b/src/test/ui/macros/unreachable.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code +// ignore-emscripten no processes + fn main() { unreachable!() } diff --git a/src/test/run-fail/expr-match-panic-fn.rs b/src/test/ui/match/expr-match-panic-fn.rs index 120df61b4bf..ea471717e88 100644 --- a/src/test/run-fail/expr-match-panic-fn.rs +++ b/src/test/ui/match/expr-match-panic-fn.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn f() -> ! { panic!() diff --git a/src/test/run-fail/expr-match-panic.rs b/src/test/ui/match/expr-match-panic.rs index b2f0179a083..53f8a8bd30d 100644 --- a/src/test/run-fail/expr-match-panic.rs +++ b/src/test/ui/match/expr-match-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn main() { let _x = match true { diff --git a/src/test/run-fail/match-bot-panic.rs b/src/test/ui/match/match-bot-panic.rs index f4da8c4e43f..e4a6f6d6fe4 100644 --- a/src/test/run-fail/match-bot-panic.rs +++ b/src/test/ui/match/match-bot-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/src/test/run-fail/match-disc-bot.rs b/src/test/ui/match/match-disc-bot.rs index a9312fbb1fb..18cfd5e2395 100644 --- a/src/test/run-fail/match-disc-bot.rs +++ b/src/test/ui/match/match-disc-bot.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn f() -> ! { panic!("quux") } diff --git a/src/test/run-fail/match-wildcards.rs b/src/test/ui/match/match-wildcards.rs index 7a65ad52558..43f6e4913ac 100644 --- a/src/test/run-fail/match-wildcards.rs +++ b/src/test/ui/match/match-wildcards.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:squirrelcupcake +// ignore-emscripten no processes + fn cmp() -> isize { match (Some('a'), None::<char>) { (Some(_), _) => { diff --git a/src/test/run-fail/meta-revision-bad.rs b/src/test/ui/meta-revision-bad.rs index 17f6398b735..01f1518c1c6 100644 --- a/src/test/run-fail/meta-revision-bad.rs +++ b/src/test/ui/meta-revision-bad.rs @@ -1,6 +1,7 @@ // Meta test for compiletest: check that when we give the wrong error // patterns, the test fails. +// run-fail // revisions: foo bar // should-fail //[foo] error-pattern:bar diff --git a/src/test/run-fail/meta-revision-ok.rs b/src/test/ui/meta-revision-ok.rs index 8693ee5f4ef..7df9a6ea48f 100644 --- a/src/test/run-fail/meta-revision-ok.rs +++ b/src/test/ui/meta-revision-ok.rs @@ -1,9 +1,11 @@ // Meta test for compiletest: check that when we give the right error // patterns, the test passes. See all `meta-revision-bad.rs`. +// run-fail // revisions: foo bar //[foo] error-pattern:foo //[bar] error-pattern:bar +// ignore-emscripten no processes #[cfg(foo)] fn die() { diff --git a/src/test/run-fail/mir_codegen_calls_converging_drops.rs b/src/test/ui/mir/mir_codegen_calls_converging_drops.rs index ee0dc98ce68..b562f930814 100644 --- a/src/test/run-fail/mir_codegen_calls_converging_drops.rs +++ b/src/test/ui/mir/mir_codegen_calls_converging_drops.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:converging_fn called // error-pattern:0 dropped // error-pattern:exit +// ignore-emscripten no processes struct Droppable(u8); impl Drop for Droppable { diff --git a/src/test/run-fail/mir_codegen_calls_converging_drops_2.rs b/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs index ee2c25ce856..e9446da9e39 100644 --- a/src/test/run-fail/mir_codegen_calls_converging_drops_2.rs +++ b/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:complex called // error-pattern:dropped // error-pattern:exit +// ignore-emscripten no processes struct Droppable; impl Drop for Droppable { diff --git a/src/test/run-fail/mir_codegen_calls_diverging.rs b/src/test/ui/mir/mir_codegen_calls_diverging.rs index dceae0a4e4a..736d580e2da 100644 --- a/src/test/run-fail/mir_codegen_calls_diverging.rs +++ b/src/test/ui/mir/mir_codegen_calls_diverging.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:diverging_fn called +// ignore-emscripten no processes fn diverging_fn() -> ! { panic!("diverging_fn called") diff --git a/src/test/run-fail/mir_codegen_calls_diverging_drops.rs b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs index 187e526f7c0..796d7447793 100644 --- a/src/test/run-fail/mir_codegen_calls_diverging_drops.rs +++ b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:diverging_fn called // error-pattern:0 dropped +// ignore-emscripten no processes struct Droppable(u8); impl Drop for Droppable { diff --git a/src/test/run-fail/mir_drop_panics.rs b/src/test/ui/mir/mir_drop_panics.rs index bda555b9262..bf269ee901b 100644 --- a/src/test/run-fail/mir_drop_panics.rs +++ b/src/test/ui/mir/mir_drop_panics.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:panic 1 // error-pattern:drop 2 +// ignore-emscripten no processes struct Droppable(u32); impl Drop for Droppable { diff --git a/src/test/run-fail/mir_dynamic_drops_1.rs b/src/test/ui/mir/mir_dynamic_drops_1.rs index db8d0af29db..a77b2368d3b 100644 --- a/src/test/run-fail/mir_dynamic_drops_1.rs +++ b/src/test/ui/mir/mir_dynamic_drops_1.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:drop 1 // error-pattern:drop 2 // ignore-cloudabi no std::process +// ignore-emscripten no processes /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/src/test/run-fail/mir_dynamic_drops_2.rs b/src/test/ui/mir/mir_dynamic_drops_2.rs index 21d3a042b1e..088a16d3387 100644 --- a/src/test/run-fail/mir_dynamic_drops_2.rs +++ b/src/test/ui/mir/mir_dynamic_drops_2.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:drop 1 // ignore-cloudabi no std::process +// ignore-emscripten no processes /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/src/test/run-fail/mir_dynamic_drops_3.rs b/src/test/ui/mir/mir_dynamic_drops_3.rs index b9049968682..029bdcd9a15 100644 --- a/src/test/run-fail/mir_dynamic_drops_3.rs +++ b/src/test/ui/mir/mir_dynamic_drops_3.rs @@ -1,8 +1,10 @@ +// run-fail // error-pattern:unwind happens // error-pattern:drop 3 // error-pattern:drop 2 // error-pattern:drop 1 // ignore-cloudabi no std::process +// ignore-emscripten no processes /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/src/test/run-fail/mir_indexing_oob_1.rs b/src/test/ui/mir/mir_indexing_oob_1.rs index 1cd53e309eb..6d769b6b23a 100644 --- a/src/test/run-fail/mir_indexing_oob_1.rs +++ b/src/test/ui/mir/mir_indexing_oob_1.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 10 +// ignore-emscripten no processes const C: [u32; 5] = [0; 5]; diff --git a/src/test/run-fail/mir_indexing_oob_2.rs b/src/test/ui/mir/mir_indexing_oob_2.rs index 64b260993c9..a9e85057015 100644 --- a/src/test/run-fail/mir_indexing_oob_2.rs +++ b/src/test/ui/mir/mir_indexing_oob_2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 10 +// ignore-emscripten no processes const C: &'static [u8; 5] = b"hello"; diff --git a/src/test/run-fail/mir_indexing_oob_3.rs b/src/test/ui/mir/mir_indexing_oob_3.rs index 3688088439b..4f5cab59bfc 100644 --- a/src/test/run-fail/mir_indexing_oob_3.rs +++ b/src/test/ui/mir/mir_indexing_oob_3.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 10 +// ignore-emscripten no processes const C: &'static [u8; 5] = b"hello"; diff --git a/src/test/run-fail/return-never-coerce.rs b/src/test/ui/never_type/return-never-coerce.rs index 18182ff0f9d..d615940eff1 100644 --- a/src/test/run-fail/return-never-coerce.rs +++ b/src/test/ui/never_type/return-never-coerce.rs @@ -1,6 +1,8 @@ // Test that ! coerces to other types. +// run-fail // error-pattern:aah! +// ignore-emscripten no processes fn call_another_fn<T, F: FnOnce() -> T>(f: F) -> T { f() diff --git a/src/test/run-fail/divide-by-zero.rs b/src/test/ui/numbers-arithmetic/divide-by-zero.rs index ba93563154a..30e0e6c1bdd 100644 --- a/src/test/run-fail/divide-by-zero.rs +++ b/src/test/ui/numbers-arithmetic/divide-by-zero.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:attempt to divide by zero +// ignore-emscripten no processes + #[allow(unconditional_panic)] fn main() { let y = 0; diff --git a/src/test/run-fail/mod-zero.rs b/src/test/ui/numbers-arithmetic/mod-zero.rs index f70b3ac920c..08371639412 100644 --- a/src/test/run-fail/mod-zero.rs +++ b/src/test/ui/numbers-arithmetic/mod-zero.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:attempt to calculate the remainder with a divisor of zero +// ignore-emscripten no processes + #[allow(unconditional_panic)] fn main() { let y = 0; diff --git a/src/test/run-fail/overflowing-add.rs b/src/test/ui/numbers-arithmetic/overflowing-add.rs index 5ca91314d95..b0f22a74b4a 100644 --- a/src/test/run-fail/overflowing-add.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-add.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to add with overflow' // compile-flags: -C debug-assertions +// ignore-emscripten no processes #![allow(arithmetic_overflow)] diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs new file mode 100644 index 00000000000..e5ce8033639 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _x = 1_i32 << 32; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr new file mode 100644 index 00000000000..54008d33968 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-lsh-1.rs:7:14 + | +LL | let _x = 1_i32 << 32; + | ^^^^^^^^^^^ attempt to shift left with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-lsh-1.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs new file mode 100644 index 00000000000..7fd3407a056 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _x = 1 << -1; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr new file mode 100644 index 00000000000..872e71bb737 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-lsh-2.rs:7:14 + | +LL | let _x = 1 << -1; + | ^^^^^^^ attempt to shift left with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-lsh-2.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs new file mode 100644 index 00000000000..e007eb4a2e2 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _x = 1_u64 << 64; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr new file mode 100644 index 00000000000..d55ed4a046c --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-lsh-3.rs:7:14 + | +LL | let _x = 1_u64 << 64; + | ^^^^^^^^^^^ attempt to shift left with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-lsh-3.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/run-fail/overflowing-lsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs index 0d3912ce13f..738d0133915 100644 --- a/src/test/run-fail/overflowing-lsh-4.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs @@ -1,15 +1,15 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' +// build-fail // compile-flags: -C debug-assertions // This function is checking that our automatic truncation does not // sidestep the overflow checking. -#![warn(arithmetic_overflow)] -#![warn(const_err)] +#![deny(arithmetic_overflow, const_err)] fn main() { // this signals overflow when checking is on let x = 1_i8 << 17; + //~^ ERROR: this arithmetic operation will overflow // ... but when checking is off, the fallback will truncate the // input to its lower three bits (= 1). Note that this is *not* diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr new file mode 100644 index 00000000000..1ef8dd3466c --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-lsh-4.rs:11:13 + | +LL | let x = 1_i8 << 17; + | ^^^^^^^^^^ attempt to shift left with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-lsh-4.rs:7:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/run-fail/overflowing-mul.rs b/src/test/ui/numbers-arithmetic/overflowing-mul.rs index 2dfc9bb5ae4..34ab5d8fad5 100644 --- a/src/test/run-fail/overflowing-mul.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-mul.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/src/test/run-fail/overflowing-neg.rs b/src/test/ui/numbers-arithmetic/overflowing-neg.rs index f512aa35bed..fe77544641c 100644 --- a/src/test/run-fail/overflowing-neg.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-neg.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to negate with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/src/test/run-fail/overflowing-pow-signed.rs b/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs index c539c685faf..b59efe6f212 100644 --- a/src/test/run-fail/overflowing-pow-signed.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions fn main() { diff --git a/src/test/run-fail/overflowing-pow-unsigned.rs b/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs index 1d4fa3b5c7e..f2643c16463 100644 --- a/src/test/run-fail/overflowing-pow-unsigned.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions fn main() { diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs new file mode 100644 index 00000000000..f1488cf8559 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _x = -1_i32 >> 32; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr new file mode 100644 index 00000000000..236303e2e9a --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-rsh-1.rs:7:14 + | +LL | let _x = -1_i32 >> 32; + | ^^^^^^^^^^^^ attempt to shift right with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-rsh-1.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs new file mode 100644 index 00000000000..39127b9703b --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _x = -1_i32 >> -1; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr new file mode 100644 index 00000000000..981c8986f76 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-rsh-2.rs:7:14 + | +LL | let _x = -1_i32 >> -1; + | ^^^^^^^^^^^^ attempt to shift right with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-rsh-2.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs new file mode 100644 index 00000000000..8ee6dde93ea --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _x = -1_i64 >> 64; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr new file mode 100644 index 00000000000..c2994503f0e --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-rsh-3.rs:7:14 + | +LL | let _x = -1_i64 >> 64; + | ^^^^^^^^^^^^ attempt to shift right with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-rsh-3.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/run-fail/overflowing-rsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs index 1877d5c9685..ce7f818e330 100644 --- a/src/test/run-fail/overflowing-rsh-4.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs @@ -1,15 +1,15 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' +// build-fail // compile-flags: -C debug-assertions // This function is checking that our (type-based) automatic // truncation does not sidestep the overflow checking. -#![warn(arithmetic_overflow)] -#![warn(const_err)] +#![deny(arithmetic_overflow, const_err)] fn main() { // this signals overflow when checking is on let x = 2_i8 >> 17; + //~^ ERROR: this arithmetic operation will overflow // ... but when checking is off, the fallback will truncate the // input to its lower three bits (= 1). Note that this is *not* diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr new file mode 100644 index 00000000000..3db1da06dbe --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-rsh-4.rs:11:13 + | +LL | let x = 2_i8 >> 17; + | ^^^^^^^^^^ attempt to shift right with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-rsh-4.rs:7:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs new file mode 100644 index 00000000000..88928c99596 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _n = 1i64 >> [64][0]; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr new file mode 100644 index 00000000000..bd3eae82977 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-rsh-5.rs:7:14 + | +LL | let _n = 1i64 >> [64][0]; + | ^^^^^^^^^^^^^^^ attempt to shift right with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-rsh-5.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs new file mode 100644 index 00000000000..88928c99596 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs @@ -0,0 +1,9 @@ +// build-fail +// compile-flags: -C debug-assertions + +#![deny(arithmetic_overflow, const_err)] + +fn main() { + let _n = 1i64 >> [64][0]; + //~^ ERROR: this arithmetic operation will overflow +} diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr new file mode 100644 index 00000000000..5d76639fb50 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr @@ -0,0 +1,14 @@ +error: this arithmetic operation will overflow + --> $DIR/overflowing-rsh-6.rs:7:14 + | +LL | let _n = 1i64 >> [64][0]; + | ^^^^^^^^^^^^^^^ attempt to shift right with overflow + | +note: the lint level is defined here + --> $DIR/overflowing-rsh-6.rs:4:9 + | +LL | #![deny(arithmetic_overflow, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/run-fail/overflowing-sub.rs b/src/test/ui/numbers-arithmetic/overflowing-sub.rs index fb096c31957..66685ac961a 100644 --- a/src/test/run-fail/overflowing-sub.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-sub.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to subtract with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/src/test/run-fail/promoted_overflow.rs b/src/test/ui/numbers-arithmetic/promoted_overflow.rs index 3c42da4b1d8..da59e81ed6b 100644 --- a/src/test/run-fail/promoted_overflow.rs +++ b/src/test/ui/numbers-arithmetic/promoted_overflow.rs @@ -1,5 +1,6 @@ #![allow(arithmetic_overflow)] +// run-fail // error-pattern: overflow // compile-flags: -C overflow-checks=yes diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/ui/panic-runtime/unwind-interleaved.rs index c163678ae98..a8b3f349309 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/ui/panic-runtime/unwind-interleaved.rs @@ -1,4 +1,6 @@ -// error-pattern:fail +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes fn a() {} diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/ui/panic-runtime/unwind-rec.rs index 83ac19ff4a5..a9b7ee8ec7d 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/ui/panic-runtime/unwind-rec.rs @@ -1,5 +1,6 @@ -// error-pattern:fail - +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes fn build() -> Vec<isize> { panic!(); diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/ui/panic-runtime/unwind-rec2.rs index 4dfc282b6c0..a130f9e879f 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/ui/panic-runtime/unwind-rec2.rs @@ -1,5 +1,6 @@ -// error-pattern:fail - +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes fn build1() -> Vec<isize> { vec![0, 0, 0, 0, 0, 0, 0] diff --git a/src/test/ui/panic-runtime/unwind-unique.rs b/src/test/ui/panic-runtime/unwind-unique.rs new file mode 100644 index 00000000000..d66e39110ea --- /dev/null +++ b/src/test/ui/panic-runtime/unwind-unique.rs @@ -0,0 +1,12 @@ +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes + +fn failfn() { + panic!(); +} + +fn main() { + Box::new(0); + failfn(); +} diff --git a/src/test/run-fail/args-panic.rs b/src/test/ui/panics/args-panic.rs index 9a62652dde1..322054caf11 100644 --- a/src/test/run-fail/args-panic.rs +++ b/src/test/ui/panics/args-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:meep +// ignore-emscripten no processes #![feature(box_syntax)] diff --git a/src/test/run-fail/doublepanic.rs b/src/test/ui/panics/doublepanic.rs index 10d303e491e..c1fcc875c36 100644 --- a/src/test/run-fail/doublepanic.rs +++ b/src/test/ui/panics/doublepanic.rs @@ -1,6 +1,9 @@ #![allow(unreachable_code)] +// run-fail // error-pattern:One +// ignore-emscripten no processes + fn main() { panic!("One"); panic!("Two"); diff --git a/src/test/run-fail/explicit-panic-msg.rs b/src/test/ui/panics/explicit-panic-msg.rs index 35e0518b9be..1789e2e62c8 100644 --- a/src/test/run-fail/explicit-panic-msg.rs +++ b/src/test/ui/panics/explicit-panic-msg.rs @@ -1,7 +1,10 @@ #![allow(unused_assignments)] #![allow(unused_variables)] +// run-fail // error-pattern:wooooo +// ignore-emscripten no processes + fn main() { let mut a = 1; if 1 == 1 { diff --git a/src/test/run-fail/explicit-panic.rs b/src/test/ui/panics/explicit-panic.rs index 11ea6b41221..27c73d3493c 100644 --- a/src/test/run-fail/explicit-panic.rs +++ b/src/test/ui/panics/explicit-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:explicit +// ignore-emscripten no processes + fn main() { panic!(); } diff --git a/src/test/run-fail/fmt-panic.rs b/src/test/ui/panics/fmt-panic.rs index 5749991914c..87fb2e6dd54 100644 --- a/src/test/run-fail/fmt-panic.rs +++ b/src/test/ui/panics/fmt-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:meh +// ignore-emscripten no processes fn main() { let str_var: String = "meh".to_string(); diff --git a/src/test/run-fail/main-panic.rs b/src/test/ui/panics/main-panic.rs index 3a9409562db..023ab470125 100644 --- a/src/test/run-fail/main-panic.rs +++ b/src/test/ui/panics/main-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at +// ignore-emscripten no processes fn main() { panic!() diff --git a/src/test/run-fail/panic-arg.rs b/src/test/ui/panics/panic-arg.rs index c164ff94630..f7c2dbb096f 100644 --- a/src/test/run-fail/panic-arg.rs +++ b/src/test/ui/panics/panic-arg.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:woe +// ignore-emscripten no processes + fn f(a: isize) { println!("{}", a); } diff --git a/src/test/run-fail/panic-macro-any-wrapped.rs b/src/test/ui/panics/panic-macro-any-wrapped.rs index 83eb39a538f..80c87c6f32c 100644 --- a/src/test/run-fail/panic-macro-any-wrapped.rs +++ b/src/test/ui/panics/panic-macro-any-wrapped.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'Box<Any>' +// ignore-emscripten no processes fn main() { panic!(Box::new(612_i64)); diff --git a/src/test/ui/panics/panic-macro-any.rs b/src/test/ui/panics/panic-macro-any.rs new file mode 100644 index 00000000000..ffc7114c1f5 --- /dev/null +++ b/src/test/ui/panics/panic-macro-any.rs @@ -0,0 +1,9 @@ +// run-fail +// error-pattern:panicked at 'Box<Any>' +// ignore-emscripten no processes + +#![feature(box_syntax)] + +fn main() { + panic!(box 413 as Box<dyn std::any::Any + Send>); +} diff --git a/src/test/run-fail/panic-macro-explicit.rs b/src/test/ui/panics/panic-macro-explicit.rs index f632034807c..ac4d6f8128b 100644 --- a/src/test/run-fail/panic-macro-explicit.rs +++ b/src/test/ui/panics/panic-macro-explicit.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'explicit panic' +// ignore-emscripten no processes fn main() { panic!(); diff --git a/src/test/run-fail/panic-macro-fmt.rs b/src/test/ui/panics/panic-macro-fmt.rs index 658ae56e7e4..a755ebc0f4e 100644 --- a/src/test/run-fail/panic-macro-fmt.rs +++ b/src/test/ui/panics/panic-macro-fmt.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-fail-fmt 42 rust' +// ignore-emscripten no processes fn main() { panic!("test-fail-fmt {} {}", 42, "rust"); diff --git a/src/test/run-fail/panic-macro-owned.rs b/src/test/ui/panics/panic-macro-owned.rs index 9b935717638..b898fde77a3 100644 --- a/src/test/run-fail/panic-macro-owned.rs +++ b/src/test/ui/panics/panic-macro-owned.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-fail-owned' +// ignore-emscripten no processes fn main() { panic!("test-fail-owned"); diff --git a/src/test/run-fail/panic-macro-static.rs b/src/test/ui/panics/panic-macro-static.rs index 31ac488beb2..a1d467cbfb5 100644 --- a/src/test/run-fail/panic-macro-static.rs +++ b/src/test/ui/panics/panic-macro-static.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-fail-static' +// ignore-emscripten no processes fn main() { panic!("test-fail-static"); diff --git a/src/test/run-fail/panic-main.rs b/src/test/ui/panics/panic-main.rs index 881eb7b5823..87df7688f0b 100644 --- a/src/test/run-fail/panic-main.rs +++ b/src/test/ui/panics/panic-main.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:moop +// ignore-emscripten no processes + fn main() { panic!("moop"); } diff --git a/src/test/run-fail/panic-parens.rs b/src/test/ui/panics/panic-parens.rs index e7f98e58c4f..59ab5444649 100644 --- a/src/test/run-fail/panic-parens.rs +++ b/src/test/ui/panics/panic-parens.rs @@ -1,6 +1,9 @@ // Fail macros without arguments need to be disambiguated in // certain positions + +// run-fail // error-pattern:oops +// ignore-emscripten no processes fn bigpanic() { while (panic!("oops")) { diff --git a/src/test/run-fail/panic-set-handler.rs b/src/test/ui/panics/panic-set-handler.rs index ea2b152c6c4..3c00183e253 100644 --- a/src/test/run-fail/panic-set-handler.rs +++ b/src/test/ui/panics/panic-set-handler.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:greetings from the panic handler +// ignore-emscripten no processes use std::panic; diff --git a/src/test/run-fail/panic-set-unset-handler.rs b/src/test/ui/panics/panic-set-unset-handler.rs index f8809c2f388..dde0c72f765 100644 --- a/src/test/run-fail/panic-set-unset-handler.rs +++ b/src/test/ui/panics/panic-set-unset-handler.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'foobar' +// ignore-emscripten no processes use std::panic; diff --git a/src/test/run-fail/panic-take-handler-nop.rs b/src/test/ui/panics/panic-take-handler-nop.rs index bb191a38f84..41cbac97c44 100644 --- a/src/test/run-fail/panic-take-handler-nop.rs +++ b/src/test/ui/panics/panic-take-handler-nop.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'foobar' +// ignore-emscripten no processes use std::panic; diff --git a/src/test/run-fail/panic-task-name-none.rs b/src/test/ui/panics/panic-task-name-none.rs index c7f504046ba..4e95fb5bdb8 100644 --- a/src/test/run-fail/panic-task-name-none.rs +++ b/src/test/ui/panics/panic-task-name-none.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern:thread '<unnamed>' panicked at 'test' // ignore-emscripten Needs threads diff --git a/src/test/run-fail/panic-task-name-owned.rs b/src/test/ui/panics/panic-task-name-owned.rs index 58f76ff787f..f85be7bb8e2 100644 --- a/src/test/run-fail/panic-task-name-owned.rs +++ b/src/test/ui/panics/panic-task-name-owned.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern:thread 'owned name' panicked at 'test' // ignore-emscripten Needs threads. diff --git a/src/test/run-fail/panic.rs b/src/test/ui/panics/panic.rs index 95f20dedad2..b6227a582ce 100644 --- a/src/test/run-fail/panic.rs +++ b/src/test/ui/panics/panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:1 == 2 +// ignore-emscripten no processes + fn main() { assert!(1 == 2); } diff --git a/src/test/run-fail/result-get-panic.rs b/src/test/ui/panics/result-get-panic.rs index cddf20ee49d..461f30b9134 100644 --- a/src/test/run-fail/result-get-panic.rs +++ b/src/test/ui/panics/result-get-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:called `Result::unwrap()` on an `Err` value +// ignore-emscripten no processes use std::result::Result::Err; diff --git a/src/test/run-fail/test-panic.rs b/src/test/ui/panics/test-panic.rs index 92f5146b710..85c9279cdf2 100644 --- a/src/test/run-fail/test-panic.rs +++ b/src/test/ui/panics/test-panic.rs @@ -1,5 +1,5 @@ +// run-fail // check-stdout -// error-pattern:thread 'test_foo' panicked at // compile-flags: --test // ignore-emscripten diff --git a/src/test/run-fail/test-should-fail-bad-message.rs b/src/test/ui/panics/test-should-fail-bad-message.rs index 3c69bb07d3b..701f2677648 100644 --- a/src/test/run-fail/test-should-fail-bad-message.rs +++ b/src/test/ui/panics/test-should-fail-bad-message.rs @@ -1,5 +1,5 @@ +// run-fail // check-stdout -// error-pattern:thread 'test_foo' panicked at // compile-flags: --test // ignore-emscripten diff --git a/src/test/run-fail/test-should-panic-bad-message.rs b/src/test/ui/panics/test-should-panic-bad-message.rs index b73d4d7377a..a82c4e1440a 100644 --- a/src/test/run-fail/test-should-panic-bad-message.rs +++ b/src/test/ui/panics/test-should-panic-bad-message.rs @@ -1,7 +1,8 @@ +// run-fail // compile-flags: --test - -// error-pattern:panicked at 'bar' // check-stdout +// ignore-emscripten no processes + #[test] #[should_panic(expected = "foo")] pub fn test_bar() { diff --git a/src/test/run-fail/test-should-panic-no-message.rs b/src/test/ui/panics/test-should-panic-no-message.rs index b18389ec744..13f67a41cdd 100644 --- a/src/test/run-fail/test-should-panic-no-message.rs +++ b/src/test/ui/panics/test-should-panic-no-message.rs @@ -1,7 +1,8 @@ +// run-fail // compile-flags: --test - -// error-pattern:panicked at 'explicit panic' // check-stdout +// ignore-emscripten no processes + #[test] #[should_panic(expected = "foo")] pub fn test_explicit() { diff --git a/src/test/run-fail/unique-panic.rs b/src/test/ui/panics/unique-panic.rs index adefd796af4..22e0d63d594 100644 --- a/src/test/run-fail/unique-panic.rs +++ b/src/test/ui/panics/unique-panic.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern: panic fn main() { diff --git a/src/test/run-fail/while-body-panics.rs b/src/test/ui/panics/while-body-panics.rs index 76acb4ba42d..2c05eb389cc 100644 --- a/src/test/run-fail/while-body-panics.rs +++ b/src/test/ui/panics/while-body-panics.rs @@ -1,6 +1,9 @@ #![allow(while_true)] +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn main() { let _x: isize = { while true { diff --git a/src/test/run-fail/while-panic.rs b/src/test/ui/panics/while-panic.rs index a0827591729..857f65a2252 100644 --- a/src/test/run-fail/while-panic.rs +++ b/src/test/ui/panics/while-panic.rs @@ -1,6 +1,9 @@ #![allow(while_true)] +// run-fail // error-pattern:giraffe +// ignore-emscripten no processes + fn main() { panic!({ while true { diff --git a/src/test/run-fail/tls-exit-status.rs b/src/test/ui/process/tls-exit-status.rs index f15fd4f6894..36d6aff9e77 100644 --- a/src/test/run-fail/tls-exit-status.rs +++ b/src/test/ui/process/tls-exit-status.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:nonzero // exec-env:RUST_NEWRT=1 // ignore-cloudabi no std::env +// ignore-emscripten no processes use std::env; diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs index 796729ac4cc..10dc6115dcb 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:returned Box<dyn Error> from main() // failure-status: 1 +// ignore-emscripten no processes use std::error::Error; use std::io; diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-never.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs index cb37b8e0670..faf2526c8d8 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-never.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:oh, dear +// ignore-emscripten no processes fn main() -> ! { panic!("oh, dear"); diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs index 2f3a73a30ad..6a625fb05e8 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:returned Box<Error> from main() // failure-status: 1 +// ignore-emscripten no processes use std::io::{Error, ErrorKind}; diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-str.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs index bd6fa8af935..94f16c6fd02 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-str.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern: An error message for you // failure-status: 1 +// ignore-emscripten no processes fn main() -> Result<(), &'static str> { Err("An error message for you") diff --git a/src/test/run-fail/str-overrun.rs b/src/test/ui/str/str-overrun.rs index e566308a087..a3ec8941322 100644 --- a/src/test/run-fail/str-overrun.rs +++ b/src/test/ui/str/str-overrun.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 5 +// ignore-emscripten no processes + fn main() { let s: String = "hello".to_string(); diff --git a/src/test/run-fail/rhs-type.rs b/src/test/ui/structs/rhs-type.rs index 6efbeadd704..c48e7c08ed2 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/ui/structs/rhs-type.rs @@ -1,6 +1,9 @@ // Tests that codegen treats the rhs of pth's decl // as a _|_-typed thing, not a str-typed thing + +// run-fail // error-pattern:bye +// ignore-emscripten no processes #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/ui/test-attrs/run-unexported-tests.rs index 11e100e716e..f533a3ef885 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/ui/test-attrs/run-unexported-tests.rs @@ -1,4 +1,4 @@ -// error-pattern:ran an unexported test +// run-fail // compile-flags:--test // check-stdout diff --git a/src/test/run-fail/task-spawn-barefn.rs b/src/test/ui/threads-sendsync/task-spawn-barefn.rs index 497c5ea7180..e5b899e0af9 100644 --- a/src/test/run-fail/task-spawn-barefn.rs +++ b/src/test/ui/threads-sendsync/task-spawn-barefn.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern:Ensure that the child thread runs by panicking // ignore-emscripten Needs threads. diff --git a/src/test/run-fail/test-tasks-invalid-value.rs b/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs index 2dae1b4592c..6411421429c 100644 --- a/src/test/run-fail/test-tasks-invalid-value.rs +++ b/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs @@ -1,6 +1,7 @@ // This checks that RUST_TEST_THREADS not being 1, 2, ... is detected // properly. +// run-fail // error-pattern:should be a positive integer // compile-flags: --test // exec-env:RUST_TEST_THREADS=foo diff --git a/src/test/run-fail/vec-overrun.rs b/src/test/ui/vec/vec-overrun.rs index 2be945f736c..bdc7d507d53 100644 --- a/src/test/run-fail/vec-overrun.rs +++ b/src/test/ui/vec/vec-overrun.rs @@ -1,5 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 1 but the index is 2 - +// ignore-emscripten no processes fn main() { let v: Vec<isize> = vec![10]; |
