diff --git a/pkgs/racket-test-core/tests/racket/cstruct.rktl b/pkgs/racket-test-core/tests/racket/cstruct.rktl index 2c28e3f2df..69134cfdd4 100644 --- a/pkgs/racket-test-core/tests/racket/cstruct.rktl +++ b/pkgs/racket-test-core/tests/racket/cstruct.rktl @@ -72,12 +72,14 @@ (syntax-test #'(define-cstruct x ())) (syntax-test #'(define-cstruct #f ())) (syntax-test #'(define-cstruct _y (y))) -(syntax-test #'(define-cstruct _y () #:alignment)) -(syntax-test #'(define-cstruct _y () #:alignment 2 #:alignment 2)) -(syntax-test #'(define-cstruct _y () #:property)) -(syntax-test #'(define-cstruct _y () #:property x)) -(syntax-test #'(define-cstruct _y () #:property x y . 10)) -(syntax-test #'(define-cstruct _y () #:no-equal #:no-equal)) +(syntax-test #'(define-cstruct _y ([x _int]) #:alignment) #rx"missing expression for #:alignment") +(syntax-test #'(define-cstruct _y ([x _int]) #:alignment 2 #:alignment 2) #rx"multiple specifications of #:alignment") +(syntax-test #'(define-cstruct _y ([x _int]) #:malloc-mode) #rx"missing expression for #:malloc-mode") +(syntax-test #'(define-cstruct _y ([x _int]) #:malloc-mode 'atomic #:malloc-mode 'atomic) #rx"multiple specifications of #:malloc-mode") +(syntax-test #'(define-cstruct _y ([x _int]) #:property) #rx"missing property expression for #:property") +(syntax-test #'(define-cstruct _y ([x _int]) #:property x) #rx"missing value expression for #:property") +(syntax-test #'(define-cstruct _y ([x _int]) #:property x y . 10)) +(syntax-test #'(define-cstruct _y ([x _int]) #:no-equal #:no-equal) #rx"multiple specifications of #:no-equal") ;; ---------------------------------------- ;; Check struct properties and subtypes: diff --git a/racket/collects/ffi/unsafe.rkt b/racket/collects/ffi/unsafe.rkt index 6cb137b2a9..3281eb0c69 100644 --- a/racket/collects/ffi/unsafe.rkt +++ b/racket/collects/ffi/unsafe.rkt @@ -1627,7 +1627,7 @@ [(#:malloc-mode m . rest) (not malloc-mode) (loop #'rest alignment #'m properties property-bindings no-equal?)] - [(#:alignment m . rest) + [(#:malloc-mode m . rest) (err "multiple specifications of #:malloc-mode" (head))] [(#:property) (err "missing property expression for #:property" (head))] [(#:property prop) (err "missing value expression for #:property" (head))]