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

[Merged by Bors] - Remove an outdated workaround for impl Trait #5659

Closed
wants to merge 2 commits into from

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Aug 12, 2022

Objective

Rust 1.63 resolved an issue that prevents you from combining explicit generic arguments with impl Trait arguments.

Now, we no longer need to use dynamic dispatch to work around this.

Migration Guide

The methods Schedule::get_stage and get_stage_mut now accept impl StageLabel instead of &dyn StageLabel.

Before

let stage = schedule.get_stage_mut::<SystemStage>(&MyLabel)?;

After

let stage = schedule.get_stage_mut::<SystemStage>(MyLabel)?;

Copy link
Contributor

@BorisBoutillier BorisBoutillier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked we have no additional reference to get_stage/get_stage_mut in bevy source code then the one updated.

@rparrett rparrett added C-Code-Quality A section of code that is hard to understand or change A-ECS Entities, components, systems, and events labels Aug 12, 2022
@JoJoJet JoJoJet marked this pull request as ready for review August 13, 2022 13:58
@TimJentzsch
Copy link
Contributor

TimJentzsch commented Aug 13, 2022

@JoJoJet If you rebase/merge the latest main, the CI should work again.

@JoJoJet
Copy link
Member Author

JoJoJet commented Aug 13, 2022

@TimJentzsch Thanks! I appreciate it

crates/bevy_ecs/src/schedule/mod.rs Outdated Show resolved Hide resolved
@NiklasEi NiklasEi added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Aug 13, 2022
@cart
Copy link
Member

cart commented Aug 16, 2022

bors r+

@cart
Copy link
Member

cart commented Aug 16, 2022

bors retry

bors bot pushed a commit that referenced this pull request Aug 16, 2022
# Objective

Rust 1.63 resolved [an issue](rust-lang/rust#83701) that prevents you from combining explicit generic arguments with `impl Trait` arguments.

Now, we no longer need to use dynamic dispatch to work around this.

## Migration Guide

The methods `Schedule::get_stage` and `get_stage_mut` now accept `impl StageLabel` instead of `&dyn StageLabel`.

### Before
```rust
let stage = schedule.get_stage_mut::<SystemStage>(&MyLabel)?;
```

### After
```rust
let stage = schedule.get_stage_mut::<SystemStage>(MyLabel)?;
```
@bors
Copy link
Contributor

bors bot commented Aug 16, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Aug 16, 2022
# Objective

Rust 1.63 resolved [an issue](rust-lang/rust#83701) that prevents you from combining explicit generic arguments with `impl Trait` arguments.

Now, we no longer need to use dynamic dispatch to work around this.

## Migration Guide

The methods `Schedule::get_stage` and `get_stage_mut` now accept `impl StageLabel` instead of `&dyn StageLabel`.

### Before
```rust
let stage = schedule.get_stage_mut::<SystemStage>(&MyLabel)?;
```

### After
```rust
let stage = schedule.get_stage_mut::<SystemStage>(MyLabel)?;
```
@bors bors bot changed the title Remove an outdated workaround for impl Trait [Merged by Bors] - Remove an outdated workaround for impl Trait Aug 17, 2022
@bors bors bot closed this Aug 17, 2022
maccesch pushed a commit to Synphonyte/bevy that referenced this pull request Sep 28, 2022
# Objective

Rust 1.63 resolved [an issue](rust-lang/rust#83701) that prevents you from combining explicit generic arguments with `impl Trait` arguments.

Now, we no longer need to use dynamic dispatch to work around this.

## Migration Guide

The methods `Schedule::get_stage` and `get_stage_mut` now accept `impl StageLabel` instead of `&dyn StageLabel`.

### Before
```rust
let stage = schedule.get_stage_mut::<SystemStage>(&MyLabel)?;
```

### After
```rust
let stage = schedule.get_stage_mut::<SystemStage>(MyLabel)?;
```
@rparrett rparrett added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Oct 26, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# Objective

Rust 1.63 resolved [an issue](rust-lang/rust#83701) that prevents you from combining explicit generic arguments with `impl Trait` arguments.

Now, we no longer need to use dynamic dispatch to work around this.

## Migration Guide

The methods `Schedule::get_stage` and `get_stage_mut` now accept `impl StageLabel` instead of `&dyn StageLabel`.

### Before
```rust
let stage = schedule.get_stage_mut::<SystemStage>(&MyLabel)?;
```

### After
```rust
let stage = schedule.get_stage_mut::<SystemStage>(MyLabel)?;
```
@JoJoJet JoJoJet deleted the impl-trait-arg branch December 1, 2022 15:05
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

Rust 1.63 resolved [an issue](rust-lang/rust#83701) that prevents you from combining explicit generic arguments with `impl Trait` arguments.

Now, we no longer need to use dynamic dispatch to work around this.

## Migration Guide

The methods `Schedule::get_stage` and `get_stage_mut` now accept `impl StageLabel` instead of `&dyn StageLabel`.

### Before
```rust
let stage = schedule.get_stage_mut::<SystemStage>(&MyLabel)?;
```

### After
```rust
let stage = schedule.get_stage_mut::<SystemStage>(MyLabel)?;
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for explicit_generic_args_with_impl_trait
6 participants