Improve the pretty print of UnstableFeature clause

This commit is contained in:
tiif 2025-09-19 07:07:49 +00:00
parent 2f4dfc753f
commit 4e62715541
5 changed files with 7 additions and 8 deletions

View file

@ -3177,8 +3177,7 @@ define_print! {
write!(p, "` can be evaluated")?;
}
ty::ClauseKind::UnstableFeature(symbol) => {
write!(p, "unstable feature: ")?;
write!(p, "`{symbol}`")?;
write!(p, "feature({symbol}) is enabled")?;
}
}
}

View file

@ -7,7 +7,7 @@ LL |
LL | struct A([u8]);
| ---- this field does not implement `ConstParamTy_`
|
note: the `ConstParamTy_` impl for `[u8]` requires that `unstable feature: `unsized_const_params``
note: the `ConstParamTy_` impl for `[u8]` requires that `feature(unsized_const_params) is enabled`
--> $DIR/unsized_field-1.rs:10:10
|
LL | struct A([u8]);
@ -22,7 +22,7 @@ LL |
LL | struct B(&'static [u8]);
| ------------- this field does not implement `ConstParamTy_`
|
note: the `ConstParamTy_` impl for `&'static [u8]` requires that `unstable feature: `unsized_const_params``
note: the `ConstParamTy_` impl for `&'static [u8]` requires that `feature(unsized_const_params) is enabled`
--> $DIR/unsized_field-1.rs:14:10
|
LL | struct B(&'static [u8]);
@ -37,7 +37,7 @@ LL |
LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
| ---------------------------------------------------------- this field does not implement `ConstParamTy_`
|
note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `unstable feature: `unsized_const_params``
note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `feature(unsized_const_params) is enabled`
--> $DIR/unsized_field-1.rs:21:10
|
LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);

View file

@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
|
= note: conflicting implementation in crate `unstable_impl_coherence_aux`:
- impl<T> Trait for T
where unstable feature: `foo`;
where feature(foo) is enabled;
error: aborting due to 1 previous error

View file

@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
|
= note: conflicting implementation in crate `unstable_impl_coherence_aux`:
- impl<T> Trait for T
where unstable feature: `foo`;
where feature(foo) is enabled;
error: aborting due to 1 previous error

View file

@ -7,7 +7,7 @@ LL | vec![].foo();
= note: multiple `impl`s satisfying `Vec<_>: Trait` found in the `unstable_impl_method_selection_aux` crate:
- impl Trait for Vec<u32>;
- impl Trait for Vec<u64>
where unstable feature: `bar`;
where feature(bar) is enabled;
error: aborting due to 1 previous error