Commit Graph

148923 Commits

Author SHA1 Message Date
Jacob Pratt
bc2f0fb5a9
Specialize implementations
Implementations in stdlib are now optimized as they were before.
2021-05-26 18:07:09 -04:00
Jacob Pratt
a875876027
Make Range implementation safe 2021-05-26 00:12:06 -04:00
Jacob Pratt
641c8cd875
Limit TrustedLen impls to core types 2021-05-26 00:12:06 -04:00
bors
47a90f4520 Auto merge of #85535 - dtolnay:weakdangle, r=kennytm
Weak's type parameter may dangle on drop

Way back in 34076bc0c9, #\[may_dangle\] was added to Rc\<T\> and Arc\<T\>'s Drop impls. That appears to have been because a test added in #28929 used Arc and Rc with dangling references at drop time. However, Weak was not covered by that test, and therefore no #\[may_dangle\] was forced to be added at the time.

As far as dropping, Weak has *even less need* to interact with the T than Rc and Arc do. Roughly speaking #\[may_dangle\] describes generic parameters that the outer type's Drop impl does not interact with except by possibly dropping them; no other interaction (such as trait method calls on the generic type) is permissible. It's clear this applies to Rc's and Arc's drop impl, which sometimes drop T but otherwise do not interact with one. It applies *even more* to Weak. Dropping a Weak cannot ever cause T's drop impl to run. Either there are strong references still in existence, in which case better not drop the T. Or there are no strong references still in existence, in which case the T would already have been dropped previously by the drop of the last strong count.
2021-05-26 01:17:02 +00: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
fbf1b1a719 Auto merge of #85664 - GuillaumeGomez:rollup-o7qgo8c, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #85361 (Use TargetTriple::from_path in rustdoc)
 - #85605 (Replace Local::new(1) with CAPTURE_STRUCT_LOCAL)
 - #85631 (Move keyword primitive css dom)
 - #85644 (Better English for documenting when to use unimplemented!())
 - #85650 (Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs)
 - #85657 (Remove doubled braces in non_exhaustive structs’ documentation text.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-25 11:12:47 +00:00
Guillaume Gomez
afec7261bc
Rollup merge of #85657 - kpreid:brackets, r=jyn514
Remove doubled braces in non_exhaustive structs’ documentation text.

In commit 4b80687854 (part of Rust 1.52.1) many calls to `write!(w,` were replaced with `w.write_str(`, but this one contained braces that were doubled to escape them when taken as a format string, and so changing the call without changing the text caused them to become doubled in the final HTML output.

I examined `print_item.rs` and the diff of that prior commit for any other occurrences of this mistake and I did not find any.
2021-05-25 13:05:17 +02:00
Guillaume Gomez
aa8c37d2c9
Rollup merge of #85650 - scottmcm:adjust-adjustment-docs, r=jyn514
Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs

A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.

See https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/adjustment/struct.Adjustment.html
2021-05-25 13:05:16 +02:00
Guillaume Gomez
46615598a9
Rollup merge of #85644 - tialaramex:master, r=dtolnay
Better English for documenting when to use unimplemented!()

I don't think "plan of using" is correct here. I considered "plan on using" but eventually decided "plan to use" is better.
2021-05-25 13:05:15 +02:00
Guillaume Gomez
0f3c98ad51
Rollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha
Move keyword primitive css dom

Fixes #85569.

r? ``@jsha``
2021-05-25 13:05:14 +02:00
Guillaume Gomez
ad72247833
Rollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper
Replace Local::new(1) with CAPTURE_STRUCT_LOCAL
2021-05-25 13:05:14 +02:00
Guillaume Gomez
6b0b81b098
Rollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514
Use TargetTriple::from_path in rustdoc

This fixes the problem reported in https://github.com/Rust-for-Linux/linux/pull/272 where rustdoc requires the absolute path of a target spec json instead of accepting a relative path like rustc.
2021-05-25 13:05:09 +02:00
Guillaume Gomez
a06829cfbd Update keyword GUI test 2021-05-25 10:44:06 +02:00
Guillaume Gomez
706aa31a2d Move extra search result information for keywords and primitives from CSS to DOM 2021-05-25 10:44:05 +02:00
bors
cdbe288897 Auto merge of #85634 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/85591
2021-05-25 08:31:56 +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
Kevin Reid
08e7c6ba6f Remove doubled braces in non_exhaustive structs’ documentation text.
In commit 4b80687854 (part of Rust 1.52.1)
many calls to `write!(w,` were replaced with `w.write_str(`, but this
one contained braces that were doubled to escape them when taken as a
format string, and so changing the call without changing the text caused
them to become doubled in the final HTML output.

I examined `print_item.rs` and the diff of that prior commit for any
other occurrences of this mistake and I did not find any.
2021-05-24 20:47:10 -07:00
bors
d568d63b1f Auto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakis
Make building THIR a stealable query

This PR creates a stealable `thir_body` query so that we can build the THIR only once for THIR unsafeck and MIR build.

Blocked on #83842.
r? `@nikomatsakis`
2021-05-25 03:07:03 +00:00
Scott McMurray
bc2c3dca55 Add some backticks to the rustc_middle::ty::adjustment::Adjustment docs
A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.
2021-05-24 15:47:28 -07:00
Nick Lamb
54ccf95af2 Better English for documenting when to use unimplemented!() 2021-05-24 22:21:05 +01:00
bors
126561cb31 Auto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #85271 (Fix indentation in move keyword documentation)
 - #85551 (Fix search results display)
 - #85621 (Restore sans-serif font for module items.)
 - #85628 (Replace more "NULL" with "null")

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-24 18:05:35 +00:00
bjorn3
6afc1f4516 Add test 2021-05-24 19:53:44 +02:00
bjorn3
f22a80890a Use parse_target_triple in rustdoc 2021-05-24 19:53:44 +02:00
Guillaume Gomez
16fe40d3a3
Rollup merge of #85628 - LeSeulArtichaut:thir-null-lowercase, r=estebank
Replace more "NULL" with "null"

Error messages in THIR unsafeck still contain "NULL", make them lowercase to be consistent with MIR unsafeck (cc #84842).
2021-05-24 18:53:37 +02:00
Guillaume Gomez
9d3b9cdb2c
Rollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomez
Restore sans-serif font for module items.

This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).

Fixes #85616.
Fixes https://github.com/rust-lang/rust/issues/85545.

r? `@camelid`
2021-05-24 18:53:36 +02:00
Guillaume Gomez
30f4486ee4
Rollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jsha
Fix search results display

Fixes https://github.com/rust-lang/rust/issues/85544.

cc `@dns2utf8`

r? `@jsha`
2021-05-24 18:53:35 +02:00
Guillaume Gomez
2a8eeafa9d
Rollup merge of #85271 - th1000s:master, r=JohnTitor
Fix indentation in move keyword documentation

See (at the time of writing) the second example code block with `create_fn()` at https://doc.rust-lang.org/std/keyword.move.html
2021-05-24 18:53:29 +02: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
Ralf Jung
8b8801e591 update Miri 2021-05-24 17:17:45 +02:00
Pietro Albini
9e22b844dd remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
Eric Huss
1c9500a8f4 Bootstrap: skip rustdoc fingerprint for building docs. 2021-05-24 10:37:13 -04:00
Pietro Albini
c81c3d0d73 bootstrap from 1.54.0 beta 2021-05-24 10:37:12 -04:00
LeSeulArtichaut
af3d9a3aa3 Make thir_check_unsafety itself responsible for checking gate 2021-05-24 15:09:33 +02:00
LeSeulArtichaut
13e7b237fd Add comments about stealing THIR in mir_build 2021-05-24 15:05:20 +02:00
bors
bf24e6ba00 Auto merge of #85626 - lnicola:rust-analyzer-2021-05-24, r=jonas-schievink
⬆️ rust-analyzer
2021-05-24 12:43:47 +00:00
LeSeulArtichaut
3559565e07 Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
Laurențiu Nicola
4b31d95e18 ⬆️ rust-analyzer 2021-05-24 13:56:09 +03:00
bors
6f6919231e Auto merge of #85601 - klensy:padint-example-fix, r=dtolnay
fix pad_integral example

pad_integral's parameter `is_nonnegative - whether the original integer was either positive or zero`, but in example it checked as `self.nb > 0`, so it previously printed `-0` for `format!("{}", Foo::new(0)`, what is wrong.
2021-05-24 10:02:55 +00:00
bors
68424e2f01 Auto merge of #85515 - jedel1043:fix-85480, r=petrochenkov
Fix ast pretty printing for anonymous types

Fixes #85480.
2021-05-24 05:39:07 +00:00
Jacob Hoffman-Andrews
c1c6175e62 Restore sans-serif font for module items.
This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).
2021-05-23 22:28:19 -07:00
jedel1043
d59b1f1ef4 Add test for pretty printing anonymous types 2021-05-24 00:05:46 -05:00
jedel1043
5b4bc05fa5 Fix ast expanded printing for anonymous types 2021-05-24 00:03:59 -05:00
bors
3f9646da57 Auto merge of #85611 - rust-lang:array-mod-doc, r=jyn514
Update std::array module doc header

This line is very outdated; not only are traits implemented on arrays of arbitrary length, those implementations are documented on the primitive type, not in this module.
2021-05-24 01:53:53 +00:00
bors
9f69e2f8b2 Auto merge of #85606 - 12101111:link_modifiers, r=petrochenkov
remove native_link_modifiers from the list of incomplete features.

These features are fully implemented and not incomplete.
The tracking issue of them is https://github.com/rust-lang/rust/issues/81490.
The implement PR is https://github.com/rust-lang/rust/pull/83507.
2021-05-23 22:06:53 +00:00
bstrie
ed75d62fd5
Update std::array module doc header
Extremely outdated; not only are traits implemented on arrays of arbitrary length, those implementations are documented on the primitive type, not in this module.
2021-05-23 15:55:27 -04:00
bors
f64503eb55 Auto merge of #85554 - 12101111:fix-dedup-native-libs, r=petrochenkov
native lib: defer the duplicate check after relevant_lib check.

https://github.com/rust-lang/rust/pull/84794 break code using conditional-compilation with `#[link]` attributes.

```rust
#[cfg(target_env = "musl")]
cfg_if::cfg_if! {
    if #[cfg(any(target_feature = "crt-static", feature = "llvm-libunwind"))] {
        #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
        extern "C" {}
    } else {
        #[link(name = "unwind", cfg(feature = "system-llvm-libunwind"))]
        #[link(name = "gcc_s", cfg(not(feature = "system-llvm-libunwind")))]
        extern "C" {}
    }
}

```
2021-05-23 19:42:19 +00:00
bors
d8af907491 Auto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jsha
Don't hide inherent implementations by default

Fixes a regression introduced in #85575.

r? `@jsha`
2021-05-23 17:13:51 +00:00
12101111
a90ec5d492
remove native_link_modifiers from the list of incomplete features. 2021-05-24 00:36:55 +08:00
Paul Trojahn
0a80cc4d83 Replace Local::new(1) with CAPTURE_STRUCT_LOCAL 2021-05-23 18:36:23 +02:00
bors
13bf0b2a3c Auto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpider
rustdoc: render `<Self as X>::Y` type casts properly

Rustdoc didn't render any `<Self as X>` casts which causes invalid code inside the documentation. This is fixed by this PR by checking if the target type `X` is different from `Self`, and if so, it will render a typecast.

Resolves #85454
2021-05-23 14:54:14 +00:00