Commit Graph

161954 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews
ee6c33c255 Fix spacing for · between stability and source 2022-01-21 15:00:20 -08:00
Guillaume Gomez
f0525da124 Unify search input and buttons size 2022-01-21 23:38:48 +01:00
Santiago Pastorino
e2567b034d
Remove intermediate function doesn't make more sense 2022-01-21 18:23:36 -03:00
Santiago Pastorino
19e3c86003
Make strict_disjoint use explicit_disjoint 2022-01-21 18:23:22 -03:00
Santiago Pastorino
1ec962fb34
Do not pass OverlapMode down, just create a closure to properly set the filtering 2022-01-21 18:22:24 -03:00
Santiago Pastorino
d2d25a5be0
Implement stable with negative coherence mode 2022-01-21 18:22:21 -03:00
Santiago Pastorino
c2890ed426
Add overlap mode 2022-01-21 18:21:04 -03:00
Santiago Pastorino
b2a45f0645
Extract stable_disjoint fn 2022-01-21 18:20:58 -03:00
Matthias Krüger
26e9357fae
Rollup merge of #93139 - jsha:fix-wrapped-names, r=Nemo157
rustdoc: fix overflow-wrap for table layouts

For all table layouts, set overflow-wrap: break-word.

Fixes #93135

Demo: https://rustdoc.crud.net/jsha/fix-wrapped-names/std/intrinsics/index.html#functions

(Compare vs https://doc.rust-lang.org/nightly/std/intrinsics/index.html - you may have to make your browser narrower to see the effect)

r? `@Nemo157`
2022-01-21 22:03:20 +01:00
Matthias Krüger
081d65fa4a
Rollup merge of #93134 - tlyu:delete-stdin-split, r=Amanieu
delete `Stdin::split` forwarder

Part of #87096. Delete the `Stdin::split` forwarder because it's seen as too niche to expose at this level.

`@rustbot` label T-libs-api A-io
2022-01-21 22:03:19 +01:00
Matthias Krüger
9474c74fb6
Rollup merge of #93109 - JakobDegen:arc-docs, r=m-ou-se
Improve `Arc` and `Rc` documentation

This makes two changes (I can split the PR if necessary, but the changes are pretty small):
 1. A bunch of trait implementations claimed to be zero cost; however, they use the `Arc<T>: From<Box<T>>` impl which is definitely not free, especially for large dynamically sized `T`.
 2.  The code in deferred initialization examples unnecessarily used excessive amounts of `unsafe`. This has been reduced.
2022-01-21 22:03:18 +01:00
Matthias Krüger
ab19d4a515
Rollup merge of #93046 - est31:let_else, r=davidtwco
Use let_else in even more places

Followup of #89933, #91018, #91481.
2022-01-21 22:03:17 +01:00
Matthias Krüger
1f3a2dd0b1
Rollup merge of #92963 - terrarier2111:tuple-diagnostic, r=davidtwco
Implement tuple array diagnostic

Fixes https://github.com/rust-lang/rust/issues/92089
2022-01-21 22:03:16 +01:00
Matthias Krüger
430673f265
Rollup merge of #92843 - camelid:str-concat-sugg, r=davidtwco
Improve string concatenation suggestion

Before:

    error[E0369]: cannot add `&str` to `&str`
     --> file.rs:2:22
      |
    2 |     let _x = "hello" + " world";
      |              ------- ^ -------- &str
      |              |       |
      |              |       `+` cannot be used to concatenate two `&str` strings
      |              &str
      |
    help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
      |
    2 |     let _x = "hello".to_owned() + " world";
      |              ~~~~~~~~~~~~~~~~~~

After:

    error[E0369]: cannot add `&str` to `&str`
     --> file.rs:2:22
      |
    2 |     let _x = "hello" + " world";
      |              ------- ^ -------- &str
      |              |       |
      |              |       `+` cannot be used to concatenate two `&str` strings
      |              &str
      |
      = note: string concatenation requires an owned `String` on the left
    help: create an owned `String` from a string reference
      |
    2 |     let _x = "hello".to_owned() + " world";
      |                     +++++++++++
2022-01-21 22:03:15 +01:00
Matthias Krüger
e38cbc78aa
Rollup merge of #92835 - iwanders:issue-66450-improve-cfg-error-message, r=nagisa
Improve error message for key="value" cfg arguments.

Hi, I ran into difficulties using the `--cfg` flag syntax, first hit when googling for the error was issue https://github.com/rust-lang/rust/issues/66450. Reading that issue, it sounded like the best way to improve the experience was to improve the error message, this is low risk and doesn't introduce any additional argument parsing.

The issue mentions that it is entirely dependent on the shell, while this may be true, I think guiding the the user into the realization that the quotes may need to be escaped is helpful. The two suggested escapings both work in Bash and in the Windows command prompt.

fyi `@ehuss`
2022-01-21 22:03:14 +01:00
Matthias Krüger
701a8330e8
Rollup merge of #92586 - esp-rs:bugfix/allocation-alignment-espidf, r=yaahc
Set the allocation MIN_ALIGN for espidf to 4.

Closes https://github.com/esp-rs/rust/issues/99.

cc: `@ivmarkov`
2022-01-21 22:03:13 +01:00
Matthias Krüger
10c9ec399e
Rollup merge of #92467 - Aaron1011:extern-local-region, r=oli-obk
Ensure that early-bound function lifetimes are always 'local'

During borrowchecking, we treat any free (early-bound) regions on
the 'defining type' as `RegionClassification::External`. According
to the doc comments, we should only have 'external' regions when
checking a closure/generator.

However, a plain function can also have some if its regions
be considered 'early bound' - this occurs when the region is
constrained by an argument, appears in a `where` clause, or
in an opaque type. This was causing us to incorrectly mark these
regions as 'external', which caused some diagnostic code
to act as if we were referring to a 'parent' region from inside
a closure.

This PR marks all instantiated region variables as 'local'
when we're borrow-checking something other than a
closure/generator/inline-const.
2022-01-21 22:03:12 +01:00
Matthias Krüger
fc694064e8
Rollup merge of #91965 - ferrocene:pa-more-granular-exclude, r=Mark-Simulacrum
Add more granular `--exclude` in `x.py`

x.py has support for excluding some steps from the current invocation, but unfortunately that's not granular enough: some steps have the same name in different modules, and that prevents excluding only *some* of them.

As a practical example, let's say you need to run everything in `./x.py test` except for the standard library tests, as those tests require IPv6 and need to be executed on a separate machine. Before this commit, if you were to just run this:

    ./x.py test --exclude library/std

...the invocation would eventually fail, as that would not only exclude running the tests for the standard library (`library/std` in the `test` module), it would also exclude generating its documentation (`library/std` in the `doc` module), breaking linkchecker.

This commit adds support to the `--exclude` flag for prefixing paths with the name of the module their step is defined in, allowing the user to choose which module to exclude from:

    ./x.py test --exclude test::library/std

This maintains backward compatibility with existing invocations, while allowing more ganular exclusion. Examples of the behavior:

| `--exclude`         | Docs    | Tests   |
| ------------------- | ------- | ------- |
| `library/std`       | Skipped | Skipped |
| `doc::library/std`  | Skipped | Run     |
| `test::library/std` | Run     | Skipped |

Note that this PR only changes the `--exclude` flag, and not in other `x.py` arguments or flags yet.

In the implementation I tried to limit the impact this would have with rustbuild as a whole as much as possible. The module name is extracted from the step by parsing the result of `std::any::type_name()`: unfortunately that output can change at any point in time, but IMO it's better than having to annotate all the existing and future `Step` implementations with the module name. I added a test to ensure the parsing works as expected, so hopefully if anyone makes changes to the output of `std::any::type_name()` they'll also notice they have to update rustbuild.

r? `@Mark-Simulacrum`
2022-01-21 22:03:11 +01:00
bors
17d29dcdce Auto merge of #92363 - the8472:less-compiletest-normalization, r=Mark-Simulacrum
Override rustc version in ui and mir-opt tests to get stable hashes

Building a dozen separate regexps for each test in compiletest consumes significant amounts of CPU cycles.

UI test timings on my machine:

OLD: 39.63s
NEW: 30.27s
2022-01-21 20:47:48 +00:00
Jacob Hoffman-Andrews
2eb8bfc643 rustdoc: remove dashed underline under main heading 2022-01-21 12:04:59 -08:00
Guillaume Gomez
78cee22fb4 Add missing GUI test explanations 2022-01-21 20:41:47 +01:00
Wesley Wiser
1a0278e1d1 Work around missing code coverage data causing llvm-cov failures
If we do not add code coverage instrumentation to the `Body` of a
function, then when we go to generate the function record for it, we
won't write any data and this later causes llvm-cov to fail when
processing data for the entire coverage report.

I've identified two main cases where we do not currently add code
coverage instrumentation to the `Body` of a function:

  1. If the function has a single `BasicBlock` and it ends with a
     `TerminatorKind::Unreachable`.

  2. If the function is created using a proc macro of some kind.

For case 1, this typically not important as this most often occurs as
the result of function definitions that take or return uninhabited
types. These kinds of functions, by definition, cannot even be called so
they logically should not be counted in code coverage statistics.

For case 2, I haven't looked into this very much but I've noticed while
testing this patch that (other than functions which are covered by case
1) the skipped function coverage debug message is occasionally triggered
in large crate graphs by functions generated from a proc macro. This may
have something to do with weird spans being generated by the proc macro
but this is just a guess.

I think it's reasonable to land this change since currently, we fail to
generate *any* results from llvm-cov when a function has no coverage
instrumentation applied to it. With this change, we get coverage data
for all functions other than the two cases discussed above.
2022-01-21 19:39:18 +00:00
Eric Holk
ead84d0895 Add reference to breakage this works around 2022-01-21 11:06:14 -08:00
Rune Tynan
66d056a9bf Update test to include self case 2022-01-21 13:19:18 -05:00
Rune Tynan
f4b42946c8 Remove FIXME and fix inconsistency of local blanket impls by using HIR for them 2022-01-21 13:01:58 -05:00
Eric Holk
2c2deff74a Add regression test for #93161 2022-01-21 09:48:39 -08:00
bors
cbaeec14f9 Auto merge of #92983 - pietroalbini:pa-bump-runner-images, r=Mark-Simulacrum
Update Linux runners to Ubuntu 20.04

r? `@Mark-Simulacrum`
2022-01-21 17:43:39 +00:00
Eric Holk
13090889f5 Disable drop range tracking in generators
Generator drop tracking caused an ICE for generators involving the Never
type (Issue #93161). Since this breaks miri, we temporarily disable drop
tracking so miri is unblocked while we properly fix the issue.
2022-01-21 09:36:24 -08:00
Amanieu d'Antras
361a2f9a83 Update HashMap::try_reserve test to version from hashbrown 2022-01-21 17:20:38 +00:00
Amanieu d'Antras
88149d13e3 Update hashbrown to 0.12.0 2022-01-21 17:20:38 +00:00
Vadim Petrochenkov
29d623528d Gate l4-bender linker flavor 2022-01-21 16:51:10 +01:00
Benjamin Lamowski
660d993c64 adapt L4Bender implementation
- Fix style errors.

- L4-bender does not yet support dynamic linking.

- Stack unwinding is not yet supported for x86_64-unknown-l4re-uclibc.
  For now, just abort on panics.

- Use GNU-style linker options where possible. As suggested by review:
    - Use standard GNU-style ld syntax for relro flags.
    - Use standard GNU-style optimization flags and logic.
    - Use standard GNU-style ld syntax for --subsystem.

- Don't read environment variables in L4Bender linker. Thanks to
  CARGO_ENCODED_RUSTFLAGS introduced in #9601, l4-bender's arguments can
  now be passed from the L4Re build system without resorting to custom
  parsing of environment variables.
2022-01-21 16:50:33 +01:00
Amanieu d'Antras
24588e6b3a Old versions of Android generate SIGSEGV from libc::abort 2022-01-21 15:44:57 +00:00
bors
4992548f28 Auto merge of #8271 - Jarcho:ptr_arg_214, r=flip1995
Check usages in `ptr_arg`

fixes #214
fixes #1981
fixes #3381
fixes #6406
fixes #6964

This does not take into account the return type of the function currently, so `(&Vec<_>) -> &Vec<_>` functions may still be false positives.

The name given for the type also has to match the real type name, so `type Foo = Vec<u32>` won't trigger the lint, but `type Vec = Vec<u32>` will. I'm not sure if this is the best way to handle this, or if a note about the actual type should be added instead.

changelog: Check if the argument is used in a way which requires the original type in `ptr_arg`
changelog: Lint mutable references in `ptr_arg`
2022-01-21 15:43:57 +00:00
Sebastian Humenda
d98428711e Add L4Bender as linker variant 2022-01-21 16:28:33 +01:00
Jason Newcomb
15c068ed0f Fix needless_borrow causing mutable borrows to be moved 2022-01-21 09:50:11 -05:00
Jason Newcomb
048297b5b2 ptr_arg cleanup 2022-01-21 09:43:41 -05:00
bors
4d8b66aefd Auto merge of #92787 - camsteffen:methodcall-span, r=Mark-Simulacrum
Remove a `Span` from `hir::ExprKind::MethodCall`

It's just a copy of `MethodCall.0.ident.span`.
2022-01-21 14:33:17 +00:00
Santiago Pastorino
052b31b587
Move auxiliary fns out of overlap_with_probe 2022-01-21 10:53:17 -03:00
Santiago Pastorino
f518827503
Use impl1 and impl2 instead of a and b prefixes 2022-01-21 10:50:42 -03:00
Cameron Steffen
82f613ee3b Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
Cameron Steffen
b11733534d Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
bors
f4709e6f1d Auto merge of #8329 - Alexendoo:enum-variant-names, r=giraffate
Don't suggest an empty variant name in `enum_variant_names`

changelog: false positive fix: [`enum_variant_names`]: No longer suggests an empty variant name

Fixes #8324
2022-01-21 13:37:18 +00:00
Alex Macleod
7c563175c7 Don't suggest an empty variant name in enum_variant_names 2022-01-21 13:10:19 +00:00
Tavian Barnes
3eeb3ca407 fs: Use readdir() instead of readdir_r() on Android
Bionic also guarantees that readdir() is thread-safe enough.
2022-01-21 07:59:14 -05:00
Tavian Barnes
bc04a4eac4 fs: Use readdir() instead of readdir_r() on Linux
readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names.  Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe.  This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.

See #40021 for more details.  Fixes #86649.  Fixes #34668.
2022-01-21 07:59:14 -05:00
Tavian Barnes
c3e92fec94 fs: Implement more ReadDir methods in terms of name_cstr() 2022-01-21 07:59:14 -05:00
bors
84e918971d Auto merge of #92896 - lqd:update-deps, r=Mark-Simulacrum
Update some rustc dependencies to deduplicate them

This PR updates `rand` and `itertools` in rustc (not the whole workspace) in order to deduplicate them (and hopefully slightly improve compile times).

~~Currently, `object` is still duplicated, but https://github.com/rust-lang/thorin/pull/15 and updating `thorin` in the future will remove the use of version 0.27.~~  Update: Thorin 0.2 has now been released, and this PR updates `rustc_codegen_ssa` to use it and deduplicate the `object` crate.

There's a final tiny rustc dependency, `cfg-if`, which will be left: as both versions 0.1.x and 1.0 looked to be heavily depended on, they will require a few cascading updates to be removed.
2022-01-21 10:38:30 +00:00
Pietro Albini
b3ad40532d
allow excluding paths only from a single module
x.py has support for excluding some steps from the invocation, but
unfortunately that's not granular enough: some steps have the same name
in different modules, and that prevents excluding only *some* of them.

As a practical example, let's say you need to run everything in `./x.py
test` except for the standard library tests, as those tests require IPv6
and need to be executed on a separate machine. Before this commit, if
you were to just run this:

    ./x.py test --exclude library/std

...the execution would fail, as that would not only exclude running the
tests for the standard library, it would also exclude generating its
documentation (breaking linkchecker).

This commit adds support for an optional module annotation in --exclude
paths, allowing the user to choose which module to exclude from:

    ./x.py test --exclude test::library/std

This maintains backward compatibility, but also allows for more ganular
exclusion. More examples on how this works:

| `--exclude`         | Docs    | Tests   |
| ------------------- | ------- | ------- |
| `library/std`       | Skipped | Skipped |
| `doc::library/std`  | Skipped | Run     |
| `test::library/std` | Run     | Skipped |

Note that the new behavior only works in the `--exclude` flag, and not
in other x.py arguments or flags yet.
2022-01-21 09:33:43 +01:00
Pietro Albini
b27d59d083
replace paths in PathSet with a dedicated TaskPath struct 2022-01-21 09:33:38 +01:00