diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer/comments.rs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 0b868b514fe..4291f811f3f 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -1008,8 +1008,7 @@ pub fn find_repr_attrs(diagnostic: &Handler, attr: &Attribute) -> Vec<ReprAttr> if let Some(mi) = item.word() { let word = &*mi.name().as_str(); let hint = match word { - // Can't use "extern" because it's not a lexical identifier. - "C" => Some(ReprExtern), + "C" => Some(ReprC), "packed" => Some(ReprPacked), "simd" => Some(ReprSimd), _ => match int_type_of_word(word) { @@ -1080,7 +1079,7 @@ fn int_type_of_word(s: &str) -> Option<IntType> { #[derive(PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)] pub enum ReprAttr { ReprInt(IntType), - ReprExtern, + ReprC, ReprPacked, ReprSimd, ReprAlign(u32), diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index 23449ee69ab..49362f07799 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -101,7 +101,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String { break; } } - if i > line.len() { + if i >= line.len() { can_trim = false; } if !can_trim { |
