Commit graph

134604 commits

Author SHA1 Message Date
XAMPPRocky 7bb1889899
Apply suggestions from code review
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2020-12-08 22:13:03 +00:00
Erin Power 891341942a Update RELEASES.md for 1.49.0 2020-12-07 23:45:23 +00:00
bors 3d6705aa5a Auto merge of #79797 - jethrogb:sgx-fix-79038, r=Mark-Simulacrum
Fix SGX CI, take 3

Broken in #79038

r? `@Mark-Simulacrum`

I actually ran `./x.py test --target x86_64-fortanix-unknown-sgx` on the commit before submitting it this time.
2020-12-07 20:25:24 +00:00
bors afa995b2dd Auto merge of #79751 - aDotInTheVoid:json-true-idx, r=jyn514
Rustdoc: Use correct def_id for doctree::Import

The default overwrites the crate root, which crashes rustdoc-json.

While investigating this, It turns out somehow, some items are being documented twice. I'm not sure how this is happening but for now, we just make sure they were the same if they have the same id.

[Zulip descussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Panic.20in.20json-format/near/218899256)

[Bless script](https://gist.github.com/aDotInTheVoid/2dfce0d241338def3f033f941b7c183d) (Once this is more pollished I'll submit it)

r? `@jyn514`
2020-12-07 17:35:02 +00:00
bors b5ff9c3d05 Auto merge of #79773 - lcnr:type-visitor, r=oli-obk
small `TypeVisitor` refactor

cc `@LeSeulArtichaut` `@scottmcm`

adds `ControlFlow::map_break`
2020-12-07 15:07:09 +00:00
Bastian Kauschke e3e4870bce small TypeVisitor refactor 2020-12-07 15:52:59 +01:00
Jethro Beekman 9703bb8192 Fix SGX CI, take 3
Broken in #79038
2020-12-07 15:22:34 +01:00
bors 2b76c48328 Auto merge of #79772 - ethanboxx:79760-wrongly-speaks-of-methods, r=oli-obk
smarter E0390

Should fix #79760

I am fairly new to the compiler so am hoping I did things correctly :).
2020-12-07 09:28:25 +00:00
bors e5721a5283 Auto merge of #79641 - sourcefrog:split-example, r=dtolnay
Add a doctest example of str::split on a slice of chars

This is mentioned as supported, but the semantics are not described.
2020-12-07 06:05:34 +00:00
bors f00ace93d0 Auto merge of #79776 - petrochenkov:mvtest, r=Mark-Simulacrum
Move some tests to subdirectories

Mostly tests related to imports.
(A couple of very outdated tests is also deleted.)

Part of https://github.com/rust-lang/rust/issues/73494.
2020-12-07 00:00:00 +00:00
Vadim Petrochenkov 4eb9da3b17 Move some tests to subdirectories 2020-12-07 02:25:09 +03:00
Ethan Brierley 67db0ea4a7 suggestions from camelid review 2020-12-06 21:30:30 +00:00
Ethan Brierley 0c13a9c020 smarter E0390 2020-12-06 20:30:07 +00:00
bors 0f6f2d681b Auto merge of #79765 - flip1995:clippyup, r=Manishearth
Update Clippy

Biweekly Clippy update (which I forgot about on Thursday)

This includes a `Cargo.lock` update, so probably needs `rollup=never`.

r? `@Manishearth`
2020-12-06 16:59:10 +00:00
flip1995 898ef0ff87
Update Cargo.lock 2020-12-06 15:07:59 +01:00
flip1995 d3eb49baa9
Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup 2020-12-06 15:01:03 +01:00
bors d577c535b4 Auto merge of #78609 - lcnr:rustdoc-const-eval, r=matthewjasper
extend `WithOptConstParam` docs, move rustdoc test

This should hopefully make things a bit clearer, feel free to comment on anything which can still be improved.

cc `@ecstatic-morse` `@nikomatsakis` `@RalfJung`
2020-12-06 13:03:45 +00:00
bors a68864b688 Auto merge of #79734 - ethanboxx:inferred_const_note, r=varkor
Const parameters can not be inferred with `_` help note

This should close: #79557

# Example output
```
error[E0747]: type provided when a constant was expected
 --> inferred_const_note.rs:6:19
  |
6 |     let a = foo::<_, 2>([0, 1, 2]);
  |                   ^
  |
  = help: Const parameters can not be inferred with `_`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0747`.
