about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
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-21Rollup merge of #88072 - kit-981:feature/build-ios-toolchain-on-linux, ↵Jack Huey-5/+0
r=Mark-Simulacrum Allow the iOS toolchain to be built on Linux The iOS toolchain can be built on Linux with minor changes. The compilation will invoke `xcrun` to find the path to the iPhone SDK but a fake `xcrun` executable can be used. ``` #!/bin/sh echo "/path/to/sdk" ``` The iOS toolchain can then be built and linked with rustup. ``` $ ./x.py build --stage 2 --host x86_64-unknown-linux-gnu \ --target aarch64-apple-ios $ rustup toolchain link stage1 build/x86_64-unknown-linux-gnu/stage1 ``` It's possible to take this toolchain and compile an iOS executable with it. This requires the ld64 linker and an iOS SDK. The ld64 linker can be taken from [cctools](https://github.com/tpoechtrager/cctools-port). A project's .cargo/config can then be edited to use the linker for this target. ``` [target.aarch64-apple-ios] linker = "/path/to/cctools/bin/arm-apple-darwin-ld" rustflags = [ "-C", """ link-args= -F/path/to/sdk/System/Library/Frameworks -L/path/to/sdk/usr/lib -L/path/to/sdk/usr/lib/system/ -adhoc_codesign """, ] ```
2021-08-21Rollup merge of #87604 - yaymukund:verify-backported-commits, r=Mark-SimulacrumJack Huey-0/+188
CI: Verify commits in beta & stable are in upstream branches. Closes #74721 I think this does the trick. https://github.com/rust-lang/rust/pull/87597 is an example of it failing as it should.
2021-08-21Use `write!`Noah Lev-6/+2
2021-08-21Use the length limit as the initial capacityNoah Lev-2/+11
The length limit turns out to be a surprisingly good heuristic for initial allocation size. See here for more details [1]. [1]: https://github.com/rust-lang/rust/pull/88173#discussion_r692531631
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-21Clarify wording in docsNoah Lev-1/+1
2021-08-21Address review commentsAaron Hill-634/+353
2021-08-21Auto merge of #82776 - jyn514:extern-url-fallback, r=GuillaumeGomezbors-14/+51
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-21cleanup: `Span::new` -> `Span::with_lo`Vadim Petrochenkov-3/+3
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/+17
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-21Auto merge of #88073 - lnicola:rust-analyzer-2021-08-16, r=lnicolabors-37/+17
:arrow_up: rust-analyzer
2021-08-20Test that incomplete inference for TAITs failSantiago Pastorino-0/+36
2021-08-21Auto merge of #88149 - Mark-Simulacrum:prep-never-type, r=jackh726bors-0/+4
Refactor fallback code to prepare for never type This PR contains cherry-picks of some of `@nikomatsakis's` work from #79366, and shouldn't (AFAICT) represent any change in behavior. However, the refactoring is good regardless of the never type work being landed, and will reduce the size of those eventual PR(s) (and rebase pain). I am not personally an expert on this code, and the commits are essentially 100% `@nikomatsakis's,` but they do seem reasonable to me by my understanding. Happy to edit with review, of course. Commits are best reviewed in sequence rather than all together. r? `@jackh726` perhaps?
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-20Add support for including non-backport commits.Mukund Lakshman-4/+24
2021-08-20Add cherry-pick.sh convenience script.Mukund Lakshman-0/+34
2021-08-20Auto merge of #88000 - bjorn3:fix_cg_llvm_clif_compile, r=Mark-Simulacrumbors-1/+5
Fix compiling other codegen backends when llvm is enabled Extracted from #81746 Without this change rustbuild will not pass the required linker argument to find libllvm. While other backends likely don't use libllvm, it is necessary to be able to link against rustc_driver as the llvm backend is linked into it.
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-19Refactor Markdown length-limited summary implementationNoah Lev-43/+125
This commit refactors the implementation of `markdown_summary_with_limit()`, separating the logic of determining when the limit has been reached from the actual rendering process. The main advantage of the new approach is that it guarantees that all HTML tags are closed, whereas the previous implementation could generate tags that were never closed. It also ensures that no empty tags are generated (e.g., `<em></em>`). The new implementation consists of a general-purpose struct `HtmlWithLimit` that manages the length-limiting logic and a function `markdown_summary_with_limit()` that renders Markdown to HTML using the struct.
2021-08-19CI: Verify commits in beta & stable are in upstream branches.Mukund Lakshman-0/+134
Closes #74721
2021-08-19Test that type alias impl trait happens in a submoduleSantiago Pastorino-10/+23
2021-08-19introduce a Coerce predicateNiko Matsakis-0/+4
2021-08-19Fix clippy let expressions falloutCameron Steffen-150/+136