]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoPrevent impl blocks containing only private items to be documented by default
Guillaume Gomez [Tue, 9 Aug 2022 13:39:58 +0000 (15:39 +0200)]
Prevent impl blocks containing only private items to be documented by default

22 months agoAuto merge of #100304 - matthiaskrgr:rollup-gs56vlw, r=matthiaskrgr
bors [Tue, 9 Aug 2022 08:03:08 +0000 (08:03 +0000)]
Auto merge of #100304 - matthiaskrgr:rollup-gs56vlw, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #100163 (Refactor: remove an unnecessary string search)
 - #100212 (Remove more Clean trait implementations)
 - #100238 (Further improve error message for E0081)
 - #100268 (Add regression test for #79148)
 - #100294 (Update Duration::as_secs doc to point to as_secs_f64/32 for including fractional part)
 - #100303 (:arrow_up: rust-analyzer)

Failed merges:

 - #100281 (Remove more Clean trait implementations)

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

22 months agoRollup merge of #100303 - lnicola:rust-analyzer-2022-08-09, r=lnicola
Matthias Krüger [Tue, 9 Aug 2022 05:06:02 +0000 (07:06 +0200)]
Rollup merge of #100303 - lnicola:rust-analyzer-2022-08-09, r=lnicola

:arrow_up: rust-analyzer

r? `@ghost`

22 months agoRollup merge of #100294 - theli-ua:master, r=thomcc
Matthias Krüger [Tue, 9 Aug 2022 05:06:01 +0000 (07:06 +0200)]
Rollup merge of #100294 - theli-ua:master, r=thomcc

Update Duration::as_secs doc to point to as_secs_f64/32 for including fractional part

Rather than suggesting to calculate manually

22 months agoRollup merge of #100268 - TaKO8Ki:add-regression-test-for-79148, r=Mark-Simulacrum
Matthias Krüger [Tue, 9 Aug 2022 05:05:59 +0000 (07:05 +0200)]
Rollup merge of #100268 - TaKO8Ki:add-regression-test-for-79148, r=Mark-Simulacrum

Add regression test for #79148

closes #79148

22 months agoRollup merge of #100238 - Bryysen:master, r=cjgillot
Matthias Krüger [Tue, 9 Aug 2022 05:05:58 +0000 (07:05 +0200)]
Rollup merge of #100238 - Bryysen:master, r=cjgillot

Further improve error message for E0081

Closes #97533

22 months agoRollup merge of #100212 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC
Matthias Krüger [Tue, 9 Aug 2022 05:05:56 +0000 (07:05 +0200)]
Rollup merge of #100212 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC

Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`

22 months agoRollup merge of #100163 - TaKO8Ki:remove-unnecessary-string-search, r=wesleywiser
Matthias Krüger [Tue, 9 Aug 2022 05:05:55 +0000 (07:05 +0200)]
Rollup merge of #100163 - TaKO8Ki:remove-unnecessary-string-search, r=wesleywiser

Refactor: remove an unnecessary string search

22 months agoAuto merge of #100205 - cjgillot:noice-doc, r=camelid
bors [Tue, 9 Aug 2022 05:05:46 +0000 (05:05 +0000)]
Auto merge of #100205 - cjgillot:noice-doc, r=camelid

Avoid ICE in rustdoc when using `Fn` bounds

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

22 months ago:arrow_up: rust-analyzer
Laurențiu Nicola [Tue, 9 Aug 2022 04:23:57 +0000 (07:23 +0300)]
:arrow_up: rust-analyzer

22 months agoUpdate Duration::as_secs doc to point to as_secs_f64/32 for including fractional...
Anton Romanov [Tue, 9 Aug 2022 00:51:17 +0000 (17:51 -0700)]
Update Duration::as_secs doc to point to as_secs_f64/32 for including fractional part

Rather than suggesting to calculate manually

22 months agoAdd regression test comment
Noah Lev [Mon, 8 Aug 2022 21:09:55 +0000 (14:09 -0700)]
Add regression test comment

22 months agoFix plural form of `variant` in error message not formatting correctly
Bryysen [Mon, 8 Aug 2022 19:34:55 +0000 (21:34 +0200)]
Fix plural form of `variant` in error message not formatting correctly
due to ordering, added/improved comments and removed redundant test
already caught by `E0081.rs`

22 months agoSynthetize a trait ref when none is available.
Camille GILLOT [Mon, 8 Aug 2022 19:09:09 +0000 (21:09 +0200)]
Synthetize a trait ref when none is available.

22 months agoadd regression test for #79148
Takayuki Maeda [Mon, 8 Aug 2022 10:50:10 +0000 (19:50 +0900)]
add regression test for #79148

22 months agoAuto merge of #98863 - compiler-errors:projection-msg, r=estebank
bors [Mon, 8 Aug 2022 10:16:20 +0000 (10:16 +0000)]
Auto merge of #98863 - compiler-errors:projection-msg, r=estebank

Implement special-cased projection error message for some common traits

Not sure what the best phrasing is, but I feel like these are more clear than the plain `<Type as Iterator>::Output == Type` messages.

If this is actually a good idea, are there any other traits this could benefit?

22 months agoAuto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiasko
bors [Mon, 8 Aug 2022 07:31:12 +0000 (07:31 +0000)]
Auto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiasko

Only fetch HIR for naked functions that have the attribute.

22 months agoAuto merge of #100207 - notriddle:notriddle/skipped-inline-module, r=Manishearth
bors [Mon, 8 Aug 2022 04:39:29 +0000 (04:39 +0000)]
Auto merge of #100207 - notriddle:notriddle/skipped-inline-module, r=Manishearth

rustdoc: do not mark the contents of a skipped module as inlined

Fixes #100204

22 months agoAdjust wording
Michael Goulet [Mon, 8 Aug 2022 00:13:41 +0000 (00:13 +0000)]
Adjust wording

22 months agoImplement special-cased projection error message for some common traits
Michael Goulet [Sun, 3 Jul 2022 20:17:08 +0000 (20:17 +0000)]
Implement special-cased projection error message for some common traits

22 months agoFix wording on comment
Bryysen [Sun, 7 Aug 2022 21:50:12 +0000 (23:50 +0200)]
Fix wording on comment

22 months agoAuto merge of #100245 - matthiaskrgr:rollup-tfoo650, r=matthiaskrgr
bors [Sun, 7 Aug 2022 21:25:29 +0000 (21:25 +0000)]
Auto merge of #100245 - matthiaskrgr:rollup-tfoo650, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #100019 (Revive suggestions for boxed trait objects instead of impl Trait)
 - #100038 (Document the `no-std` target option in config.toml.example)
 - #100194 (Remove even more box syntax uses from src/test)
 - #100206 (test: skip terminfo parsing in Miri)
 - #100230 (Use start_point instead of next_point to point to elided lifetime amp…)
 - #100244 (Add armv4t-none-eabi take2)

Failed merges:

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

22 months agoAdd comments to obscure code, remove unnesecary parameter from closure
Bryysen [Sun, 7 Aug 2022 20:28:16 +0000 (22:28 +0200)]
Add comments to obscure code, remove unnesecary parameter from closure

22 months agoRollup merge of #100244 - Lokathor:add-armv4t-none-eabi-take2, r=jackh726
Matthias Krüger [Sun, 7 Aug 2022 19:10:27 +0000 (21:10 +0200)]
Rollup merge of #100244 - Lokathor:add-armv4t-none-eabi-take2, r=jackh726

Add armv4t-none-eabi take2

This is the same as the previous PR (https://github.com/rust-lang/rust/pull/99226) but i just made a fresh branch without a merge commit in it.

---

### armv4t-none-eabi target quiz

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target.

That's me!

> Targets must use naming consistent with any existing targets

We're using the existing name as recognized by LLVM and GCC

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

No legal issues here.

>> The target must not introduce license incompatibilities.

No license requirements here.

>> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

check

>> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy.

no new deps, we're just adding a rustc target description file for a target llvm already knows about.

>> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries.

bare-metal target, doesn't rely on any libs at all.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate

`core` only here. You could build `alloc` too, but you'd have to bring your own global allocator.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible.

LLVM knows how to do it, you just need the GNU Binutils linker because LLVM's linker doesn't work that far back. That's in the docs as part of this PR.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target.

No burdens, LLVM already knows how to do this. Further, because this is a cpu-feature variant of an existing tier3 target the `compiler-builtins` crate has already been updated as necessary to fix any missing builtin function gaps.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

check.

22 months agoRollup merge of #100230 - cjgillot:noice-multibyte-amp, r=compiler-errors
Matthias Krüger [Sun, 7 Aug 2022 19:10:26 +0000 (21:10 +0200)]
Rollup merge of #100230 - cjgillot:noice-multibyte-amp, r=compiler-errors

Use start_point instead of next_point to point to elided lifetime amp…

Using `next_point` creates a span which points inside the multibyte token, ICEing.

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

22 months agoRollup merge of #100206 - RalfJung:miri-terminfo, r=thomcc
Matthias Krüger [Sun, 7 Aug 2022 19:10:25 +0000 (21:10 +0200)]
Rollup merge of #100206 - RalfJung:miri-terminfo, r=thomcc

test: skip terminfo parsing in Miri

Terminfo parsing takes a significant amount of time in Miri, making libtest startup very slow. To work around that Miri in fact unsets the `TERM` variable. However, this means we don't get colors in `cargo miri test`.

So I propose we add some logic in libtest that skips parsing terminfo files under Miri, and just uses the regular basic coloring commands (taken from the `colored` crate).

As far as I can see, these two commands are all that libtest ever needs from terminfo, so Miri doesn't even lose any functionality through this. If you want I can entirely remove the terminfo parsing code and just use these commands instead.

Cc https://github.com/rust-lang/miri/issues/2292 `@saethlin`

22 months agoRollup merge of #100194 - est31:box_syntax_tests, r=Mark-Simulacrum
Matthias Krüger [Sun, 7 Aug 2022 19:10:24 +0000 (21:10 +0200)]
Rollup merge of #100194 - est31:box_syntax_tests, r=Mark-Simulacrum

Remove even more box syntax uses from src/test

Prior work, notably #88316 has removed box syntax from most of the testsuite.
However, some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
This migrates the tests where `box` is mostly an "implementation detail" and not the primary thing being tested by the test.
Furthermore, some tests from the mir-opt test suite are not being migrated.

22 months agoRollup merge of #100038 - nicholasbishop:bishop-add-no-std, r=Mark-Simulacrum
Matthias Krüger [Sun, 7 Aug 2022 19:10:23 +0000 (21:10 +0200)]
Rollup merge of #100038 - nicholasbishop:bishop-add-no-std, r=Mark-Simulacrum

Document the `no-std` target option in config.toml.example

22 months agoRollup merge of #100019 - TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait...
Matthias Krüger [Sun, 7 Aug 2022 19:10:22 +0000 (21:10 +0200)]
Rollup merge of #100019 - TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait, r=compiler-errors

Revive suggestions for boxed trait objects instead of impl Trait

The suggestion implemented in #75608 was not working properly, so I fixed it.

22 months agoAuto merge of #100218 - nicholasbishop:bishop-update-cb, r=Mark-Simulacrum
bors [Sun, 7 Aug 2022 18:44:41 +0000 (18:44 +0000)]
Auto merge of #100218 - nicholasbishop:bishop-update-cb, r=Mark-Simulacrum

Update compiler_builtins to 0.1.78

Among other things, this pulls in https://github.com/rust-lang/compiler-builtins/pull/475, which fixes some i128/u128 arithmetic operations on the `x86_64-unknown-uefi` target.

22 months agoUpdate SUMMARY.md
Lokathor [Sun, 7 Aug 2022 18:42:25 +0000 (12:42 -0600)]
Update SUMMARY.md

22 months agoCreate armv4t_none_eabi.md
Lokathor [Sun, 7 Aug 2022 18:41:38 +0000 (12:41 -0600)]
Create armv4t_none_eabi.md

22 months agoCreate armv4t_none_eabi.rs
Lokathor [Sun, 7 Aug 2022 18:40:41 +0000 (12:40 -0600)]
Create armv4t_none_eabi.rs

22 months agoAuto merge of #99833 - andrewpollack:fuchsia-rust-ci-zircon-lib-improvement, r=Mark...
bors [Sun, 7 Aug 2022 15:58:30 +0000 (15:58 +0000)]
Auto merge of #99833 - andrewpollack:fuchsia-rust-ci-zircon-lib-improvement, r=Mark-Simulacrum

Fuchsia CI zircon lib improvement

Removing Zircon build process, instead pulling `sysroot` and related libs directly from Fuchsia SDK

cc. `@tmandry` `@djkoloski`

22 months agotest: skip terminfo parsing in Miri
Ralf Jung [Sat, 6 Aug 2022 18:17:40 +0000 (14:17 -0400)]
test: skip terminfo parsing in Miri

22 months agoFurther improve error message for E0081
Bryysen [Sun, 7 Aug 2022 15:24:25 +0000 (17:24 +0200)]
Further improve error message for E0081

Multiple duplicate assignments of the same discriminant are now reported
in the samme error. We now point out the incrementation start point for
discriminants that are not explicitly assigned that are also duplicates.
Removed old test related to E0081 that is now covered by error-codes/E0081.rs.
Also refactored parts of the `check_enum` function.

22 months agoShifting CI to pull Zircon libraries directly from Fuchsia SDK
Andrew Pollack [Wed, 27 Jul 2022 23:47:19 +0000 (23:47 +0000)]
Shifting CI to pull Zircon libraries directly from Fuchsia SDK

PR feedback

PR Followups

Updating clang download

Updating clang download

Restructuring env used

Restructuring env used

Adding chmod

Adding chmod

Adding chmod

23 months agoAuto merge of #99983 - RalfJung:more-layout-checks, r=eddyb
bors [Sun, 7 Aug 2022 13:17:54 +0000 (13:17 +0000)]
Auto merge of #99983 - RalfJung:more-layout-checks, r=eddyb

More layout sanity checks

r? `@eddyb`

23 months agoUse start_point instead of next_point to point to elided lifetime ampersand.
Camille GILLOT [Sun, 7 Aug 2022 12:35:11 +0000 (14:35 +0200)]
Use start_point instead of next_point to point to elided lifetime ampersand.

23 months agoAuto merge of #12956 - oxalica:feat/la-arena-apis, r=lnicola
bors [Sun, 7 Aug 2022 08:50:23 +0000 (08:50 +0000)]
Auto merge of #12956 - oxalica:feat/la-arena-apis, r=lnicola

More methods and traits for `la_arena::ArenaMap`

Continue of #12931. Seems that I forgot some methods in the previous PR :(

I also changed `ArenaMap::insert` to return the old value, to match the map-like collection API of std. **So this is a breaking change.**

r? `@lnicola`

23 months agofix wrong suggestions for boxed trait objects instead of impl trait
Takayuki Maeda [Mon, 1 Aug 2022 11:22:50 +0000 (20:22 +0900)]
fix wrong suggestions for boxed trait objects instead of impl trait

23 months agorevive suggestions for boxed trait objects instead of impl Trait
Takayuki Maeda [Mon, 1 Aug 2022 09:42:16 +0000 (18:42 +0900)]
revive suggestions for boxed trait objects instead of impl Trait

23 months agoAuto merge of #12959 - lnicola:rainbows-again, r=lnicola
bors [Sun, 7 Aug 2022 06:30:11 +0000 (06:30 +0000)]
Auto merge of #12959 - lnicola:rainbows-again, r=lnicola

Fix `test_rainbow_highlighting` gate

CC https://github.com/rust-lang/rust-analyzer/pull/12903#pullrequestreview-1058906953

23 months agoFix test_rainbow_highlighting gate
Laurențiu Nicola [Sun, 7 Aug 2022 06:29:26 +0000 (09:29 +0300)]
Fix test_rainbow_highlighting gate

23 months agoAuto merge of #100091 - chenyukang:add-check-for-link-ordinal, r=michaelwoerister
bors [Sun, 7 Aug 2022 05:37:29 +0000 (05:37 +0000)]
Auto merge of #100091 - chenyukang:add-check-for-link-ordinal, r=michaelwoerister

Check link ordinal to make sure it is targetted  for foreign function

Fix #100009, when link ordinal is not target for foreign functions, emit an error.

cc `@dpaoliello`

23 months agoAuto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrum
bors [Sun, 7 Aug 2022 02:56:48 +0000 (02:56 +0000)]
Auto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrum

Move `x test --skip` to be part of `--exclude`

`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`.
Fix --exclude to work properly for files and directories rather than having a separate flag.

Fixes https://github.com/rust-lang/rust/issues/96342. cc https://github.com/rust-lang/rust/pull/96493#issuecomment-1200521720

r? `@Mark-Simulacrum`

23 months agoRemove even more box syntax uses from src/test
est31 [Thu, 7 Jul 2022 02:36:10 +0000 (04:36 +0200)]
Remove even more box syntax uses from src/test

Prior work, notably 6550021124451628b1efc60c59284465b109e3aa from #88316
has removed box syntax from most of the testsuite. However,
some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
Some tests that are very box syntax specific are not being migrated.

23 months agoUpdate compiler_builtins to 0.1.78
Nicholas Bishop [Sun, 7 Aug 2022 00:49:48 +0000 (20:49 -0400)]
Update compiler_builtins to 0.1.78

23 months agoAuto merge of #100213 - matthiaskrgr:rollup-mqe7t1n, r=matthiaskrgr
bors [Sat, 6 Aug 2022 23:38:28 +0000 (23:38 +0000)]
Auto merge of #100213 - matthiaskrgr:rollup-mqe7t1n, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #100071 (deps: dedupe `annotate-snippets` crate versions)
 - #100127 (Remove Windows function preloading)
 - #100130 (Avoid pointing out `return` span if it has nothing to do with type error)
 - #100169 (Optimize `pointer::as_aligned_to`)
 - #100175 (ascii -> ASCII in code comment)

Failed merges:

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

23 months agoRollup merge of #100175 - fxn:patch-1, r=Mark-Simulacrum
Matthias Krüger [Sat, 6 Aug 2022 23:19:35 +0000 (01:19 +0200)]
Rollup merge of #100175 - fxn:patch-1, r=Mark-Simulacrum

ascii -> ASCII in code comment

Easy one I spotted while reading source code.

23 months agoRollup merge of #100169 - WaffleLapkin:optimize_is_aligned_to, r=workingjubilee
Matthias Krüger [Sat, 6 Aug 2022 23:19:34 +0000 (01:19 +0200)]
Rollup merge of #100169 - WaffleLapkin:optimize_is_aligned_to, r=workingjubilee

Optimize `pointer::as_aligned_to`

This PR replaces `addr % align` with `addr & align - 1`, which is correct due to `align` being a power of two.

Here is a proof that this makes things better: [[godbolt]](https://godbolt.org/z/Wbq3hx6YG).

This PR also removes `assume(align != 0)`, with the new impl it does not improve anything anymore ([[godbolt]](https://rust.godbolt.org/z/zcnrG4777), [[original concern]](https://github.com/rust-lang/rust/pull/95643#discussion_r843326903)).

23 months agoRollup merge of #100130 - compiler-errors:erroneous-return-span, r=lcnr
Matthias Krüger [Sat, 6 Aug 2022 23:19:33 +0000 (01:19 +0200)]
Rollup merge of #100130 - compiler-errors:erroneous-return-span, r=lcnr

Avoid pointing out `return` span if it has nothing to do with type error

This code:

```rust
fn f(_: String) {}

fn main() {
    let x = || {
        if true {
            return ();
        }
        f("");
    };
}
```

Emits this:
```
   Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
 --> src/main.rs:8:11
  |
8 |         f("");
  |           ^^- help: try using a conversion method: `.to_string()`
  |           |
  |           expected struct `String`, found `&str`
  |
note: return type inferred to be `String` here
 --> src/main.rs:6:20
  |
6 |             return ();
  |                    ^^
```

Specifically, that note has nothing to do with the type error in question. This is because the change implemented in #84244 tries to point out the `return` span on _any_ type coercion error within a closure that happens after a `return` statement, regardless of if the error has anything to do with it.

This is really easy to trigger -- just needs a closure (or an `async`) and an early return (or any other form, e.g. `?` operator suffices) -- and super distracting in production codebases. I'm letting #84128 regress because that issue is much harder to fix correctly, and I can re-open that issue after this lands.

As a drive-by, I added a `resolve_vars_if_possible` to the coercion error logic, which leads to some error improvements. Unrelated to the issue above, though.

23 months agoRollup merge of #100127 - ChrisDenton:remove-init, r=thomcc
Matthias Krüger [Sat, 6 Aug 2022 23:19:32 +0000 (01:19 +0200)]
Rollup merge of #100127 - ChrisDenton:remove-init, r=thomcc

Remove Windows function preloading

After `@Mark-Simulacrum` asked me to provide guidance for when optionally imported functions should be preloaded, I realised my justifications were now quite weak. I think the strongest argument that can be made is that it avoids some degree of nondeterminism when calling these functions (in as far as system API calls can be said to be deterministic). However, I don't think that's particularly convincing unless there's a real world use case where it matters. Further discussion with `@thomcc` has strengthened my feeling that preloading isn't really needed.

Note that `WaitOnAddress` needed some adjustment to work without preloading. I opted not to use a macro for this special case as it seemed silly to do so for just one thing (and I don't like macros tbh).

23 months agoRollup merge of #100071 - klensy:annotate-snippets-bump, r=Mark-Simulacrum
Matthias Krüger [Sat, 6 Aug 2022 23:19:32 +0000 (01:19 +0200)]
Rollup merge of #100071 - klensy:annotate-snippets-bump, r=Mark-Simulacrum

deps: dedupe `annotate-snippets` crate versions

Dedupes `annotate-snippets` crate versions (https://github.com/rust-lang/annotate-snippets-rs/blob/0.9.1/CHANGELOG.md). Should work, but there is not a lot of tests.

Looks like switching to that crate a bit stalled.

23 months agoremove Clean trait implementation for ty::Predicate
Guillaume Gomez [Sat, 6 Aug 2022 22:36:23 +0000 (00:36 +0200)]
remove Clean trait implementation for ty::Predicate

23 months agoremove Clean trait implementation for hir::WherePredicate
Guillaume Gomez [Sat, 6 Aug 2022 22:30:18 +0000 (00:30 +0200)]
remove Clean trait implementation for hir::WherePredicate

23 months agoAuto merge of #100117 - nicholasbishop:bishop-update-cc, r=Mark-Simulacrum
bors [Sat, 6 Aug 2022 21:10:52 +0000 (21:10 +0000)]
Auto merge of #100117 - nicholasbishop:bishop-update-cc, r=Mark-Simulacrum

Bump cc version in bootstrap

Among other changes, the newer cc release pulls in this fix:
https://github.com/rust-lang/cc-rs/commit/b2792e33ff91b92e2e920e54d582b0c334670c37

This fixes errors when building compiler_builtins for UEFI targets.

23 months agoReturns the old value for la_arena::ArenaMap::insert
oxalica [Sat, 6 Aug 2022 20:48:52 +0000 (04:48 +0800)]
Returns the old value for la_arena::ArenaMap::insert

23 months agoImpl more methods and traits for la_arena::ArenaMap
oxalica [Sat, 6 Aug 2022 20:17:04 +0000 (04:17 +0800)]
Impl more methods and traits for la_arena::ArenaMap

23 months agoDocument the `no-std` target option in config.toml.example
Nicholas Bishop [Mon, 1 Aug 2022 22:12:07 +0000 (18:12 -0400)]
Document the `no-std` target option in config.toml.example

23 months agorustdoc: do not mark the contents of a skipped module as inlined
Michael Howell [Sat, 6 Aug 2022 20:17:40 +0000 (13:17 -0700)]
rustdoc: do not mark the contents of a skipped module as inlined

23 months agoAuto merge of #99524 - cuviper:relnotes-1.63.0, r=Mark-Simulacrum
bors [Sat, 6 Aug 2022 17:50:41 +0000 (17:50 +0000)]
Auto merge of #99524 - cuviper:relnotes-1.63.0, r=Mark-Simulacrum

Add release notes for Rust 1.63.0

23 months agoAvoid ICE in rustdoc.
Camille GILLOT [Sat, 6 Aug 2022 17:42:52 +0000 (19:42 +0200)]
Avoid ICE in rustdoc.

23 months agoAuto merge of #100195 - matthiaskrgr:rollup-ovzyyb0, r=matthiaskrgr
bors [Sat, 6 Aug 2022 15:09:59 +0000 (15:09 +0000)]
Auto merge of #100195 - matthiaskrgr:rollup-ovzyyb0, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #100094 (Detect type mismatch due to loop that might never iterate)
 - #100132 (Use (actually) dummy place for let-else divergence)
 - #100167 (Recover `require`, `include` instead of `use` in item)
 - #100193 (Remove more Clean trait implementations)

Failed merges:

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

23 months agoAuto merge of #12953 - stanciuadrian:fmt, r=lnicola
bors [Sat, 6 Aug 2022 15:02:30 +0000 (15:02 +0000)]
Auto merge of #12953 - stanciuadrian:fmt, r=lnicola

Run stable `fmt` & `cargo` through `rustup`

`cargo test -p ide-assists` fails on Windows/x64/nightly:

```shell
> rustup self update
info: checking for self-updates
  rustup unchanged - 1.25.1

> rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-updates

   stable-x86_64-pc-windows-msvc unchanged - rustc 1.62.1 (e092d0b6b 2022-07-16)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.64.0-nightly (affe0d3a0 2022-08-05)

info: cleaning up downloads & tmp directories

> rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\stanc\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)

active toolchain
----------------

nightly-x86_64-pc-windows-msvc (default)
rustc 1.64.0-nightly (affe0d3a0 2022-08-05)

> cargo test -p ide-assists

test tests::sourcegen::sourcegen_assists_docs ... FAILED

failures:

---- tests::sourcegen::sourcegen_assists_docs stdout ----
thread 'tests::sourcegen::sourcegen_assists_docs' panicked at 'Failed to run rustfmt from toolchain 'stable'. Please run `rustup component add rustfmt --toolchain stable` to install it.', crates\sourcegen\src\lib.rs:141:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    tests::sourcegen::sourcegen_assists_docs

test result: FAILED. 1576 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.82s

error: test failed, to rerun pass '-p ide-assists --lib'
```

After some investigation it seemed that [`cmd!`](https://github.com/rust-lang/rust-analyzer/blob/51705698bd66919435e4fcbc25d96bd7fc5583f4/crates/sourcegen/src/lib.rs#L139) didn't execute the expected (stable) rustfmt.

A simple `xshell` test failed too:

```rust
use xshell::{cmd, Shell};

