Commit Graph

137047 Commits

Author SHA1 Message Date
Guillaume Gomez
d5243e3a97 Add test for primitive search 2021-02-01 15:56:51 +01:00
Guillaume Gomez
198e3aba8f Put back primitives in search 2021-02-01 15:56:51 +01:00
bors
a2f8f62818 Auto merge of #81335 - thomwiggers:no-panic-shrink-to, r=Mark-Simulacrum
Trying to shrink_to greater than capacity should be no-op

Per the discussion in https://github.com/rust-lang/rust/issues/56431, `shrink_to` shouldn't panic if you try to make a vector shrink to a capacity greater than its current capacity.
2021-01-27 18:36:32 +00:00
bors
613ef740f3 Auto merge of #80987 - GuillaumeGomez:remove-cache-key, r=jyn514
Remove CACHE_KEY global

We realized in https://github.com/rust-lang/rust/pull/80914 that the cache handling (through a global) needed to be updated to make it much easier to handle.

r? `@jyn514`
2021-01-27 10:19:51 +00:00
Guillaume Gomez
d78e1ed623 Fix clean/types doc links 2021-01-27 10:05:06 +01:00
Guillaume Gomez
5f22b30ca6 Add search index test for primitive types 2021-01-27 10:05:06 +01:00
Guillaume Gomez
cac238e4a3 More cleanup 2021-01-27 10:05:06 +01:00
Guillaume Gomez
9a64180f0d Unify cache usage and improve naming 2021-01-27 10:05:06 +01:00
Guillaume Gomez
522f48cb3f Improve documentation on GetDefId trait's methods 2021-01-27 10:05:06 +01:00
Guillaume Gomez
d98a72c77b Update to new rustdoc APIs 2021-01-27 10:05:06 +01:00
Guillaume Gomez
6a36b3f49d Apply review comments and improve code 2021-01-27 10:05:05 +01:00
Guillaume Gomez
19630ead41 Remove cache usage wherever possible 2021-01-27 10:05:05 +01:00
Guillaume Gomez
c448270099 Use empty Cache for methods requiring it when filling Cache itself 2021-01-27 10:05:05 +01:00
Guillaume Gomez
9fd5a67984 Remove CACHE_KEY global 2021-01-27 10:05:05 +01:00
bors
742c972c4f Auto merge of #79591 - estebank:unexpected-generics, r=oli-obk
Point only at generic arguments when they are unexpected
2021-01-27 07:15:33 +00:00
bors
78e22069d0 Auto merge of #81393 - pnkfelix:issue-81296-make-weak-item-traversal-deterministic, r=estebank
Make weak item traversal deterministic

Fix #81296.

(No test added. The relevant test *is* ui/panic-handler/weak-lang-item.rs, and this change should make it less flaky.)
2021-01-27 00:19:45 +00:00
Esteban Küber
2e846d6f61 Point only at generic arguments when they are unexpected 2021-01-26 15:59:43 -08:00
bors
d1aed50ab8 Auto merge of #81417 - JohnTitor:rollup-yi3q05s, r=JohnTitor
Rollup of 14 pull requests

Successful merges:

 - #80812 (Update RELEASES.md for 1.50.0)
 - #80876 (Add `unwrap_unchecked()` methods for `Option` and `Result`)
 - #80900 (Fix ICE with `ReadPointerAsBytes` validation error)
 - #81191 (BTreeMap: test all borrowing interfaces and test more chaotic order behavior)
 - #81195 (Account for generics when suggesting bound)
 - #81299 (Fix some bugs reported by eslint)
 - #81325 (typeck: Don't suggest converting LHS exprs)
 - #81353 (Fix spelling in documentation for error E0207)
 - #81369 (rustc_codegen_ssa: use wall time for codegen_to_LLVM_IR time-passes entry)
 - #81389 (rustdoc: Document CommonMark extensions.)
 - #81399 (Update books)
 - #81401 (tidy: Some code cleanup.)
 - #81407 (Refine "remove semicolon" suggestion in trait selection)
 - #81412 (Fix assertion in `MaybeUninit::array_assume_init()` for zero-length arrays)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-26 19:44:26 +00:00
Yuki Okushi
b2f6c2aa9b
Rollup merge of #81412 - hyd-dev:array-assume-init-wrong-assertion, r=m-ou-se
Fix assertion in `MaybeUninit::array_assume_init()` for zero-length arrays

That assertion has a false positive ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=63922b8c897b04112adcdf346deb1d0e)):
```rust
#![feature(maybe_uninit_array_assume_init)]

use std::mem::MaybeUninit;

enum Uninhabited {}

fn main() {
    unsafe {
        // thread 'main' panicked at 'attempted to instantiate uninhabited type `Uninhabited`'
        MaybeUninit::<Uninhabited>::array_assume_init([]);
    }
}
```
*Previously reported in https://github.com/rust-lang/rust/pull/80600#discussion_r564496692.*

This PR makes it ignore zero-length arrays.

cc #80908
2021-01-27 04:43:37 +09:00
Yuki Okushi
d68570c78f
Rollup merge of #81407 - osa1:issue81098, r=estebank
Refine "remove semicolon" suggestion in trait selection

Don't suggest it if the last statement doesn't have a semicolon

Fixes #81098

See also #54771 for why this suggestion was added
2021-01-27 04:43:35 +09:00
Yuki Okushi
24a1081a23
Rollup merge of #81401 - ehuss:tidy-cleanup, r=Mark-Simulacrum
tidy: Some code cleanup.

This is just some cleanup that shouldn't have any change in behavior.  (See commit messages for more details.)

* Remove cargo check. This test wasn't working, and is no longer valid.
* Remove edition filter exceptions. They are no longer necessary.
* Remove unnecessary trailing semicolon.  Otherwise the warning will prevent tidy from building after the beta branch.
2021-01-27 04:43:33 +09:00
Yuki Okushi
9da36082c2
Rollup merge of #81399 - ehuss:update-books, r=ehuss
Update books

## nomicon

