Skip to content

Commit 847a897

Browse files
committed
fix some comments.
1 parent 47016f9 commit 847a897

File tree

1 file changed

+7
-6
lines changed
  • src/libsyntax/ext/deriving/generic

1 file changed

+7
-6
lines changed

src/libsyntax/ext/deriving/generic/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,8 @@ impl<'a> MethodDef<'a> {
10671067
.collect::<Vec<ast::Ident>>();
10681068

10691069
// The `vi_idents` will be bound, solely in the catch-all, to
1070-
// a series of let statements mapping each self_arg to an isize
1071-
// corresponding to its discriminant value.
1070+
// a series of let statements mapping each self_arg to an int
1071+
// value corresponding to its discriminant.
10721072
let vi_idents: Vec<ast::Ident> = self_arg_names.iter()
10731073
.map(|name| { let vi_suffix = format!("{}_vi", &name[..]);
10741074
cx.ident_of(&vi_suffix[..]) })
@@ -1186,18 +1186,19 @@ impl<'a> MethodDef<'a> {
11861186
// Build a series of let statements mapping each self_arg
11871187
// to its discriminant value. If this is a C-style enum
11881188
// with a specific repr type, then casts the values to
1189-
// that type. Otherwise casts to `isize`.
1189+
// that type. Otherwise casts to `i32` (the default repr
1190+
// type).
11901191
//
11911192
// i.e. for `enum E<T> { A, B(1), C(T, T) }`, and a deriving
11921193
// with three Self args, builds three statements:
11931194
//
11941195
// ```
11951196
// let __self0_vi = unsafe {
1196-
// std::intrinsics::discriminant_value(&self) } as isize;
1197+
// std::intrinsics::discriminant_value(&self) } as i32;
11971198
// let __self1_vi = unsafe {
1198-
// std::intrinsics::discriminant_value(&__arg1) } as isize;
1199+
// std::intrinsics::discriminant_value(&__arg1) } as i32;
11991200
// let __self2_vi = unsafe {
1200-
// std::intrinsics::discriminant_value(&__arg2) } as isize;
1201+
// std::intrinsics::discriminant_value(&__arg2) } as i32;
12011202
// ```
12021203
let mut index_let_stmts: Vec<P<ast::Stmt>> = Vec::new();
12031204

0 commit comments

Comments
 (0)