Commit Graph

209553 Commits

Author SHA1 Message Date
Guillaume Gomez
53b6a894ca
Rollup merge of #104097 - RalfJung:miri-alloc-benches, r=thomcc
run alloc benchmarks in Miri and fix UB

Miri since recently has a "fake monotonic clock" that works even with isolation. Its measurements are not very meaningful but it means we can run these benches and check them for UB.

And that's a good thing since there was UB here: fixes https://github.com/rust-lang/rust/issues/104096.

r? ``@thomcc``
2022-11-08 20:40:50 +01:00
Guillaume Gomez
afaba1997d
Rollup merge of #104093 - RalfJung:test-sizes, r=thomcc
disable btree size tests on Miri

Seems fine not to run these in Miri, they can't have UB anyway. And this lets us do layout randomization in Miri.

r? ``@thomcc``
2022-11-08 20:40:49 +01:00
Guillaume Gomez
3abf329040
Rollup merge of #104027 - ted-tanner:issue-103697-fix, r=jyn514
Place config.toml in current working directory if config not found

Fixes an issue where bootsrapping a Rust build would place `config.toml` in `{src_root}` rather than the current working directory

#103697
2022-11-08 20:40:49 +01:00
Guillaume Gomez
3a78320f5c
Rollup merge of #103928 - chenyukang:yukang/fix-103874-add-ty_error_with_guaranteed, r=lcnr
Add 'ty_error_with_guaranteed' and 'const_error_with_guaranteed'

Part of #103874
2022-11-08 20:40:48 +01:00
bors
85f4f41deb Auto merge of #103252 - lcnr:recompute_applicable_impls, r=jackh726
selection failure: recompute applicable impls

The way we currently skip errors for ambiguous trait obligations seems pretty fragile so we get some duplicate errors because of this.

Removing this info from selection errors changes this system to be closer to my image of our new trait solver and is also making it far easier to change overflow errors to be non-fatal 

r? types cc `@estebank`
2022-11-08 19:35:08 +00:00
Manish Goregaokar
9eb977bec4 Add llvm-main to triagebot.toml 2022-11-08 11:30:15 -08:00
Waffle Maybe
268ea3528d
Fix outdated comment
Co-authored-by: clubby789 <jamie@hill-daniel.co.uk>
2022-11-08 21:49:58 +04:00
bors
c5842b0be7 Auto merge of #103965 - petrochenkov:effvisperf3, r=oli-obk
resolve: More detailed effective visibility tracking for imports

Per-`DefId` tracking is not enough, due to glob imports in particular, which have a single `DefId` for the whole glob import item.
We need to track this stuff per every introduced name (`NameBinding`).

Also drop `extern` blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.

Later commits add some debug-only invariant checking and optimiaztions to mitigate regressions in https://github.com/rust-lang/rust/pull/103965#issuecomment-1304256445.

This is a bugfix and continuation of https://github.com/rust-lang/rust/pull/102026.
2022-11-08 14:37:40 +00:00
lcnr
91d5a32bc5 ignore wasm in test 2022-11-08 14:48:07 +01:00
lcnr
003ed76e41 delay errors as bug 2022-11-08 14:48:07 +01:00
lcnr
f1551bfc02 selection failure: recompute applicable impls 2022-11-08 14:48:07 +01:00
Maybe Waffle
e5d01dcc78 Remove an address comparison from the parser 2022-11-08 11:51:10 +00:00
bors
ddfe1e87f7 Auto merge of #104063 - compiler-errors:ct-norm-unless, r=jackh726
Don't normalize constants unless they need normalization

Maybe makes normalization a bit faster when we have many constants in a type

r? `@ghost`
2022-11-08 10:02:11 +00:00
Pietro Albini
807a7bfcee
clarify licensing situation of mpsc and spsc queue 2022-11-08 09:36:08 +01:00
bors
57d3c58ed6 Auto merge of #104138 - Dylan-DPC:rollup-m3ojpjg, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #103446 (Specialize `iter::ArrayChunks::fold` for TrustedRandomAccess iterators)
 - #103651 (Fix `rustc_parse_format` spans following escaped utf-8 multibyte chars)
 - #103865 (Move `fallback_has_occurred` state tracking to `FnCtxt`)
 - #103955 (Update linker-plugin-lto.md to contain up to Rust 1.65)
 - #103987 (Remove `in_tail_expr` from FnCtxt)
 - #104067 (fix debuginfo for windows_gnullvm_base.rs)
 - #104094 (fully move `on_unimplemented` to `error_reporting`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-08 06:49:52 +00:00
Dylan DPC
c23068c8c6
Rollup merge of #104094 - lcnr:on_unimplemented-move, r=wesleywiser
fully move `on_unimplemented` to `error_reporting`

the `traits` module has a few too many submodules in my opinion.
2022-11-08 11:23:53 +05:30
Dylan DPC
2b9e099a83
Rollup merge of #104067 - jeremyd2019:patch-1, r=davidtwco
fix debuginfo for windows_gnullvm_base.rs

These lines (including the FIXME comment) were added to windows_gnu_base.rs in cf2c492ef8 but windows_gnullvm_base.rs was not updated.  This resulted in an error `LLVM ERROR: dwo only supported with ELF and Wasm` attempting to build on aarch64-pc-windows-gnullvm.

See also https://github.com/msys2/MINGW-packages/pull/13921#issuecomment-1304391707

/cc ```@mati865``` ```@davidtwco```

r? ```@davidtwco```
2022-11-08 11:23:53 +05:30
Dylan DPC
58c13e095e
Rollup merge of #103987 - compiler-errors:no-in_tail_expr, r=eholk
Remove `in_tail_expr` from FnCtxt

Cleans up yet another unneeded member from `FnCtxt`. The `in_tail_expr` condition wasn't even correct -- it was set for true while typechecking the whole fn body.
2022-11-08 11:23:52 +05:30
Dylan DPC
799648a61f
Rollup merge of #103955 - str4d:update-lto-doc-1.65, r=ehuss
Update linker-plugin-lto.md to contain up to Rust 1.65

The table rows were obtained via the script embedded in the page.
2022-11-08 11:23:52 +05:30
Dylan DPC
77a44ab568
Rollup merge of #103865 - compiler-errors:fallback-has-occurred-tracking, r=eholk
Move `fallback_has_occurred` state tracking to `FnCtxt`

Removes a ton of callsites that defaulted to `false`
2022-11-08 11:23:51 +05:30
Dylan DPC
4946ee7c8f
Rollup merge of #103651 - Alexendoo:parse-format-unicode-escapes, r=wesleywiser
Fix `rustc_parse_format` spans following escaped utf-8 multibyte chars

Currently too many skips are created for char escapes that are larger than 1 byte when encoded in UTF-8, [playground:](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c77a9dc669b69b167271b59ed2c8d88c)

```rust
fn main() {
    format!("\u{df}{a}");
    format!("\u{211d}{a}");
    format!("\u{1f4a3}{a}");
}
```
```
error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
 --> src/main.rs:2:22
  |
2 |     format!("\u{df}{a}");
  |                      ^ not found in this scope

error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
 --> src/main.rs:3:25
  |
3 |     format!("\u{211d}{a}");
  |                         ^ not found in this scope

error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
 --> src/main.rs:4:27
  |
4 |     format!("\u{1f4a3}{a}");
  |                           ^ not found in this scope
```

This reduces the number of skips to account for that

Fixes https://github.com/rust-lang/rust-clippy/issues/9727
2022-11-08 11:23:51 +05:30
Dylan DPC
b695ed3f20
Rollup merge of #103446 - the8472:tra-array-chunks, r=Mark-Simulacrum
Specialize `iter::ArrayChunks::fold` for TrustedRandomAccess iterators

```
OLD:
test iter::bench_trusted_random_access_chunks                      ... bench:         368 ns/iter (+/- 4)
NEW:
test iter::bench_trusted_random_access_chunks                      ... bench:          30 ns/iter (+/- 0)
```

The resulting assembly is similar to #103166 but the specialization kicks in under different (partially overlapping) conditions compared to that PR. They're complementary.

In principle a TRA-based specialization could be applied to all `ArrayChunks` methods, including `next()` as we do for `Zip` but that would have all the same hazards as the Zip specialization. Only doing it for `fold` is far less hazardous. The downside is that it only helps with internal, exhaustive iteration. I.e. `for _ in` or `try_fold` will not benefit.

Note that the regular, `try_fold`-based and the specialized `fold()` impl have observably slightly different behavior. Namely the specialized variant does not fetch the remainder elements from the underlying iterator. We do have a few other places in the standard library where beyond-the-end-of-iteration side-effects are being elided under some circumstances but not others.

Inspired by https://old.reddit.com/r/rust/comments/yaft60/zerocost_iterator_abstractionsnot_so_zerocost/
2022-11-08 11:23:50 +05:30
yukang
3320879f40 code cleanup with err.emit_unless 2022-11-08 11:17:57 +08:00
yukang
465ac26405 deprecate unchecked_claim_error_was_emitted in error_reported 2022-11-08 11:17:57 +08:00
yukang
1f21b96dce add 'ty_error_with_guaranteed' and 'const_error_with_guaranteed' 2022-11-08 11:17:46 +08:00
bors
6b23a7e87f Auto merge of #104023 - Nilstrieb:cleanup-query, r=cjgillot
Several query cleanups

A few cleanups, mostly about naming in `rustc_query_system`.

