about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-07-22Rollup merge of #74618 - JohnTitor:no-more-bad-placeholder, r=estebankManish Goregaokar-6/+14
Do not ICE on assoc type with bad placeholder Fixes #74612 r? @estebank
2020-07-22Rollup merge of #74538 - nbdd0121:issue-73976, r=lcnrManish Goregaokar-0/+102
Guard against non-monomorphized type_id intrinsic call This PR checks whether the type is sufficient monomorphized when calling type_id or type_name intrinsics. If the type is not sufficiently monomorphized, e.g. used in a pattern, the code will be rejected. Fixes #73976
2020-07-22Rollup merge of #73783 - estebank:impl-dyn-trait-static-lifetime, r=nikomatsakisManish Goregaokar-211/+724
Detect when `'static` obligation might come from an `impl` Partly address #71341.
2020-07-22Change error code numberEsteban Küber-20/+19
2020-07-22Auto merge of #74633 - davidtwco:issue-74614-disable-polymorphisation, ↵bors-31/+59
r=wesleywiser Disable polymorphisation Fixes #74614. This PR disables polymorphisation to fix the regression in #74614 after investigation into the issue makes it clear that the fix won't be trivial. ~~I'll file an issue shortly to replace #74614 with the findings so far.~~ #74636 has been filed to track the fix of the underlying regression. r? @eddyb
2020-07-22Handle fully-qualified paths and add test casesEsteban Küber-16/+302
2020-07-22Use `ty::Instance::resolve` to identify `'static` bound sourceEsteban Küber-54/+49
2020-07-22Further tweak wording of E0759 and introduce E0767Esteban Küber-138/+201
2020-07-22Add more context to diagnosticEsteban Küber-4/+32
2020-07-22Increase accuracy of lifetime bound on trait object impl suggestionEsteban Küber-35/+123
2020-07-22Detect when `'static` obligation might come from an `impl`Esteban Küber-107/+161
Address #71341.
2020-07-22Rollup merge of #74237 - lzutao:compiletest, r=Mark-SimulacrumManish Goregaokar-1/+1
compiletest: Rewrite extract_*_version functions This makes extract_lldb_version has the same version type like extract_gdb_version.
2020-07-22Rollup merge of #73893 - ajpaverd:cfguard-stabilize, r=nikomatsakisManish Goregaokar-1/+1
Stabilize control-flow-guard codegen option This is the stabilization PR discussed in #68793. It converts the `-Z control-flow-guard` debugging option into a codegen option (`-C control-flow-guard`), and changes the associated tests.
2020-07-22tests: add regression test for #74614David Wood-0/+17
This commit adds a regression test for #74614 so that it is fixed before polymorphisation is re-enabled. Signed-off-by: David Wood <david@davidtw.co>
2020-07-22sess: disable polymorphisationDavid Wood-31/+42
This commit disables polymorphisation to resolve regressions related to closures which inherit unused generic parameters and are then used in casts or reflection. Signed-off-by: David Wood <david@davidtw.co>
2020-07-22Do not ICE on assoc type with bad placeholderYuki Okushi-6/+14
2020-07-21Auto merge of #69749 - davidtwco:issue-46477-polymorphization, r=eddybbors-0/+971
Polymorphization This PR implements an analysis to detect when functions could remain polymorphic during code generation. Fixes #46477 r? @eddyb cc @rust-lang/wg-mir-opt @nikomatsakis @pnkfelix
2020-07-21Expand test to cover type_name and monomorphic useGary Guo-15/+77
2020-07-20Rollup merge of #74557 - jakubadamw:issue-74539, r=nagisaManish Goregaokar-0/+33
Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern Fixes #74539.
2020-07-20Rollup merge of #74051 - yodaldevoid:issue_60814, r=nikomatsakisManish Goregaokar-0/+56
disallow non-static lifetimes in const generics Disallow non-static lifetimes in const generics in order to to patch over an ICE caused when we encounter a non-static lifetime in a const generic during borrow checking. This restriction may be relaxed in the future, but we need more discussion before then, and in the meantime we should still deal with this ICE. Fixes issue #60814
2020-07-20Rollup merge of #73323 - davidtwco:issue-73252-wfcheck-foreign-fn-decl, ↵Manish Goregaokar-32/+69
r=ecstatic-morse wf: check foreign fn decls for well-formedness Fixes #73252 and fixes #73253. This PR extends current well-formedness checking to apply to foreign function declarations, re-using the existing machinery for regular functions. In doing this, later parts of the compiler (such as the `improper_ctypes` lint) can rely on being operations not failing as a result of invalid code which would normally be caught earlier.
2020-07-20Rollup merge of #72714 - JohnTitor:debug-assert, r=nikomatsakisManish Goregaokar-0/+36
Fix debug assertion in typeck Fixes #72410
2020-07-20index: introduce and use `FiniteBitSet`David Wood-2/+10
This commit introduces a `FiniteBitSet` type which replaces the manual bit manipulation which was being performed in polymorphization. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20mir: use attribute over `-Z polymorphize-errors`David Wood-70/+117
This commit replaces the `-Z polymorphize-errors` debugging flag with a `#[rustc_polymorphize_error]` attribute for use on functions. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20ty: normalize fn sigs before substDavid Wood-0/+25
This commit normalizes function signatures for instances before substituting, a workaround for polymorphization considering parameters unused when they show up in the signature, but not the body (due to being normalized). Unfortunately, this causes test output to change with the parallel compiler only. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20mir: `unused_generic_params` queryDavid Wood-0/+891
This commit implements the `unused_generic_params` query, an initial version of polymorphization which detects when an item does not use generic parameters and is being needlessly monomorphized as a result. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20Fix an ICE on an invalid `binding @ ...` in a tuple struct patternJakub Adam Wieczorek-0/+33
2020-07-20wf: check foreign fn decls for well-formednessDavid Wood-32/+69
This commit extends current well-formedness checking to apply to foreign function declarations, re-using the existing machinery for regular functions. In doing this, later parts of the compiler (such as the `improper_ctypes` lint) can rely on being operations not failing as a result of invalid code which would normally be caught earlier. Signed-off-by: David Wood <david@davidtw.co>
2020-07-19Rollup merge of #74516 - lcnr:min-specialization-ice, r=matthewjasperManish Goregaokar-0/+16
do not try fetching the ancestors of errored trait impls fixes #74483 While building the specialization graph, we use `tcx.all_impls` which discards impls with incorrect self types, we do however call `trait_def.ancestors` with these impls which caused an ICE as they aren't part of the specialization graph.
2020-07-19Guard against non-monomorphized type_id intrinsic callGary Guo-0/+40
2020-07-19Add test for an explicit non-'static lifetime in a const argumentGabriel Smith-0/+28
2020-07-19disallow non-static lifetimes in const genericsGabriel Smith-0/+28
This has been put in place to patch over an ICE caused when we encounter a non-static lifetime in a const generic during borrow checking. This restriction may be relaxed in the future, but we need more discussion before then, and in the meantime we should still deal with this ICE. Fixes issue #60814
2020-07-19do not try fetching the ancestors of errored trait implsBastian Kauschke-0/+16
2020-07-19Add missing : after *llvm-versionLzu Tao-1/+1
2020-07-18Rollup merge of #74459 - canova:const-unreachable-unchecked, r=oli-obkManish Goregaokar-0/+81
Make unreachable_unchecked a const fn This PR makes `std::hint::unreachable_unchecked` a const fn so we can use it inside a const function. r? @RalfJung Fixes #53188.
2020-07-18Rollup merge of #74445 - lcnr:const-generic-ty-decl, r=Dylan-DPCManish Goregaokar-0/+48
add test for #62878 forgot to push this as part of #74159 r? @Dylan-DPC
2020-07-18Rollup merge of #74071 - petrochenkov:cload3, r=matthewjasperManish Goregaokar-20/+3
rustc_metadata: Make crate loading fully speculative Instead of reporting `span_err`s on the spot crate loading errors are now wrapped into the `CrateError` enum and returned, so they are reported only at the top level `resolve_crate` call, and not reported at all if we are resolving speculatively with `maybe_resolve_crate`. As a result we can attempt loading crates for error recovery (e.g. import suggestions) without any risk of producing extra errors. Also, this means better separation between error reporting and actual logic. Fixes https://github.com/rust-lang/rust/issues/55103 Fixes https://github.com/rust-lang/rust/issues/56590
2020-07-18rustc_metadata: Make crate loading fully speculativeVadim Petrochenkov-20/+3
2020-07-18Fix debug assertion in typeckYuki Okushi-0/+36
2020-07-17Rollup merge of #74448 - davidtwco:improper-ctypes-definitions-boxes, ↵Manish Goregaokar-63/+46
r=davidtwco improper_ctypes_definitions: allow `Box` Addresses https://github.com/rust-lang/rust/pull/72700#issuecomment-659449386. This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. cc @alexcrichton @CryZe
2020-07-17Rollup merge of #74444 - Alexendoo:test-69414, r=nikomatsakisManish Goregaokar-2/+5
Add regression test for #69414 Closes #69414 (no longer ICEs after #74159)
2020-07-17Rollup merge of #74069 - erikdesjardins:bad-niche, r=nikomatsakisManish Goregaokar-3/+28
Compare tagged/niche-filling layout and pick the best one Finishes up #71045, and so fixes #63866. cc @eddyb r? @nikomatsakis (since @eddyb wrote the first commit)
2020-07-18Update UB test to fail during build with contant errorsNazım Can Altınova-5/+34
2020-07-17Rollup merge of #74438 - RalfJung:uninit-lint, r=davidtwcoManish Goregaokar-36/+73
warn about uninitialized multi-variant enums Fixes https://github.com/rust-lang/rust/issues/73608
2020-07-17Rollup merge of #74364 - lcnr:lazy-norm-tests, r=nikomatsakisManish Goregaokar-0/+36
add lazy normalization regression tests We previously didn't have simple tests which fail if we aren't careful around lazy normalization. We now do.
2020-07-17Rollup merge of #73930 - a1phyr:feature_const_option, r=dtolnayManish Goregaokar-0/+14
Make some Option methods const Tracking issue: #67441 Constantify the following methods of `Option`: - `as_ref` - `is_some` - `is_none` - `iter` (not sure about this one, but it is possible, and will be useful when const traits are a thing) cc @rust-lang/wg-const-eval @rust-lang/libs
2020-07-17Add a test for const unsafe_unreachable that triggers UBNazım Can Altınova-0/+35
2020-07-17Add a passing test for const unsafe_unreachableNazım Can Altınova-0/+17
2020-07-17improper_ctypes_definitions: allow `Box`David Wood-63/+46
This commit stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. Signed-off-by: David Wood <david@davidtw.co>
2020-07-17add test for #62878Bastian Kauschke-0/+48