about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-09-02Rollup merge of #36223 - abhiQmar:e0558-formatting, r=jonathandturnerJonathan Turner-1/+4
Update compiler error E0558 to use new error format Fixes #36196 part of #35233 r? @jonathandturner
2016-09-02Rollup merge of #36210 - EugeneGonzalez:E0529, r=jonathandturnerJonathan Turner-1/+3
Fixed E0529's label and unit test Fixes #36195 part of #35233. This is ready for review, but will likely fail Travis due to #36138. I changed the wording of the label, so feedback on that would be appreciated. r? @jonathandturner
2016-09-02Rollup merge of #36205 - EugeneGonzalez:E0528, r=jonathandturnerJonathan Turner-1/+3
Fixed E0528 label and unit test Fixes #36194 part of #35233. r? @jonathandturner
2016-09-02Rollup merge of #36171 - jonathandturner:temporary_value, r=nikomatsakisJonathan Turner-36/+14
Update lifetime errors to specifically note temporaries This PR updates the error message we give in the case of a temporary value not living long enough. Before: <img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png"> Now: <img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png"> Specifically, it makes the following changes: * Detects if a temporary is being used. If so, it changes the labels to mention that a temporary value specifically is in question * Simplifies wording of the existing labels to focus on lifetimes rather than values being valid * Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note. r? @nikomatsakis
2016-09-03Update compiler error E0558 to use new error formatAbhishek Kumar-1/+4
Fixes #36196 part of #35233
2016-09-02Update E0496 to new formatAndrea Corradi-46/+66
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-4/+3
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2016-09-02Forget to update tests to use new error messageJared Roesch-2/+2
2016-09-02Address feedback, and remove invalid testsJared Roesch-164/+53
2016-09-02Reject certain auto trait declarationsJared Roesch-16/+5
Fixes #29859
2016-09-02Add tests for #29859Jared Roesch-0/+50
2016-09-02Moved test on E0493 from compile-fail to ui.Federico Ravasio-33/+0
2016-09-02E0493: showing a label where the destructor is defined.Federico Ravasio-0/+9
2016-09-01Auto merge of #35915 - llogiq:rfc-1623, r=nikomatsakisbors-15/+199
implementing RFC 1623. This fixes #35897. This is a work in progress. In particular, I want to add more tests, especially the compile-fail test is very bare-bones.
2016-09-01Fixed E0529's label and unit testEugene R Gonzalez-1/+3
2016-09-01Fixed E0528 label and unit testEugene R Gonzalez-1/+3
2016-09-01Avoid cascading name resolution errors caused by an ambiguous module.Jeffrey Seyfried-0/+5
2016-09-01Avoid reporting multiple ambiguity errors for a single use of a name.Jeffrey Seyfried-0/+13
2016-09-01item_like_imports: Allow unused ambiguous glob imports.Jeffrey Seyfried-0/+14
2016-09-01item_like_imports: Allow multiple glob imports of the same item.Jeffrey Seyfried-0/+38
2016-09-01item_like_imports: Make all visible items glob importable.Jeffrey Seyfried-0/+7
2016-09-01item_like_imports: Allow single imports with a given visibilityJeffrey Seyfried-0/+37
to reexport some (but not all) namespaces with less visibility.
2016-09-01Improve diagnostics and remove dead code.Jeffrey Seyfried-2/+6
2016-09-01Fix test `compile-fail/task-rng-isnt-sendable.rs`.Jeffrey Seyfried-2/+2
2016-09-01Auto merge of #34494 - CensoredUsername:allow_sysV64_abi, r=nagisabors-0/+19
Allow specification of the system V AMD64 ABI constraint. This can be specified using `extern "sysV64" fn` on all platforms. This ABI is used as the C ABI on unix platforms, but can only be specified there using extern "C". It was impossible to specify on other platforms. Meanwhile the win64 ABI, which was the extern "C" ABI on the windows platform could be specified on other platforms using extern "win64". This pull request adds the the "sysV64" ABI constraint which exposes this calling convention on platforms where it is not the C ABI.
2016-09-01Auto merge of #34982 - arielb1:bad-tuples-and-objects, r=nikomatsakisbors-34/+5
Turn the RFC1592 warnings into hard errors The warnings have already reached stable, and I want to improve the trait error reporting code. Turning warnings into errors, this is obviously a [breaking-change]. r? @nikomatsakis cc @rust-lang/compiler
2016-09-01turn the RFC1592 warnings into hard errorsAriel Ben-Yehuda-34/+5
The warnings have already reached stable The test rfc1592_deprecated is covered by `bad_sized` and `unsized6`. Fixes #33242 Fixes #33243
2016-08-31Update error message for lifetime of borrowed valuesJonathan Turner-36/+14
2016-08-31Rollup merge of #36114 - zjhmale:fix-E0393, r=jonathandturnerJonathan Turner-7/+19
Update E0393 to new error format Fixes #35632. Part of #35233. r? @jonathandturner and a wired thing is that if i add another label ```rust .span_label(span, &format!("missing reference to `{}`", def.name)) .span_label(span, &format!("because of the default `Self` reference, type parameters must be specified on object types")) ``` and add a new note in the test case like ```rust trait A<T=Self> {} fn together_we_will_rule_the_galaxy(son: &A) {} //~^ ERROR E0393 //~| NOTE missing reference to `T` //~| NOTE because of the default `Self` reference, type parameters must be specified on object types ``` it will complain that ``` running 1 test test [compile-fail] compile-fail/E0393.rs ... FAILED failures: ---- [compile-fail] compile-fail/E0393.rs stdout ---- error: /Users/zjh/Documents/rustspace/rust/src/test/compile-fail/E0393.rs:13: unexpected "error": '13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]' unexpected errors (from JSON output): [ Error { line_num: 13, kind: Some( Error ), msg: "13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]" } ] ``` it is a little bit confusing and through the blog post we can use `//~^` and `//~|` to support multiple notes, @jonathandturner am i missing something here?
2016-08-31Rollup merge of #36087 - apasel422:issue-28324, r=alexcrichtonJonathan Turner-0/+18
Add test for #28324 Closes #28324
2016-08-31Rollup merge of #35773 - EugeneGonzalez:master, r=jonathandturnerJonathan Turner-1/+5
Change E0259 to the new error format Fixes #35514 as part of #35233. Sorry about creating a new PR I was having a lot of troubles squashing the commit because I didn't properly branch the new feature. r? @GuillaumeGomez
2016-08-31Updated E0493 to new format.Federico Ravasio-1/+3
2016-08-31Rollup merge of #36148 - birryree:E0194_bonus_format, r=jonathandturnerJonathan Turner-2/+2
Bonus format for E0194 Bonus fix for #35280. Part of #35233. Fixes #36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages. Errors for E0194 now look like this: ``` $> ./build/x86_64-apple-darwin/stage1/bin/rustc src/test/compile-fail/E0194.rs error[E0194]: type parameter `T` shadows another type parameter of the same name --> src/test/compile-fail/E0194.rs:13:26 | 11 | trait Foo<T> { //~ NOTE first `T` declared here | - first `T` declared here 12 | fn do_something(&self) -> T; 13 | fn do_something_else<T: Clone>(&self, bar: T); | ^ shadows another type parameter error: aborting due to previous error ``` r? @jonathandturner
2016-08-31Rollup merge of #36147 - mikhail-m1:master, r=jonathandturnerJonathan Turner-0/+8
update E0265 to new format Fixes #35309 as part of #35233. I've describe partially bonus achieve in #35309 r? @jonathandturner
2016-08-31Rollup merge of #36141 - GuillaumeGomez:err_codes, r=jonathandturnerJonathan Turner-0/+160
Err codes r? @jonathandturner
2016-08-31Rollup merge of #36136 - athulappadan:E0034, r=jonathandturnerJonathan Turner-3/+11
Update compiler error 0034 to use new format. Part of #35233 Addresses #35205 r? @jonathandturner
2016-08-31Rollup merge of #36135 - 0xmohit:pr/error-code-E0520, r=jonathandturnerJonathan Turner-1/+5
Update E0520 to new error format Fixes #36112. Part of #35233. r? @jonathandturner
2016-08-31Rollup merge of #36089 - apasel422:issue-24204, r=alexcrichtonJonathan Turner-0/+27
Add test for #24204 Closes #24204
2016-08-31Rollup merge of #36079 - acrrd:new_format_E0318, r=GuillaumeGomezJonathan Turner-3/+2
Update E0318 to new format Fixes #35322. Part of #35233. r? @GuillaumeGomez
2016-08-31Rollup merge of #36050 - abhiQmar:e0076-formatting, r=jonathandturnerJonathan Turner-1/+3
Update compiler error E0076 to use new error format Fixes #35221 part of #35233 r? @jonathandturner
2016-08-31Bonus fix for #35280. Part of #35233. Fixes #36057. Adding expanded ↵William Lee-2/+2
notes/context for what trait a parameter shadows as part of E0194 error messages.
2016-08-31Update E0393 to new error formatzjhmale-7/+19
2016-08-31Warn about multiple conflicting #[repr] hintsChris Wong-0/+30
Closes #34622
2016-08-30Change E0259 to the new error formatEugene R Gonzalez-1/+5
Fixed E0259 unit test Added name of conflict to E0259's note
2016-08-31Update compiler error E0076 to use new error formatAbhishek Kumar-1/+3
Fixes #35221 part of #35233
2016-08-30update E0265 to new formatMikhail Modin-0/+8
2016-08-30Update E0318 to new formatAndrea Corradi-3/+2
2016-08-30Add new error code testsggomez-0/+160
2016-08-30Update E0520 to new error formatMohit Agarwal-1/+5
Fixes #36112. Part of #35233. r? @jonathandturner
2016-08-30Remove useless //ignore-arch directives on a compile-fail test, and add ↵CensoredUsername-6/+0
another test that checks if the sysv64 abi corresponds to the same rules as the C abi on unix platforms