Skip to content

Commit a856c14

Browse files
LilithHafnerDilumAluthge
authored andcommitted
Do not load ScopedValues with using (JuliaLang#55452)
Stop loading `ScopedValues` with `using` so folks use `ScopedValues.with` or `using ScopedValues` rather than `Base.with`. Implements JuliaLang#55095 (comment) ~Have to bump the StyledStrings stdlib to include JuliaLang/StyledStrings.jl#80 Done --------- Co-authored-by: Dilum Aluthge <[email protected]>
1 parent 98f2249 commit a856c14

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

base/Base.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ include("weakkeydict.jl")
424424

425425
# ScopedValues
426426
include("scopedvalues.jl")
427-
using .ScopedValues
428427

429428
# metaprogramming
430429
include("meta.jl")

base/logging/logging.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module CoreLogging
44

55
import Base: isless, +, -, convert, show
6-
import Base: ScopedValue, with, @with
6+
import Base.ScopedValues: ScopedValue, with, @with
77

88
export
99
AbstractLogger,

base/mpfr.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ end
109109
tie_breaker_is_to_even(::MPFRRoundingMode) = true
110110

111111
const ROUNDING_MODE = Ref{MPFRRoundingMode}(MPFRRoundNearest)
112-
const CURRENT_ROUNDING_MODE = Base.ScopedValue{MPFRRoundingMode}()
112+
const CURRENT_ROUNDING_MODE = Base.ScopedValues.ScopedValue{MPFRRoundingMode}()
113113
const DEFAULT_PRECISION = Ref{Clong}(256)
114-
const CURRENT_PRECISION = Base.ScopedValue{Clong}()
114+
const CURRENT_PRECISION = Base.ScopedValues.ScopedValue{Clong}()
115115
# Basic type and initialization definitions
116116

117117
# Warning: the constants are MPFR implementation details from
@@ -162,7 +162,7 @@ significand_limb_count(x::BigFloat) = div(sizeof(x._d), sizeof(Limb), RoundToZer
162162
rounding_raw(::Type{BigFloat}) = something(Base.ScopedValues.get(CURRENT_ROUNDING_MODE), ROUNDING_MODE[])
163163
setrounding_raw(::Type{BigFloat}, r::MPFRRoundingMode) = ROUNDING_MODE[]=r
164164
function setrounding_raw(f::Function, ::Type{BigFloat}, r::MPFRRoundingMode)
165-
Base.@with(CURRENT_ROUNDING_MODE => r, f())
165+
Base.ScopedValues.@with(CURRENT_ROUNDING_MODE => r, f())
166166
end
167167

168168

@@ -1109,7 +1109,7 @@ Note: `nextfloat()`, `prevfloat()` do not use the precision mentioned by
11091109
The `base` keyword requires at least Julia 1.8.
11101110
"""
11111111
function setprecision(f::Function, ::Type{BigFloat}, prec::Integer; base::Integer=2)
1112-
Base.@with(CURRENT_PRECISION => _convert_precision_from_base(prec, base), f())
1112+
Base.ScopedValues.@with(CURRENT_PRECISION => _convert_precision_from_base(prec, base), f())
11131113
end
11141114

11151115
setprecision(f::Function, prec::Integer; base::Integer=2) = setprecision(f, BigFloat, prec; base)

0 commit comments

Comments
 (0)