Commit Graph

43 Commits

Author SHA1 Message Date
David Wood
539404b77d
Update output for borrowck=migrate compare mode.
This commit updates the test output for the updated NLL compare mode
that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The
previous commit changes `compiletest` and this commit only updates
`.nll.stderr` files.
2018-10-17 00:57:32 +02:00
Basile Desloges
b01550a718 Update tests 2018-09-01 12:58:18 +02:00
bors
7de3dea2b7 Auto merge of #53175 - matthewjasper:more-return-stuff, r=nikomatsakis
[NLL] Returns are interesting for free regions

Based on #53088 - creating now to get feedback.

Closes #51175

* Make assigning to the return type interesting.
* Use "returning this value" instead of "return" in error messages.
* Prefer one of the explanations that we have a name for to a generic interesting cause in some cases.
* Treat causes that involve the destination of a call like assignments.
2018-08-18 11:57:46 +00:00
Eduard-Mihai Burtescu
32e17b5921 tests: prefer edition: directives to compile-flags:--edition. 2018-08-16 10:36:11 +03:00
Matthew Jasper
371c23fe34 Update tests 2018-08-14 20:35:47 +01:00
bors
9e472c2ace Auto merge of #52450 - PramodBisht:issue/52413, r=estebank
Closes #52413: Provide structured suggestion instead of label

Provide structured suggestion instead of label
r? @estebank
2018-08-07 08:50:12 +00:00
bors
45a9d410f9 Auto merge of #53016 - scottmcm:impl-header-lifetime-elision, r=nikomatsakis
Extract impl_header_lifetime_elision out of in_band_lifetimes

This way we can experiment with `impl Debug for &MyType` separately from `impl Debug for &'a MyType`.

I can't say I know what the code in here is doing, so please let me know if there's a better way 🙂

I marked this as enabled in 2018 so that edition code continues to work without another flag.

Actual feature PR https://github.com/rust-lang/rust/pull/49251; Tracking Issue https://github.com/rust-lang/rust/issues/15872; In-band lifetimes tracking issue https://github.com/rust-lang/rust/issues/44524.

cc @aturon, per discussion on discord earlier
cc @cramertj & @nikomatsakis, who actually wrote these features
2018-08-06 21:45:32 +00:00
David Wood
37ba9ca334
Disable some nice region errors in NLL mode. 2018-08-06 20:43:16 +02:00
Pramod Bisht
49b0a1e073 #52413: addressed @estebank's Nit 2018-08-06 17:56:24 +00:00
Pramod Bisht
19401086df Closes #52413: Provide structured suggestion instead of label 2018-08-05 18:44:03 +00:00
Scott McMurray
ce9d469a70 Extract impl_header_lifetime_elision out of in_band_lifetimes 2018-08-03 00:08:44 -07:00
David Wood
b377e7bbfb
Change label from closure to function where appropriate. 2018-07-27 12:48:47 +02: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
Zack M. Davis
41d5c0ce1f in which the elided-lifetimes-in-paths lint undergoes a revolution
The existing elided-lifetimes-in-paths lint (introduced in Nov. 2017's
accd997b5 / #46254) lacked stuctured suggestions and—much more
alarmingly—produced false positives on associated functions (like
`Ref::clone`) and on anonymous '_ lifetimes (!!—yes, the very
anonymous lifetimes that we meant to suggest "instead"). That this
went apparently unnoticed for so long maybe tells you something about
how many people actually bother to flip on allow-by-default lints.

After many hours of good old-fashioned American elbow grease—and a
little help from expert reviewers—it turns out that getting the right
answer is a lot easier if we fire the lint while lowering the Higher
Intermediate Representation.

The lint is promoted to the idioms-2018 group.

