]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMove Result::as_deref_mut
David Tolnay [Thu, 30 Dec 2021 18:24:23 +0000 (10:24 -0800)]
Move Result::as_deref_mut

2 years agoMove Result::as_deref
David Tolnay [Thu, 30 Dec 2021 18:23:46 +0000 (10:23 -0800)]
Move Result::as_deref

2 years agoIgnore new failing test_is_sorted test
bjorn3 [Thu, 30 Dec 2021 17:16:04 +0000 (18:16 +0100)]
Ignore new failing test_is_sorted test

2 years agoDisable long running libcore tests
bjorn3 [Thu, 30 Dec 2021 16:50:52 +0000 (17:50 +0100)]
Disable long running libcore tests

These only finish in reasonable time with optimizations enabled.

This patch file is copied from cg_clif.

2 years agoDisable portable-simd test
bjorn3 [Thu, 30 Dec 2021 15:57:11 +0000 (16:57 +0100)]
Disable portable-simd test

Support for portable-simd isn't implemented yet

2 years agoAdd missing feature gate
bjorn3 [Thu, 30 Dec 2021 15:28:53 +0000 (16:28 +0100)]
Add missing feature gate

2 years agoFix display of toggles on mobile
Guillaume Gomez [Wed, 29 Dec 2021 17:54:33 +0000 (18:54 +0100)]
Fix display of toggles on mobile

2 years agoUpdate browser-ui-test version to have assert-position command
Guillaume Gomez [Thu, 30 Dec 2021 15:21:25 +0000 (16:21 +0100)]
Update browser-ui-test version to have assert-position command

2 years agoAuto merge of #92434 - matthiaskrgr:rollup-m8wuq0v, r=matthiaskrgr
bors [Thu, 30 Dec 2021 14:52:50 +0000 (14:52 +0000)]
Auto merge of #92434 - matthiaskrgr:rollup-m8wuq0v, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #91519 (ast: Avoid aborts on fatal errors thrown from mutable AST visitor)
 - #92414 (Fix spacing of pretty printed const item without body)
 - #92423 (Add UI test for #92292)
 - #92427 (Use `UnsafeCell::get_mut()` in `core::lazy::OnceCell::get_mut()`)

Failed merges:

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

2 years agoImport std::arch::asm
bjorn3 [Thu, 30 Dec 2021 14:36:30 +0000 (15:36 +0100)]
Import std::arch::asm

2 years agoRustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29)
bjorn3 [Thu, 30 Dec 2021 14:26:08 +0000 (15:26 +0100)]
Rustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29)

2 years agoSync from rust 65d8785f0a85d233e00fc84445f1aab451ec9f4f
bjorn3 [Thu, 30 Dec 2021 14:23:33 +0000 (15:23 +0100)]
Sync from rust 65d8785f0a85d233e00fc84445f1aab451ec9f4f

2 years agoMerge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
flip1995 [Thu, 30 Dec 2021 14:10:43 +0000 (15:10 +0100)]
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup

2 years agoMerge commit '40b00f4200fbdeefd11815398cb46394b8cb0a5e' into sync_cg_clif-2021-12-30
bjorn3 [Thu, 30 Dec 2021 13:53:41 +0000 (14:53 +0100)]
Merge commit '40b00f4200fbdeefd11815398cb46394b8cb0a5e' into sync_cg_clif-2021-12-30

