Skip to content

Commit

Permalink
Test removing unstable default parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-D-coder authored and Jacob Hughes committed Sep 23, 2020
1 parent a73e7d0 commit d281620
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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
}

0 comments on commit d281620

Please sign in to comment.