]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoFix wording in `RawVec::from_raw_parts(_in)`
Tim Diekmann [Wed, 25 Mar 2020 18:08:56 +0000 (19:08 +0100)]
Fix wording in `RawVec::from_raw_parts(_in)`

4 years agoRemove check for ZST in `RawVec::needs_to_grow`
Tim Diekmann [Wed, 25 Mar 2020 17:46:01 +0000 (18:46 +0100)]
Remove check for ZST in `RawVec::needs_to_grow`

4 years agoRefine docs for `RawVec::from_raw_parts(_in)`
Tim Diekmann [Wed, 25 Mar 2020 17:44:29 +0000 (18:44 +0100)]
Refine docs for `RawVec::from_raw_parts(_in)`

4 years agoRemove the note on the internal capacity field in `RawVec`
Tim Diekmann [Wed, 25 Mar 2020 17:42:31 +0000 (18:42 +0100)]
Remove the note on the internal capacity field in `RawVec`

4 years agoFix assertion in `shrink` to use `capacity()` instead
Tim Diekmann [Wed, 25 Mar 2020 17:41:25 +0000 (18:41 +0100)]
Fix assertion in `shrink` to use `capacity()` instead

4 years agoFix comment in `RawVec::into_box()`
Tim Diekmann [Wed, 25 Mar 2020 17:39:52 +0000 (18:39 +0100)]
Fix comment in `RawVec::into_box()`

4 years agoFix ZST handling for `RawVec`
Tim Diekmann [Wed, 25 Mar 2020 17:36:03 +0000 (18:36 +0100)]
Fix ZST handling for `RawVec`

4 years agoAdd comment to `AllocRef` implementation for `System`
Tim Diekmann [Wed, 25 Mar 2020 17:30:14 +0000 (18:30 +0100)]
Add comment to `AllocRef` implementation for `System`

4 years agoUse `NonNull` instead of `Unique` in `MemoryBlock`
Tim Diekmann [Wed, 25 Mar 2020 17:26:38 +0000 (18:26 +0100)]
Use `NonNull` instead of `Unique` in `MemoryBlock`

4 years agoFix issues from review and unsoundness of `RawVec::into_box`
Tim Diekmann [Thu, 26 Mar 2020 16:11:47 +0000 (17:11 +0100)]
Fix issues from review and unsoundness of `RawVec::into_box`

4 years agoOverhaul of the `AllocRef` trait to match allocator-wg's latest consens
Tim Diekmann [Tue, 24 Mar 2020 10:45:38 +0000 (11:45 +0100)]
Overhaul of the `AllocRef` trait to match allocator-wg's latest consens

4 years agoAuto merge of #70427 - Centril:rollup-lrcad2c, r=Centril
bors [Thu, 26 Mar 2020 12:33:18 +0000 (12:33 +0000)]
Auto merge of #70427 - Centril:rollup-lrcad2c, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #68004 (permit negative impls for non-auto traits)
 - #70385 (Miri nits: comment and var name improvement)
 - #70411 (Fix for #62691: use the largest niche across all fields)
 - #70417 (parser: recover on `...` as a pattern, suggesting `..`)
 - #70424 (simplify match stmt)

Failed merges:

r? @ghost

4 years agoRollup merge of #70424 - lcnr:nit, r=Centril
Mazdak Farrokhzad [Thu, 26 Mar 2020 12:32:20 +0000 (13:32 +0100)]
Rollup merge of #70424 - lcnr:nit, r=Centril

simplify match stmt

We actually have a surprising amount of
```rust
match expr {
    $($p:pat)|+ => true,
    _ => false,
}
```
While I would prefer this to be replaced with `matches!`, most cases are
fairly readable anyway so we can just let them be for now.

4 years agoRollup merge of #70417 - rakshith-ravi:master, r=Centril
Mazdak Farrokhzad [Thu, 26 Mar 2020 12:32:18 +0000 (13:32 +0100)]
Rollup merge of #70417 - rakshith-ravi:master, r=Centril

