about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-03-08Reduce noise in error reportingOliver Schneider-1/+0
2018-03-08Nuke ConstInt and Const*sizeOliver Schneider-0/+1
2018-03-08Add InterpretInterner to StableHashingContext for AllocId serializationOliver Schneider-2/+5
2018-03-08Codegen testsOliver Schneider-0/+1
2018-03-08Fully use miri in transOliver Schneider-292/+395
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-18/+17
2018-03-07check stability of macro invocationsAustin Bonander-0/+38
2018-03-06make bounds on higher-kinded lifetimes a hard error in ast_validationRalf Jung-5/+20
Also move the check for not having type parameters into ast_validation. I was not sure what to do with compile-fail/issue-23046.rs: The issue looks like maybe the bounds actually played a role in triggering the ICE, but that seems unlikely given that the compiler seems to entirely ignore them. However, I couldn't find a testcase without the bounds, so I figured the best I could do is to just remove the bounds and make sure at least that keeps working.
2018-03-02Update compile fail test error messagesJonathan Behrens-4/+4
2018-02-28Rollup merge of #48461 - Manishearth:epoch-dyn-trait, r=nmatsakisManish Goregaokar-0/+1
Fixes #47311. r? @nrc
2018-02-28Auto merge of #48056 - ExpHP:macro-commas, r=dtolnaybors-0/+121
Comprehensively support trailing commas in std/core macros I carefully organized the changes into four commits: * Test cases * Fixes for `macro_rules!` macros * Fixes for builtin macros * Docs for builtins **I can easily scale this back to just the first two commits for now if such is desired.** ### Breaking (?) changes * This fixes #48042, which is a breaking change that I hope people can agree is just a bugfix for an extremely dark corner case. * To fix five of the builtins, this changes `syntax::ext::base::get_single_str_from_tts` to accept a trailing comma, and revises the documentation so that this aspect is not surprising. **I made this change under the (hopefully correct) understanding that `libsyntax` is private rustc implementation detail.** After reviewing all call sites (which were, you guessed it, *precisely those five macros*), I believe the revised semantics are closer to the intended spirit of the function. ### Changes which may require concensus Up until now, it could be argued that some or all the following macros did not conceptually take a comma-separated list, because they only took one argument: * **`cfg(unix,)`** (most notable since cfg! is unique in taking a meta tag) * **`include{,_bytes,_str}("file.rs",)`** (in item form this might be written as "`include!{"file.rs",}`" which is even slightly more odd) * **`compile_error("message",);`** * **`option_env!("PATH",)`** * **`try!(Ok(()),)`** So I think these particular changes may require some sort of consensus. **All of the fixes for builtins are included this list, so if we want to defer these decisions to later then I can scale this PR back to just the first two commits.** ### Other notes/general requests for comment * Do we have a big checklist somewhere of "things to do when adding macros?" My hope is for `run-pass/macro-comma-support.rs` to remain comprehensive. * Originally I wanted the tests to also comprehensively forbid double trailing commas. However, this didn't work out too well: [see this gist and the giant FIXME in it](https://gist.github.com/ExpHP/6fc40e82f3d73267c4e590a9a94966f1#file-compile-fail_macro-comma-support-rs-L33-L50) * I did not touch `select!`. It appears to me to be a complete mess, and its trailing comma mishaps are only the tip of the iceberg. * There are [some compile-fail test cases](https://github.com/ExpHP/rust/blob/5fa97c35da2f0ee/src/test/compile-fail/macro-comma-behavior.rs#L49-L52) that didn't seem to work (rustc emits errors, but compile-fail doesn't acknowledge them), so they are disabled. Any clues? (Possibly related: These happen to be precisely the set of errors which are tagged by rustc as "this error originates in a macro outside of the current crate".) --- Fixes #48042 Closes #46241
2018-02-27update compile-fail tests; remove now redundant issue-39122.rsRalf Jung-19/+7
It is subsumed by ui/param-bounds-ignored.rs.
2018-02-25Rollup merge of #48302 - mark-i-m:markim_macro-test, r=aturonkennytm-53/+0
Move macro-at-most-once-rep-ambig test to ui test I had written this test for the feature. Now moving to ui test.
2018-02-24Rollup merge of #48481 - Manishearth:dyn-paren, r=petrochenkovManish Goregaokar-5/+0
Allow parentheses in `dyn (Trait)` r? @eddyb @nikomatsakis
2018-02-24Rollup merge of #48197 - bobtwinkles:two_phase_borrow_on_ops, r=nikomatsakisManish Goregaokar-53/+0
Allow two-phase borrows of &mut self in ops We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129. CC @pnkfelix and @nikomatsakis r? @pnkfelix
2018-02-24Rollup merge of #48061 - nikomatsakis:nll-do-not-run-mir-typeck-twice, r=eddybManish Goregaokar-8/+4
Fixes #47311. r? @nrc
2018-02-24Rollup merge of #48317 - ExpHP:unused-unsafe-is-no-fn, r=estebankManish Goregaokar-0/+39
unused_unsafe: don't label irrelevant fns Fixes #48131 Diagnostic bugfix to remove an errant note. Stops the search for an enclosing unsafe scope at the first safe fn encountered. ```rust pub unsafe fn outer() { fn inner() { unsafe { /* unnecessary */ } } inner() } ``` **Before:** ``` warning: unnecessary `unsafe` block --> src/main.rs:3:9 | 1 | pub unsafe fn outer() { | --------------------- because it's nested under this `unsafe` fn 2 | fn inner() { 3 | unsafe { /* unnecessary */ } | ^^^^^^ unnecessary `unsafe` block | = note: #[warn(unused_unsafe)] on by default ``` **After:** ``` warning: unnecessary `unsafe` block --> src/main.rs:3:9 | 3 | unsafe { /* unnecessary */ } | ^^^^^^ unnecessary `unsafe` block | = note: #[warn(unused_unsafe)] on by default ```
2018-02-24Rollup merge of #48143 - nikomatsakis:termination_trait_in_tests, r=eddybManish Goregaokar-5/+2
Termination trait in tests Support the `Termination` trait in unit tests (cc https://github.com/rust-lang/rust/issues/43301) Also, a drive-by fix for #47075. This is joint work with @bkchr.
2018-02-24Rollup merge of #48084 - cramertj:impl-trait-errors, r=nikomatsakisManish Goregaokar-40/+3
Error on nested impl Trait and path projections from impl Trait cc #34511 r? @nikomatsakis
2018-02-24Rollup merge of #47987 - Zoxc:rm-recursion-checking, r=eddybManish Goregaokar-49/+20
Remove "static item recursion checking" in favor of relying on cycle checks in the query engine Tests are changed to use the cycle check error message instead. Some duplicate tests are removed. r? @eddyb
2018-02-23Add testManish Goregaokar-5/+0
2018-02-23Silence warning in testManish Goregaokar-0/+1
2018-02-23Rollup merge of #48221 - rkruppe:improve-ctypes-lint, r=estebankManish Goregaokar-110/+22
Overhaul improper_ctypes output This snowballed into a rather big set of improvements to the diagnostics of the improper_ctypes lint. See commits for details, including effects of each change on the `compile-fail/improper-ctypes.rs` test (now a UI test), which is pretty gnarly and hopefully not representative of real code, but covers a lot of different error cases. Fixes #42050
2018-02-23update tests and reference filesNiko Matsakis-8/+4
The type checker invokes the borrow checker for closures it finds, so removing the NLL type checker affects ordering of errors somewhat.
2018-02-23update test -- we now give a slightly different errorNiko Matsakis-3/+0
2018-02-22move Termination trait to std::processNiko Matsakis-2/+2
2018-02-22put the "unit test" logic into libtestNiko Matsakis-2/+2
Also make `std::termination` module public and rename feature. The lib feature needs a different name from the language feature.
2018-02-21Rollup merge of #48198 - csmoe:inform_type_annotations, r=estebankGuillaume Gomez-6/+6
inform user where to give a type annotation should resolve #47777 previous pull request https://github.com/rust-lang/rust/pull/47982 was closed because of a mistaken rebase. r? @estebank
2018-02-18Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkorGuillaume Gomez-15/+15
fix more typos found by codespell.
2018-02-17unused_unsafe: don't label irrelevant fnsMichael Lamparski-0/+39
2018-02-18Auto merge of #47544 - U007D:master, r=nikomatsakisbors-0/+0
Relax termination_trait's error bound As per [this conversation](https://github.com/withoutboats/failure/issues/130#issuecomment-358572413) with @withoutboats and @bkchr
2018-02-17Move macro-at-most-once-rep-ambig test to ui testMark Mansi-53/+0
2018-02-17fix more typos found by codespell.Matthias Krüger-15/+15
2018-02-17Merge branch 'master' into inform_type_annotationsmoe-91/+117
2018-02-17Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakisbors-0/+30
add transform for uniform array move out reworked second step for fix #34708 previous try #46686 r? @nikomatsakis
2018-02-16Auto merge of #45404 - giannicic:defaultimpl2, r=nikomatsakisbors-91/+87
#37653 support `default impl` for specialization this commit implements the second part of the `default impl` feature: > - a `default impl` need not include all items from the trait > - a `default impl` alone does not mean that a type implements the trait The first point allows rustc to compile and run something like this: ``` trait Foo { fn foo_one(&self) -> &'static str; fn foo_two(&self) -> &'static str; } default impl<T> Foo for T { fn foo_one(&self) -> &'static str { "generic" } } struct MyStruct; fn main() { assert!(MyStruct.foo_one() == "generic"); } ``` but it shows a proper error if trying to call `MyStruct.foo_two()` The second point allows a `default impl` to be considered as not implementing the `Trait` if it doesn't implement all the trait items. The tests provided (in the compile-fail section) should cover all the possible trait resolutions. Let me know if some tests is missed. See [referenced ](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @nikomatsakis
2018-02-15[improper_ctypes] Overhaul primary labelRobin Kruppe-10/+10
- Always name the non-FFI-safe - Explain *why* the type is not FFI-safe - Stop vaguely gesturing at structs/enums/unions if the non-FFI-safe types occured in a field. The last part is arguably a regression, but it's minor now that the non-FFI-safe type is actually named. Removing it avoids some code duplication.
2018-02-15[improper_ctypes] Stop complaining about repr(usize) and repr(isize) enumsRobin Kruppe-0/+12
This dates back to at least #26583. At the time, usize and isize were considered ffi-unsafe to nudge people away from them, but this changed in the aforementioned PR, making it inconsistent to complain about it in enum discriminants. In fact, repr(usize) is probably the best way to interface with `enum Foo : size_t { ... }`.
2018-02-15Convert compile-fail/lint-ctypes.rs to ui testRobin Kruppe-100/+0
2018-02-15add Self: Trait<..> inside the param_env of a default implGianni Ciccarelli-0/+8
2018-02-14inform type annotationscsmoe-6/+6
2018-02-13Make nested impl Trait a hard errorTaylor Cramer-40/+3
2018-02-13Allow two-phase borrows of &mut self in opsbobtwinkles-53/+0
We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129
2018-02-12changed termination_trait's bound from Error to Debug; added compiletest ↵Brad Gibson-0/+0
header command and appropriate tests
2018-02-12Auto merge of #47843 - estebank:teach, r=nikomatsakisbors-4510/+0
Add `-Zteach` documentation Add extra inline documentation to E0019, E0016, E0013, E0396, E0017, E0018, E0010, E0022, E0030, E0029, E0033, E0026 and E0027. Follow up to #47652.
2018-02-11Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakisbors-1/+54
Implement `?` macro repetition See rust-lang/rfcs#2298 (with disposition merge)
2018-02-11Auto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakisbors-16/+47
rustc_mir: insert a dummy access to places being matched on, when building MIR. Fixes #47412 by adding a `_dummy = Discriminant(place)` before each `match place {...}`. r? @nikomatsakis
2018-02-10Rollup merge of #48078 - alexcrichton:fix-required-const-and-proc-macro, r=eddybkennytm-0/+20
Disallow function pointers to #[rustc_args_required_const] This commit disallows acquiring a function pointer to functions tagged as `#[rustc_args_required_const]`. This is intended to be used as future-proofing for the stdsimd crate to avoid taking a function pointer to any intrinsic which has a hard requirement that one of the arguments is a constant value. Note that the first commit here isn't related specifically to this feature, but was necessary to get this working in stdsimd!
2018-02-10Change error message for E0391 to "cyclic dependency detected"John Kåre Alsaker-18/+18
2018-02-10Remove "static item recursion checking" in favor of relying on cycle checks ↵John Kåre Alsaker-31/+2
in the query engine