Commit graph

157081 commits

Author SHA1 Message Date
Noah Lev
f93cf66507 Rename Type::def_id_full() to Type::def_id()
It should be preferred over `def_id_no_primitives()`, so it should have
a shorter name. I also put it before `def_id_no_primitives()` so that it
shows up first in the docs.
2021-10-22 13:07:43 -07:00
Noah Lev
6e3561e149 Rename Type::def_id() to Type::def_id_no_primitives()
The old name was confusing because it's easy to assume that using
`def_id()` is fine, but in some situations it's incorrect. In general,
`def_id_full()` should be preferred, so `def_id_full()` should have a
shorter name. That will happen in the next commit.
2021-10-22 13:07:43 -07:00
Noah Lev
0853c33c3b Use def_id_full() where easily possible
In general, it should be preferred over `Type::def_id()`. See each
method's docs for more.
2021-10-22 13:07:43 -07:00
Noah Lev
bf0cc90050 Replace GetDefId with inherent methods
Now that it's only implemented for `Type`, using inherent methods
instead means that imports are no longer necessary. Also, `GetDefId` is
only meant to be used with `Type`, so it shouldn't be a trait.
2021-10-22 13:07:43 -07:00
Noah Lev
7fb1306275 Remove unused impl of GetDefId for Option<T> 2021-10-22 13:07:43 -07:00
Noah Lev
6d82ee839d Remove GetDefId impl for FnRetTy
It was only used in one place, so it seems better to use ordinary
functions.
2021-10-22 13:07:42 -07:00
Will Crichton
d1c29c696e Revert def_id addition from clean::Function, add test for
scrape-examples options
2021-10-22 12:46:45 -07:00
Santiago Pastorino
9e264137e9
Be sure that we do not allow too much 2021-10-22 16:42:06 -03:00
Santiago Pastorino
132409f0c6
Assemple trait alias candidates for negative polarity
This doesn't work properly yet, we would probably need to implement an
`assembly_neg_candidates` and consider things like `T: !AB` as `T: !A`
|| `T: !B`
2021-10-22 15:49:54 -03:00
Santiago Pastorino
da79fa964c
Add rustc_strict_coherence attribute and use it to check overlap 2021-10-22 15:49:46 -03:00
Josh Stone
e9f545b9a9 Update the minimum external LLVM to 12 2021-10-22 10:50:07 -07:00
Jane Lusby
2ed566559b
Apply suggestions from code review 2021-10-22 10:47:34 -07:00
bors
01198792a6 Auto merge of #89893 - camsteffen:redundant-dump-enabled, r=matthewjasper
Remove redundant dump_enabled check
2021-10-22 17:32:20 +00:00
Josh Stone
8b0e7095a0 llvm-dwp-11 fails on absolute paths 2021-10-22 09:22:18 -07:00
Josh Stone
65150af1b4 Update the minimum external LLVM to 11 2021-10-22 09:22:18 -07:00
Charles Lew
7d7ebf8805 add feature flag for type_changing_struct_update 2021-10-22 11:46:55 -04:00
bors
45b600c833 Auto merge of #90161 - JohnTitor:rollup-1j2qc8m, r=JohnTitor
Rollup of 14 pull requests

Successful merges:

 - #87537 (Clarify undefined behaviour in binary heap, btree and hashset docs)
 - #88624 (Stabilize feature `saturating_div` for rust 1.58.0)
 - #89257 (Give better error for `macro_rules name`)
 - #89665 (Ensure that pushing empty path works as before on verbatim paths)
 - #89895 (Don't mark for loop iter expression as desugared)
 - #89922 (Update E0637 description to mention `&` w/o an explicit lifetime name)
 - #89944 (Change `Duration::[try_]from_secs_{f32, f64}` underflow error)
 - #89991 (rustc_ast: Turn `MutVisitor::token_visiting_enabled` into a constant)
 - #90028 (Reject closures in patterns)
 - #90069 (Fix const qualification when executed after promotion)
 - #90078 (Add a regression test for issue-83479)
 - #90114 (Add some tests for const_generics_defaults)
 - #90115 (Add test for issue #78561)
 - #90129 (triagebot: Treat `I-*nominated` like `I-nominated`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-22 14:25:23 +00:00
Santiago Pastorino
74454c4888
Add comment about the only way to prove NotImplemented here 2021-10-22 11:04:30 -03:00
Santiago Pastorino
2e9fb8b68b
Fix filter_impls comment 2021-10-22 10:58:38 -03:00
Santiago Pastorino
b03a0df737
Fix debug method name 2021-10-22 10:57:10 -03:00
Santiago Pastorino
5b5a2e600e
Move const filter to filter_impls 2021-10-22 10:56:32 -03:00
Steven
c736c2a3ae
Add comment documenting why we can't use a simpler solution
See #90144 for context.

r? @joshtriplett
2021-10-22 09:55:32 -04:00
Santiago Pastorino
c4c76a4fbd
Document flip polarity 2021-10-22 09:34:36 -03:00
Santiago Pastorino
7829d9dde3
Document overlap check filter 2021-10-22 09:22:19 -03:00
Maybe Waffle
a288bf6afb Mark {array,slice}::{from_ref,from_mut} as const fn 2021-10-22 14:53:30 +03:00
Yuki Okushi
ea8a896ee8
Rollup merge of #90129 - joshtriplett:triagebot-nominated, r=Mark-Simulacrum
triagebot: Treat `I-*nominated` like `I-nominated`

rustbot doesn't allow unauthenticated users to set `I-nominated`; apply the same permissions to the new `I-*nominated` labels.
2021-10-22 19:42:53 +09:00
Yuki Okushi
a741f682fe
Rollup merge of #90115 - samlich:test-issue-78561, r=oli-obk
Add test for issue #78561

Adds test for and closes #78561 which previously crashed compiler.
2021-10-22 19:42:52 +09:00
Yuki Okushi
49f2384513
Rollup merge of #90114 - BoxyUwU:cg_defaults_tests, r=lcnr
Add some tests for const_generics_defaults

I think this covers some of the stuff required for stabilisation report, some of these tests are probably covering stuff we already have but it can't hurt to have more :)

r? ````@lcnr````
2021-10-22 19:42:51 +09:00
Yuki Okushi
de306d77db
Rollup merge of #90078 - JohnTitor:test-83479, r=Mark-Simulacrum
Add a regression test for issue-83479

Add a regression test for https://github.com/rust-lang/rust/issues/83479#issue-841147340, but not close the issue, see https://github.com/rust-lang/rust/issues/83479#issuecomment-947255641.
2021-10-22 19:42:50 +09:00
Yuki Okushi
a656bc5b08
Rollup merge of #90069 - tmiasko:promoted-const-qualif, r=oli-obk
Fix const qualification when executed after promotion

The const qualification was so far performed before the promotion and
the implementation assumed that it will never encounter a promoted.

With `const_precise_live_drops` feature, checking for live drops is
delayed until after drop elaboration, which in turn runs after
promotion. so the assumption is no longer true. When evaluating
`NeedsNonConstDrop` it is now possible to encounter promoteds.

Use type base qualification for the promoted. It is a sound
approximation in general, and in the specific case of promoteds and
`NeedsNonConstDrop` it is precise.

Fixes #89938.
2021-10-22 19:42:49 +09:00
Yuki Okushi
9ed9025ea9
Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino
Reject closures in patterns

Fixes #90013.
2021-10-22 19:42:48 +09:00
Yuki Okushi
cbebdd8e67
Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726
rustc_ast: Turn `MutVisitor::token_visiting_enabled` into a constant

It's a visitor property rather than something that needs to be determined at runtime
2021-10-22 19:42:48 +09:00
Yuki Okushi
8b7adf63e1
Rollup merge of #89944 - mbartlett21:patch-2, r=Mark-Simulacrum
Change `Duration::[try_]from_secs_{f32, f64}` underflow error

The error message now says that it was a negative value.

Fixes #89913.
2021-10-22 19:42:47 +09:00
Yuki Okushi
327d8073e2
Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726
Update E0637 description to mention `&` w/o an explicit lifetime name

Deal with https://github.com/rust-lang/rust/issues/89824#issuecomment-941598647. Another solution would be splitting the error code into two as (I think) it's a bit unclear to users why they have the same error code.
2021-10-22 19:42:46 +09:00
Yuki Okushi
91fb223f59
Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco
Don't mark for loop iter expression as desugared

