Commit Graph

217478 Commits

Author SHA1 Message Date
Dylan DPC
a50c379fcd
Rollup merge of #107900 - ChrisDenton:zero-header, r=thomcc
Zero the `REPARSE_MOUNTPOINT_DATA_BUFFER` header

Makes sure the full header is correctly initialized.

Fixes #107884
2023-02-11 11:15:58 +05:30
Dylan DPC
745361d17d
Rollup merge of #107888 - lcnr:opaque-ty-validate, r=wesleywiser
revert #107074, add regression test

fixes #107346
2023-02-11 11:15:57 +05:30
Dylan DPC
dfc242220f
Rollup merge of #107878 - workingjubilee:new-size-means-bytes, r=scottmcm
Clarify `new_size` for realloc means bytes

Minor docs fix requested by https://github.com/rust-lang/rust/issues/107875
2023-02-11 11:15:57 +05:30
Dylan DPC
2228c86bad
Rollup merge of #107857 - GuillaumeGomez:ui-test-impl-projections, r=oli-obk
Add ui test for implementation on projection

The error in full can be seen in https://github.com/rust-lang/rust/pull/107263 and is part of why the PR is blocked (it still requires the approval from the team for supporting it).

r? ``@oli-obk``
2023-02-11 11:15:56 +05:30
Dylan DPC
27454012c1
Rollup merge of #107855 - compiler-errors:new-solver-random-tests, r=lcnr
Add a couple random projection tests for new solver

Self-explanatory, they're just some cases that have been on my mind in the past (especially `tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs`).
2023-02-11 11:15:56 +05:30
Dylan DPC
9af90ffa3c
Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, r=GuillaumeGomez
rustdoc: remove inconsistently-present sidebar tooltips

Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-02-11 11:15:55 +05:30
Dylan DPC
400b03ac3c
Rollup merge of #107098 - compiler-errors:pat-mismatch-fn-call, r=lcnr
Suggest function call on pattern type mismatch

Fixes #101208

This could definitely be generalized to support more suggestions in pattern matches. We can't use all of [`FnCtxt::emit_type_mismatch_suggestions`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html#method.emit_type_mismatch_suggestions), but it's on my to-do list to play around with more suggestions that would be productive in this position.
2023-02-11 11:15:55 +05:30
Dylan DPC
0e8f0b03cd
Rollup merge of #106001 - sdroege:glibc-skip-over-null-argv, r=ChrisDenton
Stop at the first `NULL` argument when iterating `argv`

Some C commandline parsers (e.g. GLib and Qt) are replacing already handled arguments in `argv` with `NULL` and move them to the end. That means that `argc` might be bigger than the actual number of non-`NULL` pointers in `argv` at this point.

To handle this we simply stop iterating at the first `NULL` argument.

`argv` is also guaranteed to be `NULL`-terminated so any non-`NULL` arguments after the first `NULL` can safely be ignored.

Fixes https://github.com/rust-lang/rust/issues/105999
2023-02-11 11:15:54 +05:30
Dylan DPC
0781d5dd8e
Rollup merge of #105019 - chenyukang:yukang/fix-104961-borrow, r=cjgillot
Add parentheses properly for borrowing suggestion

