Commit Graph

200027 Commits

Author SHA1 Message Date
Michael Howell
b96322801e rustdoc: remove no-op CSS .search-results .result-name > span
The rule `display: inline-block` was added in
5afa52bc7d.
The `margin: 0` and `font-weight: normal` were added in
c01bd560e2.

Both seem to have been added to override class-based rules that were
targetted at method sections. See
<c01bd560e2/src/librustdoc/html/static/rustdoc.css (L140-L148)>
for an example. The selectors that these were meant to override were changed
in a8318e420d and
76a3b609d0 to be more specific, so they no
longer need to be overridden.
2022-09-12 14:04:11 -07:00
Daniel Paoliello
3c184db386 Fix raw-dylib with link_name 2022-09-12 14:03:19 -07:00
Guillaume Gomez
031a2f85a5
Rollup merge of #101735 - notriddle:notriddle/backslash-escaped-html, r=GuillaumeGomez
rustdoc: fix treatment of backslash-escaped HTML

Try generating HTML for this markup:

    \<a href="https://example.com">example</a>

It will produce text, not HTML, in both rustdoc's real HTML output and in the commonmark reference implementation:

https://spec.commonmark.org/dingus/?text=%5C%3Ca%20href%3D%22https%3A%2F%2Fexample.com%22%3Eexample%3C%2Fa%3E
2022-09-12 22:47:18 +02:00
Guillaume Gomez
ac92cc861c
Rollup merge of #101732 - Nemo157:gate-rustdoc-missing-examples, r=GuillaumeGomez
Feature gate the `rustdoc::missing_doc_code_examples` lint

Moves the lint from being implicitly active on nightly `rustdoc` to requiring a feature to activate, like other unstable lints.

Uses the new tracking issue https://github.com/rust-lang/rust/issues/101730
2022-09-12 22:47:18 +02:00
Guillaume Gomez
05a267fd84
Rollup merge of #101731 - notriddle:notriddle/more-improved-html-check, r=GuillaumeGomez
rustdoc: improve rustdoc HTML suggestions handling of nested generics

Based on some poor suggestions produced when stablizing this lint and running it on `manformed-generics.rs` in #101720
2022-09-12 22:47:17 +02:00
Guillaume Gomez
bbe23e86ec
Rollup merge of #101724 - fee1-dead-contrib:triage-const-hack, r=oli-obk
Allow unauthenticated users to add the `const-hack` label

Observed in #101401.

cc ```@oli-obk```
2022-09-12 22:47:16 +02:00
Guillaume Gomez
8dc4b26b60
Rollup merge of #101723 - lukas-code:await-diag, r=compiler-errors
Impove diagnostic for `.await`ing non-futures

Strip leading whitespace from the span and use a non-verbose suggestion.
fixes #101715
2022-09-12 22:47:15 +02:00
Guillaume Gomez
57273313ae
Rollup merge of #101677 - winxpqq955:issue-101211, r=fee1-dead
Add test for #101211

Closes #101211
2022-09-12 22:47:14 +02:00
Guillaume Gomez
7fc3183520
Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk
constify some `CStr` methods

This PR marks the following public APIs as `const`:
```rust
impl CStr {
    // feature(const_cstr_from_bytes)
    pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError>;
    pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>;

    // feature(const_cstr_to_bytes)
    pub const fn to_bytes(&self) -> &[u8];
    pub const fn to_bytes_with_nul(&self) -> &[u8];
    pub const fn to_str(&self) -> Result<&str, str::Utf8Error>;
}
```

r? ```@oli-obk``` (use of `const_eval_select` :P )
cc ```@mina86``` (you've asked for this <3 )
2022-09-12 22:47:14 +02:00
Guillaume Gomez
b7504d6f4f
Rollup merge of #100185 - compiler-errors:issue-100183, r=wesleywiser
Fix `ReErased` leaking into typeck due to `typeof(...)` recovery

Fixes #100183
2022-09-12 22:47:13 +02:00
Michael Howell
29f789ffdc rustdoc: fix treatment of backslash-escaped HTML
Try generating HTML for this markup:

    \<a href="https://example.com">example</a>

It will produce text, not HTML, in both rustdoc's real HTML output and in
the commonmark reference implementation:

https://spec.commonmark.org/dingus/?text=%5C%3Ca%20href%3D%22https%3A%2F%2Fexample.com%22%3Eexample%3C%2Fa%3E
2022-09-12 12:48:22 -07:00
bors
fa6ee93752 Auto merge of #101729 - oli-obk:miriup, r=oli-obk
Update miri submodule

r? `@ghost`

fixes #101649
2022-09-12 19:34:30 +00:00
Wim Looman
72cf46aa72
Feature gate the rustdoc::missing_doc_code_examples lint 2022-09-12 21:20:24 +02:00
Guillaume Gomez
c4559ebfde
Improve Attribute doc methods 2022-09-12 21:18:59 +02:00
Michael Howell
84ca399465 rustdoc: improve rustdoc HTML suggestions handling of nested generics
Based on some poor suggestions produced when stablizing this lint and running
it on `manformed-generics.rs`
2022-09-12 11:11:37 -07:00
Wim Looman
fd1a399c4f
Allow tool-lints to specify a feature-gate too 2022-09-12 20:08:58 +02:00
Markus Reiter
14230a7f8e
Simplify clippy fix. 2022-09-12 19:46:51 +02:00
Oli Scherer
cccd99c976 Update miri submodule 2022-09-12 17:19:31 +00:00
Markus Reiter
8c78400c54
Fix clippy. 2022-09-12 19:04:17 +02:00
Markus Reiter
d01498a902
Add rustc_diagnostic_item for IP addresses. 2022-09-12 19:04:17 +02:00
Markus Reiter
f7e8ba28a4
Flatten net module again. 2022-09-12 19:04:17 +02:00
Markus Reiter
a1e4a339ed
Move net::parser into net::addr module. 2022-09-12 19:04:17 +02:00
Markus Reiter
65003fd4e3
Add tests for SockAddr Display. 2022-09-12 19:04:16 +02:00
Markus Reiter
96b44f6f65
Use DisplayBuffer for socket addresses. 2022-09-12 19:04:16 +02:00
bors
52e003a6e9 Auto merge of #99334 - NiklasJonsson:84447/error-privacy, r=oli-obk
rustc_error, rustc_private: Switch to stable hash containers

Relates https://github.com/rust-lang/rust/issues/84447
2022-09-12 15:57:37 +00:00
fee1-dead
91398912d0
Allow unauthenticated users to add the const-hack label 2022-09-12 23:04:32 +08:00
Lukas Markeffsky
2b7fb8d941 Impove diagnostic for .await-ing non-futures 2022-09-12 16:54:25 +02:00
Nixon Enraght-Moony
fdf7ec8694 Rustdoc-Json: Fix Type docs.
Primitive doesn't include Array/Slice/Tuple, as they are their own
variants.

ResolvedPath doesn't include Traits, as they appear in the DynTrait
variant.
2022-09-12 14:56:04 +01:00
Daniil Belov
ffa83596fe change rlib format to discern native dependencies 2022-09-12 16:45:03 +03:00
bors
7f115e3cd2 Auto merge of #101716 - Dylan-DPC:rollup-ayvh6nd, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #100293 (Add inline-llvm option for disabling/enabling LLVM inlining)
 - #100767 (Remove manual <[u8]>::escape_ascii)
 - #101668 (Suggest pub instead of public for const type item)
 - #101671 (Fix naming format of IEEE 754 standard)
 - #101676 (Check that the types in return position `impl Trait` in traits are well-formed)
 - #101681 (Deny return-position `impl Trait` in traits for object safety)
 - #101693 (Update browser UI test 0 10)
 - #101701 (Rustdoc-Json: Add tests for trait impls.)
 - #101706 (rustdoc: remove no-op `#search`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-12 13:16:14 +00:00
Maybe Waffle
cb02b647dc constify CStr methods 2022-09-12 16:29:12 +04:00
Dylan DPC
9bf89e7218
Rollup merge of #101706 - notriddle:notriddle/search-mobile, r=GuillaumeGomez
rustdoc: remove no-op `#search`

The margin rule was added in c729e4dca7 to remove an unnecessary left margin that was present on desktop. This desktop-mode margin was itself removed in 135281ed15.

The padding rule was added in 135281ed15 when converting the rule for `#main`, but didn't do anything even then.
2022-09-12 15:21:36 +05:30
Dylan DPC
228a8bd168
Rollup merge of #101701 - aDotInTheVoid:rdj-impl-tests, r=GuillaumeGomez
Rustdoc-Json: Add tests for trait impls.
2022-09-12 15:21:35 +05:30
Dylan DPC
8ef557d343
Rollup merge of #101693 - GuillaumeGomez:update-browser-ui-test-0-10, r=notriddle
Update browser UI test 0 10

The biggest change from this browser-ui-test update is the upgrade of the puppeteer version to `17.1.3` (the latest in short).

I also added the command `click-with-offset` to still allow us to click on the `[-]` part.

cc `@jsha`
r? `@notriddle`
2022-09-12 15:21:34 +05:30
Dylan DPC
6bacb6f6e9
Rollup merge of #101681 - compiler-errors:rpitit-obj-safety, r=lcnr
Deny return-position `impl Trait` in traits for object safety

Fixes #101667
2022-09-12 15:21:33 +05:30
Dylan DPC
5faf033f62
Rollup merge of #101676 - compiler-errors:rpitit-wf, r=lcnr
Check that the types in return position `impl Trait` in traits are well-formed

This effectively duplicates `check_associated_type_bounds`, but that shouldn't be for long, since we're going to remove it once we refactor RPITITs into regular associated items.

Fixes #101663

---

We don't check

```rust
trait Foo {
  fn bar() -> impl ?Sized;
}
```

currently, but that's for a different reason, which is that we don't currently check that a trait function's return type is sized (i.e. `fn bar() -> [u8]` also works in a trait).
2022-09-12 15:21:33 +05:30
Dylan DPC
10af4fb530
Rollup merge of #101671 - LingMan:ieee_754, r=Dylan-DPC
Fix naming format of IEEE 754 standard

Currently the documentation of f64::min refers to "IEEE-754 2008" while the documentation of f64::minimum refers to "IEEE 754-2019".
Note that one has the format IEEE,hyphen,number,space,year while the other is IEEE,space,number,hyphen,year. The official IEEE site [1] uses the later format and it is also the one most commonly used throughout the codebase.

Update all comments and - more importantly - documentation to consistently use the official format.

[1] https://standards.ieee.org/ieee/754/4211/
2022-09-12 15:21:32 +05:30
Dylan DPC
d7bad03cab
Rollup merge of #101668 - chenyukang:fix-101626, r=TaKO8Ki
Suggest pub instead of public for const type item

Fixes #101626
2022-09-12 15:21:31 +05:30
Dylan DPC
93177758fc
Rollup merge of #100767 - kadiwa4:escape_ascii, r=jackh726
Remove manual <[u8]>::escape_ascii

`@rustbot` label: +C-cleanup
2022-09-12 15:21:30 +05:30
Dylan DPC
413703201c
Rollup merge of #100293 - yanchen4791:add-inline-llvm-option, r=nnethercote
Add inline-llvm option for disabling/enabling LLVM inlining

In this PR, a new -Z option `inline-llvm` is added in order to be able to turn on/off LLVM inlining.

The capability of turning on/off inlining in LLVM backend is needed for testing performance implications of using recently enabled inlining in rustc's frontend (with -Z inline-mir=yes option, #91743). It would be interesting to see the performance effect using rustc's frontend inlining only without LLVM inlining enabled. Currently LLVM is still doing inlining no mater what value inline-mir is set to. With the option `inline-llvm` being added in this PR, user can turn off LLVM inlining by using `-Z inline-llvm=no` option (the default of inline-llvm is 'yes', LLVM inlining enabled).
2022-09-12 15:21:29 +05:30
bors
a93214ec06 Auto merge of #101604 - compiler-errors:issue-101465, r=lcnr
Fix ICE in opt_suggest_box_span

We were _totally_ mishandling substs and obligations in `opt_suggest_box_span`, so I reworked that function pretty heavily.

Also some drive-by changes, namely removing `ret_type_span`.

Fixes #101465
2022-09-12 08:46:40 +00:00
bors
56e7678ca9 Auto merge of #100502 - chenyukang:fix-100478, r=jackh726
Avoid infinite loop in function arguments checking

Fixes #100478
Fixes #101097
2022-09-12 06:05:32 +00:00
Nicholas Nethercote
b8ed1c5745 Remove unused argument from check_mac_def. 2022-09-12 14:05:54 +10:00
Nicholas Nethercote
7e3fd33a66 Remove unused argument from visit_poly_trait_ref. 2022-09-12 13:51:10 +10:00
Nicholas Nethercote
9ec5bda0dc Remove unused span argument from visit_name. 2022-09-12 13:44:29 +10:00
Nicholas Nethercote
eff1106d56 Remove unused span argument from check_mod and process_mod. 2022-09-12 13:44:27 +10:00
zahash
e82922f8ea very minor readme.md changes 2022-09-12 09:01:54 +05:30
bors
3194958217 Auto merge of #100251 - compiler-errors:tuple-trait-2, r=jackh726
Implement `std::marker::Tuple`

Split out from #99943 (https://github.com/rust-lang/rust/pull/99943#pullrequestreview-1064459183).

Implements part of rust-lang/compiler-team#537
r? `@jackh726`
2022-09-12 03:24:29 +00:00
Nicholas Nethercote
925363f13d Remove unused span argument from walk_fn. 2022-09-12 13:24:27 +10:00
Nicholas Nethercote
6568ef338e Remove path_span argument to the visit_path_segment methods.
The `visit_path_segment` method of both the AST and HIR visitors has a
`path_span` argument that isn't necessary. This commit removes it.

There are two very small and inconsequential functional changes.

- One call to `NodeCollector::insert` now is passed a path segment
  identifier span instead of a full path span. This span is only used in
a panic message printed in the case of an internal compiler bug.

- Likewise, one call to `LifetimeCollectVisitor::record_elided_anchor`
  now uses a path segment identifier span instead of a full path span.
  This span is used to make some `'_` lifetimes.
2022-09-12 13:24:25 +10:00