Skip to content

Commit 2587d3d

Browse files
committed
Also test in release mode in CI
1 parent 75a1a08 commit 2587d3d

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ jobs:
233233
# Allows installing for a different base target
234234
target: ${{ matrix.rust.target || matrix.target }}
235235

236+
- name: Build
237+
uses: actions-rs/cargo@v1
238+
with:
239+
command: build
240+
args: ${{ matrix.args }}
241+
236242
- name: Check documentation
237243
uses: actions-rs/cargo@v1
238244
with:
@@ -251,6 +257,12 @@ jobs:
251257
command: test
252258
args: --no-fail-fast --features ${{ env.FEATURES }} ${{ matrix.args }} ${{ matrix.test-args }}
253259

260+
- name: Test in release mode
261+
uses: actions-rs/cargo@v1
262+
with:
263+
command: test
264+
args: --no-fail-fast --features ${{ env.FEATURES }} ${{ matrix.args }} ${{ matrix.test-args }} --release
265+
254266
- name: Test with unstable features
255267
if: matrix.rust.toolchain == 'nightly'
256268
uses: actions-rs/cargo@v1

objc2/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub mod __gnustep_hack {
180180
}
181181

182182
pub unsafe fn get_class_to_force_linkage() -> &'static Class {
183-
unsafe { &_OBJC_CLASS_NSObject }
183+
unsafe { core::ptr::read_volatile(&&_OBJC_CLASS_NSObject) }
184184
}
185185

186186
#[test]

objc2/src/rc/autorelease.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ impl !AutoreleaseSafe for AutoreleasePool {}
276276
/// });
277277
/// ```
278278
///
279-
/// Incorrect usage which panics because we tried to pass an outer pool to an
280-
/// inner pool:
279+
/// Incorrect usage which panics (with debug assertions enabled) because we
280+
/// tried to pass an outer pool to an inner pool:
281281
///
282282
#[cfg_attr(feature = "unstable_autoreleasesafe", doc = "```compile_fail")]
283283
#[cfg_attr(not(feature = "unstable_autoreleasesafe"), doc = "```should_panic")]
@@ -300,6 +300,8 @@ impl !AutoreleaseSafe for AutoreleasePool {}
300300
/// // assigned to the outer pool, even though it was released by the
301301
/// // inner pool already.
302302
/// });
303+
/// #
304+
/// # panic!("Does not panic in release mode, so for testing we make it!");
303305
/// ```
304306
#[doc(alias = "@autoreleasepool")]
305307
pub fn autoreleasepool<T, F>(f: F) -> T

0 commit comments

Comments
 (0)