You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Account for type Alias = dyn Trait; in unsized return suggestion
```
error[E0746]: return type cannot have an unboxed trait object
--> tests/ui/unsized/issue-91801.rs:8:77
|
8 | fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> {
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs:566:39
|
help: box the return type to make a boxed trait object, and wrap all of the returned values in `Box::new`
|
8 | fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Box<Validator<'a>> {
| ++++ +
help: alternatively, you might be able to borrow from one of the function's arguments
|
8 | fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> &Validator<'a> {
| +
```
0 commit comments