]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd an error in case the doc alias is the same as the item it's aliasing
Guillaume Gomez [Mon, 4 Jan 2021 14:05:36 +0000 (15:05 +0100)]
Add an error in case the doc alias is the same as the item it's aliasing

3 years agoAuto merge of #80610 - Aaron1011:unhash-def-path-hash, r=varkor
bors [Mon, 4 Jan 2021 07:49:01 +0000 (07:49 +0000)]
Auto merge of #80610 - Aaron1011:unhash-def-path-hash, r=varkor

Use `UnhashMap` whenever we have a key of `DefPathHash`

3 years agoAuto merge of #80554 - GuillaumeGomez:more-js-cleanup, r=jyn514
bors [Mon, 4 Jan 2021 05:04:04 +0000 (05:04 +0000)]
Auto merge of #80554 - GuillaumeGomez:more-js-cleanup, r=jyn514

More js cleanup

Part of #79052 (Same kind as #80515).

This one is about some small fixes:
 * Replacing some loops with `onEachLazy`.
 * Removing unused function arguments.
 * Turn `buildHelperPopup` into a variable so it can be "replaced" once the function has been called once so it's not called again.

r? `@jyn514`

3 years agoAuto merge of #80418 - oli-obk:this_could_have_been_so_simple, r=RalfJung
bors [Mon, 4 Jan 2021 02:15:57 +0000 (02:15 +0000)]
Auto merge of #80418 - oli-obk:this_could_have_been_so_simple, r=RalfJung

Allow references to interior mutable data behind a feature gate

supercedes #80373 by simply not checking for interior mutability on borrows of locals that have `StorageDead` and thus can never be leaked to the final value of the constant

tracking issue: https://github.com/rust-lang/rust/issues/80384

r? `@RalfJung`

3 years agoAuto merge of #77859 - bugadani:no-duplicate-ref-link-error, r=jyn514
bors [Sun, 3 Jan 2021 20:24:16 +0000 (20:24 +0000)]
Auto merge of #77859 - bugadani:no-duplicate-ref-link-error, r=jyn514

Rustdoc: only report broken ref-style links once

This PR assigns the markdown `LinkType` to each parsed link and passes this information into the link collector.
If a link can't be resolved in `resolve_with_disambiguator`, the failure is cached for the link types where we only want to report the error once (namely `Shortcut` and `Reference`).

Fixes  #77681

3 years agoAuto merge of #80655 - GuillaumeGomez:rollup-ai7soid, r=GuillaumeGomez
bors [Sun, 3 Jan 2021 17:42:27 +0000 (17:42 +0000)]
Auto merge of #80655 - GuillaumeGomez:rollup-ai7soid, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #80580 (Add suggestion for "ignore" doc code block)
 - #80591 (remove allow(incomplete_features) from std)
 - #80617 (Detect invalid rustdoc test commands)
 - #80628 (reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats))
 - #80646 (Clean up in `each_child_of_item`)

Failed merges:

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

3 years agoOnly report reference-style link errors once
Dániel Buga [Mon, 12 Oct 2020 14:52:20 +0000 (16:52 +0200)]
Only report reference-style link errors once

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoRollup merge of #80646 - bugadani:meta, r=petrochenkov
Guillaume Gomez [Sun, 3 Jan 2021 16:09:13 +0000 (17:09 +0100)]
Rollup merge of #80646 - bugadani:meta, r=petrochenkov

Clean up in `each_child_of_item`

This PR hopes to eliminate some of the surprising elements I encountered while reading the function.
- `macros_only` is checked against inside the loop body, but if it is `true`, the loop is skipped anyway
- only query `span` when relevant
- no need to allocate attribute vector

3 years agoRollup merge of #80628 - matthiaskrgr:match_ref_pats, r=varkor
Guillaume Gomez [Sun, 3 Jan 2021 16:09:11 +0000 (17:09 +0100)]
Rollup merge of #80628 - matthiaskrgr:match_ref_pats, r=varkor

reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)

3 years agoRollup merge of #80617 - GuillaumeGomez:detect-invalid-rustdoc-test-commands, r=jyn514
Guillaume Gomez [Sun, 3 Jan 2021 16:09:09 +0000 (17:09 +0100)]
Rollup merge of #80617 - GuillaumeGomez:detect-invalid-rustdoc-test-commands, r=jyn514

Detect invalid rustdoc test commands

