]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAdd tests for asm!
Amanieu d'Antras [Thu, 20 Feb 2020 09:19:48 +0000 (09:19 +0000)]
Add tests for asm!

4 years agoImplement asm! codegen
Amanieu d'Antras [Mon, 17 Feb 2020 21:36:01 +0000 (21:36 +0000)]
Implement asm! codegen

4 years agoCheck that asm const operands are actually constants
Amanieu d'Antras [Mon, 17 Feb 2020 22:20:59 +0000 (22:20 +0000)]
Check that asm const operands are actually constants

4 years agoAdd asm! to MIR
Amanieu d'Antras [Fri, 14 Feb 2020 18:17:50 +0000 (18:17 +0000)]
Add asm! to MIR

4 years agoHIR passes for asm!
Amanieu d'Antras [Thu, 13 Feb 2020 11:00:55 +0000 (11:00 +0000)]
HIR passes for asm!

4 years agoImplement AST lowering for asm!
Amanieu d'Antras [Wed, 12 Feb 2020 15:48:03 +0000 (15:48 +0000)]
Implement AST lowering for asm!

4 years agoAdd asm! to HIR
Amanieu d'Antras [Wed, 12 Feb 2020 17:32:41 +0000 (17:32 +0000)]
Add asm! to HIR

4 years agoImplement asm! in librustc_builtin_macros
Amanieu d'Antras [Wed, 12 Feb 2020 15:47:43 +0000 (15:47 +0000)]
Implement asm! in librustc_builtin_macros

4 years agoAdd asm! to AST
Amanieu d'Antras [Wed, 22 Jan 2020 14:20:27 +0000 (14:20 +0000)]
Add asm! to AST

4 years agoAdd inline asm register definitions to librustc_target
Amanieu d'Antras [Wed, 22 Jan 2020 11:24:31 +0000 (11:24 +0000)]
Add inline asm register definitions to librustc_target

4 years agoAdd RISC-V target features
Amanieu d'Antras [Sun, 1 Mar 2020 09:52:04 +0000 (09:52 +0000)]
Add RISC-V target features

4 years agoAdd remote-test-client help text
Tom Eccles [Mon, 18 May 2020 11:32:58 +0000 (12:32 +0100)]
Add remote-test-client help text

4 years agoAuto merge of #72289 - RalfJung:abort_internal, r=Mark-Simulacrum
bors [Mon, 18 May 2020 11:11:19 +0000 (11:11 +0000)]
Auto merge of #72289 - RalfJung:abort_internal, r=Mark-Simulacrum

abort_internal is safe

`sys::abort_internal` is stably exposed as a safe function. Forward that assumption "inwards" to the `sys` module by making the function itself safe, too.

This corresponds to what https://github.com/rust-lang/rust/pull/72204 did for the intrinsic. We should probably wait until that lands because some of the intrinsic calls in this PR might then need adjustments.

4 years agoAuto merge of #72316 - RalfJung:rollup-70g6bln, r=RalfJung
bors [Mon, 18 May 2020 07:53:03 +0000 (07:53 +0000)]
Auto merge of #72316 - RalfJung:rollup-70g6bln, r=RalfJung

Rollup of 2 pull requests

Successful merges:

 - #72143 (make offset must_use)
 - #72307 (use the new interface to initialize conditional variables)

Failed merges:

r? @ghost

4 years agoAdd some more `rfold` implementations.
Nicholas Nethercote [Sun, 17 May 2020 23:34:34 +0000 (09:34 +1000)]
Add some more `rfold` implementations.

4 years agoRollup merge of #72307 - hermitcore:condvar, r=Mark-Simulacrum
Ralf Jung [Mon, 18 May 2020 06:48:45 +0000 (08:48 +0200)]
Rollup merge of #72307 - hermitcore:condvar, r=Mark-Simulacrum

use the new interface to initialize conditional variables

