]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #53577 - GuillaumeGomez:rustdoc-substring-search, r=QuietMisdreavus
bors [Sat, 25 Aug 2018 02:40:14 +0000 (02:40 +0000)]
Auto merge of #53577 - GuillaumeGomez:rustdoc-substring-search, r=QuietMisdreavus

Search a substring instead of start of string in rustdoc search

Fixes #49762.

r? @QuietMisdreavus

5 years agoAuto merge of #53225 - nikomatsakis:nll-type-annot, r=pnkfelix
bors [Fri, 24 Aug 2018 22:42:00 +0000 (22:42 +0000)]
Auto merge of #53225 - nikomatsakis:nll-type-annot, r=pnkfelix

MIR: support user-given type annotations on fns, structs, and enums

This branch adds tooling to track user-given type annotations on functions, structs, and enum variant expressions. The user-given types are passed onto NLL which then enforces them.

cc #47184 — not a complete fix, as there are more cases to cover

r? @eddyb
cc @rust-lang/wg-compiler-nll

5 years agoAuto merge of #53460 - JoshBrudnak:master, r=estebank
bors [Fri, 24 Aug 2018 19:21:27 +0000 (19:21 +0000)]
Auto merge of #53460 - JoshBrudnak:master, r=estebank

Fix compile panic on non existent type return

Reverted the change https://github.com/rust-lang/rust/commit/28a76a90009d605349babcd2755962ab93913327#diff-4ed25c00aceb84666fca639cf8101c7cL1069 which was panicking when returning a type that cannot be found in the current scope and added testing for the compile error.

For example:
```rust
fn addition() -> Wrapper<impl A> {}
```
Where Wrapper is undefined in the scope.

5 years agoaddress pnkfelix nits
Niko Matsakis [Thu, 23 Aug 2018 21:37:41 +0000 (17:37 -0400)]
address pnkfelix nits

5 years agopacify the mercilous tidy: adt-nullary-enums test
Niko Matsakis [Thu, 9 Aug 2018 17:08:18 +0000 (13:08 -0400)]
pacify the mercilous tidy: adt-nullary-enums test

5 years agopacify the mercilous tidy: adt user-ty
Niko Matsakis [Thu, 9 Aug 2018 17:07:57 +0000 (13:07 -0400)]
pacify the mercilous tidy: adt user-ty

5 years agopacify the mercilous tidy: user-ty on rvalue assignments
Niko Matsakis [Thu, 9 Aug 2018 17:07:45 +0000 (13:07 -0400)]
pacify the mercilous tidy: user-ty on rvalue assignments

5 years agopacify the mercilous tidy: doc comment for `is_identity`
Niko Matsakis [Thu, 9 Aug 2018 17:07:23 +0000 (13:07 -0400)]
pacify the mercilous tidy: doc comment for `is_identity`

5 years agopacify the mercilous tidy: canonical ignore comments
Niko Matsakis [Thu, 9 Aug 2018 17:07:11 +0000 (13:07 -0400)]
pacify the mercilous tidy: canonical ignore comments

5 years agoufcs with annot in position 1 and 2
Niko Matsakis [Thu, 9 Aug 2018 16:32:00 +0000 (12:32 -0400)]
ufcs with annot in position 1 and 2

5 years agorename test case
Niko Matsakis [Thu, 9 Aug 2018 16:25:01 +0000 (12:25 -0400)]
rename test case

the 3 is because the type arguments are in the 3rd position

5 years agoinclude ADT user-ty in output
Niko Matsakis [Thu, 9 Aug 2018 16:24:52 +0000 (12:24 -0400)]
include ADT user-ty in output

5 years agoadd test for method ufcs notation
Niko Matsakis [Thu, 9 Aug 2018 16:18:29 +0000 (12:18 -0400)]
add test for method ufcs notation

5 years agosupport user-given types in adts
Niko Matsakis [Thu, 9 Aug 2018 15:56:53 +0000 (11:56 -0400)]
support user-given types in adts

5 years agosupport user annotations in fns, methods
Niko Matsakis [Thu, 9 Aug 2018 10:58:28 +0000 (06:58 -0400)]
support user annotations in fns, methods

5 years agoequate the `user_ty` of a constant with its declared `ty`
Niko Matsakis [Thu, 9 Aug 2018 10:23:52 +0000 (06:23 -0400)]
equate the `user_ty` of a constant with its declared `ty`

5 years agoadd a `user_ty` annotation to `Constant`
Niko Matsakis [Thu, 9 Aug 2018 10:18:00 +0000 (06:18 -0400)]
add a `user_ty` annotation to `Constant`

5 years agoadd a `user_substs` table and store the annotations in there
Niko Matsakis [Wed, 8 Aug 2018 22:10:19 +0000 (18:10 -0400)]
add a `user_substs` table and store the annotations in there

5 years agoadd a `user_substs` map into the typeck tables
Niko Matsakis [Wed, 8 Aug 2018 19:59:31 +0000 (15:59 -0400)]
add a `user_substs` map into the typeck tables

5 years agoAuto merge of #53662 - kennytm:rollup, r=kennytm
bors [Fri, 24 Aug 2018 17:02:23 +0000 (17:02 +0000)]
Auto merge of #53662 - kennytm:rollup, r=kennytm

Rollup of 16 pull requests

Successful merges:

 - #53311 (Window Mutex: Document that we properly initialize the SRWLock)
 - #53503 (Discourage overuse of mem::forget)
 - #53545 (Fix #50865: ICE on impl-trait returning functions reaching private items)
 - #53559 (add macro check for lint)
 - #53562 (Lament the invincibility of the Turbofish)
 - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into())
 - #53592 (docs: minor stylistic changes to str/string docs)
 - #53594 (Update RELEASES.md to include clippy-preview)
 - #53600 (Fix a grammatical mistake in "expected generic arguments" errors)
 - #53614 (update nomicon and book)
 - #53617 (tidy: Stop requiring a license header)
 - #53618 (Add missing fmt examples)
 - #53636 (Prefer `.nth(n)` over `.skip(n).next()`.)
 - #53644 (Use SmallVec for SmallCStr)
 - #53664 (Remove unnecessary closure in rustc_mir/build/mod.rs)
 - #53666 (Added rustc_codegen_llvm to compiler documentation.)

5 years agoRollup merge of #53666 - davidtwco:issue-51737, r=Mark-Simulacrum
kennytm [Fri, 24 Aug 2018 15:27:57 +0000 (23:27 +0800)]
Rollup merge of #53666 - davidtwco:issue-51737, r=Mark-Simulacrum

Added rustc_codegen_llvm to compiler documentation.

Fixes #51737.

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 agoAuto merge of #53044 - SergioBenitez:stable-attr-literals, r=petrochenkov
bors [Fri, 24 Aug 2018 14:48:29 +0000 (14:48 +0000)]
Auto merge of #53044 - SergioBenitez:stable-attr-literals, r=petrochenkov

Stabilize 'attr_literals' feature.

RFC Issue: rust-lang/rfcs#1559
Tracking Issue: rust-lang/rust#34981

Reference PR: https://github.com/rust-lang-nursery/reference/pull/388.

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 agoAuto merge of #53653 - petrochenkov:moreregr, r=Mark-Simulacrum
bors [Fri, 24 Aug 2018 11:22:11 +0000 (11:22 +0000)]
Auto merge of #53653 - petrochenkov:moreregr, r=Mark-Simulacrum

Address two regressions

Remove assert checking that expansion data is immutable until I have time to investigate why it's firing, cc https://github.com/rust-lang/rust/issues/52363
Turn the error for module-relative access to macro-expanded `macro_export` macros into a deprecation lint, closes https://github.com/rust-lang/rust/issues/53495

5 years agoAdded rustc_codegen_llvm to compiler documentation.
David Wood [Fri, 24 Aug 2018 11:09:34 +0000 (13:09 +0200)]
Added rustc_codegen_llvm to compiler documentation.

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 agoStabilize 'attr_literals' feature.
Sergio Benitez [Fri, 3 Aug 2018 22:05:05 +0000 (15:05 -0700)]
Stabilize 'attr_literals' feature.

5 years agoTurn the error for module-relative access to macro-expanded `macro_export` macros...
Vadim Petrochenkov [Thu, 23 Aug 2018 23:51:41 +0000 (02:51 +0300)]
Turn the error for module-relative access to macro-expanded `macro_export` macros into a deprecation lint

5 years agoAdd a test for reset expansion info
Vadim Petrochenkov [Thu, 23 Aug 2018 23:26:50 +0000 (02:26 +0300)]
Add a test for reset expansion info

5 years agoRevert "hygiene: Make sure expansion info is set at most once for a given `Mark`"
Vadim Petrochenkov [Thu, 23 Aug 2018 23:21:52 +0000 (02:21 +0300)]
Revert "hygiene: Make sure expansion info is set at most once for a given `Mark`"

This reverts commit b15785b67133b5017f141d1fda1dd3dcf331b4b4.

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