Commit Graph

156990 Commits

Author SHA1 Message Date
Jakob Degen
958e645946 Adds hint if a trait fails to resolve and a newly added one in Edition 2021 is suggested 2021-10-26 22:17:01 -04:00
Jakob Degen
e91d5ca197 Add test checking that Edition 2021 is suggested for .try_into() and fix other test 2021-10-26 22:17:01 -04:00
Jakob Degen
3876753668 Add diagnostic in case of failed .try_into() method call pre-Edition 2021 2021-10-26 22:17:01 -04:00
bors
e269e6bf47 Auto merge of #90314 - matthiaskrgr:rollup-ag1js8n, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #90296 (Remove fNN::lerp)
 - #90302 (Remove unneeded into_iter)
 - #90303 (Add regression test for issue 90164)
 - #90305 (Add regression test for #87258)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-26 17:50:46 +00:00
Matthias Krüger
fcc9a9a928
Rollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-Simulacrum
Add regression test for #87258

Closes #87258.
2021-10-26 19:32:46 +02:00
Matthias Krüger
40d3819a3c
Rollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitor
Add regression test for issue 90164

Closes #90164 (previously fixed by #90181)
2021-10-26 19:32:45 +02:00
Matthias Krüger
76392fbaf3
Rollup merge of #90302 - GuillaumeGomez:rm-unneeded-into_iter, r=jyn514
Remove unneeded into_iter

As ``@camelid`` mentionned [here](https://github.com/rust-lang/rust/pull/89430#discussion_r735889324), the `into_iter` was unneeded.

r? ``@camelid``
2021-10-26 19:32:44 +02:00
Matthias Krüger
8871fe8bda
Rollup merge of #90296 - CAD97:rip-lerp, r=Mark-Simulacrum
Remove fNN::lerp

Lerp is [surprisingly complex with multiple tradeoffs depending on what guarantees you want to provide](https://github.com/rust-lang/rust/issues/86269#issuecomment-869108301) (and what you're willing to drop for raw speed), so we don't have consensus on what implementation to use, let alone what signature - `t.lerp(a, b)` nicely puts `a, b` together, but makes dispatch to lerp custom types with the same signature basically impossible, and major ecosystem crates (e.g. nalgebra, glium) use `a.lerp(b, t)`, which is easily confusable. It was suggested to maybe provide a `Lerp<T>` trait and `t.lerp([a, b])`, which _could_ be implemented by downstream math libraries for their types, but also significantly raises the bar from a simple fNN method to a full trait, and does nothing to solve the implementation question. (It also raises the question of whether we'd support higher-order bezier interpolation.)

The only consensus we have is the lack of consensus, and the [general temperature](https://github.com/rust-lang/rust/issues/86269#issuecomment-951347135) is that we should just remove this method (giving the method space back to 3rd party libs) and revisit this if (and likely only if) IEEE adds lerp to their specification.

If people want a lerp, they're _probably_ already using (or writing) a math support library, which provides a lerp function for its custom math types and can provide the same lerp implementation for the primitive types via an extension trait.

See also [previous Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/lerp.20API.20design)

cc ``@clarfonthey`` (original PR author), ``@m-ou-se`` (original r+), ``@scottmcm`` (last voice in tracking issue, prompted me to post this)

Closes #86269 (removed)
2021-10-26 19:32:44 +02:00
bors
612356aa9a Auto merge of #90290 - nyanpasu64:fix-string-as-mut-vec, r=m-ou-se
Fix copy-paste error in String::as_mut_vec() docs

Did not expect the comments to be perfectly justified... can't wait to be told to change it to `Vec<u8>`, which destroys the justification 😼
2021-10-26 14:44:47 +00:00
Bram van den Heuvel
f9344296c1 Add regression test for #87258 2021-10-26 16:35:48 +02:00
bors
3c8f001d45 Auto merge of #90284 - tonyyzy:patch-1, r=JohnTitor
Remove redundant Aligner

The `Aligner` struct seems to be unnecessary.
Previously noted by `@arthurprs` https://github.com/rust-lang/rust/pull/44963#discussion_r145340754
Reddit discussion: https://www.reddit.com/r/rust/comments/pfvvz2/aligner_and_cachealigned/
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa7ca554922755f9d1b62b017d785c6f
2021-10-26 11:45:13 +00:00
Tony Yang
f54663767d
Remove redundant Aligner
The `Aligner` struct seems to be unnecessary.
Previously noted by @arthurprs https://github.com/rust-lang/rust/pull/44963#discussion_r145340754
Reddit discussion: https://www.reddit.com/r/rust/comments/pfvvz2/aligner_and_cachealigned/
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa7ca554922755f9d1b62b017d785c6f
2021-10-26 11:34:03 +01:00
Maybe Waffle
60ffac07cb Add regression test for issue 90164 2021-10-26 13:23:27 +03:00
Guillaume Gomez
cdee839696 Remove unneeded into_iter 2021-10-26 11:50:52 +02:00
bors
c7a30c8b68 Auto merge of #90075 - pierwill:fix-79717, r=petrochenkov
Edit error messages for `rustc_resolve::AmbiguityKind` variants

Edit the language of the ambiguity descriptions for E0659. These strings now appear as notes.

Closes #79717.
2021-10-26 07:57:51 +00:00
nyanpasu64
6b90c0f1b4 Fix copy-paste error in String::as_mut_vec() docs 2021-10-25 23:22:57 -07:00
bors
1b61b1b445 Auto merge of #90299 - matthiaskrgr:rollup-n77ntld, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #90181 (fix(rustc_typeck): report function argument errors on matching type)
 - #90241 (Make thiscall abi on unsupported platforms a hard error)
 - #90294 (Update books)
 - #90295 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-26 04:44:51 +00:00
Matthias Krüger
897b5dfeee
Rollup merge of #90295 - ehuss:update-cargo, r=ehuss
Update cargo

4 commits in 7fbbf4e8f23e3c24b8afff541dcb17e53eb5ff88..6c1bc24b8b49d4bc965f67d7037906dc199c72b7
2021-10-19 02:16:48 +0000 to 2021-10-24 17:51:41 +0000
- Fix a clippy warning (rust-lang/cargo#10002)
- Upgrade Cargo to the 2021 edition (rust-lang/cargo#10000)
- Don't canonicalize executable path (rust-lang/cargo#9991)
- Bump to 0.59.0, update changelog (rust-lang/cargo#9998)
2021-10-26 06:14:09 +02:00
Matthias Krüger
02a06ad7f4
Rollup merge of #90294 - ehuss:update-books, r=ehuss
Update books

## nomicon

3 commits in 2d66852a27c5d0ec50ae021820d1de22caa2b1bd..358e6a61d5f4f0496d0a81e70cdcd25d05307342
2021-10-07 19:00:37 +0900 to 2021-10-20 11:23:12 -0700
- Write a basic "call Rust from C" example (rust-lang/nomicon#296)
- Clarify the Safe vs. Unsafe Rust relationship (rust-lang/nomicon#294)
- Fix typo with respect to dangling pointer (rust-lang/nomicon#319)

## book

8 commits in eb1282ec444db94055fa9531b6f3f803e86bb382..fd9299792852c9a368cb236748781852f75cdac6
2021-09-16 21:17:09 -0400 to 2021-10-22 21:59:46 -0400
- Reword description to emphasize what return does in a match arm
- Correct backwards wording describing From impls. Fixes rust-lang/book#2829
- Remove multiple negatives, add examples. Fixes rust-lang/book#2833
- Fix capitalization in sidebar. Fixes rust-lang/book#2860
- fix quotes
- comments from nostarch and responses for chapter 2
-  (rust-lang/book#2906)
- Merge pull request rust-lang/book#2892 from Enrico2/patch-1

## rust-by-example

1 commits in 9a60624fcad0140826c44389571dc622917cd632..27f1ff5e440ef78828b68ab882b98e1b10d9af32
2021-10-04 08:13:53 -0300 to 2021-10-13 08:04:40 -0300
- Added example of `impl Trait` as an argument (rust-lang/rust-by-example#1468)

## embedded-book

1 commits in 270fccd339e5972d9c900e788f197e81a0bcd956..51739471276b1776dea27cf562b974ef07e24685
2021-10-06 16:28:48 +0000 to 2021-10-17 16:48:42 +0000
- Fix typo in 'The Borrow Checker'  (rust-embedded/book#305)
2021-10-26 06:14:08 +02:00
Matthias Krüger
fc8df9b0b8
Rollup merge of #90241 - DrMeepster:thiscall_lint_upgrade, r=petrochenkov
Make thiscall abi on unsupported platforms a hard error

As suggested in https://github.com/rust-lang/rust/issues/42202#issuecomment-950205016, this PR makes use of the `thiscall` abi on unsupported a hard error instead of a lint.
2021-10-26 06:14:07 +02:00
Matthias Krüger
b0df3af5c3
Rollup merge of #90181 - notriddle:notriddle/error-pointer, r=estebank
fix(rustc_typeck): report function argument errors on matching type

Fixes #90101
2021-10-26 06:14:06 +02:00
CAD97
6b449b49bb Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
Eric Huss
5001cd04a8 Update cargo 2021-10-25 20:30:21 -07:00
Eric Huss
f4c0513f33 Update books 2021-10-25 19:51:09 -07:00
pierwill
7de1ff1ba8 Edit error messages for rustc_resolve::AmbiguityKind variants
Emit description of the ambiguity as a note.

Co-authored-by: Noah Lev <camelidcamel@gmail.com>
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2021-10-25 20:33:07 -05:00
bors
17e13b549f Auto merge of #85830 - bjorn3:separate_provide_extern, r=cjgillot
Avoid a branch on key being local for queries that use the same local and extern providers

Currently based on https://github.com/rust-lang/rust/pull/85810 as it slightly conflicts with it. Only the last two commits are new.
2021-10-26 00:38:58 +00:00
DrMeepster
a46daf050b make thiscall on unsupported platforms an error 2021-10-25 14:56:21 -07:00
bors
ffba430924 Auto merge of #90282 - matthiaskrgr:rollup-c6trbff, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #89581 (Add -Z no-unique-section-names to reduce ELF header bloat.)
 - #90196 (Fix and extent ControlFlow `traverse_inorder` example)
 - #90255 (⬆️ rust-analyzer)
 - #90266 (Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-25 21:33:13 +00:00
Matthias Krüger
26e9a719f2
Rollup merge of #90266 - b-naber:uneval_substs, r=lcnr
Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated

Fixes https://github.com/rust-lang/rust/issues/89334

The changes introduced in https://github.com/rust-lang/rust/pull/87280 allowed for "duplicate" caller bounds candidates to be assembled that only differed in their default substs having been "exposed" or not and resulted in an ambiguity error during trait selection. To fix this we expose the defaults substs during the creation of the ParamEnv.

r? `@lcnr`
2021-10-25 22:59:49 +02:00
Matthias Krüger
d35ecb949e
Rollup merge of #90255 - lnicola:rust-analyzer-2021-10-25, r=lnicola
⬆️ rust-analyzer

r? ~~``@ghose~~`` sorry, ``@ghost``
2021-10-25 22:59:48 +02:00
Matthias Krüger
14931b94a2
Rollup merge of #90196 - yanok:master, r=scottmcm
Fix and extent ControlFlow `traverse_inorder` example

Fix and extent ControlFlow `traverse_inorder` example

1. The existing example compiles on its own, but any usage fails to be monomorphised and so doesn't compile. Fix that by using Fn trait instead of FnMut.
2. Added an example usage of `traverse_inorder` showing how we can terminate the traversal early.

Fixes #90063
2021-10-25 22:59:47 +02:00
Matthias Krüger
2f67647606
Rollup merge of #89581 - jblazquez:master, r=Mark-Simulacrum
Add -Z no-unique-section-names to reduce ELF header bloat.

This change adds a new compiler flag that can help reduce the size of ELF binaries that contain many functions.

By default, when enabling function sections (which is the default for most targets), the LLVM backend will generate different section names for each function. For example, a function `func` would generate a section called `.text.func`. Normally this is fine because the linker will merge all those sections into a single one in the binary. However, starting with [LLVM 12](https://github.com/llvm/llvm-project/commit/ee5d1a04), the backend will also generate unique section names for exception handling, resulting in thousands of `.gcc_except_table.*` sections ending up in the final binary because some linkers like LLD don't currently merge or strip these EH sections (see discussion [here](https://reviews.llvm.org/D83655)). This can bloat the ELF headers and string table significantly in binaries that contain many functions.

The new option is analogous to Clang's `-fno-unique-section-names`, and instructs LLVM to generate the same `.text` and `.gcc_except_table` section for each function, resulting in a smaller final binary.

The motivation to add this new option was because we have a binary that ended up with so many ELF sections (over 65,000) that it broke some existing ELF tools, which couldn't handle so many sections.

Here's our old binary:

```
$ readelf --sections old.elf | head -1
There are 71746 section headers, starting at offset 0x2a246508:

$ readelf --sections old.elf | grep shstrtab
  [71742] .shstrtab      STRTAB          0000000000000000 2977204c ad44bb 00      0   0  1
```

That's an 11MB+ string table. Here's the new binary using this option:

```
$ readelf --sections new.elf | head -1
There are 43 section headers, starting at offset 0x29143ca8:

$ readelf --sections new.elf | grep shstrtab
  [40] .shstrtab         STRTAB          0000000000000000 29143acc 0001db 00      0   0  1
```

The whole binary size went down by over 20MB, which is quite significant.
2021-10-25 22:59:46 +02:00
Michael Howell
8520105464 fix(rustc_typeck): report function argument errors on matching type
Fixes #90101
2021-10-25 12:23:52 -07:00
bors
29b1248025 Auto merge of #89430 - GuillaumeGomez:rustdoc-clippy-lints, r=jyn514,camelid,notriddle
Fix clippy lints in librustdoc

I ran clippy on librustdoc and simply fixed the lints. :)

r? `@notriddle`
2021-10-25 18:24:33 +00:00
bors
84c2a8505d Auto merge of #90265 - GuillaumeGomez:rollup-gx3ficp, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #90017 (Add a couple tests for normalize under binder issues)
 - #90079 (enable `i8mm` target feature on aarch64 and arm)
 - #90233 (Tooltip overflow)
 - #90257 (Changed slice.swap documentation for better readability)
 - #90261 (Move back to linux builder on try builds)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-25 14:40:45 +00:00
Guillaume Gomez
21af58173f
Rollup merge of #90261 - Mark-Simulacrum:fix-try, r=pietroalbini
Move back to linux builder on try builds

Apparently deleted the wrong line when trying to revert changes to try in #90100 which I now see still contains the do not merge commit -- maybe I forgot to force push the local changes I had pending or something.

r? `@pietroalbini`
2021-10-25 16:34:55 +02:00
Guillaume Gomez
3697624e01
Rollup merge of #90257 - zommiommy:patch-1, r=m-ou-se
Changed slice.swap documentation for better readability

The example exchanges the letters "b" and "d", these can be easily confused and are hard to read for people with dyslexia.
Therefore, I changed the example to a more easily readable one.

This is just a small fix and it's not urgent by any means, but I spent 5 minutes trying to understand why I couldn't see any change so I fixed it.

Anyway, thank you for all your works!
2021-10-25 16:34:54 +02:00
Guillaume Gomez
6c0dcb41bd
Rollup merge of #90233 - GuillaumeGomez:tooltip-overflow, r=camelid
Tooltip overflow

Fixes #89185.

r? ``@camelid``
2021-10-25 16:34:53 +02:00
Guillaume Gomez
bd48b9975a
Rollup merge of #90079 - SparrowLii:i8mm, r=Amanieu
enable `i8mm` target feature on aarch64 and arm

As in https://github.com/rust-lang/stdarch/issues/1233, `i8mm` needs to be turned on to support the implementation of `vmmla` and `vusmmla`neon instructions in stdarch.
r? ``@Amanieu``
2021-10-25 16:34:52 +02:00
Guillaume Gomez
2d85c7eea0
Rollup merge of #90017 - jackh726:issue-tests, r=nikomatsakis
Add a couple tests for normalize under binder issues

Closes #56556
Closes #76956

r? ``@nikomatsakis``
2021-10-25 16:34:52 +02:00
b-naber
0199a81304 add tests 2021-10-25 16:05:03 +02:00
b-naber
c6b69017e2 expose default substs in param_env 2021-10-25 16:04:57 +02:00
Mark Rousskov
00bca4e957 Move back to linux builder on try builds 2021-10-25 09:38:24 -04:00
bjorn3
13abc1ae30 Fix test 2021-10-25 15:15:05 +02:00
Tommaso Fontana
9b28ab40ac
Fixed missing double quote in the patch (slice.swap) 2021-10-25 14:13:54 +02:00
Tommaso Fontana
32a3edb153
Changed slice.swap documentation for better readability
using "b" and "d" can be easily confused
2021-10-25 13:51:34 +02:00
bjorn3
f5c3e83013 Avoid a branch on key being local for queries that use the same local and extern providers 2021-10-25 13:36:23 +02:00
bors
235d9853d8 Auto merge of #90042 - pietroalbini:1.56-master, r=Mark-Simulacrum
Bump bootstrap compiler to 1.57

Fixes https://github.com/rust-lang/rust/issues/90152

r? `@Mark-Simulacrum`
2021-10-25 11:31:47 +00:00
Laurențiu Nicola
25a82fdb32 ⬆️ rust-analyzer 2021-10-25 13:30:24 +03:00
Guillaume Gomez
345519baa7 Fix scrollbars appearing on information tooltip on mac when they shouldn't 2021-10-25 11:40:13 +02:00