@@ -43,10 +43,9 @@ use crate::Expectation::{self, ExpectCastableToType, ExpectHasType, NoExpectatio
43
43
use crate :: coercion:: { CoerceMany , DynamicCoerceMany } ;
44
44
use crate :: errors:: {
45
45
AddressOfTemporaryTaken , BaseExpressionDoubleDot , BaseExpressionDoubleDotAddExpr ,
46
- BaseExpressionDoubleDotEnableDefaultFieldValues , BaseExpressionDoubleDotRemove ,
47
- CantDereference , FieldMultiplySpecifiedInInitializer , FunctionalRecordUpdateOnNonStruct ,
48
- HelpUseLatestEdition , NakedAsmOutsideNakedFn , NoFieldOnType , NoFieldOnVariant ,
49
- ReturnLikeStatementKind , ReturnStmtOutsideOfFnBody , StructExprNonExhaustive ,
46
+ BaseExpressionDoubleDotRemove , CantDereference , FieldMultiplySpecifiedInInitializer ,
47
+ FunctionalRecordUpdateOnNonStruct , HelpUseLatestEdition , NakedAsmOutsideNakedFn , NoFieldOnType ,
48
+ NoFieldOnVariant , ReturnLikeStatementKind , ReturnStmtOutsideOfFnBody , StructExprNonExhaustive ,
50
49
TypeMismatchFruTypo , YieldExprOutsideOfCoroutine ,
51
50
} ;
52
51
use crate :: {
@@ -2158,26 +2157,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2158
2157
}
2159
2158
}
2160
2159
if !self . tcx . features ( ) . default_field_values ( ) {
2161
- let sugg = self . tcx . crate_level_attribute_injection_span ( expr . hir_id ) ;
2160
+ let sugg = self . tcx . crate_level_attribute_injection_span ( ) ;
2162
2161
self . dcx ( ) . emit_err ( BaseExpressionDoubleDot {
2163
2162
span : span. shrink_to_hi ( ) ,
2164
2163
// We only mention enabling the feature if this is a nightly rustc *and* the
2165
2164
// expression would make sense with the feature enabled.
2166
2165
default_field_values_suggestion : if self . tcx . sess . is_nightly_build ( )
2167
2166
&& missing_mandatory_fields. is_empty ( )
2168
2167
&& !missing_optional_fields. is_empty ( )
2169
- && sugg. is_some ( )
2170
2168
{
2171
- sugg
2172
- } else {
2173
- None
2174
- } ,
2175
- default_field_values_help : if self . tcx . sess . is_nightly_build ( )
2176
- && missing_mandatory_fields. is_empty ( )
2177
- && !missing_optional_fields. is_empty ( )
2178
- && sugg. is_none ( )
2179
- {
2180
- Some ( BaseExpressionDoubleDotEnableDefaultFieldValues )
2169
+ Some ( sugg)
2181
2170
} else {
2182
2171
None
2183
2172
} ,
0 commit comments