]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoFix sed command for Mac
Rich Kadel [Thu, 5 Nov 2020 07:27:47 +0000 (23:27 -0800)]
Fix sed command for Mac

add -e between -i and quoted script

I had tested on my mac but forgot I had aliased sed=gsed. My bad.

3 years agorename some tests to avoid exceeding windows path limits
Rich Kadel [Wed, 4 Nov 2020 05:45:32 +0000 (21:45 -0800)]
rename some tests to avoid exceeding windows path limits

And restored missing error message from llvm-cov show

And since some CI builds disable LLVM assertions (which disables the
--debug option in llvm-cov show), I check to see if LLVM assertions are
disabled, and if so, I don't add --debug and don't check the counter
file diffs.

3 years agofix cross-platform test bugs
Rich Kadel [Mon, 2 Nov 2020 23:01:30 +0000 (15:01 -0800)]
fix cross-platform test bugs

More portable way to make python 2/3 portable.

Strip Args line (with hardcoded paths) from debug counters output.

Ignore diff failures from llvm-cov debug output files ("counters"
files), since generic function instantiations will appear in those files
with mangled names. (Sadly, the demangler is apparently not applied to
the debug output.)

3 years agoResponded to all feedback as of 2020-10-30
Rich Kadel [Fri, 30 Oct 2020 23:09:05 +0000 (16:09 -0700)]
Responded to all feedback as of 2020-10-30

3 years agoAddressed all feedback to date
Rich Kadel [Sun, 25 Oct 2020 18:13:16 +0000 (11:13 -0700)]
Addressed all feedback to date

3 years agoAdded comments on remapping expression IDs, and URL to spanviews
Rich Kadel [Sun, 25 Oct 2020 08:53:44 +0000 (01:53 -0700)]
Added comments on remapping expression IDs, and URL to spanviews

3 years agoInjecting expressions in place of counters where helpful
Rich Kadel [Thu, 22 Oct 2020 21:30:03 +0000 (14:30 -0700)]
Injecting expressions in place of counters where helpful

Implementing the Graph traits for the BasicCoverageBlock
graph.

optimized replacement of counters with expressions plus new BCB graphviz

* Avoid adding coverage to unreachable blocks.
* Special case for Goto at the end of the body. Make it non-reportable.

Improved debugging and formatting options (from env)

Don't automatically add counters to BCBs without CoverageSpans. They may
still get counters but only if there are dependencies from
other BCBs that have spans, I think.

Make CodeRegions optional for Counters too. It is
possible to inject counters (`llvm.instrprof.increment` intrinsic calls
without corresponding code regions in the coverage map. An expression
can still uses these counter values.

Refactored instrument_coverage.rs -> instrument_coverage/mod.rs, and
then broke up the mod into multiple files.

Compiling with coverage, with the expression optimization, works on
the json5format crate and its dependencies.

Refactored debug features from mod.rs to debug.rs

3 years agoAdds coverage graphviz
Rich Kadel [Fri, 23 Oct 2020 03:28:16 +0000 (20:28 -0700)]
Adds coverage graphviz

3 years agoImplemented CoverageGraph of BasicCoverageBlocks
Rich Kadel [Fri, 23 Oct 2020 06:11:38 +0000 (23:11 -0700)]
Implemented CoverageGraph of BasicCoverageBlocks

3 years agoSplitting transform/instrument_coverage.rs into transform/coverage/...
Rich Kadel [Fri, 23 Oct 2020 07:45:07 +0000 (00:45 -0700)]
Splitting transform/instrument_coverage.rs into transform/coverage/...

3 years agoRust coverage before splitting instrument_coverage.rs
Rich Kadel [Mon, 5 Oct 2020 23:36:10 +0000 (16:36 -0700)]
Rust coverage before splitting instrument_coverage.rs

3 years agoAuto merge of #78774 - flip1995:clippyup, r=Manishearth
bors [Thu, 5 Nov 2020 17:57:31 +0000 (17:57 +0000)]
Auto merge of #78774 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy update

r? `@Manishearth`

3 years agoMerge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup
flip1995 [Thu, 5 Nov 2020 13:29:48 +0000 (14:29 +0100)]
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup

3 years agoAuto merge of #78638 - vn-ki:bindigs-after-at-issue-69971, r=oli-obk
bors [Thu, 5 Nov 2020 13:26:08 +0000 (13:26 +0000)]
Auto merge of #78638 - vn-ki:bindigs-after-at-issue-69971, r=oli-obk

reverse binding order in matches to allow the subbinding of copyable fields in bindings after @

Fixes #69971

### TODO

- [x] Regression tests

r? `@oli-obk`

3 years agoAuto merge of #6296 - flip1995:rustup, r=flip1995
bors [Thu, 5 Nov 2020 13:14:26 +0000 (13:14 +0000)]
Auto merge of #6296 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoAuto merge of #78767 - m-ou-se:rollup-eu5wgxl, r=m-ou-se
bors [Thu, 5 Nov 2020 10:22:20 +0000 (10:22 +0000)]
Auto merge of #78767 - m-ou-se:rollup-eu5wgxl, r=m-ou-se

Rollup of 15 pull requests

Successful merges:

 - #76718 (Move Vec UI tests to unit tests when possible)
 - #78093 (Clean up docs for 'as' keyword)
 - #78425 (Move f64::NAN ui tests into `library`)
 - #78465 (Change as_str → to_string in proc_macro::Ident::span() docs)
 - #78584 (Add keyboard handling to the theme picker menu)
 - #78716 (Array trait impl comment/doc fixes)
 - #78727 ((rustdoc) fix test for trait impl display)
 - #78733 (fix a couple of clippy warnings:)
 - #78735 (Simplify the implementation of `get_mut` (no unsafe))
 - #78738 (Move range in ui test to ops test in library/core)
 - #78739 (Fix ICE on type error in async function)
 - #78742 (make intern_const_alloc_recursive return error)
 - #78756 (Update cargo)
 - #78757 (Improve and clean up some intra-doc links)
 - #78758 (Fixed typo in comment)

Failed merges:

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

3 years agoRollup merge of #78758 - eltociear:patch-1, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:30:04 +0000 (10:30 +0100)]
Rollup merge of #78758 - eltociear:patch-1, r=jyn514

Fixed typo in comment

paramter -> parameter

3 years agoRollup merge of #78757 - camelid:crate-link-text, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:30:02 +0000 (10:30 +0100)]
Rollup merge of #78757 - camelid:crate-link-text, r=jyn514

Improve and clean up some intra-doc links

3 years agoRollup merge of #78756 - ehuss:update-cargo, r=ehuss
Mara Bos [Thu, 5 Nov 2020 09:30:01 +0000 (10:30 +0100)]
Rollup merge of #78756 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in becb4c282b8f37469efb8f5beda45a5501f9d367..d5556aeb8405b1fe696adb6e297ad7a1f2989b62
2020-10-28 16:41:55 +0000 to 2020-11-04 22:20:36 +0000
- Implement weak dependency features. (rust-lang/cargo#8818)
- Avoid some extra downloads with new feature resolver. (rust-lang/cargo#8823)
- fix: remove install command `$`, for copying friendly (rust-lang/cargo#8828)
- Bump `anyhow` dependency to `1.0.34` in `crates-io` crate (rust-lang/cargo#8826)
- Normalize SourceID in `cargo metadata`. (rust-lang/cargo#8824)
- vendor: correct the path to cargo config (rust-lang/cargo#8822)
- Make host_root return host.root(), not host.dest() (rust-lang/cargo#8819)

3 years agoRollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obk
Mara Bos [Thu, 5 Nov 2020 09:29:59 +0000 (10:29 +0100)]
Rollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obk

make intern_const_alloc_recursive return error

fix #78655

r? ``@oli-obk``

3 years agoRollup merge of #78739 - hameerabbasi:issue-78654, r=nikomatsakis
Mara Bos [Thu, 5 Nov 2020 09:29:57 +0000 (10:29 +0100)]
Rollup merge of #78739 - hameerabbasi:issue-78654, r=nikomatsakis

Fix ICE on type error in async function

Fixes #78654

3 years agoRollup merge of #78738 - sasurau4:test/move-range-test-to-library-core, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:29:56 +0000 (10:29 +0100)]
Rollup merge of #78738 - sasurau4:test/move-range-test-to-library-core, r=jyn514

Move range in ui test to ops test in library/core

Helps with #76268

r? ````@matklad````

3 years agoRollup merge of #78735 - danielhenrymantilla:simplify-unsafecell-getmut, r=RalfJung
Mara Bos [Thu, 5 Nov 2020 09:29:54 +0000 (10:29 +0100)]
Rollup merge of #78735 - danielhenrymantilla:simplify-unsafecell-getmut, r=RalfJung

Simplify the implementation of `get_mut` (no unsafe)

Quick PR to reduce one use of `unsafe` pointed out in the previous PR

r? ````@RalfJung````

3 years agoRollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:29:53 +0000 (10:29 +0100)]
Rollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514

fix a couple of clippy warnings:

filter_next
manual_strip
redundant_static_lifetimes
single_char_pattern
unnecessary_cast
unused_unit
op_ref
redundant_closure
useless_conversion

3 years agoRollup merge of #78727 - liketechnik:issue-55201, r=GuillaumeGomez
Mara Bos [Thu, 5 Nov 2020 09:29:50 +0000 (10:29 +0100)]
Rollup merge of #78727 - liketechnik:issue-55201, r=GuillaumeGomez

(rustdoc) fix test for trait impl display

The test checks that parameters and return values with `impl Trait` types are correctly generated in rustdoc's output.

In essence, the previous version of the test checked the absence of values that would never be generated by rustdoc, so it could basically never fail. These values were adjusted to the expected output and are now required to exist in rustdoc's output. See https://github.com/rust-lang/rust/issues/55201#issuecomment-716182474 for a detailed explanation of the reasoning behind the changes.

Note that the output of rustdoc for `impl Trait`s in parameters and return values did not change since the inital test creation, so this PR only modifies the test.

Closes #55201

3 years agoRollup merge of #78716 - est31:array_traits, r=Dylan-DPC
Mara Bos [Thu, 5 Nov 2020 09:29:46 +0000 (10:29 +0100)]
Rollup merge of #78716 - est31:array_traits, r=Dylan-DPC

Array trait impl comment/doc fixes

Two small doc/comment fixes regarding trait implementations on arrays.

3 years agoRollup merge of #78584 - notriddle:master, r=GuillaumeGomez
Mara Bos [Thu, 5 Nov 2020 09:29:45 +0000 (10:29 +0100)]
Rollup merge of #78584 - notriddle:master, r=GuillaumeGomez

Add keyboard handling to the theme picker menu

This PR is mostly designed to bring the theme picker closer to feature parity with the menu bar from docs.rs. Though the rustdoc theme picker is technically already usable from the keyboard, it's really weird that arrow keys work on some of the menus, but not all of them, in the exact same page.

3 years agoRollup merge of #78465 - est31:proc_macro_to_string, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:29:42 +0000 (10:29 +0100)]
Rollup merge of #78465 - est31:proc_macro_to_string, r=jyn514

Change as_str → to_string in proc_macro::Ident::span() docs

There is no `as_str` function on Ident any more.

Also change it to an intra doc link while we're at it.

3 years agoRollup merge of #78425 - chansuke:move_nan, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:29:40 +0000 (10:29 +0100)]
Rollup merge of #78425 - chansuke:move_nan, r=jyn514

Move f64::NAN ui tests into `library`

This is a partial fix of #76268.

r? ```@matklad```

3 years agoRollup merge of #78093 - camelid:as-cleanup, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:29:38 +0000 (10:29 +0100)]
Rollup merge of #78093 - camelid:as-cleanup, r=jyn514

Clean up docs for 'as' keyword

3 years agoRollup merge of #76718 - poliorcetics:vec-ui-to-unit-test, r=jyn514
Mara Bos [Thu, 5 Nov 2020 09:29:35 +0000 (10:29 +0100)]
Rollup merge of #76718 - poliorcetics:vec-ui-to-unit-test, r=jyn514

Move Vec UI tests to unit tests when possible

Helps with #76268.

I'm moving the tests using `Vec` or `VecDeque`.

````@rustbot```` modify labels: A-testsuite C-cleanup T-libs

3 years agoupdate dangling-alloc-id-ice test
Vishnunarayan K I [Thu, 5 Nov 2020 07:54:21 +0000 (13:24 +0530)]
update dangling-alloc-id-ice test

3 years agoAuto merge of #78754 - pietroalbini:checkout-v2, r=Mark-Simulacrum
bors [Thu, 5 Nov 2020 05:14:53 +0000 (05:14 +0000)]
Auto merge of #78754 - pietroalbini:checkout-v2, r=Mark-Simulacrum

Bump actions/checkout to version 2

This was recommended by GitHub Support to try reducing the things that could've caused #78743. I checked the changelog and there should be no practical impact for us (we already set an explicit fetch-depth).

r? `@Mark-Simulacrum`

3 years agoAdd `mod nan` for test
chansuke [Thu, 5 Nov 2020 03:57:18 +0000 (12:57 +0900)]
Add `mod nan` for test

3 years agoFixed typo in comment
Ikko Ashimine [Thu, 5 Nov 2020 03:08:32 +0000 (12:08 +0900)]
Fixed typo in comment

paramter -> parameter

3 years agoAdd missing comma
Camelid [Thu, 5 Nov 2020 02:52:02 +0000 (18:52 -0800)]
Add missing comma

'Note however,' -> 'Note, however,'

3 years agoClean up some intra-doc links
Camelid [Thu, 5 Nov 2020 02:57:52 +0000 (18:57 -0800)]
Clean up some intra-doc links

3 years agoDon't use `crate` in link text
Camelid [Thu, 5 Nov 2020 02:42:37 +0000 (18:42 -0800)]
Don't use `crate` in link text

`crate::` -> `core::`

It looks weird to have `crate::` in the link text and we use the actual
crate name everywhere else.

If anyone is curious, I used this Vim command to update all the links:

    %s/\(\s\)\[`crate::\(.*\)`\]/\1[`core::\2`](crate::\2)/g

3 years agoUpdate cargo
Eric Huss [Thu, 5 Nov 2020 00:15:18 +0000 (16:15 -0800)]
Update cargo

3 years agoClean up docs for 'as' keyword
Camelid [Mon, 19 Oct 2020 01:05:29 +0000 (18:05 -0700)]
Clean up docs for 'as' keyword

3 years agoFix format
chansuke [Wed, 4 Nov 2020 23:40:04 +0000 (08:40 +0900)]
Fix format

3 years agoMove f64::NAN ui tests into `library`
chansuke [Tue, 27 Oct 2020 00:29:57 +0000 (09:29 +0900)]
Move f64::NAN ui tests into `library`

3 years agoci: bump actions/checkout to version 2
Pietro Albini [Wed, 4 Nov 2020 23:05:20 +0000 (00:05 +0100)]
ci: bump actions/checkout to version 2

This was recommended by GitHub Support to try reducing the things that
could've caused #78743. I checked the changelog and there should be no
practical impact for us (we already set an explicit fetch-depth).

3 years agoAuto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis
bors [Wed, 4 Nov 2020 22:45:15 +0000 (22:45 +0000)]
Auto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis

Provide diagnostic suggestion in ExprUseVisitor Delegate

The [Delegate trait](https://github.com/rust-lang/rust/blob/981346fc07dd5ef414c5b1b21999f7604cece006/compiler/rustc_typeck/src/expr_use_visitor.rs#L28-L38) currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

Closes: https://github.com/rust-lang/project-rfc-2229/issues/20
r? `@ghost`

3 years agoAuto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis
bors [Wed, 4 Nov 2020 22:45:15 +0000 (22:45 +0000)]
Auto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis

Provide diagnostic suggestion in ExprUseVisitor Delegate

The [Delegate trait](https://github.com/rust-lang/rust/blob/981346fc07dd5ef414c5b1b21999f7604cece006/compiler/rustc_typeck/src/expr_use_visitor.rs#L28-L38) currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

Closes: https://github.com/rust-lang/project-rfc-2229/issues/20
r? `@ghost`

3 years agoAuto merge of #6247 - giraffate:fix_suggestion_to_add_space_in_unused_unit, r=ebroto
bors [Wed, 4 Nov 2020 22:42:10 +0000 (22:42 +0000)]
Auto merge of #6247 - giraffate:fix_suggestion_to_add_space_in_unused_unit, r=ebroto

Fix suggestion to add unneeded space in `unused_unit`

Fix https://github.com/rust-lang/rust-clippy/issues/6230

changelog: Fix suggestion to add unneeded space in `unused_unit`

3 years agoAuto merge of #5911 - hegza:issue-568, r=ebroto
bors [Wed, 4 Nov 2020 22:21:44 +0000 (22:21 +0000)]
Auto merge of #5911 - hegza:issue-568, r=ebroto

Add lint for 'field_reassign_with_default` #568

changelog: Add lint for field_reassign_with_default that checks if mutable object + field modification is used to edit a binding initialized with Default::default() instead of struct constructor.

Fixes #568

Notes:
- Checks for reassignment of one or more fields of a binding initialized with Default::default().
- Implemented using EarlyLintPass, might be future proofed better with LateLintPass.
- Does not trigger if Default::default() is used via another type implementing Default.
- This is a re-open of [PR#4761](https://github.com/rust-lang/rust-clippy/pull/4761), but I couldn't figure out how to re-open that one so here's a new one with the requested changes :S

3 years agoAuto merge of #6292 - ebroto:rustup, r=ebroto
bors [Wed, 4 Nov 2020 21:53:32 +0000 (21:53 +0000)]
Auto merge of #6292 - ebroto:rustup, r=ebroto

Rustup

changelog: none

r? `@ghost`

3 years agoRun cargo dev fmt
Eduardo Broto [Wed, 4 Nov 2020 21:41:15 +0000 (22:41 +0100)]
Run cargo dev fmt

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
Eduardo Broto [Wed, 4 Nov 2020 21:37:11 +0000 (22:37 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #78740 - pietroalbini:no-more-legacy, r=Mark-Simulacrum
bors [Wed, 4 Nov 2020 20:02:08 +0000 (20:02 +0000)]
Auto merge of #78740 - pietroalbini:no-more-legacy, r=Mark-Simulacrum

Remove legacy promote-release support from build-manifestg

Now that we're not running the [legacy `promote-release`](https://github.com/rust-lang/rust-central-station/tree/master/promote-release) anymore, this PR removes support from it from `bootstrap` and `build-manifest`.

r? `@Mark-Simulacrum`

3 years agomake intern_const_alloc_recursive return error fix #78655
Vishnunarayan K I [Wed, 4 Nov 2020 16:53:43 +0000 (22:23 +0530)]
make intern_const_alloc_recursive return error fix #78655

3 years agoAuto merge of #78280 - bugadani:span, r=lcnr
bors [Wed, 4 Nov 2020 17:17:01 +0000 (17:17 +0000)]
Auto merge of #78280 - bugadani:span, r=lcnr

Codegen: Query span as late as possible

3 years agoFix issue 78654.
Hameer Abbasi [Wed, 4 Nov 2020 15:32:18 +0000 (15:32 +0000)]
Fix issue 78654.

3 years agoMove range in ui test to ops test in library/core
Daiki Ihara [Wed, 4 Nov 2020 14:59:04 +0000 (23:59 +0900)]
Move range in ui test to ops test in library/core

3 years agoAuto merge of #77227 - oli-obk:const_val_🌳_prelude, r=RalfJung
bors [Wed, 4 Nov 2020 14:26:03 +0000 (14:26 +0000)]
Auto merge of #77227 - oli-obk:const_val_🌳_prelude, r=RalfJung

Refactorings in preparation for const value trees

cc #72396

This PR changes the `Scalar::Bits { data: u128, size: u8 }` variant to `Scalar::Bits(ScalarInt)` where `ScalarInt` contains the same information, but is `repr(packed)`. The reason for using a packed struct is to allow enum variant packing to keep the original size of `Scalar` instead of adding another word to its size due to padding.
Other than that the PR just gets rid of all the inspection of the internal fields of `Scalar::Bits` which were frankly scary. These fields have invariants that we need to uphold and we can't do that without making the fields private.

r? `@ghost`

3 years agoUpdate compiler/rustc_target/src/abi/mod.rs
Oli Scherer [Wed, 4 Nov 2020 14:13:06 +0000 (15:13 +0100)]
Update compiler/rustc_target/src/abi/mod.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoUpdate compiler/rustc_target/src/abi/mod.rs
Oli Scherer [Wed, 4 Nov 2020 14:12:44 +0000 (15:12 +0100)]
Update compiler/rustc_target/src/abi/mod.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years ago`u64::try_from` will now fail if `ScalarInt` isn't exactly 64 bits, thus we use ...
oli [Wed, 4 Nov 2020 13:59:11 +0000 (13:59 +0000)]
`u64::try_from` will now fail if `ScalarInt` isn't exactly 64 bits, thus we use `to_bits` with the correct size

3 years agoMake `ScalarInt` entirely independent of MIR interpretation
oli [Wed, 4 Nov 2020 13:55:29 +0000 (13:55 +0000)]
Make `ScalarInt` entirely independent of MIR interpretation

3 years agoSimplify the implementation of `get_mut` (no unsafe)
Daniel Henry-Mantilla [Wed, 4 Nov 2020 13:54:22 +0000 (14:54 +0100)]
Simplify the implementation of `get_mut` (no unsafe)

3 years agoDocument an `unwrap`
oli [Wed, 4 Nov 2020 13:44:17 +0000 (13:44 +0000)]
Document an `unwrap`

3 years ago`u128` truncation and sign extension are not just interpreter related
oli [Wed, 4 Nov 2020 13:41:58 +0000 (13:41 +0000)]
`u128` truncation and sign extension are not just interpreter related

3 years agofix a couple of clippy warnings:
Matthias Krüger [Wed, 4 Nov 2020 12:48:50 +0000 (13:48 +0100)]
fix a couple of clippy warnings:

filter_next
manual_strip
redundant_static_lifetimes
single_char_pattern
unnecessary_cast
unused_unit
op_ref
redundant_closure
useless_conversion

3 years agoAuto merge of #78677 - Aaron1011:fix/capture-inner-attrs, r=petrochenkov
bors [Wed, 4 Nov 2020 11:37:36 +0000 (11:37 +0000)]
Auto merge of #78677 - Aaron1011:fix/capture-inner-attrs, r=petrochenkov

Use reparsed `TokenStream` if we captured any inner attributes

Fixes #78675

We now bail out of `prepend_attrs` if we ended up capturing any inner
attributes (which can happen in several places, due to token capturing
for `macro_rules!` arguments.

3 years agoFix outdated comment next to array_impl_default
est31 [Wed, 4 Nov 2020 00:48:28 +0000 (01:48 +0100)]
Fix outdated comment next to array_impl_default

The comment has become outdated as the array_impl macro
has been removed.

3 years agoMove ZST constant to the top of the impl block
oli [Mon, 2 Nov 2020 11:54:06 +0000 (11:54 +0000)]
Move ZST constant to the top of the impl block

3 years agoUpdate compiler/rustc_middle/src/ty/consts/int.rs
Oli Scherer [Mon, 2 Nov 2020 11:52:52 +0000 (12:52 +0100)]
Update compiler/rustc_middle/src/ty/consts/int.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoSimplify `assert_bits` impl
oli [Sun, 1 Nov 2020 17:32:51 +0000 (17:32 +0000)]
Simplify `assert_bits` impl

3 years agoDo not raise interp errors from the scalar int module
oli [Sun, 1 Nov 2020 17:30:33 +0000 (17:30 +0000)]
Do not raise interp errors from the scalar int module

3 years agoAdd helper for getting an `int` out of a `Scalar`
oli [Sun, 1 Nov 2020 17:21:33 +0000 (17:21 +0000)]
Add helper for getting an `int` out of a `Scalar`

3 years agoAdd `is_null` helper
oli [Sun, 1 Nov 2020 17:17:04 +0000 (17:17 +0000)]
Add `is_null` helper

This is cheaper than creating a null-`ScalarInt` and comparing
and then just throwing it away.

3 years agoExplain why we forward to self-printing during self-printing
oli [Sun, 1 Nov 2020 17:15:11 +0000 (17:15 +0000)]
Explain why we forward to self-printing during self-printing

3 years agocatch conversion errors during `ptr_sized_op`
oli [Sun, 1 Nov 2020 17:14:09 +0000 (17:14 +0000)]
catch conversion errors during `ptr_sized_op`

3 years agoReplace `Scalar::zst` with a `Scalar::ZST` constant
oli [Sun, 1 Nov 2020 17:04:13 +0000 (17:04 +0000)]
Replace `Scalar::zst` with a `Scalar::ZST` constant

3 years agoNo need for a `zst` constructor method when we can have a constant
oli [Sun, 1 Nov 2020 17:01:34 +0000 (17:01 +0000)]
No need for a `zst` constructor method when we can have a constant

3 years agoUpdate comment
oli [Sun, 1 Nov 2020 17:00:09 +0000 (17:00 +0000)]
Update comment

3 years agoUnaligned reads are UB in Rust irrelevant on which platform we are
oli [Sun, 1 Nov 2020 16:59:00 +0000 (16:59 +0000)]
Unaligned reads are UB in Rust irrelevant on which platform we are

3 years agoRemove outdated FIXME
oli [Sun, 1 Nov 2020 16:58:16 +0000 (16:58 +0000)]
Remove outdated FIXME

3 years agos/Scalar::Raw/Scalar::Int
oli [Sun, 1 Nov 2020 16:57:03 +0000 (16:57 +0000)]
s/Scalar::Raw/Scalar::Int

3 years agos/Scalar::Raw/Scalar::Int
oli [Sun, 1 Nov 2020 16:57:03 +0000 (16:57 +0000)]
s/Scalar::Raw/Scalar::Int

3 years agoFix cranelift build
oli [Thu, 29 Oct 2020 13:30:47 +0000 (13:30 +0000)]
Fix cranelift build

3 years agoExplain the use of blocks around `self.data` accesses
oli [Thu, 29 Oct 2020 10:29:26 +0000 (10:29 +0000)]
Explain the use of blocks around `self.data` accesses

3 years agoUse packed struct instead of manually packing into an array
oli [Thu, 29 Oct 2020 10:15:54 +0000 (10:15 +0000)]
Use packed struct instead of manually packing into an array

3 years agoSplit the "raw integer bytes" part out of `Scalar`
Oliver Scherer [Sat, 26 Sep 2020 13:15:35 +0000 (15:15 +0200)]
Split the "raw integer bytes" part out of `Scalar`

3 years ago32 bit platforms don't have 64 bit pointers
Oliver Scherer [Thu, 1 Oct 2020 10:51:44 +0000 (12:51 +0200)]
32 bit platforms don't have 64 bit pointers

3 years agoEncode `ScalarInt::bytes` as `u128` instead of `[u8; 16]` to see if that caused the...
Oliver Scherer [Thu, 1 Oct 2020 07:47:36 +0000 (09:47 +0200)]
Encode `ScalarInt::bytes` as `u128` instead of `[u8; 16]` to see if that caused the performance regression

3 years agoSplit the "raw integer bytes" part out of `Scalar`
Oliver Scherer [Sat, 26 Sep 2020 13:15:35 +0000 (15:15 +0200)]
Split the "raw integer bytes" part out of `Scalar`

3 years agoAuto merge of #6284 - camsteffen:rustc-sym, r=flip1995
bors [Wed, 4 Nov 2020 09:22:54 +0000 (09:22 +0000)]
Auto merge of #6284 - camsteffen:rustc-sym, r=flip1995

Use const sym where possible

I ran a regex search and replace to use const `sym` values where possible. This should give some performance boost by avoiding string interning at runtime.

Con: It is not as consistent as always using `sym!`.

I also changed an internal lint to suggest using `sym::{}`, making an assumption that this will always work for diagnostic items.

changelog: none

3 years agoAuto merge of #6270 - ClashTheBunny:clarify_allow_deny_enable_disable, r=flip1995
bors [Wed, 4 Nov 2020 08:49:10 +0000 (08:49 +0000)]
Auto merge of #6270 - ClashTheBunny:clarify_allow_deny_enable_disable, r=flip1995

Clarify allow/warn/deny documentation.  Remove enable/disable.

Disable and enable when not specifically explained were not clear to me
as an English language speaker, but I was able to figure it out fairly
easily due to the examples having A/W, which I assumed meant `allow` and
`warn`.  I removed both words to be sure it was clear as well as
extending the note on what deny means.  It now includes a statement on
exactly what each word means.

Documentation only update.

*Please keep the line below*
changelog: none

3 years agoAddress Pr comments regarding docstrings
Dhruv Jauhar [Wed, 4 Nov 2020 07:54:00 +0000 (02:54 -0500)]
Address Pr comments regarding docstrings

3 years agoMove Copy and Clone into the list of traits implemented for all sizes
est31 [Wed, 4 Nov 2020 00:28:37 +0000 (01:28 +0100)]
Move Copy and Clone into the list of traits implemented for all sizes

3 years agoUpdate wording to avoid code having "lint" metaphor
Randall Mason [Tue, 3 Nov 2020 21:59:24 +0000 (15:59 -0600)]
Update wording to avoid code having "lint" metaphor

3 years agoAuto merge of #78711 - m-ou-se:rollup-pxqnny7, r=m-ou-se
bors [Tue, 3 Nov 2020 18:58:06 +0000 (18:58 +0000)]
Auto merge of #78711 - m-ou-se:rollup-pxqnny7, r=m-ou-se

Rollup of 7 pull requests

Successful merges:

 - #77950 (Add support for SHA256 source file hashing)
 - #78624 (Sync rustc_codegen_cranelift)
 - #78626 (Improve errors about #[deprecated] attribute)
 - #78659 (Corrected suggestion for generic parameters in `function_item_references` lint)
 - #78687 (Suggest library/std when running all stage 0 tests)
 - #78699 (Show more error information in lldb_batchmode)
 - #78709 (Fix panic in bootstrap for non-workspace path dependencies.)

Failed merges:

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

3 years agoRollup merge of #78709 - ehuss:fix-in_tree_crates-non-member, r=Mark-Simulacrum
Mara Bos [Tue, 3 Nov 2020 18:32:44 +0000 (19:32 +0100)]
Rollup merge of #78709 - ehuss:fix-in_tree_crates-non-member, r=Mark-Simulacrum

Fix panic in bootstrap for non-workspace path dependencies.

If you add a `path` dependency to a `Cargo.toml` that is located outside of the workspace, then the `in_tree_crates` function can panic because it finds a path dependency that is not defined (since it uses `cargo metadata --no-deps`).  This fixes it by skipping over those entries, which are usually not things you select on the command-line.

Fixes #78617

3 years agoRollup merge of #78699 - pietroalbini:lldb-error, r=jyn514
Mara Bos [Tue, 3 Nov 2020 18:32:42 +0000 (19:32 +0100)]
Rollup merge of #78699 - pietroalbini:lldb-error, r=jyn514

Show more error information in lldb_batchmode

Even more information to try and debug #78665.

3 years agoRollup merge of #78687 - jyn514:bootstrap-help, r=Mark-Simulacrum
Mara Bos [Tue, 3 Nov 2020 18:32:40 +0000 (19:32 +0100)]
Rollup merge of #78687 - jyn514:bootstrap-help, r=Mark-Simulacrum

Suggest library/std when running all stage 0 tests

r? ``@Mark-Simulacrum``
cc ``@ijackson``

For context, this came out of a discord conversation where ``@ijackson`` was running `test --stage 1` when they were only adding doc-tests to the standard library.

3 years agoRollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obk
Mara Bos [Tue, 3 Nov 2020 18:32:38 +0000 (19:32 +0100)]
Rollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obk

Corrected suggestion for generic parameters in `function_item_references` lint

This commit handles functions with generic type parameters like you pointed out as well as const generics. Also this is probably a minor thing, but the type alias you used in the example doesn't show up so the suggestion right now would be `size_of::<[u8; 16]> as fn() ->`. This is because the lint checker works with MIR instead of HIR. I don't think we can get the alias at that point, but let me know if I'm wrong and there's a way to fix this. Also I put you as the reviewer, but I'm not sure if you want to review it or if it makes more sense to ask one of the original reviewers of this lint.
closes #78571

3 years agoRollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank
Mara Bos [Tue, 3 Nov 2020 18:32:36 +0000 (19:32 +0100)]
Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank

Improve errors about #[deprecated] attribute

This change:

1. Turns `#[deprecated]` on a trait impl block into an error, which fixes #78625;
2. Changes these and other errors about `#[deprecated]` to use the span of the attribute instead of the item; and
3. Turns this error into a lint, to make sure it can be capped with `--cap-lints` and doesn't break any existing dependencies.

Can be reviewed per commit.

---
Example:
```rust
struct X;

#[deprecated = "a"]
impl Default for X {
    #[deprecated = "b"]
    fn default() -> Self {
        X
    }
}
```

Before:
```
error: This deprecation annotation is useless
 --> src/main.rs:6:5
  |
6 | /     fn default() -> Self {
7 | |         X
8 | |     }
  | |_____^
```

After:
```
error: this `#[deprecated]' annotation has no effect
 --> src/main.rs:3:1
  |
3 | #[deprecated = "a"]
  | ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
  |
  = note: `#[deny(useless_deprecated)]` on by default

error: this `#[deprecated]' annotation has no effect
 --> src/main.rs:5:5
  |
5 |     #[deprecated = "b"]
  |     ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
```

3 years agoRollup merge of #78624 - bjorn3:update_cg_clif-2020-11-01, r=jyn514
Mara Bos [Tue, 3 Nov 2020 18:32:34 +0000 (19:32 +0100)]
Rollup merge of #78624 - bjorn3:update_cg_clif-2020-11-01, r=jyn514

Sync rustc_codegen_cranelift

This fixes bootstrapping of rustc using cg_clif again. It regressed a while before #77975 got merged.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/743