2 years agoAuto merge of #8196 - flip1995:rustup, r=flip1995
bors [Thu, 30 Dec 2021 13:22:47 +0000 (13:22 +0000)]
Auto merge of #8196 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump nightly version -> 2021-12-30
flip1995 [Thu, 30 Dec 2021 13:18:01 +0000 (14:18 +0100)]
Bump nightly version -> 2021-12-30

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 30 Dec 2021 13:04:13 +0000 (14:04 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoDisable incremental compilation on CI
bjorn3 [Thu, 30 Dec 2021 13:07:44 +0000 (14:07 +0100)]
Disable incremental compilation on CI

Fixes #1198

2 years agoRollup merge of #92427 - ChayimFriedman2:patch-1, r=kennytm
Matthias Krüger [Thu, 30 Dec 2021 12:12:36 +0000 (13:12 +0100)]
Rollup merge of #92427 - ChayimFriedman2:patch-1, r=kennytm

Use `UnsafeCell::get_mut()` in `core::lazy::OnceCell::get_mut()`

This removes one unnecessary `unsafe` block.

2 years agoRollup merge of #92423 - weirane:ui-92292, r=fee1-dead
Matthias Krüger [Thu, 30 Dec 2021 12:12:35 +0000 (13:12 +0100)]
Rollup merge of #92423 - weirane:ui-92292, r=fee1-dead

Add UI test for #92292

Closes #92292

2 years agoRollup merge of #92414 - dtolnay:constnoexpr, r=oli-obk
Matthias Krüger [Thu, 30 Dec 2021 12:12:34 +0000 (13:12 +0100)]
Rollup merge of #92414 - dtolnay:constnoexpr, r=oli-obk

Fix spacing of pretty printed const item without body

Follow-up to #92238 fixing one of the FIXMEs.

```rust
macro_rules! repro {
    ($item:item) => {
        stringify!($item)
    };
}

fn main() {
    println!("{}", repro!(extern "C" { static S: i32; }));
}
```

Before: `extern "C" { static S: i32 ; }`
After: `extern "C" { static S: i32; }`

2 years agoRollup merge of #91519 - petrochenkov:cratexp2, r=Aaron1011
Matthias Krüger [Thu, 30 Dec 2021 12:12:33 +0000 (13:12 +0100)]
Rollup merge of #91519 - petrochenkov:cratexp2, r=Aaron1011

ast: Avoid aborts on fatal errors thrown from mutable AST visitor

Set the node to some dummy value and rethrow the error instead.

When using the old aborting `visit_clobber` in `InvocationCollector::visit_crate` the next tests abort due to fatal errors:
```
ui\modules\path-invalid-form.rs
ui\modules\path-macro.rs
ui\modules\path-no-file-name.rs
ui\parser\issues\issue-5806.rs
ui\parser\mod_file_with_path_attr.rs
```

Follow up to https://github.com/rust-lang/rust/pull/91313.

2 years agoMove incr comp enable to the build system
bjorn3 [Thu, 30 Dec 2021 12:03:32 +0000 (13:03 +0100)]
Move incr comp enable to the build system

2 years agoDon't enable optimizations in the dev profile
bjorn3 [Thu, 30 Dec 2021 12:01:38 +0000 (13:01 +0100)]
Don't enable optimizations in the dev profile

I rarely use the dev profile anyway.

2 years agoFix dead code warning on windows
bjorn3 [Thu, 30 Dec 2021 11:56:45 +0000 (12:56 +0100)]
Fix dead code warning on windows

2 years agoOnly deny warnings for cg_clif build itself
bjorn3 [Thu, 30 Dec 2021 11:40:23 +0000 (12:40 +0100)]
Only deny warnings for cg_clif build itself

cc #1213

2 years agoAuto merge of #89336 - Aaron1011:variance-struct-diag, r=cjgillot
bors [Thu, 30 Dec 2021 11:34:24 +0000 (11:34 +0000)]
Auto merge of #89336 - Aaron1011:variance-struct-diag, r=cjgillot

Refactor variance diagnostics to work with more types

Instead of special-casing mutable pointers/references, we
now support general generic types (currently, we handle
`ty::Ref`, `ty::RawPtr`, and `ty::Adt`)

When a `ty::Adt` is involved, we show an additional note
explaining which of the type's generic parameters is
invariant (e.g. the `T` in `Cell<T>`). Currently, we don't
explain *why* a particular generic parameter ends up becoming
invariant. In the general case, this could require printing
a long 'backtrace' of types, so doing this would be
more suitable for a follow-up PR.

We still only handle the case where our variance switches
to `ty::Invariant`.

2 years agoRustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29)
bjorn3 [Thu, 30 Dec 2021 11:23:45 +0000 (12:23 +0100)]
Rustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29)

2 years agoAllow false positive unreachable code warning
bjorn3 [Thu, 30 Dec 2021 11:23:32 +0000 (12:23 +0100)]
Allow false positive unreachable code warning

2 years agoEnforce rustfmt on CI
bjorn3 [Thu, 30 Dec 2021 11:09:44 +0000 (12:09 +0100)]
Enforce rustfmt on CI

Fixes #1214

2 years agoRustfmt
bjorn3 [Thu, 30 Dec 2021 11:10:59 +0000 (12:10 +0100)]
Rustfmt

2 years agoDeny warnings on CI
bjorn3 [Thu, 30 Dec 2021 11:05:54 +0000 (12:05 +0100)]
Deny warnings on CI

Fixes #1213

2 years agoRename cargo executable to cargo-clif
bjorn3 [Thu, 30 Dec 2021 10:35:58 +0000 (11:35 +0100)]
Rename cargo executable to cargo-clif

This allows executing it like cargo clif build if you add it to your
PATH. It also fixes infinite recursion on Windows when invoking it as
Windows includes the current directory in PATH by default.

Fixes #971

2 years agoAuto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514
bors [Thu, 30 Dec 2021 08:26:07 +0000 (08:26 +0000)]
Auto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514

remove in_band_lifetimes from librustdoc

r? `@camelid`

closes #92368

2 years agoadd test for noop drop in landing pad
Erik Desjardins [Thu, 30 Dec 2021 06:03:17 +0000 (01:03 -0500)]
add test for noop drop in landing pad

2 years agokeep noinline for system llvm < 14
Erik Desjardins [Thu, 30 Dec 2021 04:19:55 +0000 (23:19 -0500)]
keep noinline for system llvm < 14

2 years agoUse `UnsafeCell::get_mut()` in `core::lazy::OnceCell::get_mut()`
Chayim Refael Friedman [Thu, 30 Dec 2021 03:04:44 +0000 (05:04 +0200)]
Use `UnsafeCell::get_mut()` in `core::lazy::OnceCell::get_mut()`

This removes one unnecessary `unsafe` block.

2 years agoAuto merge of #91125 - eskarn:llvm-passes-plugin-support, r=nagisa
bors [Thu, 30 Dec 2021 02:53:09 +0000 (02:53 +0000)]
Auto merge of #91125 - eskarn:llvm-passes-plugin-support, r=nagisa

Allow loading LLVM plugins with both legacy and new pass manager

Opening a draft PR to get feedback and start discussion on this feature. There is already a codegen option `passes` which allow giving a list of LLVM pass names, however we currently can't use a LLVM pass plugin (as described here : https://llvm.org/docs/WritingAnLLVMPass.html), the only available passes are the LLVM built-in ones.

The proposed modification would be to add another codegen option `pass-plugins`, which can be set with a list of paths to shared library files. These libraries are loaded using the LLVM function `PassPlugin::Load`, which calls the expected symbol `lvmGetPassPluginInfo`, and register the pipeline parsing and optimization callbacks.

An example usage with a single plugin and 3 passes would look like this in the `.cargo/config`:

```toml
rustflags = [
    "-C", "pass-plugins=/tmp/libLLVMPassPlugin",
    "-C", "passes=pass1 pass2 pass3",
]
```
This would give the same functionality as the opt LLVM tool directly integrated in rust build system.

Additionally, we can also not specify the `passes` option, and use a plugin which inserts passes in the optimization pipeline, as one could do using clang.

2 years agoMerge commit '4a053f206fd6799a25823c307f7d7f9d897be118' into sync-rustfmt-subtree
Caleb Cartwright [Thu, 30 Dec 2021 02:49:39 +0000 (20:49 -0600)]
Merge commit '4a053f206fd6799a25823c307f7d7f9d897be118' into sync-rustfmt-subtree

2 years agoAdd UI test for #92292
Wang Ruochen [Thu, 30 Dec 2021 00:04:44 +0000 (16:04 -0800)]
Add UI test for #92292

Closes #92292

2 years agoRefactor variance diagnostics to work with more types
Aaron Hill [Tue, 28 Sep 2021 01:22:44 +0000 (20:22 -0500)]
Refactor variance diagnostics to work with more types

Instead of special-casing mutable pointers/references, we
now support general generic types (currently, we handle
`ty::Ref`, `ty::RawPtr`, and `ty::Adt`)

When a `ty::Adt` is involved, we show an additional note
explaining which of the type's generic parameters is
invariant (e.g. the `T` in `Cell<T>`). Currently, we don't
explain *why* a particular generic parameter ends up becoming
invariant. In the general case, this could require printing
a long 'backtrace' of types, so doing this would be
more suitable for a follow-up PR.

We still only handle the case where our variance switches
to `ty::Invariant`.

2 years agoDo not flatten match arm block with leading attributes
David Lattimore [Wed, 29 Dec 2021 23:13:45 +0000 (10:13 +1100)]
Do not flatten match arm block with leading attributes

This is a backport of #4124.

Fixes #4109

