Commit graph

677 commits

Author SHA1 Message Date
Ellen
8295e4a6cf add test for builtin types N + N unifying with fn call 2021-09-09 15:44:04 +01:00
Andreas Liljeqvist
5b2f757dae Make abi::Abi Copy and remove a *lot* of refs
fix

fix

Remove more refs and clones

fix

more

fix
2021-09-09 10:41:19 +02:00
Deadbeef
1ca83c6451
Use trait select logic instead of query 2021-09-09 05:21:32 +00:00
Deadbeef
f0a52128ee
fmt 2021-09-09 05:21:31 +00:00
Deadbeef
a13b13ff46
Const drop selection candidates 2021-09-09 05:21:31 +00:00
Ellen
cd2915eddb fmt 2021-09-09 01:32:03 +01:00
Ellen
3212734bd7 resolve from_hir_call FIXME 2021-09-09 01:32:03 +01:00
Ellen
8c7954dc42 add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
Ellen
955e2b2da0 nits 2021-09-09 01:32:03 +01:00
Ellen
79be080255 remove comment 2021-09-09 01:32:03 +01:00
Ellen
406d2ab95d rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00
Ellen
15101c8e95 remove debug stmts 2021-09-09 01:32:03 +01:00
Ellen
1f57f8b903 remove WorkNode 2021-09-09 01:32:03 +01:00
Ellen
4cbcb0936a handle ExprKind::NeverToAny 2021-09-09 01:32:03 +01:00
Ellen
fc63e9a8fb dont build abstract const for monomorphic consts 2021-09-09 01:32:03 +01:00
Ellen
c170dcf04c tidy 2021-09-09 01:32:03 +01:00
Ellen
4483c2bdf6 dont support blocks 2021-09-09 01:32:03 +01:00
Ellen
9b2913814b as casts and block exprs 2021-09-09 01:32:03 +01:00
Ellen
2987f4ba42 WIP state 2021-09-09 01:32:03 +01:00
Mark Rousskov
2eac09d258 Use index newtyping for TyVid 2021-09-06 22:38:06 -04:00
Gary Guo
97214eecc5 Add query own_existential_vtable_entries 2021-09-05 18:13:32 +01:00
Gary Guo
871eb6233e Stop allocating vtable entries for non-object-safe methods 2021-09-05 18:13:32 +01:00
Ethan Brierley
b7d99983f8 Add line that was unintentionally removed 2021-09-04 23:13:15 +01:00
Ethan Brierley
fc5633fed6 Make fields on AbstractConst private 2021-09-04 16:28:55 +01:00
Ethan Brierley
6e4061819f Remove left over comment 2021-09-04 15:49:02 +01:00
Ethan Brierley
22c2738573 Minor cleanup: make imports more consistent 2021-09-04 15:47:00 +01:00
Ethan Brierley
85d6029c13 AbstractConst::root: Always run subst when Node is Leaf 2021-09-04 15:44:26 +01:00
bors
c5799b2a73 Auto merge of #88618 - m-ou-se:rollup-6tss5z6, r=m-ou-se
Rollup of 7 pull requests

Successful merges:

 - #88202 (Add an example for deriving PartialOrd on enums)
 - #88483 (Fix LLVM libunwind build for non-musl targets)
 - #88507 (Add test case for using `slice::fill` with MaybeUninit)
 - #88557 (small const generics cleanup)
 - #88579 (remove redundant / misplaced sentence from docs)
 - #88610 (Update outdated docs of array::IntoIter::new.)
 - #88613 (Update primitive docs for rust 2021.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-09-03 11:37:52 +00:00
Mara Bos
4b5da4aefe
Rollup merge of #88557 - lcnr:const-generics-cleanup, r=BoxyUwU
small const generics cleanup
2021-09-03 13:30:48 +02:00
bors
e4e4179539 Auto merge of #86454 - tlyu:refactor-unsized-suggestions, r=davidtwco
Refactor unsized suggestions

`@rustbot` label +A-diagnostics +A-traits +A-typesystem +C-cleanup +T-compiler
2021-09-03 08:51:21 +00:00
Aaron Hill
611191f54c
Report cycle error using 'deepest' obligation in the cycle 2021-09-02 11:49:32 -05:00
Aaron Hill
f2d9ee9c34
Preserve most sub-obligations in the projection cache 2021-09-02 11:10:40 -05:00
Michael Howell
733bdd079a fix(rustc): suggest items be borrowed in for i in items[x..]
Fixes #87994
2021-09-01 20:14:01 -07:00
lcnr
fc2a2650e2 cleanup const generics FIXME 2021-09-01 11:41:06 +02:00
Cameron Steffen
2f4e86b9ef Enforce diverging let...else 2021-08-30 20:18:42 -05:00
Ellen
fcc2badf9b rename const_evaluatable_checked to generic_const_exprs
2021-08-30 11:00:21 +02:00
Deadbeef
f3d96e9391
fmt 2021-08-27 08:09:00 +00:00
Deadbeef
80e1ee5aee
Add ty::BoundConstness 2021-08-27 06:49:18 +00:00
bors
d5cd3205fd Auto merge of #88371 - Manishearth:rollup-pkkjsme, r=Manishearth
Rollup of 11 pull requests

Successful merges:

 - #87832 (Fix debugger stepping behavior with `match` expressions)
 - #88123 (Make spans for tuple patterns in E0023 more precise)
 - #88215 (Reland #83738: "rustdoc: Don't load all extern crates unconditionally")
 - #88216 (Don't stabilize creation of TryReserveError instances)
 - #88270 (Handle type ascription type ops in NLL HRTB diagnostics)
 - #88289 (Fixes for LLVM change 0f45c16f2caa7c035e5c3edd40af9e0d51ad6ba7)
 - #88320 (type_implements_trait consider obligation failure on overflow)
 - #88332 (Add argument types tait tests)
 - #88340 (Add `c_size_t` and `c_ssize_t` to `std::os::raw`.)
 - #88346 (Revert "Add type of a let tait test impl trait straight in let")
 - #88348 (Add field types tait tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-08-27 01:07:17 +00:00
Manish Goregaokar
c418a48737
Rollup merge of #88320 - sexxi-goose:issue-88103, r=nikomatsakis
type_implements_trait consider obligation failure on overflow

