91532 Commits

Author SHA1 Message Date
kennytm
42b7d2c170
Rollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkov
Use a valid name for graphviz graphs

Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
2019-03-24 18:59:42 +08:00
Vadim Petrochenkov
c667c2fc08 Remove methods is_struct/is_tuple/is_unit from VariantData 2019-03-24 12:10:16 +03:00
David Wood
5c3d1e5d76 Separate variant id and variant constructor id.
This commit makes two changes - separating the `NodeId` that identifies
an enum variant from the `NodeId` that identifies the variant's
constructor; and no longer creating a `NodeId` for `Struct`-style enum
variants and structs.

Separation of the variant id and variant constructor id will allow the
rest of RFC 2008 to be implemented by lowering the visibility of the
variant's constructor without lowering the visbility of the variant
itself.

No longer creating a `NodeId` for `Struct`-style enum variants and
structs mostly simplifies logic as previously this `NodeId` wasn't used.
There were various cases where the `NodeId` wouldn't be used unless
there was an unit or tuple struct or enum variant but not all uses of
this `NodeId` had that condition, by removing this `NodeId`, this must
be explicitly dealt with. This change mostly applied cleanly, but there
were one or two cases in name resolution and one case in type check
where the existing logic required a id for `Struct`-style enum variants
and structs.
2019-03-24 12:10:16 +03:00
kennytm
48dc8efc85
Rollup merge of #59239 - gnzlbg:fix_spin_loop, r=nagisa
Remove inline assembly from hint::spin_loop

This PR removes the inline assembly which was not required since these
instructions are available in core::arch, and extends support of
the spin_loop hint to arm targets with the v6 feature which also
support the yield instruction.
2019-03-24 15:32:45 +08:00
kennytm
6c5e1d151a
Rollup merge of #59213 - kornelski:robots, r=Mark-Simulacrum
Track changes to robots.txt

Currently `robots.txt` of doc.rust-lang.org is not part of any repo, so there's [no way to contribute any changes to it](https://internals.rust-lang.org/t/deadlock-about-fixing-outdated-documentation-links-in-search-engines/9374), such as needed for #44894 and countless dupes of this issue.

I propose adding it to this repo. I'm not in control of the infrastructure, so I can't help to automate deployment of it, but even just having the file under source control is IMHO a step forward.
2019-03-24 15:32:42 +08:00
bors
fb5ed488ff Auto merge of #59199 - estebank:untrack-errors, r=eddyb
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins`

In the spirit of continuing through errors in type checking (#39275), remove `track_errors` from a couple of locations in the codebase.
2019-03-24 05:38:10 +00:00
Saleem Jaffer
fb93f10dac code review fixes 2019-03-24 08:59:11 +05:30
Chris Gregory
00716b480f Make ptr::eq documentation mention smart-pointer behavior
Resolves #59214
2019-03-23 19:43:32 -04:00
bors
93f5ba0ee5 Auto merge of #59084 - estebank:diagnostic-spans, r=davidtwco
Tweak some diagnostic spans
2019-03-23 22:26:11 +00:00
Esteban Küber
59f0f2edc1 Fix span after rebase 2019-03-23 14:10:39 -07:00
Peter Hall
3eb4eae96d Fixes #59361 2019-03-23 20:41:57 +00:00
Esteban Küber
81394ce9ae Fix rebase 2019-03-23 13:05:30 -07:00
Esteban Küber
0a4ecf3438 Mark duplicate import removal suggestion tool only 2019-03-23 13:05:30 -07:00
Esteban Küber
ce90db1ff1 Deduplicate const eval error spans for better output 2019-03-23 13:05:30 -07:00
Esteban Küber
44730271f7 Hide obvious suggestion from cli output 2019-03-23 13:05:30 -07:00
Esteban Küber
3211f38828 Tweak unnecessary import suggestion 2019-03-23 13:05:30 -07:00
Esteban Küber
9bfb0ef818 Tweak unsupported negative trait bounds message 2019-03-23 13:05:30 -07:00
Esteban Küber
e1be8b0318 Swap primary/secondary spans for E0458 2019-03-23 13:05:30 -07:00
Esteban Küber
8e043950c8 Swap const evaluation lint spans to point at problem in primary span 2019-03-23 13:05:30 -07:00
Esteban Küber
1b0ab0b8a9 Tweak spans for E0599 2019-03-23 13:05:29 -07:00
bors
0633c55d20 Auto merge of #59068 - ljedrz:kill_off_NodeId_stragglers, r=Zoxc
HirIdification: kill off NodeId stragglers

The final stages of HirIdification (#57578).

This PR, along with https://github.com/rust-lang/rust/pull/59042, should finalize the HirIdification process (at least the more straightforward bits).

- replace `NodeId` with `HirId` in `trait_impls`
- remove all `NodeId`s from `borrowck`
- remove all `NodeId`s from `typeck`
- remove all `NodeId`s from `mir`
- remove `trait_auto_impl` (unused)

I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel`  and `hir::ItemId`, but I don't know if this is feasible.

