]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMoved `write_shared` to its own file
Nicholas-Baron [Sun, 14 Feb 2021 07:17:38 +0000 (23:17 -0800)]
Moved `write_shared` to its own file

3 years agoFix comment with path to `symbols!` macro
Mateusz Gacek [Thu, 4 Mar 2021 18:13:53 +0000 (10:13 -0800)]
Fix comment with path to `symbols!` macro

3 years agoAdd diagnostic item to `Default` trait
Mateusz Gacek [Thu, 4 Mar 2021 18:09:02 +0000 (10:09 -0800)]
Add diagnostic item to `Default` trait

Required to resolve #6562 rust-clippy issue.

3 years agoMoved the `make_item_keywords` function to `context.rs` as it is only used there
Nicholas-Baron [Sun, 14 Feb 2021 07:03:07 +0000 (23:03 -0800)]
Moved the `make_item_keywords` function to `context.rs` as it is only used there

3 years agoMoved `print_item` and helpers to a separate file
Nicholas-Baron [Sun, 14 Feb 2021 06:23:05 +0000 (22:23 -0800)]
Moved `print_item` and helpers to a separate file

3 years agoMoved Context and its impls to a separate file
Nicholas-Baron [Sun, 14 Feb 2021 05:28:34 +0000 (21:28 -0800)]
Moved Context and its impls to a separate file

3 years agoFix assert_matches doc examples.
Mara Bos [Thu, 4 Mar 2021 17:41:43 +0000 (18:41 +0100)]
Fix assert_matches doc examples.

3 years agoAdd debug_assert_matches macro.
Mara Bos [Thu, 4 Mar 2021 17:12:33 +0000 (18:12 +0100)]
Add debug_assert_matches macro.

3 years agoAllow for multiple patterns and a guard in assert_matches.
Mara Bos [Thu, 4 Mar 2021 17:07:26 +0000 (18:07 +0100)]
Allow for multiple patterns and a guard in assert_matches.

3 years agoAdd assert_matches!(expr, pat).
Mara Bos [Thu, 4 Mar 2021 16:55:23 +0000 (17:55 +0100)]
Add assert_matches!(expr, pat).

3 years agoRemove RefCell around module_trait_cache
Joshua Nelson [Mon, 22 Feb 2021 14:21:47 +0000 (09:21 -0500)]
Remove RefCell around module_trait_cache

3 years agoDon't require a `DocContext` for `report_diagnostic`
Joshua Nelson [Mon, 22 Feb 2021 14:31:41 +0000 (09:31 -0500)]
Don't require a `DocContext` for `report_diagnostic`

This is needed for the next commit, which needs 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`

3 years agoAdd tracking issue for map_try_insert.
Mara Bos [Thu, 4 Mar 2021 15:54:28 +0000 (16:54 +0100)]
Add tracking issue for map_try_insert.

3 years agoRemove unnecessary bound from HashMap::try_insert.
Mara Bos [Thu, 4 Mar 2021 15:46:41 +0000 (16:46 +0100)]
Remove unnecessary bound from HashMap::try_insert.

3 years agoFixes -Zpolymorphize for src/test/ui/const-generics/auxiliary/crayte.rs
Oli Scherer [Thu, 4 Mar 2021 15:44:20 +0000 (15:44 +0000)]
Fixes -Zpolymorphize for src/test/ui/const-generics/auxiliary/crayte.rs

3 years agoTypo
Oli Scherer [Thu, 4 Mar 2021 14:48:17 +0000 (14:48 +0000)]
Typo

3 years agoSpread tracing instrumentation into the polymorphization logic
Oli Scherer [Thu, 4 Mar 2021 12:59:18 +0000 (12:59 +0000)]
Spread tracing instrumentation into the polymorphization logic

3 years agoIgnore file length tidy warning in hash/map.rs.
Mara Bos [Thu, 4 Mar 2021 15:25:24 +0000 (16:25 +0100)]
Ignore file length tidy warning in hash/map.rs.

3 years agoAuto merge of #81451 - nikic:llvm-12, r=nagisa
bors [Thu, 4 Mar 2021 15:16:44 +0000 (15:16 +0000)]
Auto merge of #81451 - nikic:llvm-12, r=nagisa

Upgrade to LLVM 12

This implements the necessary adjustments to make rustc work with LLVM 12. I didn't encounter any major issues so far.

r? `@cuviper`

3 years agoImplement Error for OccupiedError.
Mara Bos [Thu, 4 Mar 2021 14:57:26 +0000 (15:57 +0100)]
Implement Error for OccupiedError.

3 years agoImprove Debug implementations of OccupiedError.
Mara Bos [Thu, 4 Mar 2021 14:56:38 +0000 (15:56 +0100)]
Improve Debug implementations of OccupiedError.

3 years agoAdd HashMap::try_insert and hash_map::OccupiedError.
Mara Bos [Thu, 4 Mar 2021 14:34:47 +0000 (15:34 +0100)]
Add HashMap::try_insert and hash_map::OccupiedError.

3 years agoAdd BTreeMap::try_insert and btree_map::OccupiedError.
Mara Bos [Thu, 4 Mar 2021 14:34:47 +0000 (15:34 +0100)]
Add BTreeMap::try_insert and btree_map::OccupiedError.

3 years agoRemove a dead code path
Oli Scherer [Thu, 4 Mar 2021 12:21:36 +0000 (12:21 +0000)]
Remove a dead code path

3 years agoAuto merge of #82756 - JohnTitor:rollup-e4ij7h6, r=JohnTitor
bors [Thu, 4 Mar 2021 11:02:13 +0000 (11:02 +0000)]
Auto merge of #82756 - JohnTitor:rollup-e4ij7h6, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #80527 (Make rustdoc lints a tool lint instead of built-in)
 - #82310 (Load rustdoc's JS search index on-demand.)
 - #82315 (Improve page load performance in rustdoc)
 - #82564 (Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation)
 - #82697 (Fix stabilization version of move_ref_pattern)
 - #82717 (Account for macros when suggesting adding lifetime)
 - #82740 (Fix commit detected when using `download-rustc`)
 - #82744 (Pass `CrateNum` by value instead of by reference)

Failed merges:

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

3 years agoRollup merge of #82744 - camelid:cratenum-byval, r=GuillaumeGomez
Yuki Okushi [Thu, 4 Mar 2021 11:01:12 +0000 (20:01 +0900)]
Rollup merge of #82744 - camelid:cratenum-byval, r=GuillaumeGomez

Pass `CrateNum` by value instead of by reference

It's more idiomatic to pass a small Copy type by value and `CrateNum` is
half the size of `&CrateNum` on 64-bit systems. The memory use change is
almost certainly insignificant, but why not!

3 years agoRollup merge of #82740 - jyn514:proper-history, r=Mark-Simulacrum
Yuki Okushi [Thu, 4 Mar 2021 11:01:10 +0000 (20:01 +0900)]
Rollup merge of #82740 - jyn514:proper-history, r=Mark-Simulacrum

Fix commit detected when using `download-rustc`

On reflection on the issue in https://github.com/rust-lang/rust/pull/79540#discussion_r572572280, I think the bug was actually using the `compiler/` filter, not using `--author=bors`. https://github.com/rust-lang/rust/commit/9a1d6174c925f54c923599e29b09d6855e6b3a78 has no CI artifacts because it was merged as part of a rollup:
```
$ curl -I https://ci-artifacts.rust-lang.org/rustc-builds/96e843ce6ae42e0aa519ba45e148269de347fd84/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz
HTTP/2 404
```
So 9a1d6174c925f54c923599e29b09d6855e6b3a78 is the correct commit to download, and that's what `--author=bors` does:

$ git log --author=bors 4aec8a5da5547d6e1c24e99dad0003b7cac107f5
commit 9a1d6174c925f54c923599e29b09d6855e6b3a78

Ideally it would look for "the most recent bors commit not followed by a change to `compiler/`", which would exclude things like documentation changes and avoid redownloading more than necessary, but
- Redownloading isn't the end of the world,
- That metric is hard to implement, and
- Documentation-only or library-only changes are very rare anyway since they're usually rolled up with changes to the compiler.

Helps with https://github.com/rust-lang/rust/issues/81930.

r? `@Mark-Simulacrum`

3 years agoRollup merge of #82717 - estebank:issue-70152, r=lcnr
Yuki Okushi [Thu, 4 Mar 2021 11:01:09 +0000 (20:01 +0900)]
Rollup merge of #82717 - estebank:issue-70152, r=lcnr

Account for macros when suggesting adding lifetime

Fix #70152.

3 years agoRollup merge of #82697 - jplatte:patch-1, r=davidtwco
Yuki Okushi [Thu, 4 Mar 2021 11:01:07 +0000 (20:01 +0900)]
Rollup merge of #82697 - jplatte:patch-1, r=davidtwco

Fix stabilization version of move_ref_pattern

Both the [changelog](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1490-2020-12-31) and the milestone of the [stabilization PR](https://github.com/rust-lang/rust/pull/76119) say 1.49.0, but the source says 1.48.0. I think the former is correct.

3 years agoRollup merge of #82564 - WaffleLapkin:revert_spare_mut, r=RalfJung
Yuki Okushi [Thu, 4 Mar 2021 11:01:06 +0000 (20:01 +0900)]
Rollup merge of #82564 - WaffleLapkin:revert_spare_mut, r=RalfJung

Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation

The implementation was changed in #79015.

Later it was [pointed out](https://github.com/rust-lang/rust/issues/81944#issuecomment-782849785) that the implementation invalidates pointers to the buffer (initialized elements) by creating a unique reference to the buffer. This PR reverts the implementation.

r? ```@RalfJung```

3 years agoRollup merge of #82315 - jsha:font-display-swap, r=GuillaumeGomez
Yuki Okushi [Thu, 4 Mar 2021 11:01:04 +0000 (20:01 +0900)]
Rollup merge of #82315 - jsha:font-display-swap, r=GuillaumeGomez

Improve page load performance in rustdoc

Add an explicit height to icons (which already had an explicit width) to allow browsers to lay out the page more accurately before the icons have been loaded. https://web.dev/optimize-cls/.

Add min-width: 115px to the crate search dropdown. When the HTML first loads, this dropdown includes only the text "All crates." Later, JS loads the items underneath it, some of which are wider. That causes the dropdown to get wider, causing a distracting reflow. This sets a min-width based on the size that the dropdown eventually becomes based on the crates on doc.rust-lang.org, reducing page movement during load.

Add font-display: swap. Per https://web.dev/font-display/, this prevents "flash of invisible text" during load by using a system font until the custom font is available. I've noticed this flash of invisible text occasionally when reading Rust docs. Note that users without cached fonts will see text, and then see it reflow. For `docs.rust-lang.org`, [setting caching headers will help a lot](https://github.com/rust-lang/simpleinfra/issues/62).

Generated output at https://jacob.hoffman-andrews.com/rust/flow-improvements/std/string/struct.String.html.

3 years agoRollup merge of #82310 - jsha:rustdoc-search-onfocus, r=GuillaumeGomez
Yuki Okushi [Thu, 4 Mar 2021 11:01:03 +0000 (20:01 +0900)]
Rollup merge of #82310 - jsha:rustdoc-search-onfocus, r=GuillaumeGomez

Load rustdoc's JS search index on-demand.

Instead of being loaded on every page, the JS search index is now loaded when either (a) there is a `?search=` param, or (b) the search input is focused.

This saves both CPU and bandwidth. As of Feb 2021, https://doc.rust-lang.org/search-index1.50.0.js is 273,838 bytes gzipped or 2,544,939 bytes uncompressed. Evaluating it takes 445 ms of CPU time in Chrome 88 on a i7-10710U CPU (out of a total ~2,100 ms page reload).

Tested on Firefox and Chrome.

New:
https://jacob.hoffman-andrews.com/rust/search-on-demand/std/primitive.slice.html
https://jacob.hoffman-andrews.com/rust/search-on-demand/std/primitive.slice.html?search=fn

Old:
https://jacob.hoffman-andrews.com/rust/search-on-load/std/primitive.slice.html
https://jacob.hoffman-andrews.com/rust/search-on-load/std/primitive.slice.html?search=fn

3 years agoRollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomez
Yuki Okushi [Thu, 4 Mar 2021 11:01:01 +0000 (20:01 +0900)]
Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomez

Make rustdoc lints a tool lint instead of built-in

- Rename `broken_intra_doc_links` to `rustdoc::broken_intra_doc_links` (and similar for other rustdoc lints; I don't expect any others to be used frequently, though).
- Ensure that the old lint names still work and give deprecation errors
- Register lints even when running doctests
- Move lint machinery into a separate file
- Add `declare_rustdoc_lint!` macro

Unblocks https://github.com/rust-lang/rust/pull/80300, https://github.com/rust-lang/rust/pull/79816, https://github.com/rust-lang/rust/pull/80965. Makes the strangeness in https://github.com/rust-lang/rust/pull/77364 more apparent to the end user (note that `missing_docs` is *not* moved to rustdoc in this PR). Closes https://github.com/rust-lang/rust/issues/78786.

## Current status

This is blocked on #82620 (see https://github.com/rust-lang/rust/pull/80527#issuecomment-787401519)

3 years agoimprove offset_from docs
Ralf Jung [Thu, 4 Mar 2021 08:46:56 +0000 (09:46 +0100)]
improve offset_from docs

3 years agoAdd a regression test for issue-81712
Yuki Okushi [Thu, 4 Mar 2021 09:03:21 +0000 (18:03 +0900)]
Add a regression test for issue-81712

3 years agoPin es-check version to prevent unrelated CI failures
Yuki Okushi [Thu, 4 Mar 2021 06:03:01 +0000 (15:03 +0900)]
Pin es-check version to prevent unrelated CI failures

3 years agoAuto merge of #82304 - LeSeulArtichaut:unpretty-ast, r=spastorino
bors [Thu, 4 Mar 2021 05:46:43 +0000 (05:46 +0000)]
Auto merge of #82304 - LeSeulArtichaut:unpretty-ast, r=spastorino

Add `-Z unpretty` flags for the AST

Implements rust-lang/compiler-team#408.
Builds on #82269, but if that PR is rejected or stalls out, I can implement this without #82269.
cc rust-lang/rustc-dev-guide#1062

3 years agoPass `CrateNum` by value instead of by reference
Camelid [Thu, 4 Mar 2021 04:04:27 +0000 (20:04 -0800)]
Pass `CrateNum` by value instead of by reference

It's more idiomatic to pass a small Copy type by value and `CrateNum` is
half the size of `&CrateNum` on 64-bit systems. The memory use change is
almost certainly insignificant, but why not!

3 years agoFix commit detected when using `download-rustc`
Joshua Nelson [Thu, 4 Mar 2021 03:11:07 +0000 (22:11 -0500)]
Fix commit detected when using `download-rustc`

On reflection on the issue in https://github.com/rust-lang/rust/pull/79540#discussion_r572572280,  I think the bug was actually using the `compiler/` filter, not using `--author=bors`. https://github.com/rust-lang/rust/commit/9a1d6174c925f54c923599e29b09d6855e6b3a78 has no CI artifacts because it was merged as part of a rollup:
```
$ curl -I https://ci-artifacts.rust-lang.org/rustc-builds/96e843ce6ae42e0aa519ba45e148269de347fd84/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz
HTTP/2 404
```
So 9a1d6174c925f54c923599e29b09d6855e6b3a78 is the correct commit to download, and that's what `--author=bors` does:

$ git log --author=bors 4aec8a5da5547d6e1c24e99dad0003b7cac107f5
commit 9a1d6174c925f54c923599e29b09d6855e6b3a78

Ideally it would look for "the most recent bors commit not followed by a change to `compiler/`", which would exclude things like documentation changes and avoid redownloading more than necessary, but
- Redownloading isn't the end of the world,
- That metric is hard to implement, and
- Documentation-only or library-only changes are very rare anyway since they're usually rolled up with changes to the compiler.

3 years agoMove check only relevant in error case out of critical path
Esteban Küber [Thu, 4 Mar 2021 02:28:53 +0000 (18:28 -0800)]
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 agoAuto merge of #81114 - bugadani:generator, r=estebank
bors [Thu, 4 Mar 2021 00:23:42 +0000 (00:23 +0000)]
Auto merge of #81114 - bugadani:generator, r=estebank

Box generator-related Body fields

Might save some memory on functions that aren't generators.

3 years agoAuto merge of #82702 - jyn514:downgrade-err, r=Manishearth
bors [Wed, 3 Mar 2021 21:35:32 +0000 (21:35 +0000)]
Auto merge of #82702 - jyn514:downgrade-err, r=Manishearth

Change error about unknown attributes to a warning

Hard errors should go through a future-compatibility phase first, especially since these attributes only have no effect and don't actively cause bugs.

Follow-up to https://github.com/rust-lang/rust/pull/82662. Fixes ecosystem breakage like https://github.com/rust-lang/rust-clippy/issues/6832.

r? `@GuillaumeGomez`

3 years agoRemove useless comparison since now self.index <= self.len is an invariant
Giacomo Stevanato [Fri, 19 Feb 2021 11:17:48 +0000 (12:17 +0100)]
Remove useless comparison since now self.index <= self.len is an invariant

3 years agoDetect match arm body without braces
Esteban Küber [Fri, 26 Feb 2021 03:29:50 +0000 (19:29 -0800)]
Detect match arm body without braces

Fix #82524.

3 years agoAdd test for underflow in specialized Zip's size_hint
Giacomo Stevanato [Fri, 19 Feb 2021 11:16:12 +0000 (12:16 +0100)]
Add test for underflow in specialized Zip's size_hint

3 years agoIncrement self.len in specialized ZipImpl to avoid underflow in size_hint
Giacomo Stevanato [Fri, 19 Feb 2021 11:15:37 +0000 (12:15 +0100)]
Increment self.len in specialized ZipImpl to avoid underflow in size_hint

3 years agoreworded message
Esteban Küber [Wed, 3 Mar 2021 20:15:26 +0000 (12:15 -0800)]
reworded message

3 years agoExplicitly disable preinline during pgo-use test
Nikita Popov [Wed, 3 Mar 2021 16:58:39 +0000 (17:58 +0100)]
Explicitly disable preinline during pgo-use test

We previously used -Os to disable this pass, but since
https://reviews.llvm.org/D91673 this no longer works. Explicitly
disable it using -Cllvm-args instead.

3 years agoSchedule ThinLTOBuffer passes again after sanitizer passes
Nikita Popov [Tue, 2 Mar 2021 20:54:03 +0000 (21:54 +0100)]
Schedule ThinLTOBuffer passes again after sanitizer passes

This works around a design defect in the LLVM 12 pass builder
implementation. In LLVM 13, the PreLink ThinLTO pipeline properly
respects the OptimizerLastEPCallbacks.

3 years agoAuto merge of #82553 - tmiasko:update-tracing, r=Mark-Simulacrum
bors [Wed, 3 Mar 2021 18:01:29 +0000 (18:01 +0000)]
Auto merge of #82553 - tmiasko:update-tracing, r=Mark-Simulacrum

Update tracing to 0.1.25

* Update tracing from 0.1.18 to 0.1.25
* Update tracing-subscriber from 0.2.13 to 0.2.16
* Update tracing-tree from 0.1.6 to 0.1.8
* Add pin-project-lite to the list of allowed dependencies (it is now a direct dependency of tracing).

3 years agoAvoid unnecessary Vec construction in BufReader
Caleb Sander [Mon, 28 Dec 2020 20:45:36 +0000 (15:45 -0500)]
Avoid unnecessary Vec construction in BufReader

3 years agoUpdate library/alloc/src/vec/mod.rs
Waffle Lapkin [Wed, 3 Mar 2021 17:04:20 +0000 (20:04 +0300)]
Update library/alloc/src/vec/mod.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoChange error about unknown doc attributes to a warning
Joshua Nelson [Tue, 2 Mar 2021 14:42:32 +0000 (09:42 -0500)]
Change error about unknown doc attributes to a warning

This prevents breakage across the ecosystem, since the error was just
introduced recently without first having a warning period.

3 years agoAdd `-Z unpretty` flags for the AST
LeSeulArtichaut [Fri, 19 Feb 2021 21:40:28 +0000 (22:40 +0100)]
Add `-Z unpretty` flags for the AST

3 years agoFix diagnostic suggests adding type `[type error]`
Henry Boisdequin [Wed, 3 Mar 2021 11:20:07 +0000 (16:50 +0530)]
Fix diagnostic suggests adding type `[type error]`

Fixes #79040

Unresolved questions:

Why does this change output the diagnostic twice?

Why does the CI fail when the errors are pointed out (UI tests)?

3 years agoAuto merge of #82704 - RalfJung:miri-atomic-minmax, r=oli-obk
bors [Wed, 3 Mar 2021 11:05:01 +0000 (11:05 +0000)]
Auto merge of #82704 - RalfJung:miri-atomic-minmax, r=oli-obk

enable atomic_min/max tests in Miri

Thanks to `@henryboisdequin` and `@GregBowyer,` Miri now supports these intrinsics. :)
Also includes the necessary Miri update.

3 years agoWarn in doc test
Ryan Levick [Wed, 17 Feb 2021 09:06:23 +0000 (10:06 +0100)]
Warn in doc test

3 years agoFix borrow and deref
Ryan Levick [Tue, 16 Feb 2021 21:39:05 +0000 (22:39 +0100)]
Fix borrow and deref

3 years agoRemove lint pass on borrow and deref
Ryan Levick [Tue, 16 Feb 2021 14:12:19 +0000 (15:12 +0100)]
Remove lint pass on borrow and deref

3 years agoMove unrelated ui test back to what it was before
Ryan Levick [Wed, 10 Feb 2021 10:08:00 +0000 (11:08 +0100)]
Move unrelated ui test back to what it was before

3 years agoAllow noop_method_call in clippy ui test
Ryan Levick [Mon, 18 Jan 2021 13:15:19 +0000 (14:15 +0100)]
Allow noop_method_call in clippy ui test

3 years agoClean up code rightward drift
Esteban Küber [Wed, 13 Jan 2021 18:39:25 +0000 (10:39 -0800)]
Clean up code rightward drift

3 years agoIncrease accuracy of lint trigger
Esteban Küber [Wed, 13 Jan 2021 02:37:32 +0000 (18:37 -0800)]
Increase accuracy of lint trigger

3 years agoImprove error messages
Ryan Levick [Tue, 12 Jan 2021 13:58:51 +0000 (14:58 +0100)]
Improve error messages

3 years agoFix tidy error
Ryan Levick [Mon, 11 Jan 2021 18:02:19 +0000 (19:02 +0100)]
Fix tidy error

3 years agoUpdate error message
Ryan Levick [Mon, 11 Jan 2021 10:47:16 +0000 (11:47 +0100)]
Update error message

3 years agoFix tidy errors
Ryan Levick [Fri, 8 Jan 2021 11:09:29 +0000 (12:09 +0100)]
Fix tidy errors

3 years agoImprove warning
Ryan Levick [Fri, 8 Jan 2021 10:37:52 +0000 (11:37 +0100)]
Improve warning

3 years agoFix std tests
Ryan Levick [Thu, 7 Jan 2021 12:13:25 +0000 (13:13 +0100)]
Fix std tests

3 years agoOnly allow new lint when not bootstrapping - since beta doesn't know about the lint
Ryan Levick [Thu, 7 Jan 2021 10:24:32 +0000 (11:24 +0100)]
Only allow new lint when not bootstrapping - since beta doesn't know about the lint

3 years agoFix core tests
Ryan Levick [Wed, 6 Jan 2021 20:11:08 +0000 (21:11 +0100)]
Fix core tests

3 years agoFix ui-full-deps suite
Ryan Levick [Wed, 6 Jan 2021 16:56:34 +0000 (17:56 +0100)]
Fix ui-full-deps suite

3 years agoBless test where order of error message changed
Ryan Levick [Wed, 6 Jan 2021 13:48:06 +0000 (14:48 +0100)]
Bless test where order of error message changed

3 years agoFix tests
Ryan Levick [Tue, 5 Jan 2021 15:46:50 +0000 (16:46 +0100)]
Fix tests

3 years agoAdd tests and support two more noop methods
Ryan Levick [Tue, 5 Jan 2021 15:14:39 +0000 (16:14 +0100)]
Add tests and support two more noop methods

3 years agoFirst version of noop-lint
Ryan Levick [Tue, 5 Jan 2021 09:07:50 +0000 (10:07 +0100)]
First version of noop-lint

3 years agoAuto merge of #82718 - JohnTitor:rollup-vpfx3j2, r=JohnTitor
bors [Wed, 3 Mar 2021 08:36:46 +0000 (08:36 +0000)]
Auto merge of #82718 - JohnTitor:rollup-vpfx3j2, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #81223 ([rustdoc] Generate redirect map file)
 - #82439 (BTree: fix untrue safety)
 - #82469 (Use a crate to produce rustdoc tree comparisons instead of the `diff` command)
 - #82589 (unix: Non-mutable bufs in send_vectored_with_ancillary_to)
 - #82689 (meta: Notify Zulip for rustdoc nominated issues)
 - #82695 (Revert non-power-of-two vector restriction)
 - #82706 (use outer_expn_data() instead of outer_expn().expn_data())
 - #82710 (FloatToInit: Replacing round_unchecked_to --> to_int_unchecked)
 - #82712 (Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks`)
 - #82713 (Update cargo)

