Skip to content

Distinguish between error vs. warning for external macros #57716

Description

@jordy25519

I often see compiler notes for warnings accompanied with this message:

   = note: this error originates in a macro outside this <...>

would it be more sensible and correct to say this _warning_ originates...?

Very superficial but I find seeing "error" in compilation logs catches my eye far too often and
its only a warning. Happy to submit PR if it is a valid change.

Activity

  1. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jan 17, 2019
  2. estebank commented on Jan 18, 2019

    @estebank
    Contributor

    This can be easily added at

    fn fix_multispans_in_std_macros(&mut self,
    span: &mut MultiSpan,
    children: &mut Vec<SubDiagnostic>,
    backtrace: bool) {
    let mut spans_updated = self.fix_multispan_in_std_macros(span, backtrace);
    for child in children.iter_mut() {
    spans_updated |= self.fix_multispan_in_std_macros(&mut child.span, backtrace);
    }
    if spans_updated {
    children.push(SubDiagnostic {
    level: Level::Note,
    message: vec![
    ("this error originates in a macro outside of the current crate \
    (in Nightly builds, run with -Z external-macro-backtrace \
    for more info)".to_string(),
    Style::NoStyle),
    ],
    span: MultiSpan::new(),
    render_span: None,
    });
    }
    }

    by looking at the Diagnostic::code or, if not available, theDiagnostic::level and changing the text accordingly.

  3. added 4 commits that reference this issue on Mar 31, 2019
    e8c4e49
    f3d6ed1
    6ee2c10
    fb8396d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions