pub fn span_lint<T: LintContext>(
    cx: &T,
    lint: &'static Lint,
    sp: impl Into<MultiSpan>,
    msg: &str
Expand description

Emit a basic lint message with a msg and a span.

This is the most primitive of our lint emission methods and can be a good way to get a new lint started.

Usually it’s nicer to provide more context for lint messages. Be sure the output is understandable when you use this method.


error: usage of mem::forget on Drop type
  --> $DIR/
17 |     std::mem::forget(seven);
   |     ^^^^^^^^^^^^^^^^^^^^^^^