summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-05-22Fix hang in lexical_region_resolveMatthew Jasper-0/+7
(cherry picked from commit e7b02046a0b34ec6d114a7ba5549db8457684ec4)
2020-05-22Fix E0284 to not use incorrect wordingEsteban Küber-12/+100
Fix #71584, fix #69683. (cherry picked from commit a7b03ad4eddb65abede497dbc408244f23c36256)
2020-05-09fix error code for E0751YI-28/+28
2020-05-09normalize field projection ty to fix broken MIR issueSantiago Pastorino-0/+1
2020-05-09Add rustdoc regression test for the unused_braces lintflip1995-0/+14
2020-05-09Do not try to find binop method on RHS `TyErr`Esteban Küber-0/+27
Fix #71798.
2020-05-09resolve: Relax fresh binding disambiguation slightly to fix regressionVadim Petrochenkov-0/+1
2020-04-22adjust testsRalf Jung-133/+113
2020-04-21Auto merge of #71170 - spastorino:dyn-fnonce-alignment, r=nikomatsakisbors-12/+36
Make Box<dyn FnOnce> respect self alignment Closes #68304 r? @eddyb @nikomatsakis
2020-04-21Rollup merge of #71174 - Nokel81:fix-async-main-error, r=petrochenkovDylan DPC-0/+43
Check that main/start is not async * Add new error code E0752 * Add span to hir::IsAsync::Yes * Emit an error if main or the start function is marked as async * Add two regression tests This PR fixes #68523.
2020-04-20Rollup merge of #71284 - JOE1994:serialize_id, r=petrochenkovDylan DPC-2/+14
fix -Zast-json to output correct JSON form fixes #71086 (Reverts some of the changes made in #70215) JSON output (from an empty library) after fix has something for **"id"** field ```shell lonelyjoe@lonelyjoe-desktop:~/workspace/empty_lib/src$ rustc lib.rs -Zast-json ``` ```json { "module":{ "inner":{ "lo":0, "hi":94 }, "items":[ { "attrs":[ { "kind":{ "variant":"Normal", "fields":[ { "path":{ "span":{ "lo":0, "hi":0 }, "segments":[ { "ident":{ "name":"prelude_import", "span":{ "lo":0, "hi":0 } }, "id":3, "args":null } ] }, "args":"Empty" } ] }, "id":null, "style":"Outer", "span":{ "lo":0, "hi":0 } } ], "id":4, "span":{ "lo":0, "hi":0 }, "vis":{ "node":"Inherited", "span":{ "lo":0, "hi":0 } }, "ident":{ "name":"", "span":{ "lo":0, "hi":0 } }, "kind":{ "variant":"Use", "fields":[ { "prefix":{ "span":{ "lo":0, "hi":0 }, "segments":[ { "ident":{ "name":"{{root}}", "span":{ "lo":0, "hi":0 } }, "id":5, "args":null }, { "ident":{ "name":"std", "span":{ "lo":0, "hi":0 } }, "id":6, "args":null }, { "ident":{ "name":"prelude", "span":{ "lo":0, "hi":0 } }, "id":7, "args":null }, { "ident":{ "name":"v1", "span":{ "lo":0, "hi":0 } }, "id":8, "args":null } ] }, "kind":"Glob", "span":{ "lo":0, "hi":0 } } ] }, "tokens":null }, { "attrs":[ { "kind":{ "variant":"Normal", "fields":[ { "path":{ "span":{ "lo":0, "hi":0 }, "segments":[ { "ident":{ "name":"macro_use", "span":{ "lo":0, "hi":0 } }, "id":9, "args":null } ] }, "args":"Empty" } ] }, "id":null, "style":"Outer", "span":{ "lo":0, "hi":0 } } ], "id":10, "span":{ "lo":0, "hi":0 }, "vis":{ "node":"Inherited", "span":{ "lo":0, "hi":0 } }, "ident":{ "name":"std", "span":{ "lo":0, "hi":0 } }, "kind":{ "variant":"ExternCrate", "fields":[ null ] }, "tokens":null } ], "inline":true }, "attrs":[ ], "span":{ "lo":0, "hi":94 }, "proc_macros":[ ] } ```
2020-04-20Check that main/start is not asyncSebastian Malton-0/+43
* Add new error code E0752 * Add span to hir::IsAsync::Yes * Emit an error if main or the start function is marked as async * Add two regression tests Fix formatting errors and bless test outputs * move tests to ui/async-await fix test error text remove span from IsAsync
2020-04-20Auto merge of #71232 - eddyb:print-const-adts, r=oli-obkbors-35/+35
ty/print: pretty-print constant aggregates (arrays, tuples and ADTs). Oddly enough, we don't have any UI tests showing this off in types, only `mir-opt` tests. However, the pretty form should show up in the test output diff of #71018, if this PR is merged first. <hr/> Examples of before/after: |`Option<bool>`| |:-:| |`{transmute(0x01): std::option::Option<bool>}`| | :sparkles: ↓↓↓ :sparkles: | |`std::option::Option::<bool>::Some(true)`| | `RawVec<u32>` | |:-:| | `ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: alloc::raw_vec::RawVec::<u32>`| | :sparkles: ↓↓↓ :sparkles: | |`alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }`| <hr/> This PR is a prerequisite for #61486, *sort of*, in that we need to be able to pretty-print values in order to even consider how we might mangle them. We still don't have pretty-printing for constants of reference types, @oli-obk has the necessary support logic in a PR but I didn't want to interfere with that. <hr/> Each commit should be reviewed separately, as I've fixed a couple deficiencies along the way. r? @oli-obk cc @rust-lang/wg-mir-opt @varkor @yodaldevoid
2020-04-19check '-Zast-json' & '-Zast-json-noexpand' to output legal JSONJOE1994-2/+14
2020-04-20Auto merge of #71007 - Amanieu:deprecate_asm, r=Mark-Simulacrumbors-4/+22
Deprecate the asm! macro in favor of llvm_asm! Since we will be changing the syntax of `asm!` soon, deprecate it and encourage people to use `llvm_asm!` instead (which preserves the old syntax). This will avoid breakage when `asm!` is changed. RFC: https://github.com/rust-lang/rfcs/pull/2843
2020-04-19Rollup merge of #71324 - petrochenkov:passcheck2, r=RalfJungDylan DPC-3/+3
Fix some tests failing in `--pass check` mode r? @RalfJung
2020-04-19Rollup merge of #71317 - RalfJung:unleash-inline-asm, r=ecstatic-morseDylan DPC-0/+25
miri-unleash test for llvm_asm r? @oli-obk @ecstatic-morse
2020-04-19Rollup merge of #71310 - JohnTitor:dont-did, r=estebankDylan DPC-2/+24
Do not show DefId in diagnostics Fixes #71222 r? @estebank cc @eddyb
2020-04-19Rollup merge of #71026 - seiyab:issue-64362-adhoc, r=varkorDylan DPC-1/+21
Fix false "never constructed" warnings for `Self::` variant paths Closes #64362 .
2020-04-19Fix commentRalf Jung-3/+2
2020-04-19Fix some tests failing in `--pass check` modeVadim Petrochenkov-3/+3
2020-04-19Rollup merge of #71188 - Duddino:fix, r=matthewjasperDylan DPC-2/+10
Fixed missing trait method suggests incorrect code (self parameter not named "self"). fixes #71150
2020-04-19test for false "never constructed" warnings for `Self::` variant pathsjakubadamw-1/+21
2020-04-19miri-unleash test for llvm_asmRalf Jung-0/+26
2020-04-19Auto merge of #70015 - jonas-schievink:gen-needs-drop, r=matthewjasperbors-39/+65
Make `needs_drop` less pessimistic on generators Generators only have non-trivial drop logic when they may store (in upvars or across yields) a type that does. This prevents generation of some unnecessary MIR in simple generators. There might be some impact on compile times, but this is probably limited in real-world applications. ~~This builds off of https://github.com/rust-lang/rust/pull/69814 since that contains some fixes that are made relevant by *this* PR (see https://github.com/rust-lang/rust/pull/69814#issuecomment-599147269).~~ (this has been merged)
2020-04-19Auto merge of #69793 - estebank:predicate-obligations-4, r=nikomatsakisbors-118/+212
Maintain chain of derived obligations When evaluating the derived obligations from super traits, maintain a reference to the original obligation in order to give more actionable context in the output. Continuation (and built on) #69745, subset of #69709. r? @eddyb
2020-04-19Do not show DefId in diagnosticsYuki Okushi-2/+24
2020-04-18Add label to item source of bound obligationEsteban Küber-59/+59
2020-04-18Do not emit note for projected derived obligationsEsteban Küber-44/+0
2020-04-18Remove `AssocTypeBound` and propagate bound `Span`sEsteban Küber-88/+55
2020-04-18Maintain chain of derived obligationsEsteban Küber-0/+171
When evaluating the derived obligations from super traits, maintain a reference to the original obligation in order to give more actionable context in the output.
2020-04-19Rollup merge of #71276 - RalfJung:miri-unleash-box, r=ecstatic-morseDylan DPC-0/+29
miri-unleashed: test that we detect heap allocations This removes the second-to-last use of `IS_SUPPORTED_IN_MIRI = false`. r? @ecstatic-morse @oli-obk
2020-04-18Make Box<dyn FnOnce> respect self alignmentSantiago Pastorino-12/+36
2020-04-18Auto merge of #71218 - eddyb:a-lifetime-stranded-in-fn-def, r=nikomatsakisbors-0/+13
outlives: ignore lifetimes shallowly found in `ty::FnDef`s. Fixes #70917 by restoring the pre-#70164 behavior for now. r? @nikomatsakis
2020-04-18miri-unleashed: test that we detect heap allocationsRalf Jung-0/+29
2020-04-18Auto merge of #71147 - cuviper:min-llvm8, r=Mark-Simulacrumbors-53/+24
Update the minimum external LLVM to 8 LLVM 8 was released on March 20, 2019, over a year ago.
2020-04-17Rollup merge of #71243 - Duddino:Fix2, r=estebankDylan DPC-0/+39
Account for use of `try!()` in 2018 edition and guide users in the right direction fixes #71155
2020-04-17Rollup merge of #70467 - wesleywiser:invoke-vs-call, r=nagisaDylan DPC-8/+35
Use `call` instead of `invoke` for functions that cannot unwind The `FnAbi` now knows if the function is allowed to unwind. If a function isn't allowed to unwind, we can use a `call` instead of an `invoke`. This resolves an issue when calling LLVM intrinsics which cannot unwind LLVM will generate an error if you attempt to invoke them so we need to ignore cleanup blocks in codegen and generate a call instead. Fixes #69911 r? @eddyb cc @rust-lang/wg-ffi-unwind
2020-04-17Ignore generator-drop-cleanup on wasm32-bareJonas Schievink-31/+33
2020-04-17Adjust mir-opt test and make it drop somethingJonas Schievink-26/+54
2020-04-17Rollup merge of #71239 - JohnTitor:llvm-asm, r=AmanieuDylan DPC-19/+19
Rename `asm` test directory in favor of `llvm_asm` r? @Amanieu
2020-04-17Rollup merge of #69642 - ecstatic-morse:issue-69615, r=oli-obkDylan DPC-0/+28
Use query to determine whether function needs const checking Resolves #69615. The HIR const-checker was checking the `constness` of a function's `fn_sig` to determine whether a function needed const-checking. Now that const trait impls are a thing, this is no longer enough. All code should use the `is_const_fn_raw` query instead, which takes the constness of the impl block into account. r? @oli-obk
2020-04-17Make `needs_drop` less pessimistic on generatorsJonas Schievink-13/+9
2020-04-17Account for use of `try!()` in 2018 edition and guide users in the right ↵Duddino-0/+39
direction
2020-04-17Auto merge of #71049 - eddyb:const-err, r=oli-obkbors-293/+47
Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it. By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output). This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now. r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
2020-04-17Rename `asm` test directory in favor of `llvm_asm`Yuki Okushi-19/+19
2020-04-17Auto merge of #70629 - anyska:fields-variant, r=oli-obkbors-3/+1
rustc_target::abi: add Primitive variant to FieldsShape. Originally suggested by @eddyb.
2020-04-17Auto merge of #71230 - Dylan-DPC:rollup-rofigbv, r=Dylan-DPCbors-6/+181
Rollup of 7 pull requests Successful merges: - #70578 (Add long error explanation for E0657) - #70910 (Hides default fns inside Fuse impl to avoid exposing it to any crate) - #71164 (reword Miri validity errors: undefined -> uninitialized) - #71182 (Add some regression tests) - #71206 (Miri error messages: avoid try terminology) - #71220 (Dogfood or_patterns in the standard library) - #71225 (Fix typo in Default trait docs: Provides -> Provide) Failed merges: r? @ghost
2020-04-17ty/print: pretty-print constant aggregates (arrays, tuples and ADTs).Eduard-Mihai Burtescu-8/+8
2020-04-17mir: pretty-print `Rvalue::Aggregate` correctly.Eduard-Mihai Burtescu-27/+27