about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-10-10Fix <code> blocks in doc blocks display on mobileGuillaume Gomez-0/+4
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-0/+41
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-08Auto merge of #89659 - workingjubilee:rollup-0vggc69, r=workingjubileebors-20/+543
Rollup of 8 pull requests Successful merges: - #87918 (Enable AutoFDO.) - #88137 (On macOS, make strip="symbols" not pass any options to strip) - #88772 (Fixed confusing wording on Result::map_or_else.) - #89025 (Implement `#[link_ordinal(n)]`) - #89082 (Implement #85440 (Random test ordering)) - #89288 (Wrapper for `-Z gcc-ld=lld` to invoke rust-lld with the correct flavor) - #89476 (Correct decoding of foreign expansions during incr. comp.) - #89622 (Use correct edition for panic in [debug_]assert!().) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-07Rollup merge of #89622 - m-ou-se:debug-assert-2021, r=estebankJubilee-0/+125
Use correct edition for panic in [debug_]assert!(). See https://github.com/rust-lang/rust/issues/88638#issuecomment-915472783
2021-10-07Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkovJubilee-0/+11
Correct decoding of foreign expansions during incr. comp. Fixes https://github.com/rust-lang/rust/issues/74946 The original issue was due to a wrong assertion in `expn_hash_to_expn_id`. The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
2021-10-07Rollup merge of #89288 - rusticstuff:lld_wrapper, r=Mark-SimulacrumJubilee-13/+184
Wrapper for `-Z gcc-ld=lld` to invoke rust-lld with the correct flavor This PR adds an `lld-wrapper` tool which is installed as `ld` and `ld64` in `lib\rustlib\<host_target>\bin\gcc-ld` directory and whose sole purpose is to invoke `rust-lld` in the parent directory with the correct flavor. Lld decides which flavor to use from either the first two commandline arguments or from the name of the executable (`ld` for GNU/ld flavor, `ld64` for Darwin/Macos/ld64 flavor and so on). Symbolic links could not be used as they are not supported by rustup and on Windows. The wrapper replaces full copies of rust-lld which added some significant bloat. On UNIXish operating systems it exec rust-lld, on Windows it spawns it as a child process. Fixes #88869. r? ```@Mark-Simulacrum``` cc ```@nagisa``` ```@petrochenkov``` ```@1000teslas```
2021-10-07Rollup merge of #89082 - smoelius:master, r=kennytmJubilee-1/+37
Implement #85440 (Random test ordering) This PR adds `--shuffle` and `--shuffle-seed` options to `libtest`. The options are similar to the [`-shuffle` option](https://github.com/golang/go/blob/c894b442d1e5e150ad33fa3ce13dbfab1c037b3a/src/testing/testing.go#L1482-L1499) that was recently added to Go. Here are the relevant parts of the help message: ``` --shuffle Run tests in random order --shuffle-seed SEED Run tests in random order; seed the random number generator with SEED ... By default, the tests are run in alphabetical order. Use --shuffle or set RUST_TEST_SHUFFLE to run the tests in random order. Pass the generated "shuffle seed" to --shuffle-seed (or set RUST_TEST_SHUFFLE_SEED) to run the tests in the same order again. Note that --shuffle and --shuffle-seed do not affect whether the tests are run in parallel. ``` Is an RFC needed for this?
2021-10-07Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoeristerJubilee-6/+141
Implement `#[link_ordinal(n)]` Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name. As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL. Part of #58713.
2021-10-07Rollup merge of #87918 - mikebenfield:pr-afdo, r=nikicJubilee-0/+45
Enable AutoFDO. This largely involves implementing the options debug-info-for-profiling and profile-sample-use and forwarding them on to LLVM. AutoFDO can be used on x86-64 Linux like this: rustc -O -Clink-arg='Wl,--no-rosegment' -Cdebug-info-for-profiling main.rs -o main perf record -b ./main create_llvm_prof --binary=main --out=code.prof rustc -O -Cprofile-sample-use=code.prof main.rs -o main2 Now `main2` will have feedback directed optimization applied to it. The create_llvm_prof tool can be obtained from this github repository: https://github.com/google/autofdo The option -Clink-arg='Wl,--no-rosegment' is necessary to avoid lld putting an extra RO segment before the executable code, which would make the binary silently incompatible with create_llvm_prof.
2021-10-08Auto merge of #89646 - camelid:miri-up, r=RalfJungbors-7/+11
Update Miri Fixes #89612. r? `@RalfJung`
2021-10-07Auto merge of #89638 - rust-lang:revert-88548-intersperse, r=Mark-Simulacrumbors-0/+1
Revert "Stabilize `Iterator::intersperse()`" Reverts rust-lang/rust#88548 First step in resolving https://github.com/rust-lang/rust/issues/88967
2021-10-07Update MiriNoah Lev-7/+11
2021-10-07Auto merge of #89617 - flip1995:clippyup, r=Manishearthbors-2940/+4259
Update Clippy r? `@Manishearth`
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+15
2021-10-07Revert "Stabilize `Iterator::intersperse()`"Jane Lusby-0/+1
2021-10-07Auto merge of #89629 - GuillaumeGomez:rollup-s4r8me6, r=GuillaumeGomezbors-162/+502
Rollup of 7 pull requests Successful merges: - #89298 (Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers ) - #89461 (Add `deref_into_dyn_supertrait` lint.) - #89477 (Move items related to computing diffs to a separate file) - #89559 (RustWrapper: adapt for LLVM API change) - #89585 (Emit item no type error even if type inference fails) - #89596 (Make cfg imply doc(cfg)) - #89615 (Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-07Add wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavorHans Kratz-13/+184
The wrapper is installed as `ld` and `ld64` in the `lib\rustlib\<host_target>\bin\gcc-ld` directory and its sole purpose is to invoke `rust-lld` in the parent directory with the correct flavor.
2021-10-07Rollup merge of #89596 - GuillaumeGomez:implicit-doc-cfg, r=jyn514Guillaume Gomez-10/+199
Make cfg imply doc(cfg) This is a reopening of #79341, rebased and modified a bit (we made a lot of refactoring in rustdoc's types so they needed to be reflected in this PR as well): * `hidden_cfg` is now in the `Cache` instead of `DocContext` because `cfg` information isn't stored anymore on `clean::Attributes` type but instead computed on-demand, so we need this information in later parts of rustdoc. * I removed the `bool_to_options` feature (which makes the code a bit simpler to read for `SingleExt` trait implementation. * I updated the version for the feature. There is only one thing I couldn't figure out: [this comment](https://github.com/rust-lang/rust/pull/79341#discussion_r561855624) > I think I'll likely scrap the whole `SingleExt` extension trait as the diagnostics for 0 and >1 items should be different. How/why should they differ? EDIT: this part has been solved, the current code was fine, just needed a little simplification. cc `@Nemo157` r? `@jyn514` Original PR description: This is only active when the `doc_cfg` feature is active. The implicit cfg can be overridden via `#[doc(cfg(...))]`, so e.g. to hide a `#[cfg]` you can use something like: ```rust #[cfg(unix)] #[doc(cfg(all()))] pub struct Unix; ``` By adding `#![doc(cfg_hide(foobar))]` to the crate attributes the cfg `#[cfg(foobar)]` (and _only_ that _exact_ cfg) will not be implicitly treated as a `doc(cfg)` to render a message in the documentation.
2021-10-07Rollup merge of #89585 - nbdd0121:issue-89574, r=estebankGuillaume Gomez-10/+41
Emit item no type error even if type inference fails Fix #89574 The stashed error should be emitted regardless whether ty references error or not.
2021-10-07Rollup merge of #89477 - Nicholas-Baron:compute_diff_rs, r=Mark-SimulacrumGuillaume Gomez-142/+170
Move items related to computing diffs to a separate file Work towards #89475.
2021-10-07Rollup merge of #89461 - crlf0710:dyn_upcasting_lint, r=nikomatsakisGuillaume Gomez-0/+41
Add `deref_into_dyn_supertrait` lint. Initial implementation of #89460. Resolves #89190. Maybe also worth a beta backport if necessary. r? `@nikomatsakis`
2021-10-07Rollup merge of #89298 - gcohara:issue89193, r=workingjubileeGuillaume Gomez-0/+51
Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers closes #89193 r? `@workingjubilee`
2021-10-07Auto merge of #89534 - camsteffen:diag-name, r=oli-obkbors-0/+11
Introduce `tcx.get_diagnostic_name` Introduces a "reverse lookup" for diagnostic items. This is mainly intended for `@rust-lang/clippy` which often does a long series of `is_diagnostic_item` calls for the same `DefId`. r? `@oli-obk`
2021-10-07Add tests for panic and [debug_]assert in Rust 2021.Mara Bos-0/+125
2021-10-07Auto merge of #86525 - shamatar:array_len_opt, r=oli-obkbors-9/+690
Array `.len()` MIR optimization pass This pass kind-of works back the `[T; N].len()` call that at the moment is first coerced as `&[T; N]` -> `&[T]` and then uses `&[T].len()`. Depends on #86383
2021-10-07Remove untracked vtable-const-allocation cache from tcxMichael Woerister-0/+27
2021-10-07Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyupflip1995-2940/+4259
2021-10-06Auto merge of #89608 - Manishearth:rollup-m7kd76f, r=Manishearthbors-170/+530
Rollup of 12 pull requests Successful merges: - #87601 (Add functions to add unsigned and signed integers) - #88523 (Expand documentation for `FpCategory`.) - #89050 (refactor: VecDeques Drain fields to private) - #89245 (refactor: make VecDeque's IterMut fields module-private, not just crate-private) - #89324 (Rename `std::thread::available_conccurrency` to `std::thread::available_parallelism`) - #89329 (print-type-sizes: skip field printing for primitives) - #89501 (Note specific regions involved in 'borrowed data escapes' error) - #89506 (librustdoc: Use correct heading levels.) - #89528 (Fix suggestion to borrow when casting from pointer to reference) - #89531 (library std, libc dependency update) - #89588 (Add a test for generic_const_exprs) - #89591 (fix: alloc-optimisation is only for rust llvm) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-06Enable AutoFDO.Michael Benfield-0/+45
This largely involves implementing the options debug-info-for-profiling and profile-sample-use and forwarding them on to LLVM. AutoFDO can be used on x86-64 Linux like this: rustc -O -Cdebug-info-for-profiling main.rs -o main perf record -b ./main create_llvm_prof --binary=main --out=code.prof rustc -O -Cprofile-sample-use=code.prof main.rs -o main2 Now `main2` will have feedback directed optimization applied to it. The create_llvm_prof tool can be obtained from this github repository: https://github.com/google/autofdo Fixes #64892.
2021-10-06Rollup merge of #89591 - infinity0:master, r=AmanieuManish Goregaokar-0/+1
fix: alloc-optimisation is only for rust llvm As discussed at the bottom of #83485. On a separate note I'll take this chance ask, is it worth pulling in that patch (to recognise `__rust_dealloc`) into Debian's system LLVM? The main factors for us to consider would be (1) is the optimisation significant and (2) is there not any significant negative impact to non-rust packages that use LLVM.
2021-10-06Rollup merge of #89588 - BoxyUwU:add_a_test_uwu, r=lcnrManish Goregaokar-0/+29
Add a test for generic_const_exprs Test that const_eval_resolve evaluates consts with unused inference vars in substs r? ``@lcnr``
2021-10-06Rollup merge of #89528 - FabianWolff:issue-89497, r=jackh726Manish Goregaokar-6/+44
Fix suggestion to borrow when casting from pointer to reference Fixes #89497.
2021-10-06Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomezManish Goregaokar-122/+264
librustdoc: Use correct heading levels. Closes #89309 This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy. - I ran a script to manually check that we don't have any files with multiple `<h1>` tags. - Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`. - I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
2021-10-06Rollup merge of #89501 - Aaron1011:escaping-name-regions, r=davidtwcoManish Goregaokar-39/+188
Note specific regions involved in 'borrowed data escapes' error Fixes #67007 Currently, a 'borrowed data escapes' error does not mention the specific lifetime involved (except indirectly through a suggestion about adding a lifetime bound). We now explain the specific lifetime relationship that failed to hold, which improves otherwise vague error messages.
2021-10-06Rollup merge of #89329 - tmiasko:print-type-sizes-no-fields, r=jackh726Manish Goregaokar-1/+2
print-type-sizes: skip field printing for primitives Fixes #86528.
2021-10-06Rollup merge of #89324 - yoshuawuyts:hardware-parallelism, r=m-ou-seManish Goregaokar-2/+2
Rename `std::thread::available_conccurrency` to `std::thread::available_parallelism` _Tracking issue: https://github.com/rust-lang/rust/issues/74479_ This PR renames `std::thread::available_conccurrency` to `std::thread::available_parallelism`. ## Rationale The API was initially named `std::thread::hardware_concurrency`, mirroring the [C++ API of the same name](https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency). We eventually decided to omit any reference to the word "hardware" after [this comment](https://github.com/rust-lang/rust/pull/74480#issuecomment-662045841). And so we ended up with `available_concurrency` instead. --- For a talk I was preparing this week I was reading through ["Understanding and expressing scalable concurrency" (A. Turon, 2013)](http://aturon.github.io/academic/turon-thesis.pdf), and the following passage stood out to me (emphasis mine): > __Concurrency is a system-structuring mechanism.__ An interactive system that deals with disparate asynchronous events is naturally structured by division into concurrent threads with disparate responsibilities. Doing so creates a better fit between problem and solution, and can also decrease the average latency of the system by preventing long-running computations from obstructing quicker ones. > __Parallelism is a resource.__ A given machine provides a certain capacity for parallelism, i.e., a bound on the number of computations it can perform simultaneously. The goal is to maximize throughput by intelligently using this resource. For interactive systems, parallelism can decrease latency as well. _Chapter 2.1: Concurrency is not Parallelism. Page 30._ --- _"Concurrency is a system-structuring mechanism. Parallelism is a resource."_ — It feels like this accurately captures the way we should be thinking about these APIs. What this API returns is not "the amount of concurrency available to the program" which is a property of the program, and thus even with just a single thread is effectively unbounded. But instead it returns "the amount of _parallelism_ available to the program", which is a resource hard-constrained by the machine's capacity (and can be further restricted by e.g. operating systems). That's why I'd like to propose we rename this API from `available_concurrency` to `available_parallelism`. This still meets the criteria we previously established of not attempting to define what exactly we mean by "hardware", "threads", and other such words. Instead we only talk about "concurrency" as an abstract resource available to our program. r? `@joshtriplett`
2021-10-06Simplify AttributesExt::cfg function and remove error emissions since they ↵Guillaume Gomez-27/+45
are not useful
2021-10-06Bless testsCameron Steffen-0/+11
2021-10-06opt-level >= 4Alexander-1/+1
2021-10-06Clean up code a bit:Guillaume Gomez-8/+16
* Remove "bool_to_options" feature * Update version for compiler feature * rustfmt
2021-10-06Do not re-hash foreign spans.Camille GILLOT-0/+11
2021-10-06run remaining testsAlexander-9/+17
2021-10-06tidyAlexander-1/+1
2021-10-06Get rid of broken `ct-ng oldconfig` everywhere and directly provide a ↵Hans Kratz-20/+8
suitable .config file.
2021-10-06add MIR artifactsAlexander-3/+626
2021-10-06reset and cleanupAlexander-0/+50
2021-10-06Switch to our own mirror of libislMark Rousskov-4/+4
2021-10-06Revert the rustc_error_codes changes.Mukund Lakshman-3/+3
2021-10-06Restore h1 styles, which got accidentally removed.Mukund Lakshman-3/+3
2021-10-06fix: alloc-optimisation is only for rust llvmXimin Luo-0/+1