HermitCore introduce a new interface to intialize conditional variables.
Consequently, minor changes are required to support this interface.

4 years agoRollup merge of #72143 - rust-lang:steveklabnik-must-use, r=sfackler
Ralf Jung [Mon, 18 May 2020 06:48:43 +0000 (08:48 +0200)]
Rollup merge of #72143 - rust-lang:steveklabnik-must-use, r=sfackler

make offset must_use

https://djugei.github.io/bad-at-unsafe/ describes an error a user had when trying to use offset:

> At first I just assumed that the .add() and .offset() methods on pointers would mutate the pointer. They do not. Instead they return a new pointer, which gets dropped silently if you don't use it. Unlike for example Result, which is must_use annotated.

This PR only adds `offset`, because I wanted to float the idea; I'm imagining that there's more than just `add` and `offset` that could use this. I am also very open to re-wording the warning.

r? @rust-lang/libs

4 years agoTiny Vecs are dumb.
Nicholas Nethercote [Sun, 17 May 2020 19:28:14 +0000 (05:28 +1000)]
Tiny Vecs are dumb.

Currently, if you repeatedly push to an empty vector, the capacity
growth sequence is 0, 1, 2, 4, 8, 16, etc. This commit changes the
relevant code (the "amortized" growth strategy) to skip 1 and 2 in most
cases, instead using 0, 4, 8, 16, etc. (You can still get a capacity of
1 or 2 using the "exact" growth strategy, e.g. via `reserve_exact()`.)

This idea (along with the phrase "tiny Vecs are dumb") comes from the
"doubling" growth strategy that was removed from `RawVec` in #72013.
That strategy was barely ever used -- only when a `VecDeque` was grown,
oddly enough -- which is why it was removed in #72013.

(Fun fact: until just a few days ago, I thought the "doubling" strategy
was used for repeated push case. In other words, this commit makes
`Vec`s behave the way I always thought they behaved.)

This change reduces the number of allocations done by rustc itself by
10% or more. It speeds up rustc, and will also speed up any other Rust
program that uses `Vec`s a lot.

4 years agoAuto merge of #72300 - flip1995:clippyup, r=Mark-Simulacrum
bors [Mon, 18 May 2020 04:10:01 +0000 (04:10 +0000)]
Auto merge of #72300 - flip1995:clippyup, r=Mark-Simulacrum

Sync Clippy

cc rust-lang/rust-clippy#5608

Included changes:

- renames/merges of some lints
- ICE fix
- Downgrade useless_let_if_seq to nursery
- FP fixes
- formatting

r? @oli-obk

4 years agoAuto merge of #72269 - RalfJung:unsafe-borrow-of-packed, r=Mark-Simulacrum
bors [Mon, 18 May 2020 00:54:42 +0000 (00:54 +0000)]
Auto merge of #72269 - RalfJung:unsafe-borrow-of-packed, r=Mark-Simulacrum

move borrow-of-packed-field unsafety check out of loop

Looks like during the place refactoring, this code somehow got into this loop even though it does not actually depend on the loop variables.

4 years agominor changes to pass the format check
Stefan Lankes [Sun, 17 May 2020 22:06:32 +0000 (00:06 +0200)]
minor changes to pass the format check

4 years agouse new interface to initialize Condvar
Stefan Lankes [Sun, 17 May 2020 21:49:18 +0000 (23:49 +0200)]
use new interface to initialize Condvar

HermitCore introduce a new interface to intialize conditional variables.
Consequently, minor changes are required to support this interface.

4 years agoabort_internal is safe
Ralf Jung [Sun, 17 May 2020 17:37:44 +0000 (19:37 +0200)]
abort_internal is safe

4 years agoAuto merge of #72248 - petrochenkov:codemodel, r=Amanieu
bors [Sun, 17 May 2020 21:22:48 +0000 (21:22 +0000)]
Auto merge of #72248 - petrochenkov:codemodel, r=Amanieu