fn main() {
    let sh = &Shell::new().unwrap();
    sh.set_var("RUSTUP_TOOLCHAIN", "stable");
    let version = cmd!(sh, "rustfmt --version").read().unwrap_or_default();
    println!("{version}");
}
```

Bypassing `xshell` and using `Command` directly failed too:

```rust
use std::process::{Command, Stdio};

fn main() {
    let child = Command::new("rustfmt")
        .arg("--version")
        .stdin(Stdio::null())
        .stdout(Stdio::piped())
        .env("RUSTUP_TOOLCHAIN", "stable")
        .spawn()
        .expect("failed to start");
    let output = child.wait_with_output().unwrap();
    let version = String::from_utf8_lossy(&output.stdout);
    println!("{version}");
}
```

Spawning `cargo +stable fmt version` [failed too](https://github.com/rust-lang/rustup/issues/3036) with `error: no such subcommand: +stable`.

Only `rustup run stable` worked fine for both `cargo` and `fmt`.

Thanks to `@lnicola` for a live investigation session, hints and tips.

23 months agorun stable fmt through rustup
Adrian Stanciu [Sat, 6 Aug 2022 14:12:13 +0000 (17:12 +0300)]
run stable fmt through rustup

23 months agoRollup merge of #100193 - GuillaumeGomez:rm-clean-impls, r=notriddle
Matthias Krüger [Sat, 6 Aug 2022 14:16:00 +0000 (16:16 +0200)]
Rollup merge of #100193 - GuillaumeGomez:rm-clean-impls, r=notriddle

Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`

23 months agoRollup merge of #100167 - chenyukang:require-suggestion, r=estebank
Matthias Krüger [Sat, 6 Aug 2022 14:15:59 +0000 (16:15 +0200)]
Rollup merge of #100167 - chenyukang:require-suggestion, r=estebank

Recover `require`, `include` instead of `use` in item

Fix #100140

23 months agoRollup merge of #100132 - compiler-errors:issue-100103, r=tmiasko
Matthias Krüger [Sat, 6 Aug 2022 14:15:56 +0000 (16:15 +0200)]
Rollup merge of #100132 - compiler-errors:issue-100103, r=tmiasko

Use (actually) dummy place for let-else divergence

Fixes #100103

23 months agoRollup merge of #100094 - lyming2007:issue-98982, r=estebank
Matthias Krüger [Sat, 6 Aug 2022 14:15:56 +0000 (16:15 +0200)]
Rollup merge of #100094 - lyming2007:issue-98982, r=estebank

Detect type mismatch due to loop that might never iterate

When loop as tail expression causes a miss match type E0308 error, recursively get the return statement and add diagnostic information on it.

23 months agoAuto merge of #12931 - oxalica:feat/la-arena-apis, r=lnicola
bors [Sat, 6 Aug 2022 13:39:31 +0000 (13:39 +0000)]
Auto merge of #12931 - oxalica:feat/la-arena-apis, r=lnicola

