Commit Graph

9421 Commits

Author SHA1 Message Date
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
Mazdak Farrokhzad
af1146bd23 parse: recover on const fn() / async fn(). 2020-03-26 09:44:11 +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
PankajChaudhary5
e5f4dad6c8 Refactor code 2020-03-26 13:17:41 +05:30
PankajChaudhary5
95870e25c6 Add long error explanation for E0703 2020-03-26 11:32:56 +05:30
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
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
da10963357 typeck/pat: address review comments 2020-03-26 02:29:42 +01: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
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
Olivier Goffart
4d77d01096 Fix for #62691: use the largest niche across all fields
fixes #62691
2020-03-25 23:08:23 +01:00
Dylan DPC
3586ab615e 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
2020-03-25 19:28:11 +01:00
Dylan DPC
1154023118 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
2020-03-25 19:28:09 +01:00
Ana-Maria Mihalache
0f7840b89b Rename LayoutDetails to just Layout. 2020-03-25 15:06:48 +00:00
Mazdak Farrokhzad
c70aa344e4 borrowck: prefer "value" over "_". 2020-03-25 11:42:25 +01:00
Mazdak Farrokhzad
bd156846fa improve non-exhaustive struct pat error 2020-03-25 08:35:17 +01:00
bishtpawan
5c65568f0b update tool_lints 2020-03-25 11:32:23 +05:30
Mazdak Farrokhzad
83fc855d03 Rollup merge of #70376 - tmandry:issue-66312, r=Centril
Add test for #66312

Closes #66312. This issue was fixed by #68884.

r? @Zoxc
2020-03-25 06:45:38 +01:00
Mazdak Farrokhzad
cb17049b36 Rollup merge of #70369 - estebank:bad-placeholder-in-where, r=Centril
Fix smaller issues with invalid placeholder type errors

Follow up to #70294.

- Fix placement of suggested generic param when bounds are present.
- Reduce error duplication for invalid placeholder types in `fn` types.

r? @Centril
2020-03-25 06:45:35 +01:00
Mazdak Farrokhzad
3d0976a91b Rollup merge of #70364 - petrochenkov:nofrustc, r=Centril
resolve: Remove `rustc_attrs` as a standalone feature gate

Now it only gates specific built-in attributes.

So if you want to make a rustc attribute, make it a built-in (this was already the case in practice for some time).
2020-03-25 06:45:33 +01:00
Mazdak Farrokhzad
d03c02a589 Rollup merge of #70331 - jeremystucki:privacy, r=estebank
Increase verbosity when using update syntax with private fields

Resolves #70323
2020-03-25 06:45:27 +01:00
Esteban Küber
7534efa0ef Reduce error duplication for invalid placeholder types in fn types 2020-03-24 18:01:37 -07:00
Tyler Mandry
1a21c28e39 Add test for #66312
Closes #66312. This issue was fixed by #68884.
2020-03-24 16:44:45 -07:00
Mazdak Farrokhzad
b8093bad58 Rollup merge of #70241 - RalfJung:global-mem, r=oli-obk
Miri: move ModifiedStatic to ConstEval errors

Also generally adjust terminology from "static" to "global" where appropriate (to avoid confusion with specifically `static` items).
2020-03-24 21:32:29 +01:00
Mazdak Farrokhzad
50d2f302cb Rollup merge of #70234 - anp:tracked-std-traits, r=Amanieu
#[track_caller] on core::ops::{Index, IndexMut}.

