diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-02 14:58:12 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-03 19:00:22 +0000 |
| commit | 0d907c17a8258b012f6b1e327709ef5789128167 (patch) | |
| tree | 1dbeb630375e6dc84e3e96db428dcad0dde59309 /tests/ui/unsized | |
| parent | 23ab0f2cdc1f2563e258f29c37741154a2f084d6 (diff) | |
| download | rust-0d907c17a8258b012f6b1e327709ef5789128167.tar.gz rust-0d907c17a8258b012f6b1e327709ef5789128167.zip | |
Make error message less awkward
Diffstat (limited to 'tests/ui/unsized')
| -rw-r--r-- | tests/ui/unsized/box-instead-of-dyn-fn.rs | 2 | ||||
| -rw-r--r-- | tests/ui/unsized/box-instead-of-dyn-fn.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-91801.rs | 2 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-91801.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-91803.rs | 2 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-91803.stderr | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.rs b/tests/ui/unsized/box-instead-of-dyn-fn.rs index 321c2ebf5a1..720176081d6 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.rs +++ b/tests/ui/unsized/box-instead-of-dyn-fn.rs @@ -3,7 +3,7 @@ use std::fmt::Debug; // Test to suggest boxing the return type, and the closure branch of the `if` fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { - //~^ ERROR return type cannot have an unboxed trait object + //~^ ERROR return type cannot be a trait object without pointer indirection if a % 2 == 0 { move || println!("{a}") } else { diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.stderr b/tests/ui/unsized/box-instead-of-dyn-fn.stderr index 1f1845569ef..1836d5dfffe 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.stderr +++ b/tests/ui/unsized/box-instead-of-dyn-fn.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot have an unboxed trait object +error[E0746]: return type cannot be a trait object without pointer indirection --> $DIR/box-instead-of-dyn-fn.rs:5:56 | LL | fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { diff --git a/tests/ui/unsized/issue-91801.rs b/tests/ui/unsized/issue-91801.rs index 096b1a93574..d906a08a55a 100644 --- a/tests/ui/unsized/issue-91801.rs +++ b/tests/ui/unsized/issue-91801.rs @@ -6,7 +6,7 @@ pub static ALL_VALIDATORS: &[(&'static str, &'static Validator)] = &[("validate that credits and debits balance", &validate_something)]; fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> { - //~^ ERROR return type cannot have an unboxed trait object + //~^ ERROR return type cannot be a trait object without pointer indirection return Box::new(move |something: &'_ Something| -> Result<(), ()> { first(something).or_else(|_| second(something)) }); diff --git a/tests/ui/unsized/issue-91801.stderr b/tests/ui/unsized/issue-91801.stderr index e13cabbb81d..28e10f9caa4 100644 --- a/tests/ui/unsized/issue-91801.stderr +++ b/tests/ui/unsized/issue-91801.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot have an unboxed trait object +error[E0746]: return type cannot be a trait object without pointer indirection --> $DIR/issue-91801.rs:8:77 | LL | fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> { diff --git a/tests/ui/unsized/issue-91803.rs b/tests/ui/unsized/issue-91803.rs index c74897cc4bc..8d35c7582b8 100644 --- a/tests/ui/unsized/issue-91803.rs +++ b/tests/ui/unsized/issue-91803.rs @@ -1,7 +1,7 @@ trait Foo<'a> {} fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { - //~^ ERROR return type cannot have an unboxed trait object + //~^ ERROR return type cannot be a trait object without pointer indirection return Box::new(panic!()); } diff --git a/tests/ui/unsized/issue-91803.stderr b/tests/ui/unsized/issue-91803.stderr index 3b89066499d..e0fde4b1c1b 100644 --- a/tests/ui/unsized/issue-91803.stderr +++ b/tests/ui/unsized/issue-91803.stderr @@ -1,4 +1,4 @@ -error[E0746]: return type cannot have an unboxed trait object +error[E0746]: return type cannot be a trait object without pointer indirection --> $DIR/issue-91803.rs:3:43 | LL | fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { |
