about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-04-04Rollup merge of #59639 - cuviper:ignore-uninhabited, r=eddybMazdak Farrokhzad-0/+32
Never return uninhabited values at all Functions with uninhabited return values are already marked `noreturn`, but we were still generating return instructions for this. When running with `-C passes=lint`, LLVM prints: Unusual: Return statement in function with noreturn attribute The LLVM manual makes a stronger statement about `noreturn` though: > This produces undefined behavior at runtime if the function ever does dynamically return. We now emit an `abort` anywhere that would have tried to return an uninhabited value. Fixes #48227 cc #7463 #48229 r? @eddyb
2019-04-04Auto merge of #59517 - Zoxc:new-queries, r=oli-obkbors-293/+293
Move query definitions over to the proc macro r? @oli-obk
2019-04-04Rollup merge of #59669 - Centril:lint-pass-macro, r=oli-obkMazdak Farrokhzad-58/+15
Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros r? @oli-obk cc @Zoxc
2019-04-03Never return uninhabited values at allJosh Stone-0/+32
Functions with uninhabited return values are already marked `noreturn`, but we were still generating return instructions for this. When running with `-C passes=lint`, LLVM prints: Unusual: Return statement in function with noreturn attribute The LLVM manual makes a stronger statement about `noreturn` though: > This produces undefined behavior at runtime if the function ever does dynamically return. We now emit an `abort` anywhere that would have tried to return an uninhabited value.
2019-04-03reduce repetition in librustc(_lint) wrt. impl LintPassMazdak Farrokhzad-58/+15
2019-04-03Update testsflip1995-57/+38
2019-04-03Fix rebase falloutflip1995-59/+39
2019-04-03Add tests for internal lintsflip1995-0/+345
2019-04-02Rollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obkMazdak Farrokhzad-0/+23
Fix stack overflow when generating debuginfo for 'recursive' type By using 'impl trait', it's possible to create a self-referential type as follows: fn foo() -> impl Copy { foo } This is a function which returns itself. Normally, the signature of this function would be impossible to write - it would look like 'fn foo() -> fn() -> fn() ...' e.g. a function which returns a function, which returns a function... Using 'impl trait' allows us to avoid writing this infinitely long type. While it's useless for practical purposes, it does compile and run However, issues arise when we try to generate llvm debuginfo for such a type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we generate debuginfo, which can lead to us recursing back to the original 'fn' type when we try to process its return type. To resolve this, I've modified debuginfo generation to account for these kinds of weird types. Unfortunately, there's no 'correct' debuginfo that we can generate - 'impl trait' does not exist in debuginfo, and this kind of recursive type is impossible to directly represent. To ensure that we emit *something*, this commit emits dummy debuginfo/type names whenever it encounters a self-reference. In practice, this should never happen - it's just to ensure that we can emit some kind of debuginfo, even if it's not particularly meaningful Fixes #58463
2019-04-02Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexregMazdak Farrokhzad-0/+109
resolve: collect trait aliases along with traits It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...) Fixes https://github.com/rust-lang/rust/issues/56485 r? @alexreg
2019-04-02Rollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelixMazdak Farrokhzad-2/+2
Fixes for shallow borrows * Don't promote these borrows if we're going to remove them before codegen * Correctly mark unreachable code
2019-04-01Refactor async fn return type loweringTaylor Cramer-30/+97
async fn now lowers directly to an existential type declaration rather than reusing the `impl Trait` return type lowering. As part of this, it lowers all argument-position elided lifetimes using the in-band-lifetimes machinery, creating fresh parameter names for each of them, using each lifetime parameter as a generic argument to the generated existential type. This doesn't currently successfully allow multiple argument-position elided lifetimes since `existential type` doesn't yet support multiple lifetimes where neither outlive the other. This requires a separate fix.
2019-04-01resolve all in scope trait aliases, then elaborate their boundsSean McArthur-1/+87
2019-04-01Rollup merge of #59041 - saleemjaffer:trait_doc_comment_better_error_msg, ↵Mazdak Farrokhzad-0/+17
r=pnkfelix fixes rust-lang#56766 fixes #56766
2019-04-01Rollup merge of #58919 - estebank:impl-trait-return-lifetime, r=pnkfelixMazdak Farrokhzad-11/+21
Suggest using anonymous lifetime in `impl Trait` return Fix #48467. r? @nikomatsakis
2019-03-31Add codegen testAaron Hill-0/+15
2019-03-31Fix stack overflow when generating debuginfo for 'recursive' typeAaron Hill-0/+8
By using 'impl trait', it's possible to create a self-referential type as follows: fn foo() -> impl Copy { foo } This is a function which returns itself. Normally, the signature of this function would be impossible to write - it would look like 'fn foo() -> fn() -> fn() ...' e.g. a function which returns a function, which returns a function... Using 'impl trait' allows us to avoid writing this infinitely long type. While it's useless for practical purposes, it does compile and run However, issues arise when we try to generate llvm debuginfo for such a type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we generate debuginfo, which can lead to us recursing back to the original 'fn' type when we try to process its return type. To resolve this, I've modified debuginfo generation to account for these kinds of weird types. Unfortunately, there's no 'correct' debuginfo that we can generate - 'impl trait' does not exist in debuginfo, and this kind of recursive type is impossible to directly represent. To ensure that we emit *something*, this commit emits dummy debuginfo/type names whenever it encounters a self-reference. In practice, this should never happen - it's just to ensure that we can emit some kind of debuginfo, even if it's not particularly meaningful Fixes #58463
2019-03-31Auto merge of #59577 - dlrobertson:fix_58881, r=nagisabors-0/+21
Fix LLVM IR generated for C-variadic arguments It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments. Fixes: #58881
2019-03-31Fix LLVM IR generated for C-variadic argumentsDan Robertson-0/+21
It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments.
2019-03-31Rollup merge of #59583 - oberien:patch-1, r=CentrilMazdak Farrokhzad-0/+16
match match match match match
2019-03-31Rollup merge of #59580 - taiki-e:coerce-closure, r=oli-obkMazdak Farrokhzad-0/+12
Allow closure to unsafe fn coercion Closes #57883
2019-03-31Rollup merge of #59506 - JohnTitor:improve-mcount, r=nagisaMazdak Farrokhzad-0/+7
Use platform dependent mcount function close #59097 This pull-request is based on #57244 and [here](https://github.com/llvm-mirror/clang/search?q=MCountName&unscoped_MCountName). r? @nagisa
2019-03-31Rollup merge of #58805 - fabric-and-ink:redundant_import, r=petrochenkovMazdak Farrokhzad-20/+92
Lint for redundant imports Add lint for redundant imports. The changes are suggested by @petrochenkov. Closes #10178.
2019-03-31Suggest using anonymous lifetime in `impl Trait` return without hacksEsteban Küber-14/+18
Fallback to `static_impl_trait` for nice error message by peeking at the return type and the lifetime type. Point at the return type instead of the return expr/stmt in NLL mode.
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-0/+12
2019-03-31Fixes for shallow borrowsMatthew Jasper-2/+2
* Don't promote these borrows if we're going to remove them before codegen * Correctly mark unreachable code
2019-03-31Rollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=CentrilMazdak Farrokhzad-2/+2
Distinguish message for external macros depending on error level fixes #57716 (I picked you because assigned to this issue.) r? @estebank
2019-03-31Rollup merge of #59572 - davidtwco:issue-59508, r=varkorMazdak Farrokhzad-13/+85
Include bounds in generic re-ordering diagnostic Fixes #59508. r? @estebank cc @varkor
2019-03-31match match match match matchJaro Fietz-0/+16
2019-03-31Only mention const generics if enabled.David Wood-14/+46
This commit updates the generic parameter re-ordering diagnostic to only mention const generics if the feature is enabled.
2019-03-31Include bounds in generic reordering diagnostic.David Wood-0/+40
This commit extends the existing generic re-ordering diagnostic to include any bounds on the generic parameter, thus producing correct suggestions.
2019-03-31Distinguish depending on error levelYuki OKUSHI-2/+2
Remove unnecessary comment
2019-03-31Fix testYuki OKUSHI-1/+1
2019-03-30Restore testFabian Drinck-0/+3
2019-03-30Handle glob import in redundancy checkFabian Drinck-9/+0
2019-03-30Change message to present tenseFabian Drinck-4/+4
2019-03-30Fix more testsFabian Drinck-10/+0
2019-03-30Add glob import to redundancy testFabian Drinck-6/+36
2019-03-30Fix testsFabian Drinck-5/+13
2019-03-30Replace REDUNDANT_IMPORT with UNUSED_IMPORTSFabian Drinck-63/+14
2019-03-30Edit ui testsFabian Drinck-0/+2
2019-03-30Distinguish between imported and defined itemsFabian Drinck-1/+1
2019-03-30Bless testsFabian Drinck-0/+69
2019-03-30Improve warningFabian Drinck-7/+4
2019-03-30Add lint for redundant importsFabian Drinck-0/+31
Co-authored-by: Stephan Schauerte <stephan.schauerte@gmail.com>
2019-03-30Update testsJohn Kåre Alsaker-293/+293
2019-03-30Rollup merge of #59463 - ↵Mazdak Farrokhzad-0/+454
pnkfelix:issue-56327-skip-dyn-keyword-lint-under-macros, r=matthewjasper skip dyn keyword lint under macros This PR is following my own intuition that `rustfix` should never inject bugs into working code (even if that comes at the expense of it failing to fix things that will become bugs). Fix #56327
2019-03-30Rollup merge of #59380 - philipc:thinlto-variant, r=michaelwoeristerMazdak Farrokhzad-0/+48
Fix invalid DWARF for enums when using ThinLTO We were setting the same identifier for both the DW_TAG_structure_type and the DW_TAG_variant_part. This becomes a problem when using ThinLTO becauses it uses the identifier as a key for a map of types that is used to delete duplicates based on the ODR, so one of them is deleted as a duplicate, resulting in invalid DWARF. The DW_TAG_variant_part isn't a standalone type, so it doesn't need an identifier. Fix by omitting its identifier. ODR uniquing is [enabled here](https://github.com/rust-lang/rust/blob/f21dee2c6179276321a88a63300dce74ff707e92/src/rustllvm/PassWrapper.cpp#L1101).
2019-03-30Rollup merge of #59525 - pnkfelix:whitelist-some-rustc-attrs, r=petrochenkovMazdak Farrokhzad-0/+46
Whitelist some rustc attrs These rustc attrs are used within libcore, and were causing failures when one mixed incremental compilation with bootstrapping (due to a default of `-D warnings` when bootstrapping). Fix #59523 Fix #59524 Cc #58633
2019-03-30Rollup merge of #59455 - estebank:borrow-sugg-shorthand-field, r=davidtwcoMazdak Farrokhzad-4/+70
Account for short-hand field syntax when suggesting borrow Fix #52965.