summary refs log tree commit diff
path: root/src/test/ui/span
AgeCommit message (Collapse)AuthorLines
2018-04-28stabilize `#[must_use]` for functions and must-use operatorsZack M. Davis-40/+1
This is in the matter of RFC 1940 and tracking issue #43302.
2018-04-18Workaround rust-lang/rust#49998 by opting into experimental `-Z ↵Felix S. Klock II-9/+12
nll-subminimal-causes` flag This commit only applies the flag to the one test case, ui/span/dropck_vec_cycle_checked.rs, that absolutely needs it. Without the flag, that test takes an unknown amount of time (greater than 1 minute) to compile. But its possible that other tests would also benefit from the flag, and we may want to make it the default (after evaluating its impact on other tests). In terms of its known impact on other tests, I have only evaluated the ui tests, and the *only* ui test I have found that the flag impacts (running under NLL mode, of course), is src/test/ui/nll/issue-31567.rs In particular: ``` % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs error[E0597]: `*v.0` does not live long enough --> ../src/test/ui/nll/issue-31567.rs:22:26 | 22 | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough | ^^^^^ borrowed value does not live long enough 23 | &s_inner.0 24 | } | - borrowed value only lives until here | note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:1... --> ../src/test/ui/nll/issue-31567.rs:21:1 | 21 | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs -Z nll-subminimal-causes error[E0597]: `*v.0` does not live long enough --> ../src/test/ui/nll/issue-31567.rs:22:26 | 22 | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough | ^^^^^ borrowed value does not live long enough 23 | &s_inner.0 24 | } | - | | | borrowed value only lives until here | borrow later used here, when `v` is dropped error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. % ```
2018-04-18Update the previously checkpointed (but unused by bors) tests to reflect ↵Felix S. Klock II-14/+60
current reality.
2018-04-13Rename must-compile-successfully into compile-passGuillaume Gomez-2/+2
2018-04-11Checkpoint the current status of NLL on `ui` tests via compare-mode=nll.Felix S. Klock II-0/+923
2018-04-11Workaround rust-lang/rust#49855 by forcing rustc_error in any mode, ↵Felix S. Klock II-16/+16
including NLL. NOTE: I was careful to make each change in a manner that preserves the existing diagnostic output (usually by ensuring that no lines were added or removed). This means that the resulting source files are not as nice to read as they were at the start. But we will have to review these cases by hand anyway as follow-up work, so cleanup could reasonably happen then (or not at all).
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-5/+8
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-5/+8
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-16Update testsJohn Kåre Alsaker-1/+4
2018-03-16Rollup merge of #49042 - kennytm:fix-e0307-typo, r=rkruppekennytm-1/+1
Remove unnecessary "`" in error message E0307 (invalid self type).
2018-03-15Remove unnecessary "`" in error message E0307 (invalid self type).kennytm-1/+1
2018-03-14Add empty main() to tests where it is missing.Eric Huss-2/+2
2018-03-14Add crate name to "main function not found" error message.Eric Huss-1/+1
Fixes #44798 and rust-lang/cargo#4948.
2018-03-14update testsGuillaume Gomez-87/+85
2018-03-09tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directoriesVadim Petrochenkov-14/+0
2018-02-26Fix rebaseVadim Petrochenkov-3/+3
2018-02-26Update UI testsVadim Petrochenkov-36/+36
2018-02-26Update UI testsVadim Petrochenkov-511/+511
2018-02-25Reduce error codes length when too much are thrownGuillaume Gomez-1/+1
2018-02-25Update ui testsGuillaume Gomez-0/+88
2018-02-24Rollup merge of #48392 - estebank:string, r=petrochenkovManish Goregaokar-1/+18
Handle custom diagnostic for `&str + String` Now all of `&str + &str`, `&str + String` and `String + String` have relevant diagnostic output.
2018-02-20Handle custom diagnostic for `&str + String`Esteban Küber-1/+18
2018-02-17fix stderrcsmoe-2/+4
2018-02-14inform type annotationscsmoe-5/+5
2018-02-07Rollup merge of #48028 - zackmdavis:and_the_span_of_the_unknown_type, r=estebankManish Goregaokar-0/+42
correct E0619 span re method call receivers whose type must be known Previously, when the type of a method receiver could not be determined, the error message would, potentially confusingly, highlight the span of the entire method call. ![unknown_receiver_type](https://user-images.githubusercontent.com/1076988/35838930-a595b17c-0aa2-11e8-9364-6b8e2329f051.png) Resolves #36598, resolves #42234.
2018-02-07Rollup merge of #47922 - ↵Manish Goregaokar-2/+1
zackmdavis:and_the_case_of_the_unused_field_pattern, r=estebank correct unused field pattern suggestions ![unused_field_pattern_local](https://user-images.githubusercontent.com/1076988/35662336-7a69488a-06cc-11e8-9901-8d22b5cf924f.png) r? @estebank
2018-02-07Rollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakisManish Goregaokar-3/+3
Add filtering options to `rustc_on_unimplemented` - Add filtering options to `rustc_on_unimplemented` for local traits, filtering on `Self` and type arguments. - Add a way to provide custom notes. - Tweak binops text. - Add filter to detect wether `Self` is local or belongs to another crate. - Add filter to `Iterator` diagnostic for `&str`. Partly addresses #44755 with a different syntax, as a first approach. Fixes #46216, fixes #37522, CC #34297, #46806.
2018-02-05correct E0619 span re method call receivers whose type must be knownZack M. Davis-0/+42
Previously, when the type of a method receiver could not be determined, the error message would, potentially confusingly, highlight the span of the entire method call. Resolves #36598, resolves #42234.
2018-02-01Add filter to detect local crates for rustc_on_unimplementedEsteban Küber-2/+2
2018-02-01Change rustc_on_unimplemented for Iterator and binopsEsteban Küber-1/+5
2018-02-01Add filtering options to `rustc_on_unimplemented`Esteban Küber-6/+2
- filter error on the evaluated value of `Self` - filter error on the evaluated value of the type arguments - add argument to include custom note in diagnostic - allow the parser to parse `Self` when processing attributes - add custom message to binops
2018-02-01Minimize weird spans involving macro contextEsteban Küber-2/+2
Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without mergin them.
2018-01-31concerning well-formed suggestions for unused shorthand field patternsZack M. Davis-2/+1
Previously, unused variables would get a note that the warning could be silenced by prefixing the variable with an underscore, but that doesn't work for field shorthand patterns, which the liveness analysis didn't know about. The "to avoid this warning" verbiage seemed unnecessary. Resolves #47390.
2018-01-23Stabilized `#[repr(align(x))]` attribute (RFC 1358)Cameron Hart-10/+2
2018-01-17Rollup merge of #47471 - estebank:point-to-method-e0283, r=pnkfelixGuillaume Gomez-1/+5
On E0283, point at method with the requirements On required type annotation diagnostic error, point at method with the requirements if the span is available. CC #45453.
2018-01-15On E0283, point at method with the requirementsEsteban Küber-1/+5
On required type annotation diagnostic error, point at method with the requirements if the span is available.
2018-01-15Add error code for unstable feature errorsGuillaume Gomez-4/+4
2018-01-14syntax: Rewrite parsing of implsVadim Petrochenkov-0/+53
Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits Change wording in more diagnostics to use "auto traits" Some minor code cleanups in the parser
2018-01-06type error method suggestions use whitelisted identity-like conversionsZack M. Davis-6/+4
Previously, on a type mismatch (and if this wasn't preëmpted by a higher-priority suggestion), we would look for argumentless methods returning the expected type, and list them in a `help` note. This had two major shortcomings. Firstly, a lot of the suggestions didn't really make sense (if you used a &str where a String was expected, `.to_ascii_uppercase()` is probably not the solution you were hoping for). Secondly, we weren't generating suggestions from the most useful traits! We address the first problem with an internal `#[rustc_conversion_suggestion]` attribute meant to mark methods that keep the "same value" in the relevant sense, just converting the type. We address the second problem by making `FnCtxt.probe_for_return_type` pass the `ProbeScope::AllTraits` to `probe_op`: this would seem to be safe because grep reveals no other callers of `probe_for_return_type`. Also, structured suggestions are preferred (because they're pretty, but also for RLS and friends). Also also, we make the E0055 autoderef recursion limit error use the one-time-diagnostics set, because we can potentially hit the limit a lot during probing. (Without this, test/ui/did_you_mean/recursion_limit_deref.rs would report "aborting due to 51 errors"). Unfortunately, the trait probing is still not all one would hope for: at a minimum, we don't know how to rule out `into()` in cases where it wouldn't actually work, and we don't know how to rule in `.to_owned()` where it would. Issues #46459 and #46460 have been filed and are ref'd in a FIXME. This is hoped to resolve #42929, #44672, and #45777.
2018-01-03Auto merge of #47127 - EdSchouten:cloudabi-tests, r=kennytmbors-2/+4
First cut at getting some part of the test suite working for CloudABI I am currently working on creating a Docker container for automated CI for CloudABI. Here are some of the trivial changes that need to land to make tests pass.
2018-01-03Only bump error count when we are sure that the diagnostic is not a repetition.Rafael Fernández López-1/+1
This ensures that if we emit the same diagnostic twice, the error count will match the real number of errors shown to the user. Fixes #42106
2018-01-02Correct for changes in line numbers in expected stderr output.Ed Schouten-2/+2
Due to the disable-cloudabi tags being added to the source files, the expected output of the compiler is altered slightly.
2018-01-02Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.Ed Schouten-0/+2
It looks like many of these tests are already disabled on emscripten, which also doesn't seem to support environment variables and subprocess spawning. Just add a similar tag for CloudABI. While there, sort some of the lists of operating systems alphabetically.
2017-12-31Reword trying to operate in immutable fieldsEsteban Küber-2/+2
The previous message ("cannot assign/mutably borrow immutable field") when trying to modify a field of an immutable binding gave the (incorrect) impression that fields can be mutable independently of their ADT's binding. Slightly reword the message to read "cannot assign/mutably borrow field of immutable binding".
2017-12-21Rollup merge of #46860 - estebank:candidate-def-sp, r=petrochenkovGuillaume Gomez-14/+10
Use def span for associated function suggestions
2017-12-19Use def span for associated function suggestionsEsteban Küber-14/+10
2017-12-19Point at def span in "missing in impl" errorEsteban Küber-52/+21
2017-12-18Tweak "unecessary unsafe block" error spansEsteban Küber-65/+22
2017-12-15Same change to point at borrow for mir errorsEsteban Küber-38/+39
2017-12-14Point at var in short lived borrowsEsteban Küber-359/+404