Skip to content

Commit fa2bdbd

Browse files
authored
Unrolled build for #146753
Rollup merge of #146753 - tiif:unsatisfiable-unstable-feature, r=BoxyUwU Improve the pretty print of UnstableFeature clause As per #145095 (comment), we could make the diagnostic for unsatisfiable ``UnstableFeature`` clause better. r? `@BoxyUwU`
2 parents bbcbc78 + 4e62715 commit fa2bdbd

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3177,8 +3177,7 @@ define_print! {
31773177
write!(p, "` can be evaluated")?;
31783178
}
31793179
ty::ClauseKind::UnstableFeature(symbol) => {
3180-
write!(p, "unstable feature: ")?;
3181-
write!(p, "`{symbol}`")?;
3180+
write!(p, "feature({symbol}) is enabled")?;
31823181
}
31833182
}
31843183
}

tests/ui/const-generics/adt_const_params/unsized_field-1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL |
77
LL | struct A([u8]);
88
| ---- this field does not implement `ConstParamTy_`
99
|
10-
note: the `ConstParamTy_` impl for `[u8]` requires that `unstable feature: `unsized_const_params``
10+
note: the `ConstParamTy_` impl for `[u8]` requires that `feature(unsized_const_params) is enabled`
1111
--> $DIR/unsized_field-1.rs:10:10
1212
|
1313
LL | struct A([u8]);
@@ -22,7 +22,7 @@ LL |
2222
LL | struct B(&'static [u8]);
2323
| ------------- this field does not implement `ConstParamTy_`
2424
|
25-
note: the `ConstParamTy_` impl for `&'static [u8]` requires that `unstable feature: `unsized_const_params``
25+
note: the `ConstParamTy_` impl for `&'static [u8]` requires that `feature(unsized_const_params) is enabled`
2626
--> $DIR/unsized_field-1.rs:14:10
2727
|
2828
LL | struct B(&'static [u8]);
@@ -37,7 +37,7 @@ LL |
3737
LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
3838
| ---------------------------------------------------------- this field does not implement `ConstParamTy_`
3939
|
40-
note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `unstable feature: `unsized_const_params``
40+
note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `feature(unsized_const_params) is enabled`
4141
--> $DIR/unsized_field-1.rs:21:10
4242
|
4343
LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);

tests/ui/unstable-feature-bound/unstable_impl_coherence.disabled.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
66
|
77
= note: conflicting implementation in crate `unstable_impl_coherence_aux`:
88
- impl<T> Trait for T
9-
where unstable feature: `foo`;
9+
where feature(foo) is enabled;
1010

1111
error: aborting due to 1 previous error
1212

tests/ui/unstable-feature-bound/unstable_impl_coherence.enabled.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
66
|
77
= note: conflicting implementation in crate `unstable_impl_coherence_aux`:
88
- impl<T> Trait for T
9-
where unstable feature: `foo`;
9+
where feature(foo) is enabled;
1010

1111
error: aborting due to 1 previous error
1212

tests/ui/unstable-feature-bound/unstable_impl_method_selection.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | vec![].foo();
77
= note: multiple `impl`s satisfying `Vec<_>: Trait` found in the `unstable_impl_method_selection_aux` crate:
88
- impl Trait for Vec<u32>;
99
- impl Trait for Vec<u64>
10-
where unstable feature: `bar`;
10+
where feature(bar) is enabled;
1111

1212
error: aborting due to 1 previous error
1313

0 commit comments

Comments
 (0)