about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-05-31Extend the unused macro lint to macros 2.0est31-14/+50
2017-05-30associated_consts: check trait obligations and regionck for associated constsSean McArthur-0/+57
Closes #41323
2017-05-30Turn `invalid_type_param_default` into a lint againVadim Petrochenkov-0/+5
2017-05-30Turn public reexporting of private extern crates into a lint againVadim Petrochenkov-0/+4
2017-05-30Turn sufficiently old compatibility lints into hard errorsVadim Petrochenkov-52/+56
2017-05-30Auto merge of #42282 - Mark-Simulacrum:issue-40342, r=arielb1bors-2/+8
Don't warn on lifetime generic no_mangle functions. Fixes #40342.
2017-05-29Auto merge of #42264 - GuillaumeGomez:new-error-codes, r=Susurrusbors-0/+46
New error codes Part of #42229.
2017-05-29Auto merge of #41856 - qnighy:prohibit-parenthesized-params-in-more-types, ↵bors-1/+102
r=arielb1 Prohibit parenthesized params in more types. Prohibit parenthesized parameters in primitive types, type parameters, `Self`, etc. Fixes #32995.
2017-05-29Auto merge of #42262 - Mark-Simulacrum:issue-40350, r=eddybbors-0/+24
Don't ICE with nested enums in missing docs lint. Fixes #40350.
2017-05-28Don't warn on lifetime generic no_mangle functions.Mark Simulacrum-2/+8
2017-05-27Rollup merge of #42249 - Mark-Simulacrum:issue-40244, r=eddybMark Simulacrum-5/+9
Allow variadic functions with cdecl calling convention. Fixes #40244.
2017-05-27Rollup merge of #42217 - venkatagiri:issue_39974, r=Mark-SimulacrumMark Simulacrum-0/+21
regression test for #39974 closes #39974 r? @Mark-Simulacrum
2017-05-27Rollup merge of #42207 - Nashenas88:remove_fragment_info, r=eddybMark Simulacrum-529/+0
Remove all instances of fragment_infos and fragment sets Remove unused fragment structs. This was suggested by @eddyb in IRC: [botbot link](https://botbot.me/mozilla/rustc/2017-05-23/?msg=86016574&page=2).
2017-05-27Auto merge of #42162 - est31:closure-to-fn-coercion, r=aturonbors-47/+0
Stabilize non capturing closure to fn coercion Stabilisation PR for non capturing closure to fn coercion. closes #39817
2017-05-27Add invalid unary operator usage error codeGuillaume Gomez-0/+13
2017-05-27Fix ICE on inner enum in missing docs lint.Mark Simulacrum-0/+24
This also simplifies the lint by not storing variant depth or the struct def stack, because we no longer need them.
2017-05-27Add new error codesGuillaume Gomez-0/+33
2017-05-27Allow variadic functions with cdecl calling convention.Mark Simulacrum-5/+9
2017-05-27Stabilize unions with `Copy` fields and no destructorVadim Petrochenkov-29/+21
2017-05-26Rollup merge of #42230 - venkatagiri:ice_regression_tests, r=Mark-SimulacrumCorey Farwell-0/+129
regression tests for ICEs closes #36379 closes #37550 closes #37665 closes #38160 closes #38954 closes #39362 r? @Mark-Simulacrum
2017-05-26Rollup merge of #42216 - charliesome:associate-type-typo, r=petrochenkovCorey Farwell-3/+3
Fix 'associate type' typo I came across an error message mentioning an 'associate type'. Since this is the only instance of this term in rustc (it's 'associated type' everywhere else), I think this might be a typo.
2017-05-26Add warning cycle #42238.Masaki Hara-3/+35
2017-05-26Auto merge of #42083 - petrochenkov:safeassign, r=nikomatsakisbors-7/+38
Make assignments to `Copy` union fields safe This is an accompanying PR to PR https://github.com/rust-lang/rust/pull/42068 stabilizing FFI unions. This was first proposed in https://github.com/rust-lang/rust/issues/32836#issuecomment-281296416, see subsequent comments as well. Assignments to `Copy` union fields do not read any data from the union and are [equivalent](https://github.com/rust-lang/rust/issues/32836#issuecomment-281660298) to whole union assignments, which are safe, so they should be safe as well. This removes a significant number of "false positive" unsafe blocks, in code dealing with FFI unions in particular. It desirable to make this change now, together with stabilization of FFI unions, because now it affecfts only unstable code, but later it will cause warnings/errors caused by `unused_unsafe` lint in stable code. cc #32836 r? @nikomatsakis
2017-05-26Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakisbors-0/+8
add thiscall calling convention support This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-25regression test for #37550Venkata Giri Reddy-0/+18
2017-05-25regression test for #37665Venkata Giri Reddy-0/+20
regression test for #37550
2017-05-25Auto merge of #40847 - jseyfried:decl_macro, r=nrcbors-0/+193
Initial implementation of declarative macros 2.0 Implement declarative macros 2.0 (rust-lang/rfcs#1584) behind `#![feature(decl_macro)]`. Differences from `macro_rules!` include: - new syntax: `macro m(..) { .. }` instead of `macro_rules! m { (..) => { .. } }` - declarative macros are items: ```rust // crate A: pub mod foo { m!(); // use before definition; declaration order is irrelevant pub macro m() {} // `pub`, `pub(super)`, etc. work } fn main() { foo::m!(); // named like other items { use foo::m as n; n!(); } // imported like other items } pub use foo::m; // re-exported like other items // crate B: extern crate A; // no need for `#[macro_use]` A::foo::m!(); A::m!(); ``` - Racket-like hygiene for items, imports, methods, fields, type parameters, privacy, etc. - Intuitively, names in a macro definition are resolved in the macro definition's scope, not the scope in which the macro is used. - This [explaination](http://beautifulracket.com/explainer/hygiene.html) of hygiene for Racket applies here (except for the "Breaking Hygiene" section). I wrote a similar [explanation](https://github.com/jseyfried/rfcs/blob/hygiene/text/0000-hygiene.md) for Rust. - Generally speaking, if `fn f() { <body> }` resolves, `pub macro m() { <body> } ... m!()` also resolves, even if `m!()` is in a separate crate. - `::foo::bar` in a `macro` behaves like `$crate::foo::bar` in a `macro_rules!`, except it can access everything visible from the `macro` (thus more permissive). - See [`src/test/{run-pass, compile-fail}/hygiene`](https://github.com/rust-lang/rust/pull/40847/commits/afe7d89858fd72b983e24727d6f4058293153c19) for examples. Small example: ```rust mod foo { fn f() { println!("hello world"); } pub macro m() { f(); } } fn main() { foo::m!(); } ``` Limitations: - This does not address planned changes to matchers (`expr`,`ty`, etc.), c.f. #26361. - Lints (including stability and deprecation) and `unsafe` are not hygienic. - adding hygiene here will be mostly or entirely backwards compatible - Nested macro definitions (a `macro` inside another `macro`) don't always work correctly when invoked from external crates. - pending improvements in how we encode macro definitions in crate metadata - There is no way to "escape" hygiene without using a procedural macro. r? @nrc
2017-05-25regression test for #38160Venkata Giri Reddy-0/+31
2017-05-25regression test for #39362Venkata Giri Reddy-0/+28
2017-05-25regression test for #38954Venkata Giri Reddy-0/+16
2017-05-25regression test for #36379Venkata Giri Reddy-0/+16
2017-05-25regression test for #39974Venkata Giri Reddy-0/+21
closes #39974 r? @Mark-Simulacrum
2017-05-25Remove irrelevant tests and unused testing attributePaul Faria-529/+0
2017-05-25Stabilize non capturing closure to fn coercionest31-47/+0
2017-05-25Use parameter environment associated with field use, not field definitionVadim Petrochenkov-2/+1
2017-05-25Auto merge of #41145 - matthewjasper:stabilize-relaxed-adts, r=petrochenkovbors-22/+0
Stabilize rfc 1506 - Clarified ADT Kinds Closes #35626 Documentation: - [ ] Reference rust-lang-nursery/reference#37 - [ ] Book? - [ ] Rust by example?
2017-05-25Make assignments to `Copy` union fields safeVadim Petrochenkov-7/+39
2017-05-25Add tests.Jeffrey Seyfried-0/+193
2017-05-25Fix 'associate type' typoCharlie Somerville-3/+3
2017-05-24add thiscall calling convention supportNathan Froyd-0/+8
This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-23Remove some needless // gate-test- commentsest31-2/+0
Also, add detection to treat such comments as tidy errors. We also remove the found_lib_feature code because it was just repeating the found_feature code. Originally it was intended to allow for gate-test lines for lib features, but apparently nobody missed it.
2017-05-23Stabilize in 1.19Matthew-294/+947
2017-05-23Rollup merge of #42160 - venkatagiri:issue_38821, r=Mark-SimulacrumCorey Farwell-0/+43
regression test for #38821 Closes #38821 r? @Mark-Simulacrum
2017-05-23Rollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakisCorey Farwell-16/+0
Stabilize the loop_break_value feature Tracking issue: #37339. Documentation PRs already sent to the various repositories.
2017-05-23Auto merge of #41559 - GuillaumeGomez:partial-eq-msg, r=estebankbors-23/+30
Add better error message when == operator is badly used Part of #40660. With the following code: ```rust fn foo<T: PartialEq>(a: &T, b: T) { a == b; } fn main() { foo(&1, 1); } ``` It prints: ``` error[E0277]: the trait bound `&T: std::cmp::PartialEq<T>` is not satisfied --> test.rs:2:5 | 2 | a == b; | ^^^^^^ can't compare `&T` with `T` | = help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T` = help: consider adding a `where &T: std::cmp::PartialEq<T>` bound error: aborting due to previous error ```
2017-05-22regression test for #38821Venkata Giri Reddy-0/+43
Closes #38821 r? @Mark-Simulacrum
2017-05-20Rollup merge of #42062 - fhartwig:fix-off-by-one-span, r=nikomatsakisMark Simulacrum-2/+2
Fix off-by-one error in column number in `explain_span`. Fixes #41938
2017-05-19Rollup merge of #42006 - jseyfried:fix_include_regression, r=nrcMark Simulacrum-0/+13
Fix ICE on `include!(line!())` (regression) Fixes #41776. r? @nrc
2017-05-18Fix off-by-one error in column number in `explain_span`.Florian Hartwig-2/+2
2017-05-17Auto merge of #41911 - michaelwoerister:querify_trait_def, r=nikomatsakisbors-0/+34
Remove interior mutability from TraitDef by turning fields into queries This PR gets rid of anything `std::cell` in `TraitDef` by - moving the global list of trait impls from `TraitDef` into a query, - moving the list of trait impls relevent for some self-type from `TraitDef` into a query - moving the specialization graph of trait impls into a query, and - moving `TraitDef::object_safety` into a query. I really like how querifying things not only helps with incremental compilation and on-demand, but also just plain makes the code cleaner `:)` There are also some smaller fixes in the PR. Commits can be reviewed separately. r? @eddyb or @nikomatsakis