Add more constructors and entry-APIs for la-arena

`la-arena` on crates.io is quite helpful when just a thin wrapper for Vec with u32 indices is needed.
But the current API is not ergonomic enough.

This PR
- Adds `ArenaMap::new`. Not sure why only `Arena` has it now.
- Adds `Arena{,Map}::with_capacity` for known-size storage.
- Adds entry-API for `ArenaMap` for easier `.entry(idx).or_default().push(value)` or `.entry(idx).or_insert(...)` operations.

23 months agoAuto merge of #99893 - compiler-errors:issue-99387, r=davidtwco
bors [Sat, 6 Aug 2022 12:29:11 +0000 (12:29 +0000)]
Auto merge of #99893 - compiler-errors:issue-99387, r=davidtwco

Delay formatting trimmed path until lint/error is emitted

Fixes #99387

r? `@davidtwco`

23 months agoremove Clean trait implementation for hir::PolyTraitRef
Guillaume Gomez [Sat, 6 Aug 2022 09:54:54 +0000 (11:54 +0200)]
remove Clean trait implementation for hir::PolyTraitRef

23 months agoremove Clean trait implementation for hir::GenericBound
Guillaume Gomez [Sat, 6 Aug 2022 09:52:27 +0000 (11:52 +0200)]
remove Clean trait implementation for hir::GenericBound

23 months agoAuto merge of #100172 - Mark-Simulacrum:bump-165, r=Mark-Simulacrum
bors [Sat, 6 Aug 2022 09:37:32 +0000 (09:37 +0000)]
Auto merge of #100172 - Mark-Simulacrum:bump-165, r=Mark-Simulacrum

Bump to 1.65.0

r? `@Mark-Simulacrum`

23 months agoAuto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726
bors [Sat, 6 Aug 2022 06:48:15 +0000 (06:48 +0000)]
Auto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726

Some `FulfillmentContext`-related cleanups

Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others...

r? types

23 months agoAuto merge of #100035 - workingjubilee:merge-functions, r=nikic
bors [Fri, 5 Aug 2022 23:11:49 +0000 (23:11 +0000)]
Auto merge of #100035 - workingjubilee:merge-functions, r=nikic

Enable function merging when opt is for size

It is, of course, natural to want to merge aliasing functions when
optimizing for code size, since that can eliminate several bytes.
And an exhaustive match helps make the code less brittle.

Closes #98215.

23 months agoEnable function merging when opt is for size
Jubilee Young [Mon, 1 Aug 2022 21:04:14 +0000 (14:04 -0700)]
Enable function merging when opt is for size

It is, of course, natural to want to merge aliasing functions when
optimizing for code size, since that can eliminate several bytes.
And an exhaustive match helps make the code less brittle.

23 months agoimplement #98982
Yiming Lei [Wed, 3 Aug 2022 04:46:07 +0000 (21:46 -0700)]
implement #98982
when loop as tail expression for miss match type E0308 error, recursively get
the return statement and add diagnostic information on it
use rustc_hir::intravisit to collect the return expression
modified:   compiler/rustc_typeck/src/check/coercion.rs
new file:   src/test/ui/typeck/issue-98982.rs
new file:   src/test/ui/typeck/issue-98982.stderr

23 months agoUpdate RELEASES.md
Josh Stone [Fri, 5 Aug 2022 17:02:46 +0000 (10:02 -0700)]
Update RELEASES.md

Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
23 months agoUpdate RELEASES.md
Josh Stone [Fri, 5 Aug 2022 17:02:38 +0000 (10:02 -0700)]
Update RELEASES.md

Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
23 months agoascii -> ASCII in code comment
Xavier Noria [Fri, 5 Aug 2022 16:45:42 +0000 (18:45 +0200)]
ascii -> ASCII in code comment

23 months agomove DiagnosticArgFromDisplay into rustc_errors
Michael Goulet [Fri, 5 Aug 2022 16:43:52 +0000 (16:43 +0000)]
move DiagnosticArgFromDisplay into rustc_errors

23 months agoDelay formatting trimmed path until lint/error is emitted
Michael Goulet [Fri, 29 Jul 2022 06:48:39 +0000 (06:48 +0000)]
Delay formatting trimmed path until lint/error is emitted

23 months agoAuto merge of #100174 - Dylan-DPC:rollup-wnskbk6, r=Dylan-DPC
bors [Fri, 5 Aug 2022 16:35:15 +0000 (16:35 +0000)]
Auto merge of #100174 - Dylan-DPC:rollup-wnskbk6, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #99835 (Suggest adding/removing `ref` for binding patterns)
 - #100155 (Use `node_type_opt` to skip over generics that were not expected)
 - #100157 (rustdoc: use `collect()` instead of repeatedly pushing)
 - #100158 (kmc-solid: Add a stub implementation of #98246 (`File::set_times`))
 - #100166 (Remove more Clean trait implementations)
 - #100168 (Improve diagnostics for `const a: = expr;`)

Failed merges:

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

23 months agoRollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
Dylan DPC [Fri, 5 Aug 2022 16:24:37 +0000 (21:54 +0530)]
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_const_item, r=compiler-errors

