]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoRollup merge of #102591 - JarvisCraft:fix-double-a-article, r=compiler-errors
Matthias Krüger [Mon, 3 Oct 2022 06:00:47 +0000 (08:00 +0200)]
Rollup merge of #102591 - JarvisCraft:fix-double-a-article, r=compiler-errors

Fix duplicate usage of `a` article.

This fixes a typo first appearing in #94624 in which test-macro diagnostic uses "a" article twice.

Since I searched the sources for " a a " sequences, I also fixed the same issue in a few files where I found it.

21 months agoRollup merge of #102550 - notriddle:notriddle/impl, r=GuillaumeGomez
Matthias Krüger [Mon, 3 Oct 2022 06:00:47 +0000 (08:00 +0200)]
Rollup merge of #102550 - notriddle:notriddle/impl, r=GuillaumeGomez

rustdoc: remove no-op CSS on `.impl, .method` etc

Preview: http://notriddle.com/notriddle-rustdoc-demos/impl/index.html

# `flex-basis: 100%`

When `.impl-items { flex-basis: 100% }` and `h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant` were added in https://github.com/rust-lang/rust/commit/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, it seems like it was a mistake even then. According to MDN, [flex-basis] does nothing unless the box it's applied to is a flex *item*, a child of a flex container. However, when this was added, these elements were flex containers themselves.

[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis

# `position: relative`

This property was added to help with positioning the `[+]/[-]` toggle. It is no longer necessary, because `details.rustdoc-toggle` already has `position:relative` set on it.

21 months agoreturn when obligation has references_error
Takayuki Maeda [Mon, 3 Oct 2022 05:17:42 +0000 (14:17 +0900)]
return when obligation has references_error

21 months agoAdd some more operator cases to `dump-debug-span-debug.rs`.
Nicholas Nethercote [Mon, 3 Oct 2022 03:20:03 +0000 (14:20 +1100)]
Add some more operator cases to `dump-debug-span-debug.rs`.

21 months agoAuto merge of #102508 - nnethercote:even-more-lexer-improvements, r=matklad
bors [Mon, 3 Oct 2022 04:49:46 +0000 (04:49 +0000)]
Auto merge of #102508 - nnethercote:even-more-lexer-improvements, r=matklad

Even more lexer improvements

These are just about code clarity, rather than performance.

r? `@matklad`

21 months agoMerge branch 'master' into mul-add-negative
Elliot Bobrow [Mon, 3 Oct 2022 04:27:57 +0000 (21:27 -0700)]
Merge branch 'master' into mul-add-negative

21 months ago`suboptimal_flops` lint for multiply and subtract
Elliot Bobrow [Mon, 3 Oct 2022 04:00:51 +0000 (21:00 -0700)]
`suboptimal_flops` lint for multiply and subtract

21 months agore-add git-commit-hash file to tarballs
dawnofmidnight [Mon, 3 Oct 2022 03:21:26 +0000 (23:21 -0400)]
re-add git-commit-hash file to tarballs

rust-lang/rust#100557 removed the `git-commit-hash` file and replaced it
with `git-commit-info`. However, build-manifest relies on the
`git-commit-hash` file being present, so this adds it back.

21 months agorustdoc: re-sugar more cross-crate trait bounds
León Orell Valerian Liehr [Wed, 28 Sep 2022 20:54:39 +0000 (22:54 +0200)]
rustdoc: re-sugar more cross-crate trait bounds

21 months agolet upper_case_acronyms check the enum name
TennyZhuang [Mon, 3 Oct 2022 02:11:57 +0000 (10:11 +0800)]
let upper_case_acronyms check the enum name

Signed-off-by: TennyZhuang <zty0826@gmail.com>
21 months agoAuto merge of #102503 - cuviper:x86-stack-probes, r=nagisa
bors [Mon, 3 Oct 2022 02:09:05 +0000 (02:09 +0000)]
Auto merge of #102503 - cuviper:x86-stack-probes, r=nagisa

Enable inline stack probes on X86 with LLVM 16

The known problems with x86 inline-asm stack probes have been solved on LLVM main (16), so this flips the switch. Anyone using bleeding-edge LLVM with rustc can start testing this, as I have done locally. We'll get more direct rust-ci when LLVM 16 branches and we start our upgrade, and we can always patch or disable it then if we find new problems.

The previous attempt was #77885, reverted in #84708.

21 months agoSync docs of `slice::{from_ptr_range, from_ptr_range_mut}`
Maybe Waffle [Mon, 3 Oct 2022 00:44:50 +0000 (00:44 +0000)]
Sync docs of `slice::{from_ptr_range, from_ptr_range_mut}`

21 months agoInvert `is_top_level` to avoid negation.
Nicholas Nethercote [Fri, 30 Sep 2022 21:57:22 +0000 (07:57 +1000)]
Invert `is_top_level` to avoid negation.

21 months agoRemove `TokenStreamBuilder`.
Nicholas Nethercote [Fri, 30 Sep 2022 06:51:35 +0000 (16:51 +1000)]
Remove `TokenStreamBuilder`.

It's now only used in one function. Also, the "should we glue the
tokens?" check is only necessary when pushing a `TokenTree::Token`, not
when pushing a `TokenTree::Delimited`.

As part of this, we now do the "should we glue the tokens?" check
immediately, which avoids having look back at the previous token. It
also puts all the logic dealing with token gluing in a single place.

21 months agoInline and remove `parse_token_tree_non_delim_non_eof`.
Nicholas Nethercote [Fri, 30 Sep 2022 06:50:02 +0000 (16:50 +1000)]
Inline and remove `parse_token_tree_non_delim_non_eof`.

It has a single call site.

21 months agoMerge `parse_token_trees_until_close_delim` and `parse_all_token_trees`.
Nicholas Nethercote [Fri, 30 Sep 2022 06:43:11 +0000 (16:43 +1000)]
Merge `parse_token_trees_until_close_delim` and `parse_all_token_trees`.

Because they're very similar, and this will allow some follow-up
changes.

21 months agoAdd comments to `TokenCursor::desugar`.
Nicholas Nethercote [Thu, 29 Sep 2022 21:39:54 +0000 (07:39 +1000)]
Add comments to `TokenCursor::desugar`.

It took me some time to work out what this code was doing.

21 months agoRewrite `Token::is_op`.
Nicholas Nethercote [Wed, 28 Sep 2022 01:29:47 +0000 (11:29 +1000)]
Rewrite `Token::is_op`.

An exhaustive match is more readable and more future-proof.

21 months agoAdd comments to `Spacing`.
Nicholas Nethercote [Wed, 28 Sep 2022 01:20:42 +0000 (11:20 +1000)]
Add comments to `Spacing`.

21 months agoDocument when `slice::from_ptr_range[_mut]` panic
Maybe Waffle [Mon, 3 Oct 2022 00:41:54 +0000 (00:41 +0000)]
Document when `slice::from_ptr_range[_mut]` panic

21 months agoClarify operator splitting.
Nicholas Nethercote [Wed, 28 Sep 2022 00:07:01 +0000 (10:07 +1000)]
Clarify operator splitting.

I found this code hard to read.

21 months agoAuto merge of #8762 - Jarcho:visitor, r=Jarcho
bors [Mon, 3 Oct 2022 00:05:05 +0000 (00:05 +0000)]
Auto merge of #8762 - Jarcho:visitor, r=Jarcho

Replace `expr_visitor` with  `for_each_expr`

This is a minor change which uses `ControlFlow` rather than a boolean. This also runs the visitor rather than returning the visitor, which results in a small readability win as well.

changelog: None

21 months agoAuto merge of #102305 - flba-eb:remove_exclude_list, r=Mark-Simulacrum
bors [Sun, 2 Oct 2022 23:47:48 +0000 (23:47 +0000)]
Auto merge of #102305 - flba-eb:remove_exclude_list, r=Mark-Simulacrum

Get rid of exclude-list for Windows-only tests

Main purpose of this change is to get rid of a quite long (and growing) list of excluded targets, while this test should only be useful on Windows (as far as I understand it). The `// only-windows` header seams to implement exactly what we need here.

I don't know why there are some whitespace changes, but `x.py fmt` and `.git/hooks/pre-push` are happy.

21 months agoWorkaround rustc bug
Jason Newcomb [Sun, 2 Oct 2022 21:11:10 +0000 (17:11 -0400)]
Workaround rustc bug

21 months agoUse `for_each_expr` in place of some visitors
Jason Newcomb [Fri, 29 Apr 2022 04:09:55 +0000 (00:09 -0400)]
Use `for_each_expr` in place of some visitors

21 months agoReplace `expr_visitor` with `for_each_expr`
Jason Newcomb [Thu, 28 Apr 2022 17:29:44 +0000 (13:29 -0400)]
Replace `expr_visitor` with `for_each_expr`

21 months agoAuto merge of #100557 - dawnofmidnight:tarball-commit-info, r=Mark-Simulacrum
bors [Sun, 2 Oct 2022 20:55:17 +0000 (20:55 +0000)]
Auto merge of #100557 - dawnofmidnight:tarball-commit-info, r=Mark-Simulacrum

fix: use git-commit-info for version information

Fixes #33286.
Fixes #86587.

This PR changes the current `git-commit-hash` file that `./x.py` dist puts in the `rustc-{version}-src.tar.{x,g}z` to contain the hash, the short hash, and the commit date from which the tarball was created, assuming git was available when it was. It uses this for reading the version so that rustc has all the appropriate metadata.

# Testing

Testing this is kind of a pain. I did it with something like
```sh
./x.py dist # ensure that `ignore-git` is `false` in config.toml
cp ./build/dist/rustc-1.65.0-dev-src.tar.gz ../rustc-1.65.0-dev-src.tar.gz
cd .. && tar -xzf rustc-1.65.0-dev-src && cd rustc-1.65.0-dev-src
./x.py build
```

Then, the output of  `rustc -vV` with the stage1 compiler should have the `commit-hash` and `commit-date` fields filled, rather than be `unknown`. To be completely sure, you can use `rustc --sysroot` with the stdlib that the original `./x.py dist` made, which will require that the metadata matches.

21 months agoAvoid ICE in printing RPITIT type
Michael Goulet [Sun, 2 Oct 2022 20:25:48 +0000 (20:25 +0000)]
Avoid ICE in printing RPITIT type

21 months agoAdd example to opaque_hidden_inferred_bound lint
Michael Goulet [Sun, 2 Oct 2022 19:07:31 +0000 (19:07 +0000)]
Add example to opaque_hidden_inferred_bound lint

21 months agoMake it a lint for all opaque types
Michael Goulet [Sun, 2 Oct 2022 05:45:15 +0000 (05:45 +0000)]
Make it a lint for all opaque types

21 months agoLint for unsatisfied nested opaques
Michael Goulet [Sun, 2 Oct 2022 04:45:54 +0000 (04:45 +0000)]
Lint for unsatisfied nested opaques

21 months agoAuto merge of #7962 - Jarcho:fix_match_type_on_diagnostic_items, r=llogiq
bors [Sun, 2 Oct 2022 19:46:46 +0000 (19:46 +0000)]
Auto merge of #7962 - Jarcho:fix_match_type_on_diagnostic_items, r=llogiq

Fix and improve `match_type_on_diagnostic_item`

This extracts the fix for the lint out of #7647. There's still a couple of other functions to check, but at least this will get lint working again.

The two added util functions (`is_diagnostic_item` and `is_lang_item`) are needed to handle `DefId` for unit and tuple struct/variant constructors. The `rustc_diagnostic_item` and `lang` attributes are attached to the struct/variant `DefId`, but most of the time they are used through their constructors which have a different `DefId`. The two utility functions will check if the `DefId` is for a constructor and switch to the associated struct/variant `DefId`.

There does seem to be a bug on rustc's side where constructor `DefId`s from external crates seem to be returning `DefKind::Variant` instead of `DefKind::Ctor()`. There's a workaround put in right.

changelog: None

21 months agoDon't ICE when trying to copy unsized value in const prop
Michael Goulet [Sun, 2 Oct 2022 19:20:49 +0000 (19:20 +0000)]
Don't ICE when trying to copy unsized value in const prop

21 months agofallout: fix tests to allow uninlined_format_args
Yuri Astrakhan [Sun, 2 Oct 2022 19:13:22 +0000 (15:13 -0400)]
fallout: fix tests to allow uninlined_format_args

In order to switch `clippy::uninlined_format_args` from pedantic to
style, all existing tests must not raise a warning. I did not want to
change the actual tests, so this is a relatively minor change that:

* add `#![allow(clippy::uninlined_format_args)]` where needed
* normalizes all allow/deny/warn attributes
   * all allow attributes are grouped together
   * sorted alphabetically
   * the `clippy::*` attributes are listed separate from the other ones.
   * deny and warn attributes are listed before the allowed ones

changelog: none

21 months agoAuto merge of #9574 - Alexendoo:unused-fixed, r=Jarcho
bors [Sun, 2 Oct 2022 19:06:58 +0000 (19:06 +0000)]
Auto merge of #9574 - Alexendoo:unused-fixed, r=Jarcho

Remove unused `.fixed` files, only run asm_syntax doctests on x86

Two small changes, removes some unused `.fixed` and makes `clippy_lints` doctests pass on non x86 arches

changelog: none

21 months agoFix and improve internal lint checking for `match_type` usages
Jason Newcomb [Thu, 11 Nov 2021 19:15:01 +0000 (14:15 -0500)]
Fix and improve internal lint checking for `match_type` usages

* Check for `const`s and `static`s from external crates
* Check for `LangItem`s
* Handle inherent functions which have the same name as a field
* Also check the following functions:
    * `match_trait_method`
    * `match_def_path`
    * `is_expr_path_def_path`
    * `is_qpath_def_path`
* Handle checking for a constructor to a diagnostic item or `LangItem`

21 months agoReplace `is_lang_ctor` with `is_res_lang_ctor`
Jason Newcomb [Wed, 29 Jun 2022 02:34:02 +0000 (22:34 -0400)]
Replace `is_lang_ctor` with `is_res_lang_ctor`

21 months agoFix duplicate usage of `a` article.
Petr Portnov [Sun, 2 Oct 2022 18:40:39 +0000 (21:40 +0300)]
Fix duplicate usage of `a` article.

This fixes a typo first appearing in #94624
in which test-macro diagnostic uses "a" article twice.

Since I searched sources for " a a " sequences,
I also fixed the same issue in a few source files where I found it.

Signed-off-by: Petr Portnov <gh@progrm-jarvis.ru>
21 months agoAuto merge of #102530 - cuviper:upgrade-i586-gnu, r=pietroalbini
bors [Sun, 2 Oct 2022 18:14:32 +0000 (18:14 +0000)]
Auto merge of #102530 - cuviper:upgrade-i586-gnu, r=pietroalbini

Upgrade dist-i586-gnu-i586-i686-musl to ubuntu:22.04

The system GCC 5 in ubuntu:16.04 will be too old to compile LLVM 16, so
we need an upgrade. To avoid raising the minimum glibc requirements for
`i586-unknown-linux-gnu`, this target is converted to a crosstool-ng
toolchain, *relaxing* it to the same Linux 3.2 / glibc 2.17 minimum we
use elsewhere. The musl targets still use Ubuntu's system toolchain, but
this doesn't have the same compatibility concerns.

21 months agoRemove a couple lifetimes that could be infered
Maybe Waffle [Sun, 2 Oct 2022 15:40:20 +0000 (15:40 +0000)]
Remove a couple lifetimes that could be infered

21 months agoAuto merge of #102586 - Dylan-DPC:rollup-g107h6z, r=Dylan-DPC
bors [Sun, 2 Oct 2022 15:31:06 +0000 (15:31 +0000)]
Auto merge of #102586 - Dylan-DPC:rollup-g107h6z, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #100451 (Do not panic when a test function returns Result::Err.)
 - #102098 (Use fetch_update in sync::Weak::upgrade)
 - #102538 (Give `def_span` the same SyntaxContext as `span_with_body`.)
 - #102556 (Make `feature(const_btree_len)` implied by `feature(const_btree_new)`)
 - #102566 (Add a known-bug test for #102498)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agoAuto merge of #9576 - TennyZhuang:unnecessary_cast_for_non_literal_expr, r=llogiq
bors [Sun, 2 Oct 2022 15:26:45 +0000 (15:26 +0000)]
Auto merge of #9576 - TennyZhuang:unnecessary_cast_for_non_literal_expr, r=llogiq

let unnecessary_cast work for trivial non_literal expressions

Signed-off-by: TennyZhuang <zty0826@gmail.com>
---

changelog: [`unnecessary_cast`]: fix for trivial non_literal expressions

Fixes #9562

21 months agoAuto merge of #9479 - kraktus:manual_assert2, r=llogiq
bors [Sun, 2 Oct 2022 15:13:32 +0000 (15:13 +0000)]
Auto merge of #9479 - kraktus:manual_assert2, r=llogiq

[`manual_assert`]: Preserve comments in the suggestion

close https://github.com/rust-lang/rust-clippy/issues/7730

changelog: [`manual_assert`]: Preserve comments in the suggestion

21 months agoRollup merge of #102566 - compiler-errors:test-102498, r=Mark-Simulacrum
Dylan DPC [Sun, 2 Oct 2022 15:12:22 +0000 (20:42 +0530)]
Rollup merge of #102566 - compiler-errors:test-102498, r=Mark-Simulacrum

Add a known-bug test for #102498

Self-explanatory

21 months agoRollup merge of #102556 - WaffleLapkin:implied_by_btree_new, r=Mark-Simulacrum
Dylan DPC [Sun, 2 Oct 2022 15:12:22 +0000 (20:42 +0530)]
Rollup merge of #102556 - WaffleLapkin:implied_by_btree_new, r=Mark-Simulacrum

Make `feature(const_btree_len)` implied by `feature(const_btree_new)`

...this should fix code that used the old feature that was changed in #102197

cc ```@davidtwco``` it seems like tidy doesn't check `implied_by`, should it?

21 months agoRollup merge of #102538 - cjgillot:def-span-ctxt, r=fee1-dead
Dylan DPC [Sun, 2 Oct 2022 15:12:21 +0000 (20:42 +0530)]
Rollup merge of #102538 - cjgillot:def-span-ctxt, r=fee1-dead

Give `def_span` the same SyntaxContext as `span_with_body`.

https://github.com/rust-lang/rust/issues/102217

I'm not sure how to add a test, since the erroneous span was crafted using a proc macro.
The debug assertion in `def_span` will ensure we have the correct behaviour.

21 months agoRollup merge of #102098 - xfix:weak-upgrade-fetch-update, r=Mark-Simulacrum
Dylan DPC [Sun, 2 Oct 2022 15:12:21 +0000 (20:42 +0530)]
Rollup merge of #102098 - xfix:weak-upgrade-fetch-update, r=Mark-Simulacrum

Use fetch_update in sync::Weak::upgrade

Using `fetch_update` makes it more clear that it's CAS loop then manually implementing one.

21 months agoRollup merge of #100451 - hovinen:no-panic-on-result-err-in-test, r=Mark-Simulacrum
Dylan DPC [Sun, 2 Oct 2022 15:12:20 +0000 (20:42 +0530)]
Rollup merge of #100451 - hovinen:no-panic-on-result-err-in-test, r=Mark-Simulacrum

Do not panic when a test function returns Result::Err.

Rust's test library allows test functions to return a `Result`, so that the test is deemed to have failed if the function returns a `Result::Err` variant. Currently, this works by having `Result` implement the `Termination` trait and asserting in assert_test_result that `Termination::report()` indicates successful completion. This turns a `Result::Err` into a panic, which is caught and unwound in the test library.

This approach is problematic in certain environments where one wishes to save on both binary size and compute resources when running tests by:

 * Compiling all code with `--panic=abort` to avoid having to generate unwinding tables, and
 * Running most tests in-process to avoid the overhead of spawning new processes.

This change removes the intermediate panic step and passes a `Result::Err` directly through to the test runner.

To do this, it modifies `assert_test_result` to return a `Result<(), String>` where the `Err` variant holds what was previously the panic message. It changes the types in the `TestFn` enum to return `Result<(), String>`.

This tries to minimise the changes to benchmark tests, so it calls `unwrap()` on the `Result` returned by `assert_test_result`, effectively keeping the same behaviour as before.

Some questions for reviewers:

 * Does the change to the return types in the enum `TestFn` constitute a breaking change for the library API? Namely, the enum definition is public but the test library indicates that "Currently, not much of this is meant for users" and most of the library API appears to be marked unstable.
 * Is there a way to test this change, i.e., to test that no panic occurs if a test returns `Result::Err`?
 * Is there a shorter, more idiomatic way to fold `Result<Result<T,E>,E>` into a `Result<T,E>` than the `fold_err` function I added?

21 months agofix some logics
TennyZhuang [Sun, 2 Oct 2022 11:04:33 +0000 (19:04 +0800)]
fix some logics

Signed-off-by: TennyZhuang <zty0826@gmail.com>
21 months agoextract common codes
TennyZhuang [Sun, 2 Oct 2022 10:41:13 +0000 (18:41 +0800)]
extract common codes

Signed-off-by: TennyZhuang <zty0826@gmail.com>
21 months agoignore the lint on some test files
TennyZhuang [Sun, 2 Oct 2022 09:53:58 +0000 (17:53 +0800)]
ignore the lint on some test files

Signed-off-by: TennyZhuang <zty0826@gmail.com>
21 months agolet unnecessary_cast work for trivial non_literal expressions
TennyZhuang [Sun, 2 Oct 2022 09:12:08 +0000 (17:12 +0800)]
let unnecessary_cast work for trivial non_literal expressions

Signed-off-by: TennyZhuang <zty0826@gmail.com>
21 months agoAuto merge of #9577 - kraktus:unnecessary_cast, r=llogiq
bors [Sun, 2 Oct 2022 14:18:41 +0000 (14:18 +0000)]
Auto merge of #9577 - kraktus:unnecessary_cast, r=llogiq

[`unnecessary_cast`] add parenthesis when negative number uses a method

fix #9563

The issue was probably introduced by 90fe3bea52dd6ebd0cb02785ba523f182ff761e6

changelog: [`unnecessary_cast`] add parenthesis when negative number uses a method

r? llogiq

21 months agoRemove type argument of array_alloca and rename to byte_array_alloca
bjorn3 [Sat, 1 Oct 2022 18:22:46 +0000 (18:22 +0000)]
Remove type argument of array_alloca and rename to byte_array_alloca

21 months agoRemove dynamic_alloca from BuilderMethods
bjorn3 [Sat, 1 Oct 2022 17:34:21 +0000 (17:34 +0000)]
Remove dynamic_alloca from BuilderMethods

21 months agofix tests
kraktus [Sun, 2 Oct 2022 13:25:50 +0000 (15:25 +0200)]
fix tests

21 months agoAuto merge of #9571 - rust-lang:refactor-lit-ints, r=Jarcho
bors [Sun, 2 Oct 2022 13:11:21 +0000 (13:11 +0000)]
Auto merge of #9571 - rust-lang:refactor-lit-ints, r=Jarcho

use `is_integer_literal` more

I noticed that we have the `is_integer_literal` function in our `clippy_utils`, yet almost everywhere people still match int literal expressions manually. So I searched for instances to replace and shorten the code a bit.

---

changelog: none

21 months agoAuto merge of #2578 - RalfJung:rustc_tools_util, r=RalfJung
Ralf Jung [Sun, 2 Oct 2022 12:59:49 +0000 (14:59 +0200)]
Auto merge of #2578 - RalfJung:rustc_tools_util, r=RalfJung

21 months agoAuto merge of #2576 - RalfJung:no-more-vergen, r=RalfJung
Ralf Jung [Sun, 2 Oct 2022 12:59:18 +0000 (14:59 +0200)]
Auto merge of #2576 - RalfJung:no-more-vergen, r=RalfJung

21 months agobump rustc_tools_util
Ralf Jung [Sun, 2 Oct 2022 10:10:15 +0000 (12:10 +0200)]
bump rustc_tools_util

21 months agoAuto merge of #2574 - RalfJung:vergen, r=RalfJung
Ralf Jung [Sun, 2 Oct 2022 12:59:01 +0000 (14:59 +0200)]
Auto merge of #2574 - RalfJung:vergen, r=RalfJung

21 months agouse rustc_tools_util instead of vergen
Ralf Jung [Thu, 29 Sep 2022 11:23:44 +0000 (13:23 +0200)]
use rustc_tools_util instead of vergen

21 months agoAuto merge of #2572 - RalfJung:update, r=RalfJung
Ralf Jung [Sun, 2 Oct 2022 12:58:17 +0000 (14:58 +0200)]
Auto merge of #2572 - RalfJung:update, r=RalfJung

21 months agorelax vergen dependency
Ralf Jung [Thu, 29 Sep 2022 09:28:31 +0000 (11:28 +0200)]
relax vergen dependency

21 months agoGHA seems to have strange booleans
Ralf Jung [Thu, 29 Sep 2022 08:33:37 +0000 (10:33 +0200)]
GHA seems to have strange booleans

21 months agofix indentation
kraktus [Sun, 2 Oct 2022 10:35:02 +0000 (12:35 +0200)]
fix indentation

21 months agorevert `manual_assert` suggestion refactor
kraktus [Fri, 16 Sep 2022 19:38:56 +0000 (21:38 +0200)]
revert `manual_assert` suggestion refactor

Because `Sugg` helper does not simplify multiple negations

21 months ago[`manual_assert`]: Preserve comments in the suggestion
kraktus [Wed, 14 Sep 2022 09:58:41 +0000 (11:58 +0200)]
[`manual_assert`]: Preserve comments in the suggestion

21 months agoAuto merge of #2571 - RalfJung:cargo-update, r=RalfJung
Ralf Jung [Sun, 2 Oct 2022 12:57:40 +0000 (14:57 +0200)]
Auto merge of #2571 - RalfJung:cargo-update, r=RalfJung

21 months agobump rustc-build-sysroot
Ralf Jung [Thu, 29 Sep 2022 08:19:49 +0000 (10:19 +0200)]
bump rustc-build-sysroot

21 months agono need to make cargo-miri build quiet; cargo only prints to stderr anyway
Ralf Jung [Wed, 28 Sep 2022 20:38:38 +0000 (22:38 +0200)]
no need to make cargo-miri build quiet; cargo only prints to stderr anyway

21 months agocargo update
Ralf Jung [Wed, 28 Sep 2022 20:34:07 +0000 (22:34 +0200)]
cargo update

21 months agoAuto merge of #2564 - RalfJung:no-more-xargo, r=oli-obk
Ralf Jung [Sun, 2 Oct 2022 13:03:34 +0000 (15:03 +0200)]
Auto merge of #2564 - RalfJung:no-more-xargo, r=oli-obk

21 months agoAuto merge of #98354 - camsteffen:is-some-and-by-value, r=m-ou-se
bors [Sun, 2 Oct 2022 12:48:15 +0000 (12:48 +0000)]
Auto merge of #98354 - camsteffen:is-some-and-by-value, r=m-ou-se

Change `is_some_and` to take by value

Consistent with other function-accepting `Option` methods.

Tracking issue: #93050

r? `@m-ou-se`

21 months ago[`unnecessary_cast`] add parenthesis when negative number uses a method
kraktus [Sun, 2 Oct 2022 12:30:26 +0000 (14:30 +0200)]
[`unnecessary_cast`] add parenthesis when negative number uses a method

21 months agoMake Hash{Set,Map}::with_hasher unstably const
Nixon Enraght-Moony [Sun, 2 Oct 2022 11:57:10 +0000 (12:57 +0100)]
Make Hash{Set,Map}::with_hasher unstably const

21 months agoAuto merge of #9573 - Alexendoo:needless-borrowed-ref-slice, r=dswij
bors [Sun, 2 Oct 2022 10:39:04 +0000 (10:39 +0000)]
Auto merge of #9573 - Alexendoo:needless-borrowed-ref-slice, r=dswij

lint nested patterns and slice patterns in `needless_borrowed_reference`

Now lints in positions other than top level, e.g. `Some(&ref a)`. Or patterns are excluded as that can cause issues

Slice patterns of `ref`s are now linted, e.g. `&[ref a, ref b]`. An easy one to walk into as you might expect that to match against a slice you should use `&[]`,  then to get around a `cannot move out of type [T]` error you apply a `ref`

changelog: [`needless_borrowed_reference`]: lint nested patterns and slice patterns

21 months agofix #102320, suggest unwrap_or_else when a closure is passed to unwrap_or instead...
yukang [Wed, 28 Sep 2022 21:52:48 +0000 (05:52 +0800)]
fix #102320, suggest unwrap_or_else when a closure is passed to unwrap_or instead of suggesting calling it

21 months agoAuto merge of #102548 - nikic:inline-cell-replace, r=scottmcm
bors [Sun, 2 Oct 2022 09:53:07 +0000 (09:53 +0000)]
Auto merge of #102548 - nikic:inline-cell-replace, r=scottmcm

Mark Cell::replace() as #[inline]

Giving this a try based on https://github.com/rust-lang/rust/issues/102539#issuecomment-1264398807.

21 months agoImprove `FromStr` example
Eduardo Sánchez Muñoz [Sun, 2 Oct 2022 09:32:56 +0000 (11:32 +0200)]
Improve `FromStr` example

The `from_str` implementation from the example had an `unwrap` that would make it panic on invalid input strings. Instead of panicking, it nows returns an error to better reflect the intented behavior of the `FromStr` trait.

21 months agoAuto merge of #9509 - schubart:fix_sorting, r=llogiq
bors [Sun, 2 Oct 2022 07:51:45 +0000 (07:51 +0000)]
Auto merge of #9509 - schubart:fix_sorting, r=llogiq

Fix sorting in ` cargo dev update_lints` script

changelog: none

The old code cloned and sorted `usable_lints` into `sorted_usable_lints`, but then failed to do anything with `sorted_usable_lints`.

This was discovered by my new `collection_is_never_read` lint (#9267) that I'm working on!

Fix: I renamed the sorted vector to `usable_lints`.  Therefore it now gets used where the unsorted one was used previously.

21 months agoAuto merge of #102535 - scottmcm:optimize-split-at-partition-point, r=thomcc
bors [Sun, 2 Oct 2022 07:11:15 +0000 (07:11 +0000)]
Auto merge of #102535 - scottmcm:optimize-split-at-partition-point, r=thomcc

Tell LLVM that `partition_point` returns a valid fencepost

This was already done for a successful `binary_search`, but this way `partition_point` can get similar optimizations.

Demonstration that nightly can't do this optimization today, and leaves in the panicking path: <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=e1074cd2faf5f68e49cffd728ded243a>

r? `@thomcc`

21 months agoDelay evaluating lint primary message until after it would be suppressed
Michael Goulet [Sun, 2 Oct 2022 06:30:49 +0000 (06:30 +0000)]
Delay evaluating lint primary message until after it would be suppressed

21 months agoAdd a known-bug test for #102498
Michael Goulet [Sun, 2 Oct 2022 06:05:45 +0000 (06:05 +0000)]
Add a known-bug test for #102498

21 months agoAuto merge of #102424 - sunfishcode:sunfishcode/hidden-main, r=nagisa
bors [Sun, 2 Oct 2022 04:12:09 +0000 (04:12 +0000)]
Auto merge of #102424 - sunfishcode:sunfishcode/hidden-main, r=nagisa

Declare `main` as visibility hidden on targets that default to hidden.

On targets with `default_hidden_visibility` set, which is currrently just WebAssembly, declare the generated `main` function with visibility hidden. This makes it consistent with clang's WebAssembly target, where `main` is just a user function that gets the same visibility as any other user function, which is hidden on WebAssembly unless explicitly overridden.

This will help simplify use cases which in the future may want to automatically wasm-export all visibility-"default" symbols. `main` isn't intended to be wasm-exported, and marking it hidden prevents it from being wasm-exported in that scenario.

21 months agoRemove 'E0312' from 'compile_fail,E0312' statement temporarily
reez12g [Sun, 2 Oct 2022 02:00:43 +0000 (11:00 +0900)]
Remove 'E0312' from 'compile_fail,E0312' statement temporarily

21 months agoAuto merge of #102558 - matthiaskrgr:rollup-0odec1c, r=matthiaskrgr
bors [Sun, 2 Oct 2022 01:29:36 +0000 (01:29 +0000)]
Auto merge of #102558 - matthiaskrgr:rollup-0odec1c, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #102195 (Improve the COPYRIGHT file)
 - #102313 (Update docs so that deprecated method points to relevant method)
 - #102353 (Allow passing rustix_use_libc cfg using RUSTFLAGS)
 - #102405 (Remove a FIXME whose code got moved away in #62883.)
 - #102525 (rustdoc: remove orphaned link on array bracket)
 - #102557 (fix issue with x.py setup running into explicit panic)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agoRollup merge of #102557 - Joshument:master, r=jyn514
Matthias Krüger [Sun, 2 Oct 2022 01:16:40 +0000 (03:16 +0200)]
Rollup merge of #102557 - Joshument:master, r=jyn514

fix issue with x.py setup running into explicit panic

Fixes problem with [Issue #102555](https://github.com/rust-lang/rust/issues/102555) causing `x.py` setup to fail. Simply requires `rustfmt` be downloaded a little later.

21 months agoRollup merge of #102525 - notriddle:notriddle/array-link, r=GuillaumeGomez,jsha
Matthias Krüger [Sun, 2 Oct 2022 01:16:39 +0000 (03:16 +0200)]
Rollup merge of #102525 - notriddle:notriddle/array-link, r=GuillaumeGomez,jsha

rustdoc: remove orphaned link on array bracket

This is #98069, but for arrays instead.

For non-generics, this retains links to the array page, but instead of trying to link it all, it only links the length part, which distinguishes arrays from slices.

For generics, the entire thing becomes a link, just like slices.

| Type | Before | After |
|--|--|--|
| u32 | <code>pub fn alpha() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">; 1]</a></code> | <code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>; <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">1</a>]</code>
| generic | <code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[</a>T<a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">; 1]</a></code> | <code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[T; 1]</a></code>

21 months agoRollup merge of #102405 - hkBst:patch-3, r=Mark-Simulacrum
Matthias Krüger [Sun, 2 Oct 2022 01:16:39 +0000 (03:16 +0200)]
Rollup merge of #102405 - hkBst:patch-3, r=Mark-Simulacrum

Remove a FIXME whose code got moved away in #62883.

Remove a FIXME whose code got moved away in https://github.com/rust-lang/rust/pull/62883.

21 months agoRollup merge of #102353 - bjorn3:allow_rustix_use_libc, r=Mark-Simulacrum
Matthias Krüger [Sun, 2 Oct 2022 01:16:38 +0000 (03:16 +0200)]
Rollup merge of #102353 - bjorn3:allow_rustix_use_libc, r=Mark-Simulacrum

Allow passing rustix_use_libc cfg using RUSTFLAGS

Before this would error with

```
error: unexpected `rustix_use_libc` as condition name
  |
  = note: `-D unexpected-cfgs` implied by `-D warnings`
  = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
```

I'm setting rustix_use_libc when testing bootstrapping rustc with cg_clif as I'm disabling inline asm here.

21 months agoRollup merge of #102313 - anirudh24seven:update_sleep_ms_doc, r=Mark-Simulacrum
Matthias Krüger [Sun, 2 Oct 2022 01:16:38 +0000 (03:16 +0200)]
Rollup merge of #102313 - anirudh24seven:update_sleep_ms_doc, r=Mark-Simulacrum

Update docs so that deprecated method points to relevant method

The docs for the deprecated 'park_timeout_ms' method suggests that the user 'use park_timeout' method instead (at https://doc.rust-lang.org/std/thread/index.html).

Making a similar change so that the docs for the deprecated `sleep_ms` method suggest that the user `use sleep` method instead.

21 months agoRollup merge of #102195 - wesleywiser:copyright2, r=Mark-Simulacrum,joshtriplett
Matthias Krüger [Sun, 2 Oct 2022 01:16:37 +0000 (03:16 +0200)]
Rollup merge of #102195 - wesleywiser:copyright2, r=Mark-Simulacrum,joshtriplett

Improve the COPYRIGHT file

This is a cutdown version of #96784 which doesn't include the apfloat changes. At this point, the other 3 commits in this PR don't seem to be controversial and I'd like to go ahead and get those merged which will leave #96784 with only the more complex apfloat related change.

r? `@Mark-Simulacrum` since you are the reviewer on that PR

cc `@joshtriplett` since you also had feedback in that PR

21 months agofix issue with x.py setup running into explicit panic
Joshument [Sat, 1 Oct 2022 22:51:10 +0000 (18:51 -0400)]
fix issue with x.py setup running into explicit panic

21 months agoMake `feature(const_btree_len)` implied by `feature(const_btree_new)`
Maybe Waffle [Sat, 1 Oct 2022 22:40:04 +0000 (22:40 +0000)]
Make `feature(const_btree_len)` implied by `feature(const_btree_new)`

21 months agoAuto merge of #102193 - ferrocene:pa-remote-test-server-improvements, r=Mark-Simulacrum
bors [Sat, 1 Oct 2022 22:39:59 +0000 (22:39 +0000)]
Auto merge of #102193 - ferrocene:pa-remote-test-server-improvements, r=Mark-Simulacrum

Change argument handling in `remote-test-server` and add new flags

This PR updates `remote-test-server` to add two new flags:

* `--sequential` disables parallel test execution, accepting one connection at the time instead. We need this for Ferrocene as one of our emulators occasionally deadlocks when running multiple tests in parallel.
* `--bind <ip:port>` allows customizing the IP and port `remote-test-server` binds to, rather than using the default value.

While I was changing the flags, and [after chatting on what to do on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/remote-test-server.20flags),  I took this opportunity to cleanup argument handling in `remote-test-server`, which is a breaking change:

* The `verbose` argument has been renamed to the `--verbose` flag.
* The `remote` argument has been removed in favor of the `--bind 0.0.0.0:12345` flag. The only thing the argument did was to change the bound IP to 0.0.0.0, which can easily be replicated with `--bind` and also is not secure as our "remote" default.

I'm also open to keep the old arguments with deprecation warnings.

r? `@Mark-Simulacrum`

21 months agolint nested patterns and slice patterns in `needless_borrowed_reference`
Alex Macleod [Sat, 1 Oct 2022 21:54:22 +0000 (21:54 +0000)]
lint nested patterns and slice patterns in `needless_borrowed_reference`

21 months agoOnly run x86 asm doctests on x86
Alex Macleod [Sat, 1 Oct 2022 22:25:01 +0000 (22:25 +0000)]
Only run x86 asm doctests on x86

21 months agomake tidy accept multi-line `rustc_const_unstable` attributes
Maybe Waffle [Sat, 1 Oct 2022 22:26:48 +0000 (22:26 +0000)]
make tidy accept multi-line `rustc_const_unstable` attributes

21 months agoRemove unused .fixed files
Alex Macleod [Sat, 1 Oct 2022 22:24:48 +0000 (22:24 +0000)]
Remove unused .fixed files