Skip to content

Commit 7ce5468

Browse files
committed
Fix rebase fallout
1 parent 90c65e4 commit 7ce5468

File tree

14 files changed

+28
-13
lines changed

14 files changed

+28
-13
lines changed

src/librustc/ty/layout.rs

+4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ impl Integer {
349349
I16 => Size::from_bytes(2),
350350
I32 => Size::from_bytes(4),
351351
I64 => Size::from_bytes(8),
352+
I128 => Size::from_bytes(16),
352353
}
353354
}
354355

@@ -359,6 +360,7 @@ impl Integer {
359360
I16 => dl.i16_align,
360361
I32 => dl.i32_align,
361362
I64 => dl.i64_align,
363+
I128 => dl.i128_align,
362364
}
363365
}
364366

@@ -370,11 +372,13 @@ impl Integer {
370372
(I16, false) => tcx.types.u16,
371373
(I32, false) => tcx.types.u32,
372374
(I64, false) => tcx.types.u64,
375+
(I128, false) => tcx.types.u128,
373376
(I1, true) => tcx.types.i8,
374377
(I8, true) => tcx.types.i8,
375378
(I16, true) => tcx.types.i16,
376379
(I32, true) => tcx.types.i32,
377380
(I64, true) => tcx.types.i64,
381+
(I128, true) => tcx.types.i128,
378382
}
379383
}
380384

src/librustc_macro/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ crate-type = ["dylib"]
1010

1111
[dependencies]
1212
syntax = { path = "../libsyntax" }
13-
rustc_i128 = { path = "../librustc_i128" }

src/librustc_metadata/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use syntax::attr;
4444
use syntax::ast::{self, NodeId};
4545
use syntax::codemap;
4646
use syntax_pos::{self, Span, BytePos, Pos};
47-
use rustc_i128::u128;
47+
use rustc_i128::{u128, i128};
4848

4949
pub struct DecodeContext<'a, 'tcx: 'a> {
5050
opaque: opaque::Decoder<'a>,

src/librustc_metadata/encoder.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ use rustc::hir::{self, PatKind};
4242
use rustc::hir::intravisit::Visitor;
4343
use rustc::hir::intravisit;
4444

45+
use rustc_i128::{u128, i128};
46+
4547
use super::index_builder::{FromId, IndexBuilder, Untracked};
4648

4749
pub struct EncodeContext<'a, 'tcx: 'a> {
@@ -75,12 +77,14 @@ impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx> {
7577

7678
encoder_methods! {
7779
emit_usize(usize);
80+
emit_u128(u128);
7881
emit_u64(u64);
7982
emit_u32(u32);
8083
emit_u16(u16);
8184
emit_u8(u8);
8285

8386
emit_isize(isize);
87+
emit_i128(i128);
8488
emit_i64(i64);
8589
emit_i32(i32);
8690
emit_i16(i16);
@@ -259,7 +263,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
259263

260264
let data = VariantData {
261265
kind: variant.kind,
262-
disr: variant.disr_val.to_u64_unchecked(),
266+
disr: variant.disr_val.to_u128_unchecked(),
263267
struct_ctor: None
264268
};
265269

@@ -410,7 +414,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
410414

411415
let data = VariantData {
412416
kind: variant.kind,
413-
disr: variant.disr_val.to_u64_unchecked(),
417+
disr: variant.disr_val.to_u128_unchecked(),
414418
struct_ctor: Some(def_id.index)
415419
};
416420

@@ -672,7 +676,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
672676
};
673677
EntryKind::Struct(self.lazy(&VariantData {
674678
kind: variant.kind,
675-
disr: variant.disr_val.to_u64_unchecked(),
679+
disr: variant.disr_val.to_u128_unchecked(),
676680
struct_ctor: struct_ctor
677681
}))
678682
}
@@ -681,7 +685,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
681685

682686
EntryKind::Union(self.lazy(&VariantData {
683687
kind: variant.kind,
684-
disr: variant.disr_val.to_u64_unchecked(),
688+
disr: variant.disr_val.to_u128_unchecked(),
685689
struct_ctor: None
686690
}))
687691
}

