]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoignore type flags insertion in default_anon_const_substs if error occurred
b-naber [Fri, 29 Oct 2021 11:14:44 +0000 (13:14 +0200)]
ignore type flags insertion in default_anon_const_substs if error occurred

2 years agoAuto merge of #90347 - matthiaskrgr:rollup-rp2ms7j, r=matthiaskrgr
bors [Wed, 27 Oct 2021 18:42:13 +0000 (18:42 +0000)]
Auto merge of #90347 - matthiaskrgr:rollup-rp2ms7j, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #90239 (Consistent big O notation in map.rs)
 - #90267 (fix: inner attribute followed by outer attribute causing ICE)
 - #90288 (Add hint for people missing `TryFrom`, `TryInto`, `FromIterator` import pre-2021)
 - #90304 (Add regression test for #75961)
 - #90344 (Add tracking issue number to const_cstr_unchecked)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #90344 - xfix:tracking-issue-const_cstr_unchecked, r=Mark-Simulacrum
Matthias Krüger [Wed, 27 Oct 2021 16:25:47 +0000 (18:25 +0200)]
Rollup merge of #90344 - xfix:tracking-issue-const_cstr_unchecked, r=Mark-Simulacrum

Add tracking issue number to const_cstr_unchecked

Also created a tracking issue, see #90343.

I think it makes sense to stabilize this somewhat soon considering abuse of `transmute` to have this feature in constants, see https://crates.io/crates/cstr for an example. Code can be rewritten to use `mem::transmute` to work on stable.

2 years agoRollup merge of #90304 - vandenheuvel:test_issue_75961, r=Mark-Simulacrum
Matthias Krüger [Wed, 27 Oct 2021 16:25:46 +0000 (18:25 +0200)]
Rollup merge of #90304 - vandenheuvel:test_issue_75961, r=Mark-Simulacrum

Add regression test for #75961

Closes #75961.
Closes #21203.

2 years agoRollup merge of #90288 - JakobDegen:import_diagnostics, r=davidtwco
Matthias Krüger [Wed, 27 Oct 2021 16:25:46 +0000 (18:25 +0200)]
Rollup merge of #90288 - JakobDegen:import_diagnostics, r=davidtwco

Add hint for people missing `TryFrom`, `TryInto`, `FromIterator` import pre-2021

Adds a hint anytime a `TryFrom`, `TryInto`, `FromIterator` import is suggested noting that these traits are automatically imported in Edition 2021.

2 years agoRollup merge of #90267 - EliseZeroTwo:elisezerotwo/fix_invalid_attrs_ice, r=Aaron1011
Matthias Krüger [Wed, 27 Oct 2021 16:25:44 +0000 (18:25 +0200)]
Rollup merge of #90267 - EliseZeroTwo:elisezerotwo/fix_invalid_attrs_ice, r=Aaron1011

fix: inner attribute followed by outer attribute causing ICE

Fixes #87936, #88938, and #89971.

This removes the assertion that validates that there are no outer attributes following inner attributes. Where the inner attribute is invalid you get an actual error.

2 years agoRollup merge of #90239 - r00ster91:patch-1, r=fee1-dead
Matthias Krüger [Wed, 27 Oct 2021 16:25:43 +0000 (18:25 +0200)]
Rollup merge of #90239 - r00ster91:patch-1, r=fee1-dead

Consistent big O notation in map.rs

Follow up to #89216

2 years agoRemove big O notation
r00ster91 [Wed, 27 Oct 2021 15:43:14 +0000 (17:43 +0200)]
Remove big O notation

2 years agoAuto merge of #90273 - nbdd0121:const, r=fee1-dead
bors [Wed, 27 Oct 2021 15:32:42 +0000 (15:32 +0000)]
Auto merge of #90273 - nbdd0121:const, r=fee1-dead

Clean up special function const checks

Mark them as const and `#[rustc_do_not_const_check]` instead of hard-coding them in const-eval checks.

r? `@oli-obk`
`@rustbot` label A-const-eval T-compiler

2 years agoAdd tracking issue number to const_cstr_unchecked
Konrad Borowski [Wed, 27 Oct 2021 13:18:25 +0000 (15:18 +0200)]
Add tracking issue number to const_cstr_unchecked

2 years agoAuto merge of #90186 - jsha:fix-header-sizes, r=GuillaumeGomez
bors [Wed, 27 Oct 2021 12:27:47 +0000 (12:27 +0000)]
Auto merge of #90186 - jsha:fix-header-sizes, r=GuillaumeGomez

Fix documentation header sizes

And add a rustdoc-gui test confirming various header sizes.

Split off from #90156. This fixes a regression in #89506 where the heading level of titles within Markdown was too high (h2) for docblocks under structs, unions, and enum impls.

r? `@camelid`

Demo: https://jacob.hoffman-andrews.com/rust/fix-header-sizes/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
Stable: https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
Beta: https://doc.rust-lang.org/beta/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E

2 years agoAuto merge of #89652 - rcvalle:rust-cfi, r=nagisa
bors [Wed, 27 Oct 2021 09:19:42 +0000 (09:19 +0000)]
Auto merge of #89652 - rcvalle:rust-cfi, r=nagisa

Add LLVM CFI support to the Rust compiler

This PR adds LLVM Control Flow Integrity (CFI) support to the Rust compiler. It initially provides forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their number of arguments.

Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by defining and using compatible type identifiers (see Type metadata in the design document in the tracking issue #89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).

Thank you, `@eddyb` and `@pcc,` for all the help!

2 years agotest: add test for inner attribute followed by outer attribute causing ICE
EliseZeroTwo [Tue, 26 Oct 2021 09:45:15 +0000 (11:45 +0200)]
test: add test for inner attribute followed by outer attribute causing ICE

2 years agoAdd documentation for LLVM CFI support
Ramon de C Valle [Thu, 14 Oct 2021 19:24:53 +0000 (12:24 -0700)]
Add documentation for LLVM CFI support

This commit adds initial documentation for LLVM Control Flow Integrity
(CFI) support to the Rust compiler (see #89652 and #89653).

2 years agoRemove `is_const_fn` in `find_mir_or_eval_fn`
Gary Guo [Wed, 27 Oct 2021 06:21:17 +0000 (07:21 +0100)]
Remove `is_const_fn` in `find_mir_or_eval_fn`

2 years agoAuto merge of #90337 - matthiaskrgr:rollup-azkr158, r=matthiaskrgr
bors [Wed, 27 Oct 2021 06:16:47 +0000 (06:16 +0000)]
Auto merge of #90337 - matthiaskrgr:rollup-azkr158, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - #90154 (rustdoc: Remove `GetDefId`)
 - #90232 (rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability)
 - #90278 (rustdoc: use better highlighting for *const, *mut, and &mut)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoAdd regression test for #75961
Bram van den Heuvel [Tue, 26 Oct 2021 10:33:49 +0000 (12:33 +0200)]
Add regression test for #75961

2 years agoRollup merge of #90278 - notriddle:notriddle/highlight-ptr, r=jyn541,GuillaumeGomez
Matthias Krüger [Wed, 27 Oct 2021 04:11:38 +0000 (06:11 +0200)]
Rollup merge of #90278 - notriddle:notriddle/highlight-ptr, r=jyn541,GuillaumeGomez

rustdoc: use better highlighting for *const, *mut, and &mut

This generates more consistent HTML for these RefKeyWord combinations.

Before:

![image](https://user-images.githubusercontent.com/1593513/138742752-7e00a3f7-4621-4c62-82d1-3e4c2ef503d1.png)

After:

![image](https://user-images.githubusercontent.com/1593513/138743955-90abcdcd-fc88-4e2f-95bb-c1b1635c0001.png)

2 years agoRollup merge of #90232 - konan8205:master, r=GuillaumeGomez
Matthias Krüger [Wed, 27 Oct 2021 04:11:36 +0000 (06:11 +0200)]
Rollup merge of #90232 - konan8205:master, r=GuillaumeGomez

rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability

Due to Windows' implementation of font rendering, OpenType fonts can be distorted. So the existing font, Noto Sans KR, is not very readable on Windows. This PR improves readability of Korean glyphs on Windows.

## Before
![원1](https://user-images.githubusercontent.com/11029378/138592394-16b15787-532d-4421-a5eb-ed85675290fa.png)

## After
![원2](https://user-images.githubusercontent.com/11029378/138592409-f3a440ee-f0fc-40e4-9561-42c479439c9f.png)

The fonts included in this PR are licensed under the SIL Open Font License and generated with these commands:

```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff --flavor=woff
```
```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2
```

r? ``@GuillaumeGomez``

2 years agoRollup merge of #90154 - camelid:remove-getdefid, r=jyn514
Matthias Krüger [Wed, 27 Oct 2021 04:11:35 +0000 (06:11 +0200)]
Rollup merge of #90154 - camelid:remove-getdefid, r=jyn514

rustdoc: Remove `GetDefId`

See the individual commit messages for details.

r? `@jyn514`

2 years agoAuto merge of #89937 - JohnTitor:fix-89875, r=Amanieu
bors [Wed, 27 Oct 2021 03:08:47 +0000 (03:08 +0000)]
Auto merge of #89937 - JohnTitor:fix-89875, r=Amanieu

Properly check `target_features` not to trigger an assertion

Fixes #89875
I think it should be a condition instead of an assertion to check if it's a register as it's possible that `reg` is a register class.
Also, this isn't related to the issue directly, but `is_target_supported` doesn't check `target_features` attributes. Is there any way to check it on rustc_codegen_llvm?

r? `@Amanieu`

2 years agoReverting switching test to no_std and adjust output after rebase.
Jakob Degen [Wed, 27 Oct 2021 01:18:04 +0000 (21:18 -0400)]
Reverting switching test to no_std and adjust output after rebase.

2 years agoFix line numbers in test
Jakob Degen [Tue, 26 Oct 2021 03:14:48 +0000 (23:14 -0400)]
Fix line numbers in test

2 years agoMake `ui/suggestions/suggest-tryinto-edition-change.rs` no_std to avoid getting incon...
Jakob Degen [Tue, 26 Oct 2021 02:56:18 +0000 (22:56 -0400)]
Make `ui/suggestions/suggest-tryinto-edition-change.rs` no_std to avoid getting inconsistent output between local and CI.

2 years agoAdds hint if a trait fails to resolve and a newly added one in Edition 2021 is suggested
Jakob Degen [Tue, 26 Oct 2021 00:04:35 +0000 (20:04 -0400)]
Adds hint if a trait fails to resolve and a newly added one in Edition 2021 is suggested

2 years agoAdd test checking that Edition 2021 is suggested for .try_into() and fix other test
Jakob Degen [Mon, 25 Oct 2021 01:09:52 +0000 (21:09 -0400)]
Add test checking that Edition 2021 is suggested for .try_into() and fix other test

2 years agoAdd diagnostic in case of failed `.try_into()` method call pre-Edition 2021
Jakob Degen [Sat, 23 Oct 2021 03:21:46 +0000 (23:21 -0400)]
Add diagnostic in case of failed `.try_into()` method call pre-Edition 2021

2 years agoAuto merge of #90314 - matthiaskrgr:rollup-ag1js8n, r=matthiaskrgr
bors [Tue, 26 Oct 2021 17:50:46 +0000 (17:50 +0000)]
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

2 years agoRollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-Simulacrum
Matthias Krüger [Tue, 26 Oct 2021 17:32:46 +0000 (19:32 +0200)]
Rollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-Simulacrum

Add regression test for #87258

Closes #87258.

2 years agoRollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitor
Matthias Krüger [Tue, 26 Oct 2021 17:32:45 +0000 (19:32 +0200)]
Rollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitor

Add regression test for issue 90164

Closes #90164 (previously fixed by #90181)

2 years agoRollup merge of #90302 - GuillaumeGomez:rm-unneeded-into_iter, r=jyn514
Matthias Krüger [Tue, 26 Oct 2021 17:32:44 +0000 (19:32 +0200)]
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``

2 years agoRollup merge of #90296 - CAD97:rip-lerp, r=Mark-Simulacrum
Matthias Krüger [Tue, 26 Oct 2021 17:32:44 +0000 (19:32 +0200)]
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)

2 years agoAuto merge of #90290 - nyanpasu64:fix-string-as-mut-vec, r=m-ou-se
bors [Tue, 26 Oct 2021 14:44:47 +0000 (14:44 +0000)]
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 😼

2 years agoAdd regression test for #87258
Bram van den Heuvel [Tue, 26 Oct 2021 10:48:22 +0000 (12:48 +0200)]
Add regression test for #87258

2 years agoAuto merge of #90284 - tonyyzy:patch-1, r=JohnTitor
bors [Tue, 26 Oct 2021 11:45:13 +0000 (11:45 +0000)]
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

2 years agoRemove redundant Aligner
Tony Yang [Tue, 26 Oct 2021 10:34:03 +0000 (11:34 +0100)]
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

2 years agoAdd regression test for issue 90164
Maybe Waffle [Tue, 26 Oct 2021 10:23:27 +0000 (13:23 +0300)]
Add regression test for issue 90164

2 years agoRemove unneeded into_iter
Guillaume Gomez [Tue, 26 Oct 2021 09:50:52 +0000 (11:50 +0200)]
Remove unneeded into_iter

2 years agoAuto merge of #90075 - pierwill:fix-79717, r=petrochenkov
bors [Tue, 26 Oct 2021 07:57:51 +0000 (07:57 +0000)]
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.

2 years agoFix copy-paste error in String::as_mut_vec() docs
nyanpasu64 [Tue, 26 Oct 2021 01:42:22 +0000 (18:42 -0700)]
Fix copy-paste error in String::as_mut_vec() docs

2 years agoAuto merge of #90299 - matthiaskrgr:rollup-n77ntld, r=matthiaskrgr
bors [Tue, 26 Oct 2021 04:44:51 +0000 (04:44 +0000)]
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

2 years agoRollup merge of #90295 - ehuss:update-cargo, r=ehuss
Matthias Krüger [Tue, 26 Oct 2021 04:14:09 +0000 (06:14 +0200)]
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)

2 years agoRollup merge of #90294 - ehuss:update-books, r=ehuss
Matthias Krüger [Tue, 26 Oct 2021 04:14:08 +0000 (06:14 +0200)]
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)

2 years agoRollup merge of #90241 - DrMeepster:thiscall_lint_upgrade, r=petrochenkov
Matthias Krüger [Tue, 26 Oct 2021 04:14:07 +0000 (06:14 +0200)]
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.

2 years agoRollup merge of #90181 - notriddle:notriddle/error-pointer, r=estebank
Matthias Krüger [Tue, 26 Oct 2021 04:14:06 +0000 (06:14 +0200)]
Rollup merge of #90181 - notriddle:notriddle/error-pointer, r=estebank

fix(rustc_typeck): report function argument errors on matching type

Fixes #90101

2 years agoRemove fNN::lerp - consensus unlikely
CAD97 [Tue, 26 Oct 2021 03:22:17 +0000 (22:22 -0500)]
Remove fNN::lerp - consensus unlikely

2 years agoUpdate cargo
Eric Huss [Tue, 26 Oct 2021 03:30:21 +0000 (20:30 -0700)]
Update cargo

2 years agoUpdate books
Eric Huss [Tue, 26 Oct 2021 02:51:09 +0000 (19:51 -0700)]
Update books

2 years agoProperly check `target_features` not to trigger an assertion
Yuki Okushi [Wed, 20 Oct 2021 19:56:36 +0000 (04:56 +0900)]
Properly check `target_features` not to trigger an assertion

2 years agoAdd a regression test for issue-89875
Yuki Okushi [Tue, 19 Oct 2021 19:50:34 +0000 (04:50 +0900)]
Add a regression test for issue-89875

2 years agoRemove unnecessary check for registers
Yuki Okushi [Tue, 19 Oct 2021 02:34:58 +0000 (11:34 +0900)]
Remove unnecessary check for registers

`is_clobber()` already checks if `reg` is a register and the both
values should be the same.

2 years agoFix some typos
Yuki Okushi [Sat, 16 Oct 2021 05:04:21 +0000 (14:04 +0900)]
Fix some typos

2 years agorustdoc: use ttf based font for cjk glyphs
Shinwoo Park [Tue, 26 Oct 2021 01:58:13 +0000 (10:58 +0900)]
rustdoc: use ttf based font for cjk glyphs

2 years agoEdit error messages for rustc_resolve::AmbiguityKind variants
pierwill [Wed, 20 Oct 2021 13:56:10 +0000 (08:56 -0500)]
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>
2 years agoAuto merge of #85830 - bjorn3:separate_provide_extern, r=cjgillot
bors [Tue, 26 Oct 2021 00:38:58 +0000 (00:38 +0000)]
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.

2 years agoFix documentation header sizes
Jacob Hoffman-Andrews [Fri, 22 Oct 2021 20:45:10 +0000 (13:45 -0700)]
Fix documentation header sizes

And add a rustdoc-gui test confirming various header sizes.

2 years agoAdd LLVM CFI support to the Rust compiler
Ramon de C Valle [Thu, 7 Oct 2021 22:33:13 +0000 (15:33 -0700)]
Add LLVM CFI support to the Rust compiler

This commit adds LLVM Control Flow Integrity (CFI) support to the Rust
compiler. It initially provides forward-edge control flow protection for
Rust-compiled code only by aggregating function pointers in groups
identified by their number of arguments.

Forward-edge control flow protection for C or C++ and Rust -compiled
code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code
share the same virtual address space) will be provided in later work as
part of this project by defining and using compatible type identifiers
(see Type metadata in the design document in the tracking issue #89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e.,
-Clto).

2 years agomake thiscall on unsupported platforms an error
DrMeepster [Sun, 24 Oct 2021 18:57:45 +0000 (11:57 -0700)]
make thiscall on unsupported platforms an error

2 years agoAuto merge of #90282 - matthiaskrgr:rollup-c6trbff, r=matthiaskrgr
bors [Mon, 25 Oct 2021 21:33:13 +0000 (21:33 +0000)]
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 (:arrow_up: rust-analyzer)
 - #90266 (Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #90266 - b-naber:uneval_substs, r=lcnr
Matthias Krüger [Mon, 25 Oct 2021 20:59:49 +0000 (22:59 +0200)]
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`

2 years agoRollup merge of #90255 - lnicola:rust-analyzer-2021-10-25, r=lnicola
Matthias Krüger [Mon, 25 Oct 2021 20:59:48 +0000 (22:59 +0200)]
Rollup merge of #90255 - lnicola:rust-analyzer-2021-10-25, r=lnicola

:arrow_up: rust-analyzer

r? ~~``@ghose~~`` sorry, ``@ghost``

2 years agoRollup merge of #90196 - yanok:master, r=scottmcm
Matthias Krüger [Mon, 25 Oct 2021 20:59:47 +0000 (22:59 +0200)]
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

2 years agoRollup merge of #89581 - jblazquez:master, r=Mark-Simulacrum
Matthias Krüger [Mon, 25 Oct 2021 20:59:46 +0000 (22:59 +0200)]
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.

2 years agofix(rustc_typeck): report function argument errors on matching type
Michael Howell [Fri, 22 Oct 2021 20:49:12 +0000 (13:49 -0700)]
fix(rustc_typeck): report function argument errors on matching type

Fixes #90101

2 years agoAuto merge of #89430 - GuillaumeGomez:rustdoc-clippy-lints, r=jyn514,camelid,notriddle
bors [Mon, 25 Oct 2021 18:24:33 +0000 (18:24 +0000)]
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`

2 years agorustdoc: use better highlighting for *const, *mut, and &mut
Michael Howell [Mon, 25 Oct 2021 17:43:55 +0000 (10:43 -0700)]
rustdoc: use better highlighting for *const, *mut, and &mut

This generates more consistent HTML for these RefKeyWord combinations.

Before:

![image](https://user-images.githubusercontent.com/1593513/138742752-7e00a3f7-4621-4c62-82d1-3e4c2ef503d1.png)

After:

![image](https://user-images.githubusercontent.com/1593513/138743955-90abcdcd-fc88-4e2f-95bb-c1b1635c0001.png)

2 years agoClean up special function const checks
Gary Guo [Mon, 25 Oct 2021 16:07:16 +0000 (17:07 +0100)]
Clean up special function const checks

Mark them as const and `#[rustc_do_not_const_check]` instead of hard-coding
them in const-eval checks.

2 years agofix: inner attribute followed by outer attribute causing ICE
EliseZeroTwo [Mon, 25 Oct 2021 15:31:27 +0000 (17:31 +0200)]
fix: inner attribute followed by outer attribute causing ICE

2 years agoAuto merge of #90265 - GuillaumeGomez:rollup-gx3ficp, r=GuillaumeGomez
bors [Mon, 25 Oct 2021 14:40:45 +0000 (14:40 +0000)]
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

2 years agoRollup merge of #90261 - Mark-Simulacrum:fix-try, r=pietroalbini
Guillaume Gomez [Mon, 25 Oct 2021 14:34:55 +0000 (16:34 +0200)]
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`

2 years agoRollup merge of #90257 - zommiommy:patch-1, r=m-ou-se
Guillaume Gomez [Mon, 25 Oct 2021 14:34:54 +0000 (16:34 +0200)]
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!

2 years agoRollup merge of #90233 - GuillaumeGomez:tooltip-overflow, r=camelid
Guillaume Gomez [Mon, 25 Oct 2021 14:34:53 +0000 (16:34 +0200)]
Rollup merge of #90233 - GuillaumeGomez:tooltip-overflow, r=camelid

Tooltip overflow

Fixes #89185.

r? ``@camelid``

2 years agoRollup merge of #90079 - SparrowLii:i8mm, r=Amanieu
Guillaume Gomez [Mon, 25 Oct 2021 14:34:52 +0000 (16:34 +0200)]
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``

2 years agoRollup merge of #90017 - jackh726:issue-tests, r=nikomatsakis
Guillaume Gomez [Mon, 25 Oct 2021 14:34:52 +0000 (16:34 +0200)]
Rollup merge of #90017 - jackh726:issue-tests, r=nikomatsakis

Add a couple tests for normalize under binder issues

Closes #56556
Closes #76956

r? ``@nikomatsakis``

2 years agoadd tests
b-naber [Mon, 25 Oct 2021 14:04:23 +0000 (16:04 +0200)]
add tests

2 years agoexpose default substs in param_env
b-naber [Mon, 25 Oct 2021 13:34:59 +0000 (15:34 +0200)]
expose default substs in param_env

2 years agoMove back to linux builder on try builds
Mark Rousskov [Mon, 25 Oct 2021 13:38:04 +0000 (09:38 -0400)]
Move back to linux builder on try builds

2 years agoFix test
bjorn3 [Mon, 25 Oct 2021 13:15:05 +0000 (15:15 +0200)]
Fix test

2 years agoFixed missing double quote in the patch (slice.swap)
Tommaso Fontana [Mon, 25 Oct 2021 12:13:54 +0000 (14:13 +0200)]
Fixed missing double quote in the patch (slice.swap)

2 years agoChanged slice.swap documentation for better readability
Tommaso Fontana [Mon, 25 Oct 2021 11:51:34 +0000 (13:51 +0200)]
Changed slice.swap documentation for better readability

using "b" and "d" can be easily confused

2 years agoAvoid a branch on key being local for queries that use the same local and extern...
bjorn3 [Sun, 30 May 2021 15:24:54 +0000 (17:24 +0200)]
Avoid a branch on key being local for queries that use the same local and extern providers

2 years agoAuto merge of #90042 - pietroalbini:1.56-master, r=Mark-Simulacrum
bors [Mon, 25 Oct 2021 11:31:47 +0000 (11:31 +0000)]
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`

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 25 Oct 2021 10:30:24 +0000 (13:30 +0300)]
:arrow_up: rust-analyzer

2 years agoFix scrollbars appearing on information tooltip on mac when they shouldn't
Guillaume Gomez [Sun, 24 Oct 2021 13:28:58 +0000 (15:28 +0200)]
Fix scrollbars appearing on information tooltip on mac when they shouldn't

2 years agoFix clippy lints in librustdoc
Guillaume Gomez [Fri, 1 Oct 2021 15:12:39 +0000 (17:12 +0200)]
Fix clippy lints in librustdoc

2 years agoAuto merge of #90249 - matthiaskrgr:rollup-xwtfhq3, r=matthiaskrgr
bors [Mon, 25 Oct 2021 08:22:07 +0000 (08:22 +0000)]
Auto merge of #90249 - matthiaskrgr:rollup-xwtfhq3, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #89889 (Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate)
 - #90127 (Do not mention a reexported item if it's private)
 - #90143 (tidy: Remove submodules from edition exception list)
 - #90238 (Add alias for guillaume.gomez@huawei.com)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoenable `i8mm` on arm
SparrowLii [Mon, 25 Oct 2021 07:10:14 +0000 (15:10 +0800)]
enable `i8mm` on arm

2 years agoenable `i8mm` target feature on aarch64
SparrowLii [Wed, 20 Oct 2021 02:19:23 +0000 (10:19 +0800)]
enable `i8mm` target feature on aarch64

2 years agoRollup merge of #90238 - GuillaumeGomez:mailmap-alias, r=Mark-Simulacrum
Matthias Krüger [Mon, 25 Oct 2021 05:54:16 +0000 (07:54 +0200)]
Rollup merge of #90238 - GuillaumeGomez:mailmap-alias, r=Mark-Simulacrum

Add alias for guillaume.gomez@huawei.com

Hopefully it'll stop making me appear twice in the thanks page. :)

2 years agoRollup merge of #90143 - camelid:tidy-2021-followup, r=Mark-Simulacrum
Matthias Krüger [Mon, 25 Oct 2021 05:54:15 +0000 (07:54 +0200)]
Rollup merge of #90143 - camelid:tidy-2021-followup, r=Mark-Simulacrum

tidy: Remove submodules from edition exception list

Both style-check and date-check are now on the 2021 edition, and this
PR also updates their repositories' submodules.

cc rust-lang/rustc-dev-guide#1238
cc rust-lang/reference#1099
cc https://github.com/rust-lang/rust/pull/89103#discussion_r711783714

2 years agoRollup merge of #90127 - JohnTitor:fix-90113, r=estebank
Matthias Krüger [Mon, 25 Oct 2021 05:54:13 +0000 (07:54 +0200)]
Rollup merge of #90127 - JohnTitor:fix-90113, r=estebank

Do not mention a reexported item if it's private

Fixes #90113
The _actual_ regression was introduced in #73652, then #88838 made it worse. This fixes the issue by not counting such an import as a candidate.

2 years agoRollup merge of #89889 - estebank:unmet-send-bound-on-foreign-future, r=tmandry
Matthias Krüger [Mon, 25 Oct 2021 05:54:12 +0000 (07:54 +0200)]
Rollup merge of #89889 - estebank:unmet-send-bound-on-foreign-future, r=tmandry

Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate

Partly address #78543 by making the error quieter.

We don't have access to the `typeck` tables from foreign crates, so we
used to completely skip the new code when checking foreign crates. Now,
we carry on and don't provide as nice output (we don't clarify *what* is
making the `Future: !Send`), but at least we no longer emit a sea of
derived obligations in the output.

[1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html

r? `@tmandry`

2 years agoAuto merge of #89808 - tmiasko:llvm-multithreaded, r=nagisa
bors [Mon, 25 Oct 2021 05:28:07 +0000 (05:28 +0000)]
Auto merge of #89808 - tmiasko:llvm-multithreaded, r=nagisa

Cleanup LLVM multi-threading checks

The support for runtime multi-threading was removed from LLVM. Calls to
`LLVMStartMultithreaded` became no-ops equivalent to checking if LLVM
was compiled with support for threads http://reviews.llvm.org/D4216.

2 years agoAuto merge of #90210 - cjgillot:qarray2, r=Mark-Simulacrum
bors [Mon, 25 Oct 2021 01:10:50 +0000 (01:10 +0000)]
Auto merge of #90210 - cjgillot:qarray2, r=Mark-Simulacrum

Build the query vtable directly.

Continuation of https://github.com/rust-lang/rust/pull/89978.

This shrinks the query interface and attempts to reduce the amount of function pointer calls.

2 years agoAuto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726
bors [Sun, 24 Oct 2021 22:26:41 +0000 (22:26 +0000)]
Auto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726

Point at overlapping impls when type annotations are needed

Address https://github.com/rust-lang/rust/issues/89254.

2 years agotidy: Remove submodules from edition exception list
Noah Lev [Sun, 24 Oct 2021 20:27:13 +0000 (13:27 -0700)]
tidy: Remove submodules from edition exception list

Both style-check and date-check are now on the 2021 edition, and this
commit also updates their repositories' submodules.

2 years agoUse the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate
Esteban Kuber [Thu, 14 Oct 2021 17:57:39 +0000 (17:57 +0000)]
Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate

Partly address #78543 by making the error quieter.

We don't have access to the `typeck` tables from foreign crates, so we
used to completely skip the new code when checking foreign crates. Now,
we carry on and don't provide as nice output (we don't clarify *what* is
making the `Future: !Send`), but at least we no longer emit a sea of
derived obligations in the output.

[1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html

2 years agoAlways sort suggestions before emitting them
Esteban Kuber [Fri, 1 Oct 2021 18:09:31 +0000 (18:09 +0000)]
Always sort suggestions before emitting them

2 years agoPoint at overlapping impls when type annotations are needed
Esteban Kuber [Fri, 1 Oct 2021 13:05:17 +0000 (13:05 +0000)]
Point at overlapping impls when type annotations are needed

2 years agoFix and extend ControlFlow `traverse_inorder` example
Ilya Yanok [Sat, 23 Oct 2021 09:40:46 +0000 (11:40 +0200)]
Fix and extend 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
   a mutable reference as an input argument.
2. Added an example usage of `traverse_inorder` showing how we
   can terminate the traversal early.

Fixes #90063