@@ -122,7 +122,7 @@ fn is_unfrozen<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
122122 // Ignore types whose layout is unknown since `is_freeze` reports every generic types as `!Freeze`,
123123 // making it indistinguishable from `UnsafeCell`. i.e. it isn't a tool to prove a type is
124124 // 'unfrozen'. However, this code causes a false negative in which
125- // a type contains a layout-unknown type, but also a unsafe cell like `const CELL: Cell<T>`.
125+ // a type contains a layout-unknown type, but also an unsafe cell like `const CELL: Cell<T>`.
126126 // Yet, it's better than `ty.has_type_flags(TypeFlags::HAS_TY_PARAM | TypeFlags::HAS_PROJECTION)`
127127 // since it works when a pointer indirection involves (`Cell<*const T>`).
128128 // Making up a `ParamEnv` where every generic params and assoc types are `Freeze`is another option;
@@ -266,7 +266,7 @@ impl<'tcx> LateLintPass<'tcx> for NonCopyConst {
266266 // in other words, lint consts whose value *could* be unfrozen, not definitely is.
267267 // This feels inconsistent with how the lint treats generic types,
268268 // which avoids linting types which potentially become unfrozen.
269- // One could check whether a unfrozen type have a *frozen variant*
269+ // One could check whether an unfrozen type have a *frozen variant*
270270 // (like `body_id_opt.map_or_else(|| !has_frozen_variant(...), ...)`),
271271 // and do the same as the case of generic types at impl items.
272272 // Note that it isn't sufficient to check if it has an enum
@@ -293,7 +293,7 @@ impl<'tcx> LateLintPass<'tcx> for NonCopyConst {
293293 } ) => {
294294 if_chain ! {
295295 // Lint a trait impl item only when the definition is a generic type,
296- // assuming a assoc const is not meant to be a interior mutable type.
296+ // assuming an assoc const is not meant to be an interior mutable type.
297297 if let Some ( of_trait_def_id) = of_trait_ref. trait_def_id( ) ;
298298 if let Some ( of_assoc_item) = specialization_graph:: Node :: Trait ( of_trait_def_id)
299299 . item( cx. tcx, impl_item. ident, AssocKind :: Const , of_trait_def_id) ;
0 commit comments