]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoUse correct drop scopes for if expressions
Matthew Jasper [Thu, 25 Feb 2021 22:37:22 +0000 (22:37 +0000)]
Use correct drop scopes for if expressions

2 years agoAuto merge of #87982 - m-ou-se:non-fmt-panic-assert-str, r=cjgillot
bors [Sun, 15 Aug 2021 17:57:39 +0000 (17:57 +0000)]
Auto merge of #87982 - m-ou-se:non-fmt-panic-assert-str, r=cjgillot

Add automatic migration for assert!(.., string).

Fixes part of #87313.

2 years agoAdd a dead code test for using anon const in pattern
Gary Guo [Sat, 14 Aug 2021 20:56:57 +0000 (21:56 +0100)]
Add a dead code test for using anon const in pattern

2 years agoUpdate RELEASES.md for 1.55.0
Erin Power [Fri, 30 Jul 2021 11:32:16 +0000 (13:32 +0200)]
Update RELEASES.md for 1.55.0

Co-authored-by: Eric Huss <eric@huss.org>
Co-authored-by: inquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com>
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Co-authored-by: Daniel Giger <danielg3432@gmail.com>
2 years agomove object safety test to library/core
ibraheemdev [Sun, 15 Aug 2021 17:00:25 +0000 (13:00 -0400)]
move object safety test to library/core

2 years agoUpdate redox_syscall
bjorn3 [Sun, 15 Aug 2021 16:40:40 +0000 (18:40 +0200)]
Update redox_syscall

The currently pinned version doesn't compile with the latest rustc nightly

2 years agoAuto merge of #87792 - GuillaumeGomez:ci-fetch, r=pietroalbini
bors [Sun, 15 Aug 2021 14:02:40 +0000 (14:02 +0000)]
Auto merge of #87792 - GuillaumeGomez:ci-fetch, r=pietroalbini

Remove git fetch from CI

https://github.com/rust-lang/rust/pull/86623 added a call to `git fetch`, which is problematic for releases.

r? `@pietroalbini`

2 years agoDe-dupe NLL HRTB diagnostics' use of `type_op_prove_predicate`
Rémy Rakic [Sun, 15 Aug 2021 12:49:36 +0000 (14:49 +0200)]
De-dupe NLL HRTB diagnostics' use of `type_op_prove_predicate`

2 years agoFix ui tests for llvm_asm! deprecation
Amanieu d'Antras [Thu, 29 Jul 2021 17:45:13 +0000 (19:45 +0200)]
Fix ui tests for llvm_asm! deprecation

2 years agoAllow the use of the deprecated llvm_asm! in black_box
Amanieu d'Antras [Wed, 11 Aug 2021 23:18:53 +0000 (00:18 +0100)]
Allow the use of the deprecated llvm_asm! in black_box

2 years agoDeprecate llvm_asm!
Amanieu d'Antras [Thu, 29 Jul 2021 14:51:32 +0000 (16:51 +0200)]
Deprecate llvm_asm!

2 years agoAuto merge of #86692 - dns2utf8:parallelize_rustdoc-gui_tests, r=GuillaumeGomez
bors [Sun, 15 Aug 2021 10:56:35 +0000 (10:56 +0000)]
Auto merge of #86692 - dns2utf8:parallelize_rustdoc-gui_tests, r=GuillaumeGomez

Run rustdoc-gui tests in parallel

I hid the passing tests and only show the failed ones in alphabetical order:
![image](https://user-images.githubusercontent.com/739070/123663020-84e63100-d825-11eb-9b35-0a8c30cd219c.png)

Also this PR cuts down the execution time from ~40 to ~9 seconds

2 years agoAuto merge of #87975 - m-ou-se:unused-import-attributes, r=nagisa
bors [Sun, 15 Aug 2021 07:40:53 +0000 (07:40 +0000)]
Auto merge of #87975 - m-ou-se:unused-import-attributes, r=nagisa

Include attributes in removal span for unused imports.

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

2 years agodon't derive `Copy` for `RegionElement`
Rémy Rakic [Mon, 12 Jul 2021 19:11:02 +0000 (21:11 +0200)]
don't derive `Copy` for `RegionElement`

2 years agoSlight cleanup
Rémy Rakic [Sat, 26 Jun 2021 18:27:37 +0000 (20:27 +0200)]
Slight cleanup

2 years agoFix dyn trait warning
Rémy Rakic [Tue, 22 Jun 2021 21:57:30 +0000 (23:57 +0200)]
Fix dyn trait warning

2 years agoReport nicer errors for HRTB NLL errors from queries
Matthew Jasper [Mon, 7 Jun 2021 19:25:19 +0000 (20:25 +0100)]
Report nicer errors for HRTB NLL errors from queries

2 years agoReport mismatched type errors for bound region errors in NLL
Matthew Jasper [Sun, 7 Mar 2021 15:08:52 +0000 (15:08 +0000)]
Report mismatched type errors for bound region errors in NLL

2 years agoTrack causes for universes created during borrowck
Matthew Jasper [Sun, 7 Mar 2021 14:41:45 +0000 (14:41 +0000)]
Track causes for universes created during borrowck

2 years agoSimplify BoundUniversalRegionError
Matthew Jasper [Sat, 6 Mar 2021 11:22:08 +0000 (11:22 +0000)]
Simplify BoundUniversalRegionError

2 years agoReturn the canonicalized query from type ops
Matthew Jasper [Sat, 6 Mar 2021 11:12:25 +0000 (11:12 +0000)]
Return the canonicalized query from type ops

2 years agoShow bound lifetimes when comparing types in diagnostics
Matthew Jasper [Wed, 3 Mar 2021 12:14:35 +0000 (12:14 +0000)]
Show bound lifetimes when comparing types in diagnostics

2 years agoRemove unused Option from NllTypeRelatingDelegate
Matthew Jasper [Sat, 20 Feb 2021 13:27:17 +0000 (13:27 +0000)]
Remove unused Option from NllTypeRelatingDelegate

2 years agoAuto merge of #87974 - steffahn:slice_split_size_hints, r=dtolnay
bors [Sun, 15 Aug 2021 04:48:42 +0000 (04:48 +0000)]
Auto merge of #87974 - steffahn:slice_split_size_hints, r=dtolnay

Test and fix `size_hint` for slice’s [r]split* iterators

Adds extensive test (of `size_hint`) for all the _[r]split*_ iterators.
Fixes `size_hint` upper bound for _split_inclusive*_ iterators which was one higher than necessary for non-empty slices.
Fixes `size_hint` lower bound for _[r]splitn*_ iterators when _n == 0_, which was one too high.

**Lower bound being one too high was a logic error, violating the correctness condition of `size_hint`.**

_Edit:_ I’ve opened an issue for that bug, so this PR fixes #87978

2 years agoAuto merge of #87581 - Amanieu:asm_clobber_abi, r=nagisa
bors [Sat, 14 Aug 2021 22:29:27 +0000 (22:29 +0000)]
Auto merge of #87581 - Amanieu:asm_clobber_abi, r=nagisa

Add support for clobber_abi to asm!

This PR adds the `clobber_abi` feature that was proposed in #81092.

Fixes #81092

cc `@rust-lang/wg-inline-asm`

r? `@nagisa`

2 years agoFix dead code warning when inline const is used in pattern
Gary Guo [Sat, 14 Aug 2021 20:54:17 +0000 (21:54 +0100)]
Fix dead code warning when inline const is used in pattern

2 years agoMore spacing between the different blocks of results
Stefan Schindler [Sat, 14 Aug 2021 21:36:17 +0000 (23:36 +0200)]
More spacing between the different blocks of results

2 years agoImplement a finish method for the status_bar and some cleanup
Stefan Schindler [Sat, 14 Aug 2021 21:19:28 +0000 (23:19 +0200)]
Implement a finish method for the status_bar and some cleanup

2 years agoAuto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk
bors [Sat, 14 Aug 2021 19:59:08 +0000 (19:59 +0000)]
Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk

Run RemoveZsts pass at mir-opt-level=1

per https://github.com/rust-lang/rust/pull/83177#issuecomment-803942217

This pass removes assignments to ZST places.

Perf (from https://github.com/rust-lang/rust/pull/83177#issuecomment-803442557): https://perf.rust-lang.org/compare.html?start=41b315a470d583f6446599984ff9ad3bd61012b2&end=bd5d1b96f0c64c9938feea831789e1b5bb2cd4a2

r? `@oli-obk`

2 years agoFix `reachable_set` for non-function items in non-library crates
hyd-dev [Sat, 14 Aug 2021 15:24:33 +0000 (23:24 +0800)]
Fix `reachable_set` for non-function items in non-library crates

2 years agoAuto merge of #87324 - asquared31415:named-asm-labels, r=Amanieu
bors [Sat, 14 Aug 2021 17:33:38 +0000 (17:33 +0000)]
Auto merge of #87324 - asquared31415:named-asm-labels, r=Amanieu

Lint against named asm labels

This adds a deny-by-default lint to prevent the use of named labels in inline `asm!`.  Without a solution to #81088 about whether the compiler should rewrite named labels or a special syntax for labels, a lint against them should prevent users from writing assembly that could break for internal compiler reasons, such as inlining or anything else that could change the number of actual inline assembly blocks emitted.

This does **not** resolve the issue with rewriting labels, that still needs a decision if the compiler should do any more work to try to make them work.

2 years agomake `BuildHasher` object safe
ibraheemdev [Sat, 14 Aug 2021 04:02:02 +0000 (00:02 -0400)]
make `BuildHasher` object safe

2 years agoAssign FIXMEs to me and remove obsolete ones
Deadbeef [Sat, 14 Aug 2021 15:57:46 +0000 (15:57 +0000)]
Assign FIXMEs to me and remove obsolete ones

Also fixed capitalization of documentation

2 years agoAuto merge of #87913 - a1phyr:vec_spec_clone_from, r=dtolnay
bors [Sat, 14 Aug 2021 14:52:33 +0000 (14:52 +0000)]
Auto merge of #87913 - a1phyr:vec_spec_clone_from, r=dtolnay

Specialize `Vec::clone_from` for `Copy` types

This should improve performance and reduce code size.

This also improves `clone_from` for `String`, `OsString` and `PathBuf`.

2 years agoAuto merge of #87375 - fee1-dead:move-constness-to-traitpred, r=oli-obk
bors [Sat, 14 Aug 2021 12:06:34 +0000 (12:06 +0000)]
Auto merge of #87375 - fee1-dead:move-constness-to-traitpred, r=oli-obk

Try filtering out non-const impls when we expect const impls

**TL;DR**: Associated types on const impls are now bounded; we now disallow calling a const function with bounds when the specified type param only has a non-const impl.

r? `@oli-obk`

2 years agoAuto merge of #87600 - JohnTitor:classify-ui-tests, r=petrochenkov
bors [Sat, 14 Aug 2021 09:25:33 +0000 (09:25 +0000)]
Auto merge of #87600 - JohnTitor:classify-ui-tests, r=petrochenkov

Move some UI tests to more suitable subdirs

The classifui result: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427/e06c42226c6038da91e403c33b9947843420cf44

Some notes:
- backtrace-debuginfo.rs: previously I skipped this, I'm still not sure what the best dir is. Any ideas?
- estr-subtyping.rs: Seems a quite old test so removed, shouldn't?
- deref-suggestion.rs: moved to inference as `suggestions` is not an ideal dir.
- issue-43023.rs: a bit misclassified, moved to `derives`

cc #73494
r? `@petrochenkov`

2 years agoAuto merge of #85020 - lrh2000:named-upvars, r=tmandry
bors [Sat, 14 Aug 2021 07:01:36 +0000 (07:01 +0000)]
Auto merge of #85020 - lrh2000:named-upvars, r=tmandry

Name the captured upvars for closures/generators in debuginfo

Previously, debuggers print closures as something like
```
y::main::closure-0 (0x7fffffffdd34)
```
The pointer actually references to an upvar. It is not very obvious, especially for beginners.

It's because upvars don't have names before, as they are packed into a tuple. This PR names the upvars, so we can expect to see something like
```
y::main::closure-0 {_captured_ref__b: 0x[...]}
```

r? `@tmandry`
Discussed at https://github.com/rust-lang/rust/pull/84752#issuecomment-831639489 .

2 years agoAuto merge of #88006 - GuillaumeGomez:update-browser-ui-test-dep, r=notriddle
bors [Sat, 14 Aug 2021 04:09:22 +0000 (04:09 +0000)]
Auto merge of #88006 - GuillaumeGomez:update-browser-ui-test-dep, r=notriddle

Update browser-ui-test package version

r? `@notriddle`

2 years agoAuto merge of #87997 - sl4m:update-favicon-order, r=GuillaumeGomez
bors [Sat, 14 Aug 2021 01:12:22 +0000 (01:12 +0000)]
Auto merge of #87997 - sl4m:update-favicon-order, r=GuillaumeGomez

Updates favicon order of precedence as it matters to Chrome

Hi, this updates #75438 to fix an order of precedence issue for Chrome. Unfortunately, the last favicon defined wins when it comes to Chrome, hence the primary icon being placed last. I [brought it up](https://bugs.chromium.org/p/chromium/issues/detail?id=1104663) with the Chromium team last year, but so far it's a non-issue.

I've created an example website that mimics the behaviour in Chrome. https://sl4m.github.io/chrome-favicon/

This is what I'm seeing at the moment when viewing https://doc.rust-lang.org/core/index.html in Chrome. It's falling back to the PNG.

<img width="80" alt="Screenshot 2021-08-12 at 21 11 58" src="https://user-images.githubusercontent.com/47347/129304041-b598213e-fcd3-4df1-addb-e6feac6c35b1.png">

2 years agoAuto merge of #87478 - jackh726:issue-84931, r=estebank
bors [Fri, 13 Aug 2021 22:28:01 +0000 (22:28 +0000)]
Auto merge of #87478 - jackh726:issue-84931, r=estebank

Point to where clause for GATs to add bound

Fixes #84931

r? `@estebank`

2 years agoPoint to where clause for GATs
jackh726 [Mon, 26 Jul 2021 02:12:34 +0000 (22:12 -0400)]
Point to where clause for GATs

2 years agoAuto merge of #86492 - hyd-dev:no-mangle-method, r=petrochenkov
bors [Fri, 13 Aug 2021 19:47:03 +0000 (19:47 +0000)]
Auto merge of #86492 - hyd-dev:no-mangle-method, r=petrochenkov

Associated functions that contain extern indicator or have `#[rustc_std_internal_symbol]` are reachable

Previously these fails to link with ``undefined reference to `foo'``:

<details>
<summary>Example 1</summary>

```rs
struct AssocFn;

impl AssocFn {
    #[no_mangle]
    fn foo() {}
}

fn main() {
    extern "Rust" {
        fn foo();
    }
    unsafe { foo() }
}
```
([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f1244afcdd26e2a28445f6e82ca46b50))
</details>

<details>
<summary>Example 2</summary>

```rs
#![crate_name = "lib"]
#![crate_type = "lib"]

struct AssocFn;

impl AssocFn {
    #[no_mangle]
    fn foo() {}
}
```
```rs
extern crate lib;

fn main() {
    extern "Rust" {
        fn foo();
    }
    unsafe { foo() }
}
```
</details>

But I believe they should link successfully, because this works:
<details>

```rs
#[no_mangle]
fn foo() {}

fn main() {
    extern "Rust" {
        fn foo();
    }
    unsafe { foo() }
}
```
([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=789b3f283ee6126f53939429103ed98d))
</details>

This PR fixes the problem, by adding associated functions that have "custom linkage" to `reachable_set`, just like normal functions.

I haven't tested whether #76211 and [Miri](https://github.com/rust-lang/miri/issues/1837) are fixed by this PR yet, but I'm submitting this anyway since this fixes the examples above.

I added a `run-pass` test that combines my two examples above, but I'm not sure if that's the right way to test this. Maybe I should add / modify an existing codegen test (`src/test/codegen/export-no-mangle.rs`?) instead?

2 years agoAuto merge of #87984 - m-ou-se:closure-lint-wording, r=Aaron1011
bors [Fri, 13 Aug 2021 16:57:34 +0000 (16:57 +0000)]
Auto merge of #87984 - m-ou-se:closure-lint-wording, r=Aaron1011

Closure lint wording

Some small changes to the wording of the closure migration lint.

r? `@Aaron1011`

2 years agoChange WASI's `RawFd` from `u32` to `c_int` (`i32`).
Dan Gohman [Fri, 13 Aug 2021 15:58:05 +0000 (08:58 -0700)]
Change WASI's `RawFd` from `u32` to `c_int` (`i32`).

WASI previously used `u32` as its `RawFd` type, since its "file descriptors"
are unsigned table indices, and there's no fundamental reason why WASI can't
have more than 2^31 handles.

However, this creates myriad little incompability problems with code
that also supports Unix platforms, where `RawFd` is `c_int`. While WASI
isn't a Unix, it often shares code with Unix, and this difference made
such shared code inconvenient. #87329 is the most recent example of such
code.

So, switch WASI to use `c_int`, which is `i32`. This will mean that code
intending to support WASI should ideally avoid assuming that negative file
descriptors are invalid, even though POSIX itself says that file descriptors
are never negative.

This is a breaking change, but `RawFd` is considerd an experimental
feature in [the documentation].

[the documentation]: https://doc.rust-lang.org/stable/std/os/wasi/io/type.RawFd.html

2 years agoEnable `--all-targets` for `x.py check` unconditionally
Joshua Nelson [Fri, 13 Aug 2021 16:03:17 +0000 (11:03 -0500)]
Enable `--all-targets` for `x.py check` unconditionally

Now that Cargo deduplicates diagnostics from different targets, this doesn't flood the console with
duplicate errors.

Note that this doesn't add `--all-targets` in `Builder::cargo` directly because `impl Step for Std`
actually wants to omit `--all-targets` the first time while it's still building libtest.

When passed `--all-targets`, this warns that the option isn't needed, but still continues to compile.

2 years agoUpdate tests for new closure migration lint wording.
Mara Bos [Thu, 12 Aug 2021 19:13:00 +0000 (21:13 +0200)]
Update tests for new closure migration lint wording.

2 years agoUpdate closure migration diagnostic wording.
Mara Bos [Thu, 12 Aug 2021 19:12:12 +0000 (21:12 +0200)]
Update closure migration diagnostic wording.

2 years agoAuto merge of #88009 - GuillaumeGomez:rollup-f194yyk, r=GuillaumeGomez
bors [Fri, 13 Aug 2021 14:16:12 +0000 (14:16 +0000)]
Auto merge of #88009 - GuillaumeGomez:rollup-f194yyk, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #87795 (Avoid ICE caused by suggestion)
 - #87966 (Fix `command-create-pidfd` test inside unprivileged Docker containers)
 - #87969 (Revert "Rollup merge of #87779 - Aaron1011:stmt-ast-id, r=petrochenkov")
 - #88005 (Add rustdoc GUI test for headers)

Failed merges:

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

2 years agoRollup merge of #88005 - GuillaumeGomez:headers-gui-tests, r=notriddle
Guillaume Gomez [Fri, 13 Aug 2021 13:29:12 +0000 (15:29 +0200)]
Rollup merge of #88005 - GuillaumeGomez:headers-gui-tests, r=notriddle

Add rustdoc GUI test for headers

Add test for #87861.

r? ``@notriddle``

2 years agoRollup merge of #87969 - Aaron1011:revert-stmt-id, r=petrochenkov
Guillaume Gomez [Fri, 13 Aug 2021 13:29:12 +0000 (15:29 +0200)]
Rollup merge of #87969 - Aaron1011:revert-stmt-id, r=petrochenkov

Revert "Rollup merge of #87779 - Aaron1011:stmt-ast-id, r=petrochenkov"

Fixes #87877

This change interacts badly with `noop_flat_map_stmt`,
which synthesizes multiple statements with the same `NodeId`.

I'm working on a better fix that will still allow us to
remove this special case. For now, let's revert the change
to fix the ICE.

This reverts commit a4262cc9841d91d48ef994b36eab323e615a7083, reversing
changes made to 8ee962f88e1be7e29482b13c7776c26b98a93bf7.

2 years agoRollup merge of #87966 - pietroalbini:fix-pidfd-test, r=m-ou-se
Guillaume Gomez [Fri, 13 Aug 2021 13:29:11 +0000 (15:29 +0200)]
Rollup merge of #87966 - pietroalbini:fix-pidfd-test, r=m-ou-se

Fix `command-create-pidfd` test inside unprivileged Docker containers

In `src/test/ui/command/command-create-pidfd.rs` (added #81825), the detection code to skip the test on unsupported platforms doesn't account for unprivileged Docker containers (CI uses privileged containers), which leads to a test failure as you can't call the `clone3` syscall in that environment. This PR enhances the detection code to also consider unprivileged containers.

2 years agoRollup merge of #87795 - estebank:erase-lifetimes-in-suggestion, r=oli-obk
Guillaume Gomez [Fri, 13 Aug 2021 13:29:10 +0000 (15:29 +0200)]
Rollup merge of #87795 - estebank:erase-lifetimes-in-suggestion, r=oli-obk

Avoid ICE caused by suggestion

When suggesting dereferencing something that can be iterable in a `for`
loop, erase lifetimes and use a fresh `ty::ParamEnv` to avoid 'region
constraints already solved' panic.

Fix #87657, fix #87709, fix #87651.

2 years agoImprove wording, correct -> tight.
Frank Steffahn [Fri, 13 Aug 2021 12:41:50 +0000 (14:41 +0200)]
Improve wording, correct -> tight.

2 years agoUpdate browser-ui-test package version
Guillaume Gomez [Fri, 13 Aug 2021 12:52:28 +0000 (14:52 +0200)]
Update browser-ui-test package version

2 years agoAdd rustdoc GUI test for headers
Guillaume Gomez [Fri, 13 Aug 2021 12:23:13 +0000 (14:23 +0200)]
Add rustdoc GUI test for headers

2 years agoFix Cargo.lock and ui test
Deadbeef [Fri, 13 Aug 2021 11:30:33 +0000 (11:30 +0000)]
Fix Cargo.lock and ui test

2 years agoswitch to the latest version of hermit-abi
Stefan Lankes [Fri, 13 Aug 2021 05:45:30 +0000 (07:45 +0200)]
switch to the latest version of hermit-abi

2 years agoUse is_diagnostic_item instead of get_diagnostic_item.
Mara Bos [Thu, 12 Aug 2021 17:21:46 +0000 (19:21 +0200)]
Use is_diagnostic_item instead of get_diagnostic_item.

2 years agoUpdate non-fmt-panic tests.
Mara Bos [Thu, 12 Aug 2021 17:15:47 +0000 (19:15 +0200)]
Update non-fmt-panic tests.

2 years agoConsistent use of `impl Trait` arguments in the test's helper function.
Frank Steffahn [Fri, 13 Aug 2021 10:02:03 +0000 (12:02 +0200)]
Consistent use of `impl Trait` arguments in the test's helper function.

2 years agonon_fmt_panic: machine app. suggestion for assert with string msg.
Mara Bos [Thu, 12 Aug 2021 17:14:54 +0000 (19:14 +0200)]
non_fmt_panic: machine app. suggestion for assert with string msg.

2 years agomake check less conservative and add explanation
Deadbeef [Tue, 27 Jul 2021 01:51:57 +0000 (09:51 +0800)]
make check less conservative and add explanation

2 years agoBless test
Deadbeef [Mon, 26 Jul 2021 10:02:18 +0000 (18:02 +0800)]
Bless test

2 years agoMake assoc types work with `?const `opt=out
Deadbeef [Mon, 26 Jul 2021 09:25:01 +0000 (17:25 +0800)]
Make assoc types work with `?const `opt=out

2 years agoallow incomplete features for now
Deadbeef [Mon, 26 Jul 2021 08:53:36 +0000 (16:53 +0800)]
allow incomplete features for now

2 years agoMoved ui test
Deadbeef [Mon, 26 Jul 2021 06:04:55 +0000 (14:04 +0800)]
Moved ui test

2 years agoFix tests
Deadbeef [Mon, 26 Jul 2021 04:29:18 +0000 (12:29 +0800)]
Fix tests

2 years agoFix call-generic-method-nonconst test
Deadbeef [Mon, 26 Jul 2021 04:06:55 +0000 (12:06 +0800)]
Fix call-generic-method-nonconst test

2 years agoDon't transform predicates in Inherited
Deadbeef [Mon, 26 Jul 2021 04:06:32 +0000 (12:06 +0800)]
Don't transform predicates in Inherited

2 years agohandle the case when container is not impl
Deadbeef [Mon, 26 Jul 2021 03:34:43 +0000 (11:34 +0800)]
handle the case when container is not impl

2 years agoFix assoc-type test
Deadbeef [Mon, 26 Jul 2021 03:13:23 +0000 (11:13 +0800)]
Fix assoc-type test

2 years agoPass constness to SelectionContext
Deadbeef [Mon, 26 Jul 2021 02:52:17 +0000 (10:52 +0800)]
Pass constness to SelectionContext

2 years agoTry to fix problem
Deadbeef [Sat, 24 Jul 2021 15:32:43 +0000 (23:32 +0800)]
Try to fix problem

2 years agoRelate impl
Deadbeef [Sat, 24 Jul 2021 12:11:38 +0000 (20:11 +0800)]
Relate impl

2 years agoMake selection and evaluation caches use constness
Deadbeef [Sat, 24 Jul 2021 11:12:24 +0000 (19:12 +0800)]
Make selection and evaluation caches use constness

2 years agofmt
Deadbeef [Sat, 24 Jul 2021 07:48:51 +0000 (15:48 +0800)]
fmt

2 years agoInherited use constness and assoc change predicate
Deadbeef [Sat, 24 Jul 2021 06:34:53 +0000 (14:34 +0800)]
Inherited use constness and assoc change predicate

2 years agofmt
Deadbeef [Thu, 22 Jul 2021 16:07:56 +0000 (00:07 +0800)]
fmt

2 years agoFilter non-const impls when we expect a const one
Deadbeef [Thu, 22 Jul 2021 16:01:47 +0000 (00:01 +0800)]
Filter non-const impls when we expect a const one

2 years agomove Constness into TraitPredicate
Deadbeef [Thu, 22 Jul 2021 13:56:07 +0000 (21:56 +0800)]
move Constness into TraitPredicate

2 years agoAuto merge of #87956 - m-ou-se:closure-migration-macro-body, r=Aaron1011
bors [Fri, 13 Aug 2021 08:31:26 +0000 (08:31 +0000)]
Auto merge of #87956 - m-ou-se:closure-migration-macro-body, r=Aaron1011

Fix closure migration suggestion when the body is a macro.

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

Before:
```
warning: changes to closure capture in Rust 2021 will affect drop order
 --> src/main.rs:5:13
  |
5 |     let _ = || panic!(a.0);
  |             ^^^^^^^^^^---^
  |                       |
  |                       in Rust 2018, closure captures all of `a`, but in Rust 2021, it only captures `a.0`
6 | }
  | - in Rust 2018, `a` would be dropped here, but in Rust 2021, only `a.0` would be dropped here alongside the closure
  |

help: add a dummy let to cause `a` to be fully captured
  |
20~     ($msg:expr $(,)?) => ({ let _ = &a;
21+         $crate::rt::begin_panic($msg)
22~     }),
  |
```

After:
```
warning: changes to closure capture in Rust 2021 will affect drop order
 --> src/main.rs:5:13
  |
5 |     let _ = || panic!(a.0);
  |             ^^^^^^^^^^---^
  |                       |
  |                       in Rust 2018, closure captures all of `a`, but in Rust 2021, it only captures `a.0`
6 | }
  | - in Rust 2018, `a` would be dropped here, but in Rust 2021, only `a.0` would be dropped here alongside the closure
  |
help: add a dummy let to cause `a` to be fully captured
  |
5 |     let _ = || { let _ = &a; panic!(a.0) };
  |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

2 years agoDon't put hermit mutexes in a box.
Martin Kröning [Sun, 13 Jun 2021 15:22:02 +0000 (17:22 +0200)]
Don't put hermit mutexes in a box.

Hermit mutexes are movable.

2 years agoDon't put hermit condvars in a box.
Martin Kröning [Sun, 13 Jun 2021 15:22:17 +0000 (17:22 +0200)]
Don't put hermit condvars in a box.

Hermit condvars are movable.

2 years agoDon't put hermit rwlocks in a box.
Martin Kröning [Fri, 18 Jun 2021 11:52:13 +0000 (13:52 +0200)]
Don't put hermit rwlocks in a box.

Hermit rwlocks are movable.

2 years agoAuto merge of #87954 - flip1995:clippyup, r=Manishearth
bors [Fri, 13 Aug 2021 05:30:37 +0000 (05:30 +0000)]
Auto merge of #87954 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

2 years agoUpdates favicon order of precedence as it matters to Chrome
skim [Fri, 13 Aug 2021 04:08:14 +0000 (21:08 -0700)]
Updates favicon order of precedence as it matters to Chrome

2 years agoAuto merge of #87927 - spastorino:use-def-id-typeckresults, r=oli-obk
bors [Fri, 13 Aug 2021 02:49:45 +0000 (02:49 +0000)]
Auto merge of #87927 - spastorino:use-def-id-typeckresults, r=oli-obk