I'll be happy to do more if I've missed anything.
2019-03-23 17:34:18 +00:00
Saleem Jaffer
752544b284 adding mir::StaticKind enum for static and promoted 2019-03-23 20:18:52 +05:30
Vadim Petrochenkov
4b382946e4 syntax: Remove warning for unnecessary path disambiguators 2019-03-23 17:20:11 +03:00
Guillaume Gomez
befe9cac91 Add test 2019-03-23 14:44:20 +01:00
Guillaume Gomez
dc628b4f67 cleanup 2019-03-23 14:43:27 +01:00
varkor
5032643538 Use if let instead of match 2019-03-23 13:05:36 +00:00
bors
0f118f6a6c Auto merge of #59096 - ljedrz:HirIdify_AccessLevel, r=Zoxc
middle: replace NodeId with HirId in AccessLevels

Pushing the limits of HirIdification (#57578).

Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^.

r? @Zoxc
2019-03-23 12:21:27 +00:00
Harald Hoyer
cf8347ba6b
fs::copy() set file mode early
A convenience method like fs::copy() should try to prevent pitfalls a
normal user doesn't think about.

In case of an empty umask, setting the file mode early prevents
temporarily world readable or even writeable files,
because the default mode is 0o666.

In case the target is a named pipe or special device node, setting the
file mode can lead to unwanted side effects, like setting permissons on
`/dev/stdout` or for root setting permissions on `/dev/null`.

copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or
a device like "/dev/null", so fallback to io::copy, too.

Use `fcopyfile` on MacOS instead of `copyfile`.

Fixes: https://github.com/rust-lang/rust/issues/26933
Fixed: https://github.com/rust-lang/rust/issues/37885
2019-03-23 07:36:27 +01:00
bors
d51a437e28 Auto merge of #59058 - petrochenkov:assocrecov3, r=estebank
syntax: Better recovery for `$ty::AssocItem` and `ty!()::AssocItem`

This PR improves on https://github.com/rust-lang/rust/pull/46788 covering a few missing cases.

Fixes https://github.com/rust-lang/rust/issues/52307
Fixes https://github.com/rust-lang/rust/issues/53776
r? @estebank
2019-03-23 05:51:16 +00:00
Esteban Küber
e929d19edc review comments 2019-03-22 21:54:19 -07:00
Esteban Küber
2f7b32091e extend on-unimplemented docs 2019-03-22 20:38:14 -07:00
Esteban Küber
ac3290e8d9 Add suggestion to use &*var when &str: From<String> is expected 2019-03-22 20:38:14 -07:00
Esteban Küber
57236324ee Add note to address check_match errors 2019-03-22 20:32:10 -07:00
Esteban Küber
afdc38da0a address review comments 2019-03-22 20:15:32 -07:00
Esteban Küber
c89872cb7d Do not track_errors in register_plugins 2019-03-22 20:15:32 -07:00
Esteban Küber
936dec8df3 Continue running after typeck_item_bodies has failed 2019-03-22 20:15:32 -07:00
Esteban Küber
d1808aa509 Remove track_errors from check_match 2019-03-22 20:15:32 -07:00
Esteban Küber
d72ef21ddd Reword type ascription note to reduce verbosity 2019-03-22 20:14:20 -07:00
Esteban Küber
44a086ef39 Review comment 2019-03-22 19:50:18 -07:00
Esteban Küber
81b876b6a3 Hide "type ascription is experimental error" unless it's the only one
In order to minimize the verbosity of common syntax errors that are parsed
as type ascription, hide the feature gate error unless there are no other
errors being emitted by the parser.
2019-03-22 19:50:18 -07:00
Esteban Küber
72a3089092 Only suggest let assignment for type ascription if we find an equals sign 2019-03-22 19:50:18 -07:00
Esteban Küber
b1a6c32660 Tweak labels 2019-03-22 19:50:18 -07:00
Esteban Küber
8ba1a97e37 Expand suggestions for type ascription parse errors 2019-03-22 19:50:18 -07:00
bors
f21dee2c61 Auto merge of #58929 - estebank:elide-object, r=zackmdavis
Elide object safety errors on non-existent trait function

Fix #58734.

r? @zackmdavis
2019-03-23 02:40:15 +00:00
Samuel Holland
8d3dd39d88 Correct minimum system LLVM version in tests
Since commit 9452a8dfa3ba, the new debug info format is only generated
for LLVM 8 and newer versions. However, the tests still assume that LLVM
7 will use the new debug info format. Fix the tests (and a comment in
the code) to match the actual version check.
2019-03-22 21:28:25 -05:00
Linus Färnstrand
1ccad16231 Update sys::time impls to have checked_sub_instant 2019-03-22 23:56:40 +01:00
Dan Robertson
8ea435caf8
ffi: rename VaList::copy to VaList::with_copy
Rename `VaList::copy` to `VaList::with_copy`.
2019-03-22 22:28:07 +00:00
Linus Färnstrand
d56b1fd0e7 Make duration_since use checked_duration_since 2019-03-22 22:53:07 +01:00
Linus Färnstrand
37cfeb2710 Add/rename checked_duration_since tests 2019-03-22 22:53:07 +01:00
bors
9f91bee03f Auto merge of #59370 - Centril:rollup, r=Centril
Rollup of 18 pull requests

Successful merges:

 - #59106 (Add peer_addr function to UdpSocket)
 - #59170 (Add const generics to rustdoc)
 - #59172 (Update and clean up several parts of CONTRIBUTING.md)
 - #59190 (consistent naming for Rhs type parameter in libcore/ops)
 - #59236 (Rename miri component to miri-preview)
 - #59266 (Do not complain about non-existing fields after parse recovery)
 - #59273 (some small HIR doc improvements)
 - #59291 (Make Option<ThreadId> no larger than ThreadId, with NonZeroU64)
 - #59297 (convert field/method confusion help to suggestions)
 - #59304 (Move some bench tests back from libtest)
 - #59309 (Add messages for different verbosity levels. Output copy actions.)
 - #59321 (Unify E0109, E0110 and E0111)
 - #59322 (Tweak incorrect escaped char diagnostic)
 - #59323 (use suggestions for "enum instead of variant" error)
 - #59327 (Add NAN test to docs)
 - #59329 (cleanup: Remove compile-fail-fulldeps directory again)
 - #59347 (Move one test from run-make-fulldeps to ui)
 - #59360 (Add tracking issue number for `seek_convenience`)

Failed merges:

r? @ghost
2019-03-22 21:00:07 +00:00