From the R6RS 2007 specification:
A library definition must have the following form:
(library <library name>
(export <export spec> ...)
(import <import spec> ...)
<library body>)
...
The <library body> is the library body, consisting of a sequence of definitions
followed by a sequence of expressions. The definitions may be both for local
(unexported) and exported bindings, and the expressions are initialization
expressions to be evaluated for their effects.
Thus, for your example code, an error should have been raised.