Commit graph

166288 commits

Author SHA1 Message Date
flip1995 b590d5cc9f
Update Cargo.lock 2022-04-08 10:41:55 +01:00
flip1995 515e2a2cda
Merge commit '984330a6ee3c4d15626685d6dc8b7b759ff630bd' into clippyup 2022-04-08 10:06:10 +01:00
klensy d0cc98689e check_doc_keyword: don't alloc string for emptiness check
check_doc_alias_value: get argument as Symbol to prevent needless string convertions

check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge

replace as_str() check with symbol check

get_single_str_from_tts: don't prealloc string

trivial string to str replace

LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String>

AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String>

CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
2022-04-08 11:45:57 +03:00
bors 1a4b9a8563 Auto merge of #95775 - RalfJung:miri-windows-compat, r=ChrisDenton
make windows compat_fn (crudely) work on Miri

With https://github.com/rust-lang/rust/pull/95469, Windows `compat_fn!` now has to be supported by Miri to even make stdout work. Unfortunately, it relies on some outside-of-Rust linker hacks (`#[link_section = ".CRT$XCU"]`) that are rather hard to make work in Miri. So I came up with this crude hack to make this stuff work in Miri regardless. It should come at no cost for regular executions, so I hope this is okay.

Cc https://github.com/rust-lang/rust/issues/95627 `@ChrisDenton`
2022-04-08 08:13:21 +00:00
Kai Luo 95b1d71a1b [bootstrap.py] Instruct curl to follow redirect
Some RUSTUP_DIST_SERVER perform redirection when downloading
stage0 compiler. Curl should be able to follow that.
2022-04-08 14:51:05 +08:00
bors dc1f8298ef Auto merge of #95440 - jyn514:error-index, r=Mark-Simulacrum
Fix `x test src/tools/error_index_generator --stage {0,1}`

There were two fixes needed:
1. Use `top_stage` instead of `top_stage - 1`. There was a long and torturous comment about trying to match rustdoc's version, but it works better without the hard-coding than with (before it gave errors that `libtest.so` couldn't be found).
2. Make sure that `ci-llvm/lib` is added to LD_LIBRARY_PATH. Previously the error index would be unable to load LLVM for stage0 builds.

At some point we should probably have a discussion about how rustdoc stages should be numbered;
confusion between 0/1/2 has come up several times in bootstrap now. cc https://github.com/rust-lang/rust/issues/92538

Note that this is still broken when using `download-rustc = true` and `--stage 1`,
but that's *really* a corner case and should affect almost no one. `--stage {0,2}`
work fine with download-rustc.

Fixes https://github.com/rust-lang/rust/issues/80096.
2022-04-08 05:43:25 +00:00
Cyborus04 06788fd7a4 add <[[T; N]]>::flatten, <[[T; N]]>::flatten_mut, and Vec::<[T; N]>::into_flattened 2022-04-08 00:54:39 -04:00
bstrie 66b3ca0b7f Promote x86_64-unknown-none to Tier 2 2022-04-07 22:02:32 -04:00
Jack O'Connor e0e64a8930 hide an #[allow] directive from the Arc::new_cyclic doc example 2022-04-07 18:00:46 -07:00
Jane Lusby aa3c141c86 reword panic vs result section to remove recoverable vs unrecoverable framing 2022-04-07 13:44:57 -07:00
Camille GILLOT b5dfa6a78d Compute ty_param_owner using DefIdTree. 2022-04-07 22:30:16 +02:00
Ralf Jung 38004b72bc interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internal 2022-04-07 16:24:48 -04:00
Maybe Waffle d5440926e2 Suggest replacing typeof(...) with an actual type
This commit suggests replacing typeof(...) with an actual type of "...",
for example in case of `typeof(1)` we suggest replacing it with `i32`.

If the expression
- Is not const (`{ let a = 1; let _: typeof(a); }`)
- Can't be found (`let _: typeof(this_variable_does_not_exist)`)
- Or has non-suggestable type (closure, generator, error, etc)
we don't suggest anything.
2022-04-07 23:40:32 +04:00
bors e745b4ddbd Auto merge of #95767 - oli-obk:all_your_generics_belong_to_the_definitions, r=compiler-errors
Report opaque type mismatches directly during borrowck of the function instead of within the `type_of` query.

This allows us to only store a single hidden type per opaque type instead of having to store one per set of substitutions.

r? `@compiler-errors`

