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

Stability annotations on generic parameters (take 2) #72314

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test removing unstable default parameter
Avi-D-coder committed Jul 13, 2020
commit c1650b37575bc128d66290bf942da33a3a2ad60c
Original file line number Diff line number Diff line change
@@ -109,3 +109,15 @@ impl<T> Box2<T, System> {
Self { ptr: &mut t, alloc: System {} }
}
}

#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub struct Box3<T> {
ptr: *mut T,
}

impl<T> Box3<T> {
#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub fn new(mut t: T) -> Self {
Self { ptr: &mut t }
}
}
2 changes: 2 additions & 0 deletions src/test/ui/stability-attribute/generics-default-stability.rs
Original file line number Diff line number Diff line change
@@ -115,4 +115,6 @@ fn main() {

let _: Box2<isize, System> = Box2::new(1); // ok
let _: Box2<isize> = Box2::new(1); // ok

let _: Box3<isize> = Box3::new(1); // ok
}