about summary refs log tree commit diff
path: root/tests/ui/lifetimes
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-08-06 01:26:26 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-08-06 01:26:26 +0200
commit02ea38cfff9b07be2366fb76bcd2f24ddb589df2 (patch)
tree500e02dc04400f70aa8110e4479de92d9616643a /tests/ui/lifetimes
parentec7c02612527d185c379900b613311bc1dcbf7dc (diff)
downloadrust-02ea38cfff9b07be2366fb76bcd2f24ddb589df2.tar.gz
rust-02ea38cfff9b07be2366fb76bcd2f24ddb589df2.zip
Fortify generic param default checks
Diffstat (limited to 'tests/ui/lifetimes')
-rw-r--r--tests/ui/lifetimes/unusual-rib-combinations.rs2
-rw-r--r--tests/ui/lifetimes/unusual-rib-combinations.stderr4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/lifetimes/unusual-rib-combinations.rs b/tests/ui/lifetimes/unusual-rib-combinations.rs
index 0e92b41ae1e..b3e9642332b 100644
--- a/tests/ui/lifetimes/unusual-rib-combinations.rs
+++ b/tests/ui/lifetimes/unusual-rib-combinations.rs
@@ -14,7 +14,7 @@ fn b<const C: u8()>() {}
 // Paren generic args in AnonymousReportError
 fn c<T = u8()>() {}
 //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
-//~| ERROR defaults for type parameters are only allowed in
+//~| ERROR defaults for generic parameters are not allowed here
 //~| WARN this was previously accepted
 
 // Elided lifetime in path in ConstGeneric
diff --git a/tests/ui/lifetimes/unusual-rib-combinations.stderr b/tests/ui/lifetimes/unusual-rib-combinations.stderr
index 7373ca8cf84..bd68479c58c 100644
--- a/tests/ui/lifetimes/unusual-rib-combinations.stderr
+++ b/tests/ui/lifetimes/unusual-rib-combinations.stderr
@@ -22,7 +22,7 @@ error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
 LL | fn c<T = u8()>() {}
    |          ^^^^ only `Fn` traits may use parentheses
 
-error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+error: defaults for generic parameters are not allowed here
   --> $DIR/unusual-rib-combinations.rs:15:6
    |
 LL | fn c<T = u8()>() {}
@@ -43,7 +43,7 @@ error: aborting due to 6 previous errors
 Some errors have detailed explanations: E0106, E0214, E0308, E0770.
 For more information about an error, try `rustc --explain E0106`.
 Future incompatibility report: Future breakage diagnostic:
-error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+error: defaults for generic parameters are not allowed here
   --> $DIR/unusual-rib-combinations.rs:15:6
    |
 LL | fn c<T = u8()>() {}