mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Auto merge of #90934 - JohnTitor:rollup-5soqo0j, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #85766 (Stabilize File::options()) - #88601 (Implement `Termination` for `Result<Infallible, E>`) - #90058 (Stabilize -Z strip as -C strip) - #90790 (Fix standard library test with read_link) - #90834 (Android is not GNU) - #90835 (Rename WASI's `is_character_device` to `is_char_device`.) - #90837 (Move some tests to more reasonable directories - 9) - #90848 (Remove bigint_helper_methods for *signed* types) - #90892 (fix ICE on Miri/CTFE copy of half a pointer) - #90909 (disable portable SIMD tests in Miri) Failed merges: - #90128 (Stabilize -Z symbol-mangling-version=v0 as -C symbol-mangling-version=v0) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
02063124f9
@ -1034,8 +1034,10 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
|
||||
SplitDebuginfo::Packed => link_dwarf_object(sess, &out_filename),
|
||||
}
|
||||
|
||||
let strip = strip_value(sess);
|
||||
|
||||
if sess.target.is_like_osx {
|
||||
match sess.opts.debugging_opts.strip {
|
||||
match strip {
|
||||
Strip::Debuginfo => strip_symbols_in_osx(sess, &out_filename, Some("-S")),
|
||||
Strip::Symbols => strip_symbols_in_osx(sess, &out_filename, None),
|
||||
Strip::None => {}
|
||||
@ -1043,6 +1045,14 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
|
||||
}
|
||||
}
|
||||
|
||||
// Temporarily support both -Z strip and -C strip
|
||||
fn strip_value(sess: &Session) -> Strip {
|
||||
match (sess.opts.debugging_opts.strip, sess.opts.cg.strip) {
|
||||
(s, Strip::None) => s,
|
||||
(_, s) => s,
|
||||
}
|
||||
}
|
||||
|
||||
fn strip_symbols_in_osx<'a>(sess: &'a Session, out_filename: &Path, option: Option<&str>) {
|
||||
let mut cmd = Command::new("strip");
|
||||
if let Some(option) = option {
|
||||
@ -2014,7 +2024,7 @@ fn add_order_independent_options(
|
||||
cmd.optimize();
|
||||
|
||||
// Pass debuginfo and strip flags down to the linker.
|
||||
cmd.debuginfo(sess.opts.debugging_opts.strip);
|
||||
cmd.debuginfo(strip_value(sess));
|
||||
|
||||
// We want to prevent the compiler from accidentally leaking in any system libraries,
|
||||
// so by default we tell linkers not to link to any default libraries.
|
||||
|
@ -1057,20 +1057,19 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
|
||||
Some(dest_ptr) => dest_ptr,
|
||||
};
|
||||
|
||||
// first copy the relocations to a temporary buffer, because
|
||||
// `get_bytes_mut` will clear the relocations, which is correct,
|
||||
// since we don't want to keep any relocations at the target.
|
||||
// (`get_bytes_with_uninit_and_ptr` below checks that there are no
|
||||
// relocations overlapping the edges; those would not be handled correctly).
|
||||
let relocations =
|
||||
src_alloc.prepare_relocation_copy(self, src_range, dest_offset, num_copies);
|
||||
// Prepare a copy of the initialization mask.
|
||||
let compressed = src_alloc.compress_uninit_range(src_range);
|
||||
// This checks relocation edges on the src.
|
||||
// This checks relocation edges on the src, which needs to happen before
|
||||
// `prepare_relocation_copy`.
|
||||
let src_bytes = src_alloc
|
||||
.get_bytes_with_uninit_and_ptr(&tcx, src_range)
|
||||
.map_err(|e| e.to_interp_error(src_alloc_id))?
|
||||
.as_ptr(); // raw ptr, so we can also get a ptr to the destination allocation
|
||||
// first copy the relocations to a temporary buffer, because
|
||||
// `get_bytes_mut` will clear the relocations, which is correct,
|
||||
// since we don't want to keep any relocations at the target.
|
||||
let relocations =
|
||||
src_alloc.prepare_relocation_copy(self, src_range, dest_offset, num_copies);
|
||||
// Prepare a copy of the initialization mask.
|
||||
let compressed = src_alloc.compress_uninit_range(src_range);
|
||||
|
||||
// Destination alloc preparations and access hooks.
|
||||
let (dest_alloc, extra) = self.get_raw_mut(dest_alloc_id)?;
|
||||
|
@ -551,6 +551,7 @@ fn test_codegen_options_tracking_hash() {
|
||||
untracked!(remark, Passes::Some(vec![String::from("pass1"), String::from("pass2")]));
|
||||
untracked!(rpath, true);
|
||||
untracked!(save_temps, true);
|
||||
untracked!(strip, Strip::Debuginfo);
|
||||
|
||||
macro_rules! tracked {
|
||||
($name: ident, $non_default_value: expr) => {
|
||||
@ -684,7 +685,6 @@ fn test_debugging_options_tracking_hash() {
|
||||
untracked!(self_profile_events, Some(vec![String::new()]));
|
||||
untracked!(span_debug, true);
|
||||
untracked!(span_free_formats, true);
|
||||
untracked!(strip, Strip::Debuginfo);
|
||||
untracked!(temps_dir, Some(String::from("abc")));
|
||||
untracked!(terminal_width, Some(80));
|
||||
untracked!(threads, 99);
|
||||
|
@ -37,7 +37,7 @@ use std::iter::{self, FromIterator};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::{self, FromStr};
|
||||
|
||||
/// The different settings that the `-Z strip` flag can have.
|
||||
/// The different settings that the `-C strip` flag can have.
|
||||
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
|
||||
pub enum Strip {
|
||||
/// Do not strip at all.
|
||||
|
@ -219,7 +219,7 @@ top_level_options!(
|
||||
/// generated code to parse an option into its respective field in the struct. There are a few
|
||||
/// hand-written parsers for parsing specific types of values in this module.
|
||||
macro_rules! options {
|
||||
($struct_name:ident, $stat:ident, $prefix:expr, $outputname:expr,
|
||||
($struct_name:ident, $stat:ident, $optmod:ident, $prefix:expr, $outputname:expr,
|
||||
$($( #[$attr:meta] )* $opt:ident : $t:ty = (
|
||||
$init:expr,
|
||||
$parse:ident,
|
||||
@ -264,13 +264,15 @@ macro_rules! options {
|
||||
}
|
||||
|
||||
pub const $stat: OptionDescrs<$struct_name> =
|
||||
&[ $( (stringify!($opt), $opt, desc::$parse, $desc) ),* ];
|
||||
&[ $( (stringify!($opt), $optmod::$opt, desc::$parse, $desc) ),* ];
|
||||
|
||||
mod $optmod {
|
||||
$(
|
||||
fn $opt(cg: &mut $struct_name, v: Option<&str>) -> bool {
|
||||
parse::$parse(&mut redirect_field!(cg.$opt), v)
|
||||
pub(super) fn $opt(cg: &mut super::$struct_name, v: Option<&str>) -> bool {
|
||||
super::parse::$parse(&mut redirect_field!(cg.$opt), v)
|
||||
}
|
||||
)*
|
||||
}
|
||||
|
||||
) }
|
||||
|
||||
@ -918,7 +920,7 @@ mod parse {
|
||||
}
|
||||
|
||||
options! {
|
||||
CodegenOptions, CG_OPTIONS, "C", "codegen",
|
||||
CodegenOptions, CG_OPTIONS, cgopts, "C", "codegen",
|
||||
|
||||
// This list is in alphabetical order.
|
||||
//
|
||||
@ -1013,6 +1015,8 @@ options! {
|
||||
"use soft float ABI (*eabihf targets only) (default: no)"),
|
||||
split_debuginfo: Option<SplitDebuginfo> = (None, parse_split_debuginfo, [TRACKED],
|
||||
"how to handle split-debuginfo, a platform-specific option"),
|
||||
strip: Strip = (Strip::None, parse_strip, [UNTRACKED],
|
||||
"tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"),
|
||||
target_cpu: Option<String> = (None, parse_opt_string, [TRACKED],
|
||||
"select target processor (`rustc --print target-cpus` for details)"),
|
||||
target_feature: String = (String::new(), parse_target_feature, [TRACKED],
|
||||
@ -1027,7 +1031,7 @@ options! {
|
||||
}
|
||||
|
||||
options! {
|
||||
DebuggingOptions, DB_OPTIONS, "Z", "debugging",
|
||||
DebuggingOptions, DB_OPTIONS, dbopts, "Z", "debugging",
|
||||
|
||||
// This list is in alphabetical order.
|
||||
//
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::spec::{LinkerFlavor, TargetOptions};
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
let mut base = super::linux_base::opts();
|
||||
base.os = "android".to_string();
|
||||
// Many of the symbols defined in compiler-rt are also defined in libgcc.
|
||||
// Android's linker doesn't like that by default.
|
||||
|
@ -402,11 +402,13 @@ pub mod arch {
|
||||
#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)]
|
||||
#[allow(rustdoc::bare_urls)]
|
||||
#[unstable(feature = "portable_simd", issue = "86656")]
|
||||
#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics
|
||||
#[cfg(not(bootstrap))]
|
||||
mod core_simd;
|
||||
|
||||
#[doc = include_str!("../../portable-simd/crates/core_simd/src/core_simd_docs.md")]
|
||||
#[unstable(feature = "portable_simd", issue = "86656")]
|
||||
#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics
|
||||
#[cfg(not(bootstrap))]
|
||||
pub mod simd {
|
||||
#[unstable(feature = "portable_simd", issue = "86656")]
|
||||
|
@ -1511,33 +1511,6 @@ macro_rules! int_impl {
|
||||
(a as Self, b)
|
||||
}
|
||||
|
||||
/// Calculates `self + rhs + carry` without the ability to overflow.
|
||||
///
|
||||
/// Performs "ternary addition" which takes in an extra bit to add, and may return an
|
||||
/// additional bit of overflow. This allows for chaining together multiple additions
|
||||
/// to create "big integers" which represent larger values.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(bigint_helper_methods)]
|
||||
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".carrying_add(2, false), (7, false));")]
|
||||
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".carrying_add(2, true), (8, false));")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.carrying_add(1, false), (", stringify!($SelfT), "::MIN, false));")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.carrying_add(1, true), (", stringify!($SelfT), "::MIN + 1, false));")]
|
||||
/// ```
|
||||
#[unstable(feature = "bigint_helper_methods", issue = "85532")]
|
||||
#[rustc_const_unstable(feature = "const_bigint_helper_methods", issue = "85532")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool) {
|
||||
let (sum, carry) = (self as $UnsignedT).carrying_add(rhs as $UnsignedT, carry);
|
||||
(sum as $SelfT, carry)
|
||||
}
|
||||
|
||||
/// Calculates `self` + `rhs` with an unsigned `rhs`
|
||||
///
|
||||
/// Returns a tuple of the addition along with a boolean indicating
|
||||
@ -1589,33 +1562,6 @@ macro_rules! int_impl {
|
||||
(a as Self, b)
|
||||
}
|
||||
|
||||
/// Calculates `self - rhs - borrow` without the ability to overflow.
|
||||
///
|
||||
/// Performs "ternary subtraction" which takes in an extra bit to subtract, and may return
|
||||
/// an additional bit of overflow. This allows for chaining together multiple subtractions
|
||||
/// to create "big integers" which represent larger values.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(bigint_helper_methods)]
|
||||
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".borrowing_sub(2, false), (3, false));")]
|
||||
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".borrowing_sub(2, true), (2, false));")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.borrowing_sub(1, false), (", stringify!($SelfT), "::MAX, false));")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.borrowing_sub(1, true), (", stringify!($SelfT), "::MAX - 1, false));")]
|
||||
/// ```
|
||||
#[unstable(feature = "bigint_helper_methods", issue = "85532")]
|
||||
#[rustc_const_unstable(feature = "const_bigint_helper_methods", issue = "85532")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool) {
|
||||
let (sum, borrow) = (self as $UnsignedT).borrowing_sub(rhs as $UnsignedT, borrow);
|
||||
(sum as $SelfT, borrow)
|
||||
}
|
||||
|
||||
/// Calculates `self` - `rhs` with an unsigned `rhs`
|
||||
///
|
||||
/// Returns a tuple of the subtraction along with a boolean indicating
|
||||
|
@ -95,12 +95,6 @@ depending on the target pointer size.
|
||||
|
||||
macro_rules! widening_impl {
|
||||
($SelfT:ty, $WideT:ty, $BITS:literal, unsigned) => {
|
||||
widening_impl!($SelfT, $WideT, $BITS, "");
|
||||
};
|
||||
($SelfT:ty, $WideT:ty, $BITS:literal, signed) => {
|
||||
widening_impl!($SelfT, $WideT, $BITS, "# //");
|
||||
};
|
||||
($SelfT:ty, $WideT:ty, $BITS:literal, $AdaptiveTestPrefix:literal) => {
|
||||
/// Calculates the complete product `self * rhs` without the possibility to overflow.
|
||||
///
|
||||
/// This returns the low-order (wrapping) bits and the high-order (overflow) bits
|
||||
@ -154,7 +148,7 @@ macro_rules! widening_impl {
|
||||
/// assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
|
||||
/// assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
|
||||
/// assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
|
||||
#[doc = concat!($AdaptiveTestPrefix, "assert_eq!(",
|
||||
#[doc = concat!("assert_eq!(",
|
||||
stringify!($SelfT), "::MAX.carrying_mul(", stringify!($SelfT), "::MAX, ", stringify!($SelfT), "::MAX), ",
|
||||
"(0, ", stringify!($SelfT), "::MAX));"
|
||||
)]
|
||||
@ -203,14 +197,12 @@ macro_rules! widening_impl {
|
||||
impl i8 {
|
||||
int_impl! { i8, i8, u8, 8, 7, -128, 127, 2, "-0x7e", "0xa", "0x12", "0x12", "0x48",
|
||||
"[0x12]", "[0x12]", "", "" }
|
||||
widening_impl! { i8, i16, 8, signed }
|
||||
}
|
||||
|
||||
#[lang = "i16"]
|
||||
impl i16 {
|
||||
int_impl! { i16, i16, u16, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412",
|
||||
"0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" }
|
||||
widening_impl! { i16, i32, 16, signed }
|
||||
}
|
||||
|
||||
#[lang = "i32"]
|
||||
@ -218,7 +210,6 @@ impl i32 {
|
||||
int_impl! { i32, i32, u32, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
|
||||
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
|
||||
"[0x12, 0x34, 0x56, 0x78]", "", "" }
|
||||
widening_impl! { i32, i64, 32, signed }
|
||||
}
|
||||
|
||||
#[lang = "i64"]
|
||||
@ -227,7 +218,6 @@ impl i64 {
|
||||
"0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
|
||||
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
||||
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", "", "" }
|
||||
widening_impl! { i64, i128, 64, signed }
|
||||
}
|
||||
|
||||
#[lang = "i128"]
|
||||
@ -248,7 +238,6 @@ impl isize {
|
||||
int_impl! { isize, i16, usize, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234",
|
||||
"0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]",
|
||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||
widening_impl! { isize, i32, 16, signed }
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
@ -258,7 +247,6 @@ impl isize {
|
||||
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
|
||||
"[0x12, 0x34, 0x56, 0x78]",
|
||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||
widening_impl! { isize, i64, 32, signed }
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
@ -269,7 +257,6 @@ impl isize {
|
||||
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
||||
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||
widening_impl! { isize, i128, 64, signed }
|
||||
}
|
||||
|
||||
/// If 6th bit set ascii is upper case.
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![cfg(not(miri))] // Miri does not support all SIMD intrinsics
|
||||
|
||||
use core::simd::f32x4;
|
||||
|
||||
#[test]
|
||||
|
@ -358,7 +358,7 @@ impl File {
|
||||
///
|
||||
/// It is equivalent to `OpenOptions::new()` but allows you to write more
|
||||
/// readable code. Instead of `OpenOptions::new().read(true).open("foo.txt")`
|
||||
/// you can write `File::with_options().read(true).open("foo.txt")`. This
|
||||
/// you can write `File::options().read(true).open("foo.txt")`. This
|
||||
/// also avoids the need to import `OpenOptions`.
|
||||
///
|
||||
/// See the [`OpenOptions::new`] function for more details.
|
||||
@ -366,17 +366,16 @@ impl File {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// #![feature(with_options)]
|
||||
/// use std::fs::File;
|
||||
///
|
||||
/// fn main() -> std::io::Result<()> {
|
||||
/// let mut f = File::with_options().read(true).open("foo.txt")?;
|
||||
/// let mut f = File::options().read(true).open("foo.txt")?;
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
#[must_use]
|
||||
#[unstable(feature = "with_options", issue = "65439")]
|
||||
pub fn with_options() -> OpenOptions {
|
||||
#[stable(feature = "with_options", since = "1.58.0")]
|
||||
pub fn options() -> OpenOptions {
|
||||
OpenOptions::new()
|
||||
}
|
||||
|
||||
|
@ -833,20 +833,11 @@ fn symlink_noexist() {
|
||||
fn read_link() {
|
||||
if cfg!(windows) {
|
||||
// directory symlink
|
||||
assert_eq!(
|
||||
check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
|
||||
r"C:\ProgramData"
|
||||
);
|
||||
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")), Path::new(r"C:\ProgramData"));
|
||||
// junction
|
||||
assert_eq!(
|
||||
check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
|
||||
r"C:\Users\Default"
|
||||
);
|
||||
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default"));
|
||||
// junction with special permissions
|
||||
assert_eq!(
|
||||
check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
|
||||
r"C:\Users"
|
||||
);
|
||||
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")), Path::new(r"C:\Users"));
|
||||
}
|
||||
let tmpdir = tmpdir();
|
||||
let link = tmpdir.join("link");
|
||||
|
@ -444,18 +444,22 @@ pub trait FileTypeExt {
|
||||
/// Returns `true` if this file type is a block device.
|
||||
fn is_block_device(&self) -> bool;
|
||||
/// Returns `true` if this file type is a character device.
|
||||
fn is_character_device(&self) -> bool;
|
||||
fn is_char_device(&self) -> bool;
|
||||
/// Returns `true` if this file type is a socket datagram.
|
||||
fn is_socket_dgram(&self) -> bool;
|
||||
/// Returns `true` if this file type is a socket stream.
|
||||
fn is_socket_stream(&self) -> bool;
|
||||
/// Returns `true` if this file type is any type of socket.
|
||||
fn is_socket(&self) -> bool {
|
||||
self.is_socket_stream() || self.is_socket_dgram()
|
||||
}
|
||||
}
|
||||
|
||||
impl FileTypeExt for fs::FileType {
|
||||
fn is_block_device(&self) -> bool {
|
||||
self.as_inner().bits() == wasi::FILETYPE_BLOCK_DEVICE
|
||||
}
|
||||
fn is_character_device(&self) -> bool {
|
||||
fn is_char_device(&self) -> bool {
|
||||
self.as_inner().bits() == wasi::FILETYPE_CHARACTER_DEVICE
|
||||
}
|
||||
fn is_socket_dgram(&self) -> bool {
|
||||
|
@ -106,6 +106,7 @@ mod tests;
|
||||
|
||||
use crate::io::prelude::*;
|
||||
|
||||
use crate::convert::Infallible;
|
||||
use crate::ffi::OsStr;
|
||||
use crate::fmt;
|
||||
use crate::fs;
|
||||
@ -2065,6 +2066,14 @@ impl<E: fmt::Debug> Termination for Result<!, E> {
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "termination_trait_lib", issue = "43301")]
|
||||
impl<E: fmt::Debug> Termination for Result<Infallible, E> {
|
||||
fn report(self) -> i32 {
|
||||
let Err(err) = self;
|
||||
Err::<!, _>(err).report()
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "termination_trait_lib", issue = "43301")]
|
||||
impl Termination for ExitCode {
|
||||
#[inline]
|
||||
|
@ -525,6 +525,22 @@ platforms. Possible values are:
|
||||
Note that `packed` and `unpacked` are gated behind `-Z unstable-options` on
|
||||
non-macOS platforms at this time.
|
||||
|
||||
## strip
|
||||
|
||||
The option `-C strip=val` controls stripping of debuginfo and similar auxiliary
|
||||
data from binaries during linking.
|
||||
|
||||
Supported values for this option are:
|
||||
|
||||
- `none` - debuginfo and symbols (if they exist) are copied to the produced
|
||||
binary or separate files depending on the target (e.g. `.pdb` files in case
|
||||
of MSVC).
|
||||
- `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table
|
||||
section are stripped at link time and are not copied to the produced binary
|
||||
or separate files.
|
||||
- `symbols` - same as `debuginfo`, but the rest of the symbol table section is
|
||||
stripped as well if the linker supports it.
|
||||
|
||||
## target-cpu
|
||||
|
||||
This instructs `rustc` to generate code specifically for a particular processor.
|
||||
|
@ -1,17 +0,0 @@
|
||||
# `strip`
|
||||
|
||||
The tracking issue for this feature is: [#72110](https://github.com/rust-lang/rust/issues/72110).
|
||||
|
||||
------------------------
|
||||
|
||||
Option `-Z strip=val` controls stripping of debuginfo and similar auxiliary data from binaries
|
||||
during linking.
|
||||
|
||||
Supported values for this option are:
|
||||
|
||||
- `none` - debuginfo and symbols (if they exist) are copied to the produced binary or separate files
|
||||
depending on the target (e.g. `.pdb` files in case of MSVC).
|
||||
- `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table section
|
||||
are stripped at link time and are not copied to the produced binary or separate files.
|
||||
- `symbols` - same as `debuginfo`, but the rest of the symbol table section is stripped as well
|
||||
if the linker supports it.
|
@ -1,15 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
enum option<T> { some(T), none, }
|
||||
|
||||
struct R<T> {v: Vec<option<T>> }
|
||||
|
||||
fn f<T>() -> Vec<T> { return Vec::new(); }
|
||||
|
||||
pub fn main() { let mut r: R<isize> = R {v: Vec::new()}; r.v = f(); }
|
@ -1,15 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
use std::ops::AddAssign;
|
||||
|
||||
struct Int(i32);
|
||||
|
||||
impl AddAssign<i32> for Int {
|
||||
fn add_assign(&mut self, _: i32) {
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut x = Int(0);
|
||||
x += 1;
|
||||
}
|
12
src/test/ui/consts/issue-miri-1910.rs
Normal file
12
src/test/ui/consts/issue-miri-1910.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// error-pattern unable to turn pointer into raw bytes
|
||||
#![feature(const_ptr_read)]
|
||||
#![feature(const_ptr_offset)]
|
||||
|
||||
const C: () = unsafe {
|
||||
let foo = Some(&42 as *const i32);
|
||||
let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3;
|
||||
(&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
|
||||
};
|
||||
|
||||
fn main() {
|
||||
}
|
26
src/test/ui/consts/issue-miri-1910.stderr
Normal file
26
src/test/ui/consts/issue-miri-1910.stderr
Normal file
@ -0,0 +1,26 @@
|
||||
error: any use of this value will cause an error
|
||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||
|
|
||||
LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| unable to turn pointer into raw bytes
|
||||
| inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||
| inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||
| inside `C` at $DIR/issue-miri-1910.rs:8:5
|
||||
|
|
||||
::: $DIR/issue-miri-1910.rs:5:1
|
||||
|
|
||||
LL | / const C: () = unsafe {
|
||||
LL | | let foo = Some(&42 as *const i32);
|
||||
LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3;
|
||||
LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
|
||||
LL | | };
|
||||
| |__-
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,15 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
#![allow(unused_assignments)]
|
||||
#![allow(unknown_lints)]
|
||||
|
||||
#![allow(dead_assignment)]
|
||||
|
||||
pub fn main() {
|
||||
let x : String = "hello".to_string();
|
||||
let _y : String = "there".to_string();
|
||||
let mut z = "thing".to_string();
|
||||
z = x;
|
||||
assert_eq!(z.as_bytes()[0], ('h' as u8));
|
||||
assert_eq!(z.as_bytes()[4], ('o' as u8));
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
use m::unexported;
|
||||
//~^ ERROR: is private
|
||||
|
||||
mod m {
|
||||
pub fn exported() { }
|
||||
|
||||
fn unexported() { }
|
||||
}
|
||||
|
||||
|
||||
fn main() { unexported(); }
|
@ -1,15 +0,0 @@
|
||||
error[E0603]: function `unexported` is private
|
||||
--> $DIR/export-import.rs:1:8
|
||||
|
|
||||
LL | use m::unexported;
|
||||
| ^^^^^^^^^^ private function
|
||||
|
|
||||
note: the function `unexported` is defined here
|
||||
--> $DIR/export-import.rs:7:5
|
||||
|
|
||||
LL | fn unexported() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0603`.
|
@ -1,11 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
mod foo {
|
||||
pub mod bar {
|
||||
pub fn y() { super::super::foo::x(); }
|
||||
}
|
||||
|
||||
pub fn x() { println!("x"); }
|
||||
}
|
||||
|
||||
pub fn main() { self::foo::bar::y(); }
|
@ -1,11 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
pub mod foo {
|
||||
pub fn x() { ::bar::x(); }
|
||||
}
|
||||
|
||||
pub mod bar {
|
||||
pub fn x() { println!("x"); }
|
||||
}
|
||||
|
||||
pub fn main() { foo::x(); }
|
@ -1,11 +0,0 @@
|
||||
mod foo {
|
||||
pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared crate or module `bar`
|
||||
}
|
||||
|
||||
mod bar {
|
||||
fn x() { println!("x"); }
|
||||
|
||||
pub fn y() { }
|
||||
}
|
||||
|
||||
fn main() { foo::x(); }
|
@ -1,9 +0,0 @@
|
||||
error[E0433]: failed to resolve: use of undeclared crate or module `bar`
|
||||
--> $DIR/export2.rs:2:18
|
||||
|
|
||||
LL | pub fn x() { bar::x(); }
|
||||
| ^^^ use of undeclared crate or module `bar`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0433`.
|
@ -1,4 +0,0 @@
|
||||
// run-pass
|
||||
#![allow(unused_braces)]
|
||||
|
||||
pub fn main() { let x: Box<_> = { Box::new(100) }; assert_eq!(*x, 100); }
|
@ -1,5 +1,5 @@
|
||||
warning: irrefutable `while let` pattern
|
||||
--> $DIR/while-let.rs:7:19
|
||||
--> $DIR/while-let-2.rs:7:19
|
||||
|
|
||||
LL | while let $p = $e $b
|
||||
| ^^^
|
||||
@ -15,7 +15,7 @@ LL | | });
|
||||
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
warning: irrefutable `while let` pattern
|
||||
--> $DIR/while-let.rs:7:19
|
||||
--> $DIR/while-let-2.rs:7:19
|
||||
|
|
||||
LL | while let $p = $e $b
|
||||
| ^^^
|
||||
@ -30,7 +30,7 @@ LL | | });
|
||||
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
warning: irrefutable `while let` pattern
|
||||
--> $DIR/while-let.rs:27:11
|
||||
--> $DIR/while-let-2.rs:27:11
|
||||
|
|
||||
LL | while let _a = 1 {
|
||||
| ^^^^^^^^^^
|
@ -1,20 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
#![allow(dead_code)]
|
||||
// return -> return
|
||||
// mod -> module
|
||||
// match -> match
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
pub fn main() {
|
||||
}
|
||||
|
||||
mod foo {
|
||||
}
|
||||
|
||||
fn bar() -> isize {
|
||||
match 0 {
|
||||
_ => { 0 }
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user