Commit Graph

196930 Commits

Author SHA1 Message Date
Takayuki Maeda
03db919989 remove unnecessary stderr files 2022-08-16 03:08:25 +09:00
bors
1603a70f82 Auto merge of #100356 - matthiaskrgr:rollup-he0vkjc, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #99573 (Stabilize backtrace)
 - #100069 (Add error if link_ordinal used with unsupported link kind)
 - #100086 (Add more `// unit-test`s to MIR opt tests)
 - #100332 (Rename integer log* methods to ilog*)
 - #100334 (Suggest a missing semicolon before an array)
 - #100340 (Iterate generics_def_id_map in reverse order to fix P-critical issue)
 - #100345 (docs: remove repetition in `is_numeric` function docs)
 - #100352 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-10 06:09:10 +00:00
Matthias Krüger
f6ce6aba6e
Rollup merge of #100352 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in 4fd148c47e733770c537efac5220744945d572ef..ce40690a5e4e315d3dab0aae1eae69d0252c52ac
2022-08-03 15:03:52 +0000 to 2022-08-09 22:32:17 +0000
- Make the `rust-version` error recommend `cargo update --precise -p crate@ver` (rust-lang/cargo#10891)
- resolver docs: link to version requirements syntax full explanation (rust-lang/cargo#10946)
- Bump os_info to 3.5.0 (rust-lang/cargo#10943)
- Mark --timings=html unstable in the document (rust-lang/cargo#10941)
- Mention that aliases are recursive (rust-lang/cargo#10935)
- Test if reserved filenames are allowed in Windows (rust-lang/cargo#10322)
- improve error message for `no such subcommand` (rust-lang/cargo#10924)
2022-08-10 07:21:40 +02:00
Eric Huss
0a31aa29e4 Update cargo 2022-08-10 04:07:57 -07:00
Matthias Krüger
3b97de6b1b
Rollup merge of #100345 - vincenzopalazzo:macros/is_number_doc, r=joshtriplett
docs: remove repetition in `is_numeric` function docs

In https://github.com/rust-lang/rust/pull/99628 we introduce new docs for the `is_numeric` function, and this is a follow-up PR that removes some unnecessary repetition that may be introduced by some rebasing.

`@rustbot` r? `@joshtriplett`
2022-08-10 07:21:39 +02:00
Matthias Krüger
636f0c71cb
Rollup merge of #100340 - spastorino:fix-100187, r=compiler-errors
Iterate generics_def_id_map in reverse order to fix P-critical issue

Closes #100187

Fixes a `P-critical` beta regression.
2022-08-10 07:21:38 +02:00
Matthias Krüger
354b831c32
Rollup merge of #100334 - TaKO8Ki:suggest-missing-semicolon-before-array, r=fee1-dead
Suggest a missing semicolon before an array

fixes #99658
2022-08-10 07:21:37 +02:00
Matthias Krüger
0cbecda7fe
Rollup merge of #100332 - eholk:stabilize-ilog, r=scottmcm
Rename integer log* methods to ilog*

This reflects the concensus from the libs team as reported at https://github.com/rust-lang/rust/issues/70887#issuecomment-1209513261.

Joint work with `@yoshuawuyts.`
2022-08-10 07:21:36 +02:00
Matthias Krüger
f9d6cc58b4
Rollup merge of #100086 - JakobDegen:better-tests, r=wesleyweiser
Add more `// unit-test`s to MIR opt tests

I only changed things which are hopefully completely uninteresting. I plan to submit more PRs that cover more files, but those cases will need some more complicated (and hence possibly controversial) changes, so I'll try and submit those in reasonably sized batches.

r? rust-lang/wg-mir-opt
2022-08-10 07:21:35 +02:00
Matthias Krüger
6b5ec41936
Rollup merge of #100069 - dpaoliello:linkordinal, r=michaelwoerister
Add error if link_ordinal used with unsupported link kind

The `link_ordinal` attribute only has an affect if the `raw-dylib` link kind is used, so add an error if it is used with any other link kind.
2022-08-10 07:21:34 +02:00
Matthias Krüger
e10f924e27
Rollup merge of #99573 - tbodt:stabilize-backtrace, r=yaahc
Stabilize backtrace

This PR stabilizes the std::backtrace module. As of #99431, the std::Error::backtrace item has been removed, and so the rest of the backtrace feature is set to be stabilized.

Previous discussion can be found in #72981, #3156.

Stabilized API summary:
```rust
pub mod std {
    pub mod backtrace {
        pub struct Backtrace { }
        pub enum BacktraceStatus {
            Unsupported,
            Disabled,
            Captured,
        }
        impl fmt::Debug for Backtrace {}
        impl Backtrace {
            pub fn capture() -> Backtrace;
            pub fn force_capture() -> Backtrace;
            pub const fn disabled() -> Backtrace;
            pub fn status(&self) -> BacktraceStatus;
        }
        impl fmt::Display for Backtrace {}
    }
}
```

`@yaahc`
2022-08-10 07:21:33 +02:00
bors
0459d2fa73 Auto merge of #100346 - matthiaskrgr:rollup-6rljn4p, r=matthiaskrgr
Rollup of 14 pull requests

Successful merges:

 - #98775 (rustdoc: improve scroll locking in the rustdoc mobile sidebars)
 - #99479 (rustdoc-json: Remove doc FIXME for Import::id and explain)
 - #100040 (Error on broken pipe but do not backtrace or ICE)
 - #100072 (linker-plugin-lto.md: Correct the name of example c file)
 - #100098 (Some "this expression has a field"-related fixes)
 - #100226 (Do not manually craft a span pointing inside a multibyte character.)
 - #100240 (Fail gracefully when const pattern is not structural match.)
 - #100256 (Add some high-level docs to `FnCtxt` and `ItemCtxt`)
 - #100261 (Set tainted errors bit before emitting coerce suggestions.)
 - #100275 (also update anyhow in codegen_cranelift)
 - #100281 (Remove more Clean trait implementations)
 - #100314 (Mention `unit-test` in MIR opt test README)
 - #100319 (Remove more Clean trait implementations)
 - #100323 ([rustdoc] Don't render impl blocks with doc comment if they only contain private items by default)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-10 03:21:23 +00:00
Jakob Degen
7a1bfc0ba7 Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
Jane Losare-Lusby
21396828e4
Apply suggestions from code review 2022-08-09 15:59:53 -07:00
Matthias Krüger
752b9a85dc
Rollup merge of #100323 - GuillaumeGomez:impl-blocks-only-private, r=notriddle
[rustdoc] Don't render impl blocks with doc comment if they only contain private items by default

Fixes #100001.

cc `@jhpratt`
r? `@notriddle`
2022-08-10 00:00:37 +02:00
Matthias Krüger
a431ef4949
Rollup merge of #100319 - GuillaumeGomez:rm-clean-impls-2, r=Dylan-DPC
Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? ``@Dylan-DPC``
2022-08-10 00:00:36 +02:00
Matthias Krüger
e8d8599ad9
Rollup merge of #100314 - JakobDegen:test-docs, r=RalfJung
Mention `unit-test` in MIR opt test README

r? `@RalfJung`
2022-08-10 00:00:35 +02:00
Matthias Krüger
790b19f514
Rollup merge of #100281 - GuillaumeGomez:rm-clean-impls-3, r=notriddle
Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`
2022-08-10 00:00:34 +02:00
Matthias Krüger
45c9dde4e1
Rollup merge of #100275 - RalfJung:anyhow, r=bjorn3
also update anyhow in codegen_cranelift

now that is has been un-yanked
r? ``@bjorn3``
2022-08-10 00:00:33 +02:00
Matthias Krüger
2be32e8e9b
Rollup merge of #100261 - luqmana:suggestions-overflow, r=lcnr
Set tainted errors bit before emitting coerce suggestions.

Fixes #100246.

#89576 basically got 99% of the way there but the match typechecking code (which calls `coerce_inner`) also needed a similar fix.
2022-08-10 00:00:32 +02:00
Matthias Krüger
4add5148a5
Rollup merge of #100256 - camelid:typeck-ctxt-doc, r=compiler-errors
Add some high-level docs to `FnCtxt` and `ItemCtxt`

I haven't understood the difference between these before, but
``@compiler-errors`` helped me clear it up. Hopefully this will help other
people who've been confused!

r? `@compiler-errors`
2022-08-10 00:00:31 +02:00
Matthias Krüger
b11b8d6939
Rollup merge of #100240 - cjgillot:noice-structural-match, r=davidtwco
Fail gracefully when const pattern is not structural match.

Fixes https://github.com/rust-lang/rust/issues/82909
2022-08-10 00:00:30 +02:00
Matthias Krüger
e6c9594213
Rollup merge of #100226 - cjgillot:noice-multibyte, r=davidtwco
Do not manually craft a span pointing inside a multibyte character.

Fixes https://github.com/rust-lang/rust/issues/92462
2022-08-10 00:00:29 +02:00
Matthias Krüger
867453e2df
Rollup merge of #100098 - compiler-errors:field-suggestion-fixups, r=davidtwco
Some "this expression has a field"-related fixes

Each commit does something different and is worth reviewing, but the final diff from `master..HEAD` contains the sum of the changes to the UI tests, since some commits added UI tests "regressions" which were later removed in other commits.

The only change I could see adding on top of this is suppressing `Clone::clone` from the "this expression has a field that has this method" suggestion, since it's so commonly implemented by types that it's not worthwhile suggesting in general.
2022-08-10 00:00:28 +02:00
Matthias Krüger
2059391eb2
Rollup merge of #100072 - oToToT:patch-1, r=michaelwoerister
linker-plugin-lto.md: Correct the name of example c file

The final output is linked with `cmain.o`, but we use `main.o` in the example.
This patch changes the name to `cmain.c` and `cmain.o` as the "C/C++ code as a dependency in Rust" section.
2022-08-10 00:00:27 +02:00
Matthias Krüger
cf7a9ae869
Rollup merge of #100040 - ChrisDenton:broken-pipe, r=davidtwco
Error on broken pipe but do not backtrace or ICE

Windows will report a broken pipe as a normal error which in turn `println!` will panic on. Currently this causes rustc to produce a backtrace and ICE. However, this is not a bug with rustc so a backtrace is overly verbose and ultimately unhelpful to the user.

Kind of fixes #98700. Although this is admittedly a bit of a hack because at panic time all we have is a string to inspect. On zulip it was suggested that libstd might someday provide a way to indicate a soft panic but that day isn't today.
2022-08-10 00:00:26 +02:00
Matthias Krüger
0dc39c7bd9
Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelid
rustdoc-json: Remove doc FIXME for Import::id and explain

Also add some test and refactor related code a bit.

``@rustbot`` labels +A-rustdoc-json +T-rustdoc
2022-08-10 00:00:24 +02:00
Matthias Krüger
02fc0faa9a
Rollup merge of #98775 - notriddle:notriddle/mobile-sidebar-scroll-lock, r=jsha
rustdoc: improve scroll locking in the rustdoc mobile sidebars

This PR prevents the main content area from scrolling while the mobile sidebar is open on documentation pages (porting the scroll locking behavior from the source sidebar to the regular sidebar), and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck.

This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content.

Split out from #98772
2022-08-10 00:00:23 +02:00
Vincenzo Palazzo
23bd7cbcb1 docs: remove repetition
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-09 21:54:05 +00:00
bors
34a6cae28e Auto merge of #100150 - notriddle:notriddle/implementors-js, r=GuillaumeGomez
rustdoc: use a more compact encoding for implementors/trait.*.js

The exact amount that this reduces the size of an implementors file depends on whether most of the impls are synthetic or not. For `Send`, it reduces the file from 128K to 112K, while for `Clone` it went from 64K to 44K.
2022-08-09 20:00:58 +00:00
Santiago Pastorino
750a04ea7f
Add docs for get_remapped_def_id 2022-08-09 16:39:02 -03:00
Santiago Pastorino
457ff7c56c
Iterate def_ids map backwards to try first the latest mappings (it's a stack) 2022-08-09 16:33:19 -03:00
Eric Holk
0fd4db3716 Update rustdoc-json test 2022-08-09 12:06:54 -07:00
Santiago Pastorino
e6478a3724
Add regression test for issue 100187 2022-08-09 15:42:59 -03:00
Daniel Paoliello
fda5144ceb Add error if link_ordinal used without raw-dylib 2022-08-09 11:02:41 -07:00
Noah Lev
31a051870b Address review comments 2022-08-09 10:44:52 -07:00
Takayuki Maeda
6d85bb9535 suggest a missing semicolon before an array 2022-08-10 02:29:28 +09:00
Eric Holk
c18f22058b Rename integer log* methods to ilog*
This reflects the concensus from the libs team as reported at
https://github.com/rust-lang/rust/issues/70887#issuecomment-1209513261

Co-authored-by: Yosh Wuyts <github@yosh.is>
2022-08-09 10:20:49 -07:00
Jakob Degen
6ae1c0327a Mention unit-test in MIR opt test README 2022-08-09 09:58:46 -07:00
bors
63e4312e6b Auto merge of #99217 - lcnr:implied-bounds-pre-norm, r=lcnr
consider unnormalized types for implied bounds

extracted, and slightly modified, from #98900

The idea here is that generally, rustc is split into things which can assume its inputs are well formed[^1], and things which have verify that themselves.

Generally most predicates should only deal with well formed inputs, e.g. a `&'a &'b (): Trait` predicate should be able to assume that `'b: 'a` holds. Normalization can loosen wf requirements (see #91068) and must therefore not be used in places which still have to check well formedness. The only such place should hopefully be `WellFormed` predicates

fixes #87748 and #98543

r? `@jackh726` cc `@rust-lang/types`

[^1]: These places may still encounter non-wf inputs and have to deal with them without causing an ICE as we may check for well formedness out of order.
2022-08-09 16:39:43 +00:00
Guillaume Gomez
c634852cfb Add test for impl blocks containing only private items 2022-08-09 16:44:39 +02:00
bors
6d3f1beae1 Auto merge of #100318 - Dylan-DPC:rollup-18tzp6q, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #96478 (Implement `#[rustc_default_body_unstable]`)
 - #99787 (Rustdoc-Json: Document HRTB's on DynTrait)
 - #100181 (add method to get the mutability of an AllocId)
 - #100221 (Don't document impossible to call default trait items on impls)
 - #100228 (Don't ICE while suggesting updating item path.)
 - #100301 (Avoid `&str` to `String` conversions)
 - #100305 (Suggest adding an appropriate missing pattern excluding comments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-09 13:51:33 +00:00
Guillaume Gomez
dd816a9c2e Prevent impl blocks containing only private items to be documented by default 2022-08-09 15:49:30 +02:00
lcnr
8691b96eee test implied bounds + nested proj oblig 2022-08-09 14:42:06 +02:00
Guillaume Gomez
5ed55f7b16 remove Clean trait implementation for ast::Module 2022-08-09 14:21:32 +02:00
Dylan DPC
467e7aae0f
Rollup merge of #100305 - TaKO8Ki:suggest-adding-appropriate-missing-pattern-excluding-comments, r=compiler-errors
Suggest adding an appropriate missing pattern excluding comments

fixes #100272
2022-08-09 17:34:57 +05:30
Dylan DPC
d7f414d540
Rollup merge of #100301 - TaKO8Ki:avoid-&str-to-String-conversions, r=compiler-errors
Avoid `&str` to `String` conversions

This patch removes the recently added unnecessary `&str` to `String` conversions.

follow-up to #99718
2022-08-09 17:34:56 +05:30
Dylan DPC
fac84e8bb6
Rollup merge of #100228 - luqmana:suggestion-ice, r=estebank
Don't ICE while suggesting updating item path.

When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE (*). Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases.

(*) The ICE happens because the emitter want to indicate to the user what code to delete by referencing a certain span. But in this case, said span has `lo == hi == 0` which means it thinks it's a dummy span. Adding a space before the proc macro attribute is enough to stop it from ICE'ing but even then the suggestion doesn't really make any sense:
```
help: if you import `DataStore`, refer to it directly
  |
1 -  #[dbstruct::dbstruct]
1 +  #[dbstruct::dbstruct]
```

Since suggestions are best-effort, I just gated this one on `can_be_used_for_suggestions` which catches cases like this.

Fixes #100199
2022-08-09 17:34:55 +05:30
Dylan DPC
d910e5376b
Rollup merge of #100221 - compiler-errors:impossible-trait-items, r=lcnr,notriddle,camelid
Don't document impossible to call default trait items on impls

Closes #100176

This only skips documenting _default_ trait items on impls, not ones that are written inside the impl block. This is a conservative approach, since I think we should document all items written in an impl block (I guess unless hidden or whatever), but the existence of this new query I added makes this easy to extend to other rustdoc cases.
2022-08-09 17:34:54 +05:30
Dylan DPC
7efe24c3ed
Rollup merge of #100181 - RalfJung:alloc-ref-mutability, r=jackh726
add method to get the mutability of an AllocId

Miri needs this for https://github.com/rust-lang/miri/issues/2463.
2022-08-09 17:34:52 +05:30