This does not affect diagnostics, because the diagnostic messages are exactly the same.
2022-04-07 19:37:43 +00:00
Chris Denton 6a4b44426b
Windows: Increase a pipe's buffer capacity to 64kb
This brings it inline with typical Linux defaults: https://www.man7.org/linux/man-pages/man7/pipe.7.html
2022-04-07 20:34:55 +01:00
Ralf Jung c599a4cfc3 do not round-trip function pointer through integer 2022-04-07 15:00:07 -04:00
León Orell Valerian Liehr 4623d51573 Hide cross-crate doc-hidden assoc items in trait impls 2022-04-07 20:40:17 +02:00
Ralf Jung fe85591989 make windows compat_fn (crudely) work on Miri 2022-04-07 14:07:02 -04:00
bors 984330a6ee Auto merge of #8657 - flip1995:raw_lint_desc, r=flip1995
Allow raw lint descriptions

update_lints now understands raw strings in declare_clippy_lint descriptions.

Supersedes  #8655

cc `@Alexendoo` thanks for addressing this so quickly. I build a little bit simpler version of your patch. I don't think it really matters what `Literal` we're trying to tokenize, since we assume later, that it is some sort of `str`.

changelog: none
2022-04-07 17:11:26 +00:00
flip1995 6ab4508350
Allow raw lint descriptions
update_lints now understands raw strings in declare_clippy_lint
descriptions.

Co-authored-by: Alex Macleod <alex@macleod.io>
2022-04-07 18:05:46 +01:00
bors dd38eea722 Auto merge of #95706 - petrochenkov:doclink4, r=GuillaumeGomez
rustdoc: Early doc link resolution fixes and refactorings

A subset of https://github.com/rust-lang/rust/pull/94857 that shouldn't cause perf regressions, but should fix some issues like https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/ICE.20in.20collect_intra_doc_links.2Ers https://github.com/rust-lang/rust/pull/95290 and improve performance in cases like https://github.com/rust-lang/rust/issues/95694.
2022-04-07 15:33:22 +00:00
bors abc59bb914 Auto merge of #8656 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2022-04-07 15:30:27 +00:00
Jack Grigg a404b96ca1 Manually mark 1.49 and 1.50 in linker-plugin-lto.md as Clang 11
`rustc +1.49.0 -Vv` and `rustc +1.50.0 -Vv` do not print out an
`LLVM version` line, which prevents the script from detecting them.
2022-04-07 15:30:19 +00:00
Jack Grigg 09685da5d1 Update linker-plugin-lto.md to contain up to Rust 1.60
The table rows were obtained via the script embedded in the page.
2022-04-07 15:29:30 +00:00
flip1995 a2fdbb5f53
Bump changelog stable version -> 1.60 2022-04-07 16:26:43 +01:00
flip1995 f5e32dc647
Bump nightly version -> 2022-04-07 2022-04-07 16:24:55 +01:00
flip1995 f23a9fb295
Bump Clippy Version -> 0.1.62 2022-04-07 16:24:33 +01:00
flip1995 db1d5dca50
Fix internal::INVALID_PATHS lint 2022-04-07 16:24:10 +01:00
flip1995 669fddab37
Merge remote-tracking branch 'upstream/master' into rustup 2022-04-07 15:44:37 +01:00
Oli Scherer 7d2cad68d2 Deduplicate the error printing code for hidden type mismatches 2022-04-07 13:52:59 +00:00
Oli Scherer 25876b3541 Report opaque type mismatches directly during borrowck of the function instead of within the type_of query.
This allows us to only store a single hidden type per opaque type instead of having to store one per set of substitutions.
2022-04-07 13:39:52 +00:00
bors 574bf88e3e Auto merge of #8635 - pbor:unsigned-abs, r=giraffate
Add a lint to detect cast to unsigned for abs() and suggest unsigned_…

…abs()

changelog: Add a [`cast_abs_to_unsigned`] that checks for uses of `abs()` that are cast to the corresponding unsigned integer type and suggest to replace them with `unsigned_abs()`.
2022-04-07 13:17:28 +00:00
Oli Scherer 2e0ef701c2 Document and rename the new wrapper type 2022-04-07 13:01:48 +00:00
bors 650a0e52b8 Auto merge of #8646 - Alexendoo:option-as-deref-mut, r=giraffate
Fix `as_deref_mut` false positives in `needless_option_as_deref`

Also moves it into `methods/`

Fixes #7846
Fixes #8047

changelog: [`needless_option_as_deref`]: No longer lints for `as_deref_mut` on Options that cannot be moved

supersedes #8064
2022-04-07 13:00:15 +00:00
bors fa72316031 Auto merge of #95715 - nnethercote:shrink-Nonterminal, r=davidtwco
Shrink `Nonterminal`

Small consistency and performance improvements.

r? `@petrochenkov`
2022-04-07 12:52:32 +00:00
Caio 5974c18efb [macro_metavar_expr] Add tests to ensure the feature requirement 2022-04-07 09:32:02 -03:00
Alex Macleod 182b7c38d7 Fix as_deref_mut false positives in needless_option_as_deref
Also moves the lint to the methods directory
2022-04-07 12:39:21 +01:00
Caio 3191d27f48 Kickstart the inner usage of macro_metavar_expr 2022-04-07 08:13:41 -03:00
bors ed6c958ee4 Auto merge of #95760 - Dylan-DPC:rollup-uskzggh, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #95189 (Stop flagging unexpected inner attributes as outer ones in certain diagnostics)
 - #95752 (Regression test for #82866)
 - #95753 (Correct safety reasoning in `str::make_ascii_{lower,upper}case()`)
 - #95757 (Use gender neutral terms)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-07 09:50:11 +00:00
Mara Bos f1a40410ec Return status from futex_wake(). 2022-04-07 11:34:35 +02:00
Paolo Borelli f2bbb5fac0 conf: fix lint name in comment
The lint name is ERR_EXPECT, not EXPECT_ERR
2022-04-07 11:29:02 +02:00
Paolo Borelli b0edbca0e6 new lint cast_abs_to_unsigned
Add a lint to detect cast to unsigned for abs() and suggest
unsigned_abs() to avoid panic when called on MIN.
2022-04-07 11:28:14 +02:00
Dylan DPC d907ab87a0
Rollup merge of #95757 - zofrex:gender-neutral-terms, r=dtolnay
Use gender neutral terms

#95508 was not executed well, but it did find a couple of legitimate issues: some uses of unnecessarily gendered language, and some typos. This PR fixes (properly) the legitimate issues it found.
2022-04-07 11:17:17 +02:00
Dylan DPC 6639604bd6
Rollup merge of #95753 - ChayimFriedman2:patch-1, r=dtolnay
Correct safety reasoning in `str::make_ascii_{lower,upper}case()`

I don't understand why the previous comment was used (it was inserted in #66564), but it doesn't explain why these functions are safe, only why `str::as_bytes{_mut}()` are safe.

If someone thinks they make perfect sense, I'm fine with closing this PR.
2022-04-07 11:17:16 +02:00
Dylan DPC 870ab12ea7
Rollup merge of #95752 - compiler-errors:issue-82866, r=Dylan-DPC
Regression test for #82866

Saw that this issue was open when i was cleaning my old branch for #92237.
I am also not opposed to not adding an extra test and just closing #82866.

Fixes #82866
2022-04-07 11:17:14 +02:00
Dylan DPC 648d644c60
Rollup merge of #95189 - fmease:fix-issue-94340, r=estebank
Stop flagging unexpected inner attributes as outer ones in certain diagnostics

Fixes #94340.

In the issue to-be-fixed I write that the general message _an inner attribute is not permitted in this context_ should be more specific noting that the “context” is the `include` macro. This, however, cannot be achieved without touching a lot of things and passing a flag to the `parse_expr` and `parse_item` calls in `expand_include`. This seems rather hacky to me. That's why I left it as it. `Span::from_expansion` does not apply either AFAIK.

`@rustbot` label A-diagnostics T-compiler
2022-04-07 11:17:13 +02:00
James 'zofrex' Sanderson ef59ab738e Use gender neutral terms 2022-04-07 08:51:59 +01:00
Jakub Beránek 49efa23d70
Update rustc-perf version used in CI and also the corresponding PGO benchmarks 2022-04-07 09:42:14 +02:00
bors f565016edd Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrum
Bump bootstrap compiler to 1.61.0 beta

This PR bumps the bootstrap compiler to the 1.61.0 beta. The first commit changes the stage0 compiler, the second commit applies the "mechanical" changes and the third and fourth commits apply changes explained in the relevant comments.

r? `@Mark-Simulacrum`
2022-04-07 07:34:04 +00:00
bors 8cd6080f6c Auto merge of #95748 - Dylan-DPC:rollup-t208j51, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #95352 ([bootstrap] Print the full relative path to failed tests)
 - #95646 (Mention `std::env::var` in `env!`)
 - #95708 (Update documentation for `trim*` and `is_whitespace` to include newlines)
 - #95714 (Add test for issue #83474)
 - #95725 (Message: Chunks cannot have a size of zero.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-07 05:12:08 +00:00