2 years agoAuto merge of #88354 - Jmc18134:hint-space-pauth-opt, r=nagisa
bors [Wed, 29 Dec 2021 22:35:11 +0000 (22:35 +0000)]
Auto merge of #88354 - Jmc18134:hint-space-pauth-opt, r=nagisa

Add codegen option for branch protection and pointer authentication on AArch64

The branch-protection codegen option enables the use of hint-space pointer
authentication code for AArch64 targets.

2 years agoFix whitespace in pretty printed PatKind::Range
David Tolnay [Wed, 29 Dec 2021 20:51:10 +0000 (12:51 -0800)]
Fix whitespace in pretty printed PatKind::Range

2 years agoMark drop calls in landing pads cold instead of noinline
Erik Desjardins [Wed, 29 Dec 2021 20:28:31 +0000 (15:28 -0500)]
Mark drop calls in landing pads cold instead of noinline

Now that deferred inlining has been disabled in LLVM,
this shouldn't cause catastrophic size blowup.

2 years agoFix spacing in pretty printed PatKind::Struct with no fields
David Tolnay [Wed, 29 Dec 2021 20:37:13 +0000 (12:37 -0800)]
Fix spacing in pretty printed PatKind::Struct with no fields

2 years agoMove equal sign back into head ibox
David Tolnay [Wed, 29 Dec 2021 19:53:03 +0000 (11:53 -0800)]
Move equal sign back into head ibox

2 years agoFix spacing of pretty printed const item without body
David Tolnay [Wed, 29 Dec 2021 19:35:50 +0000 (11:35 -0800)]
Fix spacing of pretty printed const item without body

2 years agoAuto merge of #92244 - petrochenkov:alltraits, r=cjgillot
bors [Wed, 29 Dec 2021 19:22:33 +0000 (19:22 +0000)]
Auto merge of #92244 - petrochenkov:alltraits, r=cjgillot

rustc_metadata: Encode list of all crate's traits into metadata

While working on https://github.com/rust-lang/rust/pull/88679 I noticed that rustdoc is casually doing something quite expensive, something that is used only for error reporting in rustc - collecting all traits from all crates in the dependency tree.

This PR trades some minor extra time spent by metadata encoder in rustc for major gains for rustdoc (and for rustc runs with errors, which execute the `all_traits` query for better diagnostics).

2 years agoFix double space in pretty printed TryBlock
David Tolnay [Wed, 29 Dec 2021 19:13:33 +0000 (11:13 -0800)]
Fix double space in pretty printed TryBlock

2 years agoRemove unused allow deprecated
bjorn3 [Wed, 29 Dec 2021 17:06:01 +0000 (18:06 +0100)]
Remove unused allow deprecated

2 years agoAuto merge of #92309 - ehuss:remove-check_lines, r=Mark-Simulacrum
bors [Wed, 29 Dec 2021 16:07:22 +0000 (16:07 +0000)]
Auto merge of #92309 - ehuss:remove-check_lines, r=Mark-Simulacrum

compiletest: Remove some vestigial code

The `check_lines` header is no longer parsed as a header, but instead inside the debuginfo tests. I believe this was changed in #13726.

2 years agoRemove unused feature gates from libtest
bjorn3 [Wed, 29 Dec 2021 15:36:22 +0000 (16:36 +0100)]
Remove unused feature gates from libtest

2 years agoRemove #![crate_name] attribute from libtest
bjorn3 [Wed, 29 Dec 2021 15:36:08 +0000 (16:36 +0100)]
Remove #![crate_name] attribute from libtest

The crate name is already set in Cargo.toml. The comment says there is
some logic in the compiler that reads #![crate_name] and not
--crate-name, but I can't find it. Removing it seems to work fine.

2 years agoReplace TDynBenchFn with Fn(&mut Bencher)
bjorn3 [Wed, 29 Dec 2021 15:16:18 +0000 (16:16 +0100)]
Replace TDynBenchFn with Fn(&mut Bencher)

2 years agoAdd a couple needs-asm-support headers to tests
bjorn3 [Wed, 29 Dec 2021 14:14:50 +0000 (15:14 +0100)]
Add a couple needs-asm-support headers to tests

This will allow them to be ignored by codegen backends that don't
support inline asm.

2 years agoSuggest while let x = y when encountering while x = y
ametisf [Wed, 29 Dec 2021 12:23:19 +0000 (13:23 +0100)]
Suggest while let x = y when encountering while x = y

