]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #53545 - FelixMcFelix:fix-50865-beta, r=petrochenkov
kennytm [Fri, 24 Aug 2018 15:27:16 +0000 (23:27 +0800)]
Rollup merge of #53545 - FelixMcFelix:fix-50865-beta, r=petrochenkov

Fix #50865: ICE on impl-trait returning functions reaching private items

Adds a test case as suggested in #50865, and implements @petrochenkov's suggestion. Fixes #50865.

Impl-trait-returning functions are marked under a new (low) access level, which they propagate rather than `AccessLevels::Reachable`. `AccessLevels::is_reachable` returns false for such items (leaving stability analysis unaffected), these items may still be visible to the lints phase however.

5 years agoRollup merge of #53664 - IsaacWoods:fix_53608, r=oli-obk
kennytm [Fri, 24 Aug 2018 11:25:41 +0000 (19:25 +0800)]
Rollup merge of #53664 - IsaacWoods:fix_53608, r=oli-obk

Remove unnecessary closure in rustc_mir/build/mod.rs

Fixes #53608

5 years agoRollup merge of #53644 - llogiq:smallvec-for-small-c-str, r=estebank
kennytm [Fri, 24 Aug 2018 08:44:51 +0000 (16:44 +0800)]
Rollup merge of #53644 - llogiq:smallvec-for-small-c-str, r=estebank

Use SmallVec for SmallCStr

This reuses the awesome optimizations from Servo's `SmallVec` to speed up `SmallCStr`.

5 years agoRollup merge of #53636 - frewsxcv:frewsxcv-nth, r=rkruppe
kennytm [Fri, 24 Aug 2018 08:44:50 +0000 (16:44 +0800)]
Rollup merge of #53636 - frewsxcv:frewsxcv-nth, r=rkruppe

Prefer `.nth(n)` over `.skip(n).next()`.

Found by clippy.

5 years agoRollup merge of #53618 - GuillaumeGomez:fmt-examples, r=QuietMisdreavus
kennytm [Fri, 24 Aug 2018 08:44:47 +0000 (16:44 +0800)]
Rollup merge of #53618 - GuillaumeGomez:fmt-examples, r=QuietMisdreavus

Add missing fmt examples

r? @QuietMisdreavus

5 years agoRollup merge of #53617 - joshtriplett:tidy-no-license-header, r=Mark-Simulacrum
kennytm [Fri, 24 Aug 2018 08:44:44 +0000 (16:44 +0800)]
Rollup merge of #53617 - joshtriplett:tidy-no-license-header, r=Mark-Simulacrum

tidy: Stop requiring a license header

Previously approved in rust-lang/rust#43498 ; update tidy to match.

5 years agoRollup merge of #53614 - RalfJung:nomicon, r=kennytm
kennytm [Fri, 24 Aug 2018 08:44:42 +0000 (16:44 +0800)]
Rollup merge of #53614 - RalfJung:nomicon, r=kennytm

update nomicon and book

5 years agoRollup merge of #53600 - varkor:expected-generic-arg-s, r=eddyb
kennytm [Fri, 24 Aug 2018 08:44:40 +0000 (16:44 +0800)]
Rollup merge of #53600 - varkor:expected-generic-arg-s, r=eddyb

Fix a grammatical mistake in "expected generic arguments" errors

r? @eddyb

5 years agoRollup merge of #53594 - rust-lang:Aaronepower-patch-1, r=Mark-Simulacrum
kennytm [Fri, 24 Aug 2018 08:44:39 +0000 (16:44 +0800)]
Rollup merge of #53594 - rust-lang:Aaronepower-patch-1, r=Mark-Simulacrum

Update RELEASES.md to include clippy-preview

