Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #84517

Closed
wants to merge 133 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ThibsG and others added 30 commits March 28, 2021 09:37
This is a quick-fix for an ICE in `tabs_in_doc_comments`. The problem
was that we we're indexing into possibly multi-byte characters, such as '位'.

More specifically `get_chunks_of_tabs` was returning indices into
multi-byte characters. Those were passed on to a `Span` creation that
then caused the ICE.

This fix makes sure that we don't return indices that point inside a
multi-byte character. *However*, we are still iterating over unicode
codepoints, not grapheme clusters. So a seemingly single character like y̆ ,
which actually consists of two codepoints, will probably still cause
incorrect spans in the output.
Only lint when `into_iter` is an implementation of `IntoIterator`
Minor cleanups
Fix `macro_use_import` ICE

fixes: rust-lang#7015
changelog: Fix `macro_use_import` ICE
…ffen

Invalid null usage v2

This is continuation of rust-lang#6192 after inactivity.

I plan to move paths into the compiler as diagnostic items after this is merged.

fixes rust-lang#1703
changelog: none
This still applies the lint, and also adds a structured suggestion to
rename it.
Use `register_renamed` instead of `register_removed` for uplifted lints

This still applies the lint, and also adds a structured suggestion to
rename it.

changelog: Use `register_renamed` instead of `register_removed` for lints uplifted to rustc
…fn, r=flip1995

Remove `debug_assert` from `panic_in_result_fn`

I couldn't find any documentation on `debug_assert` that should be remove.
In my humble opinion, I would also like to argue that `todo` and `unreachable` shouldn't trigger this lint?

Related: rust-lang/rust-clippy#6082

r? `@flip1995`

changelog: Change `panic_in_result_fn` to ignore `debug_assert` and co macros
…arth

Fix false-positive `debug_assert` in `panic`

This fixes a false-positive in `clippy::panic` when `debug_assert` is used with a message.

Fixes rust-lang/rust-clippy#7062.

changelog: Fix false-positive in `panic` when `debug_assert` is used with a message
…0, r=giraffate

Fix FP in `single_component_path_imports` lint

Fix FP in  `single_component_path_imports` lint when the import is reused with `self`, like in `use self::module`.

Fixes rust-lang#5210

changelog: none
Deprecate `filter_map`

Since rust-lang#6591, `filter_map` does not even lint `filter().map()`. The cases that are still linted make no sense IMO. So this just removes/deprecates it.

changelog: Deprecate `filter_map` lint

Closes rust-lang#3424
Fixes rust-lang#7050
…ishearth

Add a note on the issue rust-lang#5953

Hello,

I thought it would be better to have a note and warning about this issue considering it introduced an UB in the past even with the "Search on Github" feature.

---

changelog: Add a note on the issue rust-lang#5953 to the known problems section.
Introduce `is_lang_ctor`

changelog: none

Replaces `is_some_ctor` and `is_ok_ctor`. Removes many path usages.
flip1995 and others added 17 commits April 22, 2021 11:24
Rustup

r? `@ghost`

changelog: none
… clean::Module

It can be calculated on-demand even without a TyCtxt.

This also changed `from_item_kind` to take a whole item, which avoids
having to add more and more parameters.
This was missed a while ago when support for proc-macro attributes was
first added.
…ode, r=pnkfelix

Implement a lint that highlights all moves larger than a configured limit