Failed merges:

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

3 years agoRollup merge of #82713 - ehuss:update-cargo, r=ehuss
Yuki Okushi [Wed, 3 Mar 2021 07:27:48 +0000 (16:27 +0900)]
Rollup merge of #82713 - ehuss:update-cargo, r=ehuss

Update cargo

12 commits in 572e201536dc2e4920346e28037b63c0f4d88b3c..c68432f1e5cbbc09833699a951b1b5b059651dff
2021-02-24 16:51:20 +0000 to 2021-03-02 18:26:29 +0000
- Don't panic when printing JSON with non-utf8 paths (rust-lang/cargo#9226)
- Detect changes for JSON spec targets. (rust-lang/cargo#9223)
- Fix `cargo_target_empty_cfg` test with env var. (rust-lang/cargo#9225)
- Correct default cargo new edition (rust-lang/cargo#9202)
- Update split-debuginfo docs around the default. (rust-lang/cargo#9224)
- Minor update to registry API error messages. (rust-lang/cargo#9213)
- Some minor code cleanup. (rust-lang/cargo#9214)
- doc: Fix spelling worksapce-&gt;workspace (rust-lang/cargo#9212)
- Update SPDX version in docs. (rust-lang/cargo#9209)
- Throw error if CARGO_TARGET_DIR is an empty string (rust-lang/cargo#8939)
- testsuite: Use split debuginfo on macos. (rust-lang/cargo#9207)
- testsuite: Improve performance when using rustup. (rust-lang/cargo#9206)

3 years agoRollup merge of #82712 - CDirkx:cfg-target_os, r=dtolnay
Yuki Okushi [Wed, 3 Mar 2021 07:27:47 +0000 (16:27 +0900)]
Rollup merge of #82712 - CDirkx:cfg-target_os, r=dtolnay

Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks`

`redox` and `vxworks` are now part of target_family `unix`, thus `cfg(unix)` already implies `cfg(target_os="redox")` and `cfg(target_os="vxworks")`

https://github.com/rust-lang/rust/blob/35dbef235048f9a2939dc20effe083ca483c37ff/compiler/rustc_target/src/spec/redox_base.rs#L26

https://github.com/rust-lang/rust/blob/35dbef235048f9a2939dc20effe083ca483c37ff/compiler/rustc_target/src/spec/vxworks_base.rs#L27

3 years agoRollup merge of #82710 - peter-kehl:FloatToInit_82709, r=sfackler
Yuki Okushi [Wed, 3 Mar 2021 07:27:46 +0000 (16:27 +0900)]
Rollup merge of #82710 - peter-kehl:FloatToInit_82709, r=sfackler

FloatToInit: Replacing round_unchecked_to --> to_int_unchecked

FloatToInit docs: Replacing round_unchecked_to with
to_int_unchecked. Bug #82709.

3 years agoRollup merge of #82706 - klensy:expn-data, r=petrochenkov
Yuki Okushi [Wed, 3 Mar 2021 07:27:45 +0000 (16:27 +0900)]
Rollup merge of #82706 - klensy:expn-data, r=petrochenkov

use outer_expn_data() instead of outer_expn().expn_data()

From the comment in hygiene.rs, so use it:
https://github.com/rust-lang/rust/blob/master/compiler/rustc_span/src/hygiene.rs#L627-L632

3 years agoRollup merge of #82695 - XAMPPRocky:remove-non-power-of-two-limit, r=nagisa
Yuki Okushi [Wed, 3 Mar 2021 07:27:44 +0000 (16:27 +0900)]
Rollup merge of #82695 - XAMPPRocky:remove-non-power-of-two-limit, r=nagisa

Revert non-power-of-two vector restriction

Removes the power of two restriction from rustc. As discussed in https://github.com/rust-lang/stdsimd/issues/63

r? ```@calebzulawski```

cc ```@workingjubilee``` ```@thomcc```

3 years agoRollup merge of #82689 - camelid:rustdoc-nominated, r=Manishearth
Yuki Okushi [Wed, 3 Mar 2021 07:27:42 +0000 (16:27 +0900)]
Rollup merge of #82689 - camelid:rustdoc-nominated, r=Manishearth

meta: Notify Zulip for rustdoc nominated issues

The rustdoc team does not currently use the `I-nominated` label, unlike
the libs and compiler teams (and maybe others). One reason for this is
that the other teams discuss their nominated issues in meetings, while
rustdoc is an async-only team.

However, it might be helpful to start using the `I-nominated` label for
rustdoc. The team currently uses a `cc ``@rust-lang/rustdoc``` ping as the
equivalent, but it's easier to track issues when they use `I-nominated`.
Also we'd be more consistent with the other teams' procedures.

Since rustdoc doesn't have meetings, I propose we instead use the
triagebot notify Zulip functionality to create a topic in `#rustdoc` on
Zulip and ping the team. So it would look a bit like the procedure for
WG-prioritization when an issue acquires the `I-prioritize` label.

cc ``@rust-lang/rustdoc`` for approval of the change
r? ``@Mark-Simulacrum`` to make sure I configured triagebot correctly

3 years agoRollup merge of #82589 - LinkTed:master, r=joshtriplett
Yuki Okushi [Wed, 3 Mar 2021 07:27:41 +0000 (16:27 +0900)]
Rollup merge of #82589 - LinkTed:master, r=joshtriplett

unix: Non-mutable bufs in send_vectored_with_ancillary_to

This is the same PR as [#79753](https://github.com/rust-lang/rust/pull/79753). It was closed because of inactivity. Therefore, I create a new one. ````@lukaslihotzki````

3 years agoRollup merge of #82469 - notriddle:bring-our-own-diff, r=Mark-Simulacrum
Yuki Okushi [Wed, 3 Mar 2021 07:27:40 +0000 (16:27 +0900)]
Rollup merge of #82469 - notriddle:bring-our-own-diff, r=Mark-Simulacrum

Use a crate to produce rustdoc tree comparisons instead of the `diff` command

It doesn't come with Windows, so bring [our own](https://github.com/notriddle/rust-unified-diff/).

Fixes #82409

![image](https://user-images.githubusercontent.com/1593513/109230755-9a1d5700-7782-11eb-8359-353a506875ab.png)

3 years agoRollup merge of #82439 - ssomers:btree_fix_unsafety, r=Mark-Simulacrum
Yuki Okushi [Wed, 3 Mar 2021 07:27:39 +0000 (16:27 +0900)]
Rollup merge of #82439 - ssomers:btree_fix_unsafety, r=Mark-Simulacrum

BTree: fix untrue safety

Fix needless and missing `unsafe` tags.

r? ````@Mark-Simulacrum````

3 years agoRollup merge of #81223 - GuillaumeGomez:generate-redirect-map, r=jyn514
Yuki Okushi [Wed, 3 Mar 2021 07:27:38 +0000 (16:27 +0900)]
Rollup merge of #81223 - GuillaumeGomez:generate-redirect-map, r=jyn514

[rustdoc] Generate redirect map file

Fixes #81134.

So with this code:

```rust
#![crate_name = "foo"]

pub use private::Quz;
pub use hidden::Bar;

mod private {
    pub struct Quz;
}

#[doc(hidden)]
pub mod hidden {
    pub struct Bar;
}

#[macro_export]
macro_rules! foo {
() => {}
}
```

It generates:

```json
{
  "foo/macro.foo!.html": "foo/macro.foo.html",
  "foo/private/struct.Quz.html": "foo/struct.Quz.html",
  "foo/hidden/struct.Bar.html": "foo/struct.Bar.html"
}
```

Do the pathes look as you expected ````@pietroalbini?````

r? ````@jyn514````

3 years agoAuto merge of #76345 - okready:sgx-mem-range-overflow-checks, r=joshtriplett
bors [Wed, 3 Mar 2021 05:45:50 +0000 (05:45 +0000)]
Auto merge of #76345 - okready:sgx-mem-range-overflow-checks, r=joshtriplett

Add is_enclave_range/is_user_range overflow checks

Fixes #76343.

This adds overflow checking to `is_enclave_range` and `is_user_range` in `sgx::os::fortanix_sgx::mem` in order to mitigate possible security issues with enclave code. It also accounts for an edge case where the memory range provided ends exactly at the end of the address space, where calculating `p + len` would overflow back to zero despite the range potentially being valid.

3 years agoUse Arial as fallback font instead of sans-serif.
Jacob Hoffman-Andrews [Wed, 3 Mar 2021 02:27:34 +0000 (18:27 -0800)]
Use Arial as fallback font instead of sans-serif.

On most platforms and browsers, `sans-serif` is equivalent to Arial.
However, on Firefox on Ubuntu (and possibly other Linuxes), `sans-serif`
is DejaVu Sans, a much wider font. This creates a larger shift in text
when the custom fonts finally load. Arial is a web-safe font, and
specifying it explicitly gives us more cross-platform consistency, as
well as reducing the layout shift that happens when fonts load.

3 years agoAccount for macros when suggesting adding lifetime
Esteban Küber [Wed, 3 Mar 2021 02:24:13 +0000 (18:24 -0800)]
Account for macros when suggesting adding lifetime

Fix #70152.

3 years agoImprove page load performance in rustdoc.
Jacob Hoffman-Andrews [Sat, 20 Feb 2021 01:54:41 +0000 (17:54 -0800)]
Improve page load performance in rustdoc.

Add font-display: swap. Per https://web.dev/font-display/, this prevents
"flash of invisible text" during load by using a system font until the
custom font is available. I've noticed this flash of invisible text
occasionally when reading Rust docs.

Add an explicit height to icons (which already had an explicit width)
to allow browsers to lay out the page more accurately before the icons
have been loaded. https://web.dev/optimize-cls/.

Add min-width: 115px to the crate search dropdown. When the HTML first
loads, this dropdown includes only the text "All crates." Later, JS
loads the items underneath it, some of which are wider. That causes
the dropdown to get wider, causing a distracting reflow. This sets a
min-width based on the size that the dropdown eventually becomes based
on the crates on doc.rust-lang.org, reducing page movement during load.

3 years agoUpdate cargo
Eric Huss [Wed, 3 Mar 2021 00:24:14 +0000 (16:24 -0800)]
Update cargo

3 years agoRemove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks`
Christiaan Dirkx [Wed, 3 Mar 2021 00:14:17 +0000 (01:14 +0100)]
Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks`

`redox` and `vxworks` are part of target_family `unix`, thus `cfg(unix)` already implies `cfg(target_os="redox")` and `(target_os="vxworks")`

3 years agoMake Vec::split_at_spare_mut impl safer & simplier
Waffle [Tue, 2 Mar 2021 22:04:20 +0000 (01:04 +0300)]
Make Vec::split_at_spare_mut impl safer & simplier

3 years agoAdd test that Vec::spare_capacity_mut doesn't invalidate pointers
Waffle [Tue, 2 Mar 2021 22:00:59 +0000 (01:00 +0300)]
Add test that Vec::spare_capacity_mut doesn't invalidate pointers

3 years agoLoad rustdoc's JS search index on-demand.
Jacob Hoffman-Andrews [Sat, 20 Feb 2021 01:22:30 +0000 (17:22 -0800)]
Load rustdoc's JS search index on-demand.

Instead of being loaded on every page, the JS search index is now
loaded when either (a) there is a `?search=` param, or (b) the search
input is focused.

This saves both CPU and bandwidth. As of Feb 2021,
https://doc.rust-lang.org/search-index1.50.0.js is 273,838 bytes
gzipped or 2,544,939 bytes uncompressed. Evaluating it takes 445 ms
of CPU time in Chrome 88 on a i7-10710U CPU (out of a total ~2,100
ms page reload).

Generate separate JS file with crate names.

This is much smaller than the full search index, and is used in the "hot
path" to draw the page. In particular it's used to crate the dropdown
for the search bar, and to append a list of crates to the sidebar (on
some pages).

Skip early search that can bypass 500ms timeout.

This was occurring when someone had typed some text during the load of
search-index.js. Their query was usually not ready to execute, and the
search itself is fairly expensive, delaying the overall load, which
delayed the input / keyup events, which delayed eventually executing the
query.

3 years agoAuto merge of #82562 - llogiq:one-up-82248, r=oli-obk
bors [Tue, 2 Mar 2021 21:01:47 +0000 (21:01 +0000)]
Auto merge of #82562 - llogiq:one-up-82248, r=oli-obk

Optimize counting digits in line numbers during error reporting further

This one-ups #82248 by switching the strategy: Instead of dividing the value by 10 repeatedly, we compare with a limit that we multiply by 10 repeatedly. In my benchmarks, this took between 50% and 25% of the original time. The reasons for being faster are:

1. While LLVM is able to replace a division by constant with a multiply + shift, a plain multiplication is still faster. However, this doesn't even factor, because
2. Multiplication, unlike division, is const. We also use a simple for-loop instead of a more complex loop + break, which allows
3. rustc to const-fold the whole loop, and indeed the assembly output simply shows a series of comparisons.

3 years agoFloatToInit: Replacing round_unchecked_to --> to_int_unchecked
Peter Kehl [Tue, 2 Mar 2021 20:38:22 +0000 (12:38 -0800)]
FloatToInit: Replacing round_unchecked_to --> to_int_unchecked

FloatToInit docs: Replacing round_unchecked_to with
to_int_unchecked. Bug #82709.

3 years agouse outer_expn_data() instead of outer_expn().expn_data()
klensy [Tue, 2 Mar 2021 19:01:29 +0000 (22:01 +0300)]
use outer_expn_data() instead of outer_expn().expn_data()

3 years agoupdate Miri
Ralf Jung [Tue, 2 Mar 2021 19:01:25 +0000 (20:01 +0100)]
update Miri