Fixes: #88103
2021-08-26 12:38:11 -07:00
lcnr
7cbfa2ee33 rebase 2021-08-26 11:14:31 +02:00
lcnr
f3996f6a88 review 2021-08-26 11:14:31 +02:00
lcnr
bc0156bace shrink ty::PredicateKind again 2021-08-26 11:00:30 +02:00
lcnr
caa975c89e use ty::Unevaluated instead of def substs pair 2021-08-26 11:00:30 +02:00
lcnr
ab9108b70f update TypeFlags to deal with missing ct substs 2021-08-26 11:00:30 +02:00
lcnr
cc47998e28 add tcx to fn walk 2021-08-26 11:00:30 +02:00
lcnr
bfaf13af4e make unevaluated const substs optional 2021-08-26 11:00:30 +02:00
lcnr
f4b606fd17 require a tcx for TypeVisitor 2021-08-26 10:54:01 +02:00
Niko Matsakis
88bcd4457b
trailing whitespace 2021-08-25 12:09:48 -04:00
Niko Matsakis
d7d122faec
update docs for type_implements_trait 2021-08-25 11:39:35 -04:00
Aman Arora
a216d666ca type_implements_trait consider obligation failure on overflow 2021-08-25 03:52:24 -04:00
jackh726
af14db14f4 Review comments 2021-08-24 22:29:41 -04:00
Jack Huey
8d7707f3c4 Normalize associated types with bound vars 2021-08-24 22:29:39 -04:00
Mara Bos
5cf025f076
Rollup merge of #88230 - steffahn:a_an, r=oli-obk
Fix typos “a”→“an”

Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an.

While automation was used to find these, every change was checked manually.

Changes in submodules get separate PRs:
* https://github.com/rust-lang/stdarch/pull/1201
* https://github.com/rust-lang/cargo/pull/9821
* https://github.com/rust-lang/miri/pull/1874
* https://github.com/rust-lang/rls/pull/1746
* https://github.com/rust-analyzer/rust-analyzer/pull/9984
  _folks @ rust-analyzer are fast at merging…_
  * https://github.com/rust-analyzer/rust-analyzer/pull/9985
  * https://github.com/rust-analyzer/rust-analyzer/pull/9987
  * https://github.com/rust-analyzer/rust-analyzer/pull/9989

_For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._

<hr>

This has some overlap with #88226, but neither is a strict superset of the other.

If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.
2021-08-23 20:45:49 +02:00
bors
91f9806208 Auto merge of #88166 - BoxyUwU:const-equate-canon, r=lcnr
canonicalize consts before calling try_unify_abstract_consts query

Fixes #88022
Fixes #86953
Fixes #77708
Fixes #82034
Fixes #85031

these ICEs were all caused by calling the `try_unify_abstract_consts` query with inference vars in substs

r? `@lcnr`
2021-08-22 18:00:22 +00:00
Frank Steffahn
bf88b113ea Fix typos “a”→“an” 2021-08-22 15:35:11 +02:00
bors
1eb187c16e Auto merge of #88139 - lcnr:marker-trait-attr, r=nikomatsakis
marker_traits: require `EvaluatedToOk` during winnowing

closes #84955, while it doesn't really fix it in a way that makes me happy it should prevent the issue for now and this
test can't be reproduced anyways, so it doesn't make much sense to keep it open.

fixes #84917 as only one of the impls depends on regions, so we now drop the ambiguous one instead of the correct one.

cc https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/winnowing.20soundly/near/247899832

r? `@nikomatsakis`
2021-08-22 10:44:38 +00:00
bors
d3e2578c31 Auto merge of #88135 - crlf0710:trait_upcasting_part_3, r=nikomatsakis
Trait upcasting coercion (part 3)

By using separate candidates for each possible choice, this fixes type-checking issues in previous commits.

r? `@nikomatsakis`
2021-08-21 21:14:07 +00:00
bors
797095a686 Auto merge of #88149 - Mark-Simulacrum:prep-never-type, r=jackh726
Refactor fallback code to prepare for never type

This PR contains cherry-picks of some of `@nikomatsakis's` work from #79366, and shouldn't (AFAICT) represent any change in behavior. However, the refactoring is good regardless of the never type work being landed, and will reduce the size of those eventual PR(s) (and rebase pain).

I am not personally an expert on this code, and the commits are essentially 100% `@nikomatsakis's,` but they do seem reasonable to me by my understanding. Happy to edit with review, of course. Commits are best reviewed in sequence rather than all together.

r? `@jackh726` perhaps?
2021-08-21 01:29:12 +00:00
Anton Golov
b8fff95961 Require a box expression's type to be Sized 2021-08-20 16:25:52 +02:00
Niko Matsakis
947c0de028 introduce a Coerce predicate 2021-08-19 17:28:24 -04:00
Ellen
c2b61fbafe move code to InferCtxt method 2021-08-19 21:04:09 +01:00
Ellen
696c88d69c canonicalize const equate predicates 2021-08-19 19:47:38 +01:00
Charles Lew
c22dfab215 Add assertion to ensure the query doesn't get called before type infererence is done. 2021-08-20 02:37:00 +08:00
bors
3d0774d0dc Auto merge of #86700 - lqd:matthews-nll-hrtb-errors, r=nikomatsakis
Matthew's work on improving NLL's "higher-ranked subtype error"s

This PR rebases `@matthewjasper's` [branch](https://github.com/matthewjasper/rust/tree/nll-hrtb-errors) which has great work to fix the obscure higher-ranked subtype errors that are tracked in #57374.

These are a blocker to turning full NLLs on, and doing some internal cleanups to remove some of the old region code.

The goal is so `@nikomatsakis` can take a look at this early, and I'll then do my best to help do the changes and followup work to land this work, and move closer to turning off the migration mode.

I've only updated the branch and made it compile, removed a warning or two.

r? `@nikomatsakis`

(Here's the [zulip topic to discuss this](https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll/topic/.2357374.3A.20improving.20higher-ranked.20subtype.20errors.20via.20.2386700) that Niko wanted)
2021-08-18 15:54:59 +00:00
lcnr
3329f67f17 marker_traits: require EvaluatedToOk 2021-08-18 16:34:54 +02:00
Charles Lew
6b1c52ff25 Fold vtable_trait_upcasting_coercion_new_vptr_slot logic into obligation processing. 2021-08-18 13:00:27 +08:00
Charles Lew
1e605023ec Properly generate multiple candidates for trait upcasting coercion. 2021-08-18 13:00:27 +08:00
bors
aa8f27bf4d Auto merge of #87668 - estebank:tweak-bound-output, r=oli-obk
Use note for pointing at bound introducing requirement

Modify output for pointing where a trait bound obligation is introduced in an E0277 from using a span label to using a note in order to always preserve order of the output:

Before:
```
error[E0277]: `<<Self as Case1>::A as Iterator>::Item` doesn't implement `Debug`
  --> $DIR/bounds-on-assoc-in-trait.rs:18:28
   |
LL |     type A: Iterator<Item: Debug>;
   |                            ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
  ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
   |
LL | pub trait Debug {
   | --------------- required by this bound in `Debug`
   |
   = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
```
After:
```
error[E0277]: `<<Self as Case1>::A as Iterator>::Item` doesn't implement `Debug`
  --> $DIR/bounds-on-assoc-in-trait.rs:18:28
   |
LL |     type A: Iterator<Item: Debug>;
   |                            ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
note: required by a bound in `Debug`
  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
   |
LL | pub trait Debug {
   | ^^^^^^^^^^^^^^^ required by this bound in `Debug`
```
2021-08-17 06:59:49 +00:00
Esteban Küber
39f220ce12 Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
Matthew Jasper
4421dd17fa Return the canonicalized query from type ops 2021-08-15 08:44:36 +02:00
Deadbeef
f25d2bd53b
Assign FIXMEs to me and remove obsolete ones
Also fixed capitalization of documentation
2021-08-14 16:48:01 +00:00
Deadbeef
2931a9df2f
make check less conservative and add explanation 2021-08-13 09:28:52 +00:00
Deadbeef
869daad8fc
Fix tests 2021-08-13 09:28:51 +00:00
Deadbeef
bcf0e2f528
Fix assoc-type test 2021-08-13 09:28:50 +00:00
Deadbeef
01bb3710b5
Pass constness to SelectionContext 2021-08-13 09:28:50 +00:00
Deadbeef
3bab45d2ac
Make selection and evaluation caches use constness 2021-08-13 09:28:49 +00:00
Deadbeef
36ace4c0ad
fmt 2021-08-13 09:28:49 +00:00
Deadbeef
d356cd10f7
fmt 2021-08-13 09:26:34 +00:00
Deadbeef
4c8b6a20a9
Filter non-const impls when we expect a const one 2021-08-13 09:26:33 +00:00
Deadbeef
32390a0df6
move Constness into TraitPredicate 2021-08-13 09:26:33 +00:00
bors
d488de82f3 Auto merge of #87587 - oli-obk:lazy_tait, r=spastorino
Various refactorings of the TAIT infrastructure

Before this PR we used to store the opaque type knowledge outside the `InferCtxt`, so it got recomputed on every opaque type instantiation.

I also removed a feature gate check that makes no sense in the planned lazy TAIT resolution scheme

Each commit passes all tests, so this PR is best reviewed commit by commit.

r? `@spastorino`
2021-08-11 05:14:45 +00:00
Oli Scherer
93c4aa80b8 Don't collect into a Vec that is immediately being iterated on again. 2021-08-10 11:03:10 +00:00
Esteban Küber
f93cbedade Do not ICE on HIR based WF check when involving lifetimes
Fix #87549.
2021-08-09 07:01:35 +00:00
Oli Scherer
092e9ccd8a Point to the value instead of the TAIT declaration for obligation failures 2021-08-06 10:42:05 +00:00
Oli Scherer
b2c1919a3d Store the DefId of the currently typechecked item in InferCtxt
This allows opaque type inference to check for defining uses without having to pass down that def id via function arguments to every method that could possibly cause an opaque type to be compared with a concrete type
2021-08-06 10:39:23 +00:00
Oli Scherer
20371b94f6 Immediately register new opaque types in the global list.
Previously each opaque type instantiation would create new inference vars, even for the same opaque type/substs combination. Now there is a global map in InferCtxt that gets filled whenever we encounter an opaque type.
2021-08-06 10:39:08 +00:00
Oli Scherer
a30b548919 Split fold_opaque_ty 2021-08-06 10:23:11 +00:00
Oli Scherer
34182804e8 Move some code around in preparation of splitting a function 2021-08-06 10:21:01 +00:00
Oli Scherer
14021feea9 Remove a field that is computed later anyway 2021-08-06 10:18:31 +00:00
Oli Scherer
d99805982b Move opaque type cache into InferCtxt 2021-08-06 10:12:31 +00:00
bors
a6ece56152 Auto merge of #86400 - FabianWolff:issue-85735, r=estebank
Remove invalid suggestion involving `Fn` trait bound

This pull request closes #85735. The actual issue is a duplicate of #21974, but #85735 contains a further problem, which is an invalid suggestion if `Fn`/`FnMut`/`FnOnce` trait bounds are involved: The suggestion code checks whether the trait bound ends with `>` to determine whether it has any generic arguments, but the `Fn*` traits have a special syntax for generic arguments that doesn't involve angle brackets. The example given in #85735:
```rust
trait Foo {}
impl<'a, 'b, T> Foo for T
where
    T: FnMut(&'a ()),
    T: FnMut(&'b ()), {

    }
```
currently produces:
```
error[E0283]: type annotations needed
   --> src/lib.rs:4:8
    |
4   |       T: FnMut(&'a ()),
    |          ^^^^^^^^^^^^^ cannot infer type for type parameter `T`
    |
    = note: cannot satisfy `T: FnMut<(&'a (),)>`
help: consider specifying the type arguments in the function call
    |
4   |     T: FnMut(&'a ())::<Self, Args>,
    |                     ^^^^^^^^^^^^^^

error: aborting due to previous error
```
which is incorrect, because there is no function call, and applying the suggestion would lead to a parse error. With my changes, I get:
```
error[E0283]: type annotations needed
   --> test.rs:4:8
    |
4   |     T: FnMut(&'a ()),
    |        ^^^^^^^^^^^^^ cannot infer type for type parameter `T`
    |
   ::: [...]/library/core/src/ops/function.rs:147:1
    |
147 | pub trait FnMut<Args>: FnOnce<Args> {
    | ----------------------------------- required by this bound in `FnMut`
    |
    = note: cannot satisfy `T: FnMut<(&'a (),)>`

error: aborting due to previous error
```
i.e. I have added a check to prevent the invalid suggestion from being issued for `Fn*` bounds, while the underlying issue #21974 remains for now.
2021-08-03 19:48:54 +00:00
Fabian Wolff
f8c10ff8b7 Remove invalid suggestion involving Fn trait bound 2021-08-03 21:31:34 +02:00
bors
c6bc102fea Auto merge of #87515 - crlf0710:trait_upcasting_part2, r=bjorn3
Trait upcasting coercion (part2)

This is the second part of trait upcasting coercion implementation.

Currently this is blocked on #86264 .

The third part might be implemented using unsafety checking

r? `@bjorn3`
2021-08-03 16:58:56 +00:00
Yuki Okushi
14e92d7116
Do not suggest impl traits as type arguments 2021-08-03 20:05:50 +09:00
Charles Lew
63ed625313 Implement pointer casting. 2021-08-03 01:09:37 +08:00
bors
b53a93db2d Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
rfc3052 followup: Remove authors field from Cargo manifests

Since RFC 3052 soft deprecated the authors field, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information for contributors, we may as well
remove it from crates in this repo.
2021-08-02 05:49:17 +00:00
bors
aadd6189ad Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisa
more clippy::complexity fixes

(also a couple of clippy::perf fixes)
2021-08-01 09:15:15 +00:00
bors
7069a8c2b7 Auto merge of #86264 - crlf0710:trait_upcasting_part1, r=nikomatsakis
Trait upcasting coercion (part1)

This revives the first part of earlier PR #60900 .

It's not very clear to me which parts of that pr was design decisions, so i decide to cut it into pieces and land them incrementally. This allows more eyes on the details.

This is the first part, it adds feature gates, adds feature gates tests, and implemented the unsize conversion part.
(I hope i have dealt with the `ExistentialTraitRef` values correctly...)

The next part will be implementing the pointer casting.
2021-07-31 07:46:14 +00:00
Charles Lew
fb4e0a0972 Implement trait upcasting coercion type-checking. 2021-07-31 00:51:39 +08:00
Esteban Küber
0b8f192cfe Use multispan suggestions more often
* Use more accurate span for `async move` suggestion
* Use more accurate span for deref suggestion
* Use `multipart_suggestion` more often
2021-07-30 09:26:31 -07:00
Jade
3cf820e17d rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
Fabian Wolff
dbd0fd2c2a Fix ICE in diagnostic_hir_wf_check 2021-07-28 01:41:52 +02:00
Matthias Krüger
066eb6ab5d clippy::filter_next 2021-07-25 12:26:02 +02:00
Matthias Krüger
1c129f7b97 use vec![] macro to create Vector with first item inside instead of pushing to an empty vec![]
slightly reduces code bloat
2021-07-25 12:19:33 +02:00
bors
f9b95f92c8 Auto merge of #86461 - crlf0710:rich_vtable, r=nikomatsakis
Refactor vtable format for upcoming trait_upcasting feature.

This modifies vtable format:
1. reordering occurrence order of methods coming from different traits
2. include `VPtr`s for supertraits where this vtable cannot be directly reused during trait upcasting.
Also, during codegen, the vtables corresponding to these newly included `VPtr` will be requested and generated.

For the cases where this vtable can directly used, now the super trait vtable has exactly the same content to some prefix of this one.

r? `@bjorn3`
cc `@RalfJung`
cc `@rust-lang/wg-traits`
2021-07-24 10:21:23 +00:00
Yuki Okushi
3fc79fde63
Rollup merge of #87322 - chazkiker2:fix/suggestion-ref-sync-send, r=estebank
fix: clarify suggestion that `&T` must refer to `T: Sync` for `&T: Send`

### Description

- [x] fix #86507
- [x] add UI test for relevant code from issue
- [x] change `rustc_trait_selection/src/traits/error_reporting/suggestions.rs` to include a more clear suggestion when `&T` fails to satisfy `Send` bounds due to the fact that `T` fails to implement `Sync`
- [x] update UI test in Clippy: `src/tools/tests/ui/future_not_send.stderr`
2021-07-24 04:31:11 +09:00
chaz-kiker
831ac19639 Squash all commits.
add test for issue 86507

add stderr for issue 86507

update issue-86507 UI test

add comment for the expected error in UI test file

add proper 'refers to <ref_type>' in suggestion

update diagnostic phrasing; update test to match new phrasing; re-organize logic for checking T: Sync

evaluate additional obligation to figure out if T is Sync

run './x.py test tidy --bless'

incorporate changes from review; reorganize logic for readability
2021-07-22 15:42:42 -05:00
Oli Scherer
bdc20e372b Use instrument debugging for more readable logs 2021-07-22 11:20:29 +00:00
bors
7c89e389d0 Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank
Support HIR wf checking for function signatures

During function type-checking, we normalize any associated types in
the function signature (argument types + return type), and then
create WF obligations for each of the normalized types. The HIR wf code
does not currently support this case, so any errors that we get have
imprecise spans.

This commit extends `ObligationCauseCode::WellFormed` to support
recording a function parameter, allowing us to get the corresponding
HIR type if an error occurs. Function typechecking is modified to
pass this information during signature normalization and WF checking.
The resulting code is fairly verbose, due to the fact that we can
no longer normalize the entire signature with a single function call.

As part of the refactoring, we now perform HIR-based WF checking
for several other 'typed items' (statics, consts, and inherent impls).

As a result, WF and projection errors in a function signature now
have a precise span, which points directly at the responsible type.
If a function signature is constructed via a macro, this will allow
the error message to point at the code 'most responsible' for the error
(e.g. a user-supplied macro argument).
2021-07-22 07:21:45 +00:00
Aaron Hill
3291218f47
Improve caching during trait evaluation
Previously, we would 'forget' that we had `'static` regions in some
place during trait evaluation. This lead to us producing
`EvaluatedToOkModuloRegions` when we could have produced
`EvaluatedToOk`, causing us to perform unnecessary work.

This PR preserves `'static` regions when we canonicalize a predicate for
`evaluate_obligation`, and when we 'freshen' a predicate during trait
evaluation. Thie ensures that evaluating a predicate containing
`'static` regions can produce `EvaluatedToOk` (assuming that we
don't end up introducing any region dependencies during evaluation).

Building off of this improved caching, we use
`predicate_must_hold_considering_regions` during fulfillment of
projection predicates to see if we can skip performing additional work.
We already do this for trait predicates, but doing this for projection
predicates lead to mixed performance results without the above caching
improvements.
2021-07-21 17:54:05 -05:00
Aaron Hill
db0324ebb2
Support HIR wf checking for function signatures
During function type-checking, we normalize any associated types in
the function signature (argument types + return type), and then
create WF obligations for each of the normalized types. The HIR wf code
does not currently support this case, so any errors that we get have
imprecise spans.

This commit extends `ObligationCauseCode::WellFormed` to support
recording a function parameter, allowing us to get the corresponding
HIR type if an error occurs. Function typechecking is modified to
pass this information during signature normalization and WF checking.
The resulting code is fairly verbose, due to the fact that we can
no longer normalize the entire signature with a single function call.

As part of the refactoring, we now perform HIR-based WF checking
for several other 'typed items' (statics, consts, and inherent impls).

As a result, WF and projection errors in a function signature now
have a precise span, which points directly at the responsible type.
If a function signature is constructed via a macro, this will allow
the error message to point at the code 'most responsible' for the error
(e.g. a user-supplied macro argument).
2021-07-20 10:58:14 -05:00
Charles Lew
634638782b Switch to store Instance directly within VtblEntry, fix TraitVPtr representation. 2021-07-20 22:53:02 +08:00
Charles Lew
ab171c5279 Add internal attribute and tests. 2021-07-20 22:14:43 +08:00
Charles Lew
d2dc4276fd Refactor vtable format. 2021-07-20 22:14:42 +08:00
bors
da7d405357 Auto merge of #87244 - jackh726:issue-71883, r=estebank
Better diagnostics with mismatched types due to implicit static lifetime

Fixes #78113

I think this is my first diagnostics PR...definitely happy to hear thoughts on the direction/implementation here.

I was originally just trying to solve the error above, where the lifetime on a GAT was causing a cryptic "mismatched types" error. But as I was writing this, I realized that this (unintentionally) also applied to a different case: `wf-in-foreign-fn-decls-issue-80468.rs`. I'm not sure if this diagnostic should get a new error code, or even reuse an existing one. And, there might be some ways to make this even more generalized. Also, the error is a bit more lengthy and verbose than probably needed. So thoughts there are welcome too.

This PR essentially ended up adding a new nice region error pass that triggers if a type doesn't match the self type of an impl which is selected because of a predicate because of an implicit static bound on that self type.

r? `@estebank`
2021-07-20 10:56:08 +00:00
bors
a72c360a30 Auto merge of #87141 - spastorino:remove_impl_trait_in_bindings, r=oli-obk
Remove impl trait in bindings

Closes #86729

r? `@oli-obk`
2021-07-20 05:34:22 +00:00
jackh726
3cd5ad5cd7 Better diagnostics when mismatched types due to implict static lifetime 2021-07-19 18:20:21 -04:00
bors
d5af63480f Auto merge of #87225 - estebank:cleanup, r=oli-obk
Various diagnostics clean ups/tweaks

* Always point at macros, including derive macros
* Point at non-local items that introduce a trait requirement
* On private associated item, point at definition
2021-07-19 18:44:27 +00:00
Esteban Küber
ba052bd8de Various diagnostics clean ups/tweaks
* Always point at macros, including derive macros
* Point at non-local items that introduce a trait requirement
* On private associated item, point at definition
2021-07-19 08:43:35 -07:00
Santiago Pastorino
ba1e13fa66
Revert "structural_match: non-structural-match ty closures"
Reverts #73353
2021-07-18 09:30:10 -03:00
Santiago Pastorino
000b945cea
Remove OpaqueTyOrigin::Misc, use TyAlias instead 2021-07-18 09:30:10 -03:00
Santiago Pastorino
66c9cd9e66
Remove OpaqueTyOrigin::Binding 2021-07-17 23:14:22 -03:00
jackh726
fa839b1194 Add needs_normalization 2021-07-17 16:09:22 -04:00
jackh726
d954a8ee8e Some perf optimizations and logging 2021-07-17 16:09:17 -04:00
bors
32c447e179 Auto merge of #83898 - Aaron1011:feature/hir-wf, r=estebank
Add initial implementation of HIR-based WF checking for diagnostics

During well-formed checking, we walk through all types 'nested' in
generic arguments. For example, WF-checking `Option<MyStruct<u8>>`
will cause us to check `MyStruct<u8>` and `u8`. However, this is done
on a `rustc_middle::ty::Ty`, which has no span information. As a result,
any errors that occur will have a very general span (e.g. the
definintion of an associated item).

This becomes a problem when macros are involved. In general, an
associated type like `type MyType = Option<MyStruct<u8>>;` may
have completely different spans for each nested type in the HIR. Using
the span of the entire associated item might end up pointing to a macro
invocation, even though a user-provided span is available in one of the
nested types.

This PR adds a framework for HIR-based well formed checking. This check
is only run during error reporting, and is used to obtain a more precise
span for an existing error. This is accomplished by individually
checking each 'nested' type in the HIR for the type, allowing us to
find the most-specific type (and span) that produces a given error.

The majority of the changes are to the error-reporting code. However,
some of the general trait code is modified to pass through more
information.

Since this has no soundness implications, I've implemented a minimal
version to begin with, which can be extended over time. In particular,
this only works for HIR items with a corresponding `DefId` (e.g. it will
not work for WF-checking performed within function bodies).
2021-07-16 21:54:42 +00:00
Aaron Hill
a765333738
Add initial implementation of HIR-based WF checking for diagnostics
During well-formed checking, we walk through all types 'nested' in
generic arguments. For example, WF-checking `Option<MyStruct<u8>>`
will cause us to check `MyStruct<u8>` and `u8`. However, this is done
on a `rustc_middle::ty::Ty`, which has no span information. As a result,
any errors that occur will have a very general span (e.g. the
definintion of an associated item).

This becomes a problem when macros are involved. In general, an
associated type like `type MyType = Option<MyStruct<u8>>;` may
have completely different spans for each nested type in the HIR. Using
the span of the entire associated item might end up pointing to a macro
invocation, even though a user-provided span is available in one of the
nested types.

This PR adds a framework for HIR-based well formed checking. This check
is only run during error reporting, and is used to obtain a more precise
span for an existing error. This is accomplished by individually
checking each 'nested' type in the HIR for the type, allowing us to
find the most-specific type (and span) that produces a given error.

The majority of the changes are to the error-reporting code. However,
some of the general trait code is modified to pass through more
information.

Since this has no soundness implications, I've implemented a minimal
version to begin with, which can be extended over time. In particular,
this only works for HIR items with a corresponding `DefId` (e.g. it will
not work for WF-checking performed within function bodies).
2021-07-16 16:29:02 -05:00
Guillaume Gomez
7d36d69b4a
Rollup merge of #87200 - oli-obk:fixup_fixup_opaque_types, r=nikomatsakis
TAIT: Infer all inference variables in opaque type substitutions via InferCx

The previous algorithm was correct for the example given in its
documentation, but when the TAIT was declared as a free item
instead of an associated item, the generic parameters were the
wrong ones.

cc `@spastorino`

r? `@nikomatsakis`
2021-07-16 19:54:12 +02:00
Oli Scherer
24a8d3bce3 Add some more tracing instrumentation 2021-07-16 17:34:17 +00:00
jackh726
cf001dc889 Remove failed and review comments 2021-07-15 10:58:49 -04:00
jackh726
a9f1e1c440 WIP partial apply fix 2021-07-13 10:50:40 -04:00
jackh726
c63f1fe92b Replace associated item bound vars with placeholders when projecting. 2021-07-09 00:04:47 -04:00
Guillaume Gomez
d12b16887b
Rollup merge of #86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis
Use diagnostic items instead of lang items for rfc2229 migrations

This PR removes the `Send`, `UnwindSafe` and `RefUnwindSafe` lang items introduced in https://github.com/rust-lang/rust/pull/84730, and uses diagnostic items instead to check for `Send`, `UnwindSafe` and `RefUnwindSafe` traits for RFC2229 migrations.

r? ```@nikomatsakis```
2021-07-08 18:30:33 +02:00
Aman Arora
8ef5212eff Make type_implements_trait not a query 2021-07-06 14:38:10 -04:00
bors
969a6c2481 Auto merge of #86674 - Aaron1011:new-querify-limits, r=michaelwoerister
Query-ify global limit attribute handling

Currently, we read various 'global limits' from inner attributes the crate root (`recursion_limit`, `move_size_limit`, `type_length_limit`, `const_eval_limit`). These limits are then stored in `Sessions`, allowing them to be access from a `TyCtxt` without registering a dependency on the crate root attributes.

This PR moves the calculation of these global limits behind queries, so that we properly track dependencies on crate root attributes. During the setup of macro expansion (before we've created a `TyCtxt`), we need to access the recursion limit, which is now done by directly calling into the code shared by the normal query implementations.
2021-07-05 16:30:53 +00:00
Aaron Hill
7e5a88a56c
Combine individual limit queries into single limits query 2021-07-04 13:02:51 -05:00
bors
23c652dfe3 Auto merge of #86866 - nikomatsakis:issue-84841, r=oli-obk
Hack: Ignore inference variables in certain queries

Fixes #84841
Fixes #86753

Some queries are not built to accept types with inference variables, which can lead to ICEs. These queries probably ought to be converted to canonical form, but as a quick workaround, we can return conservative results in the case that inference variables are found.

We should file a follow-up issue (and update the FIXMEs...) to do the proper refactoring.

cc `@arora-aman`

r? `@oli-obk`
2021-07-04 17:39:37 +00:00
Aaron Hill
ff15b5e2c7
Query-ify global limit attribute handling 2021-07-04 12:33:14 -05:00
Niko Matsakis
63fbefd359 tag issues with FIXME 2021-07-04 12:50:28 -04:00
Niko Matsakis
40ee019c17 allow inference vars in type_implements_trait 2021-07-04 11:28:20 -04:00
bors
d34a3a401b Auto merge of #85090 - Aaron1011:type-outlives-global, r=matthewjasper,jackh726
Return `EvaluatedToOk` when type in outlives predicate is global

A global type doesn't reference any local regions or types, so it's
guaranteed to outlive any region.
2021-07-03 22:42:58 +00:00
Yuki Okushi
884053a4b4
Remove ty::Binder::bind()
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2021-07-03 01:12:32 +09:00
Roxane
cc3af7091c Rename variable 2021-06-29 20:26:37 -04:00
Aaron Hill
1f7cb16fce
Return EvaluatedToOk when type in outlives predicate is global
A global type doesn't reference any local regions or types, so it's
guaranteed to outlive any region.
2021-06-29 19:21:13 -05:00
Roxane Fruytier
06afafd492 Use diagnostic items to check for Send, UnwindSafe and RefUnwindSafe traits 2021-06-29 17:47:57 -04:00
bors
8cb207ae69 Auto merge of #86386 - inquisitivecrystal:better-errors-for-display-traits-v3, r=estebank
Better errors for Debug and Display traits

Currently, if someone tries to pass value that does not implement `Debug` or `Display` to a formatting macro, they get a very verbose and confusing error message. This PR changes the error messages for missing `Debug` and `Display` impls to be less overwhelming in this case, as suggested by #85844. I was a little less aggressive in changing the error message than that issue proposed. Still, this implementation would be enough to reduce the number of messages to be much more manageable.

After this PR, information on the cause of an error involving a `Debug` or `Display` implementation would suppressed if the requirement originated within a standard library macro. My reasoning was that errors originating from within a macro are confusing when they mention details that the programmer can't see, and this is particularly problematic for `Debug` and `Display`, which are most often used via macros. It is possible that either a broader or a narrower criterion would be better. I'm quite open to any feedback.

Fixes #85844.
2021-06-23 03:16:04 +00:00
Taylor Yu
3252432c27 improve comments for unsized suggestions 2021-06-18 17:24:38 -05:00
Taylor Yu
69f0dc69a4 deindent unsized suggestions
Move stuff out of loops. Use early returns.
2021-06-18 17:24:35 -05:00
Taylor Yu
437b2026e1 factor out maybe_indirection_for_unsized 2021-06-18 17:19:09 -05:00
Taylor Yu
2862f08b79 factor out maybe_suggest_unsized_generics 2021-06-18 14:20:45 -05:00
Taylor Yu
ce982a35e1 debug for suggest_unsized_bound_if_applicable 2021-06-18 14:16:23 -05:00
Niko Matsakis
f6adaedd9b add various coments to explain how the code works 2021-06-18 11:44:56 -04:00
Aris Merchant
f1f1c9b25b Improve errors for missing Debug and Display impls 2021-06-16 01:13:28 -07:00
Charles Lew
a86d3a7e45 Refactor to make interpreter and codegen backend neutral to vtable internal representation. 2021-06-15 01:59:00 +08:00
bors
d59b80d588 Auto merge of #86130 - BoxyUwU:abstract_const_as_cast, r=oli-obk
const_eval_checked: Support as casts in abstract consts
2021-06-12 08:50:22 +00:00
Ellen
17cd79090e support as _ and add tests 2021-06-10 14:53:44 +01:00
Ellen
c318364d48 Add more tests + visit_ty in some places 2021-06-09 19:28:41 +01:00
Ellen
8e7299dfcd Support as casts in abstract consts 2021-06-08 08:02:16 +01:00
Santiago Pastorino
9e547b4464
Differentiate different defining uses of taits when they reference distinct generic parameters 2021-06-07 19:10:12 -03:00
Santiago Pastorino
e386373514
Remove substs from OpaqueTypeDecl, use the one in OpaqueTypeKey 2021-06-07 19:09:32 -03:00
Santiago Pastorino
5dabd55d7d
Use substs from opaque type key instead of using it from opaque_decl 2021-06-07 19:08:43 -03:00
Santiago Pastorino
37ab718350
Make opaque type map key be of type OpaqueTypeKey 2021-06-07 19:07:24 -03:00
Santiago Pastorino
7f8cad2019
Make OpaqueTypeKey the key of opaque types map 2021-06-07 19:04:52 -03:00
Santiago Pastorino
2bc723fbca
Change opaque type map to be a VecMap 2021-06-07 19:03:57 -03:00
Taylor Yu
e848be06e1 don't suggest unsized indirection in where-clauses
Skip where-clauses when suggesting using indirection in combination with
`?Sized` bounds on type parameters.
2021-06-03 17:19:57 -05:00
Camille GILLOT
0e71283495 Restrict access to crate_name.
Also remove original_crate_name, which had the exact same implementation
2021-06-02 18:35:32 +02:00
Camille Gillot
0f0f3138cb
Revert "Reduce the amount of untracked state in TyCtxt" 2021-06-01 09:05:22 +02:00
Camille GILLOT
10fb4b2fe5 Restrict access to crate_name.
Also remove original_crate_name, which had the exact same implementation
2021-05-30 19:54:04 +02:00
Niko Matsakis
128d385e56 stabilize member constraints 2021-05-26 06:01:53 -04:00
bors
ff2c947c00 Auto merge of #85481 - lcnr:const-equate, r=matthewjasper
deal with `const_evaluatable_checked` in `ConstEquate`

Failing to evaluate two constants which do not contain inference variables should not result in ambiguity.
2021-05-25 13:53:48 +00:00
bors
a7890c7952 Auto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrum
Bump bootstrap compiler to beta 1.53.0

This PR bumps the bootstrap compiler to version 1.53.0 beta, as part of our usual release process (this was supposed to be Wednesday's step, but creating the beta release took longer than expected).

The PR also includes the "Bootstrap: skip rustdoc fingerprint for building docs" commit, see the reasoning [on Zulip](https://zulip-archive.rust-lang.org/241545trelease/88450153betabootstrap.html).

r? `@Mark-Simulacrum`
2021-05-25 05:48:00 +00:00
bors
ef0ec303fa Auto merge of #85596 - scottmcm:more-on-unimplemented, r=estebank
Extend `rustc_on_implemented` to improve more `?` error messages

`_Self` could match the generic definition; this adds that functionality for matching the generic definition of type parameters too.

Your advice welcome on the wording of all these messages, and which things belong in the message/label/note.

r? `@estebank`
2021-05-24 15:24:38 +00:00
Pietro Albini
9e22b844dd remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
Scott McMurray
8be67998a1 Extend rustc_on_implemented to improve a ?-on-ControlFlow error message 2021-05-23 07:18:02 -07:00
bors
6f5a198ffc Auto merge of #85382 - Aaron1011:project-eval, r=nikomatsakis
Always produce sub-obligations when using cached projection result

See https://github.com/rust-lang/rust/issues/85360

When we skip adding the sub-obligations to the `obligation` list, we can affect whether or not the final result is `EvaluatedToOk` or `EvaluatedToOkModuloObligations`. This creates problems for incremental compilation, since the projection cache is untracked shared state.

To solve this issue, we unconditionally process the sub-obligations. Surprisingly, this is a slight performance *win* in many cases.
2021-05-21 02:39:39 +00:00
lcnr
412e0404c0 deal with const_evaluatable_checked in ConstEquate 2021-05-19 21:27:51 +02:00
Guillaume Gomez
fad04ff60e
Rollup merge of #85369 - FabianWolff:issue-84973, r=jackh726
Suggest borrowing if a trait implementation is found for &/&mut <type>

This pull request fixes #84973 by suggesting to borrow if a trait is not implemented for some type `T`, but it is for `&T` or `&mut T`. For instance:
```rust
trait Ti {}
impl<T> Ti for &T {}
fn foo<T: Ti>(_: T) {}

trait Tm {}
impl<T> Tm for &mut T {}
fn bar<T: Tm>(_: T) {}

fn main() {
    let a: i32 = 5;
    foo(a);

    let b: Box<i32> = Box::new(42);
    bar(b);
}
```
gives, on current nightly:
```
error[E0277]: the trait bound `i32: Ti` is not satisfied
  --> t2.rs:11:9
   |
3  | fn foo<T: Ti>(_: T) {}
   |           -- required by this bound in `foo`
...
11 |     foo(a);
   |         ^ the trait `Ti` is not implemented for `i32`

error[E0277]: the trait bound `Box<i32>: Tm` is not satisfied
  --> t2.rs:14:9
   |
7  | fn bar<T: Tm>(_: T) {}
   |           -- required by this bound in `bar`
...
14 |     bar(b);
   |         ^ the trait `Tm` is not implemented for `Box<i32>`

error: aborting due to 2 previous errors
```
whereas with my changes, I get:
```
error[E0277]: the trait bound `i32: Ti` is not satisfied
  --> t2.rs:11:9
   |
3  | fn foo<T: Ti>(_: T) {}
   |           -- required by this bound in `foo`
...
11 |     foo(a);
   |         ^
   |         |
   |         expected an implementor of trait `Ti`
   |         help: consider borrowing here: `&a`

error[E0277]: the trait bound `Box<i32>: Tm` is not satisfied
  --> t2.rs:14:9
   |
7  | fn bar<T: Tm>(_: T) {}
   |           -- required by this bound in `bar`
...
14 |     bar(b);
   |         ^
   |         |
   |         expected an implementor of trait `Tm`
   |         help: consider borrowing mutably here: `&mut b`

error: aborting due to 2 previous errors
```
In my implementation, I have added a "blacklist" to make these suggestions flexible. In particular, suggesting to borrow can interfere with other suggestions, such as to add another trait bound to a generic argument. I have tried to configure this blacklist to cause the least amount of test case failures, i.e. to model the current behavior as closely as possible (I only had to change one existing test case, and this change was quite clearly an improvement).
2021-05-18 14:08:55 +02:00
Alexis Bourget
b574c67b93 New rustdoc lint to respect -Dwarnings correctly
This adds a new lint to `rustc` that is used in rustdoc when a code
block is empty or cannot be parsed as valid Rust code.

Previously this was unconditionally a warning. As such some
documentation comments were (unknowingly) abusing this to pass despite
the `-Dwarnings` used when compiling `rustc`, this should not be the
case anymore.
2021-05-17 21:31:01 -04:00
Fabian Wolff
572bb13ae5 Implement jackh726's suggestions 2021-05-17 23:13:04 +02:00
bors
3396a383bb Auto merge of #85178 - cjgillot:local-crate, r=oli-obk
Remove CrateNum parameter for queries that only work on local crate

The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea.

Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-17 01:42:03 +00:00
Aaron Hill
8657bb251c
Always produce sub-obligations when using cached projection result 2021-05-16 17:18:17 -04:00
Fabian Wolff
48d07d1326 Suggest borrowing if a trait implementation is found for &/&mut <type> 2021-05-16 16:20:35 +02:00
Niko Matsakis
89c58eac68 have on_completion record subcycles
Rework `on_completion` method so that it removes all
provisional cache entries that are "below" a completed
node (while leaving those entries that are not below
the node).

This corrects an imprecise result that could in turn lead
to an incremental compilation failure. Under the old
scheme, if you had:

* A depends on...
     * B depends on A
     * C depends on...
         * D depends on C
     * T: 'static

then the provisional results for A, B, C, and D would all
be entangled. Thus, if A was `EvaluatedToOkModuloRegions`
(because of that final condition), then the result for C and
D would also be demoted to "ok modulo regions".

In reality, though, the result for C depends only on C and itself,
and is not dependent on regions. If we happen to evaluate the
cycle starting from C, we would never reach A, and hence the
result would be "ok".

Under the new scheme, the provisional results for C and D
are moved to the permanent cache immediately and are not affected
by the result of A.
2021-05-13 05:58:21 -04:00
Camille GILLOT
4e8d4bdf4b Use () for all_traits. 2021-05-12 13:58:46 +02:00
Dylan DPC
01e9d09d3b
Rollup merge of #84987 - lcnr:nits, r=Mark-Simulacrum
small nits
2021-05-07 00:38:45 +02:00
bors
377d1a984c Auto merge of #84559 - jackh726:issue-84398, r=nikomatsakis
Deduplicate ParamCandidates with the same value except for bound vars

Fixes #84398

This is kind of a hack. I wonder if we can get other types of candidates that are the same except for bound vars. This won't be a problem with Chalk, since we don't really need to know that there are two different "candidates" if they both give the same final substitution.

r? `@nikomatsakis`
2021-05-06 17:42:32 +00:00
lcnr
b9811418dd outdated comment 2021-05-06 16:27:59 +02:00
Jack Huey
c1ef0f3050
Pick candidate with fewer bound vars 2021-05-06 10:19:51 -04:00
Jack Huey
857cb4de20 Make traits with GATs not object safe 2021-04-27 14:34:23 -04:00
Jack Huey
9f0693969a Deduplicate ParamCandidates with the same value except for bound vars 2021-04-25 15:11:49 -04:00
Dylan DPC
2f438e31f5
Rollup merge of #84343 - camsteffen:closure-tree, r=varkor
Remove `ScopeTree::closure_tree`

Seems to be dead code since #50649.
2021-04-22 18:14:32 +02:00
Cameron Steffen
c9c14d0c1f Small refactor 2021-04-19 15:40:21 -05:00
klensy
f43ee8ebf6 fix few typos 2021-04-19 15:57:08 +03:00
teymour-aldridge
567de4a202 Improve an error message. 2021-04-18 20:38:23 +01:00
Dylan DPC
74b23f9d11
Rollup merge of #83980 - pierwill:fix-compiler-librustc-names, r=davidtwco
Fix outdated crate names in compiler docs

Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.
2021-04-08 20:29:58 +02:00
pierwill
0019ca9141 Fix outdated crate names in compiler docs
Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.

Also fix incorrect file paths.
2021-04-08 11:12:14 -05:00
Dylan DPC
a113240b91
Rollup merge of #83689 - estebank:cool-bears-hot-tip, r=davidtwco
Add more info for common trait resolution and async/await errors

* Suggest `Pin::new`/`Box::new`/`Arc::new`/`Box::pin` in more cases
* Point at `impl` and type defs introducing requirements on E0277
2021-04-08 01:01:43 +02:00
Esteban Küber
60c7f37f7c Add spans to E0277 for impl/trait type/fn obligation disparity 2021-04-06 19:55:45 -07:00
Esteban Küber
2375b8ae7e review comments 2021-04-06 19:55:45 -07:00
Esteban Küber
8bc5581978 Point at impl and type defs introducing requirements on E0277 2021-04-06 19:55:44 -07:00