Skip to content

Commit

Permalink
Fix rebase fallout
Browse files Browse the repository at this point in the history
This commit includes manual merge conflict resolution changes from a rebase by @est31.
  • Loading branch information
nagisa authored and est31 committed Dec 30, 2016
1 parent bfa53cf commit 7a3704c
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/libproc_macro/Cargo.toml
Expand Up @@ -9,4 +9,3 @@ crate-type = ["dylib"]

[dependencies]
syntax = { path = "../libsyntax" }
rustc_i128 = { path = "../librustc_i128" }
4 changes: 4 additions & 0 deletions src/librustc/ty/layout.rs
Expand Up @@ -350,6 +350,7 @@ impl Integer {
I16 => Size::from_bytes(2),
I32 => Size::from_bytes(4),
I64 => Size::from_bytes(8),
I128 => Size::from_bytes(16),
}
}

Expand All @@ -360,6 +361,7 @@ impl Integer {
I16 => dl.i16_align,
I32 => dl.i32_align,
I64 => dl.i64_align,
I128 => dl.i128_align,
}
}

Expand All @@ -371,11 +373,13 @@ impl Integer {
(I16, false) => tcx.types.u16,
(I32, false) => tcx.types.u32,
(I64, false) => tcx.types.u64,
(I128, false) => tcx.types.u128,
(I1, true) => tcx.types.i8,
(I8, true) => tcx.types.i8,
(I16, true) => tcx.types.i16,
(I32, true) => tcx.types.i32,
(I64, true) => tcx.types.i64,
(I128, true) => tcx.types.i128,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/decoder.rs
Expand Up @@ -44,7 +44,7 @@ use syntax::ast::{self, NodeId};
use syntax::codemap;
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP};
use syntax_pos::{self, Span, BytePos, Pos};
use rustc_i128::u128;
use rustc_i128::{u128, i128};

pub struct DecodeContext<'a, 'tcx: 'a> {
opaque: opaque::Decoder<'a>,
Expand Down
12 changes: 8 additions & 4 deletions src/librustc_metadata/encoder.rs
Expand Up @@ -43,6 +43,8 @@ use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::intravisit::{Visitor, NestedVisitorMap};
use rustc::hir::intravisit;

use rustc_i128::{u128, i128};

use super::index_builder::{FromId, IndexBuilder, Untracked};

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

encoder_methods! {
emit_usize(usize);
emit_u128(u128);
emit_u64(u64);
emit_u32(u32);
emit_u16(u16);
emit_u8(u8);

emit_isize(isize);
emit_i128(i128);
emit_i64(i64);
emit_i32(i32);
emit_i16(i16);
Expand Down Expand Up @@ -259,7 +263,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {

let data = VariantData {
ctor_kind: variant.ctor_kind,
disr: variant.disr_val.to_u64_unchecked(),
disr: variant.disr_val.to_u128_unchecked(),
struct_ctor: None,
};

Expand Down Expand Up @@ -386,7 +390,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {

let data = VariantData {
ctor_kind: variant.ctor_kind,
disr: variant.disr_val.to_u64_unchecked(),
disr: variant.disr_val.to_u128_unchecked(),
struct_ctor: Some(def_id.index),
};

Expand Down Expand Up @@ -648,7 +652,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
};
EntryKind::Struct(self.lazy(&VariantData {
ctor_kind: variant.ctor_kind,
disr: variant.disr_val.to_u64_unchecked(),
disr: variant.disr_val.to_u128_unchecked(),
struct_ctor: struct_ctor,
}))
}
Expand All @@ -657,7 +661,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {

EntryKind::Union(self.lazy(&VariantData {
ctor_kind: variant.ctor_kind,
disr: variant.disr_val.to_u64_unchecked(),
disr: variant.disr_val.to_u128_unchecked(),
struct_ctor: None,
}))
}
Expand Down
3 changes: 0 additions & 3 deletions src/librustc_metadata/lib.rs
Expand Up @@ -51,9 +51,6 @@ mod diagnostics;

pub use rustc::middle;

#[macro_use]
mod macros;

mod astencode;
mod index_builder;
mod index;
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_metadata/schema.rs
Expand Up @@ -27,6 +27,8 @@ use syntax_pos::{self, Span};

use std::marker::PhantomData;

use rustc_i128::u128;

pub fn rustc_version() -> String {
format!("rustc {}",
option_env!("CFG_VERSION").unwrap_or("unknown version"))
Expand Down Expand Up @@ -264,7 +266,7 @@ pub struct FnData {
#[derive(RustcEncodable, RustcDecodable)]
pub struct VariantData {
pub ctor_kind: CtorKind,
pub disr: u64,
pub disr: u128,

/// If this is a struct's only variant, this
/// is the index of the "struct ctor" item.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_resolve/lib.rs
Expand Up @@ -2313,8 +2313,8 @@ impl<'a> Resolver<'a> {
let prim = self.primitive_type_table.primitive_types[&path[0].name];
match prim {
TyUint(UintTy::U128) | TyInt(IntTy::I128) => {
if !this.session.features.borrow().i128_type {
emit_feature_err(&this.session.parse_sess.span_diagnostic,
if !self.session.features.borrow().i128_type {
emit_feature_err(&self.session.parse_sess,
"i128_type", span, GateIssue::Language,
"128-bit type is unstable");

Expand Down
1 change: 1 addition & 0 deletions src/librustc_trans/type_.rs
Expand Up @@ -313,6 +313,7 @@ impl Type {
I16 => Type::i16(cx),
I32 => Type::i32(cx),
I64 => Type::i64(cx),
I128 => Type::i128(cx),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Expand Up @@ -1332,7 +1332,7 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
let repr_type_ty = ccx.tcx.enum_repr_type(Some(&hint)).to_ty(ccx.tcx);
if repr_type_ty == ccx.tcx.types.i128 || repr_type_ty == ccx.tcx.types.u128 {
if !ccx.tcx.sess.features.borrow().i128_type {
emit_feature_err(&ccx.tcx.sess.parse_sess.span_diagnostic,
emit_feature_err(&ccx.tcx.sess.parse_sess,
"i128_type", sp, GateIssue::Language, "128-bit type is unstable");
}
}
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax_ext/deriving/generic/mod.rs
Expand Up @@ -788,6 +788,7 @@ fn find_repr_type_name(diagnostic: &Handler, type_attrs: &[ast::Attribute]) -> &
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U8)) => "u8",
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U16)) => "u16",
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U32)) => "u32",
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U64)) => "u64",
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U128)) => "u128",
}
}
Expand Down
1 change: 1 addition & 0 deletions src/rustllvm/RustWrapper.cpp
Expand Up @@ -1456,6 +1456,7 @@ extern "C" LLVMRustLinkage LLVMRustGetLinkage(LLVMValueRef V) {

extern "C" void LLVMRustSetLinkage(LLVMValueRef V, LLVMRustLinkage RustLinkage) {
LLVMSetLinkage(V, from_rust(RustLinkage));
}

// Returns true if both high and low were successfully set. Fails in case constant wasn’t any of
// the common sizes (1, 8, 16, 32, 64, 128 bits)
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/i128.rs
Expand Up @@ -7,6 +7,9 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-stage0
// ignore-stage1
#![feature(i128_type)]

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-pass/u128.rs
Expand Up @@ -7,6 +7,9 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-stage0
// ignore-stage1
#![feature(i128_type)]

fn main() {
Expand Down

0 comments on commit 7a3704c

Please sign in to comment.