-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update rust nightly version and fix builds #22
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
==========================================
- Coverage 77.44% 77.18% -0.27%
==========================================
Files 15 15
Lines 838 837 -1
==========================================
- Hits 649 646 -3
- Misses 189 191 +2
Continue to review full report at Codecov.
|
I've blindly followed rustc's hint at adding the trait bounds for Let's step back and think what the lifetime means on a ConnectionType. Here, we are essentially asking the implementation of a Now, why are additional bounds required on Let's try and replicate this error with a minimal example. My first attempt does not produce the error: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#scheduled-events #![feature(generic_associated_types)]
trait NetworkResource<WorldType> {
type ConnectionType<'a> : Connection<WorldType>;
}
trait Connection<WorldType> {} Could it be triggered by the use of this associated type in the trait methods? |
Indeed, using this generic associated type when reborrowing gives us the error: #![feature(generic_associated_types)]
trait NetworkResource {
type ConnectionType<'a> : Connection;
fn get(&self) -> Self::ConnectionType<'_>;
}
trait Connection {}
|
See rust-lang/rust#87479 If I'm understanding this correctly, the following bounds means that we are guaranteeing that the type constructor type ConnectionType<'a>
where
Self: 'a,
WorldType: 'a; This prevents some surprising and confusing errors downstream where certain implementations of If we didn't have these bounds added, even though we're only using |
proc_macro_is_available
is now stabilised in rust 1.57, and updated 3rd party libraries have started using them, causing them to break with old rust compiler versions.When updating the rust version, the generic associated types in
NetworkResource::ConenctionType
now requires additional trait bounds.The
test_env_log
is also deprecated and renamed totest_log
.