Improve diagnostics for `const a: = expr;`

Adds a suggestion to write a type when there is a colon, but the type is not present.
I've also shrunk spans a little, so the suggestions are a little nicer.

Resolves #100146

r? `@compiler-errors`

23 months agoRollup merge of #100166 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC
Dylan DPC [Fri, 5 Aug 2022 16:24:36 +0000 (21:54 +0530)]
Rollup merge of #100166 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC

Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`

23 months agoRollup merge of #100158 - solid-rs:patch/kmc-solid/follow-up-98246, r=joshtriplett
Dylan DPC [Fri, 5 Aug 2022 16:24:35 +0000 (21:54 +0530)]
Rollup merge of #100158 - solid-rs:patch/kmc-solid/follow-up-98246, r=joshtriplett

kmc-solid: Add a stub implementation of #98246 (`File::set_times`)

 Fixes the build failure of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets after #98246.

This target does not support setting a modification time and access time separately, hence stubbing out the implementation.

23 months agoRollup merge of #100157 - rust-lang:notriddle/use-map-instead-of-repeated-push, r...
Dylan DPC [Fri, 5 Aug 2022 16:24:34 +0000 (21:54 +0530)]
Rollup merge of #100157 - rust-lang:notriddle/use-map-instead-of-repeated-push, r=Dylan-DPC

rustdoc: use `collect()` instead of repeatedly pushing

23 months agoRollup merge of #100155 - compiler-errors:issue-100154, r=jackh726
Dylan DPC [Fri, 5 Aug 2022 16:24:33 +0000 (21:54 +0530)]
Rollup merge of #100155 - compiler-errors:issue-100154, r=jackh726

Use `node_type_opt` to skip over generics that were not expected

Fixes #100154

23 months agoRollup merge of #99835 - TaKO8Ki:suggest-adding-or-removing-ref-for-binding-pattern...
Dylan DPC [Fri, 5 Aug 2022 16:24:32 +0000 (21:54 +0530)]
Rollup merge of #99835 - TaKO8Ki:suggest-adding-or-removing-ref-for-binding-pattern, r=estebank

Suggest adding/removing `ref` for binding patterns

This fixes what a fixme comment says.

r? `@estebank`

23 months agoBump to 1.65.0
Mark Rousskov [Fri, 5 Aug 2022 15:32:46 +0000 (11:32 -0400)]
Bump to 1.65.0

23 months agoOptimize `pointer::as_aligned_to`
Maybe Waffle [Fri, 5 Aug 2022 13:11:47 +0000 (17:11 +0400)]
Optimize `pointer::as_aligned_to`

23 months agoAuto merge of #12947 - Veykril:switch-workspace, r=Veykril
bors [Fri, 5 Aug 2022 13:13:44 +0000 (13:13 +0000)]
Auto merge of #12947 - Veykril:switch-workspace, r=Veykril

Don't switch workspace on vfs file changes from libraries

When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.

23 months agoAuto merge of #12949 - Veykril:token-pick, r=Veykril
bors [Fri, 5 Aug 2022 13:06:10 +0000 (13:06 +0000)]
Auto merge of #12949 - Veykril:token-pick, r=Veykril

fix: Fix incorrect token pick rankings

23 months agoAuto merge of #100073 - dpaoliello:externvar, r=michaelwoerister
bors [Fri, 5 Aug 2022 13:05:34 +0000 (13:05 +0000)]
Auto merge of #100073 - dpaoliello:externvar, r=michaelwoerister

Add test for raw-dylib with an external variable

All existing tests of link kind `raw-dylib` only validate the ability to link against functions, but it is also possible to link against variables.

This adds tests for linking against a variable using `raw-dylib` both by-name and by-ordinal.

23 months agofix: Fix incorrect token pick rankings
Lukas Wirth [Fri, 5 Aug 2022 12:59:26 +0000 (14:59 +0200)]
fix: Fix incorrect token pick rankings

23 months agoAuto merge of #12948 - Veykril:classify-ops, r=Veykril
bors [Fri, 5 Aug 2022 12:55:36 +0000 (12:55 +0000)]
Auto merge of #12948 - Veykril:classify-ops, r=Veykril

feat: Handle operators like their trait functions in the IDE

Allows hover and goto implementation to work on `?`, indexing brackets, binary operators, prefix operators and `await`. Regarding `await`, hover will continue to show the keyword docs while goto implementation will bring the user to the `poll` function of the `Future` implementation.
![Code_CJmZ3FGFVn](https://user-images.githubusercontent.com/3757771/183076683-c9899bd6-60d3-461b-965f-0c0f9745e2e8.gif)

Fixes https://github.com/rust-lang/rust-analyzer/issues/12810

23 months agoSimplify
Lukas Wirth [Fri, 5 Aug 2022 12:54:14 +0000 (14:54 +0200)]
Simplify

23 months agoFix visibilities
Lukas Wirth [Fri, 5 Aug 2022 12:28:36 +0000 (14:28 +0200)]
Fix visibilities