Commit Graph

109097 Commits

Author SHA1 Message Date
Dylan DPC
de3d1e9fa9
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).
2020-03-26 21:44:03 +01:00
Dylan DPC
b15423e72e
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
2020-03-26 21:44:02 +01:00
JOE1994
4538f8953b add 'fn write_u16s'(rustc_mir::interpret::Memory) 2020-03-26 11:01:21 -04:00
bors
2fbb07525e 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
2020-03-26 12:33:18 +00:00
Mazdak Farrokhzad
608715bbd1
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.
2020-03-26 13:32:20 +01:00
Mazdak Farrokhzad
37e186087c
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.
2020-03-26 13:32:18 +01:00
Mazdak Farrokhzad
f9d1378dd4
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.)
2020-03-26 13:32:17 +01:00
Mazdak Farrokhzad
20771ae5b9
Rollup merge of #70385 - RalfJung:miri-nits, r=eddyb
Miri nits: comment and var name improvement

r? @eddyb
2020-03-26 13:32:15 +01:00
Mazdak Farrokhzad
b0a63cb932
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?
2020-03-26 13:32:14 +01:00
Olivier Goffart
0b00c20465 Reorganize a bit the code and add a comment 2020-03-26 13:14:25 +01:00
Niko Matsakis
0d0702623f wip pacify the merciless ui tests 2020-03-26 07:41:26 -04:00
Niko Matsakis
011215b2c7 pacify the merciless x.py fmt 2020-03-26 06:52:58 -04:00
Niko Matsakis
c35801e160 use slice pattern instead of calling is_empty() and [0] 2020-03-26 06:52:58 -04:00
Niko Matsakis
b9e09d8f65 add test for negative specializes negative 2020-03-26 06:52:58 -04:00
Niko Matsakis
f5c09ed344 move stderr file too 2020-03-26 06:52:58 -04:00
Niko Matsakis
644b9a0a94 give the negative-impls-builtin test a more sensible name 2020-03-26 06:52:58 -04:00
Niko Matsakis
7107f6e606 comment the typeck-negative-impls-builtin test 2020-03-26 06:52:58 -04:00
Niko Matsakis
f66284778a move feature-gate-negative-impls test to traits/negative-impls 2020-03-26 06:52:58 -04:00
Niko Matsakis
73a55009ac convert to doc comments 2020-03-26 06:52:58 -04:00
Niko Matsakis
68aa798436 bump negative impls version to 1.44.0 2020-03-26 06:52:58 -04:00
Niko Matsakis
cc0d6d03f6 create a tracking issue and link to it 2020-03-26 06:52:57 -04:00
Niko Matsakis
fda3378e3f 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.
2020-03-26 06:52:55 -04:00
Niko Matsakis
65071708f8 make a custom error for overlap with negative impls 2020-03-26 06:52:26 -04:00
Niko Matsakis
e8a05e201e permit negative impls for non-auto traits 2020-03-26 06:27:45 -04:00
Bastian Kauschke
c21e25c262 simplify match stmt 2020-03-26 10:52:52 +01:00
Rakshith Ravi
73c82030e8 Throw error when encountering ... instead of .. while destructing a pattern
Added tests and stderr output
2020-03-26 13:25:34 +05:30
bors
3b1d735118 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
2020-03-26 07:36:21 +00:00
Ralf Jung
5d12f22f35 update miri 2020-03-26 08:21:30 +01:00
Nicholas Nethercote
a50cca920d Convert a chained if-else to a match.
It makes things a little clearer.
2020-03-26 13:53:03 +11:00
Nicholas Nethercote
87ef16c9dc 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.
2020-03-26 13:49:02 +11:00
bors
a17dd36084 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
2020-03-26 02:22:26 +00:00
Mazdak Farrokhzad
16e9d3f0ca
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)
2020-03-26 03:21:33 +01:00
Mazdak Farrokhzad
7db48250cd
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
2020-03-26 03:21:31 +01:00
Mazdak Farrokhzad
ca7dfb1cfa
Rollup merge of #70386 - Centril:patty, r=estebank
typeck: minor pattern typing improvements

r? @estebank
2020-03-26 03:21:30 +01:00
Mazdak Farrokhzad
ef01fe6bbc
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
2020-03-26 03:21:29 +01:00
Mazdak Farrokhzad
9fa4953aa4
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
2020-03-26 03:21:27 +01:00
Mazdak Farrokhzad
b105ac4018
Rollup merge of #69866 - estebank:guess_head_span, r=eddyb
Rename `def_span` to `guess_head_span`

r? @eddyb
2020-03-26 03:21:26 +01:00
Mazdak Farrokhzad
da10963357 typeck/pat: address review comments 2020-03-26 02:29:42 +01:00
Mazdak Farrokhzad
632c0af38f borrowck diagnostics: address review comments. 2020-03-26 02:13:17 +01:00
Esteban Küber
4832f3fd5d review comments 2020-03-25 18:10:18 -07:00
Esteban Küber
89571a1bbc Tweak chained operators diagnostic
Use more selective spans
Improve suggestion output
Be more selective when displaying suggestions
Silence some knock-down type errors
2020-03-25 17:13:04 -07:00
Esteban Küber
f18a6dcec0 Rename def_span to guess_head_span 2020-03-25 16:45:12 -07:00
Olivier Goffart
bb3e513a2c Revert previous commit and make the optimisation in a nicer way 2020-03-26 00:20:39 +01:00
Ralf Jung
0fdb7df32b avoid catching InterpError 2020-03-26 00:16:05 +01:00
bors
e4519e2b96 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
2020-03-25 22:56:53 +00:00
Dylan DPC
84a2865963
Rollup merge of #70409 - mathstuf:gitignore-target-symlink, r=Mark-Simulacrum
gitignore: allow target to be a symlink

Following rust-lang/cargo#4944.
2020-03-25 23:53:04 +01:00
Dylan DPC
5bccef5d86
Rollup merge of #70407 - spastorino:avoid-nomination-on-toolstate-breakage, r=Mark-Simulacrum
Avoid tagging as I-nominated on toolstate breakage

r? @Mark-Simulacrum
2020-03-25 23:53:03 +01:00
Dylan DPC
15359b0d57
Rollup merge of #70406 - GuillaumeGomez:cleanup-e0458, r=Dylan-DPC
Clean up E0458 explanation

r? @Dylan-DPC
2020-03-25 23:53:01 +01:00
Dylan DPC
0fa57e4595
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.
2020-03-25 23:52:59 +01:00
Dylan DPC
818da9eb4d
Rollup merge of #69700 - anyska:layout-details-rename, r=oli-obk
Rename LayoutDetails to just Layout.
2020-03-25 23:52:57 +01:00