mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 12:18:33 +00:00
Rustup to rustc 1.35.0-nightly (aa99abeb2
2019-04-14)
This commit is contained in:
parent
2f36416fc9
commit
de792ad690
@ -281,6 +281,9 @@ index 828d572..bc04fb1 100644
|
|||||||
#[stable(feature = "nonzero", since = "1.28.0")]
|
#[stable(feature = "nonzero", since = "1.28.0")]
|
||||||
-pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize};
|
-pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize};
|
||||||
+pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroUsize};
|
+pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroUsize};
|
||||||
|
#[stable(feature = "signed_nonzero", since = "1.34.0")]
|
||||||
|
-pub use core::num::{NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroIsize};
|
||||||
|
+pub use core::num::{NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroIsize};
|
||||||
|
|
||||||
#[cfg(test)] use crate::fmt;
|
#[cfg(test)] use crate::fmt;
|
||||||
#[cfg(test)] use crate::ops::{Add, Sub, Mul, Div, Rem};
|
#[cfg(test)] use crate::ops::{Add, Sub, Mul, Div, Rem};
|
||||||
|
@ -62,7 +62,7 @@ index 1181b86..20f9251 100644
|
|||||||
}
|
}
|
||||||
+*/
|
+*/
|
||||||
|
|
||||||
pub fn push(f: Box<dyn FnBox()>) -> bool {
|
pub fn push(f: Box<dyn FnOnce()>) -> bool {
|
||||||
unsafe {
|
unsafe {
|
||||||
diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs
|
diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs
|
||||||
index 6260c3b..611ed7e 100644
|
index 6260c3b..611ed7e 100644
|
||||||
@ -89,7 +89,7 @@ index b2142e7..718bb1c 100644
|
|||||||
- let _handler = stack_overflow::Handler::new();
|
- let _handler = stack_overflow::Handler::new();
|
||||||
-
|
-
|
||||||
- // Finally, let's run some code.
|
- // Finally, let's run some code.
|
||||||
- Box::from_raw(main as *mut Box<dyn FnBox()>)()
|
- Box::from_raw(main as *mut Box<dyn FnOnce()>)()
|
||||||
+ panic!("Threads are not yet supported, because cranelift doesn't support atomics.");
|
+ panic!("Threads are not yet supported, because cranelift doesn't support atomics.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
src/base.rs
23
src/base.rs
@ -410,8 +410,13 @@ fn trans_stmt<'a, 'tcx: 'a>(
|
|||||||
layout::Variants::Single { index } => {
|
layout::Variants::Single { index } => {
|
||||||
assert_eq!(index, *variant_index);
|
assert_eq!(index, *variant_index);
|
||||||
}
|
}
|
||||||
layout::Variants::Multiple { discr_kind: layout::DiscriminantKind::Tag, .. } => {
|
layout::Variants::Multiple {
|
||||||
let ptr = place.place_field(fx, mir::Field::new(0));
|
discr: _,
|
||||||
|
discr_index,
|
||||||
|
discr_kind: layout::DiscriminantKind::Tag,
|
||||||
|
variants: _,
|
||||||
|
} => {
|
||||||
|
let ptr = place.place_field(fx, mir::Field::new(discr_index));
|
||||||
let to = layout
|
let to = layout
|
||||||
.ty
|
.ty
|
||||||
.ty_adt_def()
|
.ty_adt_def()
|
||||||
@ -422,15 +427,17 @@ fn trans_stmt<'a, 'tcx: 'a>(
|
|||||||
ptr.write_cvalue(fx, discr);
|
ptr.write_cvalue(fx, discr);
|
||||||
}
|
}
|
||||||
layout::Variants::Multiple {
|
layout::Variants::Multiple {
|
||||||
|
discr: _,
|
||||||
|
discr_index,
|
||||||
discr_kind: layout::DiscriminantKind::Niche {
|
discr_kind: layout::DiscriminantKind::Niche {
|
||||||
dataful_variant,
|
dataful_variant,
|
||||||
ref niche_variants,
|
ref niche_variants,
|
||||||
niche_start,
|
niche_start,
|
||||||
},
|
},
|
||||||
..
|
variants: _,
|
||||||
} => {
|
} => {
|
||||||
if *variant_index != dataful_variant {
|
if *variant_index != dataful_variant {
|
||||||
let niche = place.place_field(fx, mir::Field::new(0));
|
let niche = place.place_field(fx, mir::Field::new(discr_index));
|
||||||
//let niche_llty = niche.layout.immediate_llvm_type(bx.cx);
|
//let niche_llty = niche.layout.immediate_llvm_type(bx.cx);
|
||||||
let niche_value =
|
let niche_value =
|
||||||
((variant_index.as_u32() - niche_variants.start().as_u32()) as u128)
|
((variant_index.as_u32() - niche_variants.start().as_u32()) as u128)
|
||||||
@ -767,7 +774,7 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
|
|||||||
return trap_unreachable_ret_value(fx, dest_layout, "[panic] Tried to get discriminant for uninhabited type.");
|
return trap_unreachable_ret_value(fx, dest_layout, "[panic] Tried to get discriminant for uninhabited type.");
|
||||||
}
|
}
|
||||||
|
|
||||||
let (discr_scalar, discr_kind) = match &layout.variants {
|
let (discr_scalar, discr_index, discr_kind) = match &layout.variants {
|
||||||
layout::Variants::Single { index } => {
|
layout::Variants::Single { index } => {
|
||||||
let discr_val = layout
|
let discr_val = layout
|
||||||
.ty
|
.ty
|
||||||
@ -777,10 +784,12 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
|
|||||||
});
|
});
|
||||||
return CValue::const_val(fx, dest_layout.ty, discr_val as u64 as i64);
|
return CValue::const_val(fx, dest_layout.ty, discr_val as u64 as i64);
|
||||||
}
|
}
|
||||||
layout::Variants::Multiple { discr, discr_kind, variants: _ } => (discr, discr_kind),
|
layout::Variants::Multiple { discr, discr_index, discr_kind, variants: _ } => {
|
||||||
|
(discr, *discr_index, discr_kind)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let discr = place.place_field(fx, mir::Field::new(0)).to_cvalue(fx);
|
let discr = place.place_field(fx, mir::Field::new(discr_index)).to_cvalue(fx);
|
||||||
let discr_ty = discr.layout().ty;
|
let discr_ty = discr.layout().ty;
|
||||||
let lldiscr = discr.load_scalar(fx);
|
let lldiscr = discr.load_scalar(fx);
|
||||||
match discr_kind {
|
match discr_kind {
|
||||||
|
@ -173,7 +173,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
|||||||
if sess.opts.cg.rpath {
|
if sess.opts.cg.rpath {
|
||||||
sess.err("rpath is not yet supported");
|
sess.err("rpath is not yet supported");
|
||||||
}
|
}
|
||||||
if sess.opts.debugging_opts.pgo_gen.is_some() {
|
if sess.opts.debugging_opts.pgo_gen.enabled() {
|
||||||
sess.err("pgo is not supported");
|
sess.err("pgo is not supported");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,7 @@ fn link_args(cmd: &mut dyn Linker,
|
|||||||
cmd.build_static_executable();
|
cmd.build_static_executable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if sess.opts.debugging_opts.pgo_gen.is_some() {
|
if sess.opts.debugging_opts.pgo_gen.enabled() {
|
||||||
cmd.pgo_gen();
|
cmd.pgo_gen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user