]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #82711 - notriddle:string-cow-docs, r=Mark-Simulacrum
Mara Bos [Mon, 8 Mar 2021 19:08:56 +0000 (20:08 +0100)]
Rollup merge of #82711 - notriddle:string-cow-docs, r=Mark-Simulacrum

Add documentation for string->Cow conversions

Mostly, it's just to reassure everyone that these functions don't allocate.

Part of #51430

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 8 Mar 2021 15:30:42 +0000 (17:30 +0200)]
:arrow_up: rust-analyzer

3 years agoUse Option::get_or_default
Cameron Steffen [Sat, 6 Mar 2021 22:40:45 +0000 (16:40 -0600)]
Use Option::get_or_default

3 years agoAdd Option::get_or_default
Cameron Steffen [Sat, 6 Mar 2021 22:01:34 +0000 (16:01 -0600)]
Add Option::get_or_default

3 years agoAuto merge of #82896 - Dylan-DPC:rollup-9setmme, r=Dylan-DPC
bors [Mon, 8 Mar 2021 14:59:20 +0000 (14:59 +0000)]
Auto merge of #82896 - Dylan-DPC:rollup-9setmme, r=Dylan-DPC

Rollup of 10 pull requests

Successful merges:

 - #82047 (bypass auto_da_alloc for metadata files)
 - #82415 (expand: Refactor module loading)
 - #82557 (Add natvis for Result, NonNull, CString, CStr, and Cow)
 - #82613 (Remove Item::kind, use tagged enum. Rename variants to match)
 - #82642 (Fix jemalloc usage on OSX)
 - #82682 (Implement built-in attribute macro `#[cfg_eval]` + some refactoring)
 - #82684 (Disable destination propagation on all mir-opt-levels)
 - #82755 (Refactor confirm_builtin_call, remove partial if)
 - #82857 (Edit ructc_ast_lowering docs)
 - #82862 (Generalize Write impl for Vec<u8> to Vec<u8, A>)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoUpdate library/core/src/array/mod.rs
Arnav Jindal [Mon, 8 Mar 2021 14:58:30 +0000 (20:28 +0530)]
Update library/core/src/array/mod.rs

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
3 years agoMove rustdoc UI tests into a subdirectory
Joshua Nelson [Fri, 5 Mar 2021 15:04:22 +0000 (10:04 -0500)]
Move rustdoc UI tests into a subdirectory

This also adds a little leeway to the test limit.

3 years ago[.mailmap] Add entry for Ramkumar Ramachandra
Ramkumar Ramachandra [Mon, 8 Mar 2021 12:40:35 +0000 (13:40 +0100)]
[.mailmap] Add entry for Ramkumar Ramachandra

3 years agoRollup merge of #82862 - athre0z:generalize-vec-write-impl, r=TimDiekmann
Dylan DPC [Mon, 8 Mar 2021 12:13:27 +0000 (13:13 +0100)]
Rollup merge of #82862 - athre0z:generalize-vec-write-impl, r=TimDiekmann

Generalize Write impl for Vec<u8> to Vec<u8, A>

As discussed in the [issue tracker for the wg-allocators working group][1], updating this impl for allocator support was most likely just forgotten previously. This PR fixes this.

r? `````@TimDiekmann`````

[1]: https://github.com/rust-lang/wg-allocators/issues/86

3 years agoRollup merge of #82857 - pierwill:edit-ast-lowering-lib, r=Dylan-DPC
Dylan DPC [Mon, 8 Mar 2021 12:13:26 +0000 (13:13 +0100)]
Rollup merge of #82857 - pierwill:edit-ast-lowering-lib, r=Dylan-DPC

Edit ructc_ast_lowering docs

Fixes some punctuation and formatting; also makes some small wording changes.

3 years agoRollup merge of #82755 - osa1:confirm_builtin_call_refactor, r=petrochenkov
Dylan DPC [Mon, 8 Mar 2021 12:13:25 +0000 (13:13 +0100)]
Rollup merge of #82755 - osa1:confirm_builtin_call_refactor, r=petrochenkov

Refactor confirm_builtin_call, remove partial if

Pass callee expr to `confirm_builtin_call`. This removes a partial
pattern match in `confirm_builtin_call` and the `panic` in the `else`
branch. The diff is large because of indentation changes caused by
removing the if-let.

3 years agoRollup merge of #82684 - tmiasko:dest-prop, r=jonas-schievink
Dylan DPC [Mon, 8 Mar 2021 12:13:24 +0000 (13:13 +0100)]
Rollup merge of #82684 - tmiasko:dest-prop, r=jonas-schievink

Disable destination propagation on all mir-opt-levels

The new `// compile-flags: -Zunsound-mir-opts` are inserted without an extra newline to avoid introducing a large mir-opt diff.

3 years agoRollup merge of #82682 - petrochenkov:cfgeval, r=Aaron1011
Dylan DPC [Mon, 8 Mar 2021 12:13:23 +0000 (13:13 +0100)]
Rollup merge of #82682 - petrochenkov:cfgeval, r=Aaron1011

Implement built-in attribute macro `#[cfg_eval]` + some refactoring

This PR implements a built-in attribute macro `#[cfg_eval]` as it was suggested in https://github.com/rust-lang/rust/pull/79078 to avoid `#[derive()]` without arguments being abused as a way to configure input for other attributes.

The macro is used for eagerly expanding all `#[cfg]` and `#[cfg_attr]` attributes in its input ("fully configuring" the input).
The effect is identical to effect of `#[derive(Foo, Bar)]` which also fully configures its input before passing it to macros `Foo` and `Bar`, but unlike `#[derive]` `#[cfg_eval]` can be applied to any syntax nodes supporting macro attributes, not only certain items.

`cfg_eval` was the first name suggested in https://github.com/rust-lang/rust/pull/79078, but other alternatives are also possible, e.g. `cfg_expand`.

```rust
#[cfg_eval]
#[my_attr] // Receives `struct S {}` as input, the field is configured away by `#[cfg_eval]`
struct S {
    #[cfg(FALSE)]
    field: u8,
}
```

Tracking issue: https://github.com/rust-lang/rust/issues/82679

3 years agoRollup merge of #82642 - sfackler:jemalloc-zone, r=pnkfelix
Dylan DPC [Mon, 8 Mar 2021 12:13:22 +0000 (13:13 +0100)]
Rollup merge of #82642 - sfackler:jemalloc-zone, r=pnkfelix

Fix jemalloc usage on OSX

Closes #82423

3 years agoRollup merge of #82613 - CraftSpider:fix-de, r=aDotInTheVoid
Dylan DPC [Mon, 8 Mar 2021 12:13:21 +0000 (13:13 +0100)]
Rollup merge of #82613 - CraftSpider:fix-de, r=aDotInTheVoid

Remove Item::kind, use tagged enum. Rename variants to match

Fixes #82299, by making the ItemEnum tagged. Doesn't remove ItemKind as it's still used in other places.

r? `````@jyn514`````
`````@rustbot````` label: +A-rustdoc-json +T-rustdoc

3 years agoRollup merge of #82557 - rylev:natvis-improvements, r=varkor
Dylan DPC [Mon, 8 Mar 2021 12:13:20 +0000 (13:13 +0100)]
Rollup merge of #82557 - rylev:natvis-improvements, r=varkor

Add natvis for Result, NonNull, CString, CStr, and Cow

This adds natvis support (used for Windows debugging) to the following types: `Result`, `NonNull`, `CString`, `CStr`, and `Cow`.

3 years agoRollup merge of #82415 - petrochenkov:modin3, r=davidtwco
Dylan DPC [Mon, 8 Mar 2021 12:13:19 +0000 (13:13 +0100)]
Rollup merge of #82415 - petrochenkov:modin3, r=davidtwco

expand: Refactor module loading

This is an accompanying PR to https://github.com/rust-lang/rust/pull/82399, but they can be landed independently.
See individual commits for more details.

Anyone should be able to review this equally well because all people actually familiar with this code left the project.

3 years agoRollup merge of #82047 - the8472:fast-rename, r=davidtwco
Dylan DPC [Mon, 8 Mar 2021 12:13:18 +0000 (13:13 +0100)]
Rollup merge of #82047 - the8472:fast-rename, r=davidtwco

bypass auto_da_alloc for metadata files

This saves about 0.7% when rerunning the UI test suite. I.e. when the metadata files exist and will be overwritten. No improvements expected for a clean build. So it might show up in incr-patched perf results.
```
regular rename:

Benchmark #1: touch src/tools/compiletest/src/main.rs ; RUSTC_WRAPPER="" schedtool -B -e ./x.py test src/test/ui
  Time (mean ± σ):     47.305 s ±  0.170 s    [User: 1631.540 s, System: 412.648 s]
  Range (min … max):   47.125 s … 47.856 s    20 runs

non-durable rename:

Benchmark #1: touch src/tools/compiletest/src/main.rs ; RUSTC_WRAPPER="" schedtool -B -e ./x.py test src/test/ui
  Time (mean ± σ):     46.930 s ±  0.064 s    [User: 1634.344 s, System: 396.038 s]
  Range (min … max):   46.759 s … 47.043 s    20 runs
```

There are more places that trigger auto_da_alloc behavior by overwriting existing files with O_TRUNC, but those are much harder to locate because `O_TRUNC` is set on `open()` but the writeback is triggered on `close()`. The latter is the part which shows up in profiles.

3 years agoAuto merge of #82783 - nikic:llvm-ct-backports, r=nagisa
bors [Mon, 8 Mar 2021 11:39:32 +0000 (11:39 +0000)]
Auto merge of #82783 - nikic:llvm-ct-backports, r=nagisa

Backport some LLVM compile-time improvements

Pick up two LLVM patches that reduce number of alias analysis queries, to see whether that gives any visible improvement.

r? `@ghost`

3 years agoAuto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
bors [Mon, 8 Mar 2021 08:39:24 +0000 (08:39 +0000)]
Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix

Test the effect of shrinking the size of Rvalue by 16 bytes

r? `@ghost`

3 years agoGrammar Fixes
Arnav Jindal [Mon, 8 Mar 2021 06:19:26 +0000 (11:49 +0530)]
Grammar Fixes

3 years agoAdd documentation for string->Cow conversions
Michael Howell [Tue, 2 Mar 2021 23:37:50 +0000 (16:37 -0700)]
Add documentation for string->Cow conversions

Mostly, it's just to reassure everyone that these functions don't allocate.

Part of #51430

3 years agoAuto merge of #81635 - michaelwoerister:structured_def_path_hash, r=pnkfelix
bors [Sun, 7 Mar 2021 23:45:57 +0000 (23:45 +0000)]
Auto merge of #81635 - michaelwoerister:structured_def_path_hash, r=pnkfelix

Let a portion of DefPathHash uniquely identify the DefPath's crate.

This allows to directly map from a `DefPathHash` to the crate it originates from, without constructing side tables to do that mapping -- something that is useful for incremental compilation where we deal with `DefPathHash` instead of `DefId` a lot.

It also allows to reliably and cheaply check for `DefPathHash` collisions which allows the compiler to gracefully abort compilation instead of running into a subsequent ICE at some random place in the code.

The following new piece of documentation describes the most interesting aspects of the changes:

```rust
/// A `DefPathHash` is a fixed-size representation of a `DefPath` that is
/// stable across crate and compilation session boundaries. It consists of two
/// separate 64-bit hashes. The first uniquely identifies the crate this
/// `DefPathHash` originates from (see [StableCrateId]), and the second
/// uniquely identifies the corresponding `DefPath` within that crate. Together
/// they form a unique identifier within an entire crate graph.
///
/// There is a very small chance of hash collisions, which would mean that two
/// different `DefPath`s map to the same `DefPathHash`. Proceeding compilation
/// with such a hash collision would very probably lead to an ICE and, in the
/// worst case, to a silent mis-compilation. The compiler therefore actively
/// and exhaustively checks for such hash collisions and aborts compilation if
/// it finds one.
///
/// `DefPathHash` uses 64-bit hashes for both the crate-id part and the
/// crate-internal part, even though it is likely that there are many more
/// `LocalDefId`s in a single crate than there are individual crates in a crate
/// graph. Since we use the same number of bits in both cases, the collision
/// probability for the crate-local part will be quite a bit higher (though
/// still very small).
///
/// This imbalance is not by accident: A hash collision in the
/// crate-local part of a `DefPathHash` will be detected and reported while
/// compiling the crate in question. Such a collision does not depend on
/// outside factors and can be easily fixed by the crate maintainer (e.g. by
/// renaming the item in question or by bumping the crate version in a harmless
/// way).
///
/// A collision between crate-id hashes on the other hand is harder to fix
/// because it depends on the set of crates in the entire crate graph of a
/// compilation session. Again, using the same crate with a different version
/// number would fix the issue with a high probability -- but that might be
/// easier said then done if the crates in questions are dependencies of
/// third-party crates.
///
/// That being said, given a high quality hash function, the collision
/// probabilities in question are very small. For example, for a big crate like
/// `rustc_middle` (with ~50000 `LocalDefId`s as of the time of writing) there
/// is a probability of roughly 1 in 14,750,000,000 of a crate-internal
/// collision occurring. For a big crate graph with 1000 crates in it, there is
/// a probability of 1 in 36,890,000,000,000 of a `StableCrateId` collision.
```

Given the probabilities involved I hope that no one will ever actually see the error messages. Nonetheless, I'd be glad about some feedback on how to improve them. Should we create a GH issue describing the problem and possible solutions to point to? Or a page in the rustc book?

r? `@pnkfelix` (feel free to re-assign)

3 years agoUpdate Cargo
Aaron Hill [Sun, 7 Mar 2021 23:39:19 +0000 (18:39 -0500)]
Update Cargo

Output of `git log --oneline  c68432f1e..970bc67c3`:

970bc67c3 (HEAD, origin/master, origin/auto-cargo, origin/HEAD) Auto merge of #9243 - wickerwaka:configurable-env-doc, r=ehuss
4d7a29b75 Document the configurable-env usntable option
f7a7a3f91 Auto merge of #9229 - alexcrichton:fix-borrow-mut, r=ehuss
3f2ece7a9 Fix a `BorrowMut` error when stdout is closed
7441e8c23 Auto merge of #8825 - Aaron1011:feature/report-future-incompat, r=ehuss
139ed73f5 Add future-incompat tracking issue number.
9ea350368 Fix some minor formatting issues.
f03d47ce4 Address review comments
6177c6584 Implement future incompatibility report support
c69409658 Auto merge of #9022 - nagisa:nagisa/manifest_path, r=alexcrichton
548300b20 Add the path to the manifest in json output
99e714c05 Auto merge of #9230 - kornelski:nobinaries, r=alexcrichton
61a31bc5f Auto merge of #9236 - kornelski:track-assert, r=Eh2406
3f7f0942c track_caller on custom assert functions
6977dee10 Explain `cargo install` is not for libraries
e4aebf0a0 Auto merge of #9231 - joshtriplett:clear-to-eol-if-color, r=alexcrichton
b219f0eb7 Auto merge of #9181 - jyn514:computer-says-no, r=ehuss
0b1816578 Remove unhelpful link to Cargo book
ea46f5ce3 Use ANSI clear-to-EOL if color is force-enabled
a6394bcc1 Remove unnecessary `config` argument to `Features::add`
3a86ecf2d Fix TODO about nightly features
09677c83c Be less unix-centric in error messages
ecfdced0d Fix test that assumed tests always were run on the stable channel
eba541994 Update comment in build_script_env
a5720117f Make `nightly_features_allowed` a field instead of a function
169b09ce7 Compute `enable_nightly_features` once instead of on each call
8fc86e155 Remove unused thread_locals
4b096beae Fix `masquerade_as_nightly_cargo` in work threads
e56417c8c Suggest RUSTC_BOOTSTRAP=crate instead of RUSTC_BOOTSTRAP=1
418129dae Downgrade error to a warning when `RUSTC_BOOTSTRAP` is set or this is the nightly channel
6c422a2c0 Restrict RUSTC_BOOTSTRAP in build.rs

3 years agodiagnostics: Don't mention external crates when hitting import errors on crate import...
Manish Goregaokar [Sun, 7 Mar 2021 22:51:35 +0000 (14:51 -0800)]
diagnostics: Don't mention external crates when hitting import errors on crate imports in 2018

3 years agoRemove notes, increase S/N ratio
Esteban Küber [Sun, 7 Mar 2021 23:03:46 +0000 (15:03 -0800)]
Remove notes, increase S/N ratio

3 years agoadd codegen tests for some issues closed by LLVM 12
Erik Desjardins [Sun, 7 Mar 2021 19:03:35 +0000 (14:03 -0500)]
add codegen tests for some issues closed by LLVM 12

3 years agoAdd help for `matches` for `if let` in arm guard
Esteban Küber [Sun, 7 Mar 2021 22:44:21 +0000 (14:44 -0800)]
Add help for `matches` for `if let` in arm guard

3 years agodiagnostics: Differentiate between edition meanings of ::foo in resolve diagnostics...
Manish Goregaokar [Sun, 7 Mar 2021 22:19:50 +0000 (14:19 -0800)]
diagnostics: Differentiate between edition meanings of ::foo in resolve diagnostics for ::foo::Bar

3 years agodiagnostics: Differentiate between edition meanings of ::foo in resolve diagnostics...
Manish Goregaokar [Sun, 7 Mar 2021 21:53:45 +0000 (13:53 -0800)]
diagnostics: Differentiate between edition meanings of ::foo in resolve diagnostics (for bare `::foo`)

3 years agoAdd help suggesting `matches` to `let_chains` lint
Esteban Küber [Sun, 7 Mar 2021 22:05:52 +0000 (14:05 -0800)]
Add help suggesting `matches` to `let_chains` lint

3 years agoAccount for `if (let pat = expr) {}`
Esteban Küber [Sun, 7 Mar 2021 02:29:41 +0000 (18:29 -0800)]
Account for `if (let pat = expr) {}`

Partially address #82827.

3 years agoAuto merge of #82285 - nhwn:nonzero-debug, r=nagisa
bors [Sun, 7 Mar 2021 20:23:23 +0000 (20:23 +0000)]
Auto merge of #82285 - nhwn:nonzero-debug, r=nagisa

Use u32 over Option<u32> in DebugLoc

~~Changes `Option<u32>` fields in `DebugLoc` to `Option<NonZeroU32>`. Since the respective fields (`line` and `col`) are guaranteed to be 1-based, this layout optimization is a freebie.~~

EDIT: Changes `Option<u32>` fields in `DebugLoc` to `u32`. As `@bugadani` pointed out, an `Option<NonZeroU32>` is probably an unnecessary layer of abstraction since the `None` variant is always used as `UNKNOWN_LINE_NUMBER` (which is just `0`).  Also, `SourceInfo` in `metadata.rs` already uses a `u32` instead of an `Option<u32>` to encode the same information, so I think this change is warranted.

Since `@jyn514` raised some concerns over measuring performance in a similar PR (#82255), does this need a perf run?

3 years agoAdd note about the `#[doc(no-inline)]` usage
Julian Frimmel [Sun, 7 Mar 2021 09:52:35 +0000 (10:52 +0100)]
Add note about the `#[doc(no-inline)]` usage

This is required to correctly build the documentation (including all
submodules, that are only available in certain targets).

3 years agoRevert "use RWlock when accessing os::env #81850"
Eric Huss [Sun, 7 Mar 2021 19:32:42 +0000 (11:32 -0800)]
Revert "use RWlock when accessing os::env #81850"

This reverts commit 354f19cf2475148994954b6783341620c7445071, reversing
changes made to 0cfba2fd090834c909d5ed9deccdee8170da791b.

3 years agoGeneralize Write impl for Vec<u8> to Vec<u8, A>
Joel Höner [Sun, 7 Mar 2021 15:22:53 +0000 (16:22 +0100)]
Generalize Write impl for Vec<u8> to Vec<u8, A>

As discussed in the issue tracker for the wg-allocators working group[1], updating this implementation for allocator support was most likely just forgotten in the original PR.

[1]: https://github.com/rust-lang/wg-allocators/issues/86

3 years agoEdit ructc_ast_lowering docs
pierwill [Sun, 7 Mar 2021 06:07:38 +0000 (22:07 -0800)]
Edit ructc_ast_lowering docs

Fixes some punctuation and formatting; also makes some small wording changes.

3 years agoAuto merge of #82851 - JohnTitor:rollup-me5ko8g, r=JohnTitor
bors [Sun, 7 Mar 2021 02:36:07 +0000 (02:36 +0000)]
Auto merge of #82851 - JohnTitor:rollup-me5ko8g, r=JohnTitor

Rollup of 13 pull requests

Successful merges:

 - #77916 (Change built-in kernel targets to be os = none throughout)
 - #82130 (Make some Option, Result methods unstably const)
 - #82292 (Prevent specialized ZipImpl from calling `__iterator_get_unchecked` twice with the same index)
 - #82402 (Remove RefCell around `module_trait_cache`)
 - #82592 (Improve transmute docs with further clarifications)
 - #82651 (Cleanup rustdoc warnings)
 - #82720 (Fix diagnostic suggests adding type `[type error]`)
 - #82751 (improve offset_from docs)
 - #82793 (Move some tests to more suitable subdirs)
 - #82803 (rustdoc: Add an unstable option to print all unversioned files)
 - #82808 (Sync rustc_codegen_cranelift)
 - #82822 (Fix typo)
 - #82837 (tweak MaybeUninit docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #82837 - RalfJung:maybe-uninit, r=dtolnay
Yuki Okushi [Sun, 7 Mar 2021 01:41:22 +0000 (10:41 +0900)]
Rollup merge of #82837 - RalfJung:maybe-uninit, r=dtolnay

tweak MaybeUninit docs

Explain what "(no) fixed value" means.

3 years agoRollup merge of #82822 - henryboisdequin:fix-typo-rustc, r=oli-obk
Yuki Okushi [Sun, 7 Mar 2021 01:41:20 +0000 (10:41 +0900)]
Rollup merge of #82822 - henryboisdequin:fix-typo-rustc, r=oli-obk

Fix typo

we need to actually -> we actually need to

````@rustbot```` label +C-cleanup

3 years agoRollup merge of #82808 - bjorn3:sync_cg_clif-2021-03-05, r=bjorn3
Yuki Okushi [Sun, 7 Mar 2021 01:41:19 +0000 (10:41 +0900)]
Rollup merge of #82808 - bjorn3:sync_cg_clif-2021-03-05, r=bjorn3

Sync rustc_codegen_cranelift

The main highlight of this sync is removal of support for the old x86 Cranelift backend. This made it possible to use native atomic instructions rather than hackishly using a global mutex. 128bit integer support has also seen a few bugfixes and performance improvements. And finally I have formatted everything using the same rustfmt config as the rest of this repo.

r? ````@ghost````

````@rustbot```` label +A-codegen +A-cranelift +T-compiler

3 years agoRollup merge of #82803 - jyn514:unversioned-files, r=GuillaumeGomez
Yuki Okushi [Sun, 7 Mar 2021 01:41:18 +0000 (10:41 +0900)]
Rollup merge of #82803 - jyn514:unversioned-files, r=GuillaumeGomez

rustdoc: Add an unstable option to print all unversioned files

This allows sharing those files between different doc invocations
without having to know their names ahead of time.

Helps with https://github.com/rust-lang/docs.rs/issues/1302.
r? ````@GuillaumeGomez```` cc ````@pietroalbini```` ````@Nemo157````

3 years agoRollup merge of #82793 - JohnTitor:move-ui-tests, r=petrochenkov
Yuki Okushi [Sun, 7 Mar 2021 01:41:17 +0000 (10:41 +0900)]
Rollup merge of #82793 - JohnTitor:move-ui-tests, r=petrochenkov

Move some tests to more suitable subdirs

## The results from classifui

(The full results can be found here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427)

