]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoUpdate list of allowed dependencies
bjorn3 [Mon, 25 Jul 2022 15:08:20 +0000 (17:08 +0200)]
Update list of allowed dependencies

Cranelift started depending on a couple of new crates

23 months agoMerge branch 'sync_from_rust'
bjorn3 [Mon, 25 Jul 2022 14:28:35 +0000 (16:28 +0200)]
Merge branch 'sync_from_rust'

23 months agopasses: port more of `check_attr` module
David Wood [Tue, 19 Jul 2022 09:00:16 +0000 (10:00 +0100)]
passes: port more of `check_attr` module

Signed-off-by: David Wood <david.wood@huawei.com>
23 months agoMerge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
bjorn3 [Mon, 25 Jul 2022 14:07:57 +0000 (16:07 +0200)]
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25

23 months agoMerge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
bjorn3 [Mon, 25 Jul 2022 14:07:57 +0000 (16:07 +0200)]
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25

23 months agoRustup to rustc 1.64.0-nightly (7fe022f5a 2022-07-24)
bjorn3 [Mon, 25 Jul 2022 14:06:39 +0000 (16:06 +0200)]
Rustup to rustc 1.64.0-nightly (7fe022f5a 2022-07-24)

23 months agoAuto merge of #85673 - csmoe:export-exe-sym, r=bjorn3
bors [Mon, 25 Jul 2022 14:04:40 +0000 (14:04 +0000)]
Auto merge of #85673 - csmoe:export-exe-sym, r=bjorn3

RFC-2841: add codegen flag export symbols from executable

Closes #84161
r? `@nikomatsakis` `@Mark-Simulacrum`

23 months agoSync from rust 2f320a224e827b400be25966755a621779f797cc
bjorn3 [Mon, 25 Jul 2022 14:00:44 +0000 (16:00 +0200)]
Sync from rust 2f320a224e827b400be25966755a621779f797cc

23 months agoremoved CanConstProp + Visitor
Aïssata [Mon, 25 Jul 2022 13:54:49 +0000 (13:54 +0000)]
removed CanConstProp + Visitor

23 months agoUpdate Cranelift to 0.85.3
bjorn3 [Mon, 25 Jul 2022 13:50:43 +0000 (13:50 +0000)]
Update Cranelift to 0.85.3

This fixes a couple of potential miscompilations. None affect cg_clif on
x86_64, but one may affect cg_clif on AArch64.

23 months agoMerge pull request #1247 from bjorn3/melt_some_ice
bjorn3 [Mon, 25 Jul 2022 13:46:04 +0000 (15:46 +0200)]
Merge pull request #1247 from bjorn3/melt_some_ice

Melt some ICE

23 months agoavoid `&str`/`Symbol` to `String` conversions
Takayuki Maeda [Mon, 25 Jul 2022 13:40:00 +0000 (22:40 +0900)]
avoid `&str`/`Symbol` to `String` conversions

23 months agoremove `is_local_span` as it is no longer used
Takayuki Maeda [Mon, 25 Jul 2022 13:37:14 +0000 (22:37 +0900)]
remove `is_local_span` as it is no longer used

23 months agoLighten up const_prop_lint, reusing const_prop
Aïssata [Tue, 12 Jul 2022 12:17:58 +0000 (12:17 +0000)]
Lighten up const_prop_lint, reusing const_prop

23 months agoFix -Zpolymorphize
bjorn3 [Mon, 25 Jul 2022 13:17:53 +0000 (13:17 +0000)]
Fix -Zpolymorphize

23 months agoFix size_of_val and min_align_of_val for truly unsized types
bjorn3 [Mon, 25 Jul 2022 11:35:24 +0000 (11:35 +0000)]
Fix size_of_val and min_align_of_val for truly unsized types

23 months agoAdd GUI test to prevent sidebar background regression
Guillaume Gomez [Mon, 25 Jul 2022 12:35:06 +0000 (14:35 +0200)]
Add GUI test to prevent sidebar background regression

23 months agoFix sidebar background-color on mobile
Guillaume Gomez [Mon, 25 Jul 2022 12:19:26 +0000 (14:19 +0200)]
Fix sidebar background-color on mobile