Make concrete_opaque_types be FxHashSet<DefId>

r? `@oli-obk`

`@bors` rollup=always

2 years agoAuto merge of #87980 - Manishearth:rollup-vkuix3y, r=Manishearth
bors [Thu, 12 Aug 2021 23:48:16 +0000 (23:48 +0000)]
Auto merge of #87980 - Manishearth:rollup-vkuix3y, r=Manishearth

Rollup of 4 pull requests

Successful merges:

 - #87916 (Implement `black_box` using intrinsic)
 - #87922 (Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets)
 - #87953 (Improve formatting of closure capture migration suggestion for multi-line closures.)
 - #87965 (Silence non_fmt_panic from external macros.)

Failed merges:

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

2 years agoRewrite test from previous commit but without using macros.
Frank Steffahn [Thu, 12 Aug 2021 20:44:40 +0000 (22:44 +0200)]
Rewrite test from previous commit but without using macros.

2 years agoAuto merge of #87916 - nbdd0121:black_box, r=nagisa
bors [Thu, 12 Aug 2021 21:04:07 +0000 (21:04 +0000)]
Auto merge of #87916 - nbdd0121:black_box, r=nagisa

Implement `black_box` using intrinsic

Introduce `black_box` intrinsic, as suggested in https://github.com/rust-lang/rust/pull/87590#discussion_r680468700.

This is still codegenned as empty inline assembly for LLVM. For MIR interpretation and cranelift it's treated as identity.

cc `@Amanieu` as this is related to inline assembly
cc `@bjorn3` for rustc_codegen_cranelift changes
cc `@RalfJung` as this affects MIRI

r? `@nagisa` I suppose

2 years agoPrevent double panic when handling incremental fingerprint mismatch
Aaron Hill [Thu, 12 Aug 2021 20:11:21 +0000 (15:11 -0500)]
Prevent double panic when handling incremental fingerprint mismatch

When an incremental fingerprint mismatch occurs, we debug-print
our `DepNode` and query result. Unfortunately, the debug printing
process may cause us to run additional queries, which can result
in a re-entrant fingerprint mismatch error.

To avoid a double panic, this commit adds a thread-local variable
to detect re-entrant calls.

2 years agoForbid `!` from being used in `asm!` output
Gary Guo [Thu, 12 Aug 2021 19:23:34 +0000 (20:23 +0100)]
Forbid `!` from being used in `asm!` output

2 years agoImprove fallback span for closure migration lint.
Mara Bos [Thu, 12 Aug 2021 18:35:54 +0000 (20:35 +0200)]
Improve fallback span for closure migration lint.

2 years agoImprove comment in closure migration code.
Mara Bos [Thu, 12 Aug 2021 18:28:34 +0000 (20:28 +0200)]
Improve comment in closure migration code.

2 years agoRollup merge of #87965 - m-ou-se:non-fmt-panic-external, r=estebank
Manish Goregaokar [Thu, 12 Aug 2021 17:04:16 +0000 (10:04 -0700)]
Rollup merge of #87965 - m-ou-se:non-fmt-panic-external, r=estebank

Silence non_fmt_panic from external macros.

This stops the non_fmt_panic lint from triggering if a macro from another crate is entirely responsible. In those cases there's nothing that the current crate can/should do.

See also https://github.com/rust-lang/rust/issues/87621#issuecomment-890311054

2 years agoRollup merge of #87953 - m-ou-se:closure-migration-multiline-formatting, r=petrochenkov
Manish Goregaokar [Thu, 12 Aug 2021 17:04:15 +0000 (10:04 -0700)]
Rollup merge of #87953 - m-ou-se:closure-migration-multiline-formatting, r=petrochenkov

Improve formatting of closure capture migration suggestion for multi-line closures.

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

Before:
```
help: add a dummy let to cause `a` to be fully captured
  |
5 ~     let _ = || { let _ = &a;
6 +         dbg!(a.0);
7 ~     };
  |
```

After:
```
help: add a dummy let to cause `a` to be fully captured
  |
5 ~     let _ = || {
6 +         let _ = &a;
7 +         dbg!(a.0);
8 ~     };
  |
```

2 years agoRollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
Manish Goregaokar [Thu, 12 Aug 2021 17:04:14 +0000 (10:04 -0700)]
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb

Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets

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

<s>Haven't tested this yet, still playing around.</s>

This seems to fix the issue.

2 years agoRollup merge of #87916 - nbdd0121:black_box, r=nagisa
Manish Goregaokar [Thu, 12 Aug 2021 17:04:07 +0000 (10:04 -0700)]
Rollup merge of #87916 - nbdd0121:black_box, r=nagisa

Implement `black_box` using intrinsic

Introduce `black_box` intrinsic, as suggested in https://github.com/rust-lang/rust/pull/87590#discussion_r680468700.

This is still codegenned as empty inline assembly for LLVM. For MIR interpretation and cranelift it's treated as identity.

cc `@Amanieu` as this is related to inline assembly
cc `@bjorn3` for rustc_codegen_cranelift changes
cc `@RalfJung` as this affects MIRI

r? `@nagisa` I suppose

2 years agoApply c_enum_min_bits = 8 to (arm|thumb)-none- platforms
Manish Goregaokar [Tue, 10 Aug 2021 19:06:59 +0000 (12:06 -0700)]
Apply c_enum_min_bits = 8 to (arm|thumb)-none- platforms

2 years agoAdd c_enum_min_bits to target spec
Manish Goregaokar [Tue, 10 Aug 2021 18:34:13 +0000 (18:34 +0000)]
Add c_enum_min_bits to target spec