Commit Graph

81153 Commits

Author SHA1 Message Date
Esteban Küber
bde2be0b1c Add test for raw string 2018-07-23 16:03:26 -07:00
Esteban Küber
c55a698943 Only point at inside of string literals if they're actually string literals 2018-07-23 15:41:32 -07:00
Esteban Küber
6bcf8777fe Point only at invalid positional arguments 2018-07-23 15:09:00 -07:00
bors
6a1c0637ce Auto merge of #52175 - fpoli:testsuite-callsite-span, r=petrochenkov
Match errors using the callsite of macro expansions

Fix for issue #51848
2018-07-23 21:44:37 +00:00
Matthew Jasper
338d545b90 Don't match on region kinds when reporting NLL errors
With NLL region kinds are always ReVar
2018-07-23 20:54:09 +01:00
bors
00204c2f52 Auto merge of #50494 - F001:as_cell, r=alexcrichton
Implement rfc 1789: Conversions from `&mut T` to `&Cell<T>`

I'm surprised that RFC 1789 has not been implemented for several months. Tracking issue: https://github.com/rust-lang/rust/issues/43038

Please note: when I was writing tests for `&Cell<[i32]>`, I found it is not easy to get the length of the contained slice. So I designed a `get_with` method which might be useful for similar cases. This method is not designed in the RFC, and it certainly needs to be reviewed by core team. I think it has some connections with `Cell::update` https://github.com/rust-lang/rust/issues/50186 , which is also in design phase.
2018-07-23 19:43:36 +00:00
bors
8dbbd81f7e Auto merge of #52566 - pnkfelix:buffer-nll-errors-for-z-borrowck-migrate, r=nikomatsakis
Buffer NLL errors

Buffer the errors generated during MIR-borrowck (aka NLL).

This is the first big step towards resolving issue #46908.
2018-07-23 17:45:34 +00:00
bors
6bb50f569d Auto merge of #52639 - oli-obk:clippyup, r=kennytm
Update the clippy submodule

r? @kennytm

cc @nrc @Manishearth
2018-07-23 15:38:46 +00:00
Oliver Schneider
9130efdad3 Implement associated existential types 2018-07-23 17:38:45 +02:00
Esteban Küber
42306591b9 Point at incorrect named arg in format string 2018-07-23 08:22:20 -07:00
csmoe
87f0c1f337 Suggest to take and ignore args while closure args count mismatching 2018-07-23 22:35:51 +08:00
bors
5665a2d367 Auto merge of #52506 - alexcrichton:dont-duplicate-wasm-sections, r=michaelwoerister
rustc: Work around an upstream wasm ThinLTO bug

This commit implements a workaround for an [upstream LLVM bug][1] where custom
sections were accidentally duplicated amongst codegen units when ThinLTO passes
were performed. This is due to the fact that custom sections for wasm are stored
as metadata nodes which are automatically imported into modules when ThinLTO
happens. The fix here is to forcibly delete the metadata node from imported
modules before LLVM has a chance to try to copy it over.

[1]: https://bugs.llvm.org/show_bug.cgi?id=38184
2018-07-23 13:42:23 +00:00
ljedrz
49c8ba91c7 Change single char str patterns to chars 2018-07-23 15:32:57 +02:00
F001
489101cc45 use inherent method instead 2018-07-23 20:58:40 +08:00
ljedrz
fe588d894f Replace a few expect+format combos with unwrap_or_else+panic 2018-07-23 14:47:13 +02:00
Federico Poli
8ec9d7242c Match errors using the callsite of macro expansions 2018-07-23 14:31:06 +02:00
Felix S. Klock II
1a0294bb84 Thread the errors_buffer down through the NLL region_infer code. 2018-07-23 14:20:20 +02:00
Felix S. Klock II
ec005ccf84 Separate the construction of a generic bound failure from its emission. 2018-07-23 14:20:20 +02:00
Felix S. Klock II
87e729f58a thread the errors_buffer down into nll::type_check.
Right now its solely used for `check_local`, which ... I guess is not surprising?
2018-07-23 14:20:20 +02:00
Santiago Pastorino
3d3e0aa571 Buffer errors in MIR borrow check
(pnkfelix updated to address tidy, and to change the buffer from
`Vec<DiagnosticBuilder<'errs>>` to a `Vec<Diagnostic>` in order to
avoid painful lifetime maintenance.)
2018-07-23 14:20:12 +02:00
ljedrz
d89ac4caf7 Simplify 2 functions in rustc_mir/dataflow 2018-07-23 14:10:31 +02:00
Thomas de Zeeuw
89495f3ca3 Forget Waker when cloning LocalWaker
Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.

This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.

Closes #52629.
2018-07-23 13:45:25 +02:00
bors
970102f24c Auto merge of #52589 - petrochenkov:derlint, r=alexcrichton
Attach deprecation lint `proc_macro_derive_resolution_fallback` to a specific node id

So it can be `allow`-ed from inside the derive.

cc https://github.com/rust-lang/rust/pull/51952
2018-07-23 11:39:50 +00:00
Santiago Pastorino
da935e96a1 Remove redundant outlives declarations 2018-07-23 13:28:54 +02:00
Santiago Pastorino
82e853e2e2 Remove wrong allow(dead_code) directive 2018-07-23 13:28:54 +02:00
Santiago Pastorino
bc1eec3fa8 Remove unneded lifetimes relations declaration 2018-07-23 13:28:54 +02:00
Santiago Pastorino
e4e84fd8ff Let mir reference lifetime be inferred 2018-07-23 13:28:54 +02:00
Santiago Pastorino
30313c0ec9 Let lifetimes on find be inferred 2018-07-23 13:28:54 +02:00
Santiago Pastorino
caa11dee50 Remove unused lifetime annotation 2018-07-23 13:28:54 +02:00
Santiago Pastorino
5dc5c02581 gcx outlives tcx which outlives a, no need to explicitly do gcx: a 2018-07-23 13:27:32 +02:00
Santiago Pastorino
e0ea756b9f Remove duplicated report word in docs 2018-07-23 13:27:32 +02:00
Oliver Schneider
4e93436325 Update the clippy submodule 2018-07-23 13:01:44 +02:00
Ralf Jung
a303741334 typos 2018-07-23 12:53:37 +02:00
bors
2e6fc3e2c0 Auto merge of #52211 - bjorn3:misc_rustdoc_changes, r=QuietMisdreavus
Misc rustdoc changes
2018-07-23 09:37:03 +00:00
Ralf Jung
33b8f6253f Don't use NonNull::dangling as sentinel value
Instead, rely on alignment and use usize::MAX as sentinel.
2018-07-23 11:31:55 +02:00
Oliver Schneider
cbd42749ef Update mir-opt to promoted changes 2018-07-23 09:51:31 +02:00
Oliver Schneider
be92f9d3d6 Teach new error messages in MIR borrowck about promoted places 2018-07-23 09:51:31 +02:00
Oliver Schneider
ac54b7499b A promoted has a place and can thus be equal to itself 2018-07-23 09:51:31 +02:00
Oliver Schneider
4fba7d33d6 Mark an unreachable case as a bug instead of attempting to show an error to the user 2018-07-23 09:51:30 +02:00
Oliver Schneider
2aab6af0fa Fix tidy 2018-07-23 09:51:30 +02:00
Oliver Schneider
62581b8f0d Explain promoted extraction for simd shuffle 2018-07-23 09:51:30 +02:00
Oliver Schneider
de511438cd Promoteds are statics and statics have a place, not just a value 2018-07-23 09:51:30 +02:00
bors
3900bf8ae3 Auto merge of #52612 - matthewjasper:remove-unnecessary-flow, r=nikomatsakis
Don't keep the possibly initialized flow around longer than needed

The possibly initialized flow isn't used after liveness is computed, so don't keep it around. Locally this is about a 10% time win for tuple-stress (which is spending a lot of time calculating flows now that it's not spending so much on liveness).

r? @nikomatsakis
2018-07-23 06:44:15 +00:00
Esteban Küber
38abca8c2d Point at internal span in format string 2018-07-22 23:09:00 -07:00
bors
210d61f05c Auto merge of #52571 - oli-obk:promotion_abort, r=nagisa
Abort if a promoted fails to be const evaluable and its runtime checks didn't trigger

r? @eddyb

cc @RalfJung @nagisa

cc https://github.com/rust-lang/rust/issues/49760
2018-07-23 03:06:08 +00:00
bors
02b0479c26 Auto merge of #52568 - oli-obk:span_bug_error, r=varkor
Fix loop label resolution around constants

And make `delay_span_bug` a little more helpful

r? @varkor

fixes #52442
fixes #52443
2018-07-23 01:02:32 +00:00
bors
67f9c71e45 Auto merge of #52564 - pnkfelix:issue-52126-lhs-of-assign-op-is-invariant, r=eddyb
LHS of assign op is invariant

This addresses a bug injected by #45435. That PR changed the way we type-check `LHS <op> RHS` to coerce the LHS to the expected supertype in much the same way that we coerce the RHS.

The problem is that when we have a case of `LHS <op>= RHS`, we do not want to coerce to a supertype; we need the type to remain invariant. Otherwise we risk leaking a value with short-lifetimes into a expression context that needs to satisfy a long lifetime.

Fix #52126
2018-07-22 23:05:11 +00:00
bors
ffaf3d2567 Auto merge of #52069 - zackmdavis:elided_states_of_america—and_to_the_re-pub-lic, r=nikomatsakis
add structured suggestions and fix false-positive for elided-lifetimes-in-paths lint

This adds structured suggestions to the elided-lifetimes-in-paths lint (introduced in Nov. 2017's #46254), prevents it from emitting a false-positive on anonymous (underscore) lifetimes (!), and adds it to the idioms-2018 group (#52041).

~~As an aside, "elided-lifetimes-in-paths" seems like an unfortunate name, because it's not clear exactly what "elided" means. The motivation for this lint (see original issue #45992, and [RFC 2115](e978a8d301/text/2115-argument-lifetimes.md (motivation))) seems to be specifically about not supplying angle-bracketed lifetime arguments to non-`&` types, but (1) the phrase "lifetime elision" has historically also referred to the ability to not supply a lifetime name to `&` references, and (2) an `is_elided` method in the HIR returns true for anoymous/underscore lifetimes, which is _not_ what we're trying to lint here. (That naming confusion is almost certainly what led to the false positive addressed here.) Given that the lint is relatively new and is allow-by-default, is it too late to rename it ... um, _again_ (#50879)?~~

~~This does _not_ address a couple of other false positives discovered in https://github.com/rust-lang/rust/issues/52041#issuecomment-402547901.~~

![elided_states](https://user-images.githubusercontent.com/1076988/42302137-2bf9479c-7fce-11e8-8bd0-f29aefc802b6.png)

r? @nikomatsakis
cc @nrc @petrochenkov
2018-07-22 20:54:05 +00:00
Mark Rousskov
814e6e60f9 Compile rustc before building tests for rustdoc 2018-07-22 14:40:00 -06:00
Esteban Küber
59a435b220 Use MultiSpan in E0707 and E709 2018-07-22 12:19:34 -07:00