about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-08-22Auto merge of #88166 - BoxyUwU:const-equate-canon, r=lcnrbors-0/+203
canonicalize consts before calling try_unify_abstract_consts query Fixes #88022 Fixes #86953 Fixes #77708 Fixes #82034 Fixes #85031 these ICEs were all caused by calling the `try_unify_abstract_consts` query with inference vars in substs r? `@lcnr`
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-2/+2
same search
2021-08-22Fix more “a”/“an” typosFrank Steffahn-1/+1
2021-08-22Revert "Revert "Don't load all extern crates unconditionally""Joshua Nelson-4/+22
This reverts commit 5f0c54db4e595a6a77048f2b0605138ffa49a326.
2021-08-22Test TAITs different lifetimes in defining uses failSantiago Pastorino-0/+29
2021-08-22Fix more “a”/“an” typosFrank Steffahn-3/+3
2021-08-22Fix typos “a”→“an”Frank Steffahn-12/+12
2021-08-22Suggest importing the right kind of macro.Mara Bos-0/+52
2021-08-22Auto merge of #88139 - lcnr:marker-trait-attr, r=nikomatsakisbors-0/+83
marker_traits: require `EvaluatedToOk` during winnowing closes #84955, while it doesn't really fix it in a way that makes me happy it should prevent the issue for now and this test can't be reproduced anyways, so it doesn't make much sense to keep it open. fixes #84917 as only one of the impls depends on regions, so we now drop the ambiguous one instead of the correct one. cc https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/winnowing.20soundly/near/247899832 r? `@nikomatsakis`
2021-08-21Bless testsNoah Lev-17/+53
2021-08-21Improve errors for recursive type aliasesNoah Lev-18/+18
2021-08-21Rollup merge of #88201 - spastorino:tait-incomplete-inference-test, r=oli-obkJack Huey-0/+36
Test that incomplete inference for TAITs fail r? `@oli-obk` Related to #86727
2021-08-21Rollup merge of #88197 - spastorino:tait-test-fn-type, r=oli-obkJack Huey-0/+22
Test tait use in a fn type r? `@oli-obk` I thought this was going to work but doesn't, quickly checked with Niko and he told me that we ruled this out for now. I'm not exactly sure why and how but here we have a test with a FIXME :) Related to #86727
2021-08-21Rollup merge of #88194 - spastorino:test-tait-assoc-impl-trait, r=oli-obkJack Huey-0/+19
Test use of impl Trait in an impl as the value for an associated type in an impl trait r? `@oli-obk` Related to #86727
2021-08-21Rollup merge of #88192 - spastorino:add-tait-test-for-assoc-dyn, r=oli-obkJack Huey-0/+12
Use of impl trait in an impl as the value for an associated type in a dyn r? `@oli-obk` Related to #86727
2021-08-21Rollup merge of #88189 - spastorino:add-tait-struct-test, r=oli-obkJack Huey-0/+12
Add TAIT struct test r? `@oli-obk` Related to #86727
2021-08-21Rollup merge of #88183 - spastorino:add-tait-in-different-tuple-position, ↵Jack Huey-9/+6
r=oli-obk test TAIT in different positions r? `@oli-obk` Related to #86727
2021-08-21Rollup merge of #88182 - spastorino:use-trait-in-tait-tests, r=oli-obkJack Huey-33/+12
We meant to use a trait instead of lifetime here r? `@oli-obk` Related to #86727
2021-08-21Rollup merge of #88172 - spastorino:tait-defining-use-submodule-test, r=oli-obkJack Huey-10/+23
Test that type alias impl trait happens in a submodule r? `@oli-obk` Related to #86727
2021-08-21Add cross-crate tuple field count error testNoah Lev-0/+613
2021-08-21Make E0023 spans even more preciseNoah Lev-141/+89
2021-08-21Add more tuple pattern too many fields test casesNoah Lev-6/+258
2021-08-21Auto merge of #88135 - crlf0710:trait_upcasting_part_3, r=nikomatsakisbors-96/+51
Trait upcasting coercion (part 3) By using separate candidates for each possible choice, this fixes type-checking issues in previous commits. r? `@nikomatsakis`
2021-08-21Address review commentsAaron Hill-634/+353
2021-08-21Auto merge of #82776 - jyn514:extern-url-fallback, r=GuillaumeGomezbors-3/+25
Give precedence to `html_root_url` over `--extern-html-root-url` by default, but add a way to opt-in to the previous behavior ## What is an HTML root url? It tells rustdoc where it should link when documentation for a crate is not available locally; for example, when a crate is a dependency of a crate documented with `cargo doc --no-deps`. ## What is the difference between `html_root_url` and `--extern-html-root-url`? Both of these tell rustdoc what the HTML root should be set to. `doc(html_root_url)` is set by the crate author, while `--extern-html-root-url` is set by the person documenting the crate. These are often different. For example, docs.rs uses `--extern-html-root-url https://docs.rs/crate-name/version` to ensure all crates have documentation, even if `html_root_url` is not set. Conversely, crates such as Rocket set `doc(html_root_url = "https://api.rocket.rs")`, because they prefer users to view the documentation on their own site. Crates also set `html_root_url` to ensure they have documentation when building locally when offline. This is unfortunate to require, because it's more work from the library author. It also makes it impossible to distinguish between crates that want to be viewed on a different site (e.g. Rocket) and crates that just want documentation to be visible offline at all (e.g. Tokio). I have authored a separate change to the API guidelines to no longer recommend doing this: rust-lang/api-guidelines#230. ## Why change the default? In the past, docs.rs has been the main user of `--extern-html-root-url`. However, it's useful for other projects as well. In particular, Cargo wants to pass it by default when running `--no-deps` (rust-lang/cargo#8296). Unfortunately, for these other use cases, the priority order is inverted. They want to give *precedence* to the URL the crate picks, and only fall back to the `--extern-html-root` if no `html_root_url` is present. That allows passing `--extern-html-root` unconditionally, without having to parse the source code to see what attributes are present. For docs.rs, however, we still want to keep the old behavior, so that all links on docs.rs stay on the site.
2021-08-21Remove `Session.used_attrs` and move logic to `CheckAttrVisitor`Aaron Hill-346/+109
Instead of updating global state to mark attributes as used, we now explicitly emit a warning when an attribute is used in an unsupported position. As a side effect, we are to emit more detailed warning messages (instead of just a generic "unused" message). `Session.check_name` is removed, since its only purpose was to mark the attribute as used. All of the callers are modified to use `Attribute.has_name` Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed used' attribute is implemented by simply not performing any checks in `CheckAttrVisitor` for a particular attribute. We no longer emit unused attribute warnings for the `#[rustc_dummy]` attribute - it's an internal attribute used for tests, so it doesn't mark sense to treat it as 'unused'. With this commit, a large source of global untracked state is removed.
2021-08-21Auto merge of #88134 - rylev:force-warn-improvements, r=nikomatsakisbors-11/+128
Force warn improvements As part of stablization of the `--force-warn` option (#86516) I've made the following changes: * Error when the `warnings` lint group is based to the `--force-warn` option * Tests have been updated to make it easier to understand the semantics of `--force-warn` r? `@nikomatsakis`
2021-08-21Improve error message when _ is used for in/inout asm operandsAmanieu d'Antras-25/+49
2021-08-21Auto merge of #88128 - cuviper:needs-asm-support, r=Mark-Simulacrumbors-6/+10
Add needs-asm-support to more tests These were found as test failures on s390x for RHEL and Fedora.
2021-08-21Auto merge of #87570 - nikic:llvm-13, r=nagisabors-64/+16
Upgrade to LLVM 13 Work in progress update to LLVM 13. Main changes: * InlineAsm diagnostics reported using SrcMgr diagnostic kind are now handled. Previously these used a separate diag handler. * Codegen tests are updated for additional attributes. * Some data layouts have changed. * Switch `#[used]` attribute from `llvm.used` to `llvm.compiler.used` to avoid SHF_GNU_RETAIN flag introduced in https://reviews.llvm.org/D97448, which appears to trigger a bug in older versions of gold. * Set `LLVM_INCLUDE_TESTS=OFF` to avoid Python 3.6 requirement. Upstream issues: * ~~https://bugs.llvm.org/show_bug.cgi?id=51210 (InlineAsm diagnostic reporting for module asm)~~ Fixed by https://github.com/llvm/llvm-project/commit/1558bb80c01b695ce12642527cbfccf16cf54ece. * ~~https://bugs.llvm.org/show_bug.cgi?id=51476 (Miscompile on AArch64 due to incorrect comparison elimination)~~ Fixed by https://github.com/llvm/llvm-project/commit/81b106584f2baf33e09be2362c35c1bf2f6bfe94. * https://bugs.llvm.org/show_bug.cgi?id=51207 (Can't set custom section flags anymore). Problematic change reverted in our fork, https://reviews.llvm.org/D107216 posted for upstream revert. * https://bugs.llvm.org/show_bug.cgi?id=51211 (Regression in codegen for #83623). This is an optimization regression that we may likely have to eat for this release. The fix for #83623 was based on an incorrect premise, and this needs to be properly addressed in the MergeICmps pass. The [compile-time impact](https://perf.rust-lang.org/compare.html?start=ef9549b6c0efb7525c9b012148689c8d070f9bc0&end=0983094463497eec22d550dad25576a894687002) is mixed, but quite positive as LLVM upgrades go. The LLVM 13 final release is scheduled for Sep 21st. The current nightly is scheduled for stable release on Oct 21st. r? `@ghost`
2021-08-21Always use llvm.used for coverage symbolsNikita Popov-4/+1
This follows what clang does in CoverageMappingGen. Using just llvm.compiler.used is insufficient at least for MSVC targets.
2021-08-20Test that incomplete inference for TAITs failSantiago Pastorino-0/+36
2021-08-20Test use of impl Trait in an impl as the value for an associated type in an ↵Santiago Pastorino-0/+19
impl trait
2021-08-20Auto merge of #88087 - jesyspa:issue-87935-box, r=jackh726bors-82/+62
Check that a box expression's type is Sized This resolves [issue 87935](https://github.com/rust-lang/rust/issues/87935). This makes E0161 (move from an unsized rvalue) much less common. I've replaced the test to use [this case](https://github.com/rust-lang/rust/blob/master/src/test/ui/object-safety/object-safety-by-value-self-use.rs), when a boxed `dyn` trait is passed by value, but that isn't an error when `unsized_locals` is enabled. I think it may be possible to get rid of E0161 entirely by checking that case earlier, but I'm not sure if that's desirable?
2021-08-21Improve error reporting for closure return type mismatchesFabian Wolff-0/+50
2021-08-20Test tait use in a fn typeSantiago Pastorino-0/+22
2021-08-20Use of impl trait in an impl as the valoe for an associated type in a dynSantiago Pastorino-0/+12
2021-08-20Add TAIT struct testSantiago Pastorino-0/+12
2021-08-20Auto merge of #88176 - erikdesjardins:rezst, r=oli-obkbors-53/+21
Reenable RemoveZsts Now that the underlying issue has been fixed by #88124, we can reland #83417. r? `@oli-obk`
2021-08-20Update old box expression tests and add a new one.Anton Golov-26/+36
New tests also check that we're not triggering this error over-zealously.
2021-08-20test TAIT in different positionsSantiago Pastorino-9/+6
2021-08-20Change example and tests for E0161.Anton Golov-56/+26
The code will not emit this warning once box expressions require a sized type (since that error is emitted earlier in the flow).
2021-08-20We meant to use a trait instead of lifetime hereSantiago Pastorino-33/+12
2021-08-19Revert "Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, ↵Erik Desjardins-53/+21
r=oli-obk"" This reverts commit 8e11199a153218c13a419df37a9bb675181cccb7.
2021-08-20Auto merge of #88039 - sexxi-goose:fix-87987, r=nikomatsakisbors-0/+54
RFC2229 Only compute place if upvars can be resolved Closes https://github.com/rust-lang/rust/issues/87987 This PR fixes an ICE when trying to unwrap an Err. This error appears when trying to convert a PlaceBuilder into Place when upvars can't yet be resolved. We should only try to convert a PlaceBuilder into Place if upvars can be resolved. r? `@nikomatsakis`
2021-08-19Auto merge of #87996 - sexxi-goose:fix-87988, r=nikomatsakisbors-0/+63
RFC2229 Add missing edge case Closes https://github.com/rust-lang/rust/issues/87988 This PR fixes an ICE where a match discriminant is not being read when expected. This ICE was the result of a missing edge case which assumed that if a pattern is of type `PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..)` then a place could only be a multi variant if the place is of type kind Adt.
2021-08-19Test that type alias impl trait happens in a submoduleSantiago Pastorino-10/+23
2021-08-19regression testsEllen-0/+203
2021-08-19Test presence of remapped pathAndy Wang-0/+1
2021-08-19Make test function pubAndy Wang-1/+1