Skip to content

Commit

Permalink
ci: circumvent near#1211 with sufficient highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Jun 28, 2024
1 parent 1ca16a4 commit e98b53f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
rs: 1.76.0
- os: macos-latest
rs: 1.78.0
features: ['', '--features unstable,legacy,abi']
features: ['', '--features unstable,legacy,__abi-generate']
steps:
- uses: actions/checkout@v3
- name: "${{ matrix.platform.rs }} with rustfmt, and wasm32"
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
default: true
- uses: Swatinem/rust-cache@v1
- name: Compilation tests
run: cargo test --package near-sdk --test compilation_tests --features abi --features unstable -- compilation_tests --exact --nocapture
run: cargo test --package near-sdk --test compilation_tests --features __abi-generate --features unstable -- compilation_tests --exact --nocapture
windows:
name: Windows
runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions near-sdk/compilation_tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ fn compilation_tests() {
t.pass("compilation_tests/init_function.rs");
t.pass("compilation_tests/init_ignore_state.rs");
t.pass("compilation_tests/no_default.rs");
// TODO: unignore upon resolution of https://github.com/near/near-sdk-rs/issues/1211
// t.pass("compilation_tests/lifetime_method_result.rs");
t.pass("compilation_tests/lifetime_method.rs");
t.pass("compilation_tests/cond_compilation.rs");
t.compile_fail("compilation_tests/payable_view.rs");
Expand Down
4 changes: 2 additions & 2 deletions near-sdk/compilation_tests/lifetime_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ struct Ident {

#[near]
impl Ident {
pub fn is_ident<'a>(&self, other: &'a u32) -> Option<&'a u32> {
pub fn is_ident<'a>(&self, other: &'a u32) -> Option<u32> {
if *other == self.value {
Some(other)
Some(*other)
} else {
None
}
Expand Down
22 changes: 22 additions & 0 deletions near-sdk/compilation_tests/lifetime_method_result.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//! Method signature uses lifetime.
use near_sdk::near;

#[near(contract_state)]
#[derive(Default)]
struct Ident {
value: u32,
}

#[near]
impl Ident {
pub fn is_ident<'a>(&self, other: &'a u32) -> Option<&'a u32> {
if *other == self.value {
Some(other)
} else {
None
}
}
}

fn main() {}

0 comments on commit e98b53f

Please sign in to comment.