Cleanup and document `-C code-model`

r? @Amanieu

4 years agoTweak `partition`, `unzip`, `try_find`.
Nicholas Nethercote [Thu, 14 May 2020 04:40:58 +0000 (14:40 +1000)]
Tweak `partition`, `unzip`, `try_find`.

Many default iterator methods use `try_fold` or `fold`, and these ones
can too.

4 years agoMake `fold` standalone.
Nicholas Nethercote [Wed, 13 May 2020 23:39:50 +0000 (09:39 +1000)]
Make `fold` standalone.

`fold` is currently implemented via `try_fold`, but implementing it
directly results in slightly less LLVM IR being generated, speeding up
compilation of some benchmarks.

(And likewise for `rfold`.)

The commit adds `fold` implementations to all the iterators that lack
one but do have a `try_fold` implementation. Most of these just call the
`try_fold` implementation directly.

4 years agoImprove comments
Nadrieril [Sun, 17 May 2020 13:01:28 +0000 (14:01 +0100)]
Improve comments

4 years agoTest that NRVO elides the call to `memcpy`
Dylan MacKenzie [Sun, 17 May 2020 17:24:06 +0000 (10:24 -0700)]
Test that NRVO elides the call to `memcpy`

4 years agoDon't unleash NRVO const-eval test
Dylan MacKenzie [Sun, 17 May 2020 17:23:44 +0000 (10:23 -0700)]
Don't unleash NRVO const-eval test

4 years agoCache len in Fields
Nadrieril [Sun, 17 May 2020 13:58:26 +0000 (14:58 +0100)]
Cache len in Fields

4 years agotypo
Nadrieril [Sat, 9 May 2020 18:00:37 +0000 (19:00 +0100)]
typo

4 years agoFix bug just discovered
Nadrieril [Sat, 9 May 2020 14:17:16 +0000 (15:17 +0100)]
Fix bug just discovered

Suggested by matthewjasper here:
https://github.com/rust-lang/rust/pull/71930#issuecomment-626022502
I have no idea what this does but it seems to work.

4 years agoWe don't use tyerr anymore
Nadrieril [Sat, 9 May 2020 12:46:05 +0000 (13:46 +0100)]
We don't use tyerr anymore

This however unearthed a bug, hence the FIXME and the workaround.

4 years agoSmall allocation improvement
Nadrieril [Sat, 9 May 2020 12:49:04 +0000 (13:49 +0100)]
Small allocation improvement

4 years agoFilter out fields that should not be seen
Nadrieril [Sat, 9 May 2020 12:36:48 +0000 (13:36 +0100)]
Filter out fields that should not be seen

This was previously done by giving those fields the type tyerr. This was
a hack.

4 years agoMake all field-handling go through Fields
Nadrieril [Sat, 9 May 2020 11:46:42 +0000 (12:46 +0100)]
Make all field-handling go through Fields

4 years agoClarify specialize_one_pattern
Nadrieril [Sat, 9 May 2020 11:18:23 +0000 (12:18 +0100)]
Clarify specialize_one_pattern

Using a more error-oriented approache to `Option`.

4 years agoUse Fields as output to specialize_one_pattern
Nadrieril [Sat, 9 May 2020 11:00:34 +0000 (12:00 +0100)]
Use Fields as output to specialize_one_pattern

4 years agoFactor out a struct that holds subfields of a pattern
Nadrieril [Sat, 9 May 2020 10:32:54 +0000 (11:32 +0100)]
Factor out a struct that holds subfields of a pattern

4 years agoOnly need TyErr for uninhabited types
Nadrieril [Mon, 13 Apr 2020 16:45:12 +0000 (17:45 +0100)]
Only need TyErr for uninhabited types

4 years agoWe already handle arrays of unknown length correctly
Nadrieril [Mon, 13 Apr 2020 15:23:39 +0000 (16:23 +0100)]
We already handle arrays of unknown length correctly

