about summary refs log tree commit diff
path: root/src/test
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 #74460 - dennis-hamester:rustdoc-warn-pub-to-priv, r=jyn514Manish Goregaokar-5/+28
rustdoc: Always warn when linking from public to private items Change the logic such that linking from a public to a private item always triggers `intra_doc_link_resolution_failure`. Previously, the warning was not emitted when `--document-private-items` is passed. This came up during the discussion in https://github.com/rust-lang/rust/pull/74147#discussion_r452597901.
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-22rustdoc: Add explanation when linting against public to private item linksDennis Hamester-0/+4
The additional note helps explaining why the lint was triggered and that --document-private-items directly influences the link resolution.
2020-07-22rustdoc: Always warn when linking from public to private itemsDennis Hamester-5/+24
Change the logic such that linking from a public to a private item always triggers intra_doc_link_resolution_failure. Previously, the warning was not emitted when --document-private-items is passed. Also don't rely anymore on the item's visibility, which would falsely trigger the lint now that the check for --document-private-items is gone.
2020-07-22Auto merge of #74633 - davidtwco:issue-74614-disable-polymorphisation, ↵bors-34/+62
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 #74528 - euclio:intra-link-errors, r=jyn514Manish Goregaokar-117/+117
refactor and reword intra-doc link errors This commit refactors intra-doc link error reporting to deduplicate code and decouple error construction from the type of error. This greatly improves flexibility at each error construction site, while reducing the complexity of the diagnostic creation. This commit also rewords the diagnostics for clarity and style: - Diagnostics should not end in periods. - It's unnecessary to say "ignoring it". Since this is a warning by default, it's already clear that the link is ignored.
2020-07-22Rollup merge of #74237 - lzutao:compiletest, r=Mark-SimulacrumManish Goregaokar-8/+8
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-5/+5
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-22Rollup merge of #73655 - JamieCunliffe:jamie_va-args-c, r=nikicManish Goregaokar-0/+65
va_args implementation for AAPCS. Implement the va args in codegen for AAPCS, this will be used as the default va_args implementation for AArch64 rather than the va_args llvm-ir as it currently is. This should fix the following issues: https://github.com/rust-lang/rust/issues/56475 https://github.com/rust-lang/rust/issues/72579
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-34/+45
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-22[AVR] Correctly set the pointer address space when constructing pointers to ↵Dylan McKay-0/+93
functions This patch extends the existing `type_i8p` method so that it requires an explicit address space to be specified. Before this patch, the `type_i8p` method implcitily assumed the default address space, which is not a safe transformation on all targets, namely AVR. The Rust compiler already has support for tracking the "instruction address space" on a per-target basis. This patch extends the code generation routines so that an address space must always be specified. In my estimation, around 15% of the callers of `type_i8p` produced invalid code on AVR due to the loss of address space prior to LLVM final code generation. This would lead to unavoidable assertion errors relating to invalid bitcasts. With this patch, the address space is always either 1) explicitly set to the instruction address space because the logic is dealing with functions which must be placed there, or 2) explicitly set to the default address space 0 because the logic can only operate on data space pointers and thus we keep the existing semantics of assuming the default, "data" address space.
2020-07-21Auto merge of #69749 - davidtwco:issue-46477-polymorphization, r=eddybbors-2/+1296
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-20refactor and reword intra-doc link errorsAndy Russell-117/+117
This commit refactors intra-doc link error reporting to deduplicate code and decouple error construction from the type of error. This greatly improves flexibility at each error construction site, while reducing the complexity of the diagnostic creation. This commit also rewords the diagnostics for clarity and style: - Diagnostics should not end in periods. - It's unnecessary to say "ignoring it". Since this is a warning by default, it's already clear that the link is ignored.
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-2/+1216
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 #74534 - Mark-Simulacrum:rustdoc-stability, r=ManishearthManish Goregaokar-0/+37
Only skip impls of foreign unstable traits Previously unstable impls were skipped, which meant that any impl with an unstable method would get skipped. Fixes #74531.
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-19Only skip impls of foreign unstable traitsMark Rousskov-0/+37
Previously unstable impls were skipped, which meant that any impl with an unstable method would get skipped.
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-3/+3
2020-07-19Add missing : after min-gdb-versionLzu Tao-5/+5
2020-07-19Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandrybors-22/+255
Generating the coverage map @tmandry @wesleywiser rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example commands to generate a coverage report: ```shell $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main ``` ![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png) r? @wesleywiser Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
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-34/+7
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-34/+7
2020-07-18Fix debug assertion in typeckYuki Okushi-0/+36