Commit Graph

129486 Commits

Author SHA1 Message Date
Yuki Okushi 95d4215a97
Rollup merge of #77766 - JohnTitor:fix-debug-config, r=jyn514
Clarify the debug-related values should take boolean

#76588 tweaked their placeholders but these values should take boolean and the current placeholders are confusing, at least for me.
2020-10-11 03:19:16 +09:00
Yuki Okushi 8752b43900
Rollup merge of #77754 - bugadani:find_map_relevant_impl, r=matthewjasper
Add TraitDef::find_map_relevant_impl

This PR adds a method to `TraitDef`. While `for_each_relevant_impl` covers the general use case, sometimes it's not necessary to scan through all the relevant implementations, so this PR introduces a new method, `find_map_relevant_impl`. I've also replaced the `for_each_relevant_impl` calls where possible.

I'm hoping for a tiny bit of efficiency gain here and there.
2020-10-11 03:19:14 +09:00
Yuki Okushi 83685880b6
Rollup merge of #77748 - mati865:dead-code-cleanup, r=petrochenkov
Dead code cleanup in windows-gnu std

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

This is the only leftover I could find.
2020-10-11 03:19:12 +09:00
Yuki Okushi b6b6bc0a61
Rollup merge of #77738 - RalfJung:alloc-error-handler-comment, r=Amanieu
fix __rust_alloc_error_handler comment

`__rust_alloc_error_handler` was added in the same `extern` block as the allocator functions, but the comment there was not actually correct for `__rust_alloc_error_handler`. So move it down to the rest of the default allocator handling with a fixed comment. At least the comment reflects my understanding of what happens, please check carefully. :)

r? @Amanieu Cc @haraldh
2020-10-11 03:19:10 +09:00
Yuki Okushi 45e35745d3
Rollup merge of #77709 - pickfire:patch-1, r=jyn514
Link Vec leak doc to Box
2020-10-11 03:19:09 +09:00
Yuki Okushi c14c9bafcd
Rollup merge of #77629 - Julian-Wollersberger:recomputeRawStrError, r=varkor
Cleanup of `eat_while()` in lexer

The size of a lexer Token was inflated by the largest `TokenKind` variants `LiteralKind::RawStr` and `RawByteStr`, because
* it used `usize` although `u32` is sufficient in rustc, since crates must be smaller than 4GB,
* and it stored the 20 bytes big `RawStrError` enum for error reporting.

If a raw string is invalid, it now needs to be reparsed to get the `RawStrError` data, but that is a very cold code path.

Technically this breaks other tools that depend on rustc_lexer because they are now also restricted to a max file size of 4GB. But this shouldn't matter in practice, and rustc_lexer isn't stable anyway.

Can I also get a perf run?

Edit: This makes no difference in performance. The PR now only contains a small cleanup.
2020-10-11 03:19:07 +09:00
Yuki Okushi 1b134430ef
Rollup merge of #77195 - follower:patch-2, r=jyn514
Link to documentation-specific guidelines.

Changed contribution information URL because it's not obvious how to get from the current URL to the documentation-specific content.

The current URL points to this "Getting Started" page, which contains nothing specific about documentation[*] and instead launches into how to *build* `rustc` which is not a strict prerequisite for contributing documentation fixes:

 * https://rustc-dev-guide.rust-lang.org/getting-started.html

[*] The most specific content is a "Writing documentation" bullet point which is not itself a link to anything (I guess a patch for that might be helpful too).

### Why?

