Commit Graph

199748 Commits

Author SHA1 Message Date
Eric Holk
cf04547b0b Address code review comments 2022-09-13 14:50:12 -07:00
Eric Holk
de42ac3970 Move dyn* tests to their own directory 2022-09-12 17:29:24 -07:00
Eric Holk
3c2d20ef0b Make x.py check work 2022-09-12 17:29:11 -07:00
Eric Holk
ddfcca48c6 Update feature flags on dyn-star tests 2022-09-12 16:56:00 -07:00
Michael Goulet
03148ff735 Make dyn-trait-method work 2022-09-12 16:56:00 -07:00
Michael Goulet
b2ed2dcaae Rename some variants 2022-09-12 16:55:59 -07:00
Michael Goulet
12ec2f0e34 Construct dyn* during const interp 2022-09-12 16:55:59 -07:00
Michael Goulet
12353c11ca Use principal of cast target as dyn-star trait ref in codegen 2022-09-12 16:55:58 -07:00
Eric Holk
ef7062dad6 Add test to make sure we run custom destructors 2022-09-12 16:55:58 -07:00
Eric Holk
48e7f24804 Add test case for calling methods on dyn* object 2022-09-12 16:55:57 -07:00
Eric Holk
c5441acf67 Call destructors when dyn* object goes out of scope 2022-09-12 16:55:57 -07:00
Eric Holk
549c105bb3 dyn* through more typechecking and MIR 2022-09-12 16:55:56 -07:00
Eric Holk
7fccac3ea0 Typecheck dyn* coercions
Also changes things to treat dyn* as a sized type, unlike dyn Trait.
2022-09-12 16:55:56 -07:00
Eric Holk
6c01273a15 Plumb dyn trait representation through ty::Dynamic 2022-09-12 16:55:55 -07:00
Eric Holk
eff35e59c6 Introduce dyn_star feature flag
The primary purpose of this commit is to introduce the
dyn_star flag so we can begin experimenting with implementation.

In order to have something to do in the feature gate test, we also add
parser support for `dyn* Trait` objects. These are currently treated
just like `dyn Trait` objects, but this will change in the future.

Note that for now `dyn* Trait` is experimental syntax to enable
implementing some of the machinery needed for async fn in dyn traits
without fully supporting the feature.
2022-09-12 16:55:55 -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
Oli Scherer
cccd99c976 Update miri submodule 2022-09-12 17:19:31 +00: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
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
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
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
Michael Goulet
5599a45e58 Fix ICE in opt_suggest_box_span 2022-09-12 02:00:20 +00:00
Michael Goulet
0a605d33cd No more ret_type_span 2022-09-12 02:00:20 +00:00
Michael Howell
2d239fbb9c rustdoc: remove no-op #search
The padding rule was added in 135281ed15 when
converting the rule for #main, but didn't do anything even then.
2022-09-11 18:43:52 -07:00
Michael Howell
bff8078fb4 rustdoc: remove no-op #search { margin-left: 0 }
This 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.
2022-09-11 18:32:19 -07:00
bors
fa521a4691 Auto merge of #101688 - cjgillot:verify-hir-parent, r=petrochenkov
Assert that HIR nodes are not their own parent.

Fixes https://github.com/rust-lang/rust/issues/101505.
Replaces #101513

r? `@petrochenkov` `@nnethercote`
2022-09-12 00:41:56 +00:00
bors
98e1f041b6 Auto merge of #101442 - joboet:null_check_tcs, r=thomcc
Check if TCS is a null pointer on SGX

The `EENTER` instruction only checks if the TCS is aligned, not if it zero. Saying the address returned is a `NonNull<u8>` (for which `Tcs` is a type alias) is unsound. As well-behaved runners will not put the TCS at address zero, so the definition of `Tcs` is correct. However, `std` should check the address before casting it to a `NonNull`.

ping `@jethrogb` `@raoulstrackx`
`@rustbot` label I-unsound
2022-09-11 22:19:24 +00:00
Guillaume Gomez
d010f95af1 Update tests for new browser-ui-test version 2022-09-11 22:09:23 +02:00
bors
59e7a308e4 Auto merge of #101299 - saethlin:vecdeque-drain-drop, r=thomcc
Remove &[T] from vec_deque::Drain

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

I don't know what the right approach is here. There were a few suggestions in the issue, and they all seem a bit thorny to implement. So I just picked one that was kind of familiar.
2022-09-11 19:50:41 +00:00
Nixon Enraght-Moony
c3fcfa8272 Rustdoc-Json: Add tests for trait impls. 2022-09-11 20:32:47 +01:00
Camille GILLOT
51f486931f Assert that HIR nodes are not their own parent. 2022-09-11 20:12:51 +02:00
bors
0d56e34047 Auto merge of #101678 - jannic:fix-101640, r=jyn514
Add diagnostic arg 'current_crate'

With this fix, I get almost the same error message as on stable, again.

However, I expected to get the new error message `std is required by {$current_crate} because it does not declare #![no_std]`, but I didn't. Instead, I got a new line `help: consider building the standard library from source with cargo build -Zbuild-std`. So I obviously do not fully understand what is going on.

In any case, the bug itself seems to be fixed by this patch.

Closes #101640
2022-09-11 16:30:59 +00:00
bors
17a627fe87 Auto merge of #101682 - compiler-errors:rpitit-encode, r=fee1-dead
Only encode return-position `impl Trait` in trait when parent function has a default body

Semi-blocked on #101679, because I can't currently write a test for when we _should_ encode the type of the return-position `impl Trait` in trait, which is when a trait has a default function body, like so:

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

Though this can land even without #101679, since it does prevent ICEs from occuring any time you use `#![feature(return_position_impl_trait_in_trait)]` in a library, which is kind annoying.
2022-09-11 13:49:52 +00:00
joboet
2fa58080cb
std: check if TCS is a null pointer 2022-09-11 12:15:32 +02:00
Michael Goulet
1335da9d48 Only encode RPITIT when trait method has default body 2022-09-11 09:36:02 +00:00
Michael Goulet
89b6488ef0 Deny RPITIT for object safety 2022-09-11 09:14:07 +00:00
bors
6f0c4a6c5c Auto merge of #101673 - crlf0710:generator_clone, r=oli-obk
Allow generators to impl Clone/Copy

Revives #95137. It's a pity that the original pr didn't land because the implementation is almost complete! All credits goes to `@canndrew,` and i just resolved the merge conflicts and updated the feature gate version number.

r? `@oli-obk`
2022-09-11 08:50:35 +00:00
Jan Niehusmann
156717d3e5 Add diagnostic arg 'current_crate' 2022-09-11 07:15:23 +00:00
Michael Goulet
fd2766e7fd Check that the types in RPITITs are WF 2022-09-11 06:58:11 +00:00
bors
4c3f8eb277 Auto merge of #101670 - obi1kenobi:patch-1, r=jyn514
Add @obi1kenobi to the cc list for rustdoc-json-types

I'm one of the maintainers of `cargo-semver-checks`, and as mentioned [in Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Long.20Term.20Rustdoc.20JSON.20Stability) it's very useful to me to know about upcoming rustdoc JSON types changes so I can be ready to publish new `cargo-semver-checks` releases compatible with the new JSON format.
2022-09-11 06:27:29 +00:00