4 years agoFactor the code that generates TyErrs
Nadrieril [Mon, 13 Apr 2020 14:16:43 +0000 (15:16 +0100)]
Factor the code that generates TyErrs

4 years agoFix incorrect ordering
Nadrieril [Wed, 6 May 2020 11:11:52 +0000 (12:11 +0100)]
Fix incorrect ordering

I introduced this mistake in 175976e2a2b03c3f347d4eff28661445c3c58372
and I can't quite remember what the reasoning was back then. I think I
modeled it on `apply_constructor`, not realizing there was an important
difference in the order in which fields were stored.

4 years agoAuto merge of #72295 - RalfJung:rollup-icmhbs7, r=RalfJung
bors [Sun, 17 May 2020 16:20:19 +0000 (16:20 +0000)]
Auto merge of #72295 - RalfJung:rollup-icmhbs7, r=RalfJung

Rollup of 3 pull requests

Successful merges:

 - #72259 (Disallow forbidden usage of non-ascii identifiers.)
 - #72261 (Break out early on empty span when generate_fn_span)
 - #72291 (bootstrap: fix typo)

Failed merges:

r? @ghost

4 years agoMerge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup
flip1995 [Sun, 17 May 2020 15:36:26 +0000 (17:36 +0200)]
Merge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup

4 years agomake many ptr functions must_use
Steve Klabnik [Tue, 12 May 2020 16:41:41 +0000 (11:41 -0500)]
make many ptr functions must_use

https://djugei.github.io/bad-at-unsafe/ describes an error a user had when trying to use offset:

> At first I just assumed that the .add() and .offset() methods on pointers would mutate the pointer. They do not. Instead they return a new pointer, which gets dropped silently if you don't use it. Unlike for example Result, which is must_use annotated.

4 years agoRollup merge of #72291 - RalfJung:format-typo, r=jonas-schievink
Ralf Jung [Sun, 17 May 2020 14:24:29 +0000 (16:24 +0200)]
Rollup merge of #72291 - RalfJung:format-typo, r=jonas-schievink

bootstrap: fix typo

4 years agoRollup merge of #72261 - csmoe:issue-72095, r=estebank
Ralf Jung [Sun, 17 May 2020 14:24:27 +0000 (16:24 +0200)]
Rollup merge of #72261 - csmoe:issue-72095, r=estebank

Break out early on empty span when generate_fn_span

Closes #72095
r? @oli-obk
cc @estebank @tmandry

4 years agoRollup merge of #72259 - crlf0710:ascii_only_check, r=petrochenkov
Ralf Jung [Sun, 17 May 2020 14:24:26 +0000 (16:24 +0200)]
Rollup merge of #72259 - crlf0710:ascii_only_check, r=petrochenkov

Disallow forbidden usage of non-ascii identifiers.

Part of RFC2457, this tightens allowed identifiers back to ascii only in two situations.

r? @petrochenkov

4 years agoAuto merge of #72204 - RalfJung:abort, r=Mark-Simulacrum
bors [Sun, 17 May 2020 12:49:01 +0000 (12:49 +0000)]
Auto merge of #72204 - RalfJung:abort, r=Mark-Simulacrum

make abort intrinsic safe, and correct its documentation

Turns out `std::process::abort` is not the same as the intrinsic, the comment was just wrong. Quoting from the unix implementation:
```
// On Unix-like platforms, libc::abort will unregister signal handlers
// including the SIGABRT handler, preventing the abort from being blocked, and
// fclose streams, with the side effect of flushing them so libc buffered
// output will be printed.  Additionally the shell will generally print a more
// understandable error message like "Abort trap" rather than "Illegal
// instruction" that intrinsics::abort would cause, as intrinsics::abort is
// implemented as an illegal instruction.
```

4 years agoAuto merge of #5568 - ThibsG:RenameIdentityConversionLint, r=flip1995
bors [Sun, 17 May 2020 11:29:04 +0000 (11:29 +0000)]
Auto merge of #5568 - ThibsG:RenameIdentityConversionLint, r=flip1995

