]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #70048 - TyPR124:mutable_osstr, r=dtolnay
Dylan DPC [Fri, 27 Mar 2020 00:23:51 +0000 (01:23 +0100)]
Rollup merge of #70048 - TyPR124:mutable_osstr, r=dtolnay

Allow obtaining &mut OsStr

```rust
impl DerefMut for OsString {...}              // type Target = OsStr
impl IndexMut<RangeFull> for OsString {...}   // type Output = OsStr
```

---

This change is pulled out of #69937 per @dtolnay

This implements `DerefMut for OsString` to allow obtaining a `&mut OsStr`. This also implements `IndexMut for OsString`, which is used by `DerefMut`. This pattern is the same as is used by `Deref`.

This is necessary to for methods like `make_ascii_lowercase` which need to mutate the underlying value.

4 years agoRollup merge of #69936 - Aaron1011:fix/suggestion-cycle, r=varkor
Dylan DPC [Fri, 27 Mar 2020 00:23:49 +0000 (01:23 +0100)]
Rollup merge of #69936 - Aaron1011:fix/suggestion-cycle, r=varkor

Fix cycle error when emitting suggestion for mismatched `fn` type

Fixes #66667

Previously, we called `tcx.typeck_tables_of` when determining whether or
not to emit a suggestion for a type error. However, we might already be
type-checking the `DefId` we pass to `typeck_tables_of` (it could be
anywhere in the query stack).

Fortunately, we only need the function signature, not the entire
`TypeckTables`. By using `tcx.fn_sig`, we avoid the possibility of cycle
errors while retaining the ability to emit a suggestion.

4 years agoRollup merge of #69644 - ecstatic-morse:unified-dataflow-cleanup, r=eddyb
Dylan DPC [Fri, 27 Mar 2020 00:23:47 +0000 (01:23 +0100)]
Rollup merge of #69644 - ecstatic-morse:unified-dataflow-cleanup, r=eddyb

Remove framework in `dataflow/mod.rs` in favor of "generic" one

This is the culmination of the work described in rust-lang/compiler-team#202. All dataflow analyses (including the one in `clippy`) have been ported to use the framework in `dataflow/generic`, which can efficiently handle both gen/kill and generic problems. This PR moves the framework in `dataflow/generic` to `dataflow/framework`, and removes the gen/kill framework in `dataflow/mod.rs`.

More comprehensive documentation for the new framework is tracked in rust-lang/rustc-guide#564.

`clippy` will need to change the path it uses to import the dataflow analysis traits.

4 years agoMake `framework` a private module
Dylan MacKenzie [Mon, 2 Mar 2020 17:43:18 +0000 (09:43 -0800)]
Make `framework` a private module

4 years agoUpdate `framework` module docs
Dylan MacKenzie [Mon, 2 Mar 2020 17:40:58 +0000 (09:40 -0800)]
Update `framework` module docs

4 years agoMove `BottomValue` into `framework/mod.rs`
Dylan MacKenzie [Mon, 2 Mar 2020 17:32:12 +0000 (09:32 -0800)]
Move `BottomValue` into `framework/mod.rs`

4 years agoUpdate imports from `dataflow::generic` to `dataflow`
Dylan MacKenzie [Sat, 29 Feb 2020 06:02:20 +0000 (22:02 -0800)]
Update imports from `dataflow::generic` to `dataflow`

4 years agoUpdate use statements in `dataflow/mod.rs`
Dylan MacKenzie [Sat, 29 Feb 2020 05:55:41 +0000 (21:55 -0800)]
Update use statements in `dataflow/mod.rs`

4 years agoRename `dataflow::generic` to `dataflow::framework`
Dylan MacKenzie [Sat, 29 Feb 2020 05:49:33 +0000 (21:49 -0800)]
Rename `dataflow::generic` to `dataflow::framework`

4 years agoMove `MoveDataParamEnv` to beginning of module
Dylan MacKenzie [Sat, 29 Feb 2020 05:47:36 +0000 (21:47 -0800)]
Move `MoveDataParamEnv` to beginning of module

4 years agoRemove `BitDenotation` framework
Dylan MacKenzie [Sat, 29 Feb 2020 05:42:20 +0000 (21:42 -0800)]
Remove `BitDenotation` framework

4 years agoAuto merge of #70441 - Dylan-DPC:rollup-qv7h2ph, r=Dylan-DPC
bors [Thu, 26 Mar 2020 20:45:47 +0000 (20:45 +0000)]
Auto merge of #70441 - Dylan-DPC:rollup-qv7h2ph, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #70384 (Refactor object file handling)
 - #70397 (add 'fn write_u16s' to Memory)
 - #70413 (Fix incorrect pattern warning "unreachable pattern")
 - #70428 (`error_bad_item_kind`: add help text)
 - #70429 (Clean up E0459 explanation)
 - #70437 (Miri float->int casts: be explicit that this is saturating)

Failed merges:

r? @ghost

4 years agoRollup merge of #70437 - RalfJung:miri-saturate, r=hanna-kruppe
Dylan DPC [Thu, 26 Mar 2020 20:44:09 +0000 (21:44 +0100)]
Rollup merge of #70437 - RalfJung:miri-saturate, r=hanna-kruppe

Miri float->int casts: be explicit that this is saturating

r? @hanna-kruppe
Cc https://github.com/rust-lang/miri/issues/1264

