Skip to content

Exporting a nonexistent item does not cause compilation to fail #2938

Closed

Description

@bstrie

Here's the revised test case from #1908. It used to just crash with a poor error message, but now it doesn't fail at all despite the lack of anything named output_styl.

export output_format;
export output_styl;
export config;

#[doc = "The type of document to output"]
enum output_format {
    #[doc = "Markdown"]
    markdown,
    #[doc = "HTML, via markdown and pandoc"]
    pandoc_html
}

#[doc = "How to organize the output"]
enum output_style {
    #[doc = "All in a single document"]
    one_doc,
    #[doc = "Each module in its own document"]
    doc_per_mod
}

#[doc = "The configuration for this rustdoc session"]
type config = {
    output_dir: &str,
    output_format: output_format,
    output_style: output_style,
    pandoc_cmd: option<&str>
};

Compiled with rustc --lib 1908.rs.

Activity

  1. jdm commented on Jul 17, 2012

    @jdm
    Contributor

    Traditionally that has simply triggered a warning message, not a failure as far as I know.

  2. catamorphism commented on Jul 17, 2012

    @catamorphism
    Contributor

    I'll look at this too. I know it has been just a warning in the past, but IMO it should be a failure.

  3. catamorphism commented on Jul 18, 2012

    @catamorphism
    Contributor

    Postponed because we're replacing exports with pub qualifiers on individual items, as per #1893.

  4. catamorphism commented on Oct 6, 2012

    @catamorphism
    Contributor

    Obsolete now that #1893 is implemented. You can't export a non-existent item, since an export is part of an item itself. What joy!

  5. added a commit that references this issue on Aug 19, 2026
  6. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions