Commit Graph

135867 Commits

Author SHA1 Message Date
Maybe Waffle
0250f0244b allow or avoid for loops over option in compiler and tests 2022-10-09 13:07:20 +00:00
Maybe Waffle
23a7674e3e for_loop_over_fallibles: fix suggestion for "remove .next()" case
if the iterator is used after the loop, we need to use `.by_ref()`
2022-10-09 13:05:53 +00:00
Maybe Waffle
7308564423 Add a test for the for_loop_over_fallibles lint 2022-10-09 13:05:53 +00:00
Michael Howell
16a1eeacbf
Rollup merge of #102818 - rust-lang:clean-up-highlight-impots, r=Urgau
Clean up rustdoc highlight.rs imports a bit

r? `@Dylan-DPC`
2022-10-08 18:15:02 -07:00
Michael Howell
8c4191abca
Rollup merge of #102807 - aDotInTheVoid:rdj-rustup-docs, r=jyn514
Document `rust-docs-json` component

Follow up to #102241

r? ````@jyn514````
2022-10-08 18:15:01 -07:00
Michael Howell
21c6a0e364
Rollup merge of #102790 - cuviper:llvm-tblgen, r=jyn514
Fix llvm-tblgen for cross compiling

- Let llvm-config tell us where to find its tools
- Add llvm-tblgen to rust-dev for cross-compiling

Fixes #86890.
r? ````@jyn514````
2022-10-08 18:15:01 -07:00
Michael Howell
f1ab04ffbb
Rollup merge of #102782 - Hosshii:issue-102124, r=Mark-Simulacrum
Add regression test for #102124

closes #102124, which was already fixed on nightly.
2022-10-08 18:15:00 -07:00
Michael Howell
825014e889
Rollup merge of #102661 - chrysn-pull-requests:rustdoc-effect-of-fundamental, r=notriddle
rustdoc: Document effect of fundamental types

This was implemented in https://github.com/rust-lang/rust/pull/96565, but not documented. But it's a useful feature for everyone who implements own wrapper (especially wrappers-around-pointers) types, so that they can behave like pointers (and stdlib wrappers) do -- so here goes a mention in the unstable section of the rustdoc book.

(That is where I initially looked to find tricks for making my own wrapper types be transparent to documentation).
2022-10-08 18:15:00 -07:00
Michael Howell
5ba30a680c
Rollup merge of #102514 - b-naber:binder-print-fixes, r=jackh726
Don't repeat lifetime names from outer binder in print

Fixes https://github.com/rust-lang/rust/issues/102392
Fixes https://github.com/rust-lang/rust/issues/102414

r? ```@lcnr```
2022-10-08 18:14:59 -07:00
Michael Howell
bf37054b1f
Rollup merge of #99818 - aliemjay:fix-closure-normalize, r=jackh726
don't ICE when normalizing closure input tys

We were ICEing while rendering diagnostics because `universe_causes` is expected to track every universe created in the typeck's infcx.

`normalize_and_add_constraints` doesn't update `universe_causes`
when creating new universes, causing an ICE. Remove it!

Add spans to better track normalization constraints.

Fix couple places where `universe_causes` is not updated correctly to
track newly added universes.

Fixes #102800

~Fixess #99665~ (UPDATE: no longer true; the issue has a different failure path than when this PR was created and should be fixed by #101708, but the changes in this PR are still correct and should prevent potential future ICEs)
2022-10-08 18:14:59 -07:00
Matthias Krüger
92628633ee
Rollup merge of #102815 - notriddle:notriddle/mobile-topbar, r=GuillaumeGomez
rustdoc: remove mobile topbar from source pages instead of hiding it
2022-10-08 23:32:05 +02:00
Matthias Krüger
7983e7a26f
Rollup merge of #102723 - pcc:run-make-cc, r=Mark-Simulacrum
test: run-make: skip when cross-compiling

This test fails when targeting aarch64 Android. Instead of adding yet another architecture here (and one that's increasingly more common as the host), let's replace the growing list of architectures with ignore-cross-compile.
2022-10-08 23:32:04 +02:00
Matthias Krüger
a5985dc16d
Rollup merge of #102604 - anirudh24seven:anirudh_improve_bootrap_readme_readability, r=Mark-Simulacrum
Improve readability of bootstrap's README

Improve readability of bootstrap's README by adding commas & minor changes
2022-10-08 23:32:04 +02:00
Matthias Krüger
5d2c29d2a1
Rollup merge of #102581 - jyn514:src-detection, r=Mark-Simulacrum
Make the `config.src` handling for downloadable bootstrap more conservative

In particular, this supports build directories within an unrelated git repository. Fixes https://github.com/rust-lang/rust/issues/102562.

As a side effect, it will fall back to the old logic when the source directory is being built from a tarball within an unrelated git repository. However, that second case is unsupported and untested; we reserve the right to break it in the future.

`@cr1901` can you confirm this fixes your problem?
cc `@kleisauke,` I believe this will also fix your issue (although your use case still isn't supported).

r? `@Mark-Simulacrum`
2022-10-08 23:32:03 +02:00
Matthias Krüger
6776cac4c1
Rollup merge of #102524 - notriddle:notriddle/unsafe-function, r=GuillaumeGomez
rustdoc: remove weird `<a href="#">` wrapper around unsafe triangle

This DOM cleanup changes the color of the triangle, from blue to black, but since it's still a different color from the link it's next to, it should still be noticeable.

# Before

![image](https://user-images.githubusercontent.com/1593513/193352428-929b3026-acc3-448e-9bac-44dddf206b1d.png)

# After

![image](https://user-images.githubusercontent.com/1593513/193352500-2f7a0112-b478-4cc4-9ddb-32ba11575530.png)
2022-10-08 23:32:03 +02:00
Matthias Krüger
3c2356767c
Rollup merge of #99194 - simlay:simlay/update-rust-gdbgui-gdb-args-to-gdb-cmd, r=Mark-Simulacrum
Fix gdb-cmd for rust-gdbgui

With https://github.com/cs01/gdbgui/pull/198, the way that gdbgui arguments were specified changed. I've tested this with program generated from `cargo new --bin` and it worked as gdbgui should.

Closes #76383.
2022-10-08 23:32:01 +02:00
Guillaume Gomez
3a7918ad42
Clean up rustdoc highlight.rs imports a bit 2022-10-08 22:09:51 +02:00
bors
8796e7a9cf Auto merge of #102315 - RalfJung:assert_unsafe_precondition, r=thomcc
add a few more assert_unsafe_precondition

Add debug-assertion checking for `ptr.read()`, `ptr.write(_)`, and `unreachable_unchecked.`

This is quite useful for [cargo-careful](https://github.com/RalfJung/cargo-careful).
2022-10-08 17:59:45 +00:00
Michael Howell
bf510b4ded rustdoc: add test case for dimensions and color of unsafe <sup> 2022-10-08 10:50:44 -07:00
Michael Howell
569384b99a rustdoc: remove weird <a href="#"> wrapper around unsafe triangle
This DOM cleanup changes the color of the triangle, from blue to black, but
since it's still a different color from the link it's next to, it should
still be noticeable.
2022-10-08 10:50:03 -07:00
Michael Howell
d2e14e2d11 rustdoc: remove mobile topbar from source pages instead of hiding it 2022-10-08 10:48:19 -07:00
b-naber
048e637e9e handle late-bound vars from inner binders correctly and add test 2022-10-08 17:48:02 +02:00
bors
c27948d255 Auto merge of #102809 - matthiaskrgr:rollup-qq62vuv, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #101520 (Allow transmutes between the same types after erasing lifetimes)
 - #102675 (Remove `mir::CastKind::Misc`)
 - #102778 (Fix MIR inlining of asm_unwind)
 - #102785 (Remove `DefId` from some `SelectionCandidate` variants)
 - #102788 (Update rustc-dev-guide)
 - #102789 (Update browser UI test version)
 - #102797 (rustdoc: remove no-op CSS `.rightside { position: initial }`)
 - #102798 (rustdoc: add main-heading and example-wrap link CSS to big selector)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-08 14:58:11 +00:00
Matthias Krüger
b8ac02b27b
Rollup merge of #102798 - notriddle:notriddle/text-decoration-underline, r=GuillaumeGomez
rustdoc: add main-heading and example-wrap link CSS to big selector

This makes the stylesheet more consistent about how it handles link hover.
2022-10-08 14:38:21 +02:00
Matthias Krüger
d81aa7c9fe
Rollup merge of #102797 - notriddle:notriddle/rightside-position, r=GuillaumeGomez
rustdoc: remove no-op CSS `.rightside { position: initial }`

This CSS, added in 34bd2b845b, overrode CSS that was applied to the `.since` class:

34bd2b845b/src/librustdoc/html/static/rustdoc.css (L782-L795)

The absolute positioning for `.since` was abandoned in favor of always floating it, so this is no longer needed:

5de1391b88 (diff-7dc22a0530802d77c2f2ec9e834024a5657b6eab4055520fca46edc99a544413L902-L904)
2022-10-08 14:38:21 +02:00
Matthias Krüger
91b9a92e51
Rollup merge of #102789 - GuillaumeGomez:update-browser-ui-test-version, r=notriddle
Update browser UI test version

It added the possibility to concatenate strings and numbers and updated the `goto` command so it doesn't stand on its own anymore.

r? ````@notriddle````
2022-10-08 14:38:20 +02:00
Matthias Krüger
140fe041f6
Rollup merge of #102788 - joshtriplett:bump-rustc-dev-guide, r=ehuss
Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (#1477)
- Update running tests with the new flags (#1476)
- Rename typeck to hir_analysis (#1475)
- fix typo and make paragraph consistent (#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
2022-10-08 14:38:20 +02:00
Matthias Krüger
2f2664923b
Rollup merge of #102778 - nbdd0121:mir, r=tmiasko
Fix MIR inlining of asm_unwind

The MIR inlining currently doesn't handle inline asm's unwind edge correctly.

This code will cause ICE:
```rust
struct D;

impl Drop for D {
    fn drop(&mut self) {}
}

#[inline(always)]
fn foo() {
    let _d = D;
    unsafe { std::arch::asm!("", options(may_unwind)) };
}

pub fn main() {
    foo();
}
```

This PR fixes this issue. I also take the opportunity to extract common code into a method.
2022-10-08 14:38:19 +02:00
Matthias Krüger
c731646d6a
Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obk
Remove `mir::CastKind::Misc`

As discussed in #97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast.

r? ````@oli-obk````
2022-10-08 14:38:18 +02:00
Matthias Krüger
6bcdf8aa74
Rollup merge of #101520 - oli-obk:transmute_lifetimes, r=compiler-errors
Allow transmutes between the same types after erasing lifetimes

r? ````@compiler-errors````  on the impl

fixes #101081

See discussion in the issue and at https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/.23101081.3A.20Regression.20transmuting.20.60RwLockReadGuard.3CT.3A.20.3FSized.3E.E2.80.A6

I think this may need lang team signoff as its implications may go beyond the jurisdiction of T-types

I'll write up a proper summary later
2022-10-08 14:38:18 +02:00
bors
bba9785dd7 Auto merge of #100720 - camsteffen:representable, r=cjgillot
Rewrite representability

 * Improve placement of `Box` in the suggestion
 * Multiple items in a cycle emit 1 error instead of an error for each item in the cycle
 * Introduce `representability` query to avoid traversing an item every time it is used.
 * Also introduce `params_in_repr` query to avoid traversing generic items every time it is used.
2022-10-08 11:53:25 +00:00
Nixon Enraght-Moony
7e64000915 Document rust-docs-json component 2022-10-08 12:16:59 +01:00
Ali MJ Al-Nasrawy
fc3d7eb91d don't ICE when normalizing closure input tys
`normalize_and_add_constraints` doesn't add entries in `universe_causes`
when creating new universes, causing an ICE. Remove it!

Add spans to track normalization constraints.

Fix couple places where `universe_causes` is not updated correctly to
track newly added universes.
2022-10-08 04:56:25 +03:00
Michael Howell
b2369cb636 rustdoc: add main-heading and example-wrap link CSS to big selector
This makes the stylesheet more consistent about how it handles link hover.
2022-10-07 17:05:30 -07:00
bors
eed7f2f58b Auto merge of #102792 - weihanglo:update-cargo, r=ehuss
Update cargo

4 commits in 0b84a35c2c7d70df4875a03eb19084b0e7a543ef..3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3

2022-10-03 19:13:21 +0000 to 2022-10-07 17:34:03 +0000
- fix(test): Distinguish 'testname' from escaped arguments (rust-lang/cargo#11190)
- Fix sparse registry lockfile urls containing 'registry+sparse+' (rust-lang/cargo#11177)
- doc(features2): polish docs a bit (rust-lang/cargo#11185)
- Import `cargo remove` into cargo (rust-lang/cargo#11099)
2022-10-07 23:59:08 +00:00
Michael Howell
38743ec07d rustdoc: remove no-op CSS .rightside { position: initial }
This CSS, added in 34bd2b845b, overrode CSS
that was applied to the `.since` class:

34bd2b845b/src/librustdoc/html/static/rustdoc.css (L782-L795)

The absolute positioning for `.since` was abandoned in favor of always
floating it, so this is no longer needed:

5de1391b88 (diff-7dc22a0530802d77c2f2ec9e834024a5657b6eab4055520fca46edc99a544413L902-L904)
2022-10-07 16:47:44 -07:00
Josh Stone
a027474ea6 Don't run llvm-config in dry runs 2022-10-07 15:27:48 -07:00
bors
8b0c05d9ad Auto merge of #102091 - RalfJung:const_err, r=oli-obk
make const_err a hard error

This lint has been deny-by-default with future incompat wording since [Rust 1.51](https://github.com/rust-lang/rust/pull/80394) and the stable release of this week starts showing it in cargo's future compat reports. I can't wait to finally get rid of at least some of the mess in our const-err-reporting-code. ;)

r? `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/71800
Fixes https://github.com/rust-lang/rust/issues/100114
2022-10-07 20:50:51 +00:00
Weihang Lo
b725ac095d
Update cargo
4 commits in 0b84a35c2c7d70df4875a03eb19084b0e7a543ef..3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3

2022-10-03 19:13:21 +0000 to 2022-10-07 17:34:03 +0000
- fix(test): Distinguish 'testname' from escaped arguments (rust-lang/cargo#11190)
- Fix sparse registry lockfile urls containing 'registry+sparse+' (rust-lang/cargo#11177)
- doc(features2): polish docs a bit (rust-lang/cargo#11185)
- Import `cargo remove` into cargo (rust-lang/cargo#11099)
2022-10-07 20:10:58 +01:00
Josh Stone
c3277198a1 Bump download-ci-llvm-stamp 2022-10-07 11:29:24 -07:00
Josh Stone
40e497fc9c Add llvm-tblgen to rust-dev for cross-compiling 2022-10-07 11:25:01 -07:00
Josh Stone
128344196b Let llvm-config tell us where to find its tools 2022-10-07 11:24:02 -07:00
Guillaume Gomez
8d19d53c60 Update rustdoc-gui test to new browser-ui-test version 2022-10-07 20:17:22 +02:00
Guillaume Gomez
6d4013d983 Update browser-ui-test version 2022-10-07 20:17:22 +02:00
bors
2d3a85b4f8 Auto merge of #102787 - Dylan-DPC:rollup-fvbb4t9, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #102300 (Use a macro to not have to copy-paste `ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere)
 - #102475 (unsafe keyword: trait examples and unsafe_op_in_unsafe_fn update)
 - #102760 (Avoid repeated re-initialization of the BufReader buffer)
 - #102764 (Check `WhereClauseReferencesSelf` after all other object safety checks)
 - #102779 (Fix `type_of` ICE)
 - #102780 (run Miri CI when std::sys changes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-07 17:37:39 +00:00
Gary Guo
fc83427066 Fix test 2022-10-07 18:23:12 +01:00
Josh Triplett
10bd656b72 Update rustc-dev-guide
- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (#1477)
- Update running tests with the new flags (#1476)
- Rename typeck to hir_analysis (#1475)
- fix typo and make paragraph consistent (#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
2022-10-07 17:38:34 +01:00
Dylan DPC
3800d40dc8
Rollup merge of #102780 - RalfJung:miri-lib-sys, r=Mark-Simulacrum
run Miri CI when std::sys changes

r? `@Mark-Simulacrum`
2022-10-07 22:05:32 +05:30
Dylan DPC
d70e56aef8
Rollup merge of #102779 - TaKO8Ki:fix-type-of-ice-102768, r=fee1-dead
Fix `type_of` ICE

Fixes #102768
2022-10-07 22:05:32 +05:30
Dylan DPC
34dfd82de0
Rollup merge of #102764 - compiler-errors:issue-102762, r=jackh726
Check `WhereClauseReferencesSelf` after all other object safety checks

This fixes the ICE because it causes us to detect another *non-lint* `MethodViolationCode` first, instead of breaking on `WhereClauseReferencesSelf`.

We could also approach this issue by instead returning a vector of *all* of the `MethodViolationCode`s, and just reporting the first one we see, but treating it as a hard error if we return both `WhereClauseReferencesSelf` and some other violation code -- let me know if this is desired.

Fixes #102762
2022-10-07 22:05:31 +05:30