|
| 1 | +error[E0277]: `fn() {main}` can't be used as a const parameter type |
| 2 | + --> $DIR/const_param_ty_bad.rs:7:11 |
| 3 | + | |
| 4 | +LL | check(main); |
| 5 | + | ----- ^^^^ the trait `ConstParamTy` is not implemented for fn item `fn() {main}` |
| 6 | + | | |
| 7 | + | required by a bound introduced by this call |
| 8 | + | |
| 9 | +note: required by a bound in `check` |
| 10 | + --> $DIR/const_param_ty_bad.rs:4:18 |
| 11 | + | |
| 12 | +LL | fn check(_: impl std::marker::ConstParamTy) {} |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check` |
| 14 | + |
| 15 | +error[E0277]: `[closure@$DIR/const_param_ty_bad.rs:8:11: 8:13]` can't be used as a const parameter type |
| 16 | + --> $DIR/const_param_ty_bad.rs:8:11 |
| 17 | + | |
| 18 | +LL | check(|| {}); |
| 19 | + | ----- ^^^^^ the trait `ConstParamTy` is not implemented for closure `[closure@$DIR/const_param_ty_bad.rs:8:11: 8:13]` |
| 20 | + | | |
| 21 | + | required by a bound introduced by this call |
| 22 | + | |
| 23 | +note: required by a bound in `check` |
| 24 | + --> $DIR/const_param_ty_bad.rs:4:18 |
| 25 | + | |
| 26 | +LL | fn check(_: impl std::marker::ConstParamTy) {} |
| 27 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check` |
| 28 | + |
| 29 | +error[E0277]: `fn()` can't be used as a const parameter type |
| 30 | + --> $DIR/const_param_ty_bad.rs:9:11 |
| 31 | + | |
| 32 | +LL | check(main as fn()); |
| 33 | + | ----- ^^^^^^^^^^^^ the trait `ConstParamTy` is not implemented for `fn()` |
| 34 | + | | |
| 35 | + | required by a bound introduced by this call |
| 36 | + | |
| 37 | +note: required by a bound in `check` |
| 38 | + --> $DIR/const_param_ty_bad.rs:4:18 |
| 39 | + | |
| 40 | +LL | fn check(_: impl std::marker::ConstParamTy) {} |
| 41 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check` |
| 42 | + |
| 43 | +error[E0277]: `&mut ()` can't be used as a const parameter type |
| 44 | + --> $DIR/const_param_ty_bad.rs:10:11 |
| 45 | + | |
| 46 | +LL | check(&mut ()); |
| 47 | + | ----- ^^^^^^^ the trait `ConstParamTy` is not implemented for `&mut ()` |
| 48 | + | | |
| 49 | + | required by a bound introduced by this call |
| 50 | + | |
| 51 | +note: required by a bound in `check` |
| 52 | + --> $DIR/const_param_ty_bad.rs:4:18 |
| 53 | + | |
| 54 | +LL | fn check(_: impl std::marker::ConstParamTy) {} |
| 55 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check` |
| 56 | + |
| 57 | +error[E0277]: `*mut ()` can't be used as a const parameter type |
| 58 | + --> $DIR/const_param_ty_bad.rs:11:11 |
| 59 | + | |
| 60 | +LL | check(&mut () as *mut ()); |
| 61 | + | ----- ^^^^^^^^^^^^^^^^^^ the trait `ConstParamTy` is not implemented for `*mut ()` |
| 62 | + | | |
| 63 | + | required by a bound introduced by this call |
| 64 | + | |
| 65 | +note: required by a bound in `check` |
| 66 | + --> $DIR/const_param_ty_bad.rs:4:18 |
| 67 | + | |
| 68 | +LL | fn check(_: impl std::marker::ConstParamTy) {} |
| 69 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check` |
| 70 | + |
| 71 | +error[E0277]: `*const ()` can't be used as a const parameter type |
| 72 | + --> $DIR/const_param_ty_bad.rs:12:11 |
| 73 | + | |
| 74 | +LL | check(&() as *const ()); |
| 75 | + | ----- ^^^^^^^^^^^^^^^^ the trait `ConstParamTy` is not implemented for `*const ()` |
| 76 | + | | |
| 77 | + | required by a bound introduced by this call |
| 78 | + | |
| 79 | +note: required by a bound in `check` |
| 80 | + --> $DIR/const_param_ty_bad.rs:4:18 |
| 81 | + | |
| 82 | +LL | fn check(_: impl std::marker::ConstParamTy) {} |
| 83 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check` |
| 84 | + |
| 85 | +error: aborting due to 6 previous errors |
| 86 | + |
| 87 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments