Change:
This will not generate docs for the generated enum, and will warn about missing docs on the enum variant. (missing_docs is off by default, so normally you wouldn't notice this) This is a rustc bug, not a rustdoc bug, since the lint fails too (so we're somehow losing the doc attribute entirely). This works fine on beta. cc
This is a regression introduced in today's nightly (rustc 1.22.0-nightly ( 2017-09-19)) <details325ba23d55 Auto merge of - zackmdavis:rfc1940housekeeping, r=nikomatsakis Auto merge of - alexcrichton:lower-attributes-in-hir, r=nrc Auto merge of - QuietMisdreavus:trimmed-std, r=steveklabnik rustc: Forbid interpolated tokens in the HIR Auto merge of - infinity0:master, r=Mark-Simulacrum rustbuild: with --no-fail-fast, report the specific commands that failed Auto merge of - alexcrichton:rollup, r=alexcrichton Rollup merge of - GuillaumeGomez:run-button, r=steveklabnik Rollup merge of - iwillspeak:into-iterator-docs, r=steveklabnik Rollup merge of - GuillaumeGomez:more-links, r=QuietMisdreavus Rollup merge of - Ixrec:patch-1, r=eddyb Rollup merge of - bluss:document-thread-name-no-nuls, r=steveklabnik Rollup merge of - budziq:stabilizesplice, r=dtolnay Rollup merge of - oyvindln:rustchelpfix, r=arielb1 Rollup merge of - oli-obk:memchr, r=alexcrichton Rollup merge of - clarcharr:cowerror, r=alexcrichton Rollup merge of - michaelwoerister:hash-all-the-things2, r=nikomatsakis Fix run button Fix ICE caused by trying to hash INVALIDCRATENUM. Fix rebase fallout. Remove tcx from StableHashingContext. Make the StableHashingContext mostly independent of the tcx. Initialize IGNOREDATTRS in StableHashingContext lazily. Initialize the CachingCodemapView in StableHashingContext lazily. Use StableHash impls instead of functions for hashing most maps. Already hash HIR bodies during metadata export so they don't have to be hashed in downstream crates. Fix issues uncovered by rebasing: Move result fingerprinting to DepGraph::withtask(). Compute hashes of all query results. Use DefId instead of NodeId as identifier in resolvelifetime::Region. Auto merge of - tamird:cargo-bitflags, r=alexcrichton Add Example of as Trait Bound to Docs Auto merge of - oli-obk:orbitalstandardlibrary, r=alexcrichton Auto merge of - alexcrichton:trans-query, r=michaelwoerister Add more links and put the link character to the left Rebase fallout Update miri submodule Prevent distribution if miri is enabled -Zmir-emit-validate is in stage 0 Add a file to trivially disable tool building or testing Improve documentation Get the miri test suite to run inside the rustc dev environment Add and use it in Remove rustcbitflags; use the bitflags crate rustc: Move codegen to a query bootstrap: plumb verbosity into submodule ops Use double quotes to appease some TOML parsers rustc: Attach an mpsc channel to TyCtxt rustc: Remove another global map from trans rustc: Move a comment to the right spot in trans rustc: Mostly remove rustc: Move some attr methods to queries rustc: Make trans collect/partition a query rustc: Calculate in a query rustc: Use reachablility through a query rustc: Refactor trans paritioning to use tcx rustctrans: Refactor collection to use tcx missed a 'mut' Replace str's transmute() calls with pointer casts Updated tracking issue for String::splice and its unstable-book entry stabilized vecsplice ( std: Document thread builder panics for nul bytes in thread names unstable book section for RFC 1940 UI test in own directory, exercise mustuse trait methods Remove the other period and start with lowercase for more consistency Add proper help line for inline threshold Add Cow<str-Box<Errorimpls. remove tests for doc(masked) update docs and tracking issue add feature gate docmasked and tests new attribute #[doc(masked)] to hide internal crates from std docs </details
I suspect (very likely) or (less likely).
This seems to apply to any kind of attribute, not just doc attributes (and not just the form: does not generate in the LLVM IR Similarly, doing something like this with will not trigger the repr error. Seems like these attributes get discarded early.
Looks like early lint passes do detect these attributes, it is late lint passes which have trouble here. So it's on the HIR side.
Yep, it was regressed by
Well, cc-ing (and/or seems more appropriate.
I'm working on a fix for this
I've posted a fix at

Discussion:
use syntax::std_inject; use syntax::symbol::{Symbol, keywords}; use syntax::tokenstream::{TokenStream, TokenTree, Delimited}; <del> use syntax::parse::token::{Token, DelimToken}; </del> <ins> use syntax::parse::token::Token; </ins> use syntax::util::small_vector::SmallVector; use syntax::visit::{self, Visitor}; use syntax_pos::Span;

} fn lower_token_stream(&mut self, tokens: TokenStream) -> TokenStream { <del> tokens.into_trees().map(|tree| self.lower_token_tree(tree)).collect() </del> <ins> tokens.into_trees() .flat_map(|tree| self.lower_token_tree(tree).into_trees()) .collect() </ins> } <del> fn lower_token_tree(&mut self, tree: TokenTree) -> TokenTree { </del> <ins> fn lower_token_tree(&mut self, tree: TokenTree) -> TokenStream { </ins> match tree { TokenTree::Token(span, token) => { self.lower_token(token, span)

TokenTree::Delimited(span, Delimited { delim: delimited.delim, tts: self.lower_token_stream(delimited.tts.into()).into(), <del> }) </del> <ins> }).into() </ins> } } } <del> fn lower_token(&mut self, token: Token, span: Span) -> TokenTree { </del> <ins> fn lower_token(&mut self, token: Token, span: Span) -> TokenStream { </ins> match token { Token::Interpolated(_) => {} <del> other => return TokenTree::Token(span, other), </del> <ins> other => return TokenTree::Token(span, other).into(), </ins> } let tts = token.interpolated_to_tokenstream(&self.sess.parse_sess, span); <del> let tts = self.lower_token_stream(tts); TokenTree::Delimited(span, Delimited { delim: DelimToken::NoDelim, tts: tts.into(), }) </del> <ins> self.lower_token_stream(tts) </ins> } fn lower_arm(&mut self, arm: &Arm) -> hir::Arm {

<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! dox #![deny(missing_docs)] macro_rules! doc { ($e:expr) => ( #[doc = $e] pub struct Foo; ) } doc!("a"); fn main() {} </ins>