@@ -54,9 +54,9 @@ use crate::lints::{
54
54
BuiltinEllipsisInclusiveRangePatternsLint , BuiltinExplicitOutlives ,
55
55
BuiltinExplicitOutlivesSuggestion , BuiltinFeatureIssueNote , BuiltinIncompleteFeatures ,
56
56
BuiltinIncompleteFeaturesHelp , BuiltinInternalFeatures , BuiltinKeywordIdents ,
57
- BuiltinLocalVariablePointerImpl , BuiltinMissingCopyImpl , BuiltinMissingDebugImpl ,
58
- BuiltinMissingDoc , BuiltinMutablesTransmutes , BuiltinNoMangleGeneric ,
59
- BuiltinNonShorthandFieldPatterns , BuiltinSpecialModuleNameUsed , BuiltinTrivialBounds ,
57
+ BuiltinMissingCopyImpl , BuiltinMissingDebugImpl , BuiltinMissingDoc , BuiltinMutablesTransmutes ,
58
+ BuiltinNoMangleGeneric , BuiltinNonShorthandFieldPatterns ,
59
+ BuiltinReturningPointersToLocalVariables , BuiltinSpecialModuleNameUsed , BuiltinTrivialBounds ,
60
60
BuiltinTypeAliasBounds , BuiltinUngatedAsyncFnTrackCaller , BuiltinUnpermittedTypeInit ,
61
61
BuiltinUnpermittedTypeInitSub , BuiltinUnreachablePub , BuiltinUnsafe , BuiltinUnstableFeatures ,
62
62
BuiltinUnusedDocComment , BuiltinUnusedDocCommentSub , BuiltinWhileTrue , InvalidAsmLabel ,
@@ -3008,14 +3008,14 @@ declare_lint! {
3008
3008
///
3009
3009
/// Returning a pointer to memory refering to a local variable will always
3010
3010
/// end up in a dangling pointer after returning.
3011
- pub RETURN_LOCAL_VARIABLE_PTR ,
3011
+ pub RETURNING_POINTERS_TO_LOCAL_VARIABLES ,
3012
3012
Warn ,
3013
3013
"returning a pointer to stack memory associated with a local variable" ,
3014
3014
}
3015
3015
3016
- declare_lint_pass ! ( ReturnLocalVariablePointer => [ RETURN_LOCAL_VARIABLE_PTR ] ) ;
3016
+ declare_lint_pass ! ( ReturningPointersToLocalVariables => [ RETURNING_POINTERS_TO_LOCAL_VARIABLES ] ) ;
3017
3017
3018
- impl < ' tcx > LateLintPass < ' tcx > for ReturnLocalVariablePointer {
3018
+ impl < ' tcx > LateLintPass < ' tcx > for ReturningPointersToLocalVariables {
3019
3019
fn check_fn (
3020
3020
& mut self ,
3021
3021
cx : & LateContext < ' tcx > ,
@@ -3061,7 +3061,7 @@ impl<'tcx> LateLintPass<'tcx> for ReturnLocalVariablePointer {
3061
3061
}
3062
3062
}
3063
3063
3064
- impl ReturnLocalVariablePointer {
3064
+ impl ReturningPointersToLocalVariables {
3065
3065
/// Evaluates the return expression of a function and emits a lint if it
3066
3066
/// returns a pointer to a local variable.
3067
3067
fn maybe_lint_return_expr < ' tcx > ( cx : & LateContext < ' tcx > , return_expr : & hir:: Expr < ' tcx > ) {
@@ -3078,9 +3078,9 @@ impl ReturnLocalVariablePointer {
3078
3078
) = addr_expr. kind
3079
3079
{
3080
3080
cx. emit_span_lint (
3081
- RETURN_LOCAL_VARIABLE_PTR ,
3081
+ RETURNING_POINTERS_TO_LOCAL_VARIABLES ,
3082
3082
return_expr. span ,
3083
- BuiltinLocalVariablePointerImpl ,
3083
+ BuiltinReturningPointersToLocalVariables ,
3084
3084
) ;
3085
3085
}
3086
3086
}
0 commit comments