Fix rebase fallout
This commit includes manual merge conflict resolution changes from a rebase by @est31.
This commit is contained in:
parent
bfa53cfb76
commit
7a3704c500
@ -9,4 +9,3 @@ crate-type = ["dylib"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
syntax = { path = "../libsyntax" }
|
syntax = { path = "../libsyntax" }
|
||||||
rustc_i128 = { path = "../librustc_i128" }
|
|
||||||
|
@ -350,6 +350,7 @@ impl Integer {
|
|||||||
I16 => Size::from_bytes(2),
|
I16 => Size::from_bytes(2),
|
||||||
I32 => Size::from_bytes(4),
|
I32 => Size::from_bytes(4),
|
||||||
I64 => Size::from_bytes(8),
|
I64 => Size::from_bytes(8),
|
||||||
|
I128 => Size::from_bytes(16),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,6 +361,7 @@ impl Integer {
|
|||||||
I16 => dl.i16_align,
|
I16 => dl.i16_align,
|
||||||
I32 => dl.i32_align,
|
I32 => dl.i32_align,
|
||||||
I64 => dl.i64_align,
|
I64 => dl.i64_align,
|
||||||
|
I128 => dl.i128_align,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,11 +373,13 @@ impl Integer {
|
|||||||
(I16, false) => tcx.types.u16,
|
(I16, false) => tcx.types.u16,
|
||||||
(I32, false) => tcx.types.u32,
|
(I32, false) => tcx.types.u32,
|
||||||
(I64, false) => tcx.types.u64,
|
(I64, false) => tcx.types.u64,
|
||||||
|
(I128, false) => tcx.types.u128,
|
||||||
(I1, true) => tcx.types.i8,
|
(I1, true) => tcx.types.i8,
|
||||||
(I8, true) => tcx.types.i8,
|
(I8, true) => tcx.types.i8,
|
||||||
(I16, true) => tcx.types.i16,
|
(I16, true) => tcx.types.i16,
|
||||||
(I32, true) => tcx.types.i32,
|
(I32, true) => tcx.types.i32,
|
||||||
(I64, true) => tcx.types.i64,
|
(I64, true) => tcx.types.i64,
|
||||||
|
(I128, true) => tcx.types.i128,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ use syntax::ast::{self, NodeId};
|
|||||||
use syntax::codemap;
|
use syntax::codemap;
|
||||||
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP};
|
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP};
|
||||||
use syntax_pos::{self, Span, BytePos, Pos};
|
use syntax_pos::{self, Span, BytePos, Pos};
|
||||||
use rustc_i128::u128;
|
use rustc_i128::{u128, i128};
|
||||||
|
|
||||||
pub struct DecodeContext<'a, 'tcx: 'a> {
|
pub struct DecodeContext<'a, 'tcx: 'a> {
|
||||||
opaque: opaque::Decoder<'a>,
|
opaque: opaque::Decoder<'a>,
|
||||||
|
@ -43,6 +43,8 @@ use rustc::hir::itemlikevisit::ItemLikeVisitor;
|
|||||||
use rustc::hir::intravisit::{Visitor, NestedVisitorMap};
|
use rustc::hir::intravisit::{Visitor, NestedVisitorMap};
|
||||||
use rustc::hir::intravisit;
|
use rustc::hir::intravisit;
|
||||||
|
|
||||||
|
use rustc_i128::{u128, i128};
|
||||||
|
|
||||||
use super::index_builder::{FromId, IndexBuilder, Untracked};
|
use super::index_builder::{FromId, IndexBuilder, Untracked};
|
||||||
|
|
||||||
pub struct EncodeContext<'a, 'tcx: 'a> {
|
pub struct EncodeContext<'a, 'tcx: 'a> {
|
||||||
@ -75,12 +77,14 @@ impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx> {
|
|||||||
|
|
||||||
encoder_methods! {
|
encoder_methods! {
|
||||||
emit_usize(usize);
|
emit_usize(usize);
|
||||||
|
emit_u128(u128);
|
||||||
emit_u64(u64);
|
emit_u64(u64);
|
||||||
emit_u32(u32);
|
emit_u32(u32);
|
||||||
emit_u16(u16);
|
emit_u16(u16);
|
||||||
emit_u8(u8);
|
emit_u8(u8);
|
||||||
|
|
||||||
emit_isize(isize);
|
emit_isize(isize);
|
||||||
|
emit_i128(i128);
|
||||||
emit_i64(i64);
|
emit_i64(i64);
|
||||||
emit_i32(i32);
|
emit_i32(i32);
|
||||||
emit_i16(i16);
|
emit_i16(i16);
|
||||||
@ -259,7 +263,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||||||
|
|
||||||
let data = VariantData {
|
let data = VariantData {
|
||||||
ctor_kind: variant.ctor_kind,
|
ctor_kind: variant.ctor_kind,
|
||||||
disr: variant.disr_val.to_u64_unchecked(),
|
disr: variant.disr_val.to_u128_unchecked(),
|
||||||
struct_ctor: None,
|
struct_ctor: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -386,7 +390,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||||||
|
|
||||||
let data = VariantData {
|
let data = VariantData {
|
||||||
ctor_kind: variant.ctor_kind,
|
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),
|
struct_ctor: Some(def_id.index),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -648,7 +652,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||||||
};
|
};
|
||||||
EntryKind::Struct(self.lazy(&VariantData {
|
EntryKind::Struct(self.lazy(&VariantData {
|
||||||
ctor_kind: variant.ctor_kind,
|
ctor_kind: variant.ctor_kind,
|
||||||
disr: variant.disr_val.to_u64_unchecked(),
|
disr: variant.disr_val.to_u128_unchecked(),
|
||||||
struct_ctor: struct_ctor,
|
struct_ctor: struct_ctor,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@ -657,7 +661,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||||||
|
|
||||||
EntryKind::Union(self.lazy(&VariantData {
|
EntryKind::Union(self.lazy(&VariantData {
|
||||||
ctor_kind: variant.ctor_kind,
|
ctor_kind: variant.ctor_kind,
|
||||||
disr: variant.disr_val.to_u64_unchecked(),
|
disr: variant.disr_val.to_u128_unchecked(),
|
||||||
struct_ctor: None,
|
struct_ctor: None,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,6 @@ mod diagnostics;
|
|||||||
|
|
||||||
pub use rustc::middle;
|
pub use rustc::middle;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
mod macros;
|
|
||||||
|
|
||||||
mod astencode;
|
mod astencode;
|
||||||
mod index_builder;
|
mod index_builder;
|
||||||
mod index;
|
mod index;
|
||||||
|
@ -27,6 +27,8 @@ use syntax_pos::{self, Span};
|
|||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
|
use rustc_i128::u128;
|
||||||
|
|
||||||
pub fn rustc_version() -> String {
|
pub fn rustc_version() -> String {
|
||||||
format!("rustc {}",
|
format!("rustc {}",
|
||||||
option_env!("CFG_VERSION").unwrap_or("unknown version"))
|
option_env!("CFG_VERSION").unwrap_or("unknown version"))
|
||||||
@ -264,7 +266,7 @@ pub struct FnData {
|
|||||||
#[derive(RustcEncodable, RustcDecodable)]
|
#[derive(RustcEncodable, RustcDecodable)]
|
||||||
pub struct VariantData {
|
pub struct VariantData {
|
||||||
pub ctor_kind: CtorKind,
|
pub ctor_kind: CtorKind,
|
||||||
pub disr: u64,
|
pub disr: u128,
|
||||||
|
|
||||||
/// If this is a struct's only variant, this
|
/// If this is a struct's only variant, this
|
||||||
/// is the index of the "struct ctor" item.
|
/// is the index of the "struct ctor" item.
|
||||||
|
@ -2313,8 +2313,8 @@ impl<'a> Resolver<'a> {
|
|||||||
let prim = self.primitive_type_table.primitive_types[&path[0].name];
|
let prim = self.primitive_type_table.primitive_types[&path[0].name];
|
||||||
match prim {
|
match prim {
|
||||||
TyUint(UintTy::U128) | TyInt(IntTy::I128) => {
|
TyUint(UintTy::U128) | TyInt(IntTy::I128) => {
|
||||||
if !this.session.features.borrow().i128_type {
|
if !self.session.features.borrow().i128_type {
|
||||||
emit_feature_err(&this.session.parse_sess.span_diagnostic,
|
emit_feature_err(&self.session.parse_sess,
|
||||||
"i128_type", span, GateIssue::Language,
|
"i128_type", span, GateIssue::Language,
|
||||||
"128-bit type is unstable");
|
"128-bit type is unstable");
|
||||||
|
|
||||||
|
@ -313,6 +313,7 @@ impl Type {
|
|||||||
I16 => Type::i16(cx),
|
I16 => Type::i16(cx),
|
||||||
I32 => Type::i32(cx),
|
I32 => Type::i32(cx),
|
||||||
I64 => Type::i64(cx),
|
I64 => Type::i64(cx),
|
||||||
|
I128 => Type::i128(cx),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
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 repr_type_ty == ccx.tcx.types.i128 || repr_type_ty == ccx.tcx.types.u128 {
|
||||||
if !ccx.tcx.sess.features.borrow().i128_type {
|
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");
|
"i128_type", sp, GateIssue::Language, "128-bit type is unstable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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::U8)) => "u8",
|
||||||
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U16)) => "u16",
|
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U16)) => "u16",
|
||||||
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U32)) => "u32",
|
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U32)) => "u32",
|
||||||
|
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U64)) => "u64",
|
||||||
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U128)) => "u128",
|
attr::ReprInt(attr::UnsignedInt(ast::UintTy::U128)) => "u128",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1456,6 +1456,7 @@ extern "C" LLVMRustLinkage LLVMRustGetLinkage(LLVMValueRef V) {
|
|||||||
|
|
||||||
extern "C" void LLVMRustSetLinkage(LLVMValueRef V, LLVMRustLinkage RustLinkage) {
|
extern "C" void LLVMRustSetLinkage(LLVMValueRef V, LLVMRustLinkage RustLinkage) {
|
||||||
LLVMSetLinkage(V, from_rust(RustLinkage));
|
LLVMSetLinkage(V, from_rust(RustLinkage));
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true if both high and low were successfully set. Fails in case constant wasn’t any of
|
// 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)
|
// the common sizes (1, 8, 16, 32, 64, 128 bits)
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// ignore-stage0
|
||||||
|
// ignore-stage1
|
||||||
#![feature(i128_type)]
|
#![feature(i128_type)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// ignore-stage0
|
||||||
|
// ignore-stage1
|
||||||
#![feature(i128_type)]
|
#![feature(i128_type)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user