]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514
authorDylan DPC <dylan.dpc@gmail.com>
Sun, 14 Feb 2021 15:54:45 +0000 (16:54 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Feb 2021 15:54:45 +0000 (16:54 +0100)
commit641c3785dc875744fae75d5c1db12708a819e235
treec9fd4f4f525aaa389a6bba57dcaa061e181ed8e5
parente3b2655c3a37b9655cca934c475672517297b42f
parentbe4ea06643a5bd4ff3cb91efdaafd7acb070cb30
Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514

[rustdoc-json] Make `header` a vec of modifiers, and FunctionPointer consistent

Bumps version number and adds tests, this is a breaking change. I can split this into two (`is_unsafe` -> `header` and `header: Vec<Modifiers>`) if desired.

Rationale: Modifiers are individual notes on a function, it makes more sense for them to be a list of an independent enum over a String which is inconsistently exposing the HIR representation (prefix_str vs custom literals).
Function pointers currently only support `unsafe`, but there has been talk on and off about allowing them to also support `const`, and this makes handling their modifiers consistent with handling those of a function, allowing better shared code.

`@rustbot` modify labels: +A-rustdoc-json +T-rustdoc
CC: `@HeroicKatora`
r? `@jyn514`
src/librustdoc/json/conversions.rs
src/rustdoc-json-types/lib.rs