Extends #75931 to also detect where the `let` might be missing from `while let` expressions.

2 years agoAuto merge of #92397 - matthiaskrgr:rollup-xnfou17, r=matthiaskrgr
bors [Wed, 29 Dec 2021 12:07:33 +0000 (12:07 +0000)]
Auto merge of #92397 - matthiaskrgr:rollup-xnfou17, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #92075 (rustdoc: Only special case struct fields for intra-doc links, not enum variants)
 - #92118 (Parse and suggest moving where clauses after equals for type aliases)
 - #92237 (Visit expressions in-order when resolving pattern bindings)
 - #92340 (rustdoc: Start cleaning up search index generation)
 - #92351 (Add long error explanation for E0227)
 - #92371 (Remove pretty printer space inside block with only outer attrs)
 - #92372 (Print space after formal generic params in fn type)

Failed merges:

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

2 years agoRollup merge of #92372 - dtolnay:fntype, r=jackh726
Matthias Krüger [Wed, 29 Dec 2021 09:17:13 +0000 (10:17 +0100)]
Rollup merge of #92372 - dtolnay:fntype, r=jackh726

Print space after formal generic params in fn type

Follow-up to #92238 fixing one of the FIXMEs.

```rust
macro_rules! repro {
    ($ty:ty) => {
        stringify!($ty)
    };
}

fn main() {
    println!("{}", repro!(for<'a> fn(&'a u8)));
}
```

Before:&ensp;`for<'a>fn(&'a u8)`
After:&ensp;`for<'a> fn(&'a u8)`

The pretty printer's `print_formal_generic_params` already prints formal generic params correctly with a space, we just need to call it when printing BareFn types instead of reimplementing the printing incorrectly without a space.

https://github.com/rust-lang/rust/blob/83b15bfe1c15f325bc186ebfe3691b729ed59f2b/compiler/rustc_ast_pretty/src/pprust/state.rs#L1394-L1400

2 years agoRollup merge of #92371 - dtolnay:attrblock, r=oli-obk
Matthias Krüger [Wed, 29 Dec 2021 09:17:12 +0000 (10:17 +0100)]
Rollup merge of #92371 - dtolnay:attrblock, r=oli-obk

Remove pretty printer space inside block with only outer attrs

Follow-up to #92238 fixing one of the FIXMEs.

```rust
macro_rules! repro {
    ($expr:expr) => {
        stringify!($expr)
    };
}

fn main() {
    println!("{}", repro!(#[attr] {}));
}
```

Before:&ensp;`#[attr] { }`
After:&ensp;`#[attr] {}`

2 years agoRollup merge of #92351 - TmLev:master, r=GuillaumeGomez
Matthias Krüger [Wed, 29 Dec 2021 09:17:11 +0000 (10:17 +0100)]
Rollup merge of #92351 - TmLev:master, r=GuillaumeGomez

Add long error explanation for E0227

Part of the #61137.

2 years agoRollup merge of #92340 - camelid:search-index-cleanup, r=GuillaumeGomez
Matthias Krüger [Wed, 29 Dec 2021 09:17:11 +0000 (10:17 +0100)]
Rollup merge of #92340 - camelid:search-index-cleanup, r=GuillaumeGomez

rustdoc: Start cleaning up search index generation

I'm trying to simplify and clean up the code, partly to make #90779 easier.

r? `@GuillaumeGomez`

2 years agoRollup merge of #92237 - compiler-errors:issue-92100, r=cjgillot
Matthias Krüger [Wed, 29 Dec 2021 09:17:10 +0000 (10:17 +0100)]
Rollup merge of #92237 - compiler-errors:issue-92100, r=cjgillot

Visit expressions in-order when resolving pattern bindings

[edited:] Visit the pattern's sub-expressions before defining any bindings.

Otherwise, we might get into a case where a Lit/Range expression in a pattern has a qpath pointing to a Ident pattern that is defined after it, causing an ICE when lowering to HIR. I have a more detailed explanation in the issue linked.

Fixes #92100

2 years agoRollup merge of #92118 - jackh726:type-alias-position-error, r=petrochenkov
Matthias Krüger [Wed, 29 Dec 2021 09:17:08 +0000 (10:17 +0100)]
Rollup merge of #92118 - jackh726:type-alias-position-error, r=petrochenkov

Parse and suggest moving where clauses after equals for type aliases

~Mostly the same as #90076, but doesn't make any syntax changes.~ Whether or not we want to land the syntax changes, we should  parse the invalid where clause position and suggest moving.

r? `@nikomatsakis`
cc `@petrochenkov` you might have thoughts on implementation

2 years agoRollup merge of #92075 - jyn514:resolve-cleanup, r=camelid
Matthias Krüger [Wed, 29 Dec 2021 09:17:08 +0000 (10:17 +0100)]
Rollup merge of #92075 - jyn514:resolve-cleanup, r=camelid

rustdoc: Only special case struct fields for intra-doc links, not enum variants

Variants are already handled by `resolve_str_path_error`, rustdoc doesn't need to consider them separately. Thanks `@camelid` for catching this!

Eventually I'd like to fix the "combine this with `variant_field`" comment but that needs `resolve_field` to take a `ty_res` parameter to avoid it being super hacky (cc https://github.com/rust-lang/rust/issues/83761#issuecomment-813026026).

r? `@camelid`

2 years agoRemove CommandEnv::apply
Konrad Borowski [Wed, 29 Dec 2021 09:07:44 +0000 (10:07 +0100)]
Remove CommandEnv::apply

It's not being used and uses unsound set_var and remove_var
functions.

2 years agoAuto merge of #92254 - krasimirgg:gsgdt-up, r=Mark-Simulacrum
bors [Wed, 29 Dec 2021 09:00:27 +0000 (09:00 +0000)]
Auto merge of #92254 - krasimirgg:gsgdt-up, r=Mark-Simulacrum

Bump `gsgdt` to 0.1.3

No functional changes intended.

The 0.1.2 -> 0.1.3 commit https://github.com/vn-ki/gsgdt-rs/commit/3e1dcec5398d281e1b33afb41e43dfb248321a1d renames `Node::new` to `Node::from_list`.

2 years agoAddress comments
Xuanwo [Wed, 29 Dec 2021 06:02:20 +0000 (14:02 +0800)]
Address comments

Signed-off-by: Xuanwo <github@xuanwo.io>
2 years agoAuto merge of #92291 - AngelicosPhosphoros:typeid_inline_revert_92135, r=joshtriplett
bors [Wed, 29 Dec 2021 05:53:19 +0000 (05:53 +0000)]
Auto merge of #92291 - AngelicosPhosphoros:typeid_inline_revert_92135, r=joshtriplett

Reverts #92135 because perf regression

Please, start a perf test for this.

r? `@joshtriplett` You approved original PR.

2 years agoUpdate library/std/src/ffi/os_str.rs
Xuanwo [Wed, 29 Dec 2021 05:49:39 +0000 (13:49 +0800)]
Update library/std/src/ffi/os_str.rs

Co-authored-by: David Tolnay <dtolnay@gmail.com>
2 years agoAuto merge of #92283 - vacuus:print-generic-bounds, r=camelid,GuillaumeGomez
bors [Wed, 29 Dec 2021 02:49:34 +0000 (02:49 +0000)]
Auto merge of #92283 - vacuus:print-generic-bounds, r=camelid,GuillaumeGomez

rustdoc: Remove `String` allocation in iteration in `print_generic_bounds`

(I realized only after making the commit that maybe I shouldn't refer to iteration as looping, but it's close enough)