We typically don't mark spans of lowered things as desugared. This helps Clippy rightly discern when code is (not) from expansion. This was discovered by ``@flip1995`` at https://github.com/rust-lang/rust-clippy/pull/7789#issuecomment-939289501.
2021-10-22 19:42:45 +09:00
Yuki Okushi
62da4ab161
Rollup merge of #89665 - seanyoung:push-empty, r=m-ou-se
Ensure that pushing empty path works as before on verbatim paths

Fixes: https://github.com/rust-lang/rust/issues/89658

Signed-off-by: Sean Young <sean@mess.org>
2021-10-22 19:42:43 +09:00
Yuki Okushi
8738d5d611
Rollup merge of #89257 - aDotInTheVoid:macro-error-2, r=estebank
Give better error for `macro_rules name`

follow up to #89221

r? ``@estebank``

``@rustbot`` modify labels: +A-diagnostics +A-parser
2021-10-22 19:42:43 +09:00
Yuki Okushi
918f9cc88b
Rollup merge of #88624 - kellerkindt:master, r=JohnTitor
Stabilize feature `saturating_div` for rust 1.58.0

The tracking issue is #89381

This seems like a reasonable simple change(?). The feature `saturating_div` was added as part of the ongoing effort to implement a `Saturating` integer type (see #87921). The implementation has been discussed [here](https://github.com/rust-lang/rust/pull/87921#issuecomment-899357720) and [here](https://github.com/rust-lang/rust/pull/87921#discussion_r691888556). It extends the list of saturating operations on integer types (like `saturating_add`, `saturating_sub`, `saturating_mul`, ...) by the function `fn saturating_div(self, rhs: Self) -> Self`.

The stabilization of the feature `saturating_int_impl` (for the `Saturating` type) needs to have this stabilized first.

Closes #89381
2021-10-22 19:42:42 +09:00
Yuki Okushi
d91e9b7d77
Rollup merge of #87537 - Wilfred:improve-min-heap-docs, r=Mark-Simulacrum
Clarify undefined behaviour in binary heap, btree and hashset docs

Previously, it wasn't clear whether "This could include" was referring to logic errors, or undefined behaviour. Tweak wording to clarify this sentence does not relate to UB.
2021-10-22 19:42:41 +09:00
Jethro Beekman
4a439769ec Implement split_array and split_array_mut 2021-10-22 09:58:24 +02:00
Caleb Sander
afcee19d88 Make RSplit<T, P>: Clone not require T: Clone
This addresses a TODO comment. The behavior of #[derive(Clone)]
*does* result in a T: Clone requirement.

Add a manual Clone implementation, matching Split and SplitInclusive.
2021-10-21 21:25:59 -07:00
Noah Lev
1da8659fa6 Remove unused impl of GetDefId for Typedef 2021-10-21 19:56:33 -07:00
Noah Lev
b987fd78c2 Fix docs for inline::build_impl
Based on looking at the source code, it looks like the `did` needs to be
for an impl, not functions in an impl.
2021-10-21 19:54:14 -07:00
bors
68a698baf6 Auto merge of #90126 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

This adds a new dep to Clippy: [indoc](https://crates.io/crates/indoc)

And transitively: [unindent](https://crates.io/crates/unindent)
2021-10-21 23:31:13 +00:00
Caleb Cartwright
170214fa16 fix doc issue in rustfmt 2021-10-21 17:22:54 -05:00
Camille GILLOT
6f6fa8b954 Use SortedMap in HIR. 2021-10-21 23:08:57 +02:00
Hans Kratz
3e6a69534f Time out docker load after 10 minutes, kill after 12 due to CI hangs. 2021-10-21 23:07:23 +02:00
lcnr
22e1798975 ignore potential_query_instability in rustdoc 2021-10-21 21:14:34 +02:00
Camille GILLOT
0a5666b838 Do not depend on the stored value when trying to cache on disk. 2021-10-21 20:00:45 +02:00
Hudson Ayers
b802629311 add tests for -Zlocation-detail 2021-10-21 10:44:22 -07:00