Fixes #80570.

There are now errors displayed in case of bad command syntax:

```
---- [rustdoc] rustdoc/remove-url-from-headings.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python" "/home/imperio/rust/rust/src/etc/htmldocck.py" "/home/imperio/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc/remove-url-from-headings" "/home/imperio/rust/rust/src/test/rustdoc/remove-url-from-headings.rs"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
3: Invalid command: `!`@has`,` (try with ``@!has`)`
// !`@has` - '//a[`@href="http://a.a"]'`

Encountered 1 errors
```

r? `@camelid`

3 years agoRollup merge of #80591 - lcnr:incomplete-features, r=RalfJung
Guillaume Gomez [Sun, 3 Jan 2021 16:09:08 +0000 (17:09 +0100)]
Rollup merge of #80591 - lcnr:incomplete-features, r=RalfJung

remove allow(incomplete_features) from std

cc https://github.com/rust-lang/rust/pull/80349#issuecomment-753357123

> Now I am somewhat concerned that the standard library uses some of these features...

I think it is theoretically ok to use incomplete features in the standard library or the compiler if we know that there is an already working subset and we explicitly document what we have to be careful about. Though at that point it is probably better to try and split the incomplete feature into two separate ones, similar to `min_specialization`.

Will be interesting once `feature(const_evaluatable_checked)` works well enough to imo be used in the compiler but not yet well enough to be removed from `INCOMPLETE_FEATURES`.

r? `@RalfJung`

3 years agoRollup merge of #80580 - GuillaumeGomez:suggestion-ignore-codeblock-warn, r=jyn514
Guillaume Gomez [Sun, 3 Jan 2021 16:09:01 +0000 (17:09 +0100)]
Rollup merge of #80580 - GuillaumeGomez:suggestion-ignore-codeblock-warn, r=jyn514

Add suggestion for "ignore" doc code block

Part of https://github.com/rust-lang/rust/issues/30032.

This PR adds a suggestion to help users when they have a "ignore" doc code block which is invalid rust code.

r? `@jyn514`

3 years agoStylistic fixes to diagnostic messages
oli [Sun, 3 Jan 2021 15:11:34 +0000 (15:11 +0000)]
Stylistic fixes to diagnostic messages

3 years agoRefactor the non-transient cell borrow error diagnostic
oli [Sun, 3 Jan 2021 14:46:19 +0000 (14:46 +0000)]
Refactor the non-transient cell borrow error diagnostic

3 years agoDangling pointers point to everything and nothing
Oli Scherer [Sun, 3 Jan 2021 14:19:07 +0000 (15:19 +0100)]
Dangling pointers point to everything and nothing

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoGrammar fixes
Oli Scherer [Sun, 3 Jan 2021 14:15:23 +0000 (15:15 +0100)]
Grammar fixes

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoInline resetMouseMoved function directly into "mousemove" event handler
Guillaume Gomez [Thu, 31 Dec 2020 12:21:50 +0000 (13:21 +0100)]
Inline resetMouseMoved function directly into "mousemove" event handler

3 years agoReplace some loops with "onEachLazy" call
Guillaume Gomez [Thu, 31 Dec 2020 12:21:27 +0000 (13:21 +0100)]
Replace some loops with "onEachLazy" call

3 years agoCreate a "is_ignore" variable instead of doing the comparison multiple times
Guillaume Gomez [Sun, 3 Jan 2021 13:56:56 +0000 (14:56 +0100)]
Create a "is_ignore" variable instead of doing the comparison multiple times

3 years agoUpdate now-more-precise operation with a preciser message
oli [Sun, 3 Jan 2021 13:45:16 +0000 (13:45 +0000)]
Update now-more-precise operation with a preciser message

3 years agoApply suggestions from code review
Oli Scherer [Sun, 3 Jan 2021 13:20:51 +0000 (14:20 +0100)]
Apply suggestions from code review

comment nits

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoMove variable into condition where it's used
Dániel Buga [Sun, 3 Jan 2021 11:50:29 +0000 (12:50 +0100)]
Move variable into condition where it's used

3 years agoNo need to collect result of get_item_attrs
Dániel Buga [Sun, 3 Jan 2021 11:49:53 +0000 (12:49 +0100)]
No need to collect result of get_item_attrs

3 years agoDetect invalid rustdoc test commands
Guillaume Gomez [Sat, 2 Jan 2021 13:11:19 +0000 (14:11 +0100)]
Detect invalid rustdoc test commands

3 years agoAuto merge of #80590 - camelid:bool-never-docs, r=nagisa
bors [Sun, 3 Jan 2021 12:21:12 +0000 (12:21 +0000)]
Auto merge of #80590 - camelid:bool-never-docs, r=nagisa

Update `bool` and `!` docs

3 years agoClean up convoluted macros_only logic
Dániel Buga [Sun, 3 Jan 2021 11:47:38 +0000 (12:47 +0100)]
Clean up convoluted macros_only logic

3 years agoAuto merge of #80247 - tmiasko:indent, r=bjorn3
bors [Sun, 3 Jan 2021 09:16:24 +0000 (09:16 +0000)]
Auto merge of #80247 - tmiasko:indent, r=bjorn3

Fix indentation of -Z meta-stats output

3 years agoAuto merge of #80261 - GuillaumeGomez:attr-rework, r=jyn514
bors [Sun, 3 Jan 2021 06:29:42 +0000 (06:29 +0000)]
Auto merge of #80261 - GuillaumeGomez:attr-rework, r=jyn514

rustdoc DocFragment rework

Kind of a follow-up of #80119.

A few things are happening in this PR. I'm not sure about the impact on perf though so I'm very interested about that too (if the perf is worse, then we can just close this PR).

The idea here is mostly about reducing the memory usage by relying even more on `Symbol` instead of `String`. The only issue is that `DocFragment` has 3 modifications performed on it:
 1. Unindenting
 2. Collapsing similar comments into one
 3. "Beautifying" (weird JS-like comments handling).

To do so, I saved the information about unindent and the "collapse" is now on-demand (which is why I'm not sure the perf will be better, it has to be run multiple times...).

r? `@jyn514`

3 years agoAuto merge of #79827 - tmiasko:size-align, r=kennytm
bors [Sun, 3 Jan 2021 03:43:29 +0000 (03:43 +0000)]
Auto merge of #79827 - tmiasko:size-align, r=kennytm

Describe why `size_align` have not been inlined so far

although it is used only in one place.

3 years agoAuto merge of #80623 - flip1995:clippyup, r=Manishearth
bors [Sun, 3 Jan 2021 00:55:26 +0000 (00:55 +0000)]
Auto merge of #80623 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy update.

This includes a Cargo.lock update for the recent Clippy version bump.

r? `@Manishearth`

3 years agoAuto merge of #80592 - Skynoodle:snake-case-lint-reserved-identifier, r=davidtwco
bors [Sat, 2 Jan 2021 22:06:17 +0000 (22:06 +0000)]
Auto merge of #80592 - Skynoodle:snake-case-lint-reserved-identifier, r=davidtwco

Suggest renaming or escaping when fixing non-snake-case identifiers which would conflict with keywords

Fixes #80575

3 years agoreduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)
Matthias Krüger [Sat, 2 Jan 2021 19:09:17 +0000 (20:09 +0100)]
reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)

3 years agoSimplify docfragment transformation in unindent tests
Guillaume Gomez [Sun, 27 Dec 2020 22:57:45 +0000 (23:57 +0100)]
Simplify docfragment transformation in unindent tests

3 years agoRemove unused collapse pass
Guillaume Gomez [Sat, 26 Dec 2020 13:22:08 +0000 (14:22 +0100)]
Remove unused collapse pass

3 years agoImprove code for DocFragment rework
Guillaume Gomez [Sat, 26 Dec 2020 13:03:33 +0000 (14:03 +0100)]
Improve code for DocFragment rework

3 years agoAuto merge of #80412 - GuillaumeGomez:fix-search-section-pos, r=jyn514
bors [Sat, 2 Jan 2021 18:13:48 +0000 (18:13 +0000)]
Auto merge of #80412 - GuillaumeGomez:fix-search-section-pos, r=jyn514

Fix search section position on small devices

Fixes #79526.

This is exactly the same issue fixed in 9c36491538476dd3ff5ec834944aacdaceb12f30 (in https://github.com/rust-lang/rust/pull/79936) but applied to the search section. When the width becomes too small, the search input goes on its own line to get more space, making it go "under" the section following (so either "main" or "search"). The fix is to simply make the section go more under so that it doesn't go over the search input.

r? `@jyn514`

3 years agoUse bootstrap rustc for versioncheck in Clippy
flip1995 [Sat, 2 Jan 2021 17:01:42 +0000 (18:01 +0100)]
Use bootstrap rustc for versioncheck in Clippy

3 years agoUpdate rustdoc-ui test output
Guillaume Gomez [Mon, 21 Dec 2020 20:03:19 +0000 (21:03 +0100)]
Update rustdoc-ui test output

3 years agoEnd of rework of Attributes struct
Guillaume Gomez [Sat, 19 Dec 2020 14:04:42 +0000 (15:04 +0100)]
End of rework of Attributes struct

3 years agoRework DocFragment
Guillaume Gomez [Sat, 19 Dec 2020 13:21:00 +0000 (14:21 +0100)]
Rework DocFragment

3 years agoUpdate Cargo.lock
flip1995 [Sat, 2 Jan 2021 15:47:58 +0000 (16:47 +0100)]
Update Cargo.lock

3 years agoAdd snake case lint note about keyword identifiers which cannot be raw
Skynoodle [Sat, 2 Jan 2021 15:46:41 +0000 (15:46 +0000)]
Add snake case lint note about keyword identifiers which cannot be raw

3 years agoAuto merge of #80550 - bugadani:markdown-refactor, r=jyn514
bors [Sat, 2 Jan 2021 15:31:53 +0000 (15:31 +0000)]
Auto merge of #80550 - bugadani:markdown-refactor, r=jyn514

Cleanup markdown span handling, take 2

This PR includes the cleanups made in #80244 except for the removal of `locate()`.

While the biggest conceptual part in #80244 was the removal of `locate()`, it introduced a diagnostic regression.

Additional cleanup:
 - Use `RefCell` to avoid building two separate vectors for the links

Work to do:
- [ ] Decide if `locate()` can be simplified by assuming `s` is always in `md`
- [ ] Should probably add some tests that still provide the undesired diagnostics causing #80381

cc `@jyn514` This is the best I can do without patching Pulldown to provide multiple ranges for reference-style links. Also, since `locate` is probably more efficient than `rfind` (at least it's constant time), I decided to not check the link type and just cover every &str as it was before.

3 years agoMerge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyup
flip1995 [Sat, 2 Jan 2021 15:29:43 +0000 (16:29 +0100)]
Merge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyup

3 years agoAuto merge of #6536 - flip1995:rustup, r=flip1995
bors [Sat, 2 Jan 2021 15:28:08 +0000 (15:28 +0000)]
Auto merge of #6536 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoBump Clippy version to 0.1.51
flip1995 [Sat, 2 Jan 2021 15:26:10 +0000 (16:26 +0100)]
Bump Clippy version to 0.1.51

3 years agoUse rustc --version in versioncheck
flip1995 [Sat, 2 Jan 2021 15:20:43 +0000 (16:20 +0100)]
Use rustc --version in versioncheck

3 years agoBump nightly version to 2021-01-02
flip1995 [Sat, 2 Jan 2021 15:05:54 +0000 (16:05 +0100)]
Bump nightly version to 2021-01-02

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Sat, 2 Jan 2021 15:03:26 +0000 (16:03 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #6530 - m-ou-se:2021, r=phansch
bors [Sat, 2 Jan 2021 13:12:15 +0000 (13:12 +0000)]
Auto merge of #6530 - m-ou-se:2021, r=phansch

Initial support for Rust 2021.

Clippy treated Rust 2021 as Rust 2015, because 2018 was checked with `==` instead of `>=`. This fixes that, such that 2018-specific things are also enabled for 2021.

changelog: Added support for Rust 2021.

3 years agoAuto merge of #80615 - m-ou-se:rollup-xz67at2, r=m-ou-se
bors [Sat, 2 Jan 2021 12:40:32 +0000 (12:40 +0000)]
Auto merge of #80615 - m-ou-se:rollup-xz67at2, r=m-ou-se

Rollup of 6 pull requests

Successful merges:

 - #80546 (clippy fixes for librustdoc)
 - #80555 (Improve library tracking issue template)
 - #80574 (Clean bootstrap artifacts on `x.py clean`)
 - #80578 (improve unconditional_panic description)
 - #80599 (`const_generics_defaults`: don't ICE in the unimplemented parts)
 - #80613 (Diag: print enum variant instead of enum type)

Failed merges:

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

3 years agoRollup merge of #80613 - bugadani:issue-80607, r=matthewjasper
Mara Bos [Sat, 2 Jan 2021 11:29:15 +0000 (11:29 +0000)]
Rollup merge of #80613 - bugadani:issue-80607, r=matthewjasper

Diag: print enum variant instead of enum type

Closes #80607

3 years agoRollup merge of #80599 - lqd:issue_805889, r=varkor
Mara Bos [Sat, 2 Jan 2021 11:29:14 +0000 (11:29 +0000)]
Rollup merge of #80599 - lqd:issue_805889, r=varkor

`const_generics_defaults`: don't ICE in the unimplemented parts

The thought was that we could use `todo!`s to ensure we wouldn't forget to implement parts of the experimental gate.

However, that can also lead to a suboptimal experience for users as shown in #80589 having both the error/warning about the experimental feature, and the ICE.

Fixes #80589

r? `@varkor`

3 years agoRollup merge of #80578 - RalfJung:panic-lint-description, r=lcnr
Mara Bos [Sat, 2 Jan 2021 11:29:12 +0000 (11:29 +0000)]
Rollup merge of #80578 - RalfJung:panic-lint-description, r=lcnr

improve unconditional_panic description

The fact that the lint is triggered by the ConstProp pass is an implementation detail, I do not think that this should be mentioned in the description.

Cc `@oli-obk` `@ehuss`

3 years agoRollup merge of #80574 - jyn514:clean-bootstrap, r=Mark-Simulacrum
Mara Bos [Sat, 2 Jan 2021 11:29:10 +0000 (11:29 +0000)]
Rollup merge of #80574 - jyn514:clean-bootstrap, r=Mark-Simulacrum

Clean bootstrap artifacts on `x.py clean`

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

r? `@Mark-Simulacrum`

3 years agoRollup merge of #80555 - rust-lang:libs-tracking-issue, r=KodrAus
Mara Bos [Sat, 2 Jan 2021 11:29:09 +0000 (11:29 +0000)]
Rollup merge of #80555 - rust-lang:libs-tracking-issue, r=KodrAus

Improve library tracking issue template

r? `@KodrAus`

3 years agoRollup merge of #80546 - matthiaskrgr:rustdoclippy, r=LingMan
Mara Bos [Sat, 2 Jan 2021 11:29:07 +0000 (11:29 +0000)]
Rollup merge of #80546 - matthiaskrgr:rustdoclippy, r=LingMan

clippy fixes for librustdoc

fixes clippy warnings of type:
match_like_matches_macro
or_fun_call
op_ref
needless_return
let_and_return
single_char_add_str
useless_format
unnecessary_sort_by
match_ref_pats
redundant_field_names

3 years agoPrint actual enum variant
Dániel Buga [Sat, 2 Jan 2021 10:06:30 +0000 (11:06 +0100)]
Print actual enum variant

3 years agoAdd test for #80607 with undesired output
Dániel Buga [Sat, 2 Jan 2021 09:58:50 +0000 (10:58 +0100)]
Add test for #80607 with undesired output

3 years agoAuto merge of #80115 - tgnottingham:specialize_opaque_u8_sequences, r=oli-obk
bors [Sat, 2 Jan 2021 09:52:26 +0000 (09:52 +0000)]
Auto merge of #80115 - tgnottingham:specialize_opaque_u8_sequences, r=oli-obk

rustc_serialize: specialize opaque encoding and decoding of some u8 sequences

This specializes encoding and decoding of some contiguous u8 sequences to use a more efficient implementation. The default implementations process each u8 individually, but that isn't necessary for the opaque encoder and decoder. The opaque encoding for u8s is a no-op, so we can just copy entire sequences as-is, rather than process them byte by byte.

This also changes some encode and decode implementations for contiguous sequences to forward to the slice and vector implementations, so that they can take advantage of the new specialization when applicable.

3 years agoOnly use locate for borrowed strings
Dániel Buga [Thu, 31 Dec 2020 09:38:12 +0000 (10:38 +0100)]
Only use locate for borrowed strings

3 years agoAuto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmaster
bors [Sat, 2 Jan 2021 06:58:59 +0000 (06:58 +0000)]
Auto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmaster

Enable ASan, TSan, UBSan for aarch64-apple-darwin.

I confirmed ASan, TSan, UBSan all work for me locally with `clang` on my new Macbook Air.

~This requires https://github.com/rust-lang/llvm-project/pull/86~

3 years agorustc_serialize: specialize opaque decoding of some u8 sequences
Tyson Nottingham [Thu, 17 Dec 2020 05:03:45 +0000 (21:03 -0800)]
rustc_serialize: specialize opaque decoding of some u8 sequences

3 years agorustc_serialize: have read_raw_bytes take MaybeUninit<u8> slice
Tyson Nottingham [Thu, 17 Dec 2020 03:46:19 +0000 (19:46 -0800)]
rustc_serialize: have read_raw_bytes take MaybeUninit<u8> slice

3 years agorustc_serialize: specialize opaque encoding of some u8 sequences
Tyson Nottingham [Thu, 17 Dec 2020 03:03:31 +0000 (19:03 -0800)]
rustc_serialize: specialize opaque encoding of some u8 sequences

3 years agoUse `UnhashMap` whenever we have a key of `DefPathHash`
Aaron Hill [Sat, 2 Jan 2021 04:51:07 +0000 (23:51 -0500)]
Use `UnhashMap` whenever we have a key of `DefPathHash`

3 years agoAuto merge of #79870 - sharnoff:smart-pointer-Any-type_id, r=shepmaster
bors [Sat, 2 Jan 2021 04:12:48 +0000 (04:12 +0000)]
Auto merge of #79870 - sharnoff:smart-pointer-Any-type_id, r=shepmaster

Add docs note about `Any::type_id` on smart pointers

Fixes #79868.

There's an issue I've run into a couple times while using values of type `Box<dyn Any>` - essentially, calling `value.type_id()` doesn't dereference to the trait object, but uses the implementation of `Any` for `Box<dyn Any>`, giving us the `TypeId` of the container instead of the object inside it.

I couldn't find any notes about this in the documentation and - while it could be inferred from existing knowledge of Rust and the blanket implemenation of `Any` - I think it'd be nice to have a note about it in the documentation for the `any` module.

Anyways, here's a first draft of a section about it. I'm happy to revise wording :)

3 years agoalways demands -> requires
Camelid [Sat, 2 Jan 2021 02:55:01 +0000 (18:55 -0800)]
always demands -> requires

3 years agoAuto merge of #77832 - camelid:remove-manual-link-resolves, r=jyn514
bors [Sat, 2 Jan 2021 01:31:03 +0000 (01:31 +0000)]
Auto merge of #77832 - camelid:remove-manual-link-resolves, r=jyn514

Remove many unnecessary manual link resolves from library

Now that #76934 has merged, we can remove a lot of these! E.g, this is
no longer necessary:

    [`Vec<T>`]: Vec

cc `@jyn514`

3 years agoAuto merge of #80581 - jyn514:ci-llvm, r=Mark-Simulacrum
bors [Fri, 1 Jan 2021 22:44:52 +0000 (22:44 +0000)]
Auto merge of #80581 - jyn514:ci-llvm, r=Mark-Simulacrum

Give a better error for download-ci-llvm if .xz is not supported

Previously:

```
curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmp6ptXJV https://ci-artifacts.rust-lang.org/rustc-builds/99ad5a1a2824fea1ecf60068fd3636beae7ea2da/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```

Now:

```
error: XZ support is required to download LLVM
help: consider disabling `download-ci-llvm` or using a different version of python
Build completed unsuccessfully in 0:00:00
```

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

r? `@Mark-Simulacrum`

3 years agoconst_generics_defaults: don't use todo
Rémy Rakic [Fri, 1 Jan 2021 21:35:56 +0000 (22:35 +0100)]
const_generics_defaults: don't use todo

So that at least it won't ICE for users whether or not they enable the gate. For developers the FIXMEs are enough.

3 years agoclippy fixes for librustdoc
Matthias Krüger [Thu, 31 Dec 2020 01:49:44 +0000 (02:49 +0100)]
clippy fixes for librustdoc

fixes clippy warnings of type:
match_like_matches_macro
or_fun_call
op_ref
needless_return
let_and_return
single_char_add_str
useless_format
unnecessary_sort_by
match_ref_pats
redundant_field_names

3 years agoAuto merge of #80569 - notriddle:patch-3, r=jyn514
bors [Fri, 1 Jan 2021 20:01:45 +0000 (20:01 +0000)]
Auto merge of #80569 - notriddle:patch-3, r=jyn514

Use Array.prototype.filter instead of open-coding

Part of #79052, originally suggested in https://github.com/rust-lang/rust/pull/79052#discussion_r523468743 by `@jyn514`

Besides making main.js smaller (always a plus), this also performs better by using the optimized filter implementation in your browser's JavaScript engine (according to `@GuillaumeGomez,` an 84% performance improvement).

3 years agoremove incomplete features from std
Bastian Kauschke [Fri, 1 Jan 2021 18:37:58 +0000 (19:37 +0100)]
remove incomplete features from std

3 years agoBless ui tests
oli [Fri, 1 Jan 2021 18:45:44 +0000 (18:45 +0000)]
Bless ui tests

3 years agoAdd suggestion to use raw identifiers when fixing snake-case lints
Skynoodle [Fri, 1 Jan 2021 18:34:20 +0000 (18:34 +0000)]
Add suggestion to use raw identifiers when fixing snake-case lints

3 years agoAdd reserved identifier test cases for snake case lint
Skynoodle [Fri, 1 Jan 2021 18:20:56 +0000 (18:20 +0000)]
Add reserved identifier test cases for snake case lint

3 years agoUpdate `bool` and `!` docs
Camelid [Fri, 1 Jan 2021 18:09:56 +0000 (10:09 -0800)]
Update `bool` and `!` docs

3 years agoDon't mix feature gates and hard errors, decide on one per op and stick with it
oli [Wed, 30 Dec 2020 17:44:11 +0000 (17:44 +0000)]
Don't mix feature gates and hard errors, decide on one per op and stick with it

3 years agoReinstate the error-code error over the feature gate error
oli [Wed, 30 Dec 2020 17:20:38 +0000 (17:20 +0000)]
Reinstate the error-code error over the feature gate error

3 years agoEnhance some comments
oli [Wed, 30 Dec 2020 16:48:07 +0000 (16:48 +0000)]
Enhance some comments

3 years agoFix cell checks in const fn
oli [Mon, 28 Dec 2020 01:09:55 +0000 (01:09 +0000)]
Fix cell checks in const fn

3 years agoThe proper name for the rule is "enclosing scope"
oli [Sun, 27 Dec 2020 23:59:00 +0000 (23:59 +0000)]
The proper name for the rule is "enclosing scope"

3 years agoAllow references to interior mutable data behind a feature gate
oli [Sun, 27 Dec 2020 17:33:56 +0000 (17:33 +0000)]
Allow references to interior mutable data behind a feature gate

3 years agoAuto merge of #80565 - camelid:fix-not-has, r=GuillaumeGomez
bors [Fri, 1 Jan 2021 16:12:27 +0000 (16:12 +0000)]
Auto merge of #80565 - camelid:fix-not-has, r=GuillaumeGomez

Fix tests that incorrectly used `!@has` instead of `@!has`

The command is ``@!has`,` not `!`@has`.` I don't think these checks were
doing anything before! Ideally we would accept `!`@has`` as well, or at
least fail tests that use `!`@has`.` The current behavior seems to be
silently ignoring the check, which is very confusing.

