about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-06-18bless youRalf Jung-836/+340
2021-06-18make UB during CTFE a hard errorRalf Jung-0/+1
2021-06-18Auto merge of #86428 - RalfJung:miri, r=RalfJungbors-75/+8
update Miri Fixes https://github.com/rust-lang/rust/issues/86409
2021-06-18update MiriRalf Jung-75/+8
2021-06-18Auto merge of #86322 - trinity-1686a:rustdoc-fix-overflow-recursive-deref, ↵bors-13/+44
r=jyn514 fix rustdoc stack overflow on mutually recursive Deref fix #85095 fix #85037
2021-06-18Auto merge of #85284 - eggyal:custom-profiler-runtime, r=jackh726bors-22/+28
Provide option for specifying the profiler runtime Currently, if `-Zinstrument-coverage` is enabled, the target is linked against the `library/profiler_builtins` crate (which pulls in LLVM's compiler-rt runtime). This option enables backends to specify an alternative runtime crate for handling injected instrumentation calls.
2021-06-18Auto merge of #86385 - JohnTitor:use-attrvec, r=davidtwcobors-16/+16
Use `AttrVec` for `Arm`, `FieldDef`, and `Variant` Uses `AttrVec` for `Arm`, `FieldDef`, and `Variant`, i.e., where the size of the vector can be empty often. Skips `Crate` and `Item` because I think they may have the attributes on common cases and need more work outside of `rustc_ast` (e.g. rustc_expand needs a lot of tweaks). But if it's reasonable to change, I'm happy to do so. Fixes #77662
2021-06-17Auto merge of #86417 - m-ou-se:rollup-vo2y1rz, r=m-ou-sebors-112/+320
Rollup of 6 pull requests Successful merges: - #85925 (Linear interpolation) - #86202 (Specialize `io::Bytes::size_hint` for more types) - #86357 (Rely on libc for correct integer types in os/unix/net/ancillary.rs.) - #86388 (Make `s` pre-interned) - #86401 (Fix ICE when using `#[doc(keyword = "...")]` on non-items) - #86405 (Add incr-comp note for 1.53.0 relnotes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-17Rollup merge of #86405 - rust-lang:pnkfelix-incr-comp-rel-note, ↵Mara Bos-0/+1
r=Mark-Simulacrum Add incr-comp note for 1.53.0 relnotes
2021-06-17Rollup merge of #86401 - FabianWolff:issue-83512, r=LeSeulArtichautMara Bos-3/+20
Fix ICE when using `#[doc(keyword = "...")]` on non-items This pull request fixes #83512. The code for checking attributes calls `expect_item()` when it shouldn't, thus causing an ICE. I have implemented a proper check for the node kind, so that an error is reported instead of the ICE.
2021-06-17Rollup merge of #86388 - JohnTitor:static-symbol-s, r=LeSeulArtichautMara Bos-6/+2
Make `s` pre-interned Now we should be able to pre-intern `s` as the test `ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs` no longer fails.
2021-06-17Rollup merge of #86357 - de-vri-es:simplify-repeated-cfg-ifs, r=m-ou-seMara Bos-100/+10
Rely on libc for correct integer types in os/unix/net/ancillary.rs. This PR is a small maintainability improvement. It simplifies `unix/net/ancillary.rs` in `std` by removing the `cfg_ifs` for casting to the correct integer type, and just rely on libc to define the struct correctly.
2021-06-17Rollup merge of #86202 - a1phyr:spec_io_bytes_size_hint, r=m-ou-seMara Bos-3/+96
Specialize `io::Bytes::size_hint` for more types Improve the result of `<io::Bytes as Iterator>::size_hint` for some readers. I did not manage to specialize `SizeHint` for `io::Cursor` Side question: would it be interesting for `io::Read` to have an optional `size_hint` method ?
2021-06-17Rollup merge of #85925 - clarfonthey:lerp, r=m-ou-seMara Bos-0/+191
Linear interpolation #71016 is a previous attempt at implementation that was closed by the author. I decided to reuse the feature request issue (#71015) as a tracking issue. A member of the rust-lang org will have to edit the original post to be formatted correctly as I am not the issue's original author. The common name `lerp` is used because it is the term used by most code in a wide variety of contexts; it also happens to be the recently chosen name of the function that was added to C++20. To ensure symmetry as a method, this breaks the usual ordering of the method from `lerp(a, b, t)` to `t.lerp(a, b)`. This makes the most sense to me personally, and there will definitely be discussion before stabilisation anyway. Implementing lerp "correctly" is very dififcult even though it's a very common building-block used in all sorts of applications. A good prior reading is [this proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0811r2.html#linear-interpolation) for the C++20 lerp which talks about the various guarantees, which I've simplified down to: 1. Exactness: `(0.0).lerp(start, end) == start` and `(1.0).lerp(start, end) == end` 2. Consistency: `anything.lerp(x, x) == x` 3. Monotonicity: once you go up don't go down Fun story: the version provided in that proposal, from what I understand, isn't actually monotonic. I messed around with a *lot* of different lerp implementations because I kind of got a bit obsessed and I ultimately landed on one that uses the fused `mul_add` instruction. Floating-point lerp lore is hard to come by, so, just trust me when I say that this ticks all the boxes. I'm only 90% certain that it's monotonic, but I'm sure that people who care deeply about this will be there to discuss before stabilisation. The main reason for using `mul_add` is that, in general, it ticks more boxes with fewer branches to be "correct." Although it will be slower on architectures without the fused `mul_add`, that's becoming more and more rare and I have a feeling that most people who will find themselves needing `lerp` will also have an efficient `mul_add` instruction available.
2021-06-17Auto merge of #86392 - JohnTitor:use-partition-point, r=petrochenkovbors-47/+5
Prefer `partition_point` to look up assoc items Since we now have `partition_point` (instead of `equal_range`), I think it's worth trying to use it instead of manually finding it. `partition_point` uses `binary_search_by` internally (#85406) and its performance has been improved (#74024), so I guess this will make a performance difference.
2021-06-17Auto merge of #83572 - pkubaj:patch-1, r=nagisabors-0/+18
Add support for powerpc64le-unknown-freebsd
2021-06-17Update RELEASES.mdFelix S Klock II-0/+1
2021-06-17Move regression test for #83512 into doc_keyword.rsFabian Wolff-19/+15
2021-06-17Auto merge of #86399 - JohnTitor:rollup-qlm2dvz, r=JohnTitorbors-318/+406
Rollup of 7 pull requests Successful merges: - #85663 (Document Arc::from) - #85802 (Rename IoSlice(Mut)::advance to advance_slice and add IoSlice(Mut)::advance) - #85970 (Remove methods under Implementors on trait pages) - #86340 (Use better error message for hard errors in CTFE) - #86343 (Do not emit invalid suggestions on multiple mutable borrow errors) - #86355 (Remove invalid suggestions for assoc consts on placeholder type error) - #86389 (Make `sum()` and `product()` documentation hyperlinks refer to `Iterator` methods.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-17Fix ICE when using `#[doc(keyword = "...")]` on non-itemsFabian Wolff-2/+23
2021-06-17Rely on libc for correct integer types in os/unix/net/ancillary.rs.Maarten de Vries-100/+10
2021-06-17Rollup merge of #86389 - kpreid:sum, r=scottmcmYuki Okushi-10/+8
Make `sum()` and `product()` documentation hyperlinks refer to `Iterator` methods. The previous linking seemed confusing: within "the sum() method on iterators", "sum()" was linked to `Sum::sum`, not `Iterator::sum`, even though the sentence is talking about the latter. I have rewritten the sentence to be, I believe, clearer, as well as changing the link destinations; applying the same change to the `Product` documentation as well as `Sum`. I reviewed other traits in the same module and did not see similar issues, and previewed the results using `./x.py doc library/std`.
2021-06-17Rollup merge of #86355 - JohnTitor:issue-82158, r=estebankYuki Okushi-10/+51
Remove invalid suggestions for assoc consts on placeholder type error Fixes #82158 This also moves some tests to typeck. r? ``@estebank``
2021-06-17Rollup merge of #86343 - JohnTitor:issue-85581, r=estebankYuki Okushi-8/+58
Do not emit invalid suggestions on multiple mutable borrow errors Fixes #85581
2021-06-17Rollup merge of #86340 - Smittyvb:ctfe-hard-error-message, r=RalfJungYuki Okushi-107/+80
Use better error message for hard errors in CTFE I noticed this while working on #86255: currently the same message is used for hard errors and soft errors in CTFE. This changes the error messages to make hard errors use a message that indicates the reality of the situation correctly, since usage of the constant is never allowed when there was a hard error evaluating it. This doesn't affect the behaviour of these error messages, only the content. This changes the error logic to check if the error should be hard or soft where it is generated, instead of where it is emitted, to allow this distinction in error messages.
2021-06-17Rollup merge of #85970 - jsha:remove-methods-implementors, r=GuillaumeGomezYuki Okushi-153/+114
Remove methods under Implementors on trait pages As discussed at https://github.com/rust-lang/rust/issues/84326#issuecomment-842652412. On a trait page, the "Implementors" section currently lists all methods of each implementor. That duplicates the method definitions on the trait itself, and is usually not very useful. So the implementors are collapsed by default. This PR changes rustdoc to just not render them at all. Any documentation specific to an implementor can be found by clicking through to the implementor's page. This moves the "portability" info inside the `<summary>` tags so it is still visible on trait pages (as originally implemented in #79201). That also means it will be visible on struct/enum pages when methods are collapsed. Add `#[doc(hidden)]` to all implementations of `Iterator::__iterator_get_unchecked` that didn't already have it. Otherwise, due to #86145, the structs/enums with those implementations would generate documentation for them, and that documentation would have a broken link into the Iterator page. Those links were already "broken" but not detected by the link-checker, because they pointed to one of the Implementors on the Iterator page, which happened to have the right anchor name. This reduces the Read trait's page size from 128kB to 68kB (uncompressed) and from 12,125 bytes to 9,989 bytes (gzipped Demo: https://hoffman-andrews.com/rust/remove-methods-implementors/std/string/struct.String.html#trait-implementations https://hoffman-andrews.com/rust/remove-methods-implementors/std/io/trait.Read.html#implementors r? `@GuillaumeGomez`
2021-06-17Rollup merge of #85802 - Thomasdezeeuw:ioslice-advance, r=m-ou-seYuki Okushi-30/+81
Rename IoSlice(Mut)::advance to advance_slice and add IoSlice(Mut)::advance Also changes the signature of `advance_slice` to accept a `&mut &mut [IoSlice]`, not returning anything. This will better match the `IoSlice::advance` function. Updates https://github.com/rust-lang/rust/issues/62726.
2021-06-17Rollup merge of #85663 - fee1-dead:document-arc-from, r=m-ou-seYuki Okushi-0/+14
Document Arc::from
2021-06-17Auto merge of #85755 - b-naber:unexpected_concrete_region, r=nikomatsakisbors-73/+49
Replace parent substs of associated types with inference vars in borrow checker Fixes https://github.com/rust-lang/rust/issues/83190 Fixes https://github.com/rust-lang/rust/issues/78450 When we normalize an associated type that refers to an opaque type, it can happen that the substs of the associated type do not occur in the projection (they are parent substs). We previously didn't replace those substs with inference vars, which left a concrete region after all regions should have already been replaced with inference vars and triggered a `delay_span_bug`. After we normalize the opaque type, we now try to replace any remaining concrete regions with inference vars.
2021-06-17Early return from `inject_profiler_runtime`Alan Egerton-23/+23
2021-06-17Fix typos in code examples.Mara Bos-2/+2
2021-06-17use to_region_vid in opaque type codeNiko Matsakis-33/+13
Normalization can pull in named regions from the parameter environment. We need to be prepared for that in the opaque types code.
2021-06-17Auto merge of #85834 - cjgillot:save-sbi, r=michaelwoeristerbors-71/+40
Encode CrateNum using the StableCrateId for incr. comp.
2021-06-17Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwcobors-68/+217
Handle C-variadic arguments properly when reporting region errors This pull request fixes #86053. The issue is that for a C-variadic function ```rust #![feature(c_variadic)] unsafe extern "C" fn foo(_: (), ...) {} ``` `foo`'s signature will contain only the first parameter (and have `c_variadic` set to `true`), whereas its body has a second argument (a `hir::Pat` for the `...`). The code for reporting region errors iterates over the body's parameters and tries to fetch the corresponding parameter from the signature; this causes an out-of-bounds ICE for the `...` (though not in the example above, because there are no region errors to report). I have simply restricted the iteration over the body parameters to exclude `...`, which is fine because `...` cannot cause a region error.
2021-06-16Restore details for Impls on Foreign TypesJacob Hoffman-Andrews-4/+10
These were previously removed along with the details in the "Implementors" section of trait pages. But for "Implementations on Foreign Types," we need to include the details because they will not be documented anywhere else.
2021-06-16Fix target highlighting in rustdoc.Jacob Hoffman-Andrews-48/+38
Also factor out outer_version and const_outer_version into render_rightside.
2021-06-16Move anchor earlier in the DOM for easier layoutJacob Hoffman-Andrews-8/+11
2021-06-16Factor out render_rightsideJacob Hoffman-Andrews-54/+30
This covers rendering of stability_since and the srclink across methods and trait implementations, so their DOM representation is consistent.
2021-06-16Make portability part of the summary.Jacob Hoffman-Andrews-21/+27
That means it will be visible under "Implementors" on trait pages, and under "Implementations" on struct/enum pages, even when all methods are collapsed. Switch to a float layout for rightside elements.
2021-06-16Add doc(hidden) to all __iterator_get_uncheckedJacob Hoffman-Andrews-0/+15
This method on the Iterator trait is doc(hidden), and about half of implementations were doc(hidden). This adds the attribute to the remaining implementations.
2021-06-16Use render_impl_summary when rendering traits.Jacob Hoffman-Andrews-43/+29
2021-06-16Remove methods under Implementors on trait pagesJacob Hoffman-Andrews-42/+21
These were hidden by default, and duplicated information already on the page anyhow. Also remove the "Auto-hide trait implementors of a trait" setting, which is not needed anymore.
2021-06-17Prefer `partition_point` to look up assoc itemsYuki Okushi-47/+5
2021-06-17Auto merge of #86380 - cuviper:1.53-compat-bits, r=Mark-Simulacrumbors-1/+5
Add a compatibility note for BITS in 1.53 Closes #85667 r? `@Mark-Simulacrum`
2021-06-16Make `sum()` and `product()` hyperlinks refer to `Iterator` methods.Kevin Reid-10/+8
The previous linking seemed confusing: within "the sum() method on iterators", "sum()" was linked to `Sum::sum`, not `Iterator::sum`, even though the sentence is talking about the latter. I have rewritten the sentence to be, I believe, clearer, as well as changing the link destinations; applying the same change to the `Product` documentation as well as `Sum`.
2021-06-17Make `s` pre-internedYuki Okushi-6/+2
2021-06-17Use `AttrVec` for `Arm`, `FieldDef`, and `Variant`Yuki Okushi-16/+16
2021-06-16Auto merge of #86379 - JohnTitor:rollup-mkz9x36, r=JohnTitorbors-63/+136
Rollup of 10 pull requests Successful merges: - #85870 (Allow whitespace in dump_mir filter) - #86104 (Fix span calculation in format strings) - #86140 (Mention the `Borrow` guarantee on the `Hash` implementations for Arrays and `Vec`) - #86141 (Link reference in `dyn` keyword documentation) - #86260 (Open trait implementations' toggles by default.) - #86339 (Mention #79078 on compatibility notes of 1.52) - #86341 (Stop returning a value from `report_assert_as_lint`) - #86353 (Remove `projection_ty_from_predicates`) - #86361 (Add missing backslashes to prevent unwanted newlines in rustdoc HTML) - #86372 (Typo correction: s/is/its) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-16Move some hard error logic to InterpErrorSmitty-15/+27
2021-06-16Add a compatibility note for BITS in 1.53Josh Stone-1/+5