Tracking issue: rust-lang#83518
[MCP 420](rust-lang/compiler-team#420) still ~blazing~ in progress

r? ```@pnkfelix```

The main open issue I see with this minimal impl of the feature is that the lint is immediately "stable" (so it can be named on stable), even if it is never executed on stable. I don't think we have the concept of unstable lint names or hiding lint names without an active feature gate, so that would be a bigger change.
…es, r=varkor

various const parameter defaults improvements

Actually resolve names in const parameter defaults, fixing `struct Foo<const N: usize = { usize::MAX }>`.

---
Split generic parameter ban rib for types and consts, allowing
```rust
#![feature(const_generics_defaults)]
struct Q;
struct Foo<T = Q, const Q: usize = 3>(T);
```

---
Remove the type/const ordering restriction if `const_generics_defaults` is active, even if `const_generics` is not. allowing us to stabilize and test const param defaults separately.

---
Check well formedness of const parameter defaults, eagerly emitting an error for `struct Foo<const N: usize = { 0 - 1 }>`

---
Do not forbid const parameters in param defaults, allowing `struct Foo<const N: usize, T = [u8; N]>(T)` and `struct Foo<const N: usize, const M: usize = N>`. Note that this should not change anything which is stabilized, as on stable, type parameters must be in front of const parameters, which means that type parameter defaults are only allowed if no const parameters exist.

We still forbid generic parameters inside of const param types.

r? `````````@varkor````````` `````````@petrochenkov`````````
…oli-obk

further split up const_fn feature flag

This continues the work on splitting up `const_fn` into separate feature flags:
* `const_fn_trait_bound` for `const fn` with trait bounds
* `const_fn_unsize` for unsizing coercions in `const fn` (looks like only `dyn` unsizing is still guarded here)

I don't know if there are even any things left that `const_fn` guards... at least libcore and liballoc do not need it any more.

``@oli-obk`` are you currently able to do reviews?
Update Clippy

r? ```@Manishearth```

Biweekly Clippy update.
rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module

It can be calculated on-demand even without a TyCtxt.

This also changed `json::conversions::from_item_kind` to take a whole item, which avoids
having to add more and more parameters.

Helps with rust-lang#76382.

r? ```@camelid```
rustdoc: Get rid of `clean::TypeKind`

It does exactly the same thing as ItemType.
@rustbot rustbot added the rollup A PR which is a rollup label Apr 24, 2021
@JohnTitor
Copy link
Member Author

@bors r+ p=6 rollup=never

@bors
Copy link
Contributor

bors commented Apr 24, 2021

📌 Commit 3276103 has been approved by JohnTitor

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 24, 2021
@bors
Copy link
Contributor

bors commented Apr 24, 2021

⌛ Testing commit 3276103 with merge 7fe78989cc547c3ce995d29eb63aee6416597ea8...

@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4234  100  4234    0     0  51012      0 --:--:-- --:--:-- --:--:-- 50404
+ RUSTC_BOOTSTRAP=1
+ ./build/x86_64-unknown-linux-gnu/stage2/bin/rustc --edition=2018 --crate-type=lib /tmp/ctfe-stress-4.rs
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   |
   |
67 | expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable


error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
28 |         e(0); e(0); e(0); e(0)
...
...
67 | expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
23 |       ([16 $($n: tt)*] $e: expr, $T: ty) => {{
   |  ____________________________________________^
24 | |         const fn e(_: u32) -> $T { const_repeat!([$($n)*] $e, $T) }
25 | |         e(0); e(0); e(0); e(0);
26 | |         e(0); e(0); e(0); e(0);
27 | |         e(0); e(0); e(0); e(0);
28 | |         e(0); e(0); e(0); e(0)
29 | |     }};
...
...
67 |   expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
28 |         e(0); e(0); e(0); e(0)
...
...
67 | expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
23 |       ([16 $($n: tt)*] $e: expr, $T: ty) => {{
   |  ____________________________________________^
24 | |         const fn e(_: u32) -> $T { const_repeat!([$($n)*] $e, $T) }
25 | |         e(0); e(0); e(0); e(0);
26 | |         e(0); e(0); e(0); e(0);
27 | |         e(0); e(0); e(0); e(0);
28 | |         e(0); e(0); e(0); e(0)
29 | |     }};
...
...
67 |   expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
28 |         e(0); e(0); e(0); e(0)
...
...
67 | expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
23 |       ([16 $($n: tt)*] $e: expr, $T: ty) => {{
   |  ____________________________________________^
24 | |         const fn e(_: u32) -> $T { const_repeat!([$($n)*] $e, $T) }
25 | |         e(0); e(0); e(0); e(0);
26 | |         e(0); e(0); e(0); e(0);
27 | |         e(0); e(0); e(0); e(0);
28 | |         e(0); e(0); e(0); e(0)
29 | |     }};
...
...
67 |   expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
67 | expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable


error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
13 |       ([16] $e: expr, $T: ty) => {{
   |  _________________________________^
14 | |         $e; $e; $e; $e;
15 | |         $e; $e; $e; $e;
16 | |         $e; $e; $e; $e;
17 | |         $e; $e; $e; $e
18 | |     }};
...
...
67 |   expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
28 |         e(0); e(0); e(0); e(0)
...
...
67 | expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   |
   |
23 |       ([16 $($n: tt)*] $e: expr, $T: ty) => {{
   |  ____________________________________________^
24 | |         const fn e(_: u32) -> $T { const_repeat!([$($n)*] $e, $T) }
25 | |         e(0); e(0); e(0); e(0);
26 | |         e(0); e(0); e(0); e(0);
27 | |         e(0); e(0); e(0); e(0);
28 | |         e(0); e(0); e(0); e(0)
29 | |     }};
...
...
67 |   expensive_static!(UNSIZE_TRAIT: &'static dyn Trait = &42u32; [4 16 16 16 16 16]);
   |
   = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
   = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

@bors
Copy link
Contributor

bors commented Apr 24, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 24, 2021
@JohnTitor JohnTitor closed this Apr 24, 2021
@JohnTitor JohnTitor deleted the rollup-nzuxxec branch April 24, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.