- [lint-expr-stmt-attrs-for-early-lints.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/lint-expr-stmt-attrs-for-early-lints.rs) <sup>unknown</sup>: lint (1.566), feature-gates (-0.632), numbers-arithmetic (-0.955)
- [try-block.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/try-block.rs) <sup>unknown</sup>: binding (1.385), try-block (-0.097), lint (-0.932)
- [backtrace-debuginfo.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/backtrace-debuginfo.rs) <sup>unknown</sup>: macros (1.365), cfg (-0.279), drop (-0.291)
- [issues/issue-3521.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3521.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/3521)</sup>: consts (1.298), enum (-0.872), in-band-lifetimes (-0.978)
- [impl-bounds-checking.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-bounds-checking.rs) <sup>unknown</sup>: traits (1.243), for (-0.999), shadowed (-0.999)
- [issues/issue-17718.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17718.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/17718)</sup>: binding (1.236), consts (0.315), extern (-0.779)
- [issue-6157.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-6157.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/6157)</sup>: regions (1.213), unboxed-closures (-0.285), traits (-0.510)
- [issues/issue-44373.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-44373.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/44373)</sup>: consts (1.187), nll (0.427), borrowck (-0.704)
- [nullable-pointer-ffi-compat.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/nullable-pointer-ffi-compat.rs) <sup>unknown</sup>: regions (1.184), consts (0.650), traits (-0.571)
- [issues/issue-52992.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52992.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52992)</sup>: nll (1.132), associated-types (-0.628), parser (-0.893)
- [issues/issue-2330.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2330.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2330)</sup>: traits (1.116), directory_ownership (-0.691), compare-method (-0.981)
- [issue-74047.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-74047.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/74047)</sup>: async-await (1.109), impl-trait (-0.629), resolve (-0.781)
- [issues/issue-33140.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/33140)</sup>: traits (1.063), coherence (-0.832), codemap_tests (-0.944)
- [issues/issue-28576.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-28576.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/28576)</sup>: traits (1.062), associated-types (-0.333), impl-trait (-0.697)
- [issues/issue-7222.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7222.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/7222)</sup>: binding (1.062), consts (-0.226), numbers-arithmetic (-0.294)
- [tup.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/tup.rs) <sup>unknown</sup>: structs-enums (1.061), threads-sendsync (-0.550), moves (-0.790)
- [issues/issue-15261.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-15261.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/15261)</sup>: consts (1.052), where-clauses (-0.833), macros (-0.862)
- [issues/issue-76179.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-76179.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/76179)</sup>: associated-types (1.048), process (-0.887), rfc-2457 (-0.984)
- [issues/issue-42344.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-42344.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/42344)</sup>: borrowck (1.043), macros (-0.481), specialization (-0.966)
- [issues/issue-18661.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18661.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/18661)</sup>: unboxed-closures (1.038), mir (-0.648), higher-rank-trait-bounds (-0.688)
- [issues/issue-2633.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2633.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2633)</sup>: structs-enums (1.020), functions-closures (-0.722), lint (-0.967)

