Commit Graph

223174 Commits

Author SHA1 Message Date
Matthias Krüger
1ca3f33ef7
Rollup merge of #110866 - compiler-errors:test, r=jyn514
Make `method-not-found-generic-arg-elision.rs` error message not path dependent

Every time I bless `tests/ui/methods/method-not-found-generic-arg-elision.rs`, I get some nonsense "type is too long" + "written to disk" that shows up and have to manually revert because the combination of my rustc repo path + the UI test directory hits the length limit for printing types spilling to disk (since this happens before UI test path sanitization).

The fact that we use a closure in this test doesn't have to do with the UI test, so just box the closure to make the type name smaller and not path dependent.
2023-04-27 15:10:55 +02:00
Matthias Krüger
563eb04c5d
Rollup merge of #110864 - compiler-errors:into-future-stable, r=jackh726
`IntoFuture::into_future` is no longer unstable

We don't need to gate the `IntoFuture::into_future` call in `.await` lowering anymore.

``@bors`` rollup
2023-04-27 15:10:55 +02:00
Matthias Krüger
63fbb05839
Rollup merge of #110816 - clubby789:rustc-passes-diagnostics, r=compiler-errors
Migrate `rustc_passes` to translatable diagnostics

cc #100717
2023-04-27 15:10:54 +02:00
Matthias Krüger
b1ff6e3e10
Rollup merge of #110814 - WaffleLapkin:sprinkle_#inline, r=Nilstrieb
Sprinkle some `#[inline]` in `rustc_data_structures::tagged_ptr`

This is based on `nm --demangle (rustc +a --print sysroot)/lib/librustc_driver-*.so | rg CopyTaggedPtr` which shows many methods that should probably be inlined. May fix the regression in https://github.com/rust-lang/rust/pull/110795.

r? ```@Nilstrieb```
2023-04-27 15:10:53 +02:00
Matthias Krüger
5215782421
Rollup merge of #110804 - cuishuang:master, r=jyn514
Remove repeated definite articles
2023-04-27 15:10:53 +02:00
Matthias Krüger
c2a79fb490
Rollup merge of #110426 - calebcartwright:style-let-else-examples, r=compiler-errors
docs(style): add more let-else examples

Adding a few more examples for increased clarity based on subsequent discussion that arose after implementation work began.

Will need approval from t-style, but also cc ```@ytmimi``` to make sure these examples don't contradict any examples we've been incorporating as part of the rustfmt implementation
2023-04-27 15:10:52 +02:00
Maybe Waffle
1d847b8659 ignore failing test on arm 2023-04-27 13:09:41 +00:00
Maybe Waffle
e80b24cc14 fix typo in the inaccessible-temp-dir test name
(formally `...inaccessbile...`)
2023-04-27 13:07:14 +00:00
WANG Rui
c7b7248a60 Bump libffi-sys to 2.3.0 2023-04-27 19:42:52 +08:00
Boxy
bdb956e9b0 nits 2023-04-27 12:13:28 +01:00
bors
6ce22733b9 Auto merge of #110882 - BoxyUwU:rename-some-ty-flags, r=compiler-errors
rename `NEEDS_SUBST` and `NEEDS_INFER`

implements rust-lang/compiler-team#617
2023-04-27 09:55:37 +00:00
bors
a0507192fb Auto merge of #2858 - loongarch-rs:bump-libffi-sys, r=RalfJung
Bump libffi-sys to 2.3.0

Bump libffi-sys to 2.3.0 that includes LoongArch support.

Thanks
2023-04-27 09:11:56 +00:00
Chris Denton
9b9d39e43f
Abstract MultiByteToWideChar 2023-04-27 09:58:19 +01:00
Chris Denton
73b65746e8
Fix Unreadable non-UTF-8 output on localized MSVC
Fixes #35785 by converting non UTF-8 linker output to Unicode using the OEM code page.

Before:

```text
  = note: Non-UTF-8 output: LINK : fatal error LNK1181: cannot open input file \'m\x84rchenhaft.obj\'\r\n
```

After:

```text
   = note: LINK : fatal error LNK1181: cannot open input file 'märchenhaft.obj'

```

The difference is more dramatic if using a non-ascii language pack for Visual Studio.
2023-04-27 09:58:18 +01:00
bohan
9156b03287 test(doc): no fallback marco resolution 2023-04-27 16:25:05 +08:00
Nicholas Nethercote
793b2ffb67 Factor out common code in intern_node.
There are three very similar blocks in this function.
2023-04-27 17:50:02 +10:00
Nicholas Nethercote
207cec017f Clean up with_task.
Currently it creates an `Option` and then does `map`/`unwrap_or` and
`map_or_else` on it, which is hard to read.

This commit simplifies things by moving more code into the two arms of
the if/else.
2023-04-27 17:48:15 +10:00
Boxy
2f624db5ea rename needs_infer to has_infer 2023-04-27 08:35:19 +01:00
Boxy
842419712a rename needs_subst to has_param 2023-04-27 08:35:19 +01:00
Boxy
f04b8fe0af rename needs_infer to has_infer 2023-04-27 08:35:19 +01:00
bohan
907daec5ab refactor(docs): remove macro resolution fallback 2023-04-27 14:52:10 +08:00
Nicholas Nethercote
4b85aa99ad Add a comment about TypeFoldable and slices. 2023-04-27 16:21:20 +10:00
bors
8b8110e146 Auto merge of #110728 - cjgillot:no-false-optes, r=oli-obk
Do not bother optimizing impossible functions.

This is currently checked by `ConstProp`, but I see no reason to restrict it to ConstProp only.
2023-04-27 04:29:49 +00:00
Jules Bertholet
075ee26b68
Loosen From<&[T]> for Box<[T]> bound to T: Clone 2023-04-26 23:41:07 -04:00
whtahy
fcf8468efc add known-bug test for unsound issue 105782 2023-04-26 22:34:39 -04:00
whtahy
21b9f5c3bb add known-bug test for unsound issue 74629 2023-04-26 22:34:39 -04:00
whtahy
a87359d7c9 add known-bug test for unsound issue 49682 2023-04-26 22:34:30 -04:00
whtahy
bfdd1c4e35 add known-bug test for unsound issue 40582 2023-04-26 22:34:29 -04:00
WANG Rui
aafb3aa810 Bump libffi-sys to 2.3.0 2023-04-27 10:02:01 +08:00
Michael Goulet
3125979b78 Fix a bad binop error when we need a call 2023-04-27 01:34:03 +00:00
Michael Goulet
015acc2611 Provide RHS type hint when reporting operator error 2023-04-27 01:34:03 +00:00
bors
e3ccd4b9a5 Auto merge of #110562 - ComputerDruid:riscv, r=tmandry
Add definitions for riscv64gc-unknown-fuchsia

To compile, also requires a libc update with https://github.com/rust-lang/libc/pull/3204
2023-04-27 01:29:50 +00:00
Philpax
d5d2785c86 docs(std): clarify remove_dir_all errors 2023-04-27 03:19:14 +02:00
Michael Goulet
3d80dd983d Clean up some builtin operator typeck logic 2023-04-27 00:57:22 +00:00
clubby789
1ce9d7254e Migrate trivially translatable rustc_parse diagnostics 2023-04-27 01:53:06 +01:00
Jules Bertholet
5b6e747f37
Nicer ICE for #67981 2023-04-26 19:46:10 -04:00
Michael Goulet
c18e7b765f IntoFuture::into_future is no longer unstable 2023-04-26 22:44:18 +00:00
Michael Goulet
ee8942138a Split out make_ambiguous_response_no_constraints 2023-04-26 22:33:49 +00:00
bors
cb9aa8c9c1 Auto merge of #110861 - m-ou-se:thread-local-restructure, r=workingjubilee
Restructure and rename std thread_local internals to make it less of a maze

Every time I try to work on std's thread local internals, it feels like I'm trying to navigate a confusing maze made of macros, deeply nested modules, and types with multiple names/aliases. Time to clean it up a bit.

This PR:

- Exports `Key` with its own name (`Key`), instead of `__LocalKeyInner`
- Uses `pub macro` to put `__thread_local_inner` into a (unstable, hidden) module, removing `#[macro_export]`, removing it from the crate root.
- Removes the `__` from `__thread_local_inner`.
- Removes a few unnecessary `allow_internal_unstable` features from the macros
- Removes the `libstd_thread_internals` feature. (Merged with `thread_local_internals`.)
    - And removes it from the unstable book
- Gets rid of the deeply nested modules for the `Key` definitions (`mod fast` / `mod os` / `mod statik`).
- Turns a `#[cfg]` mess into a single `cfg_if`, now that there's no `#[macro_export]` anymore that breaks with `cfg_if`.
- Simplifies the `cfg_if` conditions to not repeat the conditions.
- Removes useless `normalize-stderr-test`, which were left over from when the `Key` types had different names on different platforms.
- Removes a seemingly unnecessary `realstd` re-export on `cfg(test)`.

This PR changes nothing about the thread local implementation. That's for a later PR. (Which should hopefully be easier once all this stuff is a bit cleaned up.)
2023-04-26 22:07:17 +00:00
Michael Goulet
5fa82092ae Clear response values for overflow in new solver 2023-04-26 21:54:30 +00:00
Michael Goulet
0fabceb2df Make method-not-found-generic-arg-elision.rs error message not path dependent 2023-04-26 21:48:21 +00:00
Scott McMurray
8bcfc0e597 Add some MIR pre-codegen tests for slice indexing 2023-04-26 14:43:36 -07:00
Caleb Cartwright
0776a4bf27 docs(style): add more let-else examples
Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-26 14:58:49 -05:00
Mara Bos
12fee7b004 Update tests. 2023-04-26 21:02:56 +02:00
Mara Bos
5a62ebb0b1 Remove libstd_thread_internals from unstable book. 2023-04-26 21:02:45 +02:00
Mara Bos
fba5cfe482 Restructure and rename thread local things in std. 2023-04-26 21:02:29 +02:00
bors
1c42cb4ef0 Auto merge of #110852 - matthiaskrgr:rollup-jz3eosr, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #108760 (Add lint to deny diagnostics composed of static strings)
 - #109444 (Change tidy error message for TODOs)
 - #110419 (Spelling library)
 - #110550 (Suggest deref on comparison binop RHS even if type is not Copy)
 - #110641 (Add new rustdoc book chapter to describe in-doc settings)
 - #110798 (pass `unused_extern_crates` in `librustdoc::doctest::make_test`)
 - #110819 (simplify TrustedLen impls)
 - #110825 (diagnostics: add test case for already-solved issue)
 - #110835 (Make some region folders a little stricter.)
 - #110847 (rustdoc-json: Time serialization.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-26 18:32:57 +00:00
Tamir Duberstein
c7e16af796
compiletest: add bpf-linker assembly support 2023-04-26 13:46:32 -04:00
Matthias Krüger
63bccced0c
Rollup merge of #110847 - aDotInTheVoid:rdj-time-serialization, r=GuillaumeGomez
rustdoc-json: Time serialization.

This lets us know how much time is spent in json specific code, and how much performance we could gain by using a different serialization format.

For aws-sdk-ec2, it takes 0.7s, out of a 43s build (of which 6s is spent in json specific code), and makes a 173M json file

```
$ cargo +rust_stage2 rustdoc -p aws-sdk-ec2 -- -Zunstable-options -w json -Ztime-passes
 Documenting aws-sdk-ec2 v0.26.0 (/home/gh-aDotInTheVoid/aws-sdk-rust/sdk/ec2)
time:   5.229; rss:   64MB ->  891MB ( +827MB)  expand_crate
time:   5.230; rss:   61MB ->  891MB ( +830MB)  macro_expand_crate
time:   0.256; rss:  891MB ->  891MB (   +0MB)  AST_validation
time:   0.025; rss:  891MB ->  891MB (   +1MB)  finalize_imports
time:   0.093; rss:  891MB ->  891MB (   +0MB)  compute_effective_visibilities
time:   0.122; rss:  891MB ->  891MB (   +0MB)  finalize_macro_resolutions
time:   2.442; rss:  891MB -> 1188MB ( +297MB)  late_resolve_crate
time:   0.120; rss: 1188MB -> 1190MB (   +2MB)  resolve_check_unused
time:   0.211; rss: 1190MB -> 1190MB (   +0MB)  resolve_postprocess
time:   3.017; rss:  891MB -> 1190MB ( +299MB)  resolve_crate
time:   8.520; rss:   61MB -> 1181MB (+1120MB)  prepare_outputs
time:   0.152; rss: 1181MB -> 1181MB (   +0MB)  complete_gated_feature_checking
time:   0.539; rss: 1633MB -> 1632MB (   -1MB)  drop_ast
time:  15.492; rss:   58MB -> 1621MB (+1563MB)  type_collecting
time:   1.503; rss: 1621MB -> 1705MB (  +84MB)  item_types_checking
time:   1.274; rss: 1705MB -> 1726MB (  +21MB)  crate_lints
time:   1.275; rss: 1705MB -> 1726MB (  +21MB)  missing_docs
time:   0.281; rss: 1726MB -> 1726MB (   +0MB)  check_mod_attrs
time:   0.433; rss: 1744MB -> 1750MB (   +6MB)  clean_crate
time:  11.581; rss: 1750MB -> 2107MB ( +357MB)  collect_synthetic_impls
time:   0.019; rss: 2107MB -> 2107MB (   +0MB)  collect_items_for_trait_impls
time:  12.588; rss: 1750MB -> 2139MB ( +389MB)  collect-trait-impls
time:   0.197; rss: 2139MB -> 2139MB (   +0MB)  check_doc_test_visibility
time:   0.281; rss: 2139MB -> 2150MB (  +11MB)  strip-hidden
time:   0.260; rss: 2150MB -> 2150MB (   +0MB)  strip-private
warning: unresolved link to `date`
 --> sdk/ec2/src/client/describe_instances.rs:7:11184
  |
7 | ...te of the instance (for example, shows "User Initiated [date]" when you stop or terminate the instance). Similar to the state-reason-code filter.<...
  |                                                            ^^^^ no item named `date` in scope
  |
  = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
  = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

time:   0.363; rss: 2150MB -> 2150MB (   +0MB)  collect-intra-doc-links
time:   0.946; rss: 2150MB -> 2150MB (   +0MB)  propagate-doc-cfg
time:   0.494; rss: 2150MB -> 2152MB (   +2MB)  run-lints
time:   0.658; rss: 2152MB -> 2163MB (  +11MB)  create_format_cache
time:  34.818; rss:   58MB -> 2163MB (+2105MB)  run_global_ctxt
time:   0.016; rss: 2163MB -> 2163MB (   +0MB)  create_renderer(json)
time:   0.723; rss: 2780MB -> 2780MB (   +0MB)  rustdoc_json_serialization
time:   2.216; rss: 2399MB -> 2599MB ( +199MB)  renderer_after_krate(json)
time:   6.639; rss: 2163MB -> 2417MB ( +254MB)  render_json
time:   0.312; rss: 2417MB -> 2071MB ( -346MB)  free_global_ctxt
warning: `aws-sdk-ec2` (lib doc) generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 43.06s
```

[(Zulip Discussion)](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/JSON.20metadata.20speed/near/352783145)

r? `@GuillaumeGomez`
2023-04-26 18:51:45 +02:00
Matthias Krüger
e47562c674
Rollup merge of #110835 - nnethercote:strict-region-folders-2, r=compiler-errors
Make some region folders a little stricter.

Because certain regions cannot occur in them.

r? ``@compiler-errors``
2023-04-26 18:51:44 +02:00