New lint: dangling_pointers_from_temporaries
This commit is contained in:
parent
81d6652e74
commit
c69894eaec
33 changed files with 1093 additions and 128 deletions
|
@ -1137,16 +1137,19 @@ pub(crate) struct IgnoredUnlessCrateSpecified<'a> {
|
|||
pub name: Symbol,
|
||||
}
|
||||
|
||||
// methods.rs
|
||||
// dangling.rs
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_cstring_ptr)]
|
||||
#[diag(lint_dangling_pointers_from_temporaries)]
|
||||
#[note]
|
||||
#[help]
|
||||
pub(crate) struct CStringPtr {
|
||||
#[label(lint_as_ptr_label)]
|
||||
pub as_ptr: Span,
|
||||
#[label(lint_unwrap_label)]
|
||||
pub unwrap: Span,
|
||||
// FIXME: put #[primary_span] on `ptr_span` once it does not cause conflicts
|
||||
pub(crate) struct DanglingPointersFromTemporaries<'tcx> {
|
||||
pub callee: Symbol,
|
||||
pub ty: Ty<'tcx>,
|
||||
#[label(lint_label_ptr)]
|
||||
pub ptr_span: Span,
|
||||
#[label(lint_label_temporary)]
|
||||
pub temporary_span: Span,
|
||||
}
|
||||
|
||||
// multiple_supertrait_upcastable.rs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue