Commit Graph

162277 Commits

Author SHA1 Message Date
est31
105a7461b9 Remove deprecated and unstable slice_partition_at_index functions
They have been deprecated since commit 01ac5a97c9
which was part of the 1.49.0 release, so from the point of nightly,
11 releases ago.
2022-01-30 16:19:03 +01:00
Maybe Waffle
17cd2cd592 Fix an edge case in chat::DecodeUtf16::size_hint
There are cases, when data in the buf might or might not be an error.
2022-01-30 15:32:21 +03:00
Guillaume Gomez
2604968d03 Add test to ensure that theme is applied correctly when going back in history 2022-01-30 13:19:01 +01:00
bors
7cc28c128b Auto merge of #93468 - matthiaskrgr:rollup-vxullvd, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #93256 (Make `join!` description more accurate)
 - #93358 (Add note suggesting that predicate may be satisfied, but is not `const`)
 - #93362 (Do not register infer var for GAT projection in RPIT)
 - #93391 (rustdoc: remove tooltip from source link)
 - #93414 (Move unstable is_{arch}_feature_detected! macros to std::arch)
 - #93441 (rustdoc: load the set of in-scope traits for modules with no docstring)
 - #93459 (fs: Don't copy d_name from struct dirent)
 - #93463 (Rename _args -> args in format_args expansion)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-01-30 10:30:42 +00:00
Jakub Beránek
8de59be933
Compress amount of hashed bytes for isize values in StableHasher 2022-01-30 09:52:44 +01:00
Jacob Hoffman-Andrews
a998a37476 rustdoc: small fixes to mobile navigation
- Make sure the mobile-topbar doesn't overflow its height if the user
  sets a bigger font.

- Make sure the sidebar can be scrolled all the way to the bottom by
  shortening it to accommodate the mobile-topbar.

- Make the item name in the mobile-topbar clickable to go to the top of
  the page.

- Remove excess padding sidebar in mobile mode.
2022-01-29 17:13:14 -08:00
Josh Stone
d70b9c03ec unix: Use metadata for DirEntry::file_type fallback
When `DirEntry::file_type` fails to match a known `d_type`, we should
fall back to `DirEntry::metadata` instead of a bare `lstat`, because
this is faster and more reliable on targets with `fstatat`.
2022-01-29 16:58:18 -08:00
Matthias Krüger
9f6d0cb052
Rollup merge of #93463 - dtolnay:_args, r=cjgillot
Rename _args -> args in format_args expansion

As observed in https://github.com/rust-lang/rust/pull/91359#discussion_r786058960, prior to that PR this variable was sometimes never used, such as in the case of:

```rust
println!("");

// used to expand to:
::std::io::_print(
    ::core::fmt::Arguments::new_v1(
        &["\n"],
        &match () {
            _args => [],
        },
    ),
);
```

so the leading underscore in `_args` was used to suppress an unused variable lint. However after #91359 the variable is always used when present, as the unused case would instead expand to:

```rust
::std::io::_print(::core::fmt::Arguments::new_v1(&["\n"], &[]));
```
2022-01-30 00:04:17 +01:00
Matthias Krüger
0d08bbc8c8
Rollup merge of #93459 - tavianator:dirent-copy-only-reclen, r=cuviper
fs: Don't copy d_name from struct dirent

The dirent returned from readdir() is only guaranteed to be valid for
d_reclen bytes on common platforms.  Since we copy the name separately
anyway, we can copy everything except d_name into DirEntry::entry.

Fixes #93384.
2022-01-30 00:04:16 +01:00
Matthias Krüger
605ffd6113
Rollup merge of #93441 - notriddle:notriddle/collect-crate-doc-links-very-early, r=petrochenkov
rustdoc: load the set of in-scope traits for modules with no docstring

Fixes #93428

This fix is a response to a couple of special cases related to the `module_id`, which is eventually used for trait candidates:

  * The module id is always set to the current crate, when checking `crate::`.

    Normally, the set of in-scope traits would be set in `load_links_in_attrs`, but if there are no doc comments, then that loop will never run.

  * the module id is set to the parent module, when resolving a module that is spelled like this:

        // Notice how we use an outlined doc comment here!
        // [`Test::my_fn`]
        mod something {
        }

    As with the above problem with `crate::`, we need to make sure the module gets its traits in scope resolved, even if it has no doc comments of its own.
2022-01-30 00:04:15 +01:00
Matthias Krüger
329753e248
Rollup merge of #93414 - Amanieu:std_arch_detect, r=m-ou-se
Move unstable is_{arch}_feature_detected! macros to std::arch

These macros are unstable, except for `is_x86_feature_detected` which is still exported from the crate root for backwards-compatibility.

This should unblock the stabilization of `is_aarch64_feature_detected`.

r? ```@m-ou-se```
2022-01-30 00:04:14 +01:00
Matthias Krüger
0b2359baa7
Rollup merge of #93391 - notriddle:notriddle/remove-srclink-tooltip, r=jsha,GuillaumeGomez
rustdoc: remove tooltip from source link

This made more sense back when it was abbreviated, but now it seems redundant.
2022-01-30 00:04:13 +01:00
Matthias Krüger
4484165cbd
Rollup merge of #93362 - compiler-errors:ice-gat-in-rpit, r=oli-obk
Do not register infer var for GAT projection in RPIT

Fixes #93340
Fixes #91603

r? ```@oli-obk```
2022-01-30 00:04:12 +01:00
Matthias Krüger
103c3a38a6
Rollup merge of #93358 - compiler-errors:is-not-const, r=fee1-dead
Add note suggesting that predicate may be satisfied, but is not `const`

Not sure if we should be printing this in addition to, or perhaps _instead_ of the help message:
```
help: the trait `~const Add` is not implemented for `NonConstAdd`
```

Also added `ParamEnv::is_const` and `PolyTraitPredicate::is_const_if_const` and, in a separate commit, used those in other places instead of `== hir::Constness::Const`, etc.

r? ````@fee1-dead````
2022-01-30 00:04:11 +01:00
Matthias Krüger
6e2593d343
Rollup merge of #93256 - EFanZh:patch-1, r=joshtriplett
Make `join!` description more accurate
2022-01-30 00:04:10 +01:00
Tomasz Miąsko
35b5daaaf8 Check the number of arguments first in is_recursive_call 2022-01-29 23:00:54 +01:00
Tavian Barnes
d0c8b29ec6 fs: Add a regression test for #93384 2022-01-29 16:37:21 -05:00
Tavian Barnes
f8f4c40527 fs: Don't copy d_name from struct dirent
The dirent returned from readdir() is only guaranteed to be valid for
d_reclen bytes on common platforms.  Since we copy the name separately
anyway, we can copy everything except d_name into DirEntry::entry.

Fixes #93384.
2022-01-29 16:37:21 -05:00
Noah Lev
f8a013f858 Fix some CSS warnings and errors from VS Code
There's no such CSS rule as `box-shadow-color`, so I instead copied the
whole `box-shadow` property to each rule to make it actually apply.
2022-01-29 12:51:18 -08:00
David Tolnay
6667d785d8
Rename _args -> args in format_args expansion 2022-01-29 12:44:41 -08:00
Chris Denton
0189a21c19
Document SystemTime platform precision 2022-01-29 20:41:18 +00:00
Daniel Sommermann
746b3d87b3 Update compiler_builtins to fix duplicate symbols in armv7-linux-androideabi rlib
I ran `./x.py dist --host= --target=armv7-linux-androideabi` before this diff:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-3d9661a82c59c66a.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
2
```
And after:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-ffd2745070943321.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
1
```
Fixes #93310
2022-01-29 08:28:52 -08:00
bors
a00e130dae Auto merge of #93457 - matthiaskrgr:rollup-e43ry1l, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #88205 (Add Explanation For Error E0772)
 - #92274 (Add `intrinsics::const_deallocate`)
 - #93236 (Make `NonNull::new` `const`)
 - #93299 (Fix dot separator when there is no source link)
 - #93410 (kmc-solid: Implement `net::FileDesc::duplicate`)
 - #93424 (fix nit)
 - #93431 (remove unused `jemallocator` crate)
 - #93453 (Add GUI theme change test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-01-29 16:08:35 +00:00
Gary Guo
0d4bb0b295 Change index_refutable_slice to use FxIndexMap
This will prevent unstable order when HirIds are pertubated.
2022-01-29 13:52:19 +00:00
Gary Guo
a832f5f7bc Create core::fmt::ArgumentV1 with generics instead of fn pointer 2022-01-29 13:52:19 +00:00
Matthias Krüger
d62b414b80
Rollup merge of #93453 - GuillaumeGomez:theme-change-test, r=jsha
Add GUI theme change test

r? `@jsha`
2022-01-29 14:46:35 +01:00
Matthias Krüger
c866ae5e93
Rollup merge of #93431 - lqd:remove-jemallocator, r=Mark-Simulacrum
remove unused `jemallocator` crate

When it was noticed that the rustc binary wasn't actually using jemalloc via `#[global_allocator]` and that was removed, the dependency remained.

Tests pass locally with a `jemalloc = true` build, but I'll trigger a try build to ensure I haven't missed an edge-case somewhere.

r? ```@ghost``` until that completes
2022-01-29 14:46:34 +01:00
Matthias Krüger
6621ff4a7c
Rollup merge of #93424 - lcnr:nit, r=spastorino
fix nit
2022-01-29 14:46:33 +01:00
Matthias Krüger
2836dcd2df
Rollup merge of #93410 - solid-rs:feat-kmc-solid-net-dup, r=dtolnay
kmc-solid: Implement `net::FileDesc::duplicate`

This PR implements `std::sys::solid::net::FileDesc::duplicate`, which was accidentally left out when this target was added by #86191.
2022-01-29 14:46:32 +01:00
Matthias Krüger
f5f2d44261
Rollup merge of #93299 - GuillaumeGomez:dot-separator-no-source, r=jsha
Fix dot separator when there is no source link

Fixes #92973.

We did well adding this test since there was a bug:

![Screenshot from 2022-01-25 17-05-48](https://user-images.githubusercontent.com/3050060/151016535-39b45f52-e1e0-4963-ad19-532e24ec4c9b.png)

r? `@jsha`
2022-01-29 14:46:32 +01:00
Matthias Krüger
37e9cb34e5
Rollup merge of #93236 - woppopo:const_nonnull_new, r=oli-obk
Make `NonNull::new` `const`

Tracking issue: #93235
2022-01-29 14:46:31 +01:00
Matthias Krüger
9e86a434a7
Rollup merge of #92274 - woppopo:const_deallocate, r=oli-obk
Add `intrinsics::const_deallocate`

Tracking issue: #79597
Related: #91884

This allows deallocation of a memory allocated by `intrinsics::const_allocate`. At the moment, this can be only used to reduce memory usage, but in the future this may be useful to detect memory leaks (If an allocated memory remains after evaluation, raise an error...?).
2022-01-29 14:46:30 +01:00
Matthias Krüger
11898a56c2
Rollup merge of #88205 - danii:e0772, r=GuillaumeGomez
Add Explanation For Error E0772

I've added an error explanation for the error code E0772.

Assists with #61137
2022-01-29 14:46:29 +01:00
bors
d08e816333 Auto merge of #92312 - BGR360:needs-test, r=Mark-Simulacrum
Add tests for three old ICEs

Closes #84044
Closes #91594
Closes #89066
2022-01-29 13:04:51 +00:00
Santiago Pastorino
bf1ca2e4b0
Make local_def_id_to_hir_id query directly returh HirId 2022-01-29 08:40:23 -03:00
woppopo
9728cc4e26 Document about some behaviors of const_(de)allocate and add some tests. 2022-01-29 19:13:23 +09:00
Guillaume Gomez
aee9ebae96 Extend theme change GUI test 2022-01-29 10:44:27 +01:00
Guillaume Gomez
fa11fb4c5a Update browser-ui-test version to 0.5.8 2022-01-29 10:44:18 +01:00
bors
ca43894e0e Auto merge of #93351 - anp:fuchsia-remove-dir-all, r=tmandry
Bump libc and fix remove_dir_all on Fuchsia after CVE fix

With the previous `is_dir` impl, we would attempt to unlink
a directory in the None branch, but Fuchsia supports returning
ENOTEMPTY from unlinkat() without the AT_REMOVEDIR flag because
we don't currently differentiate unlinking files and directories
by default.

On the Fuchsia side I've opened https://fxbug.dev/92273 to discuss
whether this is the correct behavior, but it doesn't seem like
addressing the error code is necessary to make our tests happy.

Depends on https://github.com/rust-lang/libc/pull/2654 since we
apparently haven't needed to reference DT_UNKNOWN before this.
2022-01-29 09:01:01 +00:00
bors
24ae9960c5 Auto merge of #93434 - Mark-Simulacrum:apple-various, r=pietroalbini
Move tier-2 (without host tools) apple targets to separate builder

One-off (likely fairly unreliable, but give some idea) measurements:

* dist-apple-various (new):  2h10m
* dist-x86_64-apple: 2h55m -> 2h36m (cutting roughly 20 minutes)
2022-01-29 02:20:00 +00:00
Ben Reeves
3f849a8b1e Add test for old ICE in #89066 2022-01-28 18:42:24 -05:00
Ben Reeves
2819d9051c Add test for old ICE in #91594 2022-01-28 18:42:23 -05:00
Ben Reeves
5b2747a3b9 Add test for old ICE
The ICE from #84044 no longer occurs.
2022-01-28 18:42:23 -05:00
bors
6250d5a08c Auto merge of #93427 - matthiaskrgr:rollup-esd3ixl, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #92611 (Add links to the reference and rust by example for asm! docs and lints)
 - #93158 (wasi: implement `sock_accept` and enable networking)
 - #93239 (Add os::unix::net::SocketAddr::from_path)
 - #93261 (Some unwinding related cg_ssa cleanups)
 - #93295 (Avoid double panics when using `TempDir` in tests)
 - #93353 (Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t>)
 - #93356 (Edit docs introduction for `std::cmp::PartialOrd`)
 - #93375 (fix typo `documenation`)
 - #93399 (rustbuild: Fix compiletest warning when building outside of root.)
 - #93404 (Fix a typo from #92899)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-01-28 23:20:38 +00:00
Jane Lusby
91ffbc43b1 Change Termination::report return type to ExitCode 2022-01-28 12:53:36 -08:00
Adam Perry
8c9944c50d Fix remove_dir_all on Fuchsia after CVE fix.
With the previous `is_dir` impl, we would attempt to unlink
a directory in the None branch, but Fuchsia supports returning
ENOTEMPTY from unlinkat() without the AT_REMOVEDIR flag because
we don't currently differentiate unlinking files and directories
by default.

On the Fuchsia side I've opened https://fxbug.dev/92273 to discuss
whether this is the correct behavior, but it doesn't seem like
addressing the error code is necessary to make our tests happy.

Updates std's libc crate to include DT_UNKNOWN for Fuchsia.
2022-01-28 20:38:39 +00:00
bors
e0a55f4491 Auto merge of #93426 - pnkfelix:issue-91671-backport-llvm-fix, r=nikic
backport llvm fix for issue 91671.

fix #91671
2022-01-28 20:11:52 +00:00
Michael Howell
3903ca197e rustdoc: load the set of in-scope traits for modules with no docstring
Fixes #93428

This fix is a response to a couple of special cases related to the
`module_id`, which is eventually used for trait candidates:

  * The module id is always set to the current crate, when checking `crate::`.

    Normally, the set of in-scope traits would be set in `load_links_in_attrs`,
    but if there are no doc comments, then that loop will never run.

  * the module id is set to the parent module, when resolving a module
    that is spelled like this:

        // Notice how we use an outlined doc comment here!
        // [`Test::my_fn`]
        mod something {
        }

    As with the above problem with `crate::`, we need to make sure the
    module gets its traits in scope resolved, even if it has no doc comments
    of its own.
2022-01-28 12:24:13 -07:00
Santiago Pastorino
5a299a9903
Make local_def_id_to_hir_id return MaybeOwner<()> 2022-01-28 15:13:01 -03:00
Santiago Pastorino
d17eb78cf8
Separate hir_owner query into two queries to avoid using extensive data on incr comp most of the time 2022-01-28 14:58:27 -03:00