From 76d9b309aeee9615f3049e7bf95083bdee4ebe01 Mon Sep 17 00:00:00 2001 From: Tommy Ip Date: Sun, 10 Dec 2017 19:14:01 +0000 Subject: [PATCH] Add must-compile-successfully comment to appropriate ui tests. --- src/test/ui/check_match/issue-43253.rs | 2 ++ src/test/ui/codemap_tests/unicode_3.rs | 2 ++ src/test/ui/explain.rs | 1 + src/test/ui/hello_world/main.rs | 2 ++ src/test/ui/lint/command-line-lint-group-allow.rs | 1 + src/test/ui/lint/command-line-lint-group-warn.rs | 1 + src/test/ui/lint/not_found.rs | 2 ++ src/test/ui/lint/unreachable_pub-pub_crate.rs | 2 ++ src/test/ui/lint/unreachable_pub.rs | 2 ++ src/test/ui/lint/unused_parens_json_suggestion.rs | 1 + src/test/ui/macros/trace-macro.rs | 1 + .../ui/nll/closure-requirements/propagate-approximated-ref.rs | 1 + .../propagate-approximated-shorter-to-static-no-bound.rs | 1 + .../propagate-approximated-shorter-to-static-wrong-bound.rs | 1 + .../ui/nll/closure-requirements/propagate-approximated-val.rs | 1 + .../closure-requirements/propagate-despite-same-free-region.rs | 1 + src/test/ui/nll/maybe-initialized-drop-uninitialized.rs | 1 + src/test/ui/print-fuel/print-fuel.rs | 1 + src/test/ui/print_type_sizes/anonymous.rs | 1 + src/test/ui/print_type_sizes/generics.rs | 1 + src/test/ui/print_type_sizes/multiple_types.rs | 1 + src/test/ui/print_type_sizes/niche-filling.rs | 1 + src/test/ui/print_type_sizes/no_duplicates.rs | 1 + src/test/ui/print_type_sizes/packed.rs | 1 + src/test/ui/print_type_sizes/padding.rs | 1 + src/test/ui/print_type_sizes/repr-align.rs | 1 + src/test/ui/print_type_sizes/uninhabited.rs | 1 + src/test/ui/print_type_sizes/variants.rs | 1 + src/test/ui/reachable/expr_andand.rs | 2 ++ src/test/ui/reachable/expr_oror.rs | 2 ++ src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs | 2 ++ src/test/ui/span/macro-span-replacement.rs | 2 ++ src/test/ui/span/multispan-import-lint.rs | 2 ++ 33 files changed, 44 insertions(+) diff --git a/src/test/ui/check_match/issue-43253.rs b/src/test/ui/check_match/issue-43253.rs index 108d7e1ea22..12ccba0ebf2 100644 --- a/src/test/ui/check_match/issue-43253.rs +++ b/src/test/ui/check_match/issue-43253.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![feature(exclusive_range_pattern)] #![warn(unreachable_patterns)] diff --git a/src/test/ui/codemap_tests/unicode_3.rs b/src/test/ui/codemap_tests/unicode_3.rs index 5294eedb845..81c3b5dde6d 100644 --- a/src/test/ui/codemap_tests/unicode_3.rs +++ b/src/test/ui/codemap_tests/unicode_3.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + fn main() { let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; } println!("{}", s); diff --git a/src/test/ui/explain.rs b/src/test/ui/explain.rs index 17fb59935dd..6305fbcffce 100644 --- a/src/test/ui/explain.rs +++ b/src/test/ui/explain.rs @@ -9,3 +9,4 @@ // except according to those terms. // compile-flags: --explain E0591 +// must-compile-successfully diff --git a/src/test/ui/hello_world/main.rs b/src/test/ui/hello_world/main.rs index 61183975577..4c53d19f719 100644 --- a/src/test/ui/hello_world/main.rs +++ b/src/test/ui/hello_world/main.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + // Test that compiling hello world succeeds with no output of any kind. fn main() { diff --git a/src/test/ui/lint/command-line-lint-group-allow.rs b/src/test/ui/lint/command-line-lint-group-allow.rs index cdb9684933d..c1840f3d44c 100644 --- a/src/test/ui/lint/command-line-lint-group-allow.rs +++ b/src/test/ui/lint/command-line-lint-group-allow.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -A bad-style +// must-compile-successfully fn main() { let _InappropriateCamelCasing = true; diff --git a/src/test/ui/lint/command-line-lint-group-warn.rs b/src/test/ui/lint/command-line-lint-group-warn.rs index 7d65c802788..048c15b1230 100644 --- a/src/test/ui/lint/command-line-lint-group-warn.rs +++ b/src/test/ui/lint/command-line-lint-group-warn.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -W bad-style +// must-compile-successfully fn main() { let _InappropriateCamelCasing = true; diff --git a/src/test/ui/lint/not_found.rs b/src/test/ui/lint/not_found.rs index 5cdc19823cf..3de2cc0bfae 100644 --- a/src/test/ui/lint/not_found.rs +++ b/src/test/ui/lint/not_found.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + // this tests the `unknown_lint` lint, especially the suggestions // the suggestion only appears if a lint with the lowercase name exists diff --git a/src/test/ui/lint/unreachable_pub-pub_crate.rs b/src/test/ui/lint/unreachable_pub-pub_crate.rs index b794f6c9517..4192b7dceef 100644 --- a/src/test/ui/lint/unreachable_pub-pub_crate.rs +++ b/src/test/ui/lint/unreachable_pub-pub_crate.rs @@ -14,6 +14,8 @@ // suggestions to use `crate` given when it is on). When that feature becomes // stable, this test can be deleted. +// must-compile-successfully + #![feature(macro_vis_matcher)] #![allow(unused)] diff --git a/src/test/ui/lint/unreachable_pub.rs b/src/test/ui/lint/unreachable_pub.rs index 5812061dfdb..393bccf03a7 100644 --- a/src/test/ui/lint/unreachable_pub.rs +++ b/src/test/ui/lint/unreachable_pub.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![feature(crate_visibility_modifier)] #![feature(macro_vis_matcher)] diff --git a/src/test/ui/lint/unused_parens_json_suggestion.rs b/src/test/ui/lint/unused_parens_json_suggestion.rs index ad501e66809..fdcd45c8314 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.rs +++ b/src/test/ui/lint/unused_parens_json_suggestion.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: --error-format pretty-json -Zunstable-options +// must-compile-successfully // The output for humans should just highlight the whole span without showing // the suggested replacement, but we also want to test that suggested diff --git a/src/test/ui/macros/trace-macro.rs b/src/test/ui/macros/trace-macro.rs index 34f674ae016..7e6da840900 100644 --- a/src/test/ui/macros/trace-macro.rs +++ b/src/test/ui/macros/trace-macro.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z trace-macros +// must-compile-successfully fn main() { println!("Hello, World!"); diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs index 76a0762461a..006bdaf4c60 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs @@ -28,6 +28,7 @@ // requirement, as you can see from the `#[rustc_regions]` output. // compile-flags:-Znll -Zborrowck=mir -Zverbose +// must-compile-successfully #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs index f776ddc8b15..5bd170cc304 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs @@ -17,6 +17,7 @@ // these errors are not (yet) reported. // compile-flags:-Znll -Zborrowck=mir -Zverbose +// must-compile-successfully #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs index 54b501c9ab6..f4fdd4a8c17 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs @@ -18,6 +18,7 @@ // these errors are not (yet) reported. // compile-flags:-Znll -Zborrowck=mir -Zverbose +// must-compile-successfully #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs index 48d446b00af..97a15a36fdd 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs @@ -16,6 +16,7 @@ // anonymous regions as well. // compile-flags:-Znll -Zborrowck=mir -Zverbose +// must-compile-successfully #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs index a28b5f4c0f9..ba4c287592e 100644 --- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs +++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs @@ -14,6 +14,7 @@ // regions is erased. // compile-flags:-Znll -Zborrowck=mir -Zverbose +// must-compile-successfully #![feature(rustc_attrs)] diff --git a/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs b/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs index 64a4d391000..92b29a98c1c 100644 --- a/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs +++ b/src/test/ui/nll/maybe-initialized-drop-uninitialized.rs @@ -9,6 +9,7 @@ // except according to those terms. //compile-flags: -Z emit-end-regions -Zborrowck=mir -Z nll +// must-compile-successfully #![allow(warnings)] diff --git a/src/test/ui/print-fuel/print-fuel.rs b/src/test/ui/print-fuel/print-fuel.rs index 0d9e243763f..2012a7d02ee 100644 --- a/src/test/ui/print-fuel/print-fuel.rs +++ b/src/test/ui/print-fuel/print-fuel.rs @@ -12,6 +12,7 @@ #![allow(dead_code)] // compile-flags: -Z print-fuel=foo +// must-compile-successfully struct S1(u8, u16, u8); struct S2(u8, u16, u8); diff --git a/src/test/ui/print_type_sizes/anonymous.rs b/src/test/ui/print_type_sizes/anonymous.rs index dc93bddbad8..cf0bedee2ab 100644 --- a/src/test/ui/print_type_sizes/anonymous.rs +++ b/src/test/ui/print_type_sizes/anonymous.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // All of the types that occur in this function are uninteresting, in // that one cannot control the sizes of these types with the same sort diff --git a/src/test/ui/print_type_sizes/generics.rs b/src/test/ui/print_type_sizes/generics.rs index 93bcd1c36e5..7bc4822359e 100644 --- a/src/test/ui/print_type_sizes/generics.rs +++ b/src/test/ui/print_type_sizes/generics.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates how generics are handled: types have to be // monomorphized, in the MIR of the original function in which they diff --git a/src/test/ui/print_type_sizes/multiple_types.rs b/src/test/ui/print_type_sizes/multiple_types.rs index 2b5010767fd..a9f29449015 100644 --- a/src/test/ui/print_type_sizes/multiple_types.rs +++ b/src/test/ui/print_type_sizes/multiple_types.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates that when multiple structural types occur in // a function, every one of them is included in the output. diff --git a/src/test/ui/print_type_sizes/niche-filling.rs b/src/test/ui/print_type_sizes/niche-filling.rs index f1c419d8895..08b58704022 100644 --- a/src/test/ui/print_type_sizes/niche-filling.rs +++ b/src/test/ui/print_type_sizes/niche-filling.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates how niche-filling enums are handled, // modelled after cases like `Option<&u32>`, `Option` and such. diff --git a/src/test/ui/print_type_sizes/no_duplicates.rs b/src/test/ui/print_type_sizes/no_duplicates.rs index 6008a346c05..40c41aae910 100644 --- a/src/test/ui/print_type_sizes/no_duplicates.rs +++ b/src/test/ui/print_type_sizes/no_duplicates.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates that when the same type occurs repeatedly // (even if multiple functions), it is only printed once in the diff --git a/src/test/ui/print_type_sizes/packed.rs b/src/test/ui/print_type_sizes/packed.rs index 7f278e71b21..1ee6395ac6c 100644 --- a/src/test/ui/print_type_sizes/packed.rs +++ b/src/test/ui/print_type_sizes/packed.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates how packing is handled; it should cause // the elimination of padding that would normally be introduced diff --git a/src/test/ui/print_type_sizes/padding.rs b/src/test/ui/print_type_sizes/padding.rs index af34a908ce8..b3cd2132343 100644 --- a/src/test/ui/print_type_sizes/padding.rs +++ b/src/test/ui/print_type_sizes/padding.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates how padding is handled: alignment // requirements can lead to the introduction of padding, either before diff --git a/src/test/ui/print_type_sizes/repr-align.rs b/src/test/ui/print_type_sizes/repr-align.rs index e9b43145de4..1bf76da8115 100644 --- a/src/test/ui/print_type_sizes/repr-align.rs +++ b/src/test/ui/print_type_sizes/repr-align.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates how padding is handled: alignment // requirements can lead to the introduction of padding, either before diff --git a/src/test/ui/print_type_sizes/uninhabited.rs b/src/test/ui/print_type_sizes/uninhabited.rs index 69cc4c93360..fae6cd4009c 100644 --- a/src/test/ui/print_type_sizes/uninhabited.rs +++ b/src/test/ui/print_type_sizes/uninhabited.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully #![feature(never_type)] diff --git a/src/test/ui/print_type_sizes/variants.rs b/src/test/ui/print_type_sizes/variants.rs index 875edb4515a..2725bb09b4b 100644 --- a/src/test/ui/print_type_sizes/variants.rs +++ b/src/test/ui/print_type_sizes/variants.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z print-type-sizes +// must-compile-successfully // This file illustrates two things: // diff --git a/src/test/ui/reachable/expr_andand.rs b/src/test/ui/reachable/expr_andand.rs index af404d03097..7d74daaa6ee 100644 --- a/src/test/ui/reachable/expr_andand.rs +++ b/src/test/ui/reachable/expr_andand.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![allow(unused_variables)] #![allow(dead_code)] #![deny(unreachable_code)] diff --git a/src/test/ui/reachable/expr_oror.rs b/src/test/ui/reachable/expr_oror.rs index d01304d4034..ab0b71f0781 100644 --- a/src/test/ui/reachable/expr_oror.rs +++ b/src/test/ui/reachable/expr_oror.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![allow(unused_variables)] #![allow(dead_code)] #![deny(unreachable_code)] diff --git a/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs b/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs index b24b2d0fb24..eb4753122f3 100644 --- a/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs +++ b/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![feature(fn_must_use)] #![warn(unused_must_use)] diff --git a/src/test/ui/span/macro-span-replacement.rs b/src/test/ui/span/macro-span-replacement.rs index 71f37f6555e..0baa4fb4fe2 100644 --- a/src/test/ui/span/macro-span-replacement.rs +++ b/src/test/ui/span/macro-span-replacement.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![warn(unused)] macro_rules! m { diff --git a/src/test/ui/span/multispan-import-lint.rs b/src/test/ui/span/multispan-import-lint.rs index c3582b0a0c5..5fb0ff7fb70 100644 --- a/src/test/ui/span/multispan-import-lint.rs +++ b/src/test/ui/span/multispan-import-lint.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// must-compile-successfully + #![warn(unused)] use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd}; -- GitLab