Commit Graph

82725 Commits

Author SHA1 Message Date
bors
5ce5e08606 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`.
```
2018-08-23 20:34:12 +00:00
Jorge Aparicio
40a38b0164 update the unstable book 2018-08-23 21:44:45 +02:00
Jorge Aparicio
363db14704 fix new ui test 2018-08-23 21:43:55 +02:00
Jorge Aparicio
ca03f86aad fix tidy 2018-08-23 20:58:55 +02:00
Jorge Aparicio
a774c81f98 add #[panic_handler]; deprecate #[panic_implementation] 2018-08-23 20:58:55 +02:00
Guillaume Gomez
2cc2e01e04 Add missing fmt examples 2018-08-23 20:20:58 +02:00
dylan_DPC
747722e444 fix testcase 2018-08-23 23:21:54 +05:30
bors
54d82d0880 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
2018-08-23 17:13:44 +00:00
Bernardo Meurer
e07c1542ac
Fixed multi-line function signatures 2018-08-23 09:34:21 -07:00
Bernardo Meurer
6ca0384755
Small style fixes 2018-08-23 09:26:37 -07:00
Bernardo Meurer
67a8666ac8
More tidy fixes to CTFE 2018-08-23 09:21:40 -07:00
Bernardo Meurer
46b885f62b
Fix stylistic mistakes 2018-08-23 08:57:42 -07:00
Bernardo Meurer
22d3f66945
Fixup long code lines 2018-08-23 08:55:42 -07:00
Bernardo Meurer
35f25bfef3
Reflow and fixup comments 2018-08-23 08:54:23 -07:00
Bernardo Meurer
37db3db53d
Fixed long strings 2018-08-23 08:52:31 -07:00
Bernardo Meurer
22beeb4cab
Add license header to CTFE/MIRI 2018-08-23 08:51:44 -07:00
Bernardo Meurer
65544e5109
Removed librustc/mir/interpret and librustc_mir/interpreter from tidy skip list 2018-08-23 08:51:39 -07:00
Kazuyoshi Kato
1f441a0905 Check null-able variables before using them 2018-08-23 08:15:23 -07:00
bors
e5284b0b57 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
2018-08-23 14:40:22 +00:00
Kornel
e7709b3d44 Discourage overuse of mem::forget 2018-08-23 15:01:28 +01:00
flip1995
65c0ebd8ab
Update clippy 2018-08-23 16:00:04 +02:00
Corey Farwell
9e0ff24b6d Prefer .nth(n) over .skip(n).next().
Found by clippy.
2018-08-23 09:35:49 -04:00
Kyle Simpson
85a05d1815 Light restructuring. 2018-08-23 13:12:53 +01:00
bors
35bf1ae257 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
2018-08-23 11:46:24 +00:00
Nicholas Nethercote
002f03b654 Make SparseBitMatrix a bit lazier.
Currently when a row is instantiated in SparseBitMatrix, any missing
rows prior to it are also fully instantiated.

This patch changes things so that those prior rows are minimally
instantiated (with a `None`). This avoids a decent number of allocations
in NLL, speeding up several benchmarks by up to 0.5%.

The patch also removes two unused methods, `len()` and
`iter_enumerated()`.
2018-08-23 18:41:55 +10:00
bors
827e57c2f6 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.
2018-08-23 08:38:22 +00:00
Matthias Krüger
ede1f7d2a5 use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into() 2018-08-23 10:14:52 +02:00
Igor Gutorov
4d81fe9243 Use optimized SmallVec implementation 2018-08-23 10:45:53 +03:00
Kazuyoshi Kato
917cdd295d Automatically expand a section even after page load
Fixes #52774
2018-08-23 00:45:43 -07:00
bors
c648b0bb2b 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.
2018-08-23 06:34:11 +00:00
Nicholas Nethercote
7f4c168a9d Rename the fields in SparseBitMatrix.
The new names are clearer.
2018-08-23 16:06:16 +10:00
bors
e73077e106 Auto merge of #53520 - nnethercote:merge-IdxSet-IdxSetBuf, r=nikomatsakis
Merge `IdxSet` and `IdxSetBuf`

Because it simplifies things.

@r? nikomatsakis
2018-08-23 02:54:24 +00:00
Tristan Burgess
7440125d62 52985: formatting PR files 2018-08-22 18:57:10 -04:00
Tristan Burgess
3045ffa512 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 6f637da50c
2018-08-22 18:56:16 -04:00
varkor
b188c2a4eb Lament the invincibility of the Turbofish 2018-08-22 23:25:28 +01:00
Josh Triplett
a15b61780b tidy: Stop requiring a license header
Previously approved in rust-lang/rust#43498 ; update tidy to match.
2018-08-22 15:18:45 -07:00
Vadim Petrochenkov
b34503e60e Stabilize a few secondary macro features
`tool_attributes`, `proc_macro_path_invoc`, partially `proc_macro_gen`
2018-08-23 01:13:17 +03:00
bors
917945d662 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]`?
2018-08-22 22:08:03 +00:00
dylan_DPC
8fbcb9c53c add warning for missing docs 2018-08-23 01:56:39 +05:30
Aaron Power
200c6d9fb5
Update RELEASES.md 2018-08-22 21:18:31 +01:00
bors
f1b506af02 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
2018-08-22 19:59:52 +00:00
Ralf Jung
276253e66a update nomicon and book 2018-08-22 21:17:58 +02:00
bors
b75b0471a8 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
2018-08-22 17:43:44 +00:00
Oliver Schneider
bd6ae6a6d1 Reexpose stability hole in the presence of feature gates 2018-08-22 18:31:53 +02:00
Oliver Schneider
bb78426ca8 Allow panicking with string literal messages inside constants 2018-08-22 18:28:57 +02:00
Guillaume Gomez
f012b4c84e
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 ab03c1e422. As far as anyone reading this comment today needs to know, the function has never parsed items from inside an extern crate.
2018-08-22 17:45:43 +02:00
Guillaume Gomez
4f78a2d58f
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.
2018-08-22 17:45:41 +02:00
Guillaume Gomez
ef4b2edbd7
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).
2018-08-22 17:45:39 +02:00
Guillaume Gomez
95bdc6589b
Rollup merge of #53558 - davidtwco:issue-53547, r=estebank
Normalize source line and column numbers.

Fixes #53547.

r? @eddyb
2018-08-22 17:45:38 +02:00
Guillaume Gomez
e53a575ddb
Rollup merge of #53544 - estebank:issue-53534, r=varkor
Point at the trait argument when using unboxed closure

Fix #53534.

r? @varkor
2018-08-22 17:45:37 +02:00