Commit Graph

81355 Commits

Author SHA1 Message Date
mark
2a7ae04a68 Extend ParseSess to support buffering lints 2018-07-23 21:54:43 -05:00
csmoe
a71deb2633 Fix ui test 2018-07-24 10:09:45 +08:00
csmoe
27c0d564ef Mark the suggestion applicable 2018-07-24 10:04:11 +08:00
kennytm
3efc612a93
Rollup merge of #52642 - ljedrz:expect_fun_call, r=Mark-Simulacrum
Replace a few expect+format combos with unwrap_or_else+panic

That way the error strings won't be created if the related errors are not triggered.
2018-07-24 09:50:00 +08:00
kennytm
378ef99eb3
Rollup merge of #52641 - ljedrz:mir_dataflow_misc, r=cramertj
Simplify 2 functions in rustc_mir/dataflow

- `graphviz::outgoing`: the `enumerate` only provides indices; use a range instead
- `DataflowState::interpret_set`: change a push loop to an iterator and remove the `each_bit` helper function
2018-07-24 09:49:59 +08:00
kennytm
b3c9fe2537
Rollup merge of #52640 - Thomasdezeeuw:fix-localwaker-clone, r=cramertj
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-24 09:49:58 +08:00
kennytm
3af372ad57
Rollup merge of #52637 - RalfJung:rc, r=joshtriplett
Don't use NonNull::dangling as sentinel value in Rc, Arc

Instead, rely on alignment and use usize::MAX as sentinel.

Cc #52508

r? @joshtriplett
2018-07-24 09:49:56 +08:00
kennytm
4084f0ee8a
Rollup merge of #52627 - Mark-Simulacrum:rustdoc-test-correct, r=alexcrichton
Compile rustc before building tests for rustdoc

r? @alexcrichton
2018-07-24 09:49:55 +08:00
kennytm
291a62064c
Rollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis
Use MultiSpan in E0707 and E709
2018-07-24 09:49:54 +08:00
kennytm
85bb13c232
Rollup merge of #52621 - ehuss:atty-fix, r=alexcrichton
Fix color detection for Windows msys terminals.

Updates atty to pull in the fix softprops/atty#28.  Closes rust-lang/cargo#5724.
2018-07-24 09:49:53 +08:00
kennytm
5b7e3a1746
Rollup merge of #52605 - estebank:str-plus-eq, r=oli-obk
Do not suggest using `to_owned()` on `&str += &str`

 - Don't provide incorrect suggestion for `&str += &str` (fix #52410)
 - On `&str + String` suggest `&str.to_owned() + &String` as a single suggestion
2018-07-24 09:49:52 +08:00
kennytm
a98c19e24b
Rollup merge of #52548 - tko:cursor-doc, r=sfackler
Cursor: update docs to clarify Cursor only works with in-memory buffers

Reduce misconceptions about Cursor being more general than it really is.

Fixes: #52470
2018-07-24 09:49:50 +08:00
kennytm
cf995d654e
Rollup merge of #52538 - ljedrz:old_musl_i586_flags, r=kennytm
Remove obsolete flags in the i586_musl Dockerfile

Resolves an [outdated FIXME](ab8b961677/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile (L45)) in the Dockerfile for dist-i586-gnu-i586-i686-musl.
2018-07-24 09:49:49 +08:00
Wesley Wiser
715005c1a7 Update compile-fail tests to be ui tests 2018-07-23 21:24:38 -04:00
Wesley Wiser
3290774fa9 Add compile-fail test for #43196
Closes #43196
2018-07-23 21:24:38 -04:00
Wesley Wiser
8c5ef0a09a Add compile-fail test for #42060
Closes #42060
2018-07-23 21:24:38 -04:00
Wesley Wiser
bbbbf2dc32 Add run-pass test for #44005
Closes #44005
2018-07-23 21:24:38 -04:00
Wesley Wiser
63ed6a19aa Add test for #33264
Closes #33264
2018-07-23 21:24:18 -04:00
alecmocatta
296a179b1c
break --subsystem=x into 2 args; closer to former presumably known-good incantation 2018-07-24 02:11:57 +01:00
Wesley Wiser
5363911d85 Add tests for #34784
Closes #34784
2018-07-23 20:57:07 -04:00
bors
e842dea7a3 Auto merge of #52618 - alexcrichton:capture-more, r=petrochenkov
rustc: Implement tokenization of nested items

Ever plagued by #43081 the compiler can return surprising spans in situations
related to procedural macros. This is exhibited by #47983 where whenever a
procedural macro is invoked in a nested item context it would fail to have
correct span information.

While #43230 provided a "hack" to cache the token stream used for each item in
the compiler it's not a full-blown solution. This commit continues to extend
this "hack" a bit more to work for nested items.

Previously in the parser the `parse_item` method would collect the tokens for an
item into a cache on the item itself. It turned out, however, that nested items
were parsed through the `parse_item_` method, so they didn't receive similar
treatment. To remedy this situation the hook for collecting tokens was moved
into `parse_item_` instead of `parse_item`.

Afterwards the token collection scheme was updated to support nested collection
of tokens. This is implemented by tracking `TokenStream` tokens instead of
`TokenTree` to allow for collecting items into streams at intermediate layers
and having them interleaved in the upper layers.

All in all, this...

Closes #47983
2018-07-24 00:50:15 +00:00
alecmocatta
22d0ab0bc3
Pass multiple linker arguments rather than concatenate with commas; -l library -> -llibrary to work with apple's ld 2018-07-24 01:30:43 +01:00
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
Guillaume Gomez
ef7d6fcbd1 Remove generic-impl rendering filter 2018-07-24 00:23:03 +02:00
Esteban Küber
6bcf8777fe Point only at invalid positional arguments 2018-07-23 15:09:00 -07:00
Guillaume Gomez
6eb0b05017 Add src and fix generics display issues 2018-07-24 00:07:22 +02: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