Fixes #104961
2023-02-11 11:15:54 +05:30
kadmin
cbd1b81bd2 Add array::map benchmarks 2023-02-11 04:23:53 +00:00
Zephaniah Ong
1057e2132e emit JSON output for building of bootstrap itself 2023-02-11 09:38:33 +08:00
Josh Stone
ffdbd58d85 Drop llvm14-builtins-abi with compiler_builtins 0.1.87 2023-02-10 16:13:31 -08:00
Josh Stone
a06aaa4a9e Update the minimum external LLVM to 14 2023-02-10 16:06:25 -08:00
base0x10
20446bd92b Update broken link in cargo style guide
Toml now uses [toml.io](https://toml.io) for released specifications
and the github repo for development. Also the old link was for the 0.4
specification, while cargo uses toml_edit, which uses toml 1.0
(reference:
https://github.com/toml-rs/toml/blob/main/crates/toml_edit/CHANGELOG.md#030---2021-09-13).
Finally the discussion of "Bare keys" vs "Quoted keys" has moved from
the `#table` section to `#keys`.
2023-02-10 23:58:25 +00:00
Michael Howell
897647b378 rustdoc: remove redundant if s.is_empty() from find_testable_code 2023-02-10 16:00:03 -07:00
bors
5a8dfd933a Auto merge of #85158 - JulianKnodt:array_const_val, r=cjgillot
Mir-Opt for copying enums with large discrepancies

I have been meaning to make this for quite a while, based off of this [hackmd](https://hackmd.io/`@ft4bxUsFT5CEUBmRKYHr7w/rJM8BBPzD).`

I'm not sure where to put this opt now that I've made it, so I'd appreciate suggestions on that!
It's also one long chain of statements, not sure if there's a more friendly format to make it.

r? `@tmiasko`
I would `r` oli but he's on leave so he suggested I `r` tmiasko or wesleywiser.
2023-02-10 21:49:31 +00:00
Scott McMurray
404e9c5e3a Have a function for the log(0) panic, rather than copy-pasting the string constant 2023-02-10 12:50:17 -08:00
bors
8011029d3a Auto merge of #13975 - DropDemBits:on-enter-after-dot-chains, r=DropDemBits
fix: Suppress extra indent after the end of field and function chains

(spurred on by <https://github.com/rust-lang/rust-analyzer/issues/4182#issuecomment-671275652>)

Caveat that this doesn't work for after tail expressions, although there shouldn't be anything after those anyways.

This also complicates when to reload the language configuration by nature of now always having a language configuration applicable.

Examples of indentation fixes:

```rs
fn main() {
    println!("Hello!"); // < enter here!
    // ... indents down here

    fs::read_to_string("soup") // < enter here!
    // ... still indents down here :(
        .map(|_| ())
        .map(|_| ()) // < enter here!
        // ... still indents down here :D
        .map_err(|_| ())
        .unwrap(); // < enter here!
    // ... indents down here :D

    // ... and subsequent enters stay at the same indent

    0.0f64
        .to_radians()
        .to_radians()
        .to_radians() // force semi on a new line
        ; // < enter here!
    // ... indents down here :D
}

fn tail_end() -> i32 {
    0i32.wrapping_abs()
        .wrapping_abs()
        .wrapping_abs()
        .wrapping_abs() // < enter here!
        // ... still indents here 🤷
}
```
2023-02-10 20:10:54 +00:00
DropDemBits
c7bd3c682f
Always reload onEnter configuration
Configuration reload doesn't happen often anyway,
and there will always be a set of onEnter rules to load
2023-02-10 14:55:17 -05:00
bors
2773383a31 Auto merge of #107886 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

One day late. Sorry forgot about it yesterday :|
2023-02-10 18:33:22 +00:00
Michael Goulet
0eba2f3c16 Suggest fn call on pattern type mismatch 2023-02-10 18:18:08 +00:00
Chris Denton
59b11e8fa3
Zero the REPARSE_MOUNTPOINT_DATA_BUFFER header
Makes sure the full header is correctly initialized, including reserve parameters.
2023-02-10 18:14:53 +00:00
Michael Goulet
9790d6fbdd Add a couple random projection tests 2023-02-10 18:14:09 +00:00
Guillaume Gomez
295fd0d835 Add regression test for reexported macros docs 2023-02-10 18:37:32 +01:00
Guillaume Gomez
ddb31de281 Also get current import attributes 2023-02-10 18:32:33 +01:00
Guillaume Gomez
c003c01a03 Correctly handle reexports for macros 2023-02-10 18:32:18 +01:00
yukang
c52435a338 cleanup and fix naming 2023-02-10 17:23:09 +00:00
Matthias Krüger
5201bb53bb remove redundant clones 2023-02-10 18:08:25 +01:00
Lukas Bergdoll
7e072199a6 Speedup heapsort by 1.5x by making it branchless
`slice::sort_unstable` will fall back to heapsort if it repeatedly fails to find
a good pivot. By making the core child update code branchless it is much faster.
On Zen3 sorting 10k `u64` and forcing the sort to pick heapsort, results in:

455us -> 278us
2023-02-10 18:05:12 +01:00
yukang
414eb48b66 add only modified for compiletest 2023-02-10 16:25:01 +00:00
bors
d9c020d426 Auto merge of #14120 - Veykril:castable, r=Veykril
internal: Revert castable expectation and simplify

Unfixes https://github.com/rust-lang/rust-analyzer/issues/11571, the PR for that introduced some regressions (tried fixing them but doing what rustc does there specifically does not help, probably because something else affects it as well there)
2023-02-10 15:44:04 +00:00
Lukas Wirth
7677f41f41 Preallocate some vecs 2023-02-10 16:42:09 +01:00
bors
3574b1a69a Auto merge of #107889 - matthiaskrgr:rollup-c0d4al0, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #107789 (Avoid exposing type parameters and implementation details sourced from macro expansions)
 - #107836 (Handle properly when there is no crate attrs)
 - #107839 (avoid duplicating the RUSTC_LOG env var name)
 - #107866 (Allow wasi-libc to initialize its environment variables lazily.)
 - #107876 (create symlink only for non-windows operating systems)
 - #107882 (Cleanup typos in en_US/borrowck.ftl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-10 15:22:51 +00:00
bors
a28f53646d Auto merge of #14119 - Veykril:miniopt, r=Veykril
internal: Remove a few allocations in hir-ty::utils
2023-02-10 15:18:46 +00:00
Lukas Wirth
79492cb8ae internal: Revert castable expectation and simplify 2023-02-10 16:08:47 +01:00
Boxy
4c98429d8c Add tests 2023-02-10 14:56:28 +00:00
Boxy
fa83c10e96 implement compute_alias_eq_goal 2023-02-10 14:56:28 +00:00
Boxy
1f89e2aef2 emit AliasEq when relating type and const aliases 2023-02-10 14:33:13 +00:00
Matthias Krüger
1e106c1cf8
Rollup merge of #107882 - workingjubilee:fix-en-borrowck-ftl-typos, r=compiler-errors
Cleanup typos in en_US/borrowck.ftl

Noticed these while opening https://github.com/rust-lang/rust/pull/107881.
2023-02-10 15:28:50 +01:00
Matthias Krüger
08ce17affc
Rollup merge of #107876 - zephaniahong:issue-107547-fix, r=albertlarsan68
create symlink only for non-windows operating systems

Follow up on #107834
It's my first time using the #cfg attribute. Did I use it correctly?

Thank you!
2023-02-10 15:28:49 +01:00
Matthias Krüger
a4c64b9c0e
Rollup merge of #107866 - sunfishcode:sunfishcode/wasi-lazy-environ, r=workingjubilee
Allow wasi-libc to initialize its environment variables lazily.

Use `__wasilibc_get_environ()` to read the environment variable list from wasi-libc instead of using `environ`. `environ` is a global variable which effectively requires wasi-libc to initialize the environment variables eagerly, and `__wasilibc_get_environ()` is specifically designed to be an alternative that lets wasi-libc intiailize its environment variables lazily.

This should have the side effect of fixing at least some of the cases of #107635.
2023-02-10 15:28:48 +01:00
Matthias Krüger
d8e4d99001
Rollup merge of #107839 - RalfJung:rustc-log, r=oli-obk
avoid duplicating the RUSTC_LOG env var name

We also have the env var name here:
c40919b7a7/compiler/rustc_driver_impl/src/lib.rs (L1247-L1251)
Redundantly having this name twice doesn't seem great. Looks like `rustc_log::init_rustc_env_logger` is dead code anyway.

r? `@oli-obk`
2023-02-10 15:28:48 +01:00
Matthias Krüger
d494cd3eab
Rollup merge of #107836 - chenyukang:yukang/fix-107822, r=oli-obk
Handle properly when there is no crate attrs

Fixes #107822

r? `@oli-obk`
2023-02-10 15:28:47 +01:00
Matthias Krüger
dc7559b599
Rollup merge of #107789 - jieyouxu:issue-107745, r=lcnr
Avoid exposing type parameters and implementation details sourced from macro expansions

Fixes #107745.

~~I would like to **request some guidance** for this issue, because I don't think this is a good fix (a band-aid at best).~~

### The Problem

The code

```rust
fn main() {
    println!("{:?}", []);
}
```

gets desugared into (`rustc +nightly --edition=2018 issue-107745.rs -Z unpretty=hir`):

```rust
#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
fn main() {
        {
                ::std::io::_print(<#[lang = "format_arguments"]>::new_v1(&["",
                                    "\n"], &[<#[lang = "format_argument"]>::new_debug(&[])]));
            };
    }
```

so the diagnostics code tries to be as specific and helpful as possible, and I think it finds that `[]` needs a type parameter and so does `new_debug`. But since `[]` doesn't have an origin for the type parameter definition, it points to `new_debug` instead and leaks the internal implementation detail since all `[]` has is an type inference variable.

### ~~The Bad Fix~~

~~This PR currently tries to fix the problem by bypassing the generated function `<#[lang = "format_argument"]>::new_debug` to avoid its generic parameter (I think it is auto-generated from the argument `[_; 0]`?) from getting collected as an `InsertableGenericArg`. This is problematic because it also prevents the help from getting displayed.~~

~~I think this fix is not ideal and hard-codes the format generated code pattern, but I can't think of a better fix. I have tried asking on Zulip but no responses there yet.~~
2023-02-10 15:28:47 +01:00
lcnr
3a72238aa6 revert #107074 2023-02-10 15:24:39 +01:00
Ralf Jung
623ed8e481 fix rustc_log doctest 2023-02-10 15:07:55 +01:00
Lukas Wirth
8f5deb4ff2 Remove a few allocations in hir-ty::utils 2023-02-10 14:57:03 +01:00
Guillaume Gomez
a03da2bdeb Add test for implementation on projection 2023-02-10 14:44:54 +01:00
Boxy
23ab2464be add AliasEq to PredicateKind 2023-02-10 13:44:46 +00:00
Philipp Krones
5566eb4da2
Update Cargo.lock 2023-02-10 14:01:31 +01:00