7 commits in a8584998eacdea7106a1dfafcbf6c1c06fcdf925..bbf06ad39d1f45654047e9596b750cc6e6d1b693
2021-01-06 12:49:49 -0500 to 2021-01-22 07:07:31 -0800
- Fix alloc link in exotic-sizes for local docs (rust-lang-nursery/nomicon#255)
- Remove TODO
- Fix small punctuation error
- Arc revisions (Clone atomic explanation) (pt2/3(+?))
- Fix Arc Clone
- Arc revisions (pt1/2(+?))
- Simple Arc implementation (without Weak refs)

## reference

5 commits in 50af691f838937c300b47812d0507c6d88c14f97..f02b09eb6e8af340ad1256a54adb7aae2ff3163e
2021-01-12 21:19:20 -0800 to 2021-01-22 01:53:02 -0800
- Fix missing space (rust-lang-nursery/reference#941)
- Start documenting name resolution. (rust-lang-nursery/reference#937)
- Fix plural and delete spurious words in comparison ops (rust-lang-nursery/reference#932)
- Document execution order (rust-lang-nursery/reference#888)
- Compound operator expressions (rust-lang-nursery/reference#915)

## book

3 commits in ac57a0ddd23d173b26731ccf939f3ba729753275..e724bd826580ff95df48a8533af7dec1080693d4
2021-01-09 14:18:45 -0500 to 2021-01-20 08:19:49 -0600
- Fixes rust-lang/book#2417. Get the index from user input instead of a const. (rust-lang/book#2566)
- Turn off the playground in a bunch more lib.rs inclusions (rust-lang/book#2569)
- Merge pull request rust-lang/book#2567 from rust-lang/rust-1.49

## rust-by-example

1 commits in 03e23af01f0b4f83a3a513da280e1ca92587f2ec..f633769acef68574427a6fae6c06f13bc2199573
2021-01-09 10:20:28 -0300 to 2021-01-13 20:58:25 -0300
- Fixed styling on closure example (rust-lang/rust-by-example#1405)
2021-01-27 04:43:32 +09:00
Yuki Okushi
ebe28f7a77
Rollup merge of #81389 - ehuss:rustdoc-cmark-extensions, r=GuillaumeGomez
rustdoc: Document CommonMark extensions.

This updates the rustdoc book to include some documentation on the CommonMark extensions that rustdoc supports.
2021-01-27 04:43:30 +09:00
Yuki Okushi
acbd1010ef
Rollup merge of #81369 - tgnottingham:codegen-to-llvm-ir-wall-time, r=lcnr
rustc_codegen_ssa: use wall time for codegen_to_LLVM_IR time-passes entry

Use elapsed wall time spent on codegen_to_LLVM_IR for all CGUs as a
whole, rather than the sum for each CGU (the distinction matters for
parallel builds, where some CGUs are processed in parallel).
2021-01-27 04:43:28 +09:00
Yuki Okushi
3741844711
Rollup merge of #81353 - jockbert:spelling_in_e0207, r=petrochenkov
Fix spelling in documentation for error E0207

I have trouble parsing the the wording "type parameter parameter".
2021-01-27 04:43:25 +09:00
Yuki Okushi
71f13fb434
Rollup merge of #81325 - osa1:issue81293, r=estebank
typeck: Don't suggest converting LHS exprs

Converting LHS of an assignment does not work, so avoid suggesting that.

Fixes #81293
2021-01-27 04:43:24 +09:00
Yuki Okushi
1308c1445c
Rollup merge of #81299 - GuillaumeGomez:fix-eslint-detected-bugs, r=Nemo157
Fix some bugs reported by eslint

Simply went into `src/librustdoc/html/static/` and ran `eslint *.js` in case you want to reproduce. :)

r? ``````@Nemo157``````
2021-01-27 04:43:22 +09:00
Yuki Okushi
644df2fd23
Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params, r=oli-obk
Account for generics when suggesting bound

Fix #81175.
2021-01-27 04:43:20 +09:00
Yuki Okushi
8299105821
Rollup merge of #81191 - ssomers:btree_more_order_chaos, r=Mark-Simulacrum
BTreeMap: test all borrowing interfaces and test more chaotic order behavior

Inspired by #81169, test what happens if you mess up order of the type with which you search (as opposed to the key type).

r? `@Mark-Simulacrum`
2021-01-27 04:43:18 +09:00
Yuki Okushi
c2c90bf548
Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obk
Fix ICE with `ReadPointerAsBytes` validation error

Fixes #79690.

r? ``````@oli-obk``````
2021-01-27 04:43:16 +09:00
Yuki Okushi
fe6b3a9792
Rollup merge of #80876 - ojeda:option-result-unwrap_unchecked, r=m-ou-se
Add `unwrap_unchecked()` methods for `Option` and `Result`

In particular:
  - `unwrap_unchecked()` for `Option`.
  - `unwrap_unchecked()` and `unwrap_err_unchecked()` for `Result`.

These complement other `*_unchecked()` methods in `core` etc.

Currently there are a couple of places it may be used inside rustc (`LinkedList`, `BTree`). It is also easy to find other repositories with similar functionality.

Fixes #48278.
2021-01-27 04:43:14 +09:00
Yuki Okushi
f85fd81968
Rollup merge of #80812 - rust-lang:relnotes-1.50.0, r=Mark-Simulacrum
Update RELEASES.md for 1.50.0

### [Rendered](https://github.com/rust-lang/rust/blob/relnotes-1.50.0/RELEASES.md)

r? `@Mark-Simulacrum`
cc `@rust-lang/release`
2021-01-27 04:43:12 +09:00
Thom Wiggers
d069c58e78
shrink_to shouldn't panic on len greater than capacity 2021-01-26 19:25:37 +01:00
hyd-dev
f52066726d
Fix assertion in MaybeUninit::array_assume_init() for zero-length arrays 2021-01-27 00:16:58 +08:00
Erin Power
39e24f745b Update RELEASES.md for 1.50.0 2021-01-26 15:03:49 +00:00
bors
7907345e58 Auto merge of #81217 - ssomers:btree_bring_back_the_slice, r=Mark-Simulacrum
BTreeMap: bring back the key slice for immutable lookup

Pave the way for binary search, by reverting a bit of #73971, which banned `keys` for misbehaving while it was defined for every `BorrowType`. Adding some `debug_assert`s along the way.

r? `@Mark-Simulacrum`
2021-01-26 14:47:51 +00:00
bors
1483e67add Auto merge of #81367 - andersk:join-test-threads, r=dtolnay
libtest: Wait for test threads to exit after they report completion

Otherwise we can miss bugs where a test reports that it succeeded but then panics within a TLS destructor.

Example:

```rust
use std:🧵:sleep;
use std::time::Duration;

struct Foo;

impl Drop for Foo {
    fn drop(&mut self) {
        sleep(Duration::from_secs(1));
        panic!()
    }
}

thread_local!(static FOO: Foo = Foo);

#[test]
pub fn test() {
    FOO.with(|_| {});
}
```

Before this fix, `cargo test` incorrectly reports success.

```console
$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running target/debug/deps/panicking_test-85130fa46b54f758

running 1 test
test test ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

$ echo $?
0
```

After this fix, the failure is visible. (The entire process is aborted due to #24479.)

```console
$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running target/debug/deps/panicking_test-76180625bc2ee3c9

running 1 test
thread 'test' panicked at 'explicit panic', src/main.rs:9:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
error: test failed, to rerun pass '--bin panicking-test'

Caused by:
  process didn't exit successfully: `/tmp/panicking-test/target/debug/deps/panicking_test-76180625bc2ee3c9 --nocapture` (signal: 6, SIGABRT: process abort signal)

$ echo $?
101
```
2021-01-26 11:15:44 +00:00
Ömer Sinan Ağacan
8ddc1c83f2 Refine "remove semicolon" suggestion in trait selection
Don't suggest it if the last statement doesn't have a semicolon

Fixes #81098

See also #54771 for why this suggestion was added
2021-01-26 13:23:30 +03:00
Ömer Sinan Ağacan
d035be8e6f typeck: Don't suggest converting LHS exprs
Converting LHS of an assignment does not work, so avoid suggesting that.

Fixes #81293
2021-01-26 09:09:15 +03:00
bors
a8f7075532 Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebank
Enforce that query results implement Debug

Currently, we require that query keys implement `Debug`, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk.

This PR adds `Debug` bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding `#[derive(Debug)]` to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.
2021-01-26 05:47:23 +00:00
bors
ff6ee2a702 Auto merge of #79113 - andjo403:raw_vec_ptr, r=m-ou-se
mark raw_vec::ptr with inline

when a lot of vectors is used in a enum as in the example in #66617 if this function is not inlined and multiple cgus is used this results in huge compile times. with this fix the compile time is 6s from minutes for the example in #66617. I did not have the patience to wait for it to compile for more then 3 min.
2021-01-26 02:56:37 +00:00
Eric Huss
fdd592acd0 Update books 2021-01-25 15:10:10 -08:00
Eric Huss
6f22f512ec tidy: Remove unnecessary trailing semicolon.
This will cause a failure due to the warning after the next beta branch
as https://github.com/rust-lang/rust/pull/79812 will hit beta.
2021-01-25 12:43:17 -08:00
Eric Huss
d9807154d6 tidy: Remove edition filter exceptions.
These exceptions are no longer necessary.
2021-01-25 12:40:22 -08:00
Eric Huss
3eebf9bb80 tidy: Remove cargo check.
The cargo check was checking that every dependency had an `extern crate`.
The compiler has not used `extern crate` in a long time (edition 2018).
The test was broken (the call to `!super::filter_dirs(path)` was backwards).
This just removes it since it is no longer valid.
2021-01-25 12:39:46 -08:00
Anders Kaseorg
b05788e859 libtest: Store pending timeouts in a deque
This reduces the total complexity of checking timeouts from quadratic
to linear, and should also fix an unwrap of None on completion of an
already timed-out test.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-01-25 12:21:33 -08:00
Felix S. Klock II
4c5ede7c6a This should address issue 81294.
(No test added. The relevant test *is* ui/panic-handler/weak-lang-item.rs, and this change should make it less flaky.)
2021-01-25 14:37:27 -05:00
bors
f4eb5d9f71 Auto merge of #68828 - oli-obk:inline_cycle, r=wesleywiser
Prevent query cycles in the MIR inliner

r? `@eddyb` `@wesleywiser`

cc `@rust-lang/wg-mir-opt`

The general design is that we have a new query that is run on the `validated_mir` instead of on the `optimized_mir`. That query is forced before going into the optimization pipeline, so as to not try to read from a stolen MIR.

The query should not be cached cross crate, as you should never call it for items from other crates. By its very design calls into other crates can never cause query cycles.

This is a pessimistic approach to inlining, since we strictly have more calls in the `validated_mir` than we have in `optimized_mir`, but that's not a problem imo.
2021-01-25 19:03:37 +00:00
Eric Huss
1c0a52d304 rustdoc: Document CommonMark extensions. 2021-01-25 11:03:15 -08:00
bors
7fba12bb1d Auto merge of #81375 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/81341
Cc `@rust-lang/miri` r? `@ghost`
2021-01-25 15:33:17 +00:00