Avoid nightly feature usage where easily possible
This commit is contained in:
parent
664b25ea38
commit
0069007d5b
4 changed files with 12 additions and 26 deletions
|
@ -1,7 +1,4 @@
|
||||||
#![feature(
|
#![feature(no_core, lang_items, box_syntax, never_type, linkage, extern_types, thread_local)]
|
||||||
no_core, start, lang_items, box_syntax, never_type, linkage,
|
|
||||||
extern_types, thread_local
|
|
||||||
)]
|
|
||||||
#![no_core]
|
#![no_core]
|
||||||
#![allow(dead_code, non_camel_case_types)]
|
#![allow(dead_code, non_camel_case_types)]
|
||||||
|
|
||||||
|
|
24
src/base.rs
24
src/base.rs
|
@ -465,16 +465,16 @@ fn codegen_stmt<'tcx>(
|
||||||
let val = crate::constant::codegen_tls_ref(fx, def_id, lval.layout());
|
let val = crate::constant::codegen_tls_ref(fx, def_id, lval.layout());
|
||||||
lval.write_cvalue(fx, val);
|
lval.write_cvalue(fx, val);
|
||||||
}
|
}
|
||||||
Rvalue::BinaryOp(bin_op, box (ref lhs, ref rhs)) => {
|
Rvalue::BinaryOp(bin_op, ref lhs_rhs) => {
|
||||||
let lhs = codegen_operand(fx, lhs);
|
let lhs = codegen_operand(fx, &lhs_rhs.0);
|
||||||
let rhs = codegen_operand(fx, rhs);
|
let rhs = codegen_operand(fx, &lhs_rhs.1);
|
||||||
|
|
||||||
let res = crate::num::codegen_binop(fx, bin_op, lhs, rhs);
|
let res = crate::num::codegen_binop(fx, bin_op, lhs, rhs);
|
||||||
lval.write_cvalue(fx, res);
|
lval.write_cvalue(fx, res);
|
||||||
}
|
}
|
||||||
Rvalue::CheckedBinaryOp(bin_op, box (ref lhs, ref rhs)) => {
|
Rvalue::CheckedBinaryOp(bin_op, ref lhs_rhs) => {
|
||||||
let lhs = codegen_operand(fx, lhs);
|
let lhs = codegen_operand(fx, &lhs_rhs.0);
|
||||||
let rhs = codegen_operand(fx, rhs);
|
let rhs = codegen_operand(fx, &lhs_rhs.1);
|
||||||
|
|
||||||
let res = if !fx.tcx.sess.overflow_checks() {
|
let res = if !fx.tcx.sess.overflow_checks() {
|
||||||
let val =
|
let val =
|
||||||
|
@ -835,19 +835,15 @@ fn codegen_stmt<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatementKind::Coverage { .. } => fx.tcx.sess.fatal("-Zcoverage is unimplemented"),
|
StatementKind::Coverage { .. } => fx.tcx.sess.fatal("-Zcoverage is unimplemented"),
|
||||||
StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping {
|
StatementKind::CopyNonOverlapping(inner) => {
|
||||||
src,
|
let dst = codegen_operand(fx, &inner.dst);
|
||||||
dst,
|
|
||||||
count,
|
|
||||||
}) => {
|
|
||||||
let dst = codegen_operand(fx, dst);
|
|
||||||
let pointee = dst
|
let pointee = dst
|
||||||
.layout()
|
.layout()
|
||||||
.pointee_info_at(fx, rustc_target::abi::Size::ZERO)
|
.pointee_info_at(fx, rustc_target::abi::Size::ZERO)
|
||||||
.expect("Expected pointer");
|
.expect("Expected pointer");
|
||||||
let dst = dst.load_scalar(fx);
|
let dst = dst.load_scalar(fx);
|
||||||
let src = codegen_operand(fx, src).load_scalar(fx);
|
let src = codegen_operand(fx, &inner.src).load_scalar(fx);
|
||||||
let count = codegen_operand(fx, count).load_scalar(fx);
|
let count = codegen_operand(fx, &inner.count).load_scalar(fx);
|
||||||
let elem_size: u64 = pointee.size.bytes();
|
let elem_size: u64 = pointee.size.bytes();
|
||||||
let bytes = if elem_size != 1 {
|
let bytes = if elem_size != 1 {
|
||||||
fx.bcx.ins().imul_imm(count, elem_size as i64)
|
fx.bcx.ins().imul_imm(count, elem_size as i64)
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
#![feature(
|
#![feature(
|
||||||
rustc_private,
|
rustc_private,
|
||||||
decl_macro,
|
decl_macro,
|
||||||
type_alias_impl_trait,
|
|
||||||
associated_type_bounds,
|
|
||||||
never_type,
|
never_type,
|
||||||
try_blocks,
|
|
||||||
box_patterns,
|
|
||||||
hash_drain_filter
|
hash_drain_filter
|
||||||
)]
|
)]
|
||||||
#![warn(rust_2018_idioms)]
|
#![warn(rust_2018_idioms)]
|
||||||
|
|
|
@ -224,10 +224,7 @@ pub(crate) fn write_ir_file(
|
||||||
|
|
||||||
let clif_file_name = clif_output_dir.join(name);
|
let clif_file_name = clif_output_dir.join(name);
|
||||||
|
|
||||||
let res: std::io::Result<()> = try {
|
let res = std::fs::File::create(clif_file_name).and_then(|mut file| write(&mut file));
|
||||||
let mut file = std::fs::File::create(clif_file_name)?;
|
|
||||||
write(&mut file)?;
|
|
||||||
};
|
|
||||||
if let Err(err) = res {
|
if let Err(err) = res {
|
||||||
tcx.sess.warn(&format!("error writing ir file: {}", err));
|
tcx.sess.warn(&format!("error writing ir file: {}", err));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue