123582 Commits

Author SHA1 Message Date
Manish Goregaokar
10b7eecbdd
Rollup merge of #74169 - ecstatic-morse:dataflow-unreachable, r=pnkfelix
Stop processing unreachable blocks when solving dataflow

...instead we `debug_assert` that the user is not checking the dataflow state for an unreachable block. This resolves a FIXME in the dataflow engine. The old behavior was an artifact of the previous dataflow framework. Things should run a tiny bit faster now, but I suspect not enough to show up in benchmarks. AFAIK, only the generator transform runs dataflow on MIR with unreachable basic blocks.

This PR also adds some utility methods to `mir::traversal`.

r? @pnkfelix
2020-07-17 14:09:08 -07:00
Manish Goregaokar
9c84c6b836
Rollup merge of #74056 - fusion-engineering-forks:fmt-arguments-as-str, r=Amanieu
Add Arguments::as_str().

There exist quite a few macros in the Rust ecosystem which use `format_args!()` for formatting, but special case the one-argument case for optimization:

```rust
#[macro_export]
macro_rules! some_macro {
    ($s:expr) => { /* print &str directly, no formatting, no buffers */ };
    ($s:expr, $($tt:tt)*) => { /* use format_args to write to a buffer first */ }
}
```

E.g. [here](7a961f0fbe/src/macros.rs (L48-L58)), [here](20f9a9e223/src/macros.rs (L9-L17)), and [here](7b679cd6da/px4/src/logging.rs (L45-L52)).

The problem with these is that a forgotten argument such as in `some_macro!("{}")` will not be diagnosed, but just prints `"{}"`.

With this PR, it is possible to handle the no-arguments case separately *after* `format_args!()`, while simplifying the macro. Then these macros can give the proper error about a missing argument, just like `print!("{}")` does, while still using the same optimized implementation as before.

This is even more important with [RFC 2795](https://github.com/rust-lang/rfcs/pull/2795), to make sure `some_macro!("{some_variable}")` works as expected.
2020-07-17 14:09:06 -07:00
Manish Goregaokar
be3b972820
Rollup merge of #74009 - mati865:mingw-tests-implib, r=nikomatsakis
Fix MinGW `run-make-fulldeps` tests

`compiler-rt-works-on-mingw` and `libs-search-path` were not ran because `only-mingw` doesn't match any target.
Enabled and verified few ignored tests with `windows-gnu` toolchain. They are still ignored on MSVC since I'm not experienced with this target.
2020-07-17 14:09:04 -07:00
Manish Goregaokar
f6cd31c3b7
Rollup merge of #73930 - a1phyr:feature_const_option, r=dtolnay
Make some Option methods const

Tracking issue: #67441

Constantify the following methods of `Option`:
- `as_ref`
- `is_some`
- `is_none`
- `iter` (not sure about this one, but it is possible, and will be useful when const traits are a thing)

cc @rust-lang/wg-const-eval @rust-lang/libs
2020-07-17 14:09:02 -07:00
Manish Goregaokar
3006ea3560
Rollup merge of #71670 - GuillaumeGomez:enforce-codeblocks-attribute-check, r=Mark-Simulacrum
Enforce even more the code blocks attributes check through rustdoc

`rustdoc` now has a lint which allows it to warn if a code block attribute is malformated (which can end up in bad situations, even more in case of testing examples!). Now it'll fail if such a situation is encountered when testing markdown code blocks examples.

r? @Mark-Simulacrum
2020-07-17 14:08:55 -07:00
Mateusz Mikuła
af1d01ebb3 Fix various tests to run on windows-gnu 2020-07-17 20:45:29 +02:00
bors
39d5a61f2e Auto merge of #72983 - Lezzz:rename-typeck, r=nikomatsakis
Rename TypeckTables to TypeckResults.

Originally suggested by @eddyb.
2020-07-17 17:25:09 +00:00
Mateusz Mikuła
933a06d8a3 Remove invalid test
When ran on Windows `cp` will follow symlink: `checkout/build/<target>/<stage>/lib/rustlib/src/rust`.
It points to `checkout` which means the test will get stuck in copying loop until there is no space left.
2020-07-17 18:07:53 +02:00
Mateusz Mikuła
2a9b51dcc4 Allow matching test by target and env 2020-07-17 18:07:51 +02:00
Mateusz Mikuła
48fe5fcbb8 Create implib for dlls when testing MinGW targets 2020-07-17 18:07:50 +02:00
Mara Bos
9c3353b97c Add tracking issue number for fmt_as_str. 2020-07-17 17:56:55 +02:00
Mara Bos
0c51f53edf Make fmt::Arguments::as_str() return a 'static str. 2020-07-17 17:56:55 +02:00
bors
3014f23ddd Auto merge of #74439 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/74345
2020-07-17 13:54:21 +00:00
Mara Bos
e17c17a1af Make Arguments::as_str() work for empty format strings. 2020-07-17 15:35:59 +02:00
Mara Bos
bc4e33e6c1 Add #[inline] to Arguments::as_str(). 2020-07-17 15:35:59 +02:00
Mara Bos
e73a23fa96 Add Arguments::as_str(). 2020-07-17 15:35:58 +02:00
Ralf Jung
8a917f9873 update Miri 2020-07-17 15:07:15 +02:00
Valentin Lazureanu
1e6adad33f Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
bors
c2dbebd3d4 Auto merge of #73365 - Manishearth:rustdoc-vis, r=GuillaumeGomez
Record visibility of reexports for all items, not just type items

This fixes https://github.com/rust-lang/rust/issues/73363

Unfortunately I can't add a test for this since this bug is obscured by the cross-crate bug, being fixed in https://github.com/rust-lang/rust/issues/73363 . Tests will be added later.

cc @jyn514

r? @GuillaumeGomez
2020-07-17 07:22:32 +00:00
Manish Goregaokar
90c678cb03 Update src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-07-16 22:22:48 -07:00
Manish Goregaokar
50d350b67c Add test for doc(hidden) intra-doc cross-crate reexports 2020-07-16 22:22:40 -07:00
Manish Goregaokar
d5b1b74f47 Record visibility of reexports for all items, not just type items 2020-07-16 22:22:40 -07:00
bors
86c0b85da9 Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini
Bump version to 1.47

This also bumps to a more recent rustfmt version, just to keep us relatively up to date (though almost nothing has changed in rustfmt we use beyond bumps to the parser infra). No formatting changes as a result of this.

r? @pietroalbini
2020-07-17 03:51:35 +00:00
bors
8534be72fc Auto merge of #74422 - Manishearth:rollup-7mfrf6g, r=Manishearth
Rollup of 8 pull requests

Successful merges:

 - #73101 (Resolve items for cross-crate imports relative to the original module)
 - #73269 (Enable some timeouts in SGX platform)
 - #74033 (Add build support for Cargo's build-std feature.)
 - #74351 (Do not render unstable items for rustc doc)
 - #74357 (Some `Symbol` related improvements)
 - #74371 (Improve ayu rustdoc theme)
 - #74386 (Add RISC-V GNU/Linux to src/tools/build-manifest as a host platform)
 - #74398 (Clean up E0723 explanation)

Failed merges:

r? @ghost
2020-07-17 00:09:49 +00:00
Manish Goregaokar
5bb9bef795
Rollup merge of #74398 - GuillaumeGomez:cleanup-e0723, r=Dylan-DPC
Clean up E0723 explanation

r? @Dylan-DPC
2020-07-16 17:09:06 -07:00
Manish Goregaokar
b1ba961cad
Rollup merge of #74386 - msizanoen1:riscv-add-manifest-host, r=pietroalbini
Add RISC-V GNU/Linux to src/tools/build-manifest as a host platform

Missed during https://github.com/rust-lang/rust/pull/72973
2020-07-16 17:09:04 -07:00
Manish Goregaokar
874097c8c7
Rollup merge of #74371 - Aloso:patch-1, r=GuilliameGomez
Improve ayu rustdoc theme

This PR changes the following:

* It makes some lines darker
* It gives the crate selector and search bar a border
  * The search bar's border turns blue when focused
* ~~Gives the logo a bright shadow.~~

For standard library crates, it would be better to invert the logo, but that would be bad for crates with a colored logo, e.g. [async-std](https://docs.rs/async-std/1.6.2/async_std/).

Before:

![old](https://user-images.githubusercontent.com/15658558/87576611-ed4e0800-c6d1-11ea-9667-3924702f79e2.png)

After (note that this PR no longer includes the white shadow of the logo):

![new](https://user-images.githubusercontent.com/15658558/87576621-ef17cb80-c6d1-11ea-8e15-5d7f8b180c07.png)
2020-07-16 17:09:02 -07:00
Manish Goregaokar
c60b051bbb
Rollup merge of #74357 - nnethercote:symbol-related-improvements, r=oli-obk
Some `Symbol` related improvements

These commits make things nicer and avoid some `Symbol::as_str()` calls.

r? @oli-obk
2020-07-16 17:09:01 -07:00
Manish Goregaokar
0e70884083
Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns, r=Mark-Simulacrum
Do not render unstable items for rustc doc

See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782

Before:
![image](https://user-images.githubusercontent.com/15225902/87501971-9cff8780-c68a-11ea-93b4-ea53ce18a77b.png)
After:
![image](https://user-images.githubusercontent.com/15225902/87501985-a7218600-c68a-11ea-81c0-a6b5b120832c.png)

Nothing changes in unstable items of std:
Before:
![image](https://user-images.githubusercontent.com/15225902/87502004-b7d1fc00-c68a-11ea-9224-a27a1d2a81d6.png)
After:
![image](https://user-images.githubusercontent.com/15225902/87502018-c0c2cd80-c68a-11ea-9773-4c63158025cb.png)

Closes  #54682
2020-07-16 17:08:59 -07:00
Manish Goregaokar
5751c7f1db
Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-Simulacrum
Add build support for Cargo's build-std feature.

This makes some changes to the standard library to make it easier to use with Cargo's build-std feature. The primary goal is to make it so that Cargo and its users do not need to know which crates to build and which features to use for every platform.

Conditional cfgs are adjusted so that there is usually a fall-through for unsupported platforms. Additionally, there is a "restricted-std" feature to mark `std` as unstable when used with build-std on no_std platforms. There is no intent to stabilize this feature for the foreseeable future.

This borrows some of the implementation for wasm which already does what this needs. More code sharing can be done with some other platforms (there is a lot of duplication with cloudabi, hermit, and sgx), but I figure that can be done in a future PR.

There are some small changes to stable behavior in this PR:
- `std::env::consts::ARCH` on asmjs now reports "wasm32", to match its actual architecture.
- Some of the wasm error messages for unsupported features report a slightly different error message so that the code can be reused.

There should otherwise not be any changes to how std is built for distribution via bootstrap.

This does not yet support all platforms when used with build-std.

- It doesn't work with 16-bit targets (hashbrown does not support that).
- It does not work with JSON spec targets.
    - In particular, all target triple snooping will need to be replaced with appropriate target option checking.
- Switching to gimli (#73441) will make cross-building *much* easier.
- There are still a ton of issues on the Cargo side to resolve. A big one is panic strategy support.

Future PRs are intended to address some of these issues.
2020-07-16 17:08:57 -07:00
Manish Goregaokar
41d956bf63
Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogb
Enable some timeouts in SGX platform

This would partially resolve https://github.com/fortanix/rust-sgx/issues/31

cc @jethrogb and @Goirad
2020-07-16 17:08:56 -07:00
Manish Goregaokar
ec93d566b3
Rollup merge of #73101 - jyn514:rustdoc-absolute-module, r=Manishearth
Resolve items for cross-crate imports relative to the original module

~~Blocked on https://github.com/rust-lang/rust/pull/73103 and https://github.com/rust-lang/rust/pull/73566~~

Closes https://github.com/rust-lang/rust/issues/65983.

I tested on the following code (as mentioned in https://github.com/rust-lang/rust/issues/65983#issuecomment-640250993):

```
pub use rand::Rng;
```
and rustdoc generated the following link: https://rust-random.github.io/rand/rand_core/trait.RngCore.html
2020-07-16 17:08:54 -07:00
Mark Rousskov
8321b3fbe4 Add zlib1g to builder deps 2020-07-16 19:36:49 -04:00
Mark Rousskov
647d9b525f apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
Mark Rousskov
6c50ae898b Bump to 1.47 2020-07-16 19:36:49 -04:00
Nicholas Nethercote
a4ba18164a Remove some Symbol:as_str() calls. 2020-07-17 08:29:58 +10:00
Nicholas Nethercote
f03c7f83eb Add UnsafetyViolationDetails.
This replaces the need for the `description` and `details` symbols in
`UnsafetyViolation`, which are static. As a result some
`Symbol::as_str()` calls are no longer necessary, which is nice.
2020-07-17 08:28:22 +10:00
Nicholas Nethercote
002af4d0c7 Avoid storing SymbolStr in a struct.
It's intended only for very temporary use.
2020-07-17 08:28:22 +10:00
Nicholas Nethercote
9f0080801d Remove ExtCtxt::ident_of.
It's equivalent to `Ident::from_str_and_span`. The commit also
introduces some more static symbols so that `Ident::new` can be used in
various places instead of `Ident::from_str_and_span`.

The commit also changes `Path::path` from a `&str` to a `Symbol`, which
then allows the lifetime annotation to be removed from `Ty`. Also, the
use of `Symbol` in `Bounds` removes the need for its lifetime
annotation.
2020-07-17 08:28:19 +10:00
Joshua Nelson
c46e0386c5 Fix invalid lint
intra_doc_resolution_failure is not a lint.
2020-07-16 18:26:58 -04:00
Joshua Nelson
8387e3825f Add (broken and ignored) test for #73829 2020-07-16 18:26:58 -04:00
Joshua Nelson
0ad1dcd6a0 Add more debugging 2020-07-16 18:26:58 -04:00
Joshua Nelson
82b3b0705b Support intra-doc links on trait and module re-exports
Trait implementations are treated the same as modules for the purposes
of intra-doc links.
2020-07-16 18:26:58 -04:00
Joshua Nelson
e63e5cdab0 Support intra-doc links on macro re-exports
This includes both `macro_rules!` and proc-macros.
2020-07-16 18:26:58 -04:00
Joshua Nelson
5f49f55eb4 rand -> my_rand
This fixes a failure in stage2 rustdoc tests.
2020-07-16 18:26:58 -04:00
Joshua Nelson
769acbaca0 #![deny(intra_doc_resolution_failure)] 2020-07-16 18:26:58 -04:00
Joshua Nelson
432b0431ab Move import to top of function 2020-07-16 18:26:58 -04:00
Joshua Nelson
71fe8f7cd8 Add test for submodules in inner crate 2020-07-16 18:26:58 -04:00
Joshua Nelson
9eb63945eb Add test for documenting the re-export 2020-07-16 18:26:58 -04:00
Joshua Nelson
e78d499637 Add test for re-exports
I had a hard time getting this to work without the `extern crate`,
suggestions are welcome.
2020-07-16 18:26:57 -04:00