about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-11-12Bumped minimal tested LLVM version to 9DevJPM-4/+4
This bumps the minimal tested llvm version to 9. This should enable supporting newer LLVM features (and CPU extensions).
2020-11-12Auto merge of #78782 - petrochenkov:nodoctok, r=Aaron1011bors-6/+6
Do not collect tokens for doc comments Doc comment is a single token and AST has all the information to re-create it precisely. Doc comments are also responsible for majority of calls to `collect_tokens` (with `num_calls == 1` and `num_calls == 0`, cc https://github.com/rust-lang/rust/pull/78736). (I also moved token collection into `fn parse_attribute` to deduplicate code a bit.) r? `@Aaron1011`
2020-11-11Auto merge of #78956 - jonas-schievink:rollup-r53giob, r=jonas-schievinkbors-195/+621
Rollup of 11 pull requests Successful merges: - #78216 (Duration::zero() -> Duration::ZERO) - #78354 (Support enable/disable sanitizers/profiler per target) - #78417 (BTreeMap: split off most code of append) - #78832 (look at assoc ct, check the type of nodes) - #78873 (Add flags customizing behaviour of MIR inlining) - #78899 (Support inlining diverging function calls) - #78923 (Cleanup and comment intra-doc link pass) - #78929 (rustc_target: Move target env "gnu" from `linux_base` to `linux_gnu_base`) - #78930 (rustc_taret: Remove `TargetOptions::is_like_android`) - #78942 (Fix typo in comment) - #78947 (Ship llvm-cov through llvm-tools) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-11Rollup merge of #78947 - dalance:llvm_cov, r=Mark-SimulacrumJonas Schievink-10/+11
Ship llvm-cov through llvm-tools `llvm-cov` is used to generate coverage report with LLVM InstrProf-based code coverage #34701. So if `llvm-cov` is shipped through llvm-tools, users can try it easily accorging to the instruction of [The Rust Unstable Book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/source-based-code-coverage.html).
2020-11-11Rollup merge of #78942 - eltociear:patch-1, r=jonas-schievinkJonas Schievink-1/+1
Fix typo in comment occurences -> occurrences
2020-11-11Rollup merge of #78923 - jyn514:intra-doc-comments, r=ManishearthJonas Schievink-167/+247
Cleanup and comment intra-doc link pass r? ```@Manishearth``` cc ```@seeplusplus```
2020-11-11Rollup merge of #78899 - tmiasko:inline-diverging, r=oli-obkJonas Schievink-0/+180
Support inlining diverging function calls The existing heuristic does penalize diverging calls to some degree, but since it never inlined them previously it might need some further modifications. Additionally introduce storage markers for all temporaries created by the inliner. The temporary introduced for destination rebrorrow, didn't use them previously.
2020-11-11Rollup merge of #78873 - tmiasko:inline-opts, r=oli-obkJonas Schievink-0/+75
Add flags customizing behaviour of MIR inlining * `-Zinline-mir-threshold` to change the default threshold. * `-Zinline-mir-hint-threshold` to change the threshold used by functions with inline hint. Having those as configurable flags makes it possible to experiment with with different inlining thresholds and substantially increase test coverage of MIR inlining when used with increased thresholds (for example, necessary to test #78844).
2020-11-11Rollup merge of #78832 - lcnr:const-evaluatable-unevaluated, r=oli-obkJonas Schievink-0/+61
look at assoc ct, check the type of nodes an example where types matter are function objects, see the added test which previously passed. Now does a shallow comparison of unevaluated constants. r? ```@oli-obk```
2020-11-11Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-SimulacrumJonas Schievink-17/+46
Support enable/disable sanitizers/profiler per target This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target. If these options are empty, the global options under `[build]` will take effect. Fix #78329
2020-11-11Auto merge of #78946 - jethrogb:linux-x86-llvm-no-gnu-unique, r=Mark-Simulacrumbors-1/+2
Linux dist: don't include unique symbols in libLLVM Fixes #76980
2020-11-11Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrumbors-2/+45
Vendor libtest's dependencies in the rust-src component This is the Rust side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23 Note that this won't produce a useful result for `cargo -Zbuild-std` if there are multiple versions of a crate vendored, but will otherwise produce a valid vendor dir. See https://github.com/rust-lang/cargo/pull/8834 for the other half of this change.
2020-11-12Ship llvm-cov through llvm-toolsdalance-10/+11
2020-11-11Linux dist: don't include unique symbols in libLLVMJethro Beekman-1/+2
2020-11-11Fix typo in commentIkko Ashimine-1/+1
occurences -> occurrences
2020-11-10Changed unwrap_or to unwrap_or_else in some places.Nicholas-Baron-3/+2
The discussion seems to have resolved that this lint is a bit "noisy" in that applying it in all places would result in a reduction in readability. A few of the trivial functions (like `Path::new`) are fine to leave outside of closures. The general rule seems to be that anything that is obviously an allocation (`Box`, `Vec`, `vec![]`) should be in a closure, even if it is a 0-sized allocation.
2020-11-10Cleanup and comment intra-doc link passJoshua Nelson-167/+247
2020-11-10Rollup merge of #78912 - JulianKnodt:mcg_macro, r=lcnrJonas Schievink-0/+212
Add macro test for min-const-generics Adds a test which uses a macro inside a block for a const-expression, as per #78433 r? `@lcnr`
2020-11-10Rollup merge of #78908 - liketechnik:fix_macro_expand_src_link, r=jyn514Jonas Schievink-11/+13
(rustdoc) [src] link for types defined by macros shows invocation, not defintion Previously the [src] link on types defined by a macro pointed to the macro definition. This pr makes the Clean-Implementation for Spans aware of macro defined types, so that the link points to the invocation instead. I'm not totally sure if it's okay to add the 'macro awareness' in the Clean-Implementation, because it erases that knowledge for all following code. Maybe it would be more sensible to add the check only for the link generation at https://github.com/rust-lang/rust/blob/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/src/librustdoc/html/render/mod.rs#L1619 Closes #39726.
2020-11-10Rollup merge of #78898 - SNCPlay42:issue-78892, r=Mark-SimulacrumJonas Schievink-0/+14
add regression test for #78892 closes #78892, which was already fixed on nightly.
2020-11-10Rollup merge of #78897 - hyd-dev:alloc-error-hook-newline, r=m-ou-seJonas Schievink-1/+1
Add missing newline to error message of the default OOM hook Currently the default OOM hook in libstd does not end the error message with a newline: ``` memory allocation of 4 bytes failedtimeout: the monitored command dumped core /playground/tools/entrypoint.sh: line 11: 7 Aborted timeout --signal=KILL ${timeout} "$`@"` ``` https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=030d8223eb57dfe47ef157709aa26542 This is because the `fmt::Arguments` passed to `dumb_print()` does not end with a newline. All other calls to `dumb_print()` in libstd pass a `\n`-ended `fmt::Arguments` to `dumb_print()`. For example: https://github.com/rust-lang/rust/blob/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/library/std/src/sys_common/util.rs#L18 I think the `\n` was forgotten in #51264. This PR appends `\n` to the error string. ~~Note that I didn't add a test, because I didn't find tests for functions in ` library/std/src/alloc.rs` or a test that is similar to the test of this change would be.~~ *Edit: CI told me there is an existing test. Sorry.*
2020-11-10Rollup merge of #78669 - sasurau4:test/check-pass-consts, r=jyn514Jonas Schievink-4/+4
Use check-pass instead of build-pass in some consts ui test suits Helps with #62277 Changed tests modified by https://github.com/rust-lang/rust/pull/57175 because of the stabilization `#![feature(const_let)]`. They should be compile-fail because the feature gate checking disallow the feature before stabilization. So the feature gate checking have nothing to do with codegen according to https://rustc-dev-guide.rust-lang.org/feature-gate-ck.html.
2020-11-10Rollup merge of #78574 - sasurau4:test/check-pass-regions, r=jyn514Jonas Schievink-18/+18
Use check-pass instead of build-pass in regions ui test suite ## Overview Helps with #62277 Region inference have nothing to do with codegen because they are erased before codegen. Ref: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20region.20inference.20.20nothing.20to.20do.20with.20codegen.20process.3F/near/215956759
2020-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-100/+218
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-11-10use check-pass instead of build-pass in consts ui test suitsDaiki Ihara-4/+4
2020-11-10Add macro test for min-const-genericskadmin-0/+212
2020-11-09Update src/test/ui/issues/issue-76547.rsTyler Mandry-1/+1
Co-authored-by: Camelid <camelidcamel@gmail.com>
2020-11-09add nll compare mode stderr fileGus Wynn-0/+20
2020-11-10(rustdoc) [src] link for types defined by macros shows invocationFlorian Warzecha-11/+13
Previously the [src] link on types defined by a macro pointed to the macro definition. This commit makes the Clean-Implementation for Spans aware of macro defined types, so that the link points to the invocation instead.
2020-11-10Add flags customizing behaviour of MIR inliningTomasz Miąsko-0/+75
* `-Zinline-mir-threshold` to change the default threshold. * `-Zinline-mir-hint-threshold` to change the threshold used by functions with inline hint.
2020-11-09Rollup merge of #78746 - pietroalbini:i686-freebsd, r=Mark-SimulacrumDylan DPC-38/+8
Demote i686-unknown-freebsd to tier 2 compiler target While technically the `i686-unknown-freebsd` target has been a tier 2 development platform for a long time, with full toolchain tarballs available on static.rust-lang.org, due to a bug in the manifest generation the target was never available for download through rustup. The infrastructure team privately inquired the FreeBSD package maintainers, and they weren't relying on those tarballs either, so it's a fair assumption to say practically nobody is using those tarballs. This PR then removes the CI builder that produces full tarballs for the target, and moves the compilation of `rust-std` for the target in `dist-various-2`. The `x86_64-unknown-freebsd` target is *not* affected. cc `@rust-lang/infra` `@rust-lang/compiler` `@rust-lang/release` r? `@Mark-Simulacrum`
2020-11-09Rollup merge of #78710 - petrochenkov:macvisit, r=davidtwcoDylan DPC-8/+2
rustc_ast: Do not panic by default when visiting macro calls Panicking by default made sense when we didn't have HIR or MIR and everything worked on AST, but now all AST visitors run early and majority of them have to deal with macro calls, often by ignoring them. The second commit renames `visit_mac` to `visit_mac_call`, the corresponding structures were renamed earlier in https://github.com/rust-lang/rust/pull/69589.
2020-11-09Rollup merge of #78580 - tmiasko:inline-loop, r=oli-obkDylan DPC-0/+134
inliner: Break inlining cycles Keep track of all instances inlined so far. When examining a new call sites from an inlined body, skip those where callee had been inlined already to avoid potential inlining cycles. Fixes #78573.
2020-11-09Rollup merge of #78566 - JRF63:polly, r=Mark-SimulacrumDylan DPC-0/+8
Enable LLVM Polly via llvm-args. I think doing it this way is better than in #51061. Polly has other useful options and we probably don't want to create a `-Z` flag for each one of them. ![results](https://user-images.githubusercontent.com/7283601/97695555-338f7180-1adf-11eb-82bd-5130e0e6fa89.png) [Benchmark](https://gist.github.com/JRF63/9a6268b91720958e90dbe7abffe20298) I noticed that `-lto` seems to interfere with polly in this specific microbenchmark, as enabling it causes the perf to drop to that of non-polly builds. Other related PRs: #75615
2020-11-09Rollup merge of #78513 - jyn514:rustup-toolchain, r=Mark-SimulacrumDylan DPC-3/+20
Infer the default host target from the host toolchain if possible - `beta-x86_64-unknown-linux-gnu` has beta stripped - `rustc2` is ignored This fixes ongoing issues where x.py will detect the wrong host triple between MSVC and GNU. I don't think this will break anyone's workflow - I'd be very surprised if you a) had no `[build]` section in `config.toml`, b) had rustc installed, and c) expected the default target to be something other than the default target used by `rustc`. But I could be wrong - I'm happy to hear user stories :) Fixes https://github.com/rust-lang/rust/issues/78150. r? ``@Mark-Simulacrum`` cc ``@Lokathor``
2020-11-09Rollup merge of #78502 - matthewjasper:chalkup, r=nikomatsakisDylan DPC-0/+33
Update Chalk to 0.36.0 This PR updates Chalk and fixes a number of bugs in the chalk integration code. cc `@rust-lang/wg-traits` r? `@nikomatsakis`
2020-11-09Rollup merge of #77016 - Mark-Simulacrum:clippy-tests, r=pietroalbiniDylan DPC-0/+4
Test clippy on PR CI on changes This runs the tools builder (which builds and tests tools, including clippy) when the clippy submodule changes. This essentially returns us to the prior state when clippy was a submodule; it makes sense for us to test it on CI when it changes. It might make sense for it to be tested regardless of changing but it is somewhat rare for it to fail and we don't want to add to CI time for the majority of PRs which don't affect it. Fixes #76999.
2020-11-09Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-SimulacrumDylan DPC-3/+121
Improve lifetime name annotations for closures & async functions * Don't refer to async functions as "generators" in error output * Where possible, emit annotations pointing exactly at the `&` in the return type of closures (when they have explicit return types) and async functions, like we do for arguments. Addresses #74072, but I wouldn't call that *closed* until annotations are identical for async and non-async functions. * Emit a better annotation when the lifetime doesn't appear in the full name type, which currently happens for opaque types like `impl Future`. Addresses #74497, but further improves could probably be made (why *doesn't* it appear in the type as `impl Future + '1`?) This is included in the same PR because the changes to `give_name_if_anonymous_region_appears_in_output` would introduce ICE otherwise (it would return `None` in cases where it didn't previously, which then gets `unwrap`ped)
2020-11-09Vendor libtest's dependencies in the rust-src componentAlexis Beingessner-2/+45
This is the Rust side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23
2020-11-10Add missing newline to error message of the default OOM hookhyd-dev-1/+1
2020-11-09use RegionNameHighlight for async fn and closure returnsSNCPlay42-5/+55
2020-11-09add regression test for #78892SNCPlay42-0/+14
2020-11-09Add `#[cfg(panic = "...")]`David Hewitt-10/+120
2020-11-09Auto merge of #78201 - joshtriplett:rustc-tls-model, r=Mark-Simulacrumbors-0/+12
Compile rustc crates with the initial-exec TLS model This should produce more efficient code, with fewer calls to __tls_get_addr. The tradeoff is that libraries using it won't work with dlopen, but that shouldn't be a problem for rustc's internal libraries.
2020-11-09Rollup merge of #78868 - notriddle:master, r=GuillaumeGomezDylan DPC-2/+3
Fix tab focus on restyled switches Setting a checkbox to `display:none` makes it impossible to tab onto it, which makes the rustdoc settings page completely keyboard inaccessible.
2020-11-09Rollup merge of #78748 - fanzier:tuple-assignment, r=petrochenkovDylan DPC-55/+214
Implement destructuring assignment for tuples This is the first step towards implementing destructuring assignment (RFC: https://github.com/rust-lang/rfcs/pull/2909, tracking issue: #71126). This PR is the first part of #71156, which was split up to allow for easier review. Quick summary: This change allows destructuring the LHS of an assignment if it's a (possibly nested) tuple. It is implemented via a desugaring (AST -> HIR lowering) as follows: ```rust (a,b) = (1,2) ``` ... becomes ... ```rust { let (lhs0,lhs1) = (1,2); a = lhs0; b = lhs1; } ``` Thanks to `@varkor` who helped with the implementation, particularly around default binding modes. r? `@petrochenkov`
2020-11-09Rollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obkDylan DPC-0/+91
inliner: Use substs_for_mir_body Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account. Resolves #78529. Resolves #78560.
2020-11-09Rollup merge of #78228 - pietroalbini:finally, r=Mark-SimulacrumDylan DPC-20/+12
Promote aarch64-unknown-linux-gnu to Tier 1 This PR promotes the `aarch64-unknown-linux-gnu` target to Tier 1, as proposed by [RFC 2959]: * The `aarch64-gnu` CI job is moved from `auto-fallible` to `auto`. * The platform support documentation is updated, uplifting the target to Tiert 1 with a note about missing stack probes support. * Building the documentation is enabled for the target, as we produce the `rust-docs` component for all Tier 1 platforms. [RFC 2959]: https://github.com/rust-lang/rfcs/pull/2959
2020-11-09Rollup merge of #78114 - jyn514:private, r=oli-obkDylan DPC-5/+6
Recognize `private_intra_doc_links` as a lint Previously, trying to allow this would give another error! ``` warning: unknown lint: `private_intra_doc_links` --> private.rs:1:10 | 1 | #![allow(private_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `broken_intra_doc_links` | = note: `#[warn(unknown_lints)]` on by default warning: public documentation for `DocMe` links to private item `DontDocMe` --> private.rs:2:11 | 2 | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | = note: `#[warn(private_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` ``` Fixes the issue found in https://github.com/rust-lang/rust/pull/77249#issuecomment-712339227. r? ````````@Manishearth```````` Does anyone know why this additional step is necessary? It seems weird this has to be declared in 3 different places.
2020-11-09Support inlining diverging function callsTomasz Miąsko-0/+180
Additionally introduce storage markers for all temporaries created by the inliner. The temporary introduced for destination rebrorrow, didn't use them previously.