diff options
| author | Ralf Jung <post@ralfj.de> | 2023-07-23 09:27:28 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-07-23 09:27:28 +0200 |
| commit | 8a3b7463ed657ddc3d705c44028f1fe7915edb60 (patch) | |
| tree | d5cc4f8f0bbfae65d776880374519df12393f27e /src | |
| parent | 46ddf460afb6b277700f1bac9a3e26b34dc2ed62 (diff) | |
| parent | cec34a43b1b14f4e39363f3b283d7ac4f593ee81 (diff) | |
| download | rust-8a3b7463ed657ddc3d705c44028f1fe7915edb60.tar.gz rust-8a3b7463ed657ddc3d705c44028f1fe7915edb60.zip | |
Merge from rustc
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/builder.rs | 7 | ||||
| -rw-r--r-- | src/tools/miri/src/intptrcast.rs | 2 | ||||
| -rw-r--r-- | src/tools/miri/src/shims/mod.rs | 4 | ||||
| -rw-r--r-- | src/tools/miri/src/shims/unix/fs.rs | 6 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/layout_cycle.rs | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/layout_cycle.stderr | 7 | ||||
| -rw-r--r-- | src/tools/tidy/src/deps.rs | 1 |
7 files changed, 17 insertions, 12 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 32eb4e68b08..1707dafb11a 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -2043,6 +2043,13 @@ impl<'a> Builder<'a> { rustflags.arg("-Zinline-mir"); } + // set rustc args passed from command line + let rustc_args = + self.config.cmd.rustc_args().iter().map(|s| s.to_string()).collect::<Vec<_>>(); + if !rustc_args.is_empty() { + cargo.env("RUSTFLAGS", &rustc_args.join(" ")); + } + Cargo { command: cargo, rustflags, rustdocflags, allow_features } } diff --git a/src/tools/miri/src/intptrcast.rs b/src/tools/miri/src/intptrcast.rs index a43ac61da74..4fd0af35304 100644 --- a/src/tools/miri/src/intptrcast.rs +++ b/src/tools/miri/src/intptrcast.rs @@ -207,7 +207,7 @@ impl<'mir, 'tcx> GlobalStateInner { .checked_add(max(size.bytes(), 1)) .ok_or_else(|| err_exhaust!(AddressSpaceFull))?; // Even if `Size` didn't overflow, we might still have filled up the address space. - if global_state.next_base_addr > ecx.data_layout().target_usize_max() { + if global_state.next_base_addr > ecx.target_usize_max() { throw_exhaust!(AddressSpaceFull); } // Given that `next_base_addr` increases in each allocation, pushing the diff --git a/src/tools/miri/src/shims/mod.rs b/src/tools/miri/src/shims/mod.rs index 63e55e7369a..1027b24e301 100644 --- a/src/tools/miri/src/shims/mod.rs +++ b/src/tools/miri/src/shims/mod.rs @@ -20,7 +20,6 @@ pub mod tls; use log::trace; use rustc_middle::{mir, ty}; -use rustc_target::abi::HasDataLayout as _; use rustc_target::spec::abi::Abi; use crate::*; @@ -109,8 +108,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { } // Return error result (usize::MAX), and jump to caller. - let usize_max = this.data_layout().target_usize_max(); - this.write_scalar(Scalar::from_target_usize(usize_max, this), dest)?; + this.write_scalar(Scalar::from_target_usize(this.target_usize_max(), this), dest)?; this.go_to_block(ret); Ok(true) } diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs index b973a9e4766..0fdd55b407c 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -12,7 +12,7 @@ use log::trace; use rustc_data_structures::fx::FxHashMap; use rustc_middle::ty::TyCtxt; -use rustc_target::abi::{Align, HasDataLayout as _, Size}; +use rustc_target::abi::{Align, Size}; use crate::shims::os_str::bytes_to_os_str; use crate::*; @@ -753,7 +753,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { // We cap the number of read bytes to the largest value that we are able to fit in both the // host's and target's `isize`. This saves us from having to handle overflows later. let count = count - .min(u64::try_from(this.data_layout().target_isize_max()).unwrap()) + .min(u64::try_from(this.target_isize_max()).unwrap()) .min(u64::try_from(isize::MAX).unwrap()); let communicate = this.machine.communicate(); @@ -807,7 +807,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { // We cap the number of written bytes to the largest value that we are able to fit in both the // host's and target's `isize`. This saves us from having to handle overflows later. let count = count - .min(u64::try_from(this.data_layout().target_isize_max()).unwrap()) + .min(u64::try_from(this.target_isize_max()).unwrap()) .min(u64::try_from(isize::MAX).unwrap()); let communicate = this.machine.communicate(); diff --git a/src/tools/miri/tests/fail/layout_cycle.rs b/src/tools/miri/tests/fail/layout_cycle.rs index d6a937de15c..3e0dd881db8 100644 --- a/src/tools/miri/tests/fail/layout_cycle.rs +++ b/src/tools/miri/tests/fail/layout_cycle.rs @@ -1,5 +1,5 @@ //@error-in-other-file: a cycle occurred during layout computation -//~^ ERROR: cycle detected when computing layout (naive) of +//~^ ERROR: cycle detected when computing layout of use std::mem; diff --git a/src/tools/miri/tests/fail/layout_cycle.stderr b/src/tools/miri/tests/fail/layout_cycle.stderr index ccf93a9def4..38907a1c50c 100644 --- a/src/tools/miri/tests/fail/layout_cycle.stderr +++ b/src/tools/miri/tests/fail/layout_cycle.stderr @@ -1,8 +1,7 @@ -error[E0391]: cycle detected when computing layout (naive) of `S<S<()>>` +error[E0391]: cycle detected when computing layout of `S<S<()>>` | - = note: ...which requires computing layout (naive) of `<S<()> as Tr>::I`... - = note: ...which again requires computing layout (naive) of `S<S<()>>`, completing the cycle - = note: cycle used when computing layout of `S<S<()>>` + = note: ...which requires computing layout of `<S<()> as Tr>::I`... + = note: ...which again requires computing layout of `S<S<()>>`, completing the cycle = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error: post-monomorphization error: a cycle occurred during layout computation diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 2be369d2b74..bfb967213e1 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -334,6 +334,7 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[ "cranelift-native", "cranelift-object", "crc32fast", + "equivalent", "fallible-iterator", "gimli", "hashbrown", |