[Rendered](https://github.com/rust-lang/rust/blob/Aaronepower-patch-1/RELEASES.md#misc)

r? @Mark-Simulacrum

5 years agoRollup merge of #53592 - matthiaskrgr:str_doc, r=alexcrichton
kennytm [Fri, 24 Aug 2018 08:44:38 +0000 (16:44 +0800)]
Rollup merge of #53592 - matthiaskrgr:str_doc, r=alexcrichton

docs: minor stylistic changes to str/string docs

std::string::String.repeat(): slightly rephrase to be more in-line with other descriptions.

add ticks around a few keywords in other descriptions.

5 years agoRemove unnecessary closure in rustc_mir/build/mod.rs
Isaac Woods [Fri, 24 Aug 2018 10:20:30 +0000 (11:20 +0100)]
Remove unnecessary closure in rustc_mir/build/mod.rs

5 years agoRollup merge of #53563 - matthiaskrgr:String, r=varkor
kennytm [Fri, 24 Aug 2018 08:44:35 +0000 (16:44 +0800)]
Rollup merge of #53563 - matthiaskrgr:String, r=varkor

use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()

5 years agoRollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa
kennytm [Fri, 24 Aug 2018 08:44:34 +0000 (16:44 +0800)]
Rollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa

Lament the invincibility of the Turbofish

Here a test case is added to ensure that any others attempting to drive the Turbofish to extinction have second thoughts. Previously the [entire test suite would succeed](https://github.com/rust-lang/rust/pull/53511) if generic arguments were accepted without disambiguation, making for [confusing and heartbreaking circumstances](https://github.com/rust-lang/rfcs/pull/2527).

5 years agoRollup merge of #53559 - Dylan-DPC:fix/missing-doc-lint, r=kennytm
kennytm [Fri, 24 Aug 2018 08:44:32 +0000 (16:44 +0800)]
Rollup merge of #53559 - Dylan-DPC:fix/missing-doc-lint, r=kennytm

add macro check for lint

Fixes #53537

5 years agoRollup merge of #53503 - kornelski:master, r=dtolnay
kennytm [Fri, 24 Aug 2018 08:44:31 +0000 (16:44 +0800)]
Rollup merge of #53503 - kornelski:master, r=dtolnay

Discourage overuse of mem::forget

Some uses of `mem::forget` have been replaced by better methods of `Box`, so I've removed obsoleted use-cases from these docs.

I've removed emphasis on leaking, because it's not obvious `mem::forget` does not guarantee leaking of memory: memory of stack-allocated objects and values partially moved out of `Box` will still be freed. That's a potential error when used to pass objects to FFI, so it's better to direct users to `Box::into_raw` instead.

5 years agoRollup merge of #53311 - RalfJung:windows-mutex, r=retep998
kennytm [Fri, 24 Aug 2018 08:44:30 +0000 (16:44 +0800)]
Rollup merge of #53311 - RalfJung:windows-mutex, r=retep998

Window Mutex: Document that we properly initialize the SRWLock

See https://github.com/rust-lang/rust/issues/35836

5 years agoAuto merge of #53638 - flip1995:clippy, r=nrc
bors [Thu, 23 Aug 2018 22:52:29 +0000 (22:52 +0000)]
Auto merge of #53638 - flip1995:clippy, r=nrc

Update clippy

r? @oli-obk @Manishearth

5 years agoUpdate clippy again
flip1995 [Thu, 23 Aug 2018 21:31:55 +0000 (23:31 +0200)]
Update clippy again

5 years agoUse SmallVec for SmallCStr
Andre Bogus [Thu, 23 Aug 2018 18:22:22 +0000 (20:22 +0200)]
Use SmallVec for SmallCStr

5 years agoAuto merge of #53588 - tristanburgess:52985_diagnostics_no_concrete_type_behind_exist...
bors [Thu, 23 Aug 2018 20:34:12 +0000 (20:34 +0000)]
Auto merge of #53588 - tristanburgess:52985_diagnostics_no_concrete_type_behind_existential_type, r=oli-obk

52985 diagnostics no concrete type behind existential type

@oli-obk FYI. See below for new cycle error generated.

```rust
error[E0391]: cycle detected when processing `Foo`
 --> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:3:1
  |
3 | existential type Foo: Copy;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: ...which requires processing `bar`...
 --> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:6:23
  |
6 |   fn bar(x: Foo) -> Foo {
  |  _______________________^
7 | |     x
8 | | }
  | |_^
  = note: ...which again requires processing `Foo`, completing the cycle

error: aborting due to previous error

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

5 years agoAdd missing fmt examples
Guillaume Gomez [Wed, 22 Aug 2018 21:43:30 +0000 (23:43 +0200)]
Add missing fmt examples

5 years agofix testcase
dylan_DPC [Thu, 23 Aug 2018 17:51:54 +0000 (23:21 +0530)]
fix testcase

5 years agoAuto merge of #53571 - MaloJaffre:vecdeque-emergency, r=RalfJung
bors [Thu, 23 Aug 2018 17:13:44 +0000 (17:13 +0000)]
Auto merge of #53571 - MaloJaffre:vecdeque-emergency, r=RalfJung

Fix unsoundness for VecDeque

 See individual commit for more details.

r? @RalfJung.

Fixes https://github.com/rust-lang/rust/issues/53566, fixes https://github.com/rust-lang/rust/issues/53529

5 years agoAuto merge of #53384 - gootorov:use-servo-smallvec, r=michaelwoerister
bors [Thu, 23 Aug 2018 14:40:22 +0000 (14:40 +0000)]
Auto merge of #53384 - gootorov:use-servo-smallvec, r=michaelwoerister

Use optimized SmallVec implementation

This PR replaces current SmallVec implementation with the one from the Servo project.

Closes https://github.com/rust-lang/rust/issues/51640

r? @Mark-Simulacrum

5 years agoDiscourage overuse of mem::forget
Kornel [Sun, 19 Aug 2018 18:46:05 +0000 (19:46 +0100)]
Discourage overuse of mem::forget

5 years agoUpdate clippy
flip1995 [Thu, 23 Aug 2018 14:00:04 +0000 (16:00 +0200)]
Update clippy

5 years agoPrefer `.nth(n)` over `.skip(n).next()`.
Corey Farwell [Thu, 23 Aug 2018 13:35:49 +0000 (09:35 -0400)]
Prefer `.nth(n)` over `.skip(n).next()`.

Found by clippy.

5 years agoLight restructuring.
Kyle Simpson [Thu, 23 Aug 2018 09:52:08 +0000 (10:52 +0100)]
Light restructuring.

5 years agoAuto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakis
bors [Thu, 23 Aug 2018 11:46:24 +0000 (11:46 +0000)]
Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakis

Implement try block expressions

I noticed that `try` wasn't a keyword yet in Rust 2018, so...

~~Fix​es https://github.com/rust-lang/rust/issues/52604~~ That was fixed by PR https://github.com/rust-lang/rust/pull/53135
cc https://github.com/rust-lang/rust/issues/31436 https://github.com/rust-lang/rust/issues/50412

5 years agoAuto merge of #53459 - petrochenkov:stabmore, r=nrc
bors [Thu, 23 Aug 2018 08:38:22 +0000 (08:38 +0000)]
Auto merge of #53459 - petrochenkov:stabmore, r=nrc

Stabilize a few secondary macro features

- `tool_attributes` - closes https://github.com/rust-lang/rust/issues/44690
- `proc_macro_path_invoc` - this feature was created due to issues with tool attributes (https://github.com/rust-lang/rust/issues/51277), those issues are now fixed (https://github.com/rust-lang/rust/pull/52841)
- partially `proc_macro_gen` - this feature was created due to issue https://github.com/rust-lang/rust/issues/50504, the issue is now fixed (https://github.com/rust-lang/rust/pull/51952), so proc macros can generate modules. They still can't generate `macro_rules` items though due to unclear hygiene interactions.

5 years agouse String::new() instead of String::from(""), "".to_string(), "".to_owned() or ...
Matthias Krüger [Thu, 23 Aug 2018 08:14:52 +0000 (10:14 +0200)]
use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()

5 years agoUse optimized SmallVec implementation
Igor Gutorov [Mon, 13 Aug 2018 19:15:16 +0000 (22:15 +0300)]
Use optimized SmallVec implementation

5 years agoAuto merge of #53235 - varkor:gat_impl_where, r=estebank
bors [Thu, 23 Aug 2018 06:34:11 +0000 (06:34 +0000)]
Auto merge of #53235 - varkor:gat_impl_where, r=estebank

Feature gate where clauses on associated type impls

Fixes #52913. This doesn't address the core problem, which is tracked by https://github.com/rust-lang/rust/issues/47206. However, it fixes the stable-to-stable regression: you now have to enable `#![feature(generic_associated_types)]` to trigger the weird behaviour.

5 years agoAuto merge of #53520 - nnethercote:merge-IdxSet-IdxSetBuf, r=nikomatsakis
bors [Thu, 23 Aug 2018 02:54:24 +0000 (02:54 +0000)]
Auto merge of #53520 - nnethercote:merge-IdxSet-IdxSetBuf, r=nikomatsakis

Merge `IdxSet` and `IdxSetBuf`

Because it simplifies things.

@r? nikomatsakis

5 years ago52985: formatting PR files
Tristan Burgess [Wed, 22 Aug 2018 04:24:03 +0000 (00:24 -0400)]
52985: formatting PR files

5 years ago52985: better cycle error for existential types
Tristan Burgess [Wed, 22 Aug 2018 04:02:07 +0000 (00:02 -0400)]
52985: better cycle error for existential types
  - Original cycle error diagnostics PR'd against this issue caught
panic-causing error while resolving std::mem::transmute calls
  - Now, catch invalid use case of not providing a concrete sized type
behind existential type in definining use case.
  - Update relevant test to reflect this new error

52985: revert normalize query changes
      - PR 53588 invalidates 53316, causing a correct cycle error to occur
    with a good span.
      - Don't need to revert the whole merge as the test files are
    still fine, just need to revert the normalize query changes.
      - It should now be correct that infinite recursion detected during
    normalize query type folding is a bug, should have been caught earlier
    (when resolving the existential type's defining use cases).

52985: code review impl
  - Only cause cycle error if anonymous type resolves to anonymous type
that has the same def id (is the same type) as the original (parent)
type.
  - Add test case to cover this case for existential types.

52985: remove Ty prefix from TyAnon
  - To align with changes per commit 6f637da50c56a22f745fd056691da8c86824cd9b

5 years agoLament the invincibility of the Turbofish
varkor [Tue, 21 Aug 2018 13:44:36 +0000 (14:44 +0100)]
Lament the invincibility of the Turbofish

5 years agotidy: Stop requiring a license header
Josh Triplett [Wed, 22 Aug 2018 22:18:45 +0000 (15:18 -0700)]
tidy: Stop requiring a license header

Previously approved in rust-lang/rust#43498 ; update tidy to match.

5 years agoStabilize a few secondary macro features
Vadim Petrochenkov [Fri, 17 Aug 2018 21:52:34 +0000 (00:52 +0300)]
Stabilize a few secondary macro features

`tool_attributes`, `proc_macro_path_invoc`, partially `proc_macro_gen`

5 years agoAuto merge of #52011 - oli-obk:dont_you_hate_it_too_when_everything_panics_constantly...
bors [Wed, 22 Aug 2018 22:08:03 +0000 (22:08 +0000)]
Auto merge of #52011 - oli-obk:dont_you_hate_it_too_when_everything_panics_constantly, r=eddyb

Allow panicking with string literal messages inside constants

r? @eddyb

cc https://github.com/rust-lang/rust/issues/51999

we can't implement things like `panic!("foo: {}", x)` right now because we can't call trait methods (most notably `Display::fmt`) inside constants. Also most of these impls probably have loops and conditions, so it's messy anyway.

But hey `panic!("foo")` works at least.

cc @japaric got any test ideas for `#![no_std]`?

5 years agoadd warning for missing docs
dylan_DPC [Wed, 22 Aug 2018 20:26:39 +0000 (01:56 +0530)]
add warning for missing docs

5 years agoUpdate RELEASES.md
Aaron Power [Wed, 22 Aug 2018 20:18:31 +0000 (21:18 +0100)]
Update RELEASES.md

5 years agoAuto merge of #53607 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 22 Aug 2018 19:59:52 +0000 (19:59 +0000)]
Auto merge of #53607 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 10 pull requests

Successful merges:

 - #53418 (Mark some suggestions as MachineApplicable)
 - #53431 (Moved some feature gate ui tests to correct location)
 - #53442 (Update version of rls-data used with save-analysis)
 - #53504 (Set applicability for more suggestions.)
 - #53541 (Fix missing impl trait display as ret type)
 - #53544 (Point at the trait argument when using unboxed closure)
 - #53558 (Normalize source line and column numbers.)
 - #53562 (Lament the invincibility of the Turbofish)
 - #53574 (Suggest direct raw-pointer dereference)
 - #53585 (Remove super old comment on function that parses items)

Failed merges:

 - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
 - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into())

r? @ghost

5 years agoupdate nomicon and book
Ralf Jung [Wed, 22 Aug 2018 19:17:58 +0000 (21:17 +0200)]
update nomicon and book

5 years agoAuto merge of #53581 - varkor:tyvariants-rename, r=eddyb
bors [Wed, 22 Aug 2018 17:43:44 +0000 (17:43 +0000)]
Auto merge of #53581 - varkor:tyvariants-rename, r=eddyb

Rename TyVariants and variants

- Rename `TypeVariants` to `TyKind`.
- Remove the `Ty` prefix from each one of its variants (plus the identically-named variants of `PrimTy`).
- Rename `ty::Slice` to `ty::List`.

The new names look cleaner.

r? @eddyb

5 years agoReexpose stability hole in the presence of feature gates
Oliver Schneider [Mon, 13 Aug 2018 12:27:29 +0000 (14:27 +0200)]
Reexpose stability hole in the presence of feature gates

5 years agoAllow panicking with string literal messages inside constants
Oliver Schneider [Mon, 13 Aug 2018 11:48:47 +0000 (13:48 +0200)]
Allow panicking with string literal messages inside constants

5 years agoRollup merge of #53585 - dtolnay:comment, r=Mark-Simulacrum
Guillaume Gomez [Wed, 22 Aug 2018 15:45:43 +0000 (17:45 +0200)]
Rollup merge of #53585 - dtolnay:comment, r=Mark-Simulacrum

Remove super old comment on function that parses items

This comment was added more than 5 years ago in ab03c1e4221. As far as anyone reading this comment today needs to know, the function has never parsed items from inside an extern crate.

5 years agoRollup merge of #53574 - vorner:ptr_as_ref_unchecked, r=Mark-Simulacrum
Guillaume Gomez [Wed, 22 Aug 2018 15:45:41 +0000 (17:45 +0200)]
Rollup merge of #53574 - vorner:ptr_as_ref_unchecked, r=Mark-Simulacrum

Suggest direct raw-pointer dereference

People often come looking for some kind of `as_ref_unchecked` method on
raw pointers that would give them `&T` and not `Option<&T>` when they
are sure the pointer is not NULL.

There's no such method, but taking a reference of the dereferenced
pointer accomplishes the same thing. Therefore, suggest using that, at
the `as_ref` site ‒ it's a place people are likely going to look into.

5 years agoRollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa
Guillaume Gomez [Wed, 22 Aug 2018 15:45:39 +0000 (17:45 +0200)]
Rollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa

Lament the invincibility of the Turbofish

Here a test case is added to ensure that any others attempting to drive the Turbofish to extinction have second thoughts. Previously the [entire test suite would succeed](https://github.com/rust-lang/rust/pull/53511) if generic arguments were accepted without disambiguation, making for [confusing and heartbreaking circumstances](https://github.com/rust-lang/rfcs/pull/2527).

5 years agoRollup merge of #53558 - davidtwco:issue-53547, r=estebank
Guillaume Gomez [Wed, 22 Aug 2018 15:45:38 +0000 (17:45 +0200)]
Rollup merge of #53558 - davidtwco:issue-53547, r=estebank

Normalize source line and column numbers.

Fixes #53547.

r? @eddyb

5 years agoRollup merge of #53544 - estebank:issue-53534, r=varkor
Guillaume Gomez [Wed, 22 Aug 2018 15:45:37 +0000 (17:45 +0200)]
Rollup merge of #53544 - estebank:issue-53534, r=varkor

Point at the trait argument when using unboxed closure

Fix #53534.

r? @varkor

5 years agoRollup merge of #53541 - GuillaumeGomez:fix-impl-trait-ret-type, r=oli-obk
Guillaume Gomez [Wed, 22 Aug 2018 15:45:36 +0000 (17:45 +0200)]
Rollup merge of #53541 - GuillaumeGomez:fix-impl-trait-ret-type, r=oli-obk

Fix missing impl trait display as ret type

I need to convert a `TraitPredicate` into a `TraitBound` to get the returned impl trait. So far, didn't find how or even if it was the good way to do it.

cc @eddyb @oli-obk (since you're the one behind the change apparently 😉)

5 years agoRollup merge of #53504 - ekse:suggestions-applicability-2, r=estebank
Guillaume Gomez [Wed, 22 Aug 2018 15:45:34 +0000 (17:45 +0200)]
Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebank

Set applicability for more suggestions.

Converts a couple more calls to `span_suggestion_with_applicability`  (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect.

r? @estebank

5 years agoRollup merge of #53442 - staktrace:rlsbump, r=nrc
Guillaume Gomez [Wed, 22 Aug 2018 15:45:32 +0000 (17:45 +0200)]
Rollup merge of #53442 - staktrace:rlsbump, r=nrc

Update version of rls-data used with save-analysis

This part 1/3 for fixing rust-lang/rust#53440.

5 years agoRollup merge of #53431 - alexreg:move-feature-gate-tests, r=cramertj
Guillaume Gomez [Wed, 22 Aug 2018 15:45:31 +0000 (17:45 +0200)]
Rollup merge of #53431 - alexreg:move-feature-gate-tests, r=cramertj

Moved some feature gate ui tests to correct location

None

5 years agoRollup merge of #53418 - ekse:suggestions-applicability, r=estebank
Guillaume Gomez [Wed, 22 Aug 2018 15:45:29 +0000 (17:45 +0200)]
Rollup merge of #53418 - ekse:suggestions-applicability, r=estebank

Mark some suggestions as MachineApplicable

I think the following suggestions should be safe to mark as `MachineApplicable`.

r? @estebank

5 years agoAuto merge of #53536 - RalfJung:array-drop, r=eddyb
bors [Wed, 22 Aug 2018 15:29:07 +0000 (15:29 +0000)]
Auto merge of #53536 - RalfJung:array-drop, r=eddyb

fix array drop glue: properly turn raw ptr into reference

Discovered while working on https://github.com/rust-lang/rust/pull/53424: The generated drop glue uses an assignment `ptr = cur` where `ptr` is a reference and `cur` a raw pointer. This is not well-formed MIR.

Do we have MIR sanity checks that run on the drop glue and should have caught this?

r? @eddyb

5 years agoFix rebase issues
varkor [Wed, 22 Aug 2018 10:54:46 +0000 (11:54 +0100)]
Fix rebase issues

5 years agoReplace TyForeign with ForeignTy
varkor [Wed, 22 Aug 2018 10:47:31 +0000 (11:47 +0100)]
Replace TyForeign with ForeignTy

5 years agoRename Def::{Param, Foreign} to Def::{TyParam, TyForeign}
varkor [Wed, 22 Aug 2018 01:13:31 +0000 (02:13 +0100)]
Rename Def::{Param, Foreign} to Def::{TyParam, TyForeign}

5 years agoRemove unnecessary TyKind::s
varkor [Wed, 22 Aug 2018 01:08:01 +0000 (02:08 +0100)]
Remove unnecessary TyKind::s

5 years agoRemove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}
varkor [Wed, 22 Aug 2018 00:35:55 +0000 (01:35 +0100)]
Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}

5 years agoRemove Ty prefix from Ty{Foreign|Param}
varkor [Wed, 22 Aug 2018 00:35:29 +0000 (01:35 +0100)]
Remove Ty prefix from Ty{Foreign|Param}

5 years agoRemove Ty prefix from Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Gener...
varkor [Wed, 22 Aug 2018 00:35:02 +0000 (01:35 +0100)]
Remove Ty prefix from Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}

5 years agoRename ty::TyVariants to ty::TyKind
varkor [Wed, 22 Aug 2018 00:34:12 +0000 (01:34 +0100)]
Rename ty::TyVariants to ty::TyKind

5 years agoRename ty::Slice to ty::List
varkor [Tue, 21 Aug 2018 23:35:01 +0000 (00:35 +0100)]
Rename ty::Slice to ty::List

5 years agoLament the invincibility of the Turbofish
varkor [Tue, 21 Aug 2018 13:44:36 +0000 (14:44 +0100)]
Lament the invincibility of the Turbofish

5 years agoAuto merge of #53524 - alexcrichton:buffer-out, r=eddyb
bors [Wed, 22 Aug 2018 13:16:32 +0000 (13:16 +0000)]
Auto merge of #53524 - alexcrichton:buffer-out, r=eddyb

Buffer LLVM's object output stream

In some profiling on OSX I saw the `write` syscall as quite high up on
the profiling graph, which is definitely not good! It looks like we're
setting the output stream of an object file as directly to a file
descriptor which means that we run the risk of doing lots of little
writes rather than a few large writes.

This commit fixes this issue by adding a buffered stream on the output,
causing the `write` syscall to disappear from the profiles on OSX.

5 years agoAdd a test for issue #53529
MaloJaffre [Wed, 22 Aug 2018 08:22:21 +0000 (10:22 +0200)]
Add a test for issue #53529

5 years agoFix unsoundness in VecDeque Debug impls
MaloJaffre [Tue, 21 Aug 2018 17:50:05 +0000 (19:50 +0200)]
Fix unsoundness in VecDeque Debug impls

Fixes #53566.

5 years agoFix a grammatical mistake in "expected generic arguments" errors
varkor [Wed, 22 Aug 2018 11:15:29 +0000 (12:15 +0100)]
Fix a grammatical mistake in "expected generic arguments" errors

5 years agoAuto merge of #53424 - RalfJung:miri-refactor, r=oli-obk
bors [Wed, 22 Aug 2018 11:11:14 +0000 (11:11 +0000)]
Auto merge of #53424 - RalfJung:miri-refactor, r=oli-obk

CTFE engine refactor

* Value gets renamed to `Operand`, so that now `interpret::{Place, Operand}` are the "dynamic" versions of `mir::{Place, Operand}`.
* `Operand` and `Place` share the data for their "stuff is in memory"-base in a new type, `MemPlace`. This also makes it possible to give some more precise types in other areas. Both `Operand` and `MemPlace` have methods available to project into fields (and other kinds of projections) without causing further allocations.
* The type for "a `Scalar` or a `ScalarPair`" is called `Value`, and again used to give some more precise types.
* All of these have versions with an attached layout, so that we can more often drag the layout along instead of recomputing it. This lets us get rid of `PlaceExtra::Downcast`. `MPlaceTy` and `PlaceTy` can only be constructed in place.rs, making sure the layout is handled properly. (The same should eventually be done for `ValTy` and `OpTy`.)
 This is used to check, when copying an operand to a place, that the sizes match (which caught a bunch of bugs).
* All the high-level functions to write typed memory take a `Place`, and live in `place.rs`. All the high-level typed functions to read typed memory take an `Operand`, and live in `operands.rs`.
* Remove `cur_frame` and handling of signedess from memory (catching a bug in the float casting code).
* [Only functional change] Enable sanity check to recurse below dyn traits and slices.

r? @oli-obk

Cc @eddyb

5 years agofix error reporting in validation
Ralf Jung [Wed, 22 Aug 2018 10:02:09 +0000 (12:02 +0200)]
fix error reporting in validation

5 years agofix validating fat pointers to user-defined unsized types
Ralf Jung [Wed, 22 Aug 2018 09:27:38 +0000 (11:27 +0200)]
fix validating fat pointers to user-defined unsized types

5 years agofix a comment in validity
Ralf Jung [Mon, 20 Aug 2018 20:39:08 +0000 (22:39 +0200)]
fix a comment in validity

5 years agofix layout sanity check
Ralf Jung [Mon, 20 Aug 2018 18:08:37 +0000 (20:08 +0200)]
fix layout sanity check

5 years agoalso avoid recomputing the layout for unary and binary ops, where possible
Ralf Jung [Mon, 20 Aug 2018 18:08:24 +0000 (20:08 +0200)]
also avoid recomputing the layout for unary and binary ops, where possible

5 years agoin a Use statement, exploit the fact that type and hence layout are the same for...
Ralf Jung [Mon, 20 Aug 2018 13:21:04 +0000 (15:21 +0200)]
in a Use statement, exploit the fact that type and hence layout are the same for LHS and RHS

5 years agooptimize creating a stack frame
Ralf Jung [Sun, 19 Aug 2018 15:01:31 +0000 (17:01 +0200)]
optimize creating a stack frame

5 years agofix validating fat raw pointers
Ralf Jung [Sun, 19 Aug 2018 10:03:58 +0000 (12:03 +0200)]
fix validating fat raw pointers

5 years agooptimize sanity check path printing
Ralf Jung [Sat, 18 Aug 2018 11:46:52 +0000 (13:46 +0200)]
optimize sanity check path printing

During the sanity check, we keep track of the path we are below in a `Vec`.  We
avoid cloning that `Vec` unless we hit a pointer indirection.  The `String`
representation is only computed when validation actually fails.

5 years agoavoid some redundant alignment checks
Ralf Jung [Sat, 18 Aug 2018 09:53:15 +0000 (11:53 +0200)]
avoid some redundant alignment checks

5 years agobetter error message when using NULL in to_ptr
Ralf Jung [Sat, 18 Aug 2018 09:11:40 +0000 (11:11 +0200)]
better error message when using NULL in to_ptr

5 years agofix UI tests
Ralf Jung [Fri, 17 Aug 2018 19:25:59 +0000 (21:25 +0200)]
fix UI tests

5 years agooptimize validation iterating over the elements of an array
Ralf Jung [Fri, 17 Aug 2018 15:47:37 +0000 (17:47 +0200)]
optimize validation iterating over the elements of an array

This is still roughly 45ns slower than the old state, because it now works with
an MPlaceTy and uses the appropriate abstractions, instead of working with a
ptr-align pair directly.

5 years agotest for detecting bad data inside trait objects / slices
Ralf Jung [Fri, 17 Aug 2018 10:39:36 +0000 (12:39 +0200)]
test for detecting bad data inside trait objects / slices

5 years agofix formatting nits
Ralf Jung [Fri, 17 Aug 2018 10:31:50 +0000 (12:31 +0200)]
fix formatting nits

5 years agomove validation to its own file
Ralf Jung [Fri, 17 Aug 2018 10:18:02 +0000 (12:18 +0200)]
move validation to its own file

5 years agoAuto merge of #53516 - petrochenkov:derregr, r=estebank
bors [Wed, 22 Aug 2018 09:03:25 +0000 (09:03 +0000)]
Auto merge of #53516 - petrochenkov:derregr, r=estebank

resolve: Continue search in outer scopes after applying derive resolution fallback

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

5 years agoRevert "Auto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapin"
MaloJaffre [Wed, 22 Aug 2018 07:06:24 +0000 (09:06 +0200)]
Revert "Auto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapin"

This partially reverts commit d5b6b95aef94169b5dbe4dbb1357d4bab1fc9800,
reversing changes made to 6b1ff19af36f7bbf1974579ec1b9bf2c8ccd595e.

Fixes #53529.
Cc: #53564.
5 years agoUpdate RELEASES.md
Aaron Power [Wed, 22 Aug 2018 08:18:34 +0000 (09:18 +0100)]
Update RELEASES.md

5 years agofix operator handling when using 128bit intrinsics
Ralf Jung [Thu, 16 Aug 2018 15:41:19 +0000 (17:41 +0200)]
fix operator handling when using 128bit intrinsics

5 years agofinally remove all traces of signs from memory
Ralf Jung [Thu, 16 Aug 2018 09:38:16 +0000 (11:38 +0200)]
finally remove all traces of signs from memory

5 years agofix computing layout when calling virtual fn
Ralf Jung [Thu, 16 Aug 2018 08:30:56 +0000 (10:30 +0200)]
fix computing layout when calling virtual fn

5 years agoavoid allocating for ZST
Ralf Jung [Thu, 16 Aug 2018 07:36:53 +0000 (09:36 +0200)]
avoid allocating for ZST

5 years agofix using copy_op to transmute
Ralf Jung [Thu, 16 Aug 2018 07:36:44 +0000 (09:36 +0200)]
fix using copy_op to transmute

5 years agotry_read_value_from_ptr -> try_read_value_from_mplace
Ralf Jung [Thu, 16 Aug 2018 07:36:25 +0000 (09:36 +0200)]
try_read_value_from_ptr -> try_read_value_from_mplace

5 years agofix dynamically determining size and alignment
Ralf Jung [Thu, 16 Aug 2018 07:05:01 +0000 (09:05 +0200)]
fix dynamically determining size and alignment

5 years agofix accessing unsized fields
Ralf Jung [Wed, 15 Aug 2018 22:41:26 +0000 (00:41 +0200)]
fix accessing unsized fields