4 years agoRollup merge of #70429 - GuillaumeGomez:cleanup-e0459, r=Dylan-DPC
Dylan DPC [Thu, 26 Mar 2020 20:44:08 +0000 (21:44 +0100)]
Rollup merge of #70429 - GuillaumeGomez:cleanup-e0459, r=Dylan-DPC

Clean up E0459 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70428 - Centril:move-to-mod, r=petrochenkov
Dylan DPC [Thu, 26 Mar 2020 20:44:06 +0000 (21:44 +0100)]
Rollup merge of #70428 - Centril:move-to-mod, r=petrochenkov

`error_bad_item_kind`: add help text

For example, this adds:
```
    = help: consider moving the `use` import out to a nearby module scope
```
r? @petrochenkov @estebank

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

4 years agoRollup merge of #70413 - AminArria:match-pattern-incorrect-warning, r=Centril,Nadrier...
Dylan DPC [Thu, 26 Mar 2020 20:44:05 +0000 (21:44 +0100)]
Rollup merge of #70413 - AminArria:match-pattern-incorrect-warning, r=Centril,Nadrieril,varkor

Fix incorrect pattern warning "unreachable pattern"

Fixes #70372

Added `is_under_guard` parameter to `_match::is_useful` and only add it to the matrix if `false`

Tested with:
```rust
#![feature(or_patterns)]
fn main() {
    match (3,42) {
        (a,_) | (_,a) if a > 10 => {println!("{}", a)}
        _ => ()
    }

    match Some((3,42)) {
        Some((a, _)) | Some((_, a)) if a > 10 => {println!("{}", a)}
        _ => ()

    }

    match Some((3,42)) {
        Some((a, _) | (_, a)) if a > 10 => {println!("{}", a)}
        _ => ()
    }
}
```

4 years agoRollup merge of #70397 - JOE1994:write_wide_str, r=RalfJung
Dylan DPC [Thu, 26 Mar 2020 20:44:03 +0000 (21:44 +0100)]
Rollup merge of #70397 - JOE1994:write_wide_str, r=RalfJung

add 'fn write_u16s' to Memory

Added new function `Memory::write_u16s`. Needed in `MIRI` for implementing helper function to write wide_str to memory (for Windows).

4 years agoRollup merge of #70384 - nnethercote:refactor-object-file-handling, r=alexcrichton
Dylan DPC [Thu, 26 Mar 2020 20:44:02 +0000 (21:44 +0100)]
Rollup merge of #70384 - nnethercote:refactor-object-file-handling, r=alexcrichton

Refactor object file handling

Some preliminary clean-ups that grease the path to #66961.

r? @alexcrichton

4 years agoMiri float->int casts: be explicit that this is saturating
Ralf Jung [Thu, 26 Mar 2020 18:09:31 +0000 (19:09 +0100)]
Miri float->int casts: be explicit that this is saturating

4 years agoAdd tests based on issue #70372 comments
Amin Arria [Thu, 26 Mar 2020 01:34:24 +0000 (22:34 -0300)]
Add tests based on issue #70372 comments

4 years agoFix incorrect pattern warning "unreachable pattern"
Amin Arria [Wed, 25 Mar 2020 23:07:01 +0000 (20:07 -0300)]
Fix incorrect pattern warning "unreachable pattern"

- Added is_under_guard parameter to _match::is_useful and
  only add to the matrix if false
- Added comments explaining behavior

4 years agoadd 'fn write_u16s'(rustc_mir::interpret::Memory)
JOE1994 [Wed, 25 Mar 2020 17:07:08 +0000 (13:07 -0400)]
add 'fn write_u16s'(rustc_mir::interpret::Memory)

4 years agoClean up E0459 explanation
Guillaume Gomez [Thu, 26 Mar 2020 13:21:05 +0000 (14:21 +0100)]
Clean up E0459 explanation

4 years agoerror_bad_item_kind: add help text
Mazdak Farrokhzad [Thu, 26 Mar 2020 13:13:50 +0000 (14:13 +0100)]
error_bad_item_kind: add help text

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 agoConvert a chained if-else to a match.
Nicholas Nethercote [Thu, 26 Mar 2020 02:53:03 +0000 (13:53 +1100)]
Convert a chained if-else to a match.

It makes things a little clearer.

4 years agoIntroduce `EmitObj`.
Nicholas Nethercote [Tue, 24 Mar 2020 01:24:52 +0000 (12:24 +1100)]
Introduce `EmitObj`.

Currently, there are three fields in `ModuleConfig` that dictate
how object files are emitted: `emit_obj`, `obj_is_bitcode`, and
`embed_bitcode`.

Some of the combinations of these fields are nonsensical, in particular
having both `obj_is_bitcode` and `embed_bitcode` true at the same time.

Also, currently:
- we needlessly emit and then delete a bytecode file if `obj_is_bitcode`
  is true but `emit_obj` is false;
- we needlessly embed bitcode in the LLVM module if `embed_bitcode` is
  true and `emit_obj` is false.

This commit combines the three fields into one, with a new type
`EmitObj` (and the auxiliary `BitcodeSection`) which can encode five
different possibilities.

In the old code, `set_flags` would set `obj_is_bitcode` and
`embed_bitcode` on all three of the configs (`modules`, `allocator`,
`metadata`) if the relevant other conditions were met, even if no object
code needed to be emitted for one or more of them. Whereas
`start_async_codegen` would set `emit_obj`, but only for those configs
that need it.

In the new code, `start_async_codegen` does all the work of setting
`emit_obj`, and it only does that for the configs that need it.
`set_flags` no longer sets anything related to object file emission.

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 "`_`".