Rename lint `identity_conversion` to `useless_conversion`

Lint name `identity_conversion` was misleading, so this PR renames it to `useless_conversion`.

As decision has not really came up in the issue comments, this PR will probably need discussion.

fixes #3106

changelog: Rename lint `identity_conversion` to `useless_conversion`

4 years agoAuto merge of #5529 - alex-700:improve-option-and-then-some-lint, r=phansch
bors [Sun, 17 May 2020 10:58:56 +0000 (10:58 +0000)]
Auto merge of #5529 - alex-700:improve-option-and-then-some-lint, r=phansch

Improve `option_and_then_some` lint

fixed #5492

changelog: Improve and generalize `option_and_then_some` and rename it to `bind_instead_of_map`.

4 years agoupdate tests
Bastian Kauschke [Sun, 17 May 2020 09:42:41 +0000 (11:42 +0200)]
update tests

4 years agobootstrap: fix typo
Ralf Jung [Sun, 17 May 2020 09:40:58 +0000 (11:40 +0200)]
bootstrap: fix typo

4 years agomake abort intrinsic safe, and correct its documentation
Ralf Jung [Sun, 17 May 2020 09:06:59 +0000 (11:06 +0200)]
make abort intrinsic safe, and correct its documentation

4 years agoAuto merge of #72135 - oli-obk:const_prop_deaggregates, r=wesleywiser
bors [Sun, 17 May 2020 09:18:12 +0000 (09:18 +0000)]
Auto merge of #72135 - oli-obk:const_prop_deaggregates, r=wesleywiser

Propagate locals, even if they have unpropagatable assignments somewhere

Second try for https://github.com/rust-lang/rust/pull/71946#discussion_r422967292

r? @wesleywiser

cc @rust-lang/wg-mir-opt @RalfJung

4 years agoimprove and generalize `option_and_then_some` lint
Aleksei Latyshev [Sat, 25 Apr 2020 20:33:11 +0000 (23:33 +0300)]
improve and generalize `option_and_then_some` lint

- rename it to bind_instead_of_map

4 years agoUpdate linker-plugin-lto.md to contain up to rust 1.43
Elichai Turkel [Sun, 17 May 2020 09:16:43 +0000 (12:16 +0300)]
Update linker-plugin-lto.md to contain up to rust 1.43

4 years agoLogically seperate lazy norm from `const_generics`
Bastian Kauschke [Sun, 17 May 2020 08:36:56 +0000 (10:36 +0200)]
Logically seperate lazy norm from `const_generics`

4 years agothe best way to fix bugs is by ignoring them
Bastian Kauschke [Tue, 12 May 2020 08:55:11 +0000 (10:55 +0200)]
the best way to fix bugs is by ignoring them

4 years agochalk
Bastian Kauschke [Tue, 12 May 2020 08:53:20 +0000 (10:53 +0200)]
chalk

4 years agocorrectly handle escaping bound variables
Bastian Kauschke [Fri, 8 May 2020 21:13:49 +0000 (23:13 +0200)]
correctly handle escaping bound variables

4 years agoadd docs
Bastian Kauschke [Fri, 8 May 2020 19:10:33 +0000 (21:10 +0200)]
add docs

4 years agomerge lazy_normalization_consts into const_generics
Bastian Kauschke [Fri, 15 May 2020 14:14:37 +0000 (16:14 +0200)]
merge lazy_normalization_consts into const_generics

4 years agoexplicitly handle errors in `select`
Bastian Kauschke [Thu, 7 May 2020 10:45:15 +0000 (12:45 +0200)]
explicitly handle errors in `select`

4 years agoexplicitly handle errors in fulfill
Bastian Kauschke [Thu, 7 May 2020 08:26:12 +0000 (10:26 +0200)]
explicitly handle errors in fulfill