src/librustc_metadata/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ mod diagnostics;
5151

5252
pub use rustc::middle;
5353

54-
#[macro_use]
55-
mod macros;
56-
5754
mod astencode;
5855
mod index_builder;
5956
mod index;

src/librustc_metadata/schema.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ use syntax_pos::{self, Span};
2626

2727
use std::marker::PhantomData;
2828

29+
use rustc_i128::u128;
30+
2931
#[cfg(not(test))]
3032
pub const RUSTC_VERSION: &'static str = concat!("rustc ", env!("CFG_VERSION"));
3133

@@ -264,7 +266,7 @@ pub struct FnData {
264266
#[derive(RustcEncodable, RustcDecodable)]
265267
pub struct VariantData {
266268
pub kind: ty::VariantKind,
267-
pub disr: u64,
269+
pub disr: u128,
268270

269271
/// If this is a struct's only variant, this
270272
/// is the index of the "struct ctor" item.

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2498,7 +2498,7 @@ impl<'a> Resolver<'a> {
24982498
match prim {
24992499
Some(&TyUint(UintTy::U128)) | Some(&TyInt(IntTy::I128)) => {
25002500
if !this.session.features.borrow().i128_type {
2501-
emit_feature_err(&this.session.parse_sess.span_diagnostic,
2501+
emit_feature_err(&this.session.parse_sess,
25022502
"i128_type", span, GateIssue::Language,
25032503
"128-bit type is unstable");
25042504
}

src/librustc_trans/type_.rs

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ impl Type {
315315
I16 => Type::i16(cx),
316316
I32 => Type::i32(cx),
317317
I64 => Type::i64(cx),
318+
I128 => Type::i128(cx),
318319
}
319320
}
320321

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
12461246
let repr_type_ty = ccx.tcx.enum_repr_type(Some(&hint)).to_ty(ccx.tcx);
12471247
if repr_type_ty == ccx.tcx.types.i128 || repr_type_ty == ccx.tcx.types.u128 {
12481248
if !ccx.tcx.sess.features.borrow().i128_type {
1249-
emit_feature_err(&ccx.tcx.sess.parse_sess.span_diagnostic,
1249+
emit_feature_err(&ccx.tcx.sess.parse_sess,
12501250
"i128_type", sp, GateIssue::Language, "128-bit type is unstable");
12511251
}
12521252
}

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ declare_features! (
305305
(active, compiler_builtins, "1.13.0", None),
306306

307307
// The `i128` type
308-
(active, i128_type, "1.14.0", Some(35118))
308+
(active, i128_type, "1.14.0", Some(35118)),
309309
);
310310

311311
declare_features! (

src/libsyntax_ext/deriving/generic/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ fn find_repr_type_name(diagnostic: &Handler, type_attrs: &[ast::Attribute]) -> &
791791
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U8)) => "u8",
792792
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U16)) => "u16",
793793
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U32)) => "u32",
794+
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U64)) => "u64",
794795
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U128)) => "u128",
795796
}
796797
}

src/rustllvm/RustWrapper.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,7 @@ extern "C" LLVMRustLinkage LLVMRustGetLinkage(LLVMValueRef V) {
13111311

13121312
extern "C" void LLVMRustSetLinkage(LLVMValueRef V, LLVMRustLinkage RustLinkage) {
13131313
LLVMSetLinkage(V, from_rust(RustLinkage));
1314+
}
13141315

13151316
// Returns true if both high and low were successfully set. Fails in case constant wasn’t any of
13161317
// the common sizes (1, 8, 16, 32, 64, 128 bits)

src/test/run-pass/i128.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
11+
// ignore-stage0
12+
// ignore-stage1
1013
#![feature(i128_type)]
1114

1215
fn main() {

src/test/run-pass/u128.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
11+
// ignore-stage0
12+
// ignore-stage1
1013
#![feature(i128_type)]
1114

1215
fn main() {

0 commit comments

Comments
 (0)