r? `@GuillaumeGomez`

3 years agoGive a better error for download-ci-llvm if .xz is not supported
Joshua Nelson [Fri, 1 Jan 2021 15:22:25 +0000 (10:22 -0500)]
Give a better error for download-ci-llvm if .xz is not supported

Previously:

```
curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmp6ptXJV https://ci-artifacts.rust-lang.org/rustc-builds/99ad5a1a2824fea1ecf60068fd3636beae7ea2da/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```

Now:

```
error: XZ support is required to download LLVM
help: consider disabling `download-ci-llvm` or using a different version of python
Build completed unsuccessfully in 0:00:00
```

3 years agoAdd test for suggestion in case a "ignore" doc block has invalid rust code inside
Guillaume Gomez [Fri, 1 Jan 2021 15:05:36 +0000 (16:05 +0100)]
Add test for suggestion in case a "ignore" doc block has invalid rust code inside

3 years agoAdd suggestion in case a "ignore" doc block has invalid rust code inside
Guillaume Gomez [Fri, 1 Jan 2021 14:35:12 +0000 (15:35 +0100)]
Add suggestion in case a "ignore" doc block has invalid rust code inside

3 years agoInitial support for Rust 2021.
Mara Bos [Fri, 1 Jan 2021 15:21:31 +0000 (16:21 +0100)]
Initial support for Rust 2021.