Making this change will make it easier for people who wish to make small "drive by" documentation fixes (and read contribution guidelines ;) ) which I find are often how I start contributing to a project. (Exhibit A: https://github.com/rust-lang/rust/pull/77050 :) )

### Background

My impression is the change of content linked is an unintentional change due to a couple of other changes:

 * Originally, the link pointed to  `contributing.md` which started with a "table of contents" linking to each section. But the content in `contributing.md` was removed and replaced with a link to the "Getting Started" section here:

    * 3f6928f1f6 (diff-6a3371457528722a734f3c51d9238c13L1)

   But the changed link doesn't actually point to the equivalent content, which is now located here:

    * https://rustc-dev-guide.rust-lang.org/contributing.html

   (If the "Guide to Rustc Development" is now considered the canonical location of "How to Contribute" content it might be a good idea to merge some of the "Contributing" Introduction section into the "Getting Started" section.)

 * This was then compounded by changing the link from `contributing.md` to  `contributing.html` here:

     * https://github.com/rust-lang/rust/pull/74037/files#diff-242481015141f373dcb178e93cffa850L88

    In order to even find the new location of the previous `contributing.md` content I ended up needing to do a GitHub search of the `rust-lang` org for the phrase "Documentation improvements are very welcome". :D
2020-10-11 03:19:05 +09:00
bors 7bc5839e99 Auto merge of #77337 - lzutao:asm-mips64, r=Amanieu
Add asm! support for mips64

- [x] Updated `src/doc/unstable-book/src/library-features/asm.md`.
- [ ] No vector type support. I don't know much about those types.

cc #76839
2020-10-10 17:32:28 +00:00
bjorn3 aa51449af4 Fix hotplug_codegen_backend test 2020-10-10 19:00:51 +02:00
Jonas Schievink 432535da2b Refactor how SwitchInt stores jump targets 2020-10-10 17:46:11 +02:00
bors 87b71ed68b Auto merge of #77771 - nagisa:revert-77023, r=Mark-Simulacrum
Revert "Assume slice len is bounded by allocation size"

https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379
suggests that the original PR introduced a significant perf regression.

This reverts commit e44784b875 / #77023.

cc `@HeroicKatora`
2020-10-10 15:17:01 +00:00
Yuki Okushi 2224e26578 Clarify the debug-related values should take boolean
They should take boolean values and the current placeholders are confusing, at least for me.
2020-10-10 23:36:55 +09:00
Joshua Nelson 23c3356f9a Mention rustdoc in `x.py setup`
This also allows 'rustdoc' as a string for the compiler profile.
2020-10-10 10:27:11 -04:00
bjorn3 12a2941214 Move llvm_util::time_trace_profiler_finish call to join_codegen
This makes it also run when compilation has failed, neither --emit exe
nor --emit metadata is passed, or -Zno-link is used.
2020-10-10 16:20:42 +02:00
Dániel Buga 0d27b765a6 Take functions by value 2020-10-10 16:19:53 +02:00
bjorn3 69f26b7761 Use fixed type for CodegenResults
This also moves the -Zno-link implementation to rustc_interface
2020-10-10 16:18:36 +02:00
Ivan Tham 8688fa8250
Improve vec leak wording
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10 22:17:48 +08:00
Ivan Tham 66369a6c70
Alloc vec doc mention cannot undo leak 2020-10-10 22:12:28 +08:00
Joshua Nelson d2ca0c4c9b Update `changelog-seen` in config.toml.example
This got out of sync when the version was bumped last time.

Long-term we may want to find an easier way to maintain this that
doesn't require bumping the version in three different places. Off the
top of my head I can't think of anything, though.
2020-10-10 10:08:36 -04:00
Dániel Buga 725e3d1df3 Re-enable test case 2020-10-10 15:56:51 +02:00
Dániel Buga b385598c96 Apply suggestions from code review
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10 15:56:51 +02:00
Dániel Buga a5fbfab8c0 Refactor path resolution and use Symbols instead of &str
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10 15:56:48 +02:00
Dániel Buga 3858c0fddd Apply suggestions from code review
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10 15:52:57 +02:00
Dániel Buga 3a640f2f3a Clean up hard to follow control flow 2020-10-10 15:52:57 +02:00
Dániel Buga 90e0fedb56 Clean up check_full_res 2020-10-10 15:52:56 +02:00
Stein Somers bb9da7a0ed BTreeMap: fix gdb introspection of BTreeMap with ZST keys or values 2020-10-10 15:27:51 +02:00
bjorn3 f141acf067 Move finalize_session_directory call out of cg_llvm
This causes it to be called even when passing `-Zno-link`, when linking
fails or when neither `--emit link` nor `--emit metadata` is used.
2020-10-10 15:20:35 +02:00
bjorn3 69f45cd965 Move save_work_product_index call out of cg_llvm 2020-10-10 15:14:58 +02:00
bors cae8bc1f23 Auto merge of #77731 - cuviper:big-endian-backtrace, r=alexcrichton
Update the backtrace crate to fix big-endian ELF

Pulls in rust-lang/backtrace-rs#373.
Fixes #77410.

r? `@alexcrichton`
2020-10-10 12:51:15 +00:00
bors 7477d445c8 Auto merge of #77717 - tmiasko:posix-spawn-error-check, r=cuviper
Fix error checking in posix_spawn implementation of Command

* Check for errors returned from posix_spawn*_init functions
* Check for non-zero return value from posix_spawn functions
2020-10-10 10:59:20 +00:00
bors 0e022fc2b8 Auto merge of #77580 - petrochenkov:norestarg, r=matthewjasper
rustc_target: Refactor away `TargetResult`

Follow-up to https://github.com/rust-lang/rust/pull/77202.

Construction of a built-in target is always infallible now, so `TargetResult` is no longer necessary.

The second commit contains some further cleanup based on built-in target construction being infallible.
2020-10-10 09:07:35 +00:00
Naoki Hayama 55e92f913a Fix typo in error code description
s/abitrary/arbitrary/
2020-10-10 18:02:53 +09:00
bors 1661f77e7b Auto merge of #77336 - pietroalbini:pkgname, r=Mark-Simulacrum
Always use the Rust version in package names

The format of the tarballs produced by CI is roughly the following:

    {component}-{release}-{target}.{ext}

While on the beta and nightly channels `{release}` is just the channel name, on the stable channel is either the Rust version or the version of the component we're shipping:

    cargo-0.47.0-x86_64-unknown-linux-gnu.tar.xz
    clippy-0.0.212-x86_64-unknown-linux-gnu.tar.xz
    llvm-tools-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    miri-0.1.0-x86_64-unknown-linux-gnu.tar.xz
    rls-1.41.0-x86_64-unknown-linux-gnu.tar.xz
    rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    ...

This makes it really hard to get the package URL without having access to the manifest (and there is no manifest on ci-artifacts.rlo), as there is no consistent version number to use.

This PR addresses the problem by always using the Rust version number as `{release}` for the stable channel, regardless of the version number of the component we're shipping. I chose that instead of "stable" to avoid breaking the URL scheme *that* much.

Rustup should not be affected by this change, as it fetches the URLs from the manifest. Unfortunately we don't have a way to test other clients before making a stable release, as this change only affects the stable channel.

r? `@Mark-Simulacrum`
2020-10-10 06:59:49 +00:00
Esteban Küber 4ae8f6ec7c address review comments 2020-10-09 22:00:48 -07:00
Josh Stone f200c1e7af doc: disambiguate stat in MetadataExt::as_raw_stat
A few architectures in `os::linux::raw` import `libc::stat`, rather than
defining that type directly. However, that also imports the _function_
called `stat`, which makes this doc link ambiguous:

    error: `crate::os::linux::raw::stat` is both a struct and a function
      --> library/std/src/os/linux/fs.rs:21:19
       |
    21 |     /// [`stat`]: crate::os::linux::raw::stat
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link
       |
       = note: `-D broken-intra-doc-links` implied by `-D warnings`
    help: to link to the struct, prefix with the item type
       |
    21 |     /// [`stat`]: struct@crate::os::linux::raw::stat
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    help: to link to the function, add parentheses
       |
    21 |     /// [`stat`]: crate::os::linux::raw::stat()
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We want the `struct`, so it's now prefixed accordingly.
2020-10-09 20:12:26 -07:00
Nixon Enraght-Moony d5b714355e Fix intra-docs link 2020-10-10 01:14:39 +01:00
Tomasz Miąsko ecd7862dfb Recognize discriminant reads as no-ops in RemoveNoopLandingPads
The cleanup blocks often contain read of discriminants. Teach
RemoveNoopLandingPads to recognize them as no-ops to remove
additional no-op landing pads.
2020-10-10 00:00:00 +00:00
Camelid 5883d3de9c Move `@has` checks closer to corresponding doc comments 2020-10-09 16:11:15 -07:00
Camelid 71ca8840d5 Use `next()` instead of `peek()` where possible 2020-10-09 16:08:15 -07:00
Camelid 330ce948f7
Link to GitHub issue re macro resolution
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-09 16:03:00 -07:00
Simonas Kazlauskas 54a5608334 Revert "Assume slice len is bounded by allocation size"
https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379
suggests that the original PR introduced a significant perf regression.

This reverts commit e44784b875 / #77023.
2020-10-10 00:56:45 +03:00
Esteban Küber fdbe4ce5c1 Add docstring 2020-10-09 14:44:24 -07:00
Esteban Küber 5e23cc4960 Given `<T as Trait>::A: Ty` suggest `T: Trait<A = Ty>`
Fix #75829
2020-10-09 14:44:24 -07:00
Esteban Küber e89ce461d3 Suggest removing bounds even when potential typo 2020-10-09 14:44:24 -07:00
Esteban Küber 5217007a20 Tweak output and add test cases 2020-10-09 14:44:24 -07:00
Esteban Küber 711760c8ec Point out why a trait is expected on `Struct + 'lt` 2020-10-09 14:44:24 -07:00
Camelid a3c517a65f Auto-prioritize issues with `regression-untriaged` 2020-10-09 14:10:44 -07:00
bors 38d911dfc5 Auto merge of #77276 - GuillaumeGomez:reexported-item-lints, r=jyn514,ollie27
Warn on broken intra-doc links added to cross-crate re-exports

This emits `broken_intra_doc_links` for docs applied to pub use statements that point to external items and are inlined.
Does not address #77200 - any existing broken links from the original crate will not show warnings.

r? `@jyn514`
2020-10-09 21:01:51 +00:00
Yuki Okushi 9f7eab4548 Use `ty::Binder::bind` to fix debug-assertions ICEs 2020-10-10 05:25:53 +09:00
bors 5ddef544fa Auto merge of #77674 - cuviper:direntry-diet, r=dtolnay
unix/vxworks: make DirEntry slightly smaller

`DirEntry` contains a `ReadDir` handle, which used to just be a wrapper
on `Arc<InnerReadDir>`. Commit af75314ecd added `end_of_stream: bool`
which is not needed by `DirEntry`, but adds 8 bytes after padding. We
can let `DirEntry` have an `Arc<InnerReadDir>` directly to avoid that.
2020-10-09 19:06:45 +00:00