Skip to content

Rollup of 6 pull requests #35979

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

Merged
merged 20 commits into from
Aug 25, 2016
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6b95606
rustc_trans: do not generate allocas for unused locals.
eddyb Aug 23, 2016
892bf3d
Use a macro in test_decode_utf8 to preserve line numbers in panic mes…
SimonSapin Aug 23, 2016
46226a7
Yield Err in char::decode_utf8 per Unicode, like String::from_utf8_lossy
SimonSapin Aug 23, 2016
2655c89
Use idiomatic names for string-related methods names.
frewsxcv Aug 24, 2016
19aae8e
Reuse iterator to avoid unnecessary creation.
frewsxcv Aug 24, 2016
28ecfb6
Move ItemEnum → Generics logic into method on ItemEnum.
frewsxcv Aug 20, 2016
7dc4116
Migrate Context::maybe_ignore_item method to standalone function.
frewsxcv Aug 20, 2016
30397ae
Migrate ItemType::from_item to convert::From.
frewsxcv Aug 20, 2016
0c9ff54
Migrate ItemType::from_type_kind to convert::From.
frewsxcv Aug 20, 2016
9dde563
Stop reexporting `PrimitiveType` enum in librustdoc.
frewsxcv Aug 23, 2016
5c849f4
Remove unnecessary 'Primitive' prefix on `PrimitiveType` enum variants.
frewsxcv Aug 23, 2016
8a6f7a5
Implement `From<ast::IntTy>` for `PrimitiveType`.
frewsxcv Aug 23, 2016
168cfea
Implement `From<ast::UintTy>` for `PrimitiveType`.
frewsxcv Aug 23, 2016
42e8ac8
Implement `From<ast::FloatTy>` for `PrimitiveType`.
frewsxcv Aug 23, 2016
cf64611
Fix debug line info for macro expansions.
vadimcn Aug 25, 2016
e0e1954
Rollup merge of #35238 - vadimcn:macro-debug-locs, r=michaelwoerister
Manishearth Aug 25, 2016
5e69622
Rollup merge of #35867 - frewsxcv:rustdoc-cleanup, r=alexcrichton
Manishearth Aug 25, 2016
7963bbb
Rollup merge of #35916 - eddyb:mir-no-dead-allocas, r=Aatch
Manishearth Aug 25, 2016
5deee46
Rollup merge of #35947 - SimonSapin:decodeutf8-error-handling, r=alex…
Manishearth Aug 25, 2016
cf597ab
Rollup merge of #35955 - frewsxcv:idiomatic-methods, r=eddyb
Manishearth Aug 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement From<ast::IntTy> for PrimitiveType.
  • Loading branch information
frewsxcv committed Aug 25, 2016
commit 8a6f7a5ced0217344f2f8a8c6a98aefb08b10fa7
23 changes: 13 additions & 10 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,17 @@ impl PrimitiveType {
}
}

impl From<ast::IntTy> for PrimitiveType {
fn from(int_ty: ast::IntTy) -> PrimitiveType {
match int_ty {
ast::IntTy::Is => PrimitiveType::Isize,
ast::IntTy::I8 => PrimitiveType::I8,
ast::IntTy::I16 => PrimitiveType::I16,
ast::IntTy::I32 => PrimitiveType::I32,
ast::IntTy::I64 => PrimitiveType::I64,
}
}
}

// Poor man's type parameter substitution at HIR level.
// Used to replace private type aliases in public signatures with their aliased types.
Expand Down Expand Up @@ -1772,11 +1783,7 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
ty::TyNever => Never,
ty::TyBool => Primitive(PrimitiveType::Bool),
ty::TyChar => Primitive(PrimitiveType::Char),
ty::TyInt(ast::IntTy::Is) => Primitive(PrimitiveType::Isize),
ty::TyInt(ast::IntTy::I8) => Primitive(PrimitiveType::I8),
ty::TyInt(ast::IntTy::I16) => Primitive(PrimitiveType::I16),
ty::TyInt(ast::IntTy::I32) => Primitive(PrimitiveType::I32),
ty::TyInt(ast::IntTy::I64) => Primitive(PrimitiveType::I64),
ty::TyInt(int_ty) => Primitive(int_ty.into()),
ty::TyUint(ast::UintTy::Us) => Primitive(PrimitiveType::Usize),
ty::TyUint(ast::UintTy::U8) => Primitive(PrimitiveType::U8),
ty::TyUint(ast::UintTy::U16) => Primitive(PrimitiveType::U16),
Expand Down Expand Up @@ -2741,11 +2748,7 @@ fn resolve_type(cx: &DocContext,
hir::TyStr => return Primitive(PrimitiveType::Str),
hir::TyBool => return Primitive(PrimitiveType::Bool),
hir::TyChar => return Primitive(PrimitiveType::Char),
hir::TyInt(ast::IntTy::Is) => return Primitive(PrimitiveType::Isize),
hir::TyInt(ast::IntTy::I8) => return Primitive(PrimitiveType::I8),
hir::TyInt(ast::IntTy::I16) => return Primitive(PrimitiveType::I16),
hir::TyInt(ast::IntTy::I32) => return Primitive(PrimitiveType::I32),
hir::TyInt(ast::IntTy::I64) => return Primitive(PrimitiveType::I64),
hir::TyInt(int_ty) => return Primitive(int_ty.into()),
hir::TyUint(ast::UintTy::Us) => return Primitive(PrimitiveType::Usize),
hir::TyUint(ast::UintTy::U8) => return Primitive(PrimitiveType::U8),
hir::TyUint(ast::UintTy::U16) => return Primitive(PrimitiveType::U16),
Expand Down