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 15 pull requests #81437

Closed
wants to merge 40 commits into from
Closed

Rollup of 15 pull requests #81437

wants to merge 40 commits into from

Conversation

jonas-schievink
Copy link
Contributor

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

johanngan and others added 30 commits January 10, 2021 01:18
This already happens with should_panic tests without an expected
message. This commit fixes should_panic tests with an expected message
to have the same behavior.
Prevents LateContext::maybe_typeck_results() from returning data in a
nested item without a body. Consequently, LateContext::qpath_res is less
likely to ICE when called in a nested item. Would have prevented
rust-lang/rust-clippy#4545, presumably.
Actually fulfills the documented guarantees.
Following traits are now diagnostic items:
- `From` (unchanged)
- `Into`
- `TryFrom`
- `TryInto`

This also adds symbols for those items:
- `into_trait`
- `try_from_trait`
- `try_into_trait`
- Add the module name to `pre_AST_expansion_passes` and don't make it a
  verbose event (since it normally doesn't take very long, and it's
  emitted many times)
- Don't make the following rustdoc events verbose; they're emitted many times.
  + build_extern_trait_impl
  + build_local_trait_impl
  + build_primitive_trait_impl
  + get_auto_trait_impls
  + get_blanket_trait_impls
- Remove `get_auto_trait_and_blanket_synthetic_impls`; it's wholly
  covered by get_{auto,blanket}_trait_impls and not very useful.
Add expected error

Add comment

Tweak comment wording

Fix after rebase to updated master

Fix after rebase to updated master

Distinguish mutation in normal and move closures

Tweak error message

Fix error message for nested closures

Refactor code showing mutated upvar in closure

Remove debug assert

B
…r=m-ou-se

Stabilize `Seek::stream_position` (feature `seek_convenience`)

Tracking issue: #59359

Unresolved questions from tracking issue:
- "Override `stream_len` for `File`?" → we can do that in the future, this does not block stabilization.
- "Rename to `len` and `position`?" → as noted in the tracking issue, both of these shorter names have problems (`len` is usually a cheap getter, `position` clashes with `Cursor`). I do think the current names are perfectly fine.
- "Rename `stream_position` to `tell`?" → as mentioned in [the comment bringing this up](#59359 (comment)), `stream_position` is more descriptive. I don't think `tell` would be a good name.

What remains to decide, is whether or not adding these methods is worth it.
Refractor a few more types to `rustc_type_ir`

In the continuation of #79169, ~~blocked on that PR~~.

This PR:
 - moves `IntVarValue`, `FloatVarValue`, `InferTy` (and friends) and `Variance`
 - creates the `IntTy`, `UintTy` and `FloatTy` enums in `rustc_type_ir`, based on their `ast` and `chalk_ir` equilavents, and uses them for types in the rest of the compiler.

~~I will split up that commit to make this easier to review and to have a better commit history.~~
EDIT: done, I split the PR in commits of 200-ish lines each

r? ``@nikomatsakis`` cc ``@jackh726``
…m-ou-se

Print failure message on all tests that should panic, but don't

Fixes #80861. Tests with the `#[should_panic]` attribute should always print a failure message if no panic occurs, regardless of whether or not an `expected` panic message is specified.
…ikomatsakis

Improve diagnostics for Precise Capture

This is just the capture analysis part and borrow checker logging will updated as part of rust-lang/project-rfc-2229#8

Closes rust-lang/project-rfc-2229#22
Point to span of upvar making closure FnMut

For #80313.
Improve safety of `LateContext::qpath_res`

This is my first rustc code change, inspired by hacking on clippy!

The first change is to clear cached `TypeckResults` from `LateContext` when visiting a nested item. I took a hint from [here](https://github.com/rust-lang/rust/blob/5e91c4ecc09312d8b63d250a432b0f3ef83f1df7/compiler/rustc_privacy/src/lib.rs#L1300).

Clippy has a `qpath_res` util function to avoid a possible ICE in `LateContext::qpath_res`. But the docs of `LateContext::qpath_res` promise no ICE. So this updates the `LateContext` method to keep its promises, and removes the util function.

Related: rust-lang/rust-clippy#4545

CC ````````@eddyb```````` since you've done related work
CC ````````@flip1995```````` FYI
Make more traits of the From/Into family diagnostic items

Following traits are now diagnostic items:
- `From` (unchanged)
- `Into`
- `TryFrom`
- `TryInto`

This also adds symbols for those items:
- `into_trait`
- `try_from_trait`
- `try_into_trait`

Related: rust-lang/rust-clippy#6620 (comment)
Make `-Z time-passes` less noisy

- Add the module name to `pre_AST_expansion_passes` and don't make it a
  verbose event (since it normally doesn't take very long, and it's
  emitted many times)
- Don't make the following rustdoc events verbose; they're emitted many times.
  + build_extern_trait_impl
  + build_local_trait_impl
  + build_primitive_trait_impl
  + get_auto_trait_impls
  + get_blanket_trait_impls
- Remove the `get_auto_trait_and_blanket_synthetic_impls` rustdoc event; it's wholly
  covered by get_{auto,blanket}_trait_impls and not very useful.

I found this while working on #81275 but it's independent of those changes.
Fuse inner iterator in FlattenCompat and improve related tests

Fixes #81248
codegen: assume constants cannot fail to evaluate

#80579 landed, so we can finally remove this old hack from codegen and instead assume that consts never fail to evaluate. :)

r? ``````@oli-obk``````
clean up some const error reporting around promoteds

These are some error reporting simplifications enabled by #80579.

Further simplifications are possible but could be blocked on making `const_err` a hard error.

r? ```@oli-obk```
combine: stop eagerly evaluating consts

`super_relate_consts` eagerly evaluates constants which doesn't seem too great.

I now also finally understand why all of the unused substs test passed. The reason being
that we just evaluated the constants in `super_relate_consts` 😆

While this change isn't strictly necessary as evaluating consts here doesn't hurt, it still feels a lot cleaner to do it this way

r? ``@oli-obk`` ``@nikomatsakis``
Improve URLs handling

Fixes #81330.

Explanations: before this PR, when emptying the search input, we still had `?search=` in the URL, which wasn't very nice. Now, if the search is empty, we drop the `?search=` part.

Also, I realized while working on this PR that when we clicked on a menu link when we were on the search results, the search parameters would look like: `?search=#the-anchor`, which was super weird. Now, it looks like this: `?search=the-search#the-anchor`.

Also, I didn't use the `Url` very nice API because it's not available in any IE version (sadness...).

cc ``@lzutao``
r? ``@Nemo157``
add const_evaluatable_checked test

cc ``@oli-obk``
@rustbot rustbot added the rollup A PR which is a rollup label Jan 27, 2021
@jonas-schievink
Copy link
Contributor Author

@bors r+ rollup=never p=15

@bors
Copy link
Contributor

bors commented Jan 27, 2021

📌 Commit 2ae3263 has been approved by jonas-schievink

@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 Jan 27, 2021
@bors
Copy link
Contributor

bors commented Jan 27, 2021

⌛ Testing commit 2ae3263 with merge d774a56ba945d5a6509d9c7858e9eef2eebcbc92...

@bors
Copy link
Contributor

bors commented Jan 27, 2021

💥 Test timed out

@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 Jan 27, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

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.

None yet