Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #91221

Merged
merged 25 commits into from
Nov 25, 2021
Merged

Rollup of 6 pull requests #91221

merged 25 commits into from
Nov 25, 2021

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 25 commits November 23, 2021 10:34
By default, AST visitors visit expressions that appear in key-value attributes.
Those expressions should not be lowered to HIR, as they do not correspond to actually compiled code.

Since an attribute cannot produce meaningful HIR, just skip them altogether.
It was replaced several years ago by the stable option `-C
overflow-checks`. The goal was to delete the `-Z` flag once users had
migrated [1]. Now that it's been several years, it makes sense to delete
the old flag.

See also the discussion on Zulip [2].

[1]: rust-lang#33134 (comment)
[2]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/overflow.20checks/near/262497224
11.0 (Big Sur) is the first version which supports ARM64 so we use
that as default.
Various fixes for const_trait_impl

A few problems I found while making `Iterator` easier to const-implement.

1. More generous `~const Drop` check.

We check for nested fields with caller bounds.

For example, an ADT type with fields of types `A`, `B`, `C`, check if all of them are either:
 - Bounded (`A: ~const Drop`, `B: Copy`)
 - Known to be able to destruct at compile time (`C = i32`, `struct C(i32)`, `C = some_fn`)

2. Don't treat trait functions marked with `#[default_method_body_is_const]` as stable const fns when checking `const_for` and `const_try` feature gates.

I think anyone can review this, so no r? this time.
…etrochenkov

Link with default MACOSX_DEPLOYMENT_TARGET if not otherwise specified.

This PR sets the MACOSX_DEPLOYMENT_TARGET environment variable during the linking stage to our default, if it is not specified. This way it matches the deployment target we pass to llvm. If not set the the linker uses Xcode or Xcode commandline tools default which varies by version.

Fixes rust-lang#90342, rust-lang#91082.

Drive-by fixes to make Rust behave more like clang:
* Default to 11.0 deployment target for ARM64 which is the earliest version that had support for it.
* Set the llvm target to `arm64-apple-macosx<deployment target>` instead of `aarch64-apple-macosx<deployment target>`.
…ait, r=estebank

Print associated types on opaque `impl Trait` types

This PR generalizes rust-lang#91021, printing associated types for all opaque `impl Trait` types instead of just special-casing for future.

before:
```
error[E0271]: type mismatch resolving `<impl Iterator as Iterator>::Item == u32`
```

after:
```
error[E0271]: type mismatch resolving `<impl Iterator<Item = usize> as Iterator>::Item == u32`
```

---

Questions:
1. I'm kinda lost in binders hell with this one. Is all of the `rebind`ing necessary?
2. Is there a map collection type that will give me a stable iteration order? Doesn't seem like TraitRef is Ord, so I can't just sort later..
3. I removed the logic that suppresses printing generator projection types. It creates outputs like this [gist](https://gist.github.com/compiler-errors/d6f12fb30079feb1ad1d5f1ab39a3a8d). Should I put that back?
4. I also added spaces between traits, `impl A+B` -> `impl A + B`. I quite like this change, but is there a good reason to keep it like that?

r? ````@estebank````
…aelwoerister

Do not visit attributes in `ItemLowerer`.

By default, AST visitors visit expressions that appear in key-value attributes.
Those expressions should not be lowered to HIR, as they do not correspond to actually compiled code.

Since an attribute cannot produce meaningful HIR, just skip them altogether.

Fixes rust-lang#81886
Fixes rust-lang#90873
r? `@michaelwoerister`
…li-obk

explain why CTFE/Miri perform truncation on shift offset

Closes rust-lang/miri#1920
…=wesleywiser

Remove `-Z force-overflow-checks`

It was replaced several years ago by the stable option `-C overflow-checks`.
The goal was to delete the `-Z` flag once users had migrated [1].
Now that it's been several years, it makes sense to delete the old flag.

See also the discussion on Zulip [2].

[1]: rust-lang#33134 (comment)
[2]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/overflow.20checks/near/262497224

r? ```@wesleywiser```
cc ```@RalfJung```
@rustbot rustbot added the rollup A PR which is a rollup label Nov 25, 2021
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Nov 25, 2021

📌 Commit 984e644 has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 25, 2021
@bors
Copy link
Contributor

bors commented Nov 25, 2021

⌛ Testing commit 984e644 with merge 37a4971...

@bors
Copy link
Contributor

bors commented Nov 25, 2021

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 37a4971 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 25, 2021
@bors bors merged commit 37a4971 into rust-lang:master Nov 25, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 25, 2021
@matthiaskrgr matthiaskrgr deleted the rollup-iuz3gxq branch November 25, 2021 19:49
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (37a4971): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants