Commit Graph

2300 Commits

Author SHA1 Message Date
Matthias Krüger
03aecda83a use subdsec_micros() instead of subsec_nanos() / 1000 2020-03-01 21:15:13 +01:00
Matthias Krüger
7be94a8a95 don't use .into() to convert types into identical types.
example:
    let s: String = format!("hello").into();
2020-02-27 23:32:46 +01:00
LeSeulArtichaut
79b8ad84c8 Implement Copy for IoSlice 2020-02-23 18:32:36 +01:00
bors
b1f395de64 Auto merge of #69084 - yaahc:delayed-doc-lint, r=petrochenkov
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-23 16:09:41 +00:00
Jane Lusby
09bc5e3d96 rustfmt darnit 2020-02-22 15:29:03 -08:00
Jane Lusby
40c67221e2 make doc comments regular comments 2020-02-22 15:13:22 -08:00
Yuki Okushi
284acafe61 Rollup merge of #68767 - kubo39:patch-macos, r=shepmaster
macOS: avoid calling pthread_self() twice
2020-02-18 20:09:04 +09:00
Hiroki Noda
67068f35dd macOS: avoid calling pthread_self() twice 2020-02-16 19:53:42 +09:00
Dylan DPC
728be34ebc Rollup merge of #69106 - RReverser:wasi-fs-copy, r=KodrAus
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-15 09:45:45 +01:00
Jethro Beekman
57a62f5335 Add comment to SGX entry code 2020-02-13 10:16:28 +01:00
Dylan DPC
2501a10670 Rollup merge of #69068 - Goirad:make-sgx-arg-cleanup-nop, r=jethrogb,nagisa
Make the SGX arg cleanup implementation a NOP

fixes #64304

cc @jethrogb
2020-02-13 02:52:56 +01:00
Ingvar Stepanyan
8fb8bb4b3f 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-12 20:08:41 +00:00
Dylan DPC
a908716ec6 Rollup merge of #69040 - jethrogb:jb/cleanup-sgx-entry, r=nagisa
Cleanup SGX entry code

cc @aandyl
2020-02-12 20:36:58 +01:00
Dario Gonzalez
1f6fb338a5 make the sgx arg cleanup implementation a no op 2020-02-11 10:11:58 -08:00
Jethro Beekman
71b9ed4a36 Avoid jumping to Rust code with user %rsp (reentry_panic) 2020-02-10 21:00:22 +01:00
Raoul Strackx
236ab6e6d6 sanitize MXCSR/FPU control registers 2020-02-10 20:57:30 +01:00
Raoul Strackx
aeedc9dea9 Corrected ac_mitigation patch. That patch used the untrusted stack to clear rflags during enclave (re-)entry 2020-02-10 20:57:25 +01:00
Jethro Beekman
1b12232b8f Fix SGX RWLock representation for UnsafeCell niche fix 2020-02-10 14:44:12 -05:00
Friedrich von Never
b0a9e949e7 Strip unnecessary subexpression
It became unnecessary since a06baa56b9 reformatted the file.
2020-02-02 15:08:46 +07:00
Hiroki Noda
c870ca6217 Update 2020-01-30 10:31:12 +09:00
Hiroki Noda
50ed6cbf98 Fix typo. 2020-01-30 10:07:36 +09:00
comet
9a78c2b11d update 2020-01-26 22:52:13 -06:00
Yuki Okushi
f998e275ca Rollup merge of #68515 - Wind-River:master_2020, r=alexcrichton
Support feature process_set_argv0 for VxWorks

r? @alexcrichton
2020-01-25 07:45:18 +09:00
BaoshanPang
06af44238f Support feature process_set_argv0 for VxWorks 2020-01-24 09:59:59 -08:00
Tomasz Miąsko
2fd6c4a18a Remove unused ignore-license directives
The tidy check was removed in rust-lang/rust#53617
2020-01-24 00:00:00 +00:00
Dylan DPC
c8125fb36a Rollup merge of #68033 - ollie27:win_f32, r=dtolnay
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-16 20:53:26 +05:30
Till Arnold
c32090c130 Document behavior of set_nonblocking on UnixListener 2020-01-12 12:01:37 +01:00
Lzu Tao
cd9a73d2ea make use of pointer::is_null 2020-01-10 12:52:00 +00:00
Oliver Middleton
084217af65 Don't use f64 shims for f32 cmath functions on none 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-08 22:56:33 +00:00
Yuki Okushi
b687461073 Rollup merge of #67977 - Wind-River:master_2020, r=alexcrichton
Updates for VxWorks

r? @alexcrichton
2020-01-09 00:29:18 +09:00
oxalica
f5baa03af0 Try statx for all linux-gnu targets 2020-01-08 14:21:27 +08:00
BaoshanPang
cec957e154 ignore signal SIGPIPE 2020-01-06 16:11:45 -08:00
bors
ef92009c1d Auto merge of #66899 - msizanoen1:riscv-std, r=alexcrichton
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-06 19:07:42 +00:00
Umesh Kalappa
012127b3fe Remove weak.rs for VxWorks 2020-01-06 11:04:58 -08:00
Guillaume Gomez
a86a18907b Rollup merge of #67848 - ollie27:float_link_name_attr, r=Dylan-DPC
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-04 13:17:32 +01:00
Oliver Middleton
83333fe85b 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.
2020-01-03 23:41:11 +00:00
Lzu Tao
dd8f072233 Use drop instead of the toilet closure |_| () 2020-01-02 08:56:12 +00:00
msizanoen1
b830b673e7 Add support for RISC-V 64-bit GNU/Linux 2020-01-01 09:52:18 +07:00
bors
f564c4db0d Auto merge of #67605 - lzutao:msdn-links, r=Mark-Simulacrum
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-28 09:19:26 +00:00
Lzu Tao
3a2ef17194 tidy: change msdn links to newer locations
see accouncement at https://docs.microsoft.com/welcome-to-docs
2019-12-25 15:35:54 +00:00
David Tolnay
4646a88b7a Deprecate Error::description for real
`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-24 22:39:49 -08:00
Mark Rousskov
6891388e66 x.py fmt after previous deignore 2019-12-24 17:38:22 -05:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Ross MacArthur
f7256d28d1 Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
Mazdak Farrokhzad
3a336c48c3 Rollup merge of #67442 - reitermarkus:dummy-variable, r=kennytm
Remove `SOCK_CLOEXEC` dummy variable on platforms that don't use it.
2019-12-20 12:17:27 +01:00
Mazdak Farrokhzad
b779cbbe68 Rollup merge of #67219 - jsgf:command-argv0-debug, r=joshtriplett
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-20 12:17:22 +01:00
Markus Reiter
b82671112c Remove SOCK_CLOEXEC dummy variable on platforms that don't use it. 2019-12-20 04:27:28 +01:00
Markus Reiter
58910255aa Remove SO_NOSIGPIPE dummy variable on platforms that don't use it. 2019-12-18 08:46:00 +01:00
Jeremy Fitzhardinge
232022ff17 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-16 14:44:16 -08:00
Mazdak Farrokhzad
39c5d8199a Rollup merge of #67267 - alexcrichton:update-wasi-libc, r=Dylan-DPC
Fix signature of `__wasilibc_find_relpath`

Looks like this function changed upstream, so it needs to be adjusted
for when used by libstd.
2019-12-15 05:57:22 +01:00