about summary refs log tree commit diff
path: root/tests/ui/diagnostic-flags
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-01-21 09:17:40 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-02-11 09:19:37 +0000
commitc294da3310301027dfa304b270c5d0ab78c2b851 (patch)
treefc4f8c2a7d41fd17f97358c612c2fab584c6d414 /tests/ui/diagnostic-flags
parentc182ce9cbc8c29ebc1b4559d027df545e6cdd287 (diff)
downloadrust-c294da3310301027dfa304b270c5d0ab78c2b851.tar.gz
rust-c294da3310301027dfa304b270c5d0ab78c2b851.zip
Reject `impl Trait` bounds in various places where we unconditionally warned since 1.0
Diffstat (limited to 'tests/ui/diagnostic-flags')
-rw-r--r--tests/ui/diagnostic-flags/allow-non-lint-warnings.rs11
-rw-r--r--tests/ui/diagnostic-flags/allow-non-lint-warnings.without_flag.stderr8
2 files changed, 9 insertions, 10 deletions
diff --git a/tests/ui/diagnostic-flags/allow-non-lint-warnings.rs b/tests/ui/diagnostic-flags/allow-non-lint-warnings.rs
index 40b9e6536f5..8980ef9c422 100644
--- a/tests/ui/diagnostic-flags/allow-non-lint-warnings.rs
+++ b/tests/ui/diagnostic-flags/allow-non-lint-warnings.rs
@@ -1,8 +1,7 @@
 // ignore-tidy-linelength
 //! Check that `-A warnings` cli flag applies to non-lint warnings as well.
 //!
-//! This test tries to exercise that by checking that the "relaxing a default bound only does
-//! something for `?Sized`; all other traits are not bound by default" non-lint warning (normally
+//! This test tries to exercise that by checking that a non-lint warning (normally
 //! warn-by-default) is suppressed if the `-A warnings` cli flag is passed.
 //!
 //! Take special note that `warnings` is a special pseudo lint group in relationship to non-lint
@@ -14,7 +13,7 @@
 //! - Original impl PR: <https://github.com/rust-lang/rust/pull/21248>.
 //! - RFC 507 "Release channels":
 //!   <https://github.com/rust-lang/rfcs/blob/c017755b9bfa0421570d92ba38082302e0f3ad4f/text/0507-release-channels.md>.
-#![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 //@ revisions: without_flag with_flag
 
@@ -22,6 +21,6 @@
 
 //@ check-pass
 
-pub trait Trait {}
-pub fn f<T: ?Trait>() {}
-//[without_flag]~^ WARN relaxing a default bound only does something for `?Sized`; all other traits are not bound by default
+#[rustc_error(warn)]
+fn main() {}
+//[without_flag]~^ WARN unexpected annotation used with `#[rustc_error(...)]`!
diff --git a/tests/ui/diagnostic-flags/allow-non-lint-warnings.without_flag.stderr b/tests/ui/diagnostic-flags/allow-non-lint-warnings.without_flag.stderr
index b037847c70f..3f33ccbd1c9 100644
--- a/tests/ui/diagnostic-flags/allow-non-lint-warnings.without_flag.stderr
+++ b/tests/ui/diagnostic-flags/allow-non-lint-warnings.without_flag.stderr
@@ -1,8 +1,8 @@
-warning: relaxing a default bound only does something for `?Sized`; all other traits are not bound by default
-  --> $DIR/allow-non-lint-warnings.rs:26:13
+warning: unexpected annotation used with `#[rustc_error(...)]`!
+  --> $DIR/allow-non-lint-warnings.rs:25:1
    |
-LL | pub fn f<T: ?Trait>() {}
-   |             ^^^^^^
+LL | fn main() {}
+   | ^^^^^^^^^
 
 warning: 1 warning emitted