4 years agoupdate tests and add relevant feature gate test
Bastian Kauschke [Tue, 5 May 2020 20:47:54 +0000 (22:47 +0200)]
update tests and add relevant feature gate test

4 years agokeep the good old lazy_normalization hack alive
Bastian Kauschke [Tue, 5 May 2020 20:47:47 +0000 (22:47 +0200)]
keep the good old lazy_normalization hack alive

4 years agoinitial cleanup
Bastian Kauschke [Tue, 5 May 2020 15:57:23 +0000 (17:57 +0200)]
initial cleanup

4 years agoPut lazy normalization behind a feature gate
Ben Lewis [Sat, 4 Jan 2020 05:54:19 +0000 (18:54 +1300)]
Put lazy normalization behind a feature gate

4 years agoAdd lazy normalization tests
Ben Lewis [Sat, 4 Jan 2020 00:42:02 +0000 (13:42 +1300)]
Add lazy normalization tests

4 years agoEmit `ConstEquate` obligation after checking/unifying for inference variables. This...
Ben Lewis [Thu, 2 Jan 2020 02:41:34 +0000 (15:41 +1300)]
Emit `ConstEquate` obligation after checking/unifying for inference variables. This means
a inference variable can be unified with an unevaluated const.

4 years agoAssume unevaluated consts are equal to the other consts and add ConstEquate obligatio...
Ben Lewis [Fri, 28 Feb 2020 21:03:04 +0000 (10:03 +1300)]
Assume unevaluated consts are equal to the other consts and add ConstEquate obligation. This delays
the need to evaluate consts eagerly and therefore gets around const eval query cycles.

4 years agoAuto merge of #72208 - tmandry:fix-fuchsia-solink, r=Mark-Simulacrum
bors [Sun, 17 May 2020 05:58:54 +0000 (05:58 +0000)]
Auto merge of #72208 - tmandry:fix-fuchsia-solink, r=Mark-Simulacrum

Don't pass --dynamic-linker for Fuchsia dylibs

This was causing a PT_INTERP header in Fuchsia dylibs (implying that
they're executable when they're not).

r? @Mark-Simulacrum
cc @frobtech @petrhosek

4 years agoAuto merge of #5608 - flip1995:rustup, r=phansch
bors [Sun, 17 May 2020 05:41:39 +0000 (05:41 +0000)]
Auto merge of #5608 - flip1995:rustup, r=phansch

Rustup with git subtree

The commits from the last rustup #5587, are again included in this rustup, since I rebased the rustup. Lesson learned: never rebase, only merge when working with git subtree.

changelog: none

4 years agoBless mir-opt tests to account for #72220
Wesley Wiser [Sun, 17 May 2020 02:12:01 +0000 (22:12 -0400)]
Bless mir-opt tests to account for #72220

4 years agoAuto merge of #72286 - Dylan-DPC:rollup-n3rk6df, r=Dylan-DPC
bors [Sun, 17 May 2020 01:31:15 +0000 (01:31 +0000)]
Auto merge of #72286 - Dylan-DPC:rollup-n3rk6df, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #72233 (Fix {:#?} representation of proc_macro::Literal)
 - #72277 (emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop)
 - #72281 (Fix whitespace in `?Sized` structured suggestion)
 - #72282 (Fix issue number typo in note)

Failed merges:

r? @ghost

4 years ago`ret` has been optimized away in debuginfo test
Dylan MacKenzie [Sat, 16 May 2020 20:56:51 +0000 (13:56 -0700)]
`ret` has been optimized away in debuginfo test

4 years agoDisable MIR optimization for alignment codegen tests
Dylan MacKenzie [Sat, 16 May 2020 20:42:41 +0000 (13:42 -0700)]
Disable MIR optimization for alignment codegen tests

NRVO optimizes away the locals whose alignment is tested. I don't think
this affects the purpose of the test.