Applies the attribute to `core::ops::Index(Mut)` and enough std internals to cover the [functions listed in "tier 1" in the original RFC](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md#survey-of-panicking-standard-functions).

Split out from #69251 to allow separate assessment of perf impact.

To my knowledge, this is the last piece of implementing RFC 2091.

Tracking issue: https://github.com/rust-lang/rust/issues/47809
2020-03-24 21:32:28 +01:00
Vadim Petrochenkov
7332305305 Remove attribute #[structural_match] and any references to it 2020-03-24 22:58:15 +03:00
Niko Matsakis
e7f8895359 save/restore pessimistic_yield when entering bodies
This flag is used to make the execution order around `+=` operators
pessimistic. Failure to save/restore the flag was causing independent
async blocks to effect one another, leading to strange ICEs and failed
assumptions.
2020-03-24 15:25:43 -04:00
Vadim Petrochenkov
1fa6be0358 resolve: Remove rustc_attrs as a standalone feature gate
Now it only gates specific built-in attributes
2020-03-24 21:37:29 +03:00
Esteban Küber
cfeedec823 Fix placement of suggested generic param when bounds are present 2020-03-24 11:36:08 -07:00
Bastian Kauschke
6c4d5d9896 improve normalize cycle error 2020-03-24 11:24:24 +01:00
bishtpawan
10226daa4e Update tools_lints 2020-03-24 15:41:31 +05:30
bishtpawan
cd9921ed82 Refactor changes 2020-03-24 13:09:18 +05:30
Mazdak Farrokhzad
92885e3a5b rustc_typeck: remove rustc_hir_pretty usage 2020-03-24 08:38:32 +01:00
bishtpawan
03bb3bde90 Add long error explanation for E0710 #61137 2020-03-24 13:03:01 +05:30
Ralf Jung
58a56cc8c0 bless you 2020-03-24 08:27:46 +01:00
Ralf Jung
69cf211d06 get back the more precise error message 2020-03-24 08:27:46 +01:00
Ralf Jung
f70af91e51 bless; add test for mutating a static 2020-03-24 08:27:46 +01:00
Mazdak Farrokhzad
d309058101 Rollup merge of #70284 - lcnr:issue70273-what-the-heck-git, r=eddyb
correctly handle const params in type_of

extends #70223, retry of #70276

fixes #70273

r? @eddyb cc @varkor
2020-03-24 07:13:40 +01:00
Mazdak Farrokhzad
d626f5bc66 Rollup merge of #70077 - Aaron1011:feature/new-def-path-ident, r=petrochenkov
Store idents for `DefPathData` into crate metadata

Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.

We now store the identifier's `Span` in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an `Ident`.

This improves the output of several tests, which previously had messages
suppressed due to dummy spans.

This is a prerequisite for #68686, since throwing away a `Span` means
that we lose hygiene information.
2020-03-24 07:13:35 +01:00
Mazdak Farrokhzad
3d8b9614d3 Rollup merge of #70074 - Centril:unpanictry, r=petrochenkov
Expand: nix all fatal errors

Basically, we go after all `.span_fatal` / `FatalError.raise()` and similar things and remove them one by one until there are no fatal errors left.

r? @petrochenkov
2020-03-24 07:13:33 +01:00
Mazdak Farrokhzad
a1309547f9 Rollup merge of #68884 - Zoxc:gen-type, r=nikomatsakis
Make the `type_of` return a generic type for generators

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

r? @nikomatsakis
2020-03-24 07:13:28 +01:00
Mazdak Farrokhzad
470e16372f pacify missing sysroot spans issue 2020-03-24 06:28:56 +01:00
Mazdak Farrokhzad
c415f12582 fix rebase fallout due to #69497. 2020-03-24 06:28:56 +01:00
Mazdak Farrokhzad
d07103508a fix rebase fallout 2020-03-24 06:28:56 +01:00
Mazdak Farrokhzad
d8080d828c expand: address review comments 2020-03-24 06:28:56 +01:00
Mazdak Farrokhzad
21944b3a10 expand: add recovery for parse_nt 2020-03-24 06:28:56 +01:00
Mazdak Farrokhzad
3979964200 defatalize expand_test_or_bench 2020-03-24 06:28:56 +01:00
Mazdak Farrokhzad
1bfa2483d5 defatalize compile_declarative_macro 2020-03-24 06:28:56 +01:00