Also, in the matter of test filenames, "elided" only has one 'l' (see,
e.g., https://en.wiktionary.org/wiki/elide).

Resolves #52041.
2018-07-22 08:27:10 -07:00
David Wood
c64db0078a
Fallback to general error handling in ICE cases. 2018-07-22 12:53:55 +01:00
Niko Matsakis
727f01700b write code to extract region names and emit new style message 2018-07-04 05:09:33 -04:00
Esteban Küber
03bcebbc60 Also point to free named region on lifetime errors 2018-06-28 11:12:44 -07:00
Zack M. Davis
4b1808578a add dyn to display of dynamic (trait) type names
The `dyn Trait` syntax was stabilized in 199ee327. Resolves #49277.
2018-06-23 18:10:25 -07:00
Vadim Petrochenkov
e60eaf59df Fix naming conventions for new lints 2018-05-25 02:35:07 +03:00
Niko Matsakis
aef29a0583 fix single-use lint 2018-05-04 05:54:01 -04:00
Christian Poveda
b80472d84c fixed tests 2018-04-27 11:02:36 -05:00
Christian Poveda
4bf35f93c9 updated stderr files and removed feature-gate test for dyn_trait 2018-04-27 10:05:51 -05:00
Christian Poveda
0efb5677d7 dyn_trait feature-gate just for stage0 2018-04-27 10:04:58 -05:00
Felix S. Klock II
032081cdff Trivial updates to .nll.stderr files post-rebase, reflecting s/-Znll/nll/ in messages. 2018-04-18 15:37:23 +02:00
Felix S. Klock II
746d63a203 Checkpoint the current status of NLL on ui tests via compare-mode=nll. 2018-04-11 00:38:35 +02:00
Taylor Cramer
e6e6bd27d5 Stabilize underscore lifetimes 2018-03-29 00:27:50 +02:00
Taylor Cramer
c393db67ba Stabilize universal_impl_trait 2018-03-26 07:39:38 +02:00
Niko Matsakis
94468dac63 permit '_ and &T in impl headers
Deprecated forms of elision are not supported.
2018-03-22 16:54:52 -04:00
Eric Huss
6aa4dcb9cf Add empty main() to tests where it is missing. 2018-03-14 12:23:28 -07:00
Eric Huss
b4b7ccbd1c Add crate name to "main function not found" error message.
Fixes #44798 and rust-lang/cargo#4948.
2018-03-14 11:40:13 -07:00
Guillaume Gomez
2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Vadim Petrochenkov
7ba5fd168a Update UI tests 2018-02-26 20:24:42 +03:00
Vadim Petrochenkov
fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Guillaume Gomez
5747fd6611 Update ui tests 2018-02-25 12:15:05 +01:00
bors
aa0a5a86a1 Auto merge of #46254 - Dylan-DPC:ellided-lifetime, r=nikomatsakis
elided lifetime

Closes #45992

Hey
Having a problem with my config so decided to make a WIP PR nevertheless. Will add some more tests.
2018-02-03 14:38:52 +00:00
dpc
accd997b54 add ellided lifetime 2018-02-02 02:10:10 +05:30
Esteban Küber
67696be160 Point only at method signatures and point at trait
- On mismatch between impl and trait method, point at the trait
   signature.
 - Point only at the method signature instead of the whole body on
   trait/impl mismatch errors.
2018-01-28 17:06:30 -08:00
Esteban Küber
6c026997bf For named lifetimes point only at method signature
When refering to named lifetime conflict, point only at the method's
signature span instead of the entire method.

When the expected and found sup and sub traces are the same, avoid
redundant text.
2018-01-28 12:07:03 -08:00
Esteban Küber
ee06559576 Tweak presentation on lifetime trait mismatch 2018-01-26 16:38:07 -08:00
kennytm
4daaee900f
Add trailing newlines to files which have no trailing newlines. 2017-12-30 15:50:52 +08:00
Niko Matsakis
e741dad629 adding lint for single use lifetime names 2017-12-20 00:07:10 +05:30
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Taylor Cramer
91b7920c09 Implement in-band lifetime bindings 2017-11-22 12:44:09 -05:00