4 years agoName return place in debuginfo if it is a user variable
Dylan MacKenzie [Sat, 16 May 2020 20:41:30 +0000 (13:41 -0700)]
Name return place in debuginfo if it is a user variable

4 years agoTest that Miri can handle MIR with NRVO applied
Dylan MacKenzie [Sat, 16 May 2020 19:15:25 +0000 (12:15 -0700)]
Test that Miri can handle MIR with NRVO applied

4 years agoExpand comment with possible improvements
Dylan MacKenzie [Sat, 16 May 2020 18:59:30 +0000 (11:59 -0700)]
Expand comment with possible improvements

4 years agoAdd simple NRVO test
Dylan MacKenzie [Fri, 15 May 2020 21:57:42 +0000 (14:57 -0700)]
Add simple NRVO test

4 years agoBless MIR tests that inline functions qualifying for NRVO
Dylan MacKenzie [Fri, 15 May 2020 21:53:20 +0000 (14:53 -0700)]
Bless MIR tests that inline functions qualifying for NRVO

4 years agoDumb NRVO
Dylan MacKenzie [Thu, 14 May 2020 17:11:15 +0000 (10:11 -0700)]
Dumb NRVO

4 years agoRollup merge of #72282 - jonas-schievink:issue-typo, r=Dylan-DPC
Dylan DPC [Sat, 16 May 2020 23:51:35 +0000 (01:51 +0200)]
Rollup merge of #72282 - jonas-schievink:issue-typo, r=Dylan-DPC

Fix issue number typo in note

4 years agoRollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC
Dylan DPC [Sat, 16 May 2020 23:51:33 +0000 (01:51 +0200)]
Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC

Fix whitespace in `?Sized` structured suggestion

4 years agoRollup merge of #72277 - RalfJung:manually-drop-docs, r=Mark-Simulacrum
Dylan DPC [Sat, 16 May 2020 23:51:31 +0000 (01:51 +0200)]
Rollup merge of #72277 - RalfJung:manually-drop-docs, r=Mark-Simulacrum

emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop

This seems to sometimes confused people, and generally seems reasonable to state in the top-level summary of the type.

4 years agoRollup merge of #72233 - dtolnay:literal, r=petrochenkov
Dylan DPC [Sat, 16 May 2020 23:51:30 +0000 (01:51 +0200)]
Rollup merge of #72233 - dtolnay:literal, r=petrochenkov