parser: recover on `...` as a pattern, suggesting `..`

Fixes #70388

My first PR to rust. So please let me know if I'm doing something wrong.

4 years agoRollup merge of #70411 - ogoffart:fix-62691, r=eddyb
Mazdak Farrokhzad [Thu, 26 Mar 2020 12:32:17 +0000 (13:32 +0100)]
Rollup merge of #70411 - ogoffart:fix-62691, r=eddyb

Fix for #62691: use the largest niche across all fields

fixes #62691

(The second commit is a small optimization but it makes the code less pretty and i don't know if it is worth it.)

4 years agoRollup merge of #70385 - RalfJung:miri-nits, r=eddyb
Mazdak Farrokhzad [Thu, 26 Mar 2020 12:32:15 +0000 (13:32 +0100)]
Rollup merge of #70385 - RalfJung:miri-nits, r=eddyb

Miri nits: comment and var name improvement

r? @eddyb

4 years agoRollup merge of #68004 - nikomatsakis:negative-impls, r=varkor
Mazdak Farrokhzad [Thu, 26 Mar 2020 12:32:14 +0000 (13:32 +0100)]
Rollup merge of #68004 - nikomatsakis:negative-impls, r=varkor

permit negative impls for non-auto traits

This is a prototype impl that extends `impl !Trait` beyond auto traits. It is not integrated with coherence or anything else, and hence only serves to prevent downstream impls (but not to allow downstream crates to rely on the absence of such impls for coherence purposes).

Fixes https://github.com/rust-lang/rust/issues/66544

TODO:

- [x] need a test that you can't rely on negative impls for coherence purposes
- [x] test that negative impls cannot specialize positive ones
- [x] test that positive impls cannot specialize negative ones
- [x] extend negative impl to `Clone` in order to fully fix #66544
- [x] and maybe make `CoerceUnsized` unsafe? -- that problem is now split out into https://github.com/rust-lang/rust/issues/68015
- [x] introduce feature flag and prepare a write-up
- [x] improve diagnostics?

4 years agoReorganize a bit the code and add a comment
Olivier Goffart [Thu, 26 Mar 2020 12:14:25 +0000 (13:14 +0100)]
Reorganize a bit the code and add a comment

4 years agowip pacify the merciless ui tests
Niko Matsakis [Thu, 26 Mar 2020 11:41:26 +0000 (07:41 -0400)]
wip pacify the merciless ui tests

4 years agopacify the merciless x.py fmt
Niko Matsakis [Thu, 19 Mar 2020 17:55:46 +0000 (13:55 -0400)]
pacify the merciless x.py fmt

4 years agouse slice pattern instead of calling `is_empty()` and `[0]`
Niko Matsakis [Thu, 19 Mar 2020 17:51:00 +0000 (13:51 -0400)]
use slice pattern instead of calling `is_empty()` and `[0]`

4 years agoadd test for negative specializes negative
Niko Matsakis [Fri, 13 Mar 2020 18:43:34 +0000 (14:43 -0400)]
add test for negative specializes negative

4 years agomove stderr file too
Niko Matsakis [Fri, 13 Mar 2020 18:43:23 +0000 (14:43 -0400)]
move stderr file too

4 years agogive the negative-impls-builtin test a more sensible name
Niko Matsakis [Fri, 13 Mar 2020 18:41:43 +0000 (14:41 -0400)]
give the negative-impls-builtin test a more sensible name

4 years agocomment the `typeck-negative-impls-builtin` test
Niko Matsakis [Fri, 13 Mar 2020 18:40:29 +0000 (14:40 -0400)]
comment the `typeck-negative-impls-builtin` test

4 years agomove feature-gate-negative-impls test to traits/negative-impls
Niko Matsakis [Fri, 13 Mar 2020 18:34:58 +0000 (14:34 -0400)]
move feature-gate-negative-impls test to traits/negative-impls

4 years agoconvert to doc comments
Niko Matsakis [Fri, 13 Mar 2020 18:33:37 +0000 (14:33 -0400)]
convert to doc comments

4 years agobump negative impls version to 1.44.0
Niko Matsakis [Fri, 13 Mar 2020 18:32:48 +0000 (14:32 -0400)]
bump negative impls version to 1.44.0

4 years agocreate a tracking issue and link to it
Niko Matsakis [Fri, 17 Jan 2020 19:34:25 +0000 (14:34 -0500)]
create a tracking issue and link to it

4 years agointroduce `negative_impls` feature gate and document
Niko Matsakis [Thu, 9 Jan 2020 10:56:38 +0000 (05:56 -0500)]
introduce `negative_impls` feature gate and document

They used to be covered by `optin_builtin_traits` but negative impls
are now applicable to all traits, not just auto traits.

This also adds docs in the unstable book for the current state of auto traits.

4 years agomake a custom error for overlap with negative impls
Niko Matsakis [Wed, 8 Jan 2020 19:10:59 +0000 (14:10 -0500)]
make a custom error for overlap with negative impls

4 years agopermit negative impls for non-auto traits
Niko Matsakis [Wed, 8 Jan 2020 11:39:38 +0000 (06:39 -0500)]
permit negative impls for non-auto traits

4 years agosimplify match stmt
Bastian Kauschke [Thu, 26 Mar 2020 09:52:52 +0000 (10:52 +0100)]
simplify match stmt

4 years agoThrow error when encountering `...` instead of `..` while destructing a pattern
Rakshith Ravi [Thu, 26 Mar 2020 05:06:52 +0000 (10:36 +0530)]
Throw error when encountering `...` instead of `..` while destructing a pattern

Added tests and stderr output

4 years agoAuto merge of #70391 - RalfJung:miri, r=RalfJung
bors [Thu, 26 Mar 2020 07:36:21 +0000 (07:36 +0000)]
Auto merge of #70391 - RalfJung:miri, r=RalfJung

update miri

Usually I'd wait until https://github.com/rust-lang/rust/pull/70226 lands which will break Miri again, but... the queue is empty (!), so whatever.^^

r? @ghost Cc @oli-obk
Fixes https://github.com/rust-lang/rust/issues/70346

4 years agoupdate miri
Ralf Jung [Thu, 26 Mar 2020 07:21:30 +0000 (08:21 +0100)]
update miri

4 years agoAuto merge of #70415 - Centril:rollup-1zttfvl, r=Centril
bors [Thu, 26 Mar 2020 02:22:26 +0000 (02:22 +0000)]
Auto merge of #70415 - Centril:rollup-1zttfvl, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #69866 (Rename `def_span` to `guess_head_span`)
 - #69878 (Tweak chained operators diagnostic)
 - #70375 (avoid catching InterpError)
 - #70386 (typeck: minor pattern typing improvements)
 - #70389 (borrowck: prefer "value" over "`_`" in diagnostics)
 - #70395 (Update cargo.)

Failed merges:

r? @ghost

4 years agoRollup merge of #70395 - ehuss:update-cargo, r=ehuss
Mazdak Farrokhzad [Thu, 26 Mar 2020 02:21:33 +0000 (03:21 +0100)]
Rollup merge of #70395 - ehuss:update-cargo, r=ehuss

Update cargo.

8 commits in 7019b3ed3d539db7429d10a343b69be8c426b576..8a0d4d9c9abc74fd670353094387d62028b40ae9
2020-03-17 21:02:00 +0000 to 2020-03-24 17:57:04 +0000
- Re-implement proc-macro feature decoupling. (rust-lang/cargo#8028)
- Remove unused transitive dependencies: miniz_oxide, adler32 (rust-lang/cargo#8023)
- Fix bug with -Zfeatures=dev_dep and `check --profile=test`. (rust-lang/cargo#8027)
- Remove Config from CompileOptions. (rust-lang/cargo#8021)
- Add `rustless.org` to documented blocklist. (rust-lang/cargo#7922)
- Print colored warnings when build script panics (rust-lang/cargo#8017)
- Do not supply --crate-version flag to rustdoc if present in RUSTDOCFLAGS (rust-lang/cargo#8014)
- Add proc-macro to index, and new feature resolver. (rust-lang/cargo#8003)

4 years agoRollup merge of #70389 - Centril:borrowck-no-underscores, r=mark-i-m
Mazdak Farrokhzad [Thu, 26 Mar 2020 02:21:31 +0000 (03:21 +0100)]
Rollup merge of #70389 - Centril:borrowck-no-underscores, r=mark-i-m

borrowck: prefer "value" over "`_`" in diagnostics

Fixes https://github.com/rust-lang/rust/issues/67565.

r? @pnkfelix @matthewjasper
cc @mark-i-m

4 years agoRollup merge of #70386 - Centril:patty, r=estebank
Mazdak Farrokhzad [Thu, 26 Mar 2020 02:21:30 +0000 (03:21 +0100)]
Rollup merge of #70386 - Centril:patty, r=estebank

typeck: minor pattern typing improvements

r? @estebank

4 years agoRollup merge of #70375 - RalfJung:check-defined-err, r=oli-obk
Mazdak Farrokhzad [Thu, 26 Mar 2020 02:21:29 +0000 (03:21 +0100)]
Rollup merge of #70375 - RalfJung:check-defined-err, r=oli-obk

avoid catching InterpError

Avoid raising and then capturing `InterpError` for the definedness check.

Cc https://github.com/rust-lang/rust/issues/69297
r? @oli-obk

4 years agoRollup merge of #69878 - estebank:chained-ops, r=Centril
Mazdak Farrokhzad [Thu, 26 Mar 2020 02:21:27 +0000 (03:21 +0100)]
Rollup merge of #69878 - estebank:chained-ops, r=Centril

Tweak chained operators diagnostic

Use more selective spans
Improve suggestion output
Be more selective when displaying suggestions
Silence some knock-down type errors

r? @Centril

4 years agoRollup merge of #69866 - estebank:guess_head_span, r=eddyb
Mazdak Farrokhzad [Thu, 26 Mar 2020 02:21:26 +0000 (03:21 +0100)]
Rollup merge of #69866 - estebank:guess_head_span, r=eddyb

Rename `def_span` to `guess_head_span`

r? @eddyb

4 years agotypeck/pat: address review comments
Mazdak Farrokhzad [Thu, 26 Mar 2020 01:29:42 +0000 (02:29 +0100)]
typeck/pat: address review comments

4 years agoborrowck diagnostics: address review comments.
Mazdak Farrokhzad [Thu, 26 Mar 2020 00:55:16 +0000 (01:55 +0100)]
borrowck diagnostics: address review comments.

4 years agoreview comments
Esteban Küber [Thu, 26 Mar 2020 01:10:18 +0000 (18:10 -0700)]
review comments

4 years agoTweak chained operators diagnostic
Esteban Küber [Tue, 10 Mar 2020 03:21:37 +0000 (20:21 -0700)]
Tweak chained operators diagnostic

Use more selective spans
Improve suggestion output
Be more selective when displaying suggestions
Silence some knock-down type errors

4 years agoRename `def_span` to `guess_head_span`
Esteban Küber [Mon, 9 Mar 2020 18:42:37 +0000 (11:42 -0700)]
Rename `def_span` to `guess_head_span`

4 years agoRevert previous commit and make the optimisation in a nicer way
Olivier Goffart [Wed, 25 Mar 2020 23:10:14 +0000 (00:10 +0100)]
Revert previous commit and make the optimisation in a nicer way

4 years agoavoid catching InterpError
Ralf Jung [Tue, 24 Mar 2020 23:12:49 +0000 (00:12 +0100)]
avoid catching InterpError

4 years agoAuto merge of #70412 - Dylan-DPC:rollup-yuq2mfy, r=Dylan-DPC
bors [Wed, 25 Mar 2020 22:56:53 +0000 (22:56 +0000)]
Auto merge of #70412 - Dylan-DPC:rollup-yuq2mfy, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #69700 (Rename LayoutDetails to just Layout.)
 - #70392 (Make x.py compatible with python 3.8.)
 - #70406 (Clean up E0458 explanation)
 - #70407 (Avoid tagging as I-nominated on toolstate breakage)
 - #70409 (gitignore: allow target to be a symlink)

Failed merges:

 - #70375 (avoid catching InterpError)

r? @ghost

4 years agoRollup merge of #70409 - mathstuf:gitignore-target-symlink, r=Mark-Simulacrum
Dylan DPC [Wed, 25 Mar 2020 22:53:04 +0000 (23:53 +0100)]
Rollup merge of #70409 - mathstuf:gitignore-target-symlink, r=Mark-Simulacrum

gitignore: allow target to be a symlink

Following rust-lang/cargo#4944.

4 years agoRollup merge of #70407 - spastorino:avoid-nomination-on-toolstate-breakage, r=Mark...
Dylan DPC [Wed, 25 Mar 2020 22:53:03 +0000 (23:53 +0100)]
Rollup merge of #70407 - spastorino:avoid-nomination-on-toolstate-breakage, r=Mark-Simulacrum

Avoid tagging as I-nominated on toolstate breakage

r? @Mark-Simulacrum

4 years agoRollup merge of #70406 - GuillaumeGomez:cleanup-e0458, r=Dylan-DPC
Dylan DPC [Wed, 25 Mar 2020 22:53:01 +0000 (23:53 +0100)]
Rollup merge of #70406 - GuillaumeGomez:cleanup-e0458, r=Dylan-DPC

Clean up E0458 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70392 - brain0:fixxpy, r=Mark-Simulacrum
Dylan DPC [Wed, 25 Mar 2020 22:52:59 +0000 (23:52 +0100)]
Rollup merge of #70392 - brain0:fixxpy, r=Mark-Simulacrum

Make x.py compatible with python 3.8.

Python 3.8 removes the `time.clock()` function, use `time.perf_counter()` instead.

4 years agoRollup merge of #69700 - anyska:layout-details-rename, r=oli-obk
Dylan DPC [Wed, 25 Mar 2020 22:52:57 +0000 (23:52 +0100)]
Rollup merge of #69700 - anyska:layout-details-rename, r=oli-obk

Rename LayoutDetails to just Layout.

4 years agoOptimize slightly by avoiding to call Niche::reserve when not needed
Olivier Goffart [Wed, 25 Mar 2020 22:05:47 +0000 (23:05 +0100)]
Optimize slightly by avoiding to call Niche::reserve when not needed

4 years agoFix for #62691: use the largest niche across all fields
Olivier Goffart [Wed, 25 Mar 2020 21:42:13 +0000 (22:42 +0100)]
Fix for #62691: use the largest niche across all fields

fixes #62691

4 years agogitignore: allow target to be a symlink
Ben Boeckel [Wed, 25 Mar 2020 21:29:17 +0000 (17:29 -0400)]
gitignore: allow target to be a symlink

Following rust-lang/cargo#4944.

4 years agoRevert "Automatically tag as nominated for T-compiler"
Santiago Pastorino [Wed, 25 Mar 2020 20:15:12 +0000 (17:15 -0300)]
Revert "Automatically tag as nominated for T-compiler"

This reverts commit 46a8fcdf3cf0eb64b5ac70b4847f1facbdd12be1.

4 years agoClean up E0458 explanation
Guillaume Gomez [Wed, 25 Mar 2020 19:49:36 +0000 (20:49 +0100)]
Clean up E0458 explanation

4 years agoAuto merge of #70404 - Dylan-DPC:rollup-iikcm6r, r=Dylan-DPC
bors [Wed, 25 Mar 2020 19:42:22 +0000 (19:42 +0000)]
Auto merge of #70404 - Dylan-DPC:rollup-iikcm6r, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70226 (use checked casts and arithmetic in Miri engine)
 - #70319 (correctly normalize constants)
 - #70352 (Add long error explanation for E0710 )
 - #70366 (Implement Fuse with Option)
 - #70379 (fix incorrect type name in doc comments)

Failed merges:

 - #70375 (avoid catching InterpError)

r? @ghost

4 years agoRollup merge of #70379 - JOE1994:patch-2, r=petrochenkov
Dylan DPC [Wed, 25 Mar 2020 18:28:14 +0000 (19:28 +0100)]
Rollup merge of #70379 - JOE1994:patch-2, r=petrochenkov

fix incorrect type name in doc comments

Change : `InterpCtx` => `InterpCx`
(`rustc_mir::interpret::InterpCx`)

4 years agoRollup merge of #70366 - cuviper:option-fuse, r=dtolnay
Dylan DPC [Wed, 25 Mar 2020 18:28:12 +0000 (19:28 +0100)]
Rollup merge of #70366 - cuviper:option-fuse, r=dtolnay

Implement Fuse with Option

The former `done` flag was roughly similar to an `Option` tag, but left
the possibity of misuse. By using a real `Option`, we can set `None`
when the iterator is exhausted, removing any way to call it again. We
also allow niche layout this way, so the `Fuse` may be smaller.

The `FusedIterator` specialization does want to ignore the possibility
of exhaustion though, so it uses `unsafe { intrinsics::unreachable() }`
to optimize that branch away. The entire `Fuse` implementation is now
isolated in its own module to contain that unsafety.

r? @scottmcm

4 years agoRollup merge of #70352 - bishtpawan:doc/61137-add-long-error-code-e0710, r=Dylan-DPC
Dylan DPC [Wed, 25 Mar 2020 18:28:11 +0000 (19:28 +0100)]
Rollup merge of #70352 - bishtpawan:doc/61137-add-long-error-code-e0710, r=Dylan-DPC

Add long error explanation for E0710

Add long explanation for the E0710 error code
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #70319 - lcnr:issue63695, r=eddyb
Dylan DPC [Wed, 25 Mar 2020 18:28:09 +0000 (19:28 +0100)]
Rollup merge of #70319 - lcnr:issue63695, r=eddyb

correctly normalize constants

closes #70317

implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708

r? eddyb cc @varkor

4 years agoRollup merge of #70226 - RalfJung:checked, r=oli-obk
Dylan DPC [Wed, 25 Mar 2020 18:28:08 +0000 (19:28 +0100)]
Rollup merge of #70226 - RalfJung:checked, r=oli-obk

use checked casts and arithmetic in Miri engine

This is unfortunately pretty annoying because we have to cast back and forth between `u64` and `usize` more often that should be necessary, and that cast is considered fallible.

For example, should [this](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/value/enum.ConstValue.html) really be `usize`?

Also, `LayoutDetails` uses `usize` for field indices, but in Miri we use `u64` to be able to also handle array indexing. Maybe methods like `mplace_field` should be suitably generalized to accept both `u64` and `usize`?

r? @oli-obk Cc @eddyb

4 years agoimpl TrustedRandomAccess for Fuse without FusedIterator
Josh Stone [Wed, 25 Mar 2020 18:09:00 +0000 (11:09 -0700)]
impl TrustedRandomAccess for Fuse without FusedIterator

4 years agoUpdate cargo.
Eric Huss [Wed, 25 Mar 2020 16:03:01 +0000 (09:03 -0700)]
Update cargo.

4 years agoMake x.py compatible with python 3.8.
Thomas Bächler [Wed, 25 Mar 2020 15:11:04 +0000 (16:11 +0100)]
Make x.py compatible with python 3.8.

Python 3.8 removes the time.clock() function, use time.perf_counter() instead.

4 years agorun test only on 64bit
Bastian Kauschke [Wed, 25 Mar 2020 15:07:36 +0000 (16:07 +0100)]
run test only on 64bit

4 years agoRename LayoutDetails to just Layout.
Ana-Maria Mihalache [Wed, 4 Mar 2020 14:13:00 +0000 (14:13 +0000)]
Rename LayoutDetails to just Layout.

4 years agoadd usize methods for Size getters
Ralf Jung [Tue, 24 Mar 2020 16:13:26 +0000 (17:13 +0100)]
add usize methods for Size getters

4 years agogo back to infix ops for Size
Ralf Jung [Tue, 24 Mar 2020 15:43:50 +0000 (16:43 +0100)]
go back to infix ops for Size

4 years agoadd helper method for ptr ops on Scalar; reduce unnecessary large operand of overflow...
Ralf Jung [Tue, 24 Mar 2020 09:16:39 +0000 (10:16 +0100)]
add helper method for ptr ops on Scalar; reduce unnecessary large operand of overflowing_signed_offset

4 years agouse Size addition instead of checked int addition
Ralf Jung [Tue, 24 Mar 2020 09:07:46 +0000 (10:07 +0100)]
use Size addition instead of checked int addition

4 years agomake Size::from* methods generic in the integer type they accept
Ralf Jung [Sun, 22 Mar 2020 16:48:11 +0000 (17:48 +0100)]
make Size::from* methods generic in the integer type they accept

4 years agoremove unnecessary cast
Ralf Jung [Sat, 21 Mar 2020 16:28:46 +0000 (17:28 +0100)]
remove unnecessary cast

4 years agomiri: avoid a bunch of casts by offering usized-based field indexing
Ralf Jung [Sat, 21 Mar 2020 16:17:01 +0000 (17:17 +0100)]
miri: avoid a bunch of casts by offering usized-based field indexing

4 years agoavoid double-cast in mplace_field
Ralf Jung [Sat, 21 Mar 2020 15:28:34 +0000 (16:28 +0100)]
avoid double-cast in mplace_field

4 years agomake bit_width return u64, consistently with other sizes in the compiler
Ralf Jung [Sat, 21 Mar 2020 12:58:06 +0000 (13:58 +0100)]
make bit_width return u64, consistently with other sizes in the compiler

4 years agouse checked casts and arithmetic in Miri engine
Ralf Jung [Sat, 21 Mar 2020 12:49:02 +0000 (13:49 +0100)]
use checked casts and arithmetic in Miri engine

4 years agomiri: simplify shift operator overflow checking
Ralf Jung [Tue, 17 Mar 2020 13:11:51 +0000 (14:11 +0100)]
miri: simplify shift operator overflow checking

4 years agoAuto merge of #70297 - nnethercote:clean-up-debugging-options, r=michaelwoerister
bors [Wed, 25 Mar 2020 14:46:51 +0000 (14:46 +0000)]
Auto merge of #70297 - nnethercote:clean-up-debugging-options, r=michaelwoerister

Clean up debugging options

I found various sub-optimal things when I was looking at option handling.

4 years agoborrowck: prefer "value" over "`_`".
Mazdak Farrokhzad [Wed, 25 Mar 2020 10:17:06 +0000 (11:17 +0100)]
borrowck: prefer "value" over "`_`".

4 years agosimplify check_pat_tuple_struct
Mazdak Farrokhzad [Wed, 25 Mar 2020 08:32:39 +0000 (09:32 +0100)]
simplify check_pat_tuple_struct

4 years agorename def_id -> static_def_id
Ralf Jung [Wed, 25 Mar 2020 07:47:59 +0000 (08:47 +0100)]
rename def_id -> static_def_id

4 years agobetter explain GLOBAL_KIND choice
Ralf Jung [Wed, 25 Mar 2020 07:46:58 +0000 (08:46 +0100)]
better explain GLOBAL_KIND choice

4 years agoimprove non-exhaustive struct pat error
Mazdak Farrokhzad [Wed, 25 Mar 2020 07:35:17 +0000 (08:35 +0100)]
improve non-exhaustive struct pat error

4 years agois_union() instead of string comparsion
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:57:00 +0000 (06:57 +0100)]
is_union() instead of string comparsion

4 years agoupdate tool_lints
bishtpawan [Wed, 25 Mar 2020 06:02:23 +0000 (11:32 +0530)]
update tool_lints

4 years agoAuto merge of #70383 - Centril:rollup-hmfft3y, r=Centril
bors [Wed, 25 Mar 2020 05:46:43 +0000 (05:46 +0000)]
Auto merge of #70383 - Centril:rollup-hmfft3y, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #70331 (Increase verbosity when using update syntax with private fields)
 - #70349 (move `hir_id_validation` to `rustc_passes` + simplify `hir::map` code)
 - #70361 (Update backtrace crate to 0.3.46)
 - #70364 (resolve: Remove `rustc_attrs` as a standalone feature gate)
 - #70369 (Fix smaller issues with invalid placeholder type errors)
 - #70373 (normalize some imports & prefer direct ones)
 - #70376 (Add test for #66312)

Failed merges:

r? @ghost

4 years agoRollup merge of #70376 - tmandry:issue-66312, r=Centril
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:38 +0000 (06:45 +0100)]
Rollup merge of #70376 - tmandry:issue-66312, r=Centril

Add test for #66312

Closes #66312. This issue was fixed by #68884.

r? @Zoxc

4 years agoRollup merge of #70373 - Centril:canon-imports, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:36 +0000 (06:45 +0100)]
Rollup merge of #70373 - Centril:canon-imports, r=Mark-Simulacrum

normalize some imports & prefer direct ones

r? @Mark-Simulacrum

4 years agoRollup merge of #70369 - estebank:bad-placeholder-in-where, r=Centril
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:35 +0000 (06:45 +0100)]
Rollup merge of #70369 - estebank:bad-placeholder-in-where, r=Centril

Fix smaller issues with invalid placeholder type errors

Follow up to #70294.

- Fix placement of suggested generic param when bounds are present.
- Reduce error duplication for invalid placeholder types in `fn` types.

r? @Centril

4 years agoRollup merge of #70364 - petrochenkov:nofrustc, r=Centril
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:33 +0000 (06:45 +0100)]
Rollup merge of #70364 - petrochenkov:nofrustc, r=Centril

resolve: Remove `rustc_attrs` as a standalone feature gate

Now it only gates specific built-in attributes.

So if you want to make a rustc attribute, make it a built-in (this was already the case in practice for some time).

4 years agoRollup merge of #70361 - tmiasko:backtrace, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:32 +0000 (06:45 +0100)]
Rollup merge of #70361 - tmiasko:backtrace, r=Mark-Simulacrum

Update backtrace crate to 0.3.46

* Support line-tables-only when using libbacktrace
* Update libbacktrace to latest master
* Define HAVE_KERN_PROC on FreeBSD to fix rust-lang/rust#54434

4 years agoRollup merge of #70349 - Centril:hir-outa-rustc, r=Zoxc
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:30 +0000 (06:45 +0100)]
Rollup merge of #70349 - Centril:hir-outa-rustc, r=Zoxc

move `hir_id_validation` to `rustc_passes` + simplify `hir::map` code

r? @Zoxc

4 years agoRollup merge of #70331 - jeremystucki:privacy, r=estebank
Mazdak Farrokhzad [Wed, 25 Mar 2020 05:45:27 +0000 (06:45 +0100)]
Rollup merge of #70331 - jeremystucki:privacy, r=estebank

Increase verbosity when using update syntax with private fields

Resolves #70323

4 years agofix type name typo in doc comments
Youngsuk Kim [Wed, 25 Mar 2020 01:34:36 +0000 (21:34 -0400)]
fix type name typo in doc comments

InterpCtx => InterpCx
(rustc_mir::interpret::InterpCx)