Commit graph

137146 commits

Author SHA1 Message Date
Aman Arora 0f4bab246b Fixme for closure origin when reborrow is implemented 2021-01-29 16:25:01 -05:00
Aman Arora fadf03ee1b Fix typos 2021-01-29 16:01:27 -05:00
Aman Arora ffd53277dc Add fixme for precise path diagnostics 2021-01-29 15:37:44 -05:00
Aman Arora c748f32ee4 Fix incorrect use mut diagnostics 2021-01-29 15:37:44 -05:00
Aman Arora 604cbdcfdd Fix unused 'mut' warning for capture's root variable 2021-01-29 15:37:42 -05:00
Aman Arora 0897db5609 Test for restricting capture precision 2021-01-29 15:37:41 -05:00
Aman Arora 1373f988fa Test cases for handling mutable references 2021-01-29 15:37:41 -05:00
Aman Arora 3488082582 Compute mutability of closure captures
When `capture_disjoint_fields` is not enabled, checking if the root variable
binding is mutable would suffice.

However with the feature enabled, the captured place might be mutable
because it dereferences a mutable reference.

This PR computes the mutability of each capture after capture analysis
in rustc_typeck. We store this in `ty::CapturedPlace` and then use
`ty::CapturedPlace::mutability` in mir_build and borrow_check.
2021-01-29 15:37:40 -05:00
Aman Arora b421cd56d9 Restrict precision of captures with capture_disjoint_fields set
- No Derefs in move closure, this will result in value behind a reference getting moved.
- No projections are applied to raw pointers, since these require unsafe blocks. We capture
  them completely.

Motivations for these are recorded here: https://hackmd.io/71qq-IOpTNqzMkPpAI1dVg?view
2021-01-29 15:37:05 -05:00
bors b122908617 Auto merge of #81470 - tmiasko:remove-allocations, r=matthewjasper
Avoid memory allocation when removing dead blocks

Use `reachable_as_bitset` to reuse a bitset from the traversal rather
than allocating it seprately. Additionally check if there are any
unreachable blocks before proceeding.
2021-01-29 13:10:09 +00:00
bors c4e33b51c1 Auto merge of #81419 - rylev:canocalize-extern-entries, r=petrochenkov
Pre-canoncalize ExternLocation::ExactPaths

This stores pre-canacolized paths inside `ExternLocation::ExactPaths` so that we don't need to canoncalize them every time we want to compare them to source lib paths.

This is related to #81414.
2021-01-29 10:11:16 +00:00
Ryan Levick 6c7ecd007f Pre-canoncalize ExternLocation::ExactPaths 2021-01-29 11:02:12 +01:00
bors 099f27b6cb Auto merge of #81440 - tmiasko:always-live-locals, r=matthewjasper
Visit only statements in always live locals

No functional changes intended.
2021-01-29 06:56:29 +00:00
bors c6bc46227a Auto merge of #81073 - ssomers:btree_owned_root_vs_dying, r=Mark-Simulacrum
BTreeMap: prevent tree from ever being owned by non-root node

This introduces a new marker type, `Dying`, which is used to note trees which are in the process of deallocation. On such trees, some fields may be in an inconsistent state as we are deallocating the tree. Unfortunately, there's not a great way to express conditional unsafety, so the methods for traversal can cause UB if not invoked correctly, but not marked as such. This is not a regression from the previous state, but rather isolates the destructive methods to solely being called on the dying state.
2021-01-29 04:06:38 +00:00
bors 74500b9978 Auto merge of #81493 - JohnTitor:rollup-sa4m4zh, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #79570 (rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`)
 - #79819 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint)
 - #79991 (rustdoc: Render HRTB correctly for bare functions)
 - #80215 (Use -target when linking binaries for Mac Catalyst)
 - #81158 (Point to span of upvar making closure FnMut)
 - #81176 (Improve safety of `LateContext::qpath_res`)
 - #81287 (Split rustdoc JSON types into separately versioned crate)
 - #81306 (Fuse inner iterator in FlattenCompat and improve related tests)
 - #81333 (clean up some const error reporting around promoteds)
 - #81459 (Fix rustdoc text selection for page titles)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-29 00:58:43 +00:00
Yuki Okushi 2b4fa3d211
Rollup merge of #81459 - probablykasper:text-selection-fix, r=Nemo157
Fix rustdoc text selection for page titles

Fixes text selection of page titles by placing the `h1.fqn span.in-band` element before `h1.fqn span.out-of-band`.

Before vs after:
https://user-images.githubusercontent.com/11315492/105768203-55708700-5f5c-11eb-924b-4e7527ffe147.mp4

Retry of PR #81397 due to merge conflicts confusing me. Recreated the same changes as in that PR, but now when I run `./x.py doc library/std`, no changes I make to `src/librustdoc/html/render/mod.rs` to the file are reflected in the built doc files, even if I delete the `build` folder. I'm guessing there's some cache I'm missing?

r? `@Nemo157`
2021-01-29 09:17:40 +09:00
Yuki Okushi 046a414c19
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
clean up some const error reporting around promoteds

These are some error reporting simplifications enabled by https://github.com/rust-lang/rust/pull/80579.

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

r? ``````@oli-obk``````
2021-01-29 09:17:38 +09:00
Yuki Okushi 94e093ab97
Rollup merge of #81306 - SkiFire13:fuse-flatten, r=cuviper
Fuse inner iterator in FlattenCompat and improve related tests

Fixes #81248
2021-01-29 09:17:36 +09:00
Yuki Okushi 788036df28
Rollup merge of #81287 - CraftSpider:json-crate, r=jyn514,GuillaumeGomez
Split rustdoc JSON types into separately versioned crate

For now just an in-tree change.

In the future, this may be exposed as a standalone crate with standard semver.
2021-01-29 09:17:34 +09:00
Yuki Okushi 0c5fccea22
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
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](5e91c4ecc0/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
2021-01-29 09:17:32 +09:00
Yuki Okushi 4283623bc0
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
Point to span of upvar making closure FnMut

For #80313.
2021-01-29 09:17:31 +09:00
Yuki Okushi a3c060c7f5
Rollup merge of #80215 - visigoth:issue-80202-fix, r=estebank
Use -target when linking binaries for Mac Catalyst

When running `rustc` with `-target x86_64-apple-ios-macabi`, the linker
eventually gets run with `-arch x86_64`, because the linker back end splits the
LLVM target triple and uses the first token as the target architecture. However,
this does not work for the Mac Catalyst ABI, which is a separate target from
Darwin.

Specifying the full target triple with `-target` allows Mac Catalyst binaries to
link and run.

closes #80202
2021-01-29 09:17:29 +09:00
Yuki Okushi 3eac643d04
Rollup merge of #79991 - camelid:rustdoc-for-lifetime, r=GuillaumeGomez,jyn514
rustdoc: Render HRTB correctly for bare functions

The angle brackets were not rendered, so code like this:

    some_func: for<'a> fn(val: &'a i32) -> i32

would be rendered as:

    some_func: fn'a(val: &'a i32) -> i32

However, rendering with angle brackets is still invalid syntax:

    some_func: fn<'a>(val: &'a i32) -> i32

so now it renders correctly as:

    some_func: for<'a> fn(val: &'a i32) -> i32

-----

However, note that this code:

    some_trait: dyn for<'a> Trait<'a>

will still render as:

    some_trait: dyn Trait<'a>

which is not invalid syntax, but is still unclear. Unfortunately I think
it's hard to fix that case because there isn't enough information in the
`rustdoc::clean::Type` that this code operates on. Perhaps that case can
be fixed in a later PR.

r? ``@jyn514``
2021-01-29 09:17:27 +09:00
Yuki Okushi 4003a73975
Rollup merge of #79819 - Aaron1011:feature/macro-trailing-semicolon, r=petrochenkov
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint

cc #79813

This PR adds an allow-by-default future-compatibility lint
`SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
macro body is ignored due to the macro being used in expression
position:

```rust
macro_rules! foo {
    () => {
        true; // WARN
    }
}

fn main() {
    let val = match true {
        true => false,
        _ => foo!()
    };
}
```

The lint takes its level from the macro call site, and
can be allowed for a particular macro by adding
`#[allow(macro_trailing_semicolon)]`.

The lint is set to warn for all internal rustc crates (when being built
by a stage1 compiler). After the next beta bump, we can enable
the lint for the bootstrap compiler as well.
2021-01-29 09:17:26 +09:00
Yuki Okushi d9e56f48c5
Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3
rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`

This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361
2021-01-29 09:17:20 +09:00
bors b05fd2a15d Auto merge of #81388 - bjorn3:wasm_bindgen_fix, r=nikomatsakis
Fix abi for wasm-bindgen

Hopefully fixes https://github.com/rust-lang/rust/issues/81386. `@alexcrichton` can you confirm this fixes wasm-bindgen?

r? `@alexcrichton`
2021-01-28 22:01:42 +00:00
bors c0b64d97be Auto merge of #81055 - matthewjasper:non-fatal-overflow, r=nikomatsakis
Make hitting the recursion limit in projection non-fatal

This change was originally made in #80246 to avoid future (effectively) infinite loop bugs in projections,
but wundergraph relies on rustc recovering here.

cc #80953

r? `@nikomatsakis`
2021-01-28 18:57:10 +00:00
Alex Crichton a124043fb0 rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo
This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361
2021-01-28 08:51:11 -08:00
Rune Tynan 3aa8456c88
Fix README typo 2021-01-28 11:15:43 -05:00
bors bf193d69fe Auto merge of #81441 - tmiasko:ctfe-inline, r=oli-obk
Try inlining trivial functions used by CTFE

r? `@ghost`
2021-01-28 15:19:16 +00:00
Aaron Hill f9025512e7
Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS lint
cc #79813

This PR adds an allow-by-default future-compatibility lint
`SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
macro body is ignored due to the macro being used in expression
position:

```rust
macro_rules! foo {
    () => {
        true; // WARN
    }
}

fn main() {
    let val = match true {
        true => false,
        _ => foo!()
    };
}
```

The lint takes its level from the macro call site, and
can be allowed for a particular macro by adding
`#[allow(semicolon_in_expressions_from_macros)]`.

The lint is set to warn for all internal rustc crates (when being built
by a stage1 compiler). After the next beta bump, we can enable
the lint for the bootstrap compiler as well.
2021-01-28 08:51:43 -05:00
bors 643a79af3d Auto merge of #81149 - Aaron1011:feature/better-no-method-found-err, r=estebank
Avoid describing a method as 'not found' when bounds are unsatisfied

Fixes #76267

When there is a single applicable method candidate, but its trait bounds
are not satisfied, we avoid saying that the method is "not found".
Insted, we update the error message to directly mention which bounds are
not satisfied, rather than mentioning them in a note.
2021-01-28 12:09:50 +00:00
bors 0e190206e2 Auto merge of #81461 - JohnTitor:rollup-b0ij25f, r=JohnTitor
Rollup of 13 pull requests

Successful merges:

 - #70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`))
 - #79951 (Refractor a few more types to `rustc_type_ir` )
 - #80868 (Print failure message on all tests that should panic, but don't)
 - #81062 (Improve diagnostics for Precise Capture)
 - #81277 (Make more traits of the From/Into family diagnostic items)
 - #81284 (Make `-Z time-passes` less noisy)
 - #81379 (Improve URLs handling)
 - #81416 (Tweak suggestion for missing field in patterns)
 - #81426 (const_evaluatable: expand abstract consts in try_unify)
 - #81428 (compiletest: Add two more unit tests)
 - #81430 (add const_evaluatable_checked test)
 - #81433 (const_evaluatable: stop looking into type aliases)
 - #81445 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-28 09:01:33 +00:00
Yuki Okushi f3dfbfc8f5
Rollup merge of #81445 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in 783bc43c660bf39c1e562c8c429b32078ad3099b..c3abcfe8a75901c7c701557a728941e8fb19399e
2021-01-20 19:02:26 +0000 to 2021-01-25 16:16:43 +0000
- Minor update to tracking issue template. (rust-lang/cargo#9097)
- Add some extra help to `cargo new` and invalid package names. (rust-lang/cargo#9098)
- Fix compilation with serde 1.0.122 (rust-lang/cargo#9102)
- Add suggestion for bad package id. (rust-lang/cargo#9095)
- Remove Registry::new. (rust-lang/cargo#9093)
- Fix: set default git config search path for tests (rust-lang/cargo#9035)
- Unstable updates (rust-lang/cargo#9092)
2021-01-28 15:09:22 +09:00
Yuki Okushi d98fcbd561
Rollup merge of #81433 - lcnr:stop-looking-into-ty-alias, r=oli-obk
const_evaluatable: stop looking into type aliases

see https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const_evaluatable.3A.20type.20alias

r? ````@oli-obk````
2021-01-28 15:09:20 +09:00
Yuki Okushi 76548bacb6
Rollup merge of #81430 - lcnr:elaborate-const-eval, r=oli-obk
add const_evaluatable_checked test

cc `````@oli-obk`````
2021-01-28 15:09:18 +09:00
Yuki Okushi d56360d495
Rollup merge of #81428 - phansch:compiletest-tests, r=Mark-Simulacrum
compiletest: Add two more unit tests

This adds two more unit tests and fixes spelling in `compiletest`.
2021-01-28 15:09:17 +09:00
Yuki Okushi f183e5f04c
Rollup merge of #81426 - BoxyUwU:boxychangesv2, r=oli-obk
const_evaluatable: expand abstract consts in try_unify

See this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/combining.20const.20bounds) for more info

cc ```@lcnr```
r? ```@oli-obk```
2021-01-28 15:09:15 +09:00
Yuki Okushi b8eac50ff5
Rollup merge of #81416 - estebank:suggestion-span-tweak, r=petrochenkov
Tweak suggestion for missing field in patterns

Account for parser recovered struct and tuple patterns to avoid invalid
suggestion.

Follow up to #81103.
2021-01-28 15:09:13 +09:00
Yuki Okushi 0b1870e7b9
Rollup merge of #81379 - GuillaumeGomez:improve-urls, r=Nemo157
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`````
2021-01-28 15:09:12 +09:00
Yuki Okushi bb6d1d3086
Rollup merge of #81284 - jyn514:impl-times, r=wesleywiser
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 https://github.com/rust-lang/rust/pull/81275 but it's independent of those changes.
2021-01-28 15:09:10 +09:00
Yuki Okushi 70be5cef69
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
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: https://github.com/rust-lang/rust-clippy/pull/6620#discussion_r562482587
2021-01-28 15:09:08 +09:00
Yuki Okushi 84ad95be70
Rollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=nikomatsakis
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
2021-01-28 15:09:06 +09:00
Yuki Okushi 98226638fd
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=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.
2021-01-28 15:09:04 +09:00
Yuki Okushi 446edd1e1a
Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis
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`````
2021-01-28 15:09:02 +09:00
Yuki Okushi 025a850d21
Rollup merge of #70904 - LukasKalbertodt:stabilize-seek-convenience, 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](https://github.com/rust-lang/rust/issues/59359#issuecomment-559541545), `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.
2021-01-28 15:09:00 +09:00
Camelid cd8dceef86 rustdoc: Render HRTB correctly for bare functions
The angle brackets were not rendered, so code like this:

    some_func: for<'a> fn(val: &'a i32) -> i32

would be rendered as:

    some_func: fn'a(val: &'a i32) -> i32

However, rendering with angle brackets is still invalid syntax:

    some_func: fn<'a>(val: &'a i32) -> i32

so now it renders correctly as:

    some_func: for<'a> fn(val: &'a i32) -> i32

-----

However, note that this code:

    some_trait: dyn for<'a> Trait<'a>

will still render as:

    some_trait: dyn Trait<'a>

which is not invalid syntax, but is still unclear. Unfortunately I think
it's hard to fix that case because there isn't enough information in the
`rustdoc::clean::Type` that this code operates on. Perhaps that case can
be fixed in a later PR.
2021-01-27 19:55:46 -08:00
Kasper 74f26a1e62 Fix rustdoc page title text selection 2021-01-28 04:42:27 +01:00
bors e32f372c42 Auto merge of #81414 - rylev:fetch-rmeta-crates, r=petrochenkov
Check for rmeta crates when getting existing crates from cache

This change makes sure to check for rmeta files when resolving crates instead of always going to disk in that case.
2021-01-28 01:29:47 +00:00
Tomasz Miąsko dc6ec3596b Avoid memory allocation when removing dead blocks
Use `reachable_as_bitset` to reuse a bitset from the traversal rather
than allocating it seprately. Additionally check if there are any
unreachable blocks before proceeding.
2021-01-28 00:00:00 +00:00