Fix {:#?} representation of proc_macro::Literal

Before:

```rust
TokenStream [
    Ident {
        ident: "name",
        span: #0 bytes(37..41),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(42..43),
    },
    Literal { lit: Lit { kind: Str, symbol: "SNPP", suffix: None }, span: Span { lo: BytePos(44), hi: BytePos(50), ctxt: #0 } },
    Punct {
        ch: ',',
        spacing: Alone,
        span: #0 bytes(50..51),
    },
    Ident {
        ident: "owner",
        span: #0 bytes(56..61),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(62..63),
    },
    Literal { lit: Lit { kind: Str, symbol: "Canary M Burns", suffix: None }, span: Span { lo: BytePos(64), hi: BytePos(80), ctxt: #0 } },
]
```

After:

```rust
TokenStream [
    Ident {
        ident: "name",
        span: #0 bytes(37..41),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(42..43),
    },
    Literal {
        kind: Str,
        symbol: "SNPP",
        suffix: None,
        span: #0 bytes(44..50),
    },
    Punct {
        ch: ',',
        spacing: Alone,
        span: #0 bytes(50..51),
    },
    Ident {
        ident: "owner",
        span: #0 bytes(56..61),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(62..63),
    },
    Literal {
        kind: Str,
        symbol: "Canary M Burns",
        suffix: None,
        span: #0 bytes(64..80),
    },
]
```

4 years agoRun fmt
flip1995 [Sat, 16 May 2020 23:18:43 +0000 (01:18 +0200)]
Run fmt

4 years agoRe-remove util/dev
flip1995 [Sat, 16 May 2020 23:14:28 +0000 (01:14 +0200)]
Re-remove util/dev

Maybe someday, git subtree will do it right

4 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Sat, 16 May 2020 23:13:02 +0000 (01:13 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

4 years agoAuto merge of #72178 - tmiasko:inliner-lifetimes, r=nikic
bors [Sat, 16 May 2020 22:16:48 +0000 (22:16 +0000)]
Auto merge of #72178 - tmiasko:inliner-lifetimes, r=nikic

Consistently use LLVM lifetime markers during codegen

Ensure that inliner inserts lifetime markers if they have been emitted during
codegen. Otherwise if allocas from inlined functions are merged together,
lifetime markers from one function might invalidate load & stores performed
by the other one.

Fixes #72154.

4 years agosimplify multispan_sugg interface
Aleksei Latyshev [Sat, 25 Apr 2020 17:52:00 +0000 (20:52 +0300)]
simplify multispan_sugg interface

- add `multispan_sugg_with_applicability`
- not it gets `&str` instead of `String`, like in `diag.multispan_suggestion`

4 years agoImprove documentation for drop elaboration
Jonas Schievink [Sat, 16 May 2020 20:10:05 +0000 (22:10 +0200)]
Improve documentation for drop elaboration

4 years agoRename lint `identity_conversion` to `useless_conversion`
ThibsG [Mon, 4 May 2020 15:09:02 +0000 (17:09 +0200)]
Rename lint `identity_conversion` to `useless_conversion`

4 years agoAuto merge of #5563 - ThibsG:MergeLints, r=flip1995
bors [Sat, 16 May 2020 20:17:11 +0000 (20:17 +0000)]
Auto merge of #5563 - ThibsG:MergeLints, r=flip1995

Merge some lints together

This PR merges following lints:

- `block_in_if_condition_expr` and `block_in_if_condition_stmt` → `blocks_in_if_conditions`
- `option_map_unwrap_or`, `option_map_unwrap_or_else` and `result_map_unwrap_or_else` → `map_unwrap`
- `option_unwrap_used` and `result_unwrap_used` → `unwrap_used`
- `option_expect_used` and `result_expect_used` → `expect_used`
- `wrong_pub_self_convention` into `wrong_self_convention`
- `for_loop_over_option` and `for_loop_over_result` → `for_loops_over_fallibles`

Lints that have already been merged since the issue was created:
- [x] `new_without_default` and `new_without_default_derive` → `new_without_default`

Need more discussion:
- `string_add` and `string_add_assign`: do we agree to merge them or not? Is there something more to do? → **not merge finally**
- `identity_op` and `modulo_one` → `useless_arithmetic`: seems outdated, since `modulo_arithmetic` has been created.

fixes #1078

changelog: Merging some lints together:
- `block_in_if_condition_expr` and `block_in_if_condition_stmt` → `blocks_in_if_conditions`
- `option_map_unwrap_or`, `option_map_unwrap_or_else` and `result_map_unwrap_or_else` → `map_unwrap_or`
- `option_unwrap_used` and `result_unwrap_used` → `unwrap_used`
- `option_expect_used` and `result_expect_used` → `expect_used`
- `for_loop_over_option` and `for_loop_over_result` → `for_loops_over_fallibles`

4 years agoFix issue number typo in note
Jonas Schievink [Sat, 16 May 2020 20:10:28 +0000 (22:10 +0200)]
Fix issue number typo in note

4 years agoFix whitespace in `?Sized` structured suggestion
Esteban Küber [Sat, 16 May 2020 19:56:21 +0000 (12:56 -0700)]
Fix whitespace in `?Sized` structured suggestion

4 years agoemphasize that ManuallyDrop is safe-to-access and unsafe-to-drop
Ralf Jung [Sat, 16 May 2020 09:14:00 +0000 (11:14 +0200)]
emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop