Commit Graph

168271 Commits

Author SHA1 Message Date
bors
b862b438db Auto merge of #96888 - Aaron1011:fake-borrow-no-sort, r=petrochenkov
Use `FxIndexSet` to avoid sorting fake borrows

This fixes #96449, but I haven't yet been able to
make the reproducer work using `#[cfg]` attributes,
so we can't use the 'revision' infra to write a test

The previous implementation relied on sorting by `PlaceRef`.
This requires sorting by a `DefId`, which uses untracked state
(see #93315)
2022-05-11 04:09:45 +00:00
Ayrton
3d5b1eeb75 Fix e_flags for 32-bit MIPS targets in generated object file
In #95604 the compiler started generating a temporary symbols.o which is added
to the linker invocation. This object file has an `e_flags` which may be invalid
for 32-bit MIPS targets. Even though symbols.o doesn't contain code, linking
    with [lld fails](https://github.com/llvm/llvm-project/blob/main/lld/ELF/Arch/MipsArchTree.cpp#L79) with
```
rust-lld: error: foo-cgu.0.rcgu.o: ABI 'o32' is incompatible with target ABI 'n64'
```
because it omits the ABI bits (EF_MIPS_ABI_O32) so lld assumes it's using the
N64 ABI. This breaks linking on nightly for the out-of-tree [psx
target](https://github.com/ayrtonm/psx-sdk-rs/issues/9), the builtin
mipsel-sony-psp target (cc @overdrivenpotato) and any other 32-bit MIPS
target using lld.

This PR sets the ABI in `e_flags` to O32 since that's the only ABI for 32-bit
MIPS that LLVM supports. It also sets other `e_flags` bits based on the target.
I had to bump the object crate version since some of these constants were [added
recently](https://github.com/gimli-rs/object/pull/433). I'm not sure if this
PR needs a test, but I can confirm that it fixes the linking issue on both
targets I mentioned.
2022-05-10 22:48:19 -04:00
Jack Huey
319575ae8c Introduce EarlyBinder 2022-05-10 22:47:18 -04:00
bors
532be942dd Auto merge of #96375 - jyn514:bootstrap-submodules, r=Mark-Simulacrum
Fix running bootstrap tests on a fresh clone

In #96303, I changed the tests not to manage submodules, with the main
goal of avoiding a clone for llvm-project. Unfortunately, there are some tests
which depend on submodules - I didn't notice locally because they were already checked out for me,
and CI doesn't use submodule handling at all. Fresh clones, however, were impacted:
```
failures:

---- builder::tests::defaults::doc_default stdout ----
thread 'main' panicked at 'fs::read_dir(builder.src.join(&relative_path).join("redirects")) failed with No such file or directory (os error 2)', src/bootstrap/doc.rs:232:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- builder::tests::dist::dist_only_cross_host stdout ----
thread 'main' panicked at 'fs::read_to_string(&toml_file_name) failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1314:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Try and get the best of both worlds by only checking out the submodules actually used in tests.
2022-05-11 00:41:50 +00:00
Nicholas Nethercote
3cd8e9866d Remove some unnecessary invisible delimiter checks.
These seem to have no useful effect... they don't seem useful from a
code inspection point of view, and they affect anything in the test
suite.
2022-05-11 10:14:49 +10:00
Michael Howell
9dc5ac8c4b
Ignore order
This isn't an ordering test really, anyway...
2022-05-10 16:42:48 -07:00
Joshua Nelson
212fc2134d Fix running bootstrap tests on a fresh clone
In #96303, I changed the tests not to manage submodules, with the main
goal of avoiding a clone for llvm-project. Unfortunately, there are some tests
which depend on submodules - I didn't notice locally because they were already checked out for me,
and CI doesn't use submodule handling at all. Fresh clones, however, were impacted:
```
failures:

---- builder::tests::defaults::doc_default stdout ----
thread 'main' panicked at 'fs::read_dir(builder.src.join(&relative_path).join("redirects")) failed with No such file or directory (os error 2)', src/bootstrap/doc.rs:232:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- builder::tests::dist::dist_only_cross_host stdout ----
thread 'main' panicked at 'fs::read_to_string(&toml_file_name) failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1314:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Try and get the best of both worlds by only checking out the submodules actually used in tests.
2022-05-10 18:13:54 -05:00
Caio
aea3b22b06 Fix issue #95151 2022-05-10 18:29:35 -03:00
bors
ecd44958e0 Auto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, r=joshtriplett
Make `BorrowedFd::borrow_raw` a const fn.

Making `BorrowedFd::borrow_raw` a const fn allows it to be used to
create a constant `BorrowedFd<'static>` holding constants such as
`AT_FDCWD`. This will allow [`rustix::fs::cwd`] to become a const fn.

For consistency, make similar changes to `BorrowedHandle::borrow_raw`
and `BorrowedSocket::borrow_raw`.

[`rustix::fs::cwd`]: https://docs.rs/rustix/latest/rustix/fs/fn.cwd.html

r? `@joshtriplett`
2022-05-10 21:19:19 +00:00
Matthias Krüger
e2dc3967fa simplify length count 2022-05-10 20:42:45 +02:00
bors
fee75fbe11 Auto merge of #96905 - jyn514:revert-96803-faster-assemble, r=Mark-Simulacrum
Revert "Make "Assemble stage1 compiler" orders of magnitude faster"

Reverts rust-lang/rust#96803. This caused `llvm-tools-nightly` to fail when installing with `rustup-toolchain-install-master` because of the presence of symlinks. I'm not sure how the symlinks got in there, but revert the PR for now while I figure it out.

r? `@Mark-Simulacrum` cc `@RalfJung`
2022-05-10 18:26:31 +00:00
est31
493af0b54f Also allow unused macro rules in stdarch 2022-05-10 19:53:22 +02:00
Michael Howell
6257bd2f4e rustdoc: clean up method path index
This removes a special case that doesn't seem to do anything
any more.
2022-05-10 08:59:59 -07:00
Joshua Nelson
89e0c29489
Revert "Make "Assemble stage1 compiler" orders of magnitude faster" 2022-05-10 10:58:52 -05:00
bors
d4c364347c Auto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #96717 (Handle mismatched generic param kinds in trait impls betterly)
 - #96725 (Expose process windows_process_extensions_main_thread_handle on Windows)
 - #96849 (Move some tests to more reasonable places)
 - #96861 (Use Rust 2021 prelude in std itself.)
 - #96879 (rustdoc: search result ranking fix)
 - #96882 (Don't subst an AdtDef with its own substs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-10 15:58:17 +00:00
Dan Gohman
e8af822423 Update the wasi toolchain.
Update the WASI build to LLVM 14.0 and the wasi-libc version from wasi-sdk-15.

This will require a ci-mirrors.rust-lang.org file load. Specifically, we
need [this LLVM release tarball] uploaded to be downloadable from
[this URL].

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-05-10-clang%2Bllvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
2022-05-10 08:46:04 -07:00
Yuki Okushi
c5f2c4476e
Rollup merge of #96882 - jackh726:no-subst, r=oli-obk
Don't subst an AdtDef with its own substs
2022-05-11 00:09:36 +09:00
Yuki Okushi
d34915f691
Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomez
rustdoc: search result ranking fix

# Before

![image](https://user-images.githubusercontent.com/1593513/167477286-91049761-67f9-4a73-8fb7-09dbb19ca76c.png)

# After

![image](https://user-images.githubusercontent.com/1593513/167477345-6733bc0f-4bb2-4625-9f7f-094031e36414.png)
2022-05-11 00:09:35 +09:00
Yuki Okushi
7274447c36
Rollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplett
Use Rust 2021 prelude in std itself.
2022-05-11 00:09:34 +09:00
Yuki Okushi
ac97727528
Rollup merge of #96849 - c410-f3r:z-errors, r=petrochenkov
Move some tests to more reasonable places

cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`
2022-05-11 00:09:33 +09:00
Yuki Okushi
f689f6582c
Rollup merge of #96725 - nico-abram:win_tid, r=ChrisDenton
Expose process windows_process_extensions_main_thread_handle on Windows

~~I did not find any tests in 7d3e03666a/library/std/src/sys/windows/process/tests.rs that actually launch processes, so I haven't added tests for this.~~ I ran the following locally, to check that it works as expected:
```rs
#![feature(windows_process_extensions_main_thread_handle)]

fn main() {
    use std::os::windows::process::{ChildExt, CommandExt};
    const CREATE_SUSPENDED: u32 = 0x00000004;

    let proc = std::process::Command::new("cmd")
        .args(["/C", "echo hello"])
        .creation_flags(CREATE_SUSPENDED)
        .spawn()
        .unwrap();

    extern "system" {
        fn ResumeThread(_: *mut std::ffi::c_void) -> u32;
    }
    unsafe {
        ResumeThread(proc.main_thread_handle());
    }

    let output = proc.wait_with_output().unwrap();
    let str_output = std::str::from_utf8(&output.stdout[..]).unwrap();
    println!("{}", str_output);
}

```

Without the feature attribute it wouldn't compile, and commenting the `ResumeThread` line makes it hang forever, showing that it works.

Trakcing issue https://github.com/rust-lang/rust/issues/96723
2022-05-11 00:09:32 +09:00
Yuki Okushi
77030b7825
Rollup merge of #96717 - BoxyUwU:gats_const_param_types_mismatch_err, r=lcnr
Handle mismatched generic param kinds in trait impls betterly

- Check that generic params on a generic associated type are the same as in the trait definition
- Check that const generics are not used in place of type generics (and the other way round too)

r? `@lcnr`
2022-05-11 00:09:31 +09:00
Oli Scherer
d63f82e1ef Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes 2022-05-10 14:50:31 +00:00
Guillaume Gomez
fe4fa53fa8 Clean up rustdoc GUI test 2022-05-10 16:42:34 +02:00
Guillaume Gomez
f9fc7ef097 Remove unused CSS rule 2022-05-10 16:40:32 +02:00
Guillaume Gomez
f82b3a16d5 Fix JS error in source code pages 2022-05-10 16:40:14 +02:00
Collin Baker
b2316c1a88 Add test skip support
libtest already supports a "--skip SUBSTRING" arg which excludes any
test names matching SUBSTRING.

This adds a "--skip" argument to compiletest and bootstrap which is
forwarded to libtest.
2022-05-10 10:29:48 -04:00
bors
eead58e75b Auto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwco
Check hidden types for well formedness at the definition site instead of only at the opaque type itself

work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.
2022-05-10 13:39:43 +00:00
Ralf Jung
761077e19e fmt 2022-05-10 14:38:00 +02:00
Ralf Jung
aef8a9306d update/remove some old comments 2022-05-10 14:23:32 +02:00
Ralf Jung
600d960261 even tighter checks for layouts on immediate field projections 2022-05-10 14:23:32 +02:00
Ralf Jung
79c169d5cf disable one check for now until #96185 is fixed 2022-05-10 14:23:32 +02:00
Oli Scherer
824e9e47f7 Use InternedObligationCauseCode everywhere 2022-05-10 12:01:56 +00:00
Yuki Okushi
c7d5e40f7e
Add regression test for #68408 2022-05-10 20:52:01 +09:00
Ralf Jung
719655658a tighten sanity checks around Scalar and ScalarPair 2022-05-10 13:32:20 +02:00
SparrowLii
eead168dd7 optimize insert_range method of IntervalSet 2022-05-10 19:27:40 +08:00
Oli Scherer
213c17486e Make FunctionArgumentObligation also use the "no allocation for misc" trick 2022-05-10 11:26:53 +00:00
Oli Scherer
1b51e1ad20 Don't allocate misc obligation parents of derived obligations 2022-05-10 11:14:07 +00:00
Oli Scherer
9ba6ddb929 Make the derived obligation cause parent private 2022-05-10 11:10:27 +00:00
Oli Scherer
5b5b549580 Add a helper function for a common piece of code 2022-05-10 11:03:52 +00:00
bors
c51871c469 Auto merge of #94799 - lcnr:list-ty-perf, r=petrochenkov
update `hash_stable` for `List<Ty<'tcx>>`

cc https://github.com/rust-lang/rust/pull/93505#issuecomment-1047538798

this is the hottest part changed since the pre-merge perf run
2022-05-10 10:53:47 +00:00
Oli Scherer
05a62c5527 Remove clone_code method 2022-05-10 10:42:29 +00:00
Oli Scherer
dc21fcb2fc Remove another use of clone_code 2022-05-10 10:32:35 +00:00
Oli Scherer
063795ce4a Remove another use of clone_code 2022-05-10 10:26:43 +00:00
lcnr
ebf95836e3 fix typo 2022-05-10 12:07:36 +02:00
lcnr
7cf9f1ab91 change some attrs to only_local 2022-05-10 12:07:36 +02:00
lcnr
5ee1b18a14 update clippy 2022-05-10 12:07:35 +02:00
lcnr
bae84a484c update rustdoc 2022-05-10 12:07:35 +02:00
lcnr
6c8265dc56 only_local: always check for misuse 2022-05-10 12:07:35 +02:00
Oli Scherer
704bbe5210 Move an extension trait method onto the type directly and reuse it 2022-05-10 09:26:09 +00:00