Clippy treated Rust 2021 as Rust 2015, because 2018 was checked with
`==` instead of `>=`. This fixes that, such that 2018-specific things
are also enabled for 2021.

3 years agoimprove unconditional_panic description
Ralf Jung [Fri, 1 Jan 2021 13:44:19 +0000 (14:44 +0100)]
improve unconditional_panic description

3 years agoAuto merge of #80547 - lqd:const_generics_defaults, r=varkor
bors [Fri, 1 Jan 2021 13:17:42 +0000 (13:17 +0000)]
Auto merge of #80547 - lqd:const_generics_defaults, r=varkor

In which we start to parse const generics defaults

As discussed in this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const.20generic.20defaults), this PR extracts the parsing parts from `@JulianKnodt's` PR #75384 for a better user-experience using the newly stabilized `min_const_generics` (albeit temporary) as shown in #80507: trying to use default values on const generics currently results in parse errors, as if the user didn't use the correct syntax (which is somewhat true but also misleading).

This PR extracts (and slightly modifies in a couple places) `@JulianKnodt's` parsing code (with attribution if I've done everything correctly), AST and HIR changes, and feature gate setup.

This feature is now marked as "incomplete" and thus will also print out the expected "const generics default values are unstable" error instead of a syntax error. Note that, as I've only extracted the parsing part, the actual feature will not work at all if enabled. There will be ICEs, and inference errors on the const generics default values themselves.

Fixes #80507.

Once this merges, I'll:
- modify the const generics tracking issue to refer to the `const_generics_defaults` gate rather than the older temporary name it uses there.
- create the GH `F-const_generics_defaults` label

r? `@varkor`

3 years agoAuto merge of #80310 - Manishearth:box-try-alloc, r=kennytm
bors [Fri, 1 Jan 2021 10:29:43 +0000 (10:29 +0000)]
Auto merge of #80310 - Manishearth:box-try-alloc, r=kennytm

Add fallible Box, Arc, and Rc allocator APIs

cc https://github.com/rust-lang/rust/issues/48043

It was suggested in https://github.com/rust-lang/rust/issues/48043#issuecomment-748008486 that `Box::try_*` follows the spirit of RFC 2116. This PR is an attempt to add the relevant APIs, tied to the same feature gate. Happy to make any changes or turn this into an RFC if necessary.

cc `@rust-lang/wg-allocators`

3 years agomake `const_generics_defaults` use the unstable syntax mechanism
Rémy Rakic [Thu, 31 Dec 2020 17:32:06 +0000 (18:32 +0100)]
make `const_generics_defaults` use the unstable syntax mechanism

This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted

3 years agoadjust const generics defaults FIXMEs to the new feature gate
Rémy Rakic [Thu, 31 Dec 2020 01:50:23 +0000 (02:50 +0100)]
adjust const generics defaults FIXMEs to the new feature gate

3 years agoupdate `min_const_generics` tests using default values for const params
Rémy Rakic [Thu, 31 Dec 2020 01:04:52 +0000 (02:04 +0100)]
update `min_const_generics` tests using default values for const params

The `const_generics_defaults` now handles them, and they correctly parse, so we can update these tests expecting a parser error .

3 years agoadd test for the `const_generics_defaults` feature gate
Rémy Rakic [Thu, 31 Dec 2020 01:03:15 +0000 (02:03 +0100)]
add test for the `const_generics_defaults` feature gate

3 years agomark `const_generics_defaults` as an incomplete feature
Rémy Rakic [Thu, 31 Dec 2020 01:02:49 +0000 (02:02 +0100)]
mark `const_generics_defaults` as an incomplete feature

3 years agofix typo in feature gates file
Rémy Rakic [Thu, 31 Dec 2020 01:01:57 +0000 (02:01 +0100)]
fix typo in feature gates file

3 years agofirst pass at default values for const generics
Julian Knodt [Thu, 31 Dec 2020 00:58:27 +0000 (01:58 +0100)]
first pass at default values for const generics

- Adds optional default values to const generic parameters in the AST
  and HIR
- Parses these optional default values
- Adds a `const_generics_defaults` feature gate

3 years agofirst pass at default values for const generics
Julian Knodt [Thu, 31 Dec 2020 00:58:27 +0000 (01:58 +0100)]
first pass at default values for const generics

- Adds optional default values to const generic parameters in the AST
  and HIR
- Parses these optional default values
- Adds a `const_generics_defaults` feature gate