@@ -149,6 +149,7 @@ macro_rules! extract_msrv_attr {
149149
150150/// If the given expression is a local binding, find the initializer expression. 
151151/// If that initializer expression is another local binding, find its initializer again. 
152+ /// 
152153/// This process repeats as long as possible (but usually no more than once). Initializer 
153154/// expressions with adjustments are ignored. If this is not desired, use [`find_binding_init`] 
154155/// instead. 
@@ -179,6 +180,7 @@ pub fn expr_or_init<'a, 'b, 'tcx: 'b>(cx: &LateContext<'tcx>, mut expr: &'a Expr
179180} 
180181
181182/// Finds the initializer expression for a local binding. Returns `None` if the binding is mutable. 
183+ /// 
182184/// By only considering immutable bindings, we guarantee that the returned expression represents the 
183185/// value of the binding wherever it is referenced. 
184186/// 
@@ -427,12 +429,12 @@ pub fn qpath_generic_tys<'tcx>(qpath: &QPath<'tcx>) -> impl Iterator<Item = &'tc
427429        } ) 
428430} 
429431
430- /// THIS METHOD IS DEPRECATED and will eventually be removed since it does not match against the 
432+ /// THIS METHOD IS DEPRECATED. Matches a `QPath` against a slice of segment string literals. 
433+ /// 
434+ /// This method is deprecated and will eventually be removed since it does not match against the 
431435/// entire path or resolved `DefId`. Prefer using `match_def_path`. Consider getting a `DefId` from 
432436/// `QPath::Resolved.1.res.opt_def_id()`. 
433437/// 
434- /// Matches a `QPath` against a slice of segment string literals. 
435- /// 
436438/// There is also `match_path` if you are dealing with a `rustc_hir::Path` instead of a 
437439/// `rustc_hir::QPath`. 
438440/// 
@@ -481,12 +483,12 @@ pub fn is_path_diagnostic_item<'tcx>(
481483    path_def_id ( cx,  maybe_path) . map_or ( false ,  |id| cx. tcx . is_diagnostic_item ( diag_item,  id) ) 
482484} 
483485
484- /// THIS METHOD IS DEPRECATED and will eventually be removed since it does not match against the 
486+ /// THIS METHOD IS DEPRECATED. Matches a `Path` against a slice of segment string literals. 
487+ /// 
488+ /// This method is deprecated and will eventually be removed since it does not match against the 
485489/// entire path or resolved `DefId`. Prefer using `match_def_path`. Consider getting a `DefId` from 
486490/// `QPath::Resolved.1.res.opt_def_id()`. 
487491/// 
488- /// Matches a `Path` against a slice of segment string literals. 
489- /// 
490492/// There is also `match_qpath` if you are dealing with a `rustc_hir::QPath` instead of a 
491493/// `rustc_hir::Path`. 
492494/// 
@@ -892,6 +894,7 @@ pub fn is_default_equivalent_call(cx: &LateContext<'_>, repl_func: &Expr<'_>) ->
892894} 
893895
894896/// Returns true if the expr is equal to `Default::default()` of it's type when evaluated. 
897+ /// 
895898/// It doesn't cover all cases, for example indirect function calls (some of std 
896899/// functions are supported) but it is the best we have. 
897900pub  fn  is_default_equivalent ( cx :  & LateContext < ' _ > ,  e :  & Expr < ' _ > )  -> bool  { 
@@ -1046,6 +1049,7 @@ impl std::ops::BitOrAssign for CaptureKind {
10461049} 
10471050
10481051/// Given an expression referencing a local, determines how it would be captured in a closure. 
1052+ /// 
10491053/// Note as this will walk up to parent expressions until the capture can be determined it should 
10501054/// only be used while making a closure somewhere a value is consumed. e.g. a block, match arm, or 
10511055/// function argument (other than a receiver). 
@@ -2348,8 +2352,9 @@ pub fn fn_def_id_with_node_args<'tcx>(
23482352} 
23492353
23502354/// Returns `Option<String>` where String is a textual representation of the type encapsulated in 
2351- /// the slice iff the given expression is a slice of primitives (as defined in the 
2352- /// `is_recursively_primitive_type` function) and `None` otherwise. 
2355+ /// the slice iff the given expression is a slice of primitives. 
2356+ /// 
2357+ /// (As defined in the `is_recursively_primitive_type` function.) Returns `None` otherwise. 
23532358pub  fn  is_slice_of_primitives ( cx :  & LateContext < ' _ > ,  expr :  & Expr < ' _ > )  -> Option < String >  { 
23542359    let  expr_type = cx. typeck_results ( ) . expr_ty_adjusted ( expr) ; 
23552360    let  expr_kind = expr_type. kind ( ) ; 
0 commit comments