Skip to content

Commit d49bd6d

Browse files
authored
v0.7 deprecation fixes (#5)
* v0.7 deprecation fixes * allow test failures on nightly
1 parent 02f7ebe commit d49bd6d

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ os:
66
julia:
77
- 0.6
88
- nightly
9+
matrix:
10+
allow_failures:
11+
- julia: nightly
912
notifications:
1013
email: false
1114
git:

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
julia 0.6
22
StaticArrays 0.5.0
3+
Compat 0.45.0

src/DiffResults.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ __precompile__()
33
module DiffResults
44

55
using StaticArrays
6+
using Compat
67

78
#########
89
# Types #
@@ -156,7 +157,7 @@ instance will be created and returned, whereas if `r::MutableDiffResult`, then `
156157
mutated in-place and returned. Thus, this function should be called as `r = value!(r, x)`.
157158
"""
158159
value!(r::MutableDiffResult, x::Number) = (r.value = x; return r)
159-
value!(r::MutableDiffResult, x::AbstractArray) = (copy!(value(r), x); return r)
160+
value!(r::MutableDiffResult, x::AbstractArray) = (copyto!(value(r), x); return r)
160161
value!(r::ImmutableDiffResult{O,V}, x::Union{Number,AbstractArray}) where {O,V} = ImmutableDiffResult(convert(V, x), r.derivs)
161162

162163
"""
@@ -198,7 +199,7 @@ function derivative!(r::MutableDiffResult, x::Number, ::Type{Val{i}} = Val{1}) w
198199
end
199200

200201
function derivative!(r::MutableDiffResult, x::AbstractArray, ::Type{Val{i}} = Val{1}) where {i}
201-
copy!(derivative(r, Val{i}), x)
202+
copyto!(derivative(r, Val{i}), x)
202203
return r
203204
end
204205

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using DiffResults, StaticArrays
2-
using Base.Test
2+
using Compat
3+
using Compat.Test
34

45
using DiffResults: DiffResult, GradientResult, JacobianResult, HessianResult,
56
value, value!, derivative, derivative!, gradient, gradient!,

0 commit comments

Comments
 (0)