23 months agoRemove reachable coverage without counters
Tomasz Miąsko [Mon, 25 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Remove reachable coverage without counters

Remove reachable coverage without counters to maintain invariant that
either there is no coverage at all or there is a live coverage counter
left that provides the function source hash.

The motivating example would be a following closure:

```rust
    let f = |x: bool| {
        debug_assert!(x);
    };
```

Which, with span changes from #93967, with disabled debug assertions,
after the final CFG simplifications but before removal of dead blocks,
gives rise to MIR:

```rust
fn main::{closure#0}(_1: &[closure@a.rs:2:13: 2:22], _2: bool) -> () {
    debug x => _2;
    let mut _0: ();

    bb0: {
        Coverage::Expression(4294967295) = 1 - 2;
        return;
    }

    ...
}
```

23 months agoError when trying to define variadic functions
bjorn3 [Mon, 25 Jul 2022 11:18:34 +0000 (11:18 +0000)]
Error when trying to define variadic functions

They aren't yet supported by Cranelift

23 months ago`Inherited` always has `TypeckResults` available
lcnr [Mon, 25 Jul 2022 11:11:07 +0000 (13:11 +0200)]
`Inherited` always has `TypeckResults` available

23 months agoAuto merge of #99707 - JohnTitor:rollup-74rb8vq, r=JohnTitor
bors [Mon, 25 Jul 2022 10:33:32 +0000 (10:33 +0000)]
Auto merge of #99707 - JohnTitor:rollup-74rb8vq, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #95040 (protect `std::io::Take::limit` from overflow in `read`)
 - #95916 (kmc-solid: Use `libc::abort` to abort a program)
 - #99494 (Use non-relocatable code in nofile-limit.rs test)
 - #99581 (Improve error messages involving `derive` and `packed`.)
 - #99643 (Add `sign-ext` target feature to the WASM target)
 - #99659 (Use `VecMap::get` in `ConstraintLocator::check`)
 - #99690 (add miri-track-caller to more intrinsic-exposing methods)

Failed merges:

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

23 months agoRollup merge of #99690 - RalfJung:miri-track-caller, r=Mark-Simulacrum
Yuki Okushi [Mon, 25 Jul 2022 09:46:55 +0000 (18:46 +0900)]
Rollup merge of #99690 - RalfJung:miri-track-caller, r=Mark-Simulacrum

add miri-track-caller to more intrinsic-exposing methods

Follow-up to https://github.com/rust-lang/rust/pull/98674: I went through the Miri test suite to find more functions that would benefit from Miri backtrace pruning, and this is what I found.

Basically anything that just exposes a potentially-UB intrinsic to the user should get this treatment.

23 months agoRollup merge of #99659 - compiler-errors:opaque-type-nit, r=oli-obk
Yuki Okushi [Mon, 25 Jul 2022 09:46:54 +0000 (18:46 +0900)]
Rollup merge of #99659 - compiler-errors:opaque-type-nit, r=oli-obk

Use `VecMap::get` in `ConstraintLocator::check`

Also rename the `def_id` param to `item_def_id` because that's easily confused with `self.def_id` (which is the opaque ty did).

23 months agoRollup merge of #99643 - daxpedda:sign-ext-wasm, r=oli-obk
Yuki Okushi [Mon, 25 Jul 2022 09:46:52 +0000 (18:46 +0900)]
Rollup merge of #99643 - daxpedda:sign-ext-wasm, r=oli-obk

Add `sign-ext` target feature to the WASM target

Some target features are still missing from that list.
See #97808 for basically the same PR by `@alexcrichton.`

Related issue: #96472.
PR introducing this issue: #87402.

23 months agoRollup merge of #99581 - nnethercote:improve-derive-packed-errors, r=estebank
Yuki Okushi [Mon, 25 Jul 2022 09:46:51 +0000 (18:46 +0900)]
Rollup merge of #99581 - nnethercote:improve-derive-packed-errors, r=estebank

Improve error messages involving `derive` and `packed`.

There are two errors involving `derive` and `packed`.

```
`#[derive]` can't be derived on a `#[repr(packed)]` struct with type or const parameters
`#[derive]` can't be derived on a `#[repr(packed)]` struct that does not derive Copy
```
The second one overstates things. It is possible to use derive on a
repr(packed) struct that doesn't derive Copy in two cases.
- If all the fields within the struct meet the required alignment: 1 for
  `repr(packed)`, or `N` for `repr(packed(N))`.
- If `Default` is the only trait derived.

This commit improves things in a few ways.
- Changes the errors to say `this trait can't be derived on this ...`.
  This is more accurate, because it's just *this* trait and *this*
  packed struct that are a problem, not *all* derived traits on *all*
  packed structs.
- Adds more details to the "ERROR" lines in the test case, enough to
  distinguish between the two error messages.
- Adds more cases to the test case that don't cause errors, e.g. `Default`
  derives.
- Uses a wider variety of builtin traits in the test case, for better coverage.

r? `@estebank`

23 months agoRollup merge of #99494 - tmiasko:no-pie, r=Mark-Simulacrum
Yuki Okushi [Mon, 25 Jul 2022 09:46:50 +0000 (18:46 +0900)]
Rollup merge of #99494 - tmiasko:no-pie, r=Mark-Simulacrum

Use non-relocatable code in nofile-limit.rs test

To avoid using static-pie which is not essential to the test but which
was reported to cause problems on Void Linux where glibc is build
without support for static-pie.

23 months agoRollup merge of #95916 - solid-rs:feat-kmc-solid-abort, r=Mark-Simulacrum
Yuki Okushi [Mon, 25 Jul 2022 09:46:48 +0000 (18:46 +0900)]
Rollup merge of #95916 - solid-rs:feat-kmc-solid-abort, r=Mark-Simulacrum

kmc-solid: Use `libc::abort` to abort a program

This PR updates the target-specific abort subroutine for the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.

The current implementation uses a `hlt` instruction, which is the most direct way to notify a connected debugger but is not the most flexible way. This PR changes it to call the `abort` libc function, making it possible for a system designer to override its behavior as they see fit.

23 months agoRollup merge of #95040 - frank-king:fix/94981, r=Mark-Simulacrum
Yuki Okushi [Mon, 25 Jul 2022 09:46:47 +0000 (18:46 +0900)]
Rollup merge of #95040 - frank-king:fix/94981, r=Mark-Simulacrum

protect `std::io::Take::limit` from overflow in `read`

Resolves #94981

23 months agoremove useless mut from examples
sourcelliu [Mon, 25 Jul 2022 09:04:51 +0000 (17:04 +0800)]
remove useless mut from examples

23 months agosuggest removing the tuple struct field for the unwrapped value
Takayuki Maeda [Fri, 22 Jul 2022 06:53:00 +0000 (15:53 +0900)]
suggest removing the tuple struct field for the unwrapped value

add a test case for macro

23 months agoAuto merge of #99600 - tmiasko:subst-folder, r=petrochenkov
bors [Mon, 25 Jul 2022 07:52:41 +0000 (07:52 +0000)]
Auto merge of #99600 - tmiasko:subst-folder, r=petrochenkov

Tweak `SubstFolder` implementation

23 months agoAuto merge of #98770 - klensy:no-string-dupes-ugly, r=cjgillot
bors [Mon, 25 Jul 2022 05:27:17 +0000 (05:27 +0000)]
Auto merge of #98770 - klensy:no-string-dupes-ugly, r=cjgillot

rmeta: avoid embedding `StabilityLevel::Unstable` reason multiple times into .rmeta\.rlib files

Avoids bloating size of some rmeta\rlib files by not placing default string for `StabilityLevel::Unstable` reason multiple times, affects only stdlib\rustc artifacts. For stdlib cuts about 3% (diff of total size for patched\unpatched *.rmeta files of stage1-std) of file size, depending on crates.

fixes #88180

23 months agofeat: impl export-executable-symbols
csmoe [Mon, 25 Jul 2022 05:20:23 +0000 (05:20 +0000)]
feat: impl export-executable-symbols

23 months agoExpose size_hint() for TokenStream's iterator
David Tolnay [Mon, 25 Jul 2022 03:36:22 +0000 (20:36 -0700)]
Expose size_hint() for TokenStream's iterator

23 months agoAuto merge of #99676 - thomcc:dont-overwrite, r=tmiasko
bors [Mon, 25 Jul 2022 02:46:36 +0000 (02:46 +0000)]
Auto merge of #99676 - thomcc:dont-overwrite, r=tmiasko

Don't overwrite CodegenFnAttrs when adding used compiler/linker

Pointed out by `@tmiasko` in https://github.com/rust-lang/rust/pull/93718#discussion_r928259163. Probably a better fix than https://github.com/rust-lang/rust/pull/99674 for https://github.com/rust-lang/rust/issues/99596, assuming it does fix the latter.

I don't have the ability to write a regression test for this at the moment, and am quite surprised this didn't cause other failures. The old code is clearly wrong though, but I'm not picky as to which of these is better to go with.

23 months agoImprove error messages involving `derive` and `packed`.
Nicholas Nethercote [Fri, 22 Jul 2022 00:04:37 +0000 (10:04 +1000)]
Improve error messages involving `derive` and `packed`.

There are two errors involving `derive` and `packed`.

```
`#[derive]` can't be derived on a `#[repr(packed)]` struct with type or const parameters
`#[derive]` can't be derived on a `#[repr(packed)]` struct that does not derive Copy
```
The second one overstates things. It is possible to use derive on a
repr(packed) struct that doesn't derive Copy in two cases.
- If all the fields within the struct meet the required alignment: 1 for
  `repr(packed)`, or `N` for `repr(packed(N))`.
- If `Default` is the only trait derived.

This commit improves things in a few ways.
- Changes the errors to say `$TRAIT can't be derived on this ...`.
  This is more accurate, because it's just $TRAIT and *this* packed
  struct that are a problem, not *all* derived traits on *all* packed
  structs.
- Adds more details to the "ERROR" lines in the test case, enough to
  distinguish between the two error messages.
- Adds more cases to the test case that don't cause errors, e.g. `Default`
  derives.
- Uses a wider variety of builtin traits in the test case, for better coverage.

23 months agoAuto merge of #97581 - AngelicosPhosphoros:improve_calloc_check_in_vec_macro_for_tupl...
bors [Mon, 25 Jul 2022 00:20:43 +0000 (00:20 +0000)]
Auto merge of #97581 - AngelicosPhosphoros:improve_calloc_check_in_vec_macro_for_tuples, r=Mark-Simulacrum

Support vec zero-alloc optimization for tuples and byte arrays

* Implement IsZero trait for tuples up to 8 IsZero elements;
* Implement IsZero for u8/i8, leading to implementation of it for arrays of them too;
* Add more codegen tests for this optimization.
* Lower size of array for IsZero trait because it fails to inline checks

23 months agointerpret, ptr_offset_from: refactor and test too-far-apart check
Ralf Jung [Sun, 24 Jul 2022 20:01:47 +0000 (16:01 -0400)]
interpret, ptr_offset_from: refactor and test too-far-apart check

23 months agofix rustdoc-gui tests
Maybe Waffle [Sun, 24 Jul 2022 21:41:25 +0000 (01:41 +0400)]
fix rustdoc-gui tests

23 months agoAuto merge of #99603 - fasterthanlime:ra-subtree-2, r=jyn514
bors [Sun, 24 Jul 2022 21:36:31 +0000 (21:36 +0000)]
Auto merge of #99603 - fasterthanlime:ra-subtree-2, r=jyn514

Convert rust-analyzer to an in-tree tool

This re-adds `rust-lang/rust-analyzer` as a git subtree rather than a submodule.

Closes https://github.com/rust-lang/rust-analyzer/issues/12815.

Prior attempt (research PR): https://github.com/rust-lang/rust/pull/99465

  * [x] Remove submodule: `git rm -f src/tools/rust-analyzer`
  * [x] Add subtree: `git subtree add -P src/tools/rust-analyzer https://github.com/rust-lang/rust-analyzer.git master`
  * [x] Move to `SourceType::InTree`,
  * [x] Enable `rust-analyzer/in-rust-tree` feature when built through `x.py`
  * [x] Add 'check' step
  * [x] Add 'test' step

With this PR, rust-analyzer becomes an "in-tree" tool. Syncs can happen in both directions, see [clippy's relevant book section](https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html).

Making sure `proc-macro-srv` doesn't break when the proc_macro bridge changes effectively becomes the responsibility of `rust-lang/rust` contributors. These days, that's mostly `@mystor,` who has been consulted throughout the process. I'm also making myself available in case there's questions / work needed that nobody else signed up for.

This doesn't change rust-analyzer's release cycle. After this PR is merged and the next nightly goes out, one can point `rust-analyzer.procMacro.server` to the rustup-provided `rust-analyzer` binary. Changes to improve the situation further (auto-discovery/install of the rust-analyzer component) will happen in `rust-lang/rust-analyzer` and be synced here eventually.

23 months agoDo not prefer module parents which are `doc(hidden)` in visibility map
Michael Goulet [Sun, 24 Jul 2022 21:25:35 +0000 (21:25 +0000)]
Do not prefer module parents which are `doc(hidden)` in visibility map

23 months agoAdd failing test
Alik Aslanyan [Tue, 21 Dec 2021 22:03:51 +0000 (02:03 +0400)]
Add failing test

23 months agoSupport vec zero-alloc optimization for tuples and byte arrays
AngelicosPhosphoros [Tue, 31 May 2022 12:14:55 +0000 (15:14 +0300)]
Support vec zero-alloc optimization for tuples and byte arrays

* Implement IsZero trait for tuples up to 8 IsZero elements;
* Implement IsZero for u8/i8, leading to implementation of it for arrays of them too;
* Add more codegen tests for this optimization.
* Lower size of array for IsZero trait because it fails to inline checks

23 months agoCombine redundant obligation cause codes
Michael Goulet [Sun, 24 Jul 2022 19:33:26 +0000 (19:33 +0000)]
Combine redundant obligation cause codes

23 months agoOnly run proc-macro-srv tests for now (after discussion with @Veykril, @jyn514, and...
Amos Wenger [Sun, 24 Jul 2022 19:04:56 +0000 (21:04 +0200)]
Only run proc-macro-srv tests for now (after discussion with @Veykril, @jyn514, and @lnicola)

23 months agoHandle additional lifetime bounds on GATs like on methods
Michael Goulet [Sun, 24 Jul 2022 18:57:41 +0000 (18:57 +0000)]
Handle additional lifetime bounds on GATs like on methods

23 months agoAuto merge of #99687 - RalfJung:rollup-bojacrc, r=RalfJung
bors [Sun, 24 Jul 2022 18:55:31 +0000 (18:55 +0000)]
Auto merge of #99687 - RalfJung:rollup-bojacrc, r=RalfJung

Rollup of 4 pull requests

Successful merges:

 - #99644 (remove some provenance-related machine hooks that Miri no longer needs)
 - #99657 (Docs - remove unnecessary `mut` that gives a warning)
 - #99672 (Remove Clean trait implementation for more items)
 - #99678 (Update doc comments that refer to config parameter)

Failed merges:

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

23 months agoadd miri-track-caller to some intrinsic-exposing methods
Ralf Jung [Sun, 24 Jul 2022 18:28:30 +0000 (14:28 -0400)]
add miri-track-caller to some intrinsic-exposing methods

23 months agoSlightly improve mismatched GAT where clause error
Michael Goulet [Sat, 16 Jul 2022 23:41:43 +0000 (23:41 +0000)]
Slightly improve mismatched GAT where clause error

23 months agoRollup merge of #99678 - danbev:rustc_parse-config-doc-comments, r=cjgillot
Ralf Jung [Sun, 24 Jul 2022 18:04:29 +0000 (14:04 -0400)]
Rollup merge of #99678 - danbev:rustc_parse-config-doc-comments, r=cjgillot

Update doc comments that refer to config parameter

This commit updates the `source_file_to_parser` and the
`maybe_source_file_to_parse` function's doc comments which currently
refer to a `config` parameter. The doc comments have been updated to
refer to the `session` parameter similar to the doc comment for
`try_file_to_source_file`, which also takes a `&Session` parameter.

23 months agoRollup merge of #99672 - GuillaumeGomez:clean-trait-removal, r=Dylan-DPC
Ralf Jung [Sun, 24 Jul 2022 18:04:28 +0000 (14:04 -0400)]
Rollup merge of #99672 - GuillaumeGomez:clean-trait-removal, r=Dylan-DPC

Remove Clean trait implementation for more items

Follow up of #99638.

cc `@camelid`
r? `@notriddle`

23 months agoRollup merge of #99657 - Phosra:patch-1, r=Dylan-DPC
Ralf Jung [Sun, 24 Jul 2022 18:04:27 +0000 (14:04 -0400)]
Rollup merge of #99657 - Phosra:patch-1, r=Dylan-DPC

Docs - remove unnecessary `mut` that gives a warning

Fixes #99654.

A trivial linting fix for a Stdio example.

`@rustbot` label +T-lib

23 months agoRollup merge of #99644 - RalfJung:interpret-int-ptr-transmute, r=oli-obk
Ralf Jung [Sun, 24 Jul 2022 18:04:26 +0000 (14:04 -0400)]
Rollup merge of #99644 - RalfJung:interpret-int-ptr-transmute, r=oli-obk

remove some provenance-related machine hooks that Miri no longer needs

Then we can make `scalar_to_ptr` a method on `Scalar`. :)

Fixes https://github.com/rust-lang/miri/issues/2188
r? `@oli-obk`

23 months agoRename and document the new BufReader internals
Ben Kimock [Sun, 24 Jul 2022 16:50:02 +0000 (12:50 -0400)]
Rename and document the new BufReader internals

23 months agoAllow Buffer methods to inline
Ben Kimock [Wed, 20 Jul 2022 22:21:15 +0000 (18:21 -0400)]
Allow Buffer methods to inline

23 months agoRemove some redundant checks from BufReader
Ben Kimock [Fri, 1 Jul 2022 01:55:19 +0000 (21:55 -0400)]
Remove some redundant checks from BufReader

The implementation of BufReader contains a lot of redundant checks.
While any one of these checks is not particularly expensive to execute,
especially when taken together they dramatically inhibit LLVM's ability
to make subsequent optimizations.

23 months agoAuto merge of #99409 - tmiasko:atomic-tests, r=m-ou-se
bors [Sun, 24 Jul 2022 16:26:56 +0000 (16:26 +0000)]
Auto merge of #99409 - tmiasko:atomic-tests, r=m-ou-se

Test codegen of atomic compare-exchange with additional memory orderings

* Add a test for atomic operations introduced in #97423 & #98383.
* Add a test for fallback code generation strategy used on LLVM 12 introduced in #98385. Use a separate test case instead of a revision system since test will be gone once LLVM 12 is no longer supported.

23 months agoRevert "Revert "Use ICF (identical code folding) for building rustc""
Jubilee Young [Sun, 24 Jul 2022 15:52:08 +0000 (08:52 -0700)]
Revert "Revert "Use ICF (identical code folding) for building rustc""

This reverts commit rust-lang/rust@45575d23f316af7476ccd0a895234ac59c47a6be,
thereby enabling identical code folding again.

23 months agoMake macros test order-resistant
Amos Wenger [Sun, 24 Jul 2022 14:48:06 +0000 (16:48 +0200)]
Make macros test order-resistant

23 months agoUpdate doc comments that refer to config parameter
Daniel Bevenius [Sun, 24 Jul 2022 14:09:04 +0000 (16:09 +0200)]
Update doc comments that refer to config parameter

This commit updates the source_file_to_parser and the
maybe_source_file_to_parse function's doc comments which currently
refer to a config parameter. The doc comments have been updated to
refer to the 'session' parameter similar to the doc comment for
try_file_to_source_file, which also takes a &Session parameter.

23 months agoremove new allocations from imported_source_files
Pietro Albini [Sun, 24 Jul 2022 14:04:13 +0000 (16:04 +0200)]
remove new allocations from imported_source_files

23 months agoSort when iterating through CrateGraph
Amos Wenger [Sun, 24 Jul 2022 14:11:05 +0000 (16:11 +0200)]
Sort when iterating through CrateGraph

23 months agoSort in DefMap::dump, since HashMap iteration order isn't defined
Amos Wenger [Sun, 24 Jul 2022 14:04:20 +0000 (16:04 +0200)]
Sort in DefMap::dump, since HashMap iteration order isn't defined

23 months agohir-def tests: sort results before comparing, since FxHashSet iteration order isn...
Amos Wenger [Sun, 24 Jul 2022 13:55:20 +0000 (15:55 +0200)]
hir-def tests: sort results before comparing, since FxHashSet iteration order isn't guaranteed

(And, in fact, it failed on i686)

23 months agoAuto merge of #99670 - Amanieu:revert-99595, r=nikic
bors [Sun, 24 Jul 2022 13:46:15 +0000 (13:46 +0000)]
Auto merge of #99670 - Amanieu:revert-99595, r=nikic

Revert "Mark atomics as unsupported on thumbv6m"

This is a breaking change for the `thumbv6m` target. See #99668 for discussion on how we can proceed forward from here.

This reverts commit 75146102197c7f35e6c38cb402b2bc1065858c54.

cc `@nikic`

23 months agoDon't overwrite CodegenFnAttrs when adding used compiler/linker
Thom Chiovoloni [Sun, 24 Jul 2022 13:18:34 +0000 (06:18 -0700)]
Don't overwrite CodegenFnAttrs when adding used compiler/linker

23 months agodon't ICE on invalid dyn calls
Ralf Jung [Sun, 24 Jul 2022 13:21:05 +0000 (09:21 -0400)]
don't ICE on invalid dyn calls

23 months agoRemove Clean trait implementation for Constant
Guillaume Gomez [Sun, 24 Jul 2022 13:08:24 +0000 (15:08 +0200)]
Remove Clean trait implementation for Constant

23 months agoRemove Clean trait implementation for FieldDef
Guillaume Gomez [Sun, 24 Jul 2022 12:58:10 +0000 (14:58 +0200)]
Remove Clean trait implementation for FieldDef

23 months agoSatisfy theme check
Maybe Waffle [Sun, 24 Jul 2022 12:48:35 +0000 (16:48 +0400)]
Satisfy theme check

23 months agoRevert "Mark atomics as unsupported on thumbv6m"
Amanieu d'Antras [Sun, 24 Jul 2022 12:12:08 +0000 (13:12 +0100)]
Revert "Mark atomics as unsupported on thumbv6m"

This reverts commit 75146102197c7f35e6c38cb402b2bc1065858c54.

23 months agoFix .gitattributes for test_data
Amos Wenger [Sun, 24 Jul 2022 12:05:35 +0000 (14:05 +0200)]
Fix .gitattributes for test_data

23 months agoadd const hack comment
Deadbeef [Fri, 14 Jan 2022 08:55:19 +0000 (16:55 +0800)]
add const hack comment

23 months agoAdd issue numbers
Deadbeef [Wed, 29 Dec 2021 06:18:52 +0000 (14:18 +0800)]
Add issue numbers

23 months agoConstify a few const `(Partial)Ord` impls
Deadbeef [Wed, 29 Dec 2021 06:07:54 +0000 (14:07 +0800)]
Constify a few const `(Partial)Ord` impls

23 months agoadd backticks
Maybe Waffle [Tue, 19 Jul 2022 16:28:53 +0000 (20:28 +0400)]
add backticks

23 months agoAdd rustdoc test for `#[rustc_must_implement_one_of]`
Maybe Waffle [Sun, 17 Jul 2022 16:51:39 +0000 (20:51 +0400)]
Add rustdoc test for `#[rustc_must_implement_one_of]`

23 months agoAdd support for `#[rustc_must_implement_one_of]` to rustdoc
Maybe Waffle [Thu, 14 Jul 2022 10:51:38 +0000 (14:51 +0400)]
Add support for `#[rustc_must_implement_one_of]` to rustdoc

23 months agomake sure has_deref is correct
ouz-a [Sun, 24 Jul 2022 10:26:20 +0000 (13:26 +0300)]
make sure has_deref is correct

23 months agoAuto merge of #93429 - fee1-dead-contrib:allow-super-trait-tilde-const, r=oli-obk
bors [Sun, 24 Jul 2022 09:16:02 +0000 (09:16 +0000)]
Auto merge of #93429 - fee1-dead-contrib:allow-super-trait-tilde-const, r=oli-obk

Allow `trait A: ~const B`

What's included: a minimal working change set for `~const` supertraits to work.

r? `@oli-obk`

23 months agoSmall fixups
Joshua Nelson [Sat, 23 Jul 2022 20:37:46 +0000 (15:37 -0500)]
Small fixups

- use `path` instead of `paths`
- don't mark rust-analyzer as an optional tool
- print the cargo command that's run in the proc-macro-test build script

  this originally was part of a change to fix `test --stage 0 rust-analyzer`,
  but I'm going to leave that for a separate PR so it's easier to review.

23 months agoMove cfg attrs up to the mod definitions to disable sourcegen
Amos Wenger [Sat, 23 Jul 2022 15:23:13 +0000 (17:23 +0200)]
Move cfg attrs up to the mod definitions to disable sourcegen

23 months agoDisable all source-gen tests at compile time
Amos Wenger [Sat, 23 Jul 2022 00:06:11 +0000 (02:06 +0200)]
Disable all source-gen tests at compile time

23 months agoDon't run slow tests in Rust CI, only RA CI
Amos Wenger [Fri, 22 Jul 2022 16:16:46 +0000 (18:16 +0200)]
Don't run slow tests in Rust CI, only RA CI

23 months agoAdd comment about CARGO_WORKSPACE_DIR
Amos Wenger [Fri, 22 Jul 2022 16:06:38 +0000 (18:06 +0200)]
Add comment about CARGO_WORKSPACE_DIR

23 months agoUse top-level path in tool Step
Amos Wenger [Fri, 22 Jul 2022 16:03:04 +0000 (18:03 +0200)]
Use top-level path in tool Step

23 months agoAllow cross-compiling, build all crates
Amos Wenger [Fri, 22 Jul 2022 16:01:49 +0000 (18:01 +0200)]
Allow cross-compiling, build all crates

23 months agoUse compiler.stage
Amos Wenger [Fri, 22 Jul 2022 15:59:15 +0000 (17:59 +0200)]
Use compiler.stage

Co-authored-by: Joshua Nelson <github@jyn.dev>
23 months agoAdd test step for rust-analyzer, run it by default
Amos Wenger [Fri, 22 Jul 2022 15:21:33 +0000 (17:21 +0200)]
Add test step for rust-analyzer, run it by default

23 months agoCheck only tests and benches, not examples
Amos Wenger [Fri, 22 Jul 2022 14:38:05 +0000 (16:38 +0200)]
Check only tests and benches, not examples

23 months agoAdd check step, stuck on 'no output generated for libgoto_def-hash rmeta'
Amos Wenger [Fri, 22 Jul 2022 14:23:40 +0000 (16:23 +0200)]
Add check step, stuck on 'no output generated for libgoto_def-hash rmeta'

23 months agoConvert rust-analyzer to 'in-tree' tool, pass 'in-rust-tree' feature by default
Amos Wenger [Fri, 22 Jul 2022 13:38:45 +0000 (15:38 +0200)]
Convert rust-analyzer to 'in-tree' tool, pass 'in-rust-tree' feature by default

23 months agoAdd 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
Amos Wenger [Sun, 24 Jul 2022 08:37:08 +0000 (10:37 +0200)]
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'

git-subtree-dir: src/tools/rust-analyzer
git-subtree-mainline: 3c98486a0cdb6d92f0fca34ffb1fd46c0e498653
git-subtree-split: 977e12a0bdc3e329af179ef3a9d466af9eb613bb

23 months agoRemove rust-analyzer submodule
Amos Wenger [Sun, 24 Jul 2022 08:36:44 +0000 (10:36 +0200)]
Remove rust-analyzer submodule

23 months agoInstantiate constness in wfcheck
Deadbeef [Sat, 23 Jul 2022 14:25:32 +0000 (14:25 +0000)]
Instantiate constness in wfcheck

23 months agoAuto merge of #98674 - RalfJung:miri-stacktrace-pruning, r=Mark-Simulacrum
bors [Sun, 24 Jul 2022 06:46:46 +0000 (06:46 +0000)]
Auto merge of #98674 - RalfJung:miri-stacktrace-pruning, r=Mark-Simulacrum

miri: prune some atomic operation and raw pointer details from stacktrace

Since Miri removes `track_caller` frames from the stacktrace, adding that attribute can help make backtraces more readable (similar to how it makes panic locations better). I made them only show up with `cfg(miri)` to make sure the extra arguments induced by `track_caller` do not cause any runtime performance trouble.

This is also testing the waters for whether the libs team is okay with having these attributes in their code, or whether you'd prefer if we find some other way to do this. If you are fine with this, we will probably want to add it to a lot more functions (all the other atomic operations, to start).

Before:
```
error: Undefined Behavior: Data race detected between Atomic Load on Thread(id = 2) and Write on Thread(id = 1) at alloc1727 (current vector clock = VClock([9, 0, 6]), conflicting timestamp = VClock([0, 6]))
    --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2594:23
     |
2594 |             SeqCst => intrinsics::atomic_load_seqcst(dst),
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Load on Thread(id = 2) and Write on Thread(id = 1) at alloc1727 (current vector clock = VClock([9, 0, 6]), conflicting timestamp = VClock([0, 6]))
     |
     = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
     = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

     = note: inside `std::sync::atomic::atomic_load::<usize>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2594:23
     = note: inside `std::sync::atomic::AtomicUsize::load` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:1719:26
note: inside closure at ../miri/tests/fail/data_race/atomic_read_na_write_race1.rs:22:13
    --> ../miri/tests/fail/data_race/atomic_read_na_write_race1.rs:22:13
     |
22   |             (&*c.0).load(Ordering::SeqCst)
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

After:
```
error: Undefined Behavior: Data race detected between Atomic Load on Thread(id = 2) and Write on Thread(id = 1) at alloc1727 (current vector clock = VClock([9, 0, 6]), conflicting timestamp = VClock([0, 6]))
  --> tests/fail/data_race/atomic_read_na_write_race1.rs:22:13
   |
22 |             (&*c.0).load(Ordering::SeqCst)
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Load on Thread(id = 2) and Write on Thread(id = 1) at alloc1727 (current vector clock = VClock([9, 0, 6]), conflicting timestamp = VClock([0, 6]))
   |
   = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
   = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

   = note: inside closure at tests/fail/data_race/atomic_read_na_write_race1.rs:22:13
```

23 months agoUse VecMap::get in ConstraintLocator::check
Michael Goulet [Sun, 24 Jul 2022 05:51:03 +0000 (05:51 +0000)]
Use VecMap::get in ConstraintLocator::check

23 months agoRemove `mut`
Phosra [Sun, 24 Jul 2022 04:22:43 +0000 (21:22 -0700)]
Remove `mut`

23 months agoAuto merge of #99251 - cuviper:hashbrown-0.12, r=Mark-Simulacrum
bors [Sun, 24 Jul 2022 04:03:29 +0000 (04:03 +0000)]
Auto merge of #99251 - cuviper:hashbrown-0.12, r=Mark-Simulacrum

Upgrade indexmap and thorin-dwp to use hashbrown 0.12

This removes the last dependencies on hashbrown 0.11.

This also upgrades to hashbrown 0.12.3 to fix a double-free (#99372).