Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give all fatals, errors, and warnings unique diagnostic codes #12144

Closed
wants to merge 7 commits into from

Commits on Feb 10, 2014

  1. rustc: Add the __tt_map_insert and __tt_map_get_expr macros

    Behind the `__tt_map` feature gate. This feature name starts with
    a double underscore to emphasize it's a hack, but there's no
    precedent for naming features this way.
    brson committed Feb 10, 2014
    Configuration menu
    Copy the full SHA
    b4f483d View commit details
    Browse the repository at this point in the history
  2. rustc: Introduce a new diagnostic code registry

    This provides a way to create stable diagnostic codes, while keeping
    the overal burden on compiler writers low, and introducing a way to
    incrementally provide extended documentation of diagnostics.
    brson committed Feb 10, 2014
    Configuration menu
    Copy the full SHA
    dda818b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    24cc6bd View commit details
    Browse the repository at this point in the history
  4. Convert to new diagnostics

    This pairs almost every error in libsyntax and librustc with an error code,
    emitting with the macros:
    
    * alert_fatal!(cx, code, fmt, args);
    * alert_err!(cx, code, fmt, args);
    * alert_warn!(cx, code, fmt, args);
    * span_fatal!(cx, span, code, fmt, args);
    * span_err!(cx, span, code, fmt, args);
    * span_warn!(cx, span, code, fmt, args);
    * resolve_err!(cx, span, code, fmt, args);
    
    These macros call the methods 'fatal_without_diagnostic_code' etc. on any
    given context. For the most part the old diagnostic methods on the various
    sessions and handles and contexts have been renamed in a way that is
    obnoxious to call (use the macros), but the macro ExtCtxt still contains
    the simple `fatal` methods, etc. for ease of use by out of tree procedural
    macros.
    
    Lint errors are difficult to convert to this system because they don't use
    string literals for reporting errors, so they don't have their own codes yet.
    brson committed Feb 10, 2014
    Configuration menu
    Copy the full SHA
    e529322 View commit details
    Browse the repository at this point in the history
  5. rustc: Add UI for extended diagnostics

    When diagnostics with codes are emitted they appear in magenta brackets,
    like `[A0002]`. After failure a note is emitted indicating whether
    any errors had extended documentation and suggesting the `--explain help`
    flag.
    brson committed Feb 10, 2014
    Configuration menu
    Copy the full SHA
    d9c7a8c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    febb7f8 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2014

  1. Address review feedback

    brson committed Feb 12, 2014
    Configuration menu
    Copy the full SHA
    e610e6e View commit details
    Browse the repository at this point in the history