mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-08 21:28:33 +00:00
Auto merge of #69535 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports This backports the following PRs: * ci: switch macOS builders to 10.15 #68863 * Backport release notes of 1.41.1 #69468 * Cherry-pick the LLVM fix for #69225 #69450 * `lit_to_const`: gracefully bubble up type errors. #69330 * [beta] bootstrap from 1.41.1 stable #69518 * bootstrap: Configure cmake when building sanitizer runtimes #69104 r? @ghost
This commit is contained in:
commit
4e1c5f0e97
10
RELEASES.md
10
RELEASES.md
@ -1,3 +1,13 @@
|
|||||||
|
Version 1.41.1 (2020-02-27)
|
||||||
|
===========================
|
||||||
|
|
||||||
|
* [Always check types of static items][69145]
|
||||||
|
* [Always check lifetime bounds of `Copy` impls][69145]
|
||||||
|
* [Fix miscompilation in callers of `Layout::repeat`][69225]
|
||||||
|
|
||||||
|
[69225]: https://github.com/rust-lang/rust/issues/69225
|
||||||
|
[69145]: https://github.com/rust-lang/rust/pull/69145
|
||||||
|
|
||||||
Version 1.41.0 (2020-01-30)
|
Version 1.41.0 (2020-01-30)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ impl Step for Llvm {
|
|||||||
cfg.define("PYTHON_EXECUTABLE", python);
|
cfg.define("PYTHON_EXECUTABLE", python);
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_cmake(builder, target, &mut cfg);
|
configure_cmake(builder, target, &mut cfg, true);
|
||||||
|
|
||||||
// FIXME: we don't actually need to build all LLVM tools and all LLVM
|
// FIXME: we don't actually need to build all LLVM tools and all LLVM
|
||||||
// libraries here, e.g., we just want a few components and a few
|
// libraries here, e.g., we just want a few components and a few
|
||||||
@ -303,7 +303,12 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
|
|||||||
panic!("\n\nbad LLVM version: {}, need >=7.0\n\n", version)
|
panic!("\n\nbad LLVM version: {}, need >=7.0\n\n", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_cmake(builder: &Builder<'_>, target: Interned<String>, cfg: &mut cmake::Config) {
|
fn configure_cmake(
|
||||||
|
builder: &Builder<'_>,
|
||||||
|
target: Interned<String>,
|
||||||
|
cfg: &mut cmake::Config,
|
||||||
|
use_compiler_launcher: bool,
|
||||||
|
) {
|
||||||
// Do not print installation messages for up-to-date files.
|
// Do not print installation messages for up-to-date files.
|
||||||
// LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
|
// LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
|
||||||
cfg.define("CMAKE_INSTALL_MESSAGE", "LAZY");
|
cfg.define("CMAKE_INSTALL_MESSAGE", "LAZY");
|
||||||
@ -374,9 +379,11 @@ fn configure_cmake(builder: &Builder<'_>, target: Interned<String>, cfg: &mut cm
|
|||||||
} else {
|
} else {
|
||||||
// If ccache is configured we inform the build a little differently how
|
// If ccache is configured we inform the build a little differently how
|
||||||
// to invoke ccache while also invoking our compilers.
|
// to invoke ccache while also invoking our compilers.
|
||||||
if let Some(ref ccache) = builder.config.ccache {
|
if use_compiler_launcher {
|
||||||
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
|
if let Some(ref ccache) = builder.config.ccache {
|
||||||
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
|
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
|
||||||
|
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc))
|
cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc))
|
||||||
.define("CMAKE_CXX_COMPILER", sanitize_cc(cxx));
|
.define("CMAKE_CXX_COMPILER", sanitize_cc(cxx));
|
||||||
@ -460,7 +467,7 @@ impl Step for Lld {
|
|||||||
t!(fs::create_dir_all(&out_dir));
|
t!(fs::create_dir_all(&out_dir));
|
||||||
|
|
||||||
let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld"));
|
let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld"));
|
||||||
configure_cmake(builder, target, &mut cfg);
|
configure_cmake(builder, target, &mut cfg, true);
|
||||||
|
|
||||||
// This is an awful, awful hack. Discovered when we migrated to using
|
// This is an awful, awful hack. Discovered when we migrated to using
|
||||||
// clang-cl to compile LLVM/LLD it turns out that LLD, when built out of
|
// clang-cl to compile LLVM/LLD it turns out that LLD, when built out of
|
||||||
@ -597,10 +604,7 @@ impl Step for Sanitizers {
|
|||||||
let _time = util::timeit(&builder);
|
let _time = util::timeit(&builder);
|
||||||
|
|
||||||
let mut cfg = cmake::Config::new(&compiler_rt_dir);
|
let mut cfg = cmake::Config::new(&compiler_rt_dir);
|
||||||
cfg.target(&self.target);
|
|
||||||
cfg.host(&builder.config.build);
|
|
||||||
cfg.profile("Release");
|
cfg.profile("Release");
|
||||||
|
|
||||||
cfg.define("CMAKE_C_COMPILER_TARGET", self.target);
|
cfg.define("CMAKE_C_COMPILER_TARGET", self.target);
|
||||||
cfg.define("COMPILER_RT_BUILD_BUILTINS", "OFF");
|
cfg.define("COMPILER_RT_BUILD_BUILTINS", "OFF");
|
||||||
cfg.define("COMPILER_RT_BUILD_CRT", "OFF");
|
cfg.define("COMPILER_RT_BUILD_CRT", "OFF");
|
||||||
@ -612,6 +616,12 @@ impl Step for Sanitizers {
|
|||||||
cfg.define("COMPILER_RT_USE_LIBCXX", "OFF");
|
cfg.define("COMPILER_RT_USE_LIBCXX", "OFF");
|
||||||
cfg.define("LLVM_CONFIG_PATH", &llvm_config);
|
cfg.define("LLVM_CONFIG_PATH", &llvm_config);
|
||||||
|
|
||||||
|
// On Darwin targets the sanitizer runtimes are build as universal binaries.
|
||||||
|
// Unfortunately sccache currently lacks support to build them successfully.
|
||||||
|
// Disable compiler launcher on Darwin targets to avoid potential issues.
|
||||||
|
let use_compiler_launcher = !self.target.contains("apple-darwin");
|
||||||
|
configure_cmake(builder, self.target, &mut cfg, use_compiler_launcher);
|
||||||
|
|
||||||
t!(fs::create_dir_all(&out_dir));
|
t!(fs::create_dir_all(&out_dir));
|
||||||
cfg.out_dir(out_dir);
|
cfg.out_dir(out_dir);
|
||||||
|
|
||||||
|
@ -1050,10 +1050,10 @@ impl Step for Compiletest {
|
|||||||
cmd.arg("--docck-python").arg(builder.python());
|
cmd.arg("--docck-python").arg(builder.python());
|
||||||
|
|
||||||
if builder.config.build.ends_with("apple-darwin") {
|
if builder.config.build.ends_with("apple-darwin") {
|
||||||
// Force /usr/bin/python on macOS for LLDB tests because we're loading the
|
// Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
|
||||||
// LLDB plugin's compiled module which only works with the system python
|
// LLDB plugin's compiled module which only works with the system python
|
||||||
// (namely not Homebrew-installed python)
|
// (namely not Homebrew-installed python)
|
||||||
cmd.arg("--lldb-python").arg("/usr/bin/python");
|
cmd.arg("--lldb-python").arg("/usr/bin/python3");
|
||||||
} else {
|
} else {
|
||||||
cmd.arg("--lldb-python").arg(builder.python());
|
cmd.arg("--lldb-python").arg(builder.python());
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ jobs:
|
|||||||
- job: macOS
|
- job: macOS
|
||||||
timeoutInMinutes: 600
|
timeoutInMinutes: 600
|
||||||
pool:
|
pool:
|
||||||
vmImage: macos-10.13
|
vmImage: macos-10.15
|
||||||
steps:
|
steps:
|
||||||
- template: steps/run.yml
|
- template: steps/run.yml
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -51,10 +51,6 @@ steps:
|
|||||||
displayName: Install clang
|
displayName: Install clang
|
||||||
condition: and(succeeded(), not(variables.SKIP_JOB))
|
condition: and(succeeded(), not(variables.SKIP_JOB))
|
||||||
|
|
||||||
- bash: src/ci/scripts/switch-xcode.sh
|
|
||||||
displayName: Switch to Xcode 9.3
|
|
||||||
condition: and(succeeded(), not(variables.SKIP_JOB))
|
|
||||||
|
|
||||||
- bash: src/ci/scripts/install-wix.sh
|
- bash: src/ci/scripts/install-wix.sh
|
||||||
displayName: Install wix
|
displayName: Install wix
|
||||||
condition: and(succeeded(), not(variables.SKIP_JOB))
|
condition: and(succeeded(), not(variables.SKIP_JOB))
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
|||||||
# - job: macOS
|
# - job: macOS
|
||||||
# timeoutInMinutes: 600
|
# timeoutInMinutes: 600
|
||||||
# pool:
|
# pool:
|
||||||
# vmImage: macos-10.13
|
# vmImage: macos-10.15
|
||||||
# steps:
|
# steps:
|
||||||
# - template: steps/run.yml
|
# - template: steps/run.yml
|
||||||
# strategy:
|
# strategy:
|
||||||
|
@ -19,9 +19,7 @@ if isMacOS; then
|
|||||||
# native clang is configured to use the correct path, but our custom one
|
# native clang is configured to use the correct path, but our custom one
|
||||||
# doesn't. This sets the SDKROOT environment variable to the SDK so that
|
# doesn't. This sets the SDKROOT environment variable to the SDK so that
|
||||||
# our own clang can figure out the correct include path on its own.
|
# our own clang can figure out the correct include path on its own.
|
||||||
if ! [[ -d "/usr/include" ]]; then
|
ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
|
||||||
ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure `AR` specifically so rustbuild doesn't try to infer it as
|
# Configure `AR` specifically so rustbuild doesn't try to infer it as
|
||||||
# `clang-ar` by accident.
|
# `clang-ar` by accident.
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Switch to XCode 9.3 on OSX since it seems to be the last version that supports
|
|
||||||
# i686-apple-darwin. We'll eventually want to upgrade this and it will probably
|
|
||||||
# force us to drop i686-apple-darwin, but let's keep the wheels turning for now.
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
|
|
||||||
|
|
||||||
if isMacOS; then
|
|
||||||
sudo xcode-select --switch /Applications/Xcode_9.3.app
|
|
||||||
fi
|
|
@ -162,6 +162,10 @@ pub struct LitToConstInput<'tcx> {
|
|||||||
/// Error type for `tcx.lit_to_const`.
|
/// Error type for `tcx.lit_to_const`.
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, HashStable)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, HashStable)]
|
||||||
pub enum LitToConstError {
|
pub enum LitToConstError {
|
||||||
|
/// The literal's inferred type did not match the expected `ty` in the input.
|
||||||
|
/// This is used for graceful error handling (`delay_span_bug`) in
|
||||||
|
/// type checking (`AstConv::ast_const_to_const`).
|
||||||
|
TypeError,
|
||||||
UnparseableFloat,
|
UnparseableFloat,
|
||||||
Reported,
|
Reported,
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use rustc::mir::interpret::{
|
use rustc::mir::interpret::{
|
||||||
truncate, Allocation, ConstValue, LitToConstError, LitToConstInput, Scalar,
|
truncate, Allocation, ConstValue, LitToConstError, LitToConstInput, Scalar,
|
||||||
};
|
};
|
||||||
use rustc::ty::{self, layout::Size, ParamEnv, TyCtxt};
|
use rustc::ty::{self, layout::Size, ParamEnv, TyCtxt, TyS};
|
||||||
use rustc_span::symbol::Symbol;
|
use rustc_span::symbol::Symbol;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
||||||
@ -20,50 +20,35 @@ crate fn lit_to_const<'tcx>(
|
|||||||
Ok(ConstValue::Scalar(Scalar::from_uint(result, width)))
|
Ok(ConstValue::Scalar(Scalar::from_uint(result, width)))
|
||||||
};
|
};
|
||||||
|
|
||||||
let lit = match *lit {
|
let lit = match (lit, &ty.kind) {
|
||||||
ast::LitKind::Str(ref s, _) => {
|
(ast::LitKind::Str(s, _), ty::Ref(_, TyS { kind: ty::Str, .. }, _)) => {
|
||||||
let s = s.as_str();
|
let s = s.as_str();
|
||||||
let allocation = Allocation::from_byte_aligned_bytes(s.as_bytes());
|
let allocation = Allocation::from_byte_aligned_bytes(s.as_bytes());
|
||||||
let allocation = tcx.intern_const_alloc(allocation);
|
let allocation = tcx.intern_const_alloc(allocation);
|
||||||
ConstValue::Slice { data: allocation, start: 0, end: s.len() }
|
ConstValue::Slice { data: allocation, start: 0, end: s.len() }
|
||||||
}
|
}
|
||||||
ast::LitKind::ByteStr(ref data) => {
|
(ast::LitKind::ByteStr(data), ty::Ref(_, TyS { kind: ty::Slice(_), .. }, _)) => {
|
||||||
if let ty::Ref(_, ref_ty, _) = ty.kind {
|
let allocation = Allocation::from_byte_aligned_bytes(data as &Vec<u8>);
|
||||||
match ref_ty.kind {
|
let allocation = tcx.intern_const_alloc(allocation);
|
||||||
ty::Slice(_) => {
|
ConstValue::Slice { data: allocation, start: 0, end: data.len() }
|
||||||
let allocation = Allocation::from_byte_aligned_bytes(data as &Vec<u8>);
|
|
||||||
let allocation = tcx.intern_const_alloc(allocation);
|
|
||||||
ConstValue::Slice { data: allocation, start: 0, end: data.len() }
|
|
||||||
}
|
|
||||||
ty::Array(_, _) => {
|
|
||||||
let id = tcx.allocate_bytes(data);
|
|
||||||
ConstValue::Scalar(Scalar::Ptr(id.into()))
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
bug!("bytestring should have type of either &[u8] or &[u8; _], not {}", ty)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bug!("bytestring should have type of either &[u8] or &[u8; _], not {}", ty)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ast::LitKind::Byte(n) => ConstValue::Scalar(Scalar::from_uint(n, Size::from_bytes(1))),
|
(ast::LitKind::ByteStr(data), ty::Ref(_, TyS { kind: ty::Array(_, _), .. }, _)) => {
|
||||||
ast::LitKind::Int(n, _) if neg => {
|
let id = tcx.allocate_bytes(data);
|
||||||
let n = n as i128;
|
ConstValue::Scalar(Scalar::Ptr(id.into()))
|
||||||
let n = n.overflowing_neg().0;
|
|
||||||
trunc(n as u128)?
|
|
||||||
}
|
}
|
||||||
ast::LitKind::Int(n, _) => trunc(n)?,
|
(ast::LitKind::Byte(n), ty::Uint(ast::UintTy::U8)) => {
|
||||||
ast::LitKind::Float(n, _) => {
|
ConstValue::Scalar(Scalar::from_uint(*n, Size::from_bytes(1)))
|
||||||
let fty = match ty.kind {
|
|
||||||
ty::Float(fty) => fty,
|
|
||||||
_ => bug!(),
|
|
||||||
};
|
|
||||||
parse_float(n, fty, neg).map_err(|_| LitToConstError::UnparseableFloat)?
|
|
||||||
}
|
}
|
||||||
ast::LitKind::Bool(b) => ConstValue::Scalar(Scalar::from_bool(b)),
|
(ast::LitKind::Int(n, _), ty::Uint(_)) | (ast::LitKind::Int(n, _), ty::Int(_)) => {
|
||||||
ast::LitKind::Char(c) => ConstValue::Scalar(Scalar::from_char(c)),
|
trunc(if neg { (*n as i128).overflowing_neg().0 as u128 } else { *n })?
|
||||||
ast::LitKind::Err(_) => return Err(LitToConstError::Reported),
|
}
|
||||||
|
(ast::LitKind::Float(n, _), ty::Float(fty)) => {
|
||||||
|
parse_float(*n, *fty, neg).map_err(|_| LitToConstError::UnparseableFloat)?
|
||||||
|
}
|
||||||
|
(ast::LitKind::Bool(b), ty::Bool) => ConstValue::Scalar(Scalar::from_bool(*b)),
|
||||||
|
(ast::LitKind::Char(c), ty::Char) => ConstValue::Scalar(Scalar::from_char(*c)),
|
||||||
|
(ast::LitKind::Err(_), _) => return Err(LitToConstError::Reported),
|
||||||
|
_ => return Err(LitToConstError::TypeError),
|
||||||
};
|
};
|
||||||
Ok(tcx.mk_const(ty::Const { val: ty::ConstKind::Value(lit), ty }))
|
Ok(tcx.mk_const(ty::Const { val: ty::ConstKind::Value(lit), ty }))
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,7 @@ impl<'a, 'tcx> Cx<'a, 'tcx> {
|
|||||||
// create a dummy value and continue compiling
|
// create a dummy value and continue compiling
|
||||||
Const::from_bits(self.tcx, 0, self.param_env.and(ty))
|
Const::from_bits(self.tcx, 0, self.param_env.and(ty))
|
||||||
}
|
}
|
||||||
|
Err(LitToConstError::TypeError) => bug!("const_eval_literal: had type error"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -843,6 +843,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
|||||||
PatKind::Wild
|
PatKind::Wild
|
||||||
}
|
}
|
||||||
Err(LitToConstError::Reported) => PatKind::Wild,
|
Err(LitToConstError::Reported) => PatKind::Wild,
|
||||||
|
Err(LitToConstError::TypeError) => bug!("lower_lit: had type error"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2738,6 +2738,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||||||
// mir.
|
// mir.
|
||||||
if let Ok(c) = tcx.at(expr.span).lit_to_const(lit_input) {
|
if let Ok(c) = tcx.at(expr.span).lit_to_const(lit_input) {
|
||||||
return c;
|
return c;
|
||||||
|
} else {
|
||||||
|
tcx.sess.delay_span_bug(expr.span, "ast_const_to_const: couldn't lit_to_const");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit d7cdb4359223be265da34ebeaa00b92b7c5419fd
|
Subproject commit 73cf98d8656736781e3ea667011d2aefc21f521e
|
@ -12,8 +12,8 @@
|
|||||||
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
|
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
|
||||||
# `0.x.0` for Cargo where they were released on `date`.
|
# `0.x.0` for Cargo where they were released on `date`.
|
||||||
|
|
||||||
date: 2020-01-30
|
date: 2020-02-27
|
||||||
rustc: 1.41.0
|
rustc: 1.41.1
|
||||||
cargo: 0.42.0
|
cargo: 0.42.0
|
||||||
|
|
||||||
# We use a nightly rustfmt to format the source because it solves some bootstrapping
|
# We use a nightly rustfmt to format the source because it solves some bootstrapping
|
||||||
|
11
src/test/ui/consts/issue-69310-array-size-lit-wrong-ty.rs
Normal file
11
src/test/ui/consts/issue-69310-array-size-lit-wrong-ty.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// This is a regression test for #69310, which was injected by #68118.
|
||||||
|
// The issue here was that as a performance optimization,
|
||||||
|
// we call the query `lit_to_const(input);`.
|
||||||
|
// However, the literal `input.lit` would not be of the type expected by `input.ty`.
|
||||||
|
// As a result, we immediately called `bug!(...)` instead of bubbling up the problem
|
||||||
|
// so that it could be handled by the caller of `lit_to_const` (`ast_const_to_const`).
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
|
|
||||||
|
const A: [(); 0.1] = [()]; //~ ERROR mismatched types
|
||||||
|
const B: [(); b"a"] = [()]; //~ ERROR mismatched types
|
@ -0,0 +1,15 @@
|
|||||||
|
error[E0308]: mismatched types
|
||||||
|
--> $DIR/issue-69310-array-size-lit-wrong-ty.rs:10:15
|
||||||
|
|
|
||||||
|
LL | const A: [(); 0.1] = [()];
|
||||||
|
| ^^^ expected `usize`, found floating-point number
|
||||||
|
|
||||||
|
error[E0308]: mismatched types
|
||||||
|
--> $DIR/issue-69310-array-size-lit-wrong-ty.rs:11:15
|
||||||
|
|
|
||||||
|
LL | const B: [(); b"a"] = [()];
|
||||||
|
| ^^^^ expected `usize`, found `&[u8; 1]`
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0308`.
|
33
src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs
Normal file
33
src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// run-fail
|
||||||
|
// compile-flags: -C opt-level=3
|
||||||
|
// error-pattern: index out of bounds: the len is 0 but the index is 16777216
|
||||||
|
// ignore-wasm no panic or subprocess support
|
||||||
|
// ignore-emscripten no panic or subprocess support
|
||||||
|
|
||||||
|
fn do_test(x: usize) {
|
||||||
|
let mut arr = vec![vec![0u8; 3]];
|
||||||
|
|
||||||
|
let mut z = vec![0];
|
||||||
|
for arr_ref in arr.iter_mut() {
|
||||||
|
for y in 0..x {
|
||||||
|
for _ in 0..1 {
|
||||||
|
z.reserve_exact(x);
|
||||||
|
let iterator = std::iter::repeat(0).take(x);
|
||||||
|
let mut cnt = 0;
|
||||||
|
iterator.for_each(|_| {
|
||||||
|
z[0] = 0;
|
||||||
|
cnt += 1;
|
||||||
|
});
|
||||||
|
let a = y * x;
|
||||||
|
let b = (y + 1) * x - 1;
|
||||||
|
let slice = &mut arr_ref[a..b];
|
||||||
|
slice[1 << 24] += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
do_test(1);
|
||||||
|
do_test(2);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user