Skip to content

Commit 83ed781

Browse files
committed
Address comments + Fix tests
1 parent 3f064ca commit 83ed781

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Diff for: src/librustdoc/clean/cfg.rs

+2
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ mod test {
416416

417417
use syntax_pos::DUMMY_SP;
418418
use syntax::ast::*;
419+
use syntax::attr;
420+
use syntax::source_map::dummy_spanned;
419421
use syntax::symbol::Symbol;
420422
use syntax::with_globals;
421423

Diff for: src/libsyntax/ast.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1351,12 +1351,17 @@ pub enum StrStyle {
13511351
Raw(u16),
13521352
}
13531353

1354-
/// A literal.
1354+
/// An AST literal.
13551355
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
13561356
pub struct Lit {
1357-
pub node: LitKind,
1357+
/// The original literal token as written in source code.
13581358
pub token: token::Lit,
1359+
/// The original literal suffix as written in source code.
13591360
pub suffix: Option<Symbol>,
1361+
/// The "semantic" representation of the literal lowered from the original tokens.
1362+
/// Strings are unescaped, hexadecimal forms are eliminated, etc.
1363+
/// FIXME: Remove this and only create the semantic representation during lowering to HIR.
1364+
pub node: LitKind,
13601365
pub span: Span,
13611366
}
13621367

Diff for: src/libsyntax/parse/literal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ macro_rules! err {
2727

2828
impl LitKind {
2929
/// Converts literal token with a suffix into a semantic literal.
30-
/// Works speculatively and may return `None` is diagnostic handler is not passed.
30+
/// Works speculatively and may return `None` if diagnostic handler is not passed.
3131
/// If diagnostic handler is passed, always returns `Some`,
3232
/// possibly after reporting non-fatal errors and recovery.
3333
fn from_lit_token(
@@ -166,7 +166,7 @@ impl LitKind {
166166

167167
impl Lit {
168168
/// Converts literal token with a suffix into an AST literal.
169-
/// Works speculatively and may return `None` is diagnostic handler is not passed.
169+
/// Works speculatively and may return `None` if diagnostic handler is not passed.
170170
/// If diagnostic handler is passed, may return `Some`,
171171
/// possibly after reporting non-fatal errors and recovery, or `None` for irrecoverable errors.
172172
crate fn from_token(

0 commit comments

Comments
 (0)