Skip to content

Commit e91ab4f

Browse files
authored
[Compiler] fix stdout/stderr to point to Core (#59672)
Followup to #58425 Fixes #56645
1 parent 139dcd9 commit e91ab4f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Compiler/src/Compiler.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ using Core: ABIOverride, Builtin, CodeInstance, IntrinsicFunction, MethodInstanc
4141
MethodTable, MethodCache, PartialOpaque, SimpleVector, TypeofVararg,
4242
_apply_iterate, apply_type, compilerbarrier, donotdelete, memoryref_isassigned,
4343
memoryrefget, memoryrefnew, memoryrefoffset, memoryrefset!, print, println, show, svec,
44-
typename, unsafe_write, write
44+
typename, unsafe_write, write, stdout, stderr
4545

46-
using Base
4746
using Base: @_foldable_meta, @_gc_preserve_begin, @_gc_preserve_end, @nospecializeinfer,
4847
PARTITION_KIND_GLOBAL, PARTITION_KIND_UNDEF_CONST, PARTITION_KIND_BACKDATED_CONST, PARTITION_KIND_DECLARED,
4948
PARTITION_FLAG_DEPWARN,
@@ -68,8 +67,10 @@ using Base: @_foldable_meta, @_gc_preserve_begin, @_gc_preserve_end, @nospeciali
6867
partialstruct_init_undefs, fieldcount_noerror, _eval_import, _eval_using,
6968
get_ci_mi, get_methodtable, morespecific, specializations, has_image_globalref,
7069
PARTITION_MASK_KIND, PARTITION_KIND_GUARD, PARTITION_FLAG_EXPORTED, PARTITION_FLAG_DEPRECATED,
71-
BINDING_FLAG_ANY_IMPLICIT_EDGES, is_some_implicit, IteratorSize, SizeUnknown, get_require_world, JLOptions
70+
BINDING_FLAG_ANY_IMPLICIT_EDGES, is_some_implicit, IteratorSize, SizeUnknown, get_require_world, JLOptions,
71+
devnull, devnull as stdin
7272

73+
using Base
7374
using Base.Order
7475

7576
import Base: ==, _topmod, append!, convert, copy, copy!, findall, first, get, get!,

Compiler/test/validation.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ using Test, Core.IR
44

55
include("setup_Compiler.jl")
66

7+
@testset "stdio validation" begin
8+
for s in (:stdout, :stderr, :print, :println, :write)
9+
@test getglobal(Compiler, s) === getglobal(Core, s)
10+
@test isconst(Compiler, s)
11+
end
12+
@test Compiler.stdin === devnull
13+
@test isconst(Compiler, :stdin)
14+
end
15+
716
function f22938(a, b, x...)
817
nothing
918
nothing

0 commit comments

Comments
 (0)