Skip to content

Commit

Permalink
Initial release candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhenrymantilla committed Jul 20, 2023
1 parent 6f73624 commit 49852e1
Show file tree
Hide file tree
Showing 17 changed files with 1,070 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template
[alias]
docs-rs = [
"doc", "--no-deps", "--open",
"--features", "docs-rs",
]

[build]
rustdocflags = [
"--html-before-content", "fix-docsrs-li-details-summary.html",
]

[doc.extern-map.registries]
crates-io = "https://docs.rs/"

[profile.rust-analyzer]
inherits = "dev"
109 changes: 109 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- master
pull_request:

jobs:
# == CHECK == #
check:
name: "Check beta stable and MSRV=1.65.0"
runs-on: ubuntu-latest
strategy:
matrix:
rust-toolchain:
- 1.65.0
- stable
# Try to guard against a near-future regression.
- beta
cargo-locked: ['', '--locked']
feature-nightly-dropck_eyepatch: ['', '--features nightly-dropck_eyepatch']
exclude:
# MSRV guarantee only stands for `.lock`-tested dependencies.
- rust-toolchain: 1.65.0
cargo-locked: ''
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust-toolchain }}
override: true

- name: Clone repo
uses: actions/checkout@v2

- name: Update `Cargo.lock`
if: matrix.cargo-locked != '--locked'
run: cargo update -v

- name: Cargo check
uses: actions-rs/cargo@v1
env:
RUSTC_BOOTSTRAP: 1
with:
command: check
args: ${{ matrix.cargo-locked }} ${{ matrix.feature-nightly-dropck_eyepatch }}

# == BUILD & TEST == #
build-and-test:
name: Build and test
runs-on: ${{ matrix.os }}
needs: []
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust-toolchain:
- 1.65.0
- stable
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
override: true
toolchain: ${{ matrix.rust-toolchain }}

- name: Clone repo
uses: actions/checkout@v2

- name: cargo test --lib --tests
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --tests

- name: cargo test --doc
if: matrix.rust-toolchain == 'stable'
uses: actions-rs/cargo@v1
env:
RUSTC_BOOTSTRAP: 1
with:
command: test
args: --features better-docs --doc

required-jobs:
needs:
- check
- build-and-test
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: 'All required jobs'
run: |
RESULT=$(echo "${{ join(needs.*.result, '') }}" | sed -e "s/success//g")
if [ -n "$RESULT" ]; then
echo "❌"
false
fi
echo "✅"
57 changes: 57 additions & 0 deletions .github/workflows/future-proof.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template
name: Cron CI

on:
push:
branches:
- master
schedule:
- cron: '0 8 * * 1,5'

jobs:
# == TEST == #
test-no-ui:
name: (Check & Build &) Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust-toolchain:
# Future-proof against compiler-regressions
- beta
- nightly
cargo-locked: ['--locked']
feature-nightly-dropck_eyepatch: ['', '--features nightly-dropck_eyepatch']
include:
# Also future-proof against semver breakage from dependencies.
- rust-toolchain: stable
cargo-locked: ''
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
override: true
toolchain: ${{ matrix.rust-toolchain }}

- name: Clone repo
uses: actions/checkout@v2

- name: Update `Cargo.lock`
if: matrix.cargo-locked != '--locked'
run: cargo update -v

- name: Cargo test
uses: actions-rs/cargo@v1
env:
RUSTC_BOOTSTRAP: 1
with:
command: test
args: |
--features better-docs
${{ matrix.cargo-locked }}
${{ matrix.feature-nightly-dropck_eyepatch }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template
/target
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template
[package]
name = "maybe-dangling"
authors = [
"Daniel Henry-Mantilla <[email protected]>",
]
version = "0.1.0-rc1" # Keep in sync
edition = "2021"
rust-version = "1.65.0"

license = "Zlib OR MIT OR Apache-2.0"
repository = "https://github.com/danielhenrymantilla/maybe-dangling.rs"
documentation = "https://docs.rs/maybe-dangling"
readme = "README.md"

description = "`ManuallyDrop<T>` and `MaybeDangling<T>` semantics in stable Rust as per https://github.com/rust-lang/rfcs/pull/3336"
keywords = ["unsafe", "dangling", "aliasing", "dereferenceable", "manuallydrop"]

[features]
default = [
]

# Enable and use `#![feature(dropck_eyepatch)]` for `MaybeDangling`.
nightly-dropck_eyepatch = []

# unstable! Will probably use nightly to improve doc quality
better-docs = []

ui-tests = [
"better-docs",
]

# `docs-rs` is very similar to `better-docs`, but for it being allowed to enable
# other features as well, often to make sure optional/non-`default` features
# make it to the rendered docs (using `--all-features` instead is not that great).
docs-rs = [
"better-docs",
]

[dependencies]

[dev-dependencies]

[workspace]

[package.metadata.docs.rs]
features = [
"docs-rs",
]
rustdoc-args = [
# Use (with or without `open`):
# ```md
# <details open class="custom"><summary><span class="summary-box"><span>Click to hide</span></span></summary>
#
# </details>
# ```
# to get nice drop-down menus (and avoid the css bug with rustdoc).
"--html-before-content", "fix-docsrs-li-details-summary.html",
]
Loading

0 comments on commit 49852e1

Please sign in to comment.