```

r? `@lcnr`
2020-12-06 08:08:05 +00:00
bors c1664c50b2 Auto merge of #6421 - xFrednet:4176-unreadable-literal-lint-fractal-option, r=Manishearth
Added a lint-fraction-readability flag to the configuration

This adds an option to disable the `unreadable_literal` lint for floats with a longer fraction. This allows users to write `0.100200300` without getting a warning. Fixes #4176

I have some open questions about this PR:
1. I've named the option `lint-fraction-readability` is this a good name or should I rename it to something else?
2. What should the default configuration value be?
    * The current default value is `true` as this was also the previous default.
3. Do I have to document this new option somewhere else or will it be extracted from the code comment?
4. The current fix option will also rewrite the fraction if the integer part violates the `unreadable_literal` lint it would otherwise also trigger the `inconsistent_digit_grouping` lint. Is this also okay?
    * `1.100200300` will be unaffected by the fix function
    * `100200300.100200300` will be effected and fixed to `100_200_300.100_200_300`

---

The project needed some getting used to but I'm happy with the result. A big thank you to `@flip1995` for giving me some pointers for this implementation and to everyone for the great introduction documentation!

---

changelog: Added the `unreadable-literal-lint-fractions` configuration to disable the `unreadable_literal` lint for fractions
2020-12-06 07:18:33 +00:00
bors 5957f208a5 Auto merge of #79737 - Xanewok:update-rls, r=calebcartwright
Update RLS and Rustfmt

Fixes #79406 Fixes #79407

This does pull 1.4.28 version of Rustfmt. Do you want me to pull the 1.4.29 while we're at it?

r? `@calebcartwright`
2020-12-06 05:52:47 +00:00
bors 4d26de6891 Auto merge of #79729 - matthiaskrgr:clones_, r=jyn514
remove redundant clones
2020-12-06 03:38:56 +00:00
Igor Matuszewski 7da967ca90 Bump Rustfmt to 1.4.29 2020-12-06 02:16:06 +01:00
bors ddafcc0b66 Auto merge of #79650 - the8472:fix-take, r=dtolnay
Fix incorrect io::Take's limit resulting from io::copy specialization

The specialization introduced in #75272 fails to update `io::Take` wrappers after performing the copy syscalls which bypass those wrappers. The buffer flushing before the copy does update them correctly, but the bytes copied after the initial flush weren't subtracted.

The fix is to subtract the bytes copied from each `Take` in the chain of wrappers, even when an error occurs during the syscall loop. To do so the `CopyResult` enum now has to carry the bytes copied so far in the error case.
2020-12-06 01:15:37 +00:00
bors bb0d481b5a Auto merge of #79697 - rylev:clearer-const-diagnostic, r=oli-obk
A slightly clearer diagnostic when misusing const

Fixes #79598

This produces the following diagnostic:
"expected one of `>`, a const expression, lifetime, or type, found keyword `const`"

Instead of the previous, more confusing:
"expected one of `>`, const, lifetime, or type, found keyword `const`"

This might not be completely clear as some users might not understand what a const expression is, but I do believe this is an improvement.
2020-12-05 22:47:37 +00:00
Nixon Enraght-Moony c254a15906 Use true ID for def_id. 2020-12-05 22:38:57 +00:00
xFrednet 898b7c594c Renamed the configuraiton to unreadable-literal-lint-fractions 2020-12-05 20:59:53 +00:00
bors e792288df3 Auto merge of #79685 - sivadeilra:fix_env_vars_win, r=davidtwco
Fix src/test/ui/env-vars.rs on 128-core machines on Windows

On Windows, the environment variable NUMBER_OF_PROCESSORS has special
meaning. Unfortunately, you can get different answers, depending on
whether you are enumerating all environment variables or querying a
specific variable. This was causing the src/test/ui/env-vars.rs test
to fail on machines with more than 64 processors when run on Windows.
2020-12-05 20:30:58 +00:00
bors 15eaa0020b Auto merge of #79719 - JohnTitor:nomicon, r=Mark-Simulacrum
Ping me when nomicon's toolstate is broken

So that I can notice the breakage easily.
2020-12-05 18:21:58 +00:00
Igor Matuszewski 2fa30ecf77 Add libc to rustc-workspace-hack 2020-12-05 18:08:33 +01:00
bors 5bb68c31f8 Auto merge of #79445 - SNCPlay42:struct-tail-recursion-limit, r=oli-obk
check the recursion limit when finding a struct's tail

fixes #79437

This does a `delay_span_bug` (via `ty_error_with_message`) rather than emit a new error message, under the assumption that there will be an error elsewhere (even if the type isn't infinitely recursive, just deeper than the recursion limit, this appears to be the case).
2020-12-05 15:58:06 +00:00
Igor Matuszewski bd37d7d827 Update RLS and Rustfmt 2020-12-05 16:40:24 +01:00
Ethan Brierley 6845e22bba Const parameters can not be inferred with _
Small improvement. Thanks varkor

Co-authored-by: varkor <github@varkor.com>

Bless
2020-12-05 15:37:59 +00:00
bors 9122b769c8 Auto merge of #78373 - matthewjasper:drop-on-into, r=pnkfelix
Don't leak return value after panic in drop

Closes #47949
2020-12-05 13:41:08 +00:00
Matthias Krüger 1734f9c291 remove redundant clones 2020-12-05 12:59:54 +01:00
bors 551a2c6cbc Auto merge of #79724 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/79709
Cc `@rust-lang/miri` r? `@ghost`
2020-12-05 11:24:40 +00:00
Ralf Jung e0e26b4bce update Miri 2020-12-05 10:02:18 +01:00
bors 8d678bcd2a Auto merge of #6418 - flip1995:apple_wraps_mhm, r=llogiq
Turn unnecessary_wraps applicability to MaybeIncorrect

Fixes: #6417

changelog: Turn [`unnecessary_wraps`] applicability to `MaybeIncorrect`
2020-12-05 08:42:21 +00:00
Yuki Okushi b1d78360f9 Ping me when nomicon's toolstate is broken 2020-12-05 12:05:03 +09:00
bors 0781b4474b Auto merge of #76301 - matklad:fmt-test, r=matklad
Cleanup: move format! ui tests to where they belong
2020-12-05 01:03:48 +00:00
Matthew Jasper 4fef39113a Avoid leaking block expression values 2020-12-04 23:07:46 +00:00
bors a5fbaed6c3 Auto merge of #79673 - ijackson:intoinnerintoinnererror, r=m-ou-se
Provide IntoInnerError::into_parts

Hi.  This is an updated version of the IntoInnerError bits of my previous portmanteau MR #78689.  Thanks to `@jyn514` and `@m-ou-se` for helpful comments there.

I have made this insta-stable since it seems like it will probably be uncontroversial, but that is definitely something that someone from the libs API team should be aware of and explicitly consider.

I included a tangentially-related commit providing documentation of the buffer full behaviiour of `&mut [u8] as Write`; the behaviour I am documenting is relied on by the doctest for `into_parts`.
2020-12-04 22:30:19 +00:00
Matthew Jasper 7f3e8551dd Use record_operands_moved more aggresively 2020-12-04 22:22:52 +00:00
Matthew Jasper b766abc88f Simplify unscheduling of drops after moves 2020-12-04 22:19:28 +00:00
xFrednet 18383c69c1 Updated code for CI 2020-12-04 22:05:52 +00:00
xFrednet 6edd598856 Added a lint-fraction-readability flag to the configuration 2020-12-04 21:26:47 +00:00
bors 3ff10e74a7 Auto merge of #79286 - TimDiekmann:rename-allocref, r=Lokathor,Wodann,m-ou-se
Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate`

Calling `Box::alloc_ref` and `Vec::alloc_ref` sounds like allocating a reference. To solve this ambiguity, this renames `AllocRef` to `Allocator` and `alloc` to `allocate`. For a more detailed explaination see https://github.com/rust-lang/wg-allocators/issues/76.

closes https://github.com/rust-lang/wg-allocators/issues/76

r? `@KodrAus`
`@rustbot` modify labels: +A-allocators +T-libs
`@rustbot` ping wg-allocators
2020-12-04 20:07:04 +00:00
Ian Jackson b777552167 IntoInnerError: Provide into_error
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-04 18:43:02 +00:00
Ian Jackson 19c7619dcd IntoInnerError: Provide into_parts
In particular, IntoIneerError only currently provides .error() which
returns a reference, not an owned value.  This is not helpful and
means that a caller of BufWriter::into_inner cannot acquire an owned
io::Error which seems quite wrong.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-04 18:43:02 +00:00
Ian Jackson db5d697004 std: impl of Write for &mut [u8]: document the buffer full error
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-04 18:38:44 +00:00
SNCPlay42 98fc02d6fa check the recursion limit when finding struct tail 2020-12-04 16:37:23 +00:00