Some notes:
- If there are related tests (e.g. it's for the same issue), they are moved along with it.
- Moved try-block.rs to the `try-block` dir.
- Moved tup.rs to the `tuple` dir.
- Moved some tests that classified as consts to the `statics` dir, as it seems they have statics actually.
- Skipped backtrace-debuginfo.rs because I think classifui overrates their helper macros.

cc #73494
r? ```@petrochenkov```

3 years agoRollup merge of #82751 - RalfJung:offset_from, r=dtolnay
Yuki Okushi [Sun, 7 Mar 2021 01:41:16 +0000 (10:41 +0900)]
Rollup merge of #82751 - RalfJung:offset_from, r=dtolnay

improve offset_from docs

`@thomcc` pointed out that the current docs leave it kind of unclear how one can satisfy the "no wrapping around `isize` or the address space" requirement of `offset_from`, so make the docs clearer about that.

FWIW, I don't think I entirely agree with that second paragraph about large objects (that I left mostly unchanged here). LLVM, to my knowledge, fundamentally assumes that all allocations fit into an `isize::MAX`. So in that sense creating a larger allocation is simply UB. I would expect a guarantee that Rust heap allocation methods will never return allocations larger than `isize::MAX` (or rather, Rust heap allocation methods should require that the `Layout` is no larger than `isize::MAX`). However, I cannot find any such requirement documented currently. Large allocations are not mentioned at all in the allocator docs, which is quite surprising -- even if we say that such allocations are not insta-UB (which I think is incompatible with LLVM), they are still extremely footgunny since `ptr::offset`/`ptr::add` do not support offsetting by more than `isize::MAX` bytes.

Furthermore, the allocator docs don't even say anything about allocations wrapping around the address space. But that is certainly something allocators must ensure never happens; we cannot expect clients to defend against this.

Cc `@rust-lang/wg-allocators`

3 years agoRollup merge of #82720 - henryboisdequin:fix-79040, r=oli-obk
Yuki Okushi [Sun, 7 Mar 2021 01:41:15 +0000 (10:41 +0900)]
Rollup merge of #82720 - henryboisdequin:fix-79040, r=oli-obk

Fix diagnostic suggests adding type `[type error]`

Fixes #79040

### Unresolved questions:

<del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks `````@oli-obk`````

3 years agoRollup merge of #82651 - jyn514:rustdoc-warnings, r=GuillaumeGomez
Yuki Okushi [Sun, 7 Mar 2021 01:41:13 +0000 (10:41 +0900)]
Rollup merge of #82651 - jyn514:rustdoc-warnings, r=GuillaumeGomez

Cleanup rustdoc warnings

## Clean up error reporting for deprecated passes

Using `error!` here goes all the way back to the original commit, https://github.com/rust-lang/rust/pull/8540. I don't see any reason to use logging; rustdoc should use diagnostics wherever possible. See https://github.com/rust-lang/rust/pull/81932#issuecomment-785291244 for further context.

- Use spans for deprecated attributes
- Use a proper diagnostic for unknown passes, instead of error logging
- Add tests for unknown passes
- Improve some wording in diagnostics

##  Report that `doc(plugins)` doesn't work using diagnostics instead of `eprintln!`

This also adds a test for the output.

This was added in https://github.com/rust-lang/rust/pull/52194. I don't see any particular reason not to use diagnostics here, I think it was just missed in https://github.com/rust-lang/rust/pull/50541.

3 years agoRollup merge of #82592 - Lonami:patch-1, r=RalfJung
Yuki Okushi [Sun, 7 Mar 2021 01:41:12 +0000 (10:41 +0900)]
Rollup merge of #82592 - Lonami:patch-1, r=RalfJung

Improve transmute docs with further clarifications

Closes #82493.

Please let me know if any of the new wording sounds off, English is not my mother tongue.

3 years agoRollup merge of #82402 - jyn514:module-cache-refcell, r=GuillaumeGomez
Yuki Okushi [Sun, 7 Mar 2021 01:41:11 +0000 (10:41 +0900)]
Rollup merge of #82402 - jyn514:module-cache-refcell, r=GuillaumeGomez

Remove RefCell around `module_trait_cache`

This builds on https://github.com/rust-lang/rust/pull/82018 and should not be merged before.

## Don't require a `DocContext` for `report_diagnostic`

This is needed for the next commit, which needs mutable access to the `cx` from
within the `decorate` closure.

- Change `as_local_hir_id` to an associated function, since it only
  needs a `TyCtxt`
- Change `source_span_for_markdown_range` to only take a `TyCtxt`

##  Remove RefCell around module_trait_cache

This is mostly just changing lots of functions from `&DocContext` to `&mut DocContext`.

3 years agoRollup merge of #82292 - SkiFire13:fix-issue-82291, r=m-ou-se
Yuki Okushi [Sun, 7 Mar 2021 01:41:10 +0000 (10:41 +0900)]
Rollup merge of #82292 - SkiFire13:fix-issue-82291, r=m-ou-se

Prevent specialized ZipImpl from calling `__iterator_get_unchecked` twice with the same index

Fixes #82291

It's open for review, but conflicts with #82289, wait before merging. The conflict involves only the new test, so it should be rather trivial to fix.

3 years agoRollup merge of #82130 - jhpratt:const-option-result, r=RalfJung
Yuki Okushi [Sun, 7 Mar 2021 01:41:09 +0000 (10:41 +0900)]
Rollup merge of #82130 - jhpratt:const-option-result, r=RalfJung

Make some Option, Result methods unstably const

The following methods are now unstably const:

- Option::transpose
- Option::flatten
- Result::flatten

While some methods for could likely be made `const` in the future, nearly all of them require something to be dropped at compile-time, which isn't currently supported. The functions listed above should have a trivial path to stabilization.

3 years agoRollup merge of #77916 - QuiltOS:kernel-code-targets-os-none, r=joshtriplett
Yuki Okushi [Sun, 7 Mar 2021 01:41:04 +0000 (10:41 +0900)]
Rollup merge of #77916 - QuiltOS:kernel-code-targets-os-none, r=joshtriplett

Change built-in kernel targets to be os = none throughout

Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the
OS-related have fields have been for code running *on* that OS, not code
hat is *part* of the OS.

The difference is huge, as syscall interfaces are nothing like
freestanding interfaces. Kernels are (hypervisors and other more exotic
situations aside) freestanding programs that use the interfaces provided
by the hardware. It's *those* interfaces, the ones external to the
program being built and its software dependencies, that are the content
of the target.

For the Linux Kernel in particular, `target_env: "gnu"` is removed for
the same reason: that `-gnu` refers to glibc or GNU/linux, neither of
which applies to the kernel itself.

Relates to #74247

3 years agorustc_builtin_macros: Share some more logic between `derive` and `cfg_eval`
Vadim Petrochenkov [Sat, 6 Mar 2021 22:11:21 +0000 (01:11 +0300)]
rustc_builtin_macros: Share some more logic between `derive` and `cfg_eval`

3 years agocfg_eval: Configure everything through mutable visitor methods
Vadim Petrochenkov [Sat, 6 Mar 2021 21:18:51 +0000 (00:18 +0300)]
cfg_eval: Configure everything through mutable visitor methods

This is simpler and mirrors what invocation collector does

3 years agoMove full configuration logic from `rustc_expand` to `rustc_builtin_macros`
Vadim Petrochenkov [Sat, 6 Mar 2021 20:37:59 +0000 (23:37 +0300)]
Move full configuration logic from `rustc_expand` to `rustc_builtin_macros`

This logic is applicable to two specific macros and not to the expansion infrastructure in general.

3 years agoAuto merge of #82738 - estebank:tail-expr-check-is-too-slow, r=oli-obk
bors [Sat, 6 Mar 2021 21:02:53 +0000 (21:02 +0000)]
Auto merge of #82738 - estebank:tail-expr-check-is-too-slow, r=oli-obk

Move check only relevant in error case out of critical path

Move the check for potentially forgotten `return` in a tail expression
of arbitrary expressions into the coercion error branch to avoid
computing unncessary coercion checks on successful code.

Follow up to #81458.

3 years agoRevert fmt version, add rustdoc-json-types to bootstrap tests
Rune Tynan [Sat, 6 Mar 2021 20:37:07 +0000 (15:37 -0500)]
Revert fmt version, add rustdoc-json-types to bootstrap tests

3 years agox.py fmt
Rune Tynan [Fri, 5 Mar 2021 00:44:09 +0000 (19:44 -0500)]
x.py fmt

3 years agoMove tests to own file
Rune Tynan [Fri, 5 Mar 2021 00:08:06 +0000 (19:08 -0500)]
Move tests to own file

3 years agoAdd roundtrip testing and bump format version
Rune Tynan [Thu, 4 Mar 2021 23:45:57 +0000 (18:45 -0500)]
Add roundtrip testing and bump format version

3 years agoRemove Item::kind, use tagged enum. Rename variants to match
Rune Tynan [Sun, 28 Feb 2021 00:44:17 +0000 (19:44 -0500)]
Remove Item::kind, use tagged enum. Rename variants to match

3 years agoImplement built-in attribute macro `#[cfg_eval]`
Vadim Petrochenkov [Sat, 6 Mar 2021 18:33:02 +0000 (21:33 +0300)]
Implement built-in attribute macro `#[cfg_eval]`

3 years agoMake some Option, Result methods unstably const
Jacob Pratt [Mon, 15 Feb 2021 03:11:46 +0000 (22:11 -0500)]
Make some Option, Result methods unstably const

The following functions are now unstably const:

- Option::transpose
- Option::flatten
- Result::transpose

3 years agorustc_ast: Replace `AstLike::finalize_tokens` with a getter `tokens_mut`
Vadim Petrochenkov [Sat, 6 Mar 2021 18:06:01 +0000 (21:06 +0300)]
rustc_ast: Replace `AstLike::finalize_tokens` with a getter `tokens_mut`

3 years agoChange x64 size checks to not apply to x32.
Harald van Dijk [Sat, 6 Mar 2021 16:02:48 +0000 (16:02 +0000)]
Change x64 size checks to not apply to x32.

Rust contains various size checks conditional on target_arch = "x86_64",
but these checks were never intended to apply to
x86_64-unknown-linux-gnux32. Add target_pointer_width = "64" to the
conditions.

3 years agotweak MaybeUninit docs
Ralf Jung [Sat, 6 Mar 2021 15:59:39 +0000 (16:59 +0100)]
tweak MaybeUninit docs

3 years agoImprove transmute docs with further clarifications
Lonami [Sat, 27 Feb 2021 15:16:41 +0000 (16:16 +0100)]
Improve transmute docs with further clarifications

Closes #82493.

3 years agoMove some tests to more suitable subdirs
Yuki Okushi [Fri, 5 Mar 2021 09:34:12 +0000 (18:34 +0900)]
Move some tests to more suitable subdirs

3 years agoHandle negative literals in cast overflow warning
Yuki Okushi [Sat, 6 Mar 2021 08:32:47 +0000 (17:32 +0900)]
Handle negative literals in cast overflow warning

3 years agoUndo addition of boxes
Camelid [Tue, 2 Mar 2021 04:06:49 +0000 (20:06 -0800)]
Undo addition of boxes

I don't think the boxing helped performance, in fact I think it
potentially made it worse. The data was still being copied, but now it
was through a pointer. Thinking about it more, I think boxing might only
help when you're passing a big object around by value all the time,
rather than the slowdown being that you're cloning it.

3 years agoFix typo
Henry Boisdequin [Sat, 6 Mar 2021 03:46:29 +0000 (09:16 +0530)]
Fix typo

we need to actually -> we actually need to

@rustbot label +C-cleanup

3 years agoDon't unnecessarily clone some fields in `Context`
Camelid [Tue, 2 Mar 2021 03:12:03 +0000 (19:12 -0800)]
Don't unnecessarily clone some fields in `Context`

There was no need to clone `id_map` because it was reset before each
item was rendered. `deref_id_map` was not reset, but it was keyed by
`DefId` and thus was unlikely to have collisions (at least for now).

Now we just clone the fields that need to be cloned, and instead create
fresh versions of the others.

3 years agoBox some fields to reduce `Context` size
Camelid [Tue, 2 Mar 2021 00:30:58 +0000 (16:30 -0800)]
Box some fields to reduce `Context` size

Reduced from 152 bytes to 88 bytes.

3 years agoDon't share `id_map` and `deref_id_map`
Camelid [Mon, 22 Feb 2021 23:43:43 +0000 (15:43 -0800)]
Don't share `id_map` and `deref_id_map`

All the tests passed, so it doesn't seem they need to be shared.
Plus they should be item/page-specific.

I'm not sure why they were shared before. I think the reason `id_map`
worked as a shared value before is that it is cleared before rendering
each item (in `render_item`). And then I'm guessing `deref_id_map`
worked because it's a hashmap keyed by `DefId`, so there was no overlap
(though I'm guessing we could have had issues in the future).

Note that `id_map` currently still has to be cleared because otherwise
child items would inherit the `id_map` of their parent. I'm hoping to
figure out a way to stop cloning `Context`, but until then we have to
reset `id_map`.

3 years agorustdoc: Add static size assertion for `Context`
Camelid [Mon, 22 Feb 2021 01:19:43 +0000 (17:19 -0800)]
rustdoc: Add static size assertion for `Context`

It's cloned a lot, so we don't want it to grow in size unexpectedly.

Only run the assert on x86-64 since the size is architecture-dependent.

3 years agorustdoc: Make a bunch of fields private
Camelid [Sun, 21 Feb 2021 22:35:15 +0000 (14:35 -0800)]
rustdoc: Make a bunch of fields private

Also create issue for removing shared mutable state.

3 years agoaddress comments
Henry Boisdequin [Wed, 3 Mar 2021 11:39:40 +0000 (17:09 +0530)]
address comments

3 years agorustdoc: Replace `Arc` around `SharedContext` with `Rc`
Camelid [Sun, 21 Feb 2021 22:25:21 +0000 (14:25 -0800)]
rustdoc: Replace `Arc` around `SharedContext` with `Rc`

It doesn't look like it's shared across threads, so it doesn't need to
be thread-safe. Of course, since we're using Rust, we'll get an error if
we try to share it across threads, so this should be safe :)

3 years agorustdoc: Move most shared fields to `SharedContext`
Camelid [Sun, 21 Feb 2021 22:21:43 +0000 (14:21 -0800)]
rustdoc: Move most shared fields to `SharedContext`

...and remove `Rc`s for the moved fields.

The only shared one that I didn't move was `cache`; see the doc-comment
I added to `cache` for details.

3 years agoDisable destination propagation on all mir-opt-levels
Tomasz Miąsko [Sat, 6 Mar 2021 00:00:00 +0000 (00:00 +0000)]
Disable destination propagation on all mir-opt-levels

3 years agoAuto merge of #82816 - GuillaumeGomez:rollup-hxohu2e, r=GuillaumeGomez
bors [Fri, 5 Mar 2021 23:16:04 +0000 (23:16 +0000)]
Auto merge of #82816 - GuillaumeGomez:rollup-hxohu2e, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #80845 (Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to make transition over hir::ItemKind simpler)
 - #82708 (Warn on `#![doc(test(...))]` on items other than the crate root and use future incompatible lint)
 - #82714 (Detect match arm body without braces)
 - #82736 (Bump optimization from mir_opt_level 2 to 3 and 3 to 4 and make "release" be level 2 by default)
 - #82782 (Make rustc shim's verbose output include crate_name being compiled.)
 - #82797 (Update tests names to start with `issue-`)
 - #82809 (rustdoc: Use substrings instead of split to grab enum variant paths)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #82809 - notriddle:microoptimize-main-js, r=GuillaumeGomez
Guillaume Gomez [Fri, 5 Mar 2021 20:44:44 +0000 (21:44 +0100)]
Rollup merge of #82809 - notriddle:microoptimize-main-js, r=GuillaumeGomez

rustdoc: Use substrings instead of split to grab enum variant paths

Both versions are about equally readable, but this version avoids scanning the entire path and building an intermediate array (`split()` in Rust is a lazy iterator, but not in JavaScript).

3 years agoRollup merge of #82797 - henryboisdequin:name-issue-num, r=Xanewok
Guillaume Gomez [Fri, 5 Mar 2021 20:44:42 +0000 (21:44 +0100)]
Rollup merge of #82797 - henryboisdequin:name-issue-num, r=Xanewok

Update tests names to start with `issue-`

See ``@JohnTitor's`` [comment](https://github.com/rust-lang/rust/pull/82720#discussion_r586488083)

``@rustbot`` label +C-cleanup

3 years agoRollup merge of #82782 - pnkfelix:include-crate-being-compiled-in-bootstrap-verbose...
Guillaume Gomez [Fri, 5 Mar 2021 20:44:41 +0000 (21:44 +0100)]
Rollup merge of #82782 - pnkfelix:include-crate-being-compiled-in-bootstrap-verbose-output, r=Mark-Simulacrum

Make rustc shim's verbose output include crate_name being compiled.

This change is mainly motivated by an issue with the environment printing I added in PR 82403: multiple rustc invocations progress in parallel, and the environment output, spanning multiple lines, gets interleaved in ways make it difficult to extra the enviroment settings.

(This aforementioned difficulty is more of a hiccup than an outright show-stopper, because the environment variables tend to be the same for all of the rustc invocations, so it doesn't matter too much if one mixes up which lines one is looking at. But still: Better to fix it.)

3 years agoRollup merge of #82736 - spastorino:mir-opt-level-perf-changes, r=oli-obk
Guillaume Gomez [Fri, 5 Mar 2021 20:44:40 +0000 (21:44 +0100)]
Rollup merge of #82736 - spastorino:mir-opt-level-perf-changes, r=oli-obk

Bump optimization from mir_opt_level 2 to 3 and 3 to 4 and make "release" be level 2 by default

r? `@oli-obk`

3 years agoRollup merge of #82714 - estebank:missing-braces, r=oli-obk
Guillaume Gomez [Fri, 5 Mar 2021 20:44:39 +0000 (21:44 +0100)]
Rollup merge of #82714 - estebank:missing-braces, r=oli-obk

Detect match arm body without braces

Fix #82524.

3 years agoRollup merge of #82708 - GuillaumeGomez:doc-test-attr-check, r=Manishearth
Guillaume Gomez [Fri, 5 Mar 2021 20:44:38 +0000 (21:44 +0100)]
Rollup merge of #82708 - GuillaumeGomez:doc-test-attr-check, r=Manishearth

Warn on `#![doc(test(...))]` on items other than the crate root and use future incompatible lint

Part of #82672.

This PR does multiple things:
 * Create a new `INVALID_DOC_ATTRIBUTE` lint which is also "future incompatible", allowing us to use it as a warning for the moment until it turns (eventually) into a hard error.
 * Use this link when `#![doc(test(...))]` isn't used at the crate level.
 * Make #82702 use this new lint as well.

r? ``@jyn514``

3 years agoRollup merge of #80845 - GuillaumeGomez:item-kind-transition, r=jyn514
Guillaume Gomez [Fri, 5 Mar 2021 20:44:37 +0000 (21:44 +0100)]
Rollup merge of #80845 - GuillaumeGomez:item-kind-transition, r=jyn514

Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to make transition over hir::ItemKind simpler

It was surprisingly difficult to make this change, mostly because of two issues:

* We now store the `ExternCrate` name in the parent struct (`clean::Item`), which forced me to modify the json conversion code a bit more than expected.
* The second problem was that, since we now have a `Some(name)`, it was trying to render it, ending up in a panic because we ended up in a `unreachable` statement. The solution was simply to add `!item.is_extern_crate()` in `formats::renderer` before calling `cx.item(item, &cache)?;`.

I'll continue to replace all the `clean::ItemKind` variants one by one until it looks exactly like `hir::ItemKind`. Then we'll simply discard the rustdoc type. Once this done, we'll be able to discard `clean::Item` too to use `hir::Item`.

r? ``@jyn514``

3 years agobless mir-inlining warning message
Santiago Pastorino [Fri, 5 Mar 2021 20:40:34 +0000 (17:40 -0300)]
bless mir-inlining warning message

3 years agoAdd an unstable option to print all unversioned files
Joshua Nelson [Fri, 5 Mar 2021 15:54:37 +0000 (10:54 -0500)]
Add an unstable option to print all unversioned files

This allows sharing those files between different doc invocations
without having to know their names ahead of time.

3 years agoUpdate minifier dependency version
Guillaume Gomez [Thu, 4 Mar 2021 16:35:11 +0000 (17:35 +0100)]
Update minifier dependency version

3 years agoFix MIR optimization level description
Santiago Pastorino [Fri, 5 Mar 2021 00:11:28 +0000 (21:11 -0300)]
Fix MIR optimization level description

3 years agoBump one missing mir_opt_level
Santiago Pastorino [Thu, 4 Mar 2021 14:15:49 +0000 (11:15 -0300)]
Bump one missing mir_opt_level

3 years agoFix rustc_driver self text and bump the mir_opt_level
Santiago Pastorino [Thu, 4 Mar 2021 14:13:39 +0000 (11:13 -0300)]
Fix rustc_driver self text and bump the mir_opt_level

3 years agoBump mir-opt-level from 2 to 3 in tests
Santiago Pastorino [Thu, 4 Mar 2021 13:35:11 +0000 (10:35 -0300)]
Bump mir-opt-level from 2 to 3 in tests

3 years agoBump mir-opt-level from 3 to 4 in tests
Santiago Pastorino [Thu, 4 Mar 2021 13:21:13 +0000 (10:21 -0300)]
Bump mir-opt-level from 3 to 4 in tests

3 years agoMake clippy set mir_opt_level using Option
Santiago Pastorino [Thu, 4 Mar 2021 02:33:18 +0000 (23:33 -0300)]
Make clippy set mir_opt_level using Option

3 years agoMake mir_opt_level default to 2 for optimized levels
Santiago Pastorino [Wed, 3 Mar 2021 22:45:33 +0000 (19:45 -0300)]
Make mir_opt_level default to 2 for optimized levels

3 years agoBump all mir_opt_level 2 to 3
Santiago Pastorino [Wed, 3 Mar 2021 21:56:00 +0000 (18:56 -0300)]
Bump all mir_opt_level 2 to 3

3 years agoBump all mir_opt_level 3 to 4
Santiago Pastorino [Wed, 3 Mar 2021 21:30:42 +0000 (18:30 -0300)]
Bump all mir_opt_level 3 to 4

3 years agoFor better consistency change mir_opt_level <= 1 to < 2
Santiago Pastorino [Wed, 3 Mar 2021 22:41:04 +0000 (19:41 -0300)]
For better consistency change mir_opt_level <= 1 to < 2