summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2020-03-08unix: Don't override existing SIGSEGV/BUS handlersJosh Stone-8/+20
Although `stack_overflow::init` runs very early in the process, even before `main`, there may already be signal handlers installed for things like the address sanitizer. In that case, just leave it alone, and don't bother trying to allocate our own signal stacks either.
2020-03-06fix various typosMatthias Krüger-3/+3
2020-03-05Const items have by default a static lifetime, there's no need to annotate ↵Matthias Krüger-2/+2
it. (clippy::redundant_static_lifetimes)
2020-03-01use subdsec_micros() instead of subsec_nanos() / 1000Matthias Krüger-1/+1
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-3/+1
example: let s: String = format!("hello").into();
2020-02-23Auto merge of #69084 - yaahc:delayed-doc-lint, r=petrochenkovbors-8/+4
Split non macro portion of unused_doc_comment from macro part into two passes/lints ## Motivation This change is motivated by the needs of the [spandoc library](https://github.com/yaahc/spandoc). The specific use case is that my macro is removing doc comments when an attribute is applied to a fn with doc comments, but I would like the lint to still appear when I forget to add the `#[spandoc]` attribute to a fn, so I don't want to have to silence the lint globally. ## Approach This change splits the `unused _doc_comment` lint into two lints, `unused_macro_doc_comment` and `unused_doc_comment`. The non macro portion is moved into an `early_lint_pass` rather than a pre_expansion_pass. This allows proc macros to silence `unused_doc_comment` warnings by either adding an attribute to silence it or by removing the doc comment before the early_pass runs. The `unused_macro_doc_comment` lint however will still be impossible for proc-macros to silence, but the only alternative that I can see is to remove this lint entirely, which I don't think is acceptable / is a decision I'm not comfortable making personally, so instead I opted to split the macro portion of the check into a separate lint so that it can be silenced globally with an attribute if necessary without needing to globally silence the `unused_doc_comment` lint as well, which is still desireable. fixes https://github.com/rust-lang/rust/issues/67838
2020-02-22rustfmt darnitJane Lusby-6/+2
2020-02-22make doc comments regular commentsJane Lusby-2/+2
2020-02-18Rollup merge of #68767 - kubo39:patch-macos, r=shepmasterYuki Okushi-2/+3
macOS: avoid calling pthread_self() twice
2020-02-16macOS: avoid calling pthread_self() twiceHiroki Noda-2/+3
2020-02-15Rollup merge of #69106 - RReverser:wasi-fs-copy, r=KodrAusDylan DPC-1/+9
Fix std::fs::copy on WASI target Previously `std::fs::copy` on wasm32-wasi would reuse code from the `sys_common` module and would successfully copy contents of the file just to fail right before closing it. This was happening because `sys_common::copy` tries to copy permissions of the file, but permissions are not a thing in WASI (at least yet) and `set_permissions` is implemented as an unconditional runtime error. This change instead adds a custom working implementation of `std::fs::copy` (like Rust already has on some other targets) that doesn't try to call `set_permissions` and is essentially a thin wrapper around `std::io::copy`. Fixes #68560.
2020-02-13Add comment to SGX entry codeJethro Beekman-0/+1
2020-02-13Rollup merge of #69068 - Goirad:make-sgx-arg-cleanup-nop, r=jethrogb,nagisaDylan DPC-6/+1
Make the SGX arg cleanup implementation a NOP fixes #64304 cc @jethrogb
2020-02-12Fix std::fs::copy on WASI targetIngvar Stepanyan-1/+9
Previously `std::fs::copy` on wasm32-wasi would reuse code from the `sys_common` module and would successfully copy contents of the file just to fail right before closing it. This was happening because `sys_common::copy` tries to copy permissions of the file, but permissions are not a thing in WASI (at least yet) and `set_permissions` is implemented as an unconditional runtime error. This change instead adds a custom working implementation of `std::fs::copy` (like Rust already has on some other targets) that doesn't try to call `set_permissions` and is essentially a thin wrapper around `std::io::copy`. Fixes #68560.
2020-02-12Rollup merge of #69040 - jethrogb:jb/cleanup-sgx-entry, r=nagisaDylan DPC-10/+29
Cleanup SGX entry code cc @aandyl
2020-02-11make the sgx arg cleanup implementation a no opDario Gonzalez-6/+1
2020-02-10Avoid jumping to Rust code with user %rsp (reentry_panic)Jethro Beekman-7/+6
2020-02-10sanitize MXCSR/FPU control registersRaoul Strackx-0/+11
2020-02-10Corrected ac_mitigation patch. That patch used the untrusted stack to clear ↵Raoul Strackx-7/+16
rflags during enclave (re-)entry
2020-02-10Fix SGX RWLock representation for UnsafeCell niche fixJethro Beekman-11/+13
2020-02-02Strip unnecessary subexpressionFriedrich von Never-1/+0
It became unnecessary since a06baa56b95674fc626b3c3fd680d6a65357fe60 reformatted the file.
2020-01-30UpdateHiroki Noda-2/+2
2020-01-30Fix typo.Hiroki Noda-1/+1
2020-01-26updatecomet-1/+1
2020-01-25Rollup merge of #68515 - Wind-River:master_2020, r=alexcrichtonYuki Okushi-5/+39
Support feature process_set_argv0 for VxWorks r? @alexcrichton
2020-01-24Support feature process_set_argv0 for VxWorksBaoshanPang-5/+39
2020-01-24Remove unused ignore-license directivesTomasz Miąsko-4/+0
The tidy check was removed in rust-lang/rust#53617
2020-01-16Rollup merge of #68033 - ollie27:win_f32, r=dtolnayDylan DPC-5/+5
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
2020-01-12Document behavior of set_nonblocking on UnixListenerTill Arnold-0/+8
2020-01-10make use of pointer::is_nullLzu Tao-20/+25
2020-01-08Don't use f64 shims for f32 cmath functions on none 32-bit x86 MSVCOliver Middleton-5/+5
These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
2020-01-09Rollup merge of #67977 - Wind-River:master_2020, r=alexcrichtonYuki Okushi-66/+2
Updates for VxWorks r? @alexcrichton
2020-01-08Try statx for all linux-gnu targetsoxalica-28/+6
2020-01-06ignore signal SIGPIPEBaoshanPang-10/+2
2020-01-06Auto merge of #66899 - msizanoen1:riscv-std, r=alexcrichtonbors-0/+2
Standard library support for riscv64gc-unknown-linux-gnu Add std support for RISC-V 64-bit GNU/Linux and update libc for RISC-V support. r? @alexcrichton
2020-01-06Remove weak.rs for VxWorksUmesh Kalappa-56/+0
2020-01-04Rollup merge of #67848 - ollie27:float_link_name_attr, r=Dylan-DPCGuillaume Gomez-3/+0
Remove unused `#[link_name = "m"]` attributes These were perhaps supposed to be `#[link(name = "m")]` but linking libm should be handled by the libc crate anyway. They should have triggered a compile error: #47725
2020-01-03Remove unused `#[link_name = "m"]` attributesOliver Middleton-3/+0
These were perhaps supposed to be `#[link(name = "m")]` but linking libm should be handled by the libc crate anyway.
2020-01-02Use drop instead of the toilet closure `|_| ()`Lzu Tao-25/+25
2020-01-01Add support for RISC-V 64-bit GNU/Linuxmsizanoen1-0/+2
2019-12-28Auto merge of #67605 - lzutao:msdn-links, r=Mark-Simulacrumbors-17/+17
tidy: change msdn links to newer locations see accouncement at https://docs.microsoft.com/welcome-to-docs The script that I used: https://gist.github.com/lzutao/1449c9210ad91899841d62e0058d2caa
2019-12-25tidy: change msdn links to newer locationsLzu Tao-17/+17
see accouncement at https://docs.microsoft.com/welcome-to-docs
2019-12-24Deprecate Error::description for realDavid Tolnay-0/+9
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-24x.py fmt after previous deignoreMark Rousskov-137/+184
2019-12-22Format the worldMark Rousskov-2460/+2501
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-23/+23
2019-12-20Rollup merge of #67442 - reitermarkus:dummy-variable, r=kennytmMazdak Farrokhzad-18/+9
Remove `SOCK_CLOEXEC` dummy variable on platforms that don't use it.
2019-12-20Rollup merge of #67219 - jsgf:command-argv0-debug, r=joshtriplettMazdak Farrokhzad-2/+6
Fix up Command Debug output when arg0 is specified. PR https://github.com/rust-lang/rust/pull/66512 added the ability to set argv[0] on Command. As a side effect, it changed the Debug output to print both the program and argv[0], which in practice results in stuttery output (`"echo" "echo" "foo"`). This PR reverts the behaviour to the the old one, so that the command is only printed once - unless arg0 has been set. In that case it emits `"[command]" "arg0" "arg1" ...`.
2019-12-20Remove `SOCK_CLOEXEC` dummy variable on platforms that don't use it.Markus Reiter-18/+9
2019-12-18Remove `SO_NOSIGPIPE` dummy variable on platforms that don't use it.Markus Reiter-12/+6