r? `@cjgillot`
2022-11-08 03:03:38 +00:00
Rejyr
ae5cc9c56e fix: lint against lint functions
fix: lint against the functions `LintContext::{lookup_with_diagnostics,lookup,struct_span_lint,lint}`, `TyCtxt::struct_lint_node`, `LintLevelsBuilder::struct_lint`.
2022-11-07 19:23:29 -05:00
bors
6184a963f7 Auto merge of #104013 - notriddle:notriddle/rustdoc-sizeof, r=GuillaumeGomez
rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`
2022-11-08 00:02:45 +00:00
The 8472
3925fc0c8e document and improve array Guard type
The type is unsafe and now exposed to the whole crate.
Document it properly and add an unsafe method so the
caller can make it visible that something unsafe is happening.
2022-11-08 00:13:26 +01:00
Jack Huey
3c71fafd6d Add a known that this is a known limitation 2022-11-07 17:52:08 -05:00
Jack Huey
cececca7c7 Get spans for a couple more region types, add some optimizations, and extend test 2022-11-07 17:39:30 -05:00
Jack Huey
00e314d5ed Add an optional Span to BrAnon and use it to print better error for HRTB error from generator interior 2022-11-07 17:39:29 -05:00
Tanner Davies
66e8a29640 Only set config.config to None when using default path 2022-11-07 15:27:42 -07:00
The 8472
43c353fff7 simplification: do not process the ArrayChunks remainder in fold() 2022-11-07 21:44:25 +01:00
The 8472
cfcce8e684 specialize iter::ArrayChunks::fold for TrustedRandomAccess iters
This is fairly safe use of TRA since it consumes the iterator so
no struct in an unsafe state will be left exposed to user code
2022-11-07 21:44:25 +01:00
The 8472
eb3f001d37 make the array initialization guard available to other modules 2022-11-07 21:44:25 +01:00
The 8472
b00666ed09 add benchmark for iter::ArrayChunks::fold specialization
This also updates the existing iter::Copied::next_chunk benchmark so
that the thing it benches doesn't get masked by the ArrayChunks specialization
2022-11-07 21:44:24 +01:00
onestacked
87c190c425 Reworked const fn ref tests 2022-11-07 21:16:22 +01:00
bors
73c9eaf214 Auto merge of #103934 - notriddle:notriddle/backtrace-deps, r=Mark-Simulacrum
std: sync "Dependencies of the `backtrace` crate" with `backtrace`

Compare:

07872f28cd/Cargo.toml (L43)

160b194295/library/std/Cargo.toml (L26)
2022-11-07 20:05:09 +00:00
bors
d69c33ad4c Auto merge of #103569 - RalfJung:miri-test-macos, r=Mark-Simulacrum
fix and (re-)enable Miri cross-target checks on macOS and Windows

Fixes https://github.com/rust-lang/rust/issues/103519
r? `@Mark-Simulacrum`
2022-11-07 17:04:06 +00:00
Guillaume Gomez
d97fa2536f
Fix invalid background-image file name 2022-11-07 17:46:46 +01:00
onestacked
0c9896bfaa Fix const_fn_trait_ref_impl, add test for it 2022-11-07 17:41:58 +01:00
yancy
d62582f92a rustdoc: Add mutable to the description 2022-11-07 16:51:23 +01:00
Kamil Koczurek
4c3cad0620 Add --print=split-debuginfo
This option prints all supported values for -Csplit-debuginfo=.., i.e.
only stable ones on stable/beta and all of them on nightly/dev.
2022-11-07 16:11:32 +01:00
Ralf Jung
29d451ccb3 fmt 2022-11-07 15:24:49 +01:00
bors
68f77297c0 Auto merge of #104102 - Dylan-DPC:rollup-0eakshe, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #103757 (Mention const and lifetime parameters in error E0207)
 - #103986 (Don't silently eat label before block in block-like expr)
 - #104003 (Move some tests to more reasonable directories)
 - #104038 (Normalize types when deducing closure signature from supertraits)
 - #104052 (Fix `resolution_failure` ICE)
 - #104090 (Modify comment syntax error)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-07 13:19:36 +00:00
Dylan DPC
81b8db2675
Rollup merge of #104090 - wanghaha-dev:master, r=Dylan-DPC
Modify comment syntax error

Modify comment syntax error
2022-11-07 18:35:26 +05:30
Dylan DPC
498efa6273
Rollup merge of #104052 - TaKO8Ki:fix-103997, r=notriddle
Fix `resolution_failure` ICE

Fixes #103997
2022-11-07 18:35:26 +05:30
Dylan DPC
f0bd2cdde4
Rollup merge of #104038 - compiler-errors:super-norm-closure-sig, r=lcnr
Normalize types when deducing closure signature from supertraits

Elaborated supertraits should be normalized, since there's no guarantee they don't contain projections 😅

Fixes #104025
r? types
2022-11-07 18:35:25 +05:30
Dylan DPC
c590396914
Rollup merge of #104003 - c410-f3r:moar-errors, r=petrochenkov
Move some tests to more reasonable directories

r? `@petrochenkov`
2022-11-07 18:35:25 +05:30