The string representation of a `clean::GenericBound` instance (evaluated [here](https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/format.rs#L397)) is deterministic for a given `self` (the instance), `cx` and `f`, and since `cx` and `f` are constant (as far as I can tell) for a given invocation of `print_generic_bounds`, `self` is the determining factor. Therefore, using the data in `self` shouldn't differ in effect from using its string representation.

Given the totality of the function calls needed to evaluate the string representation as well as the actual allocation, at the very least, this shouldn't negatively affect performance.

2 years agofeat: support parsing asm! args
Caleb Cartwright [Wed, 29 Dec 2021 01:23:51 +0000 (19:23 -0600)]
feat: support parsing asm! args

2 years agochore: bump toolchain
Caleb Cartwright [Wed, 29 Dec 2021 01:23:31 +0000 (19:23 -0600)]
chore: bump toolchain

2 years agoremove in_band_lifetimes from librustdoc
Michael Goulet [Tue, 28 Dec 2021 22:27:31 +0000 (14:27 -0800)]
remove in_band_lifetimes from librustdoc

2 years agoAuto merge of #92269 - vacuus:clean-generics-print, r=camelid
bors [Tue, 28 Dec 2021 23:38:54 +0000 (23:38 +0000)]
Auto merge of #92269 - vacuus:clean-generics-print, r=camelid

rustdoc: Remove `collect` call in `clean::Generics::print`

2 years agoAuto merge of #8117 - hotate29:issue7320, r=camsteffen
bors [Tue, 28 Dec 2021 22:15:53 +0000 (22:15 +0000)]
Auto merge of #8117 - hotate29:issue7320, r=camsteffen

update: ```Sugg::not()``` replacing the comparison operator. #7320

fixes #7320

changelog: ```needless_bool```: Changed to make a smart suggestion.

2 years agoAdd regression test for #59502
Noah Lev [Tue, 28 Dec 2021 21:15:02 +0000 (13:15 -0800)]
Add regression test for #59502

This issue was fixed using a hacky recursion "fuel" argument, but the
issue was never minimized nor was a regression test added. The
underlying bug is still unfixed, so this test should help with fixing it
and removing the `recurse` hack.

2 years agoExplain why struct fields are handled by assoc. item code
Noah Lev [Tue, 28 Dec 2021 19:40:06 +0000 (11:40 -0800)]
Explain why struct fields are handled by assoc. item code

2 years agoAuto merge of #8183 - alex-ozdemir:limit-ident, r=camsteffen
bors [Tue, 28 Dec 2021 22:01:57 +0000 (22:01 +0000)]
Auto merge of #8183 - alex-ozdemir:limit-ident, r=camsteffen

Limit the ``[`identity_op`]`` lint to integral operands.

changelog: limit ``[`identity_op`]`` to integral operands

In the ``[`identity_op`]`` lint, if the operands are non-integers, then the lint is likely
wrong.

2 years agoUpdate libssh2-sys
Eric Huss [Tue, 28 Dec 2021 21:24:03 +0000 (13:24 -0800)]
Update libssh2-sys

2 years agoRemove unused parameter
Noah Lev [Tue, 28 Dec 2021 03:28:05 +0000 (19:28 -0800)]
Remove unused parameter

2 years agoPrint space after formal generic params in fn type
David Tolnay [Thu, 23 Dec 2021 20:31:37 +0000 (12:31 -0800)]
Print space after formal generic params in fn type

2 years agoOnly special case struct fields for intra-doc links, not enum variants
Joshua Nelson [Sat, 18 Dec 2021 15:48:51 +0000 (09:48 -0600)]
Only special case struct fields for intra-doc links, not enum variants

Variants are already handled by `resolve_str_path_error`, rustdoc doesn't need to consider them separately.

2 years agoRemove pretty printer space inside block with only outer attrs
David Tolnay [Tue, 28 Dec 2021 20:26:18 +0000 (12:26 -0800)]
Remove pretty printer space inside block with only outer attrs

2 years agoParse and suggest moving where clauses after equals for type aliases
Jack Huey [Mon, 20 Dec 2021 14:10:10 +0000 (09:10 -0500)]
Parse and suggest moving where clauses after equals for type aliases

2 years agoAuto merge of #8187 - ApamNapat:fix_7651, r=llogiq
bors [Tue, 28 Dec 2021 17:11:40 +0000 (17:11 +0000)]
Auto merge of #8187 - ApamNapat:fix_7651, r=llogiq

Fixed issues with to_radians and to_degrees lints

fixes #7651

I fixed the original problem as described in the issue, but the bug remains for complex expressions (the commented out TC I added is an example). I would also love some feedback on how to cleanup my code and reduce duplication. I hope it's not a problem that the issue has been claimed by someone else - that was over two months ago.

changelog: ``[`suboptimal_flops`]`` no longer proposes broken code with `to_radians` and `to_degrees`

2 years agoAuto merge of #92352 - matthiaskrgr:rollup-19fbq7u, r=matthiaskrgr
bors [Tue, 28 Dec 2021 16:59:56 +0000 (16:59 +0000)]
Auto merge of #92352 - matthiaskrgr:rollup-19fbq7u, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #92076 (Ignore other `PredicateKind`s in rustdoc auto trait finder)
 - #92219 (Remove VCVARS_BAT)
 - #92238 (Add a test suite for stringify macro)
 - #92330 (Add myself to .mailmap)
 - #92333 (Tighten span when suggesting lifetime on path)
 - #92335 (Document units for `std::column`)
 - #92344 (:arrow_up: rust-analyzer)

Failed merges:

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

2 years agoFixed issues with to_radians and to_degrees lints
BB [Tue, 28 Dec 2021 16:45:43 +0000 (17:45 +0100)]
Fixed issues with to_radians and to_degrees lints

2 years agocontants peel_refs to catch `x << &0`
Alex Ozdemir [Tue, 28 Dec 2021 16:32:55 +0000 (08:32 -0800)]
contants peel_refs to catch `x << &0`

2 years agotest
Alex Ozdemir [Tue, 28 Dec 2021 16:19:47 +0000 (08:19 -0800)]
test

2 years agoUpdate pulldown-cmark version in clippy
Guillaume Gomez [Tue, 28 Dec 2021 15:19:23 +0000 (16:19 +0100)]
Update pulldown-cmark version in clippy

2 years agoUpdate pulldown-cmark version to 0.9
Guillaume Gomez [Fri, 24 Dec 2021 11:21:04 +0000 (12:21 +0100)]
Update pulldown-cmark version to 0.9

2 years agoAdd y.bin.dSYM to .gitignore
bjorn3 [Tue, 28 Dec 2021 15:16:49 +0000 (16:16 +0100)]
Add y.bin.dSYM to .gitignore

2 years agoAuto merge of #92153 - petrochenkov:foreignchild, r=cjgillot
bors [Tue, 28 Dec 2021 13:47:22 +0000 (13:47 +0000)]
Auto merge of #92153 - petrochenkov:foreignchild, r=cjgillot

rustc_metadata: Merge items from `extern` blocks into their parent modules during metadata encoding rather than during metadata decoding

2 years agoRollup merge of #92344 - lnicola:rust-analyzer-2021-12-28, r=lnicola
Matthias Krüger [Tue, 28 Dec 2021 12:59:27 +0000 (13:59 +0100)]
Rollup merge of #92344 - lnicola:rust-analyzer-2021-12-28, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

2 years agoRollup merge of #92335 - ecstatic-morse:std-column-unicode, r=Manishearth
Matthias Krüger [Tue, 28 Dec 2021 12:59:26 +0000 (13:59 +0100)]
Rollup merge of #92335 - ecstatic-morse:std-column-unicode, r=Manishearth

Document units for `std::column`

Fixes #92301.

r? ``@Manishearth`` (for the terminology and the Chinese)

2 years agoRollup merge of #92333 - compiler-errors:elided-lifetime-spans, r=cjgillot
Matthias Krüger [Tue, 28 Dec 2021 12:59:25 +0000 (13:59 +0100)]
Rollup merge of #92333 - compiler-errors:elided-lifetime-spans, r=cjgillot

Tighten span when suggesting lifetime on path

This is kind of a hack.

Really the issue here is that we want to suggest the segment's span if the path resolves to something defined outside of the macro, and the macro's span if it resolves to something defined within.. I'll look into seeing if we can do something like that.

Fixes #92324

r? `@cjgillot`

2 years agoRollup merge of #92330 - wesleywiser:mailmap, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Dec 2021 12:59:24 +0000 (13:59 +0100)]
Rollup merge of #92330 - wesleywiser:mailmap, r=Mark-Simulacrum

Add myself to .mailmap

2 years agoRollup merge of #92238 - dtolnay:stringifytest, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Dec 2021 12:59:24 +0000 (13:59 +0100)]
Rollup merge of #92238 - dtolnay:stringifytest, r=Mark-Simulacrum

Add a test suite for stringify macro

This attempts to cover the behavior of `stringify!` on various interpolated syntax tree nodes.

The pretty printer has a history of unsightly whitespace (double spaces, missing spaces, spaces where there shouldn't be spaces) &mdash; #91437, #91562, #91568. There are several such issues left; the test cases that I consider to be currently behaving incorrectly are marked with `// FIXME` in the PR.

2 years agoRollup merge of #92219 - ehuss:remove-vcvars, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Dec 2021 12:59:23 +0000 (13:59 +0100)]
Rollup merge of #92219 - ehuss:remove-vcvars, r=Mark-Simulacrum

Remove VCVARS_BAT

This environment variable is no longer used.  It was used in the original Azure Pipelines configuration (#60777). When GitHub Actions were added (#70190), it was no longer used, and I suspect it was just an oversight while transitioning the configuration.