Skip to content

Commit

Permalink
remove nightly feature
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Jun 1, 2022
1 parent c29280c commit aac67de
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 47 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,3 @@ jobs:
- name: Run compile-fail tests
if: matrix.rust-version == 'stable'
run: cargo test -- ui_compile_fail

- name: Build with nightly feature
if: matrix.rust-version == 'nightly'
run: cargo build --features=nightly
- name: Run tests with nightly feature
if: matrix.rust-version == 'nightly'
run: cargo test --features=nightly -- --skip ui_compile_fail
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ rust-version = "1.37"
[lib]
proc-macro = true

[features]
nightly = []

[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
Expand Down
13 changes: 0 additions & 13 deletions src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,6 @@ pub(crate) fn find_suitable_param_names(trait_def: &ItemTrait) -> (Ident, Lifeti
(ty_name, lt)
}

/// On nightly, we use `def_site` hygiene which puts our names into another
/// universe than the names of the user. This is not strictly required as our
/// name is already pretty much guaranteed to not conflict with another name,
/// but this is cleaner and just the correct thing to do.
#[cfg(feature = "nightly")]
fn param_span() -> Span2 {
crate::proc_macro::Span::def_site().into()
}

/// On stable, we use `call_site()` hygiene. That means that our names could
/// theoretically collide with names of the user. But we made sure this doesn't
/// happen.
#[cfg(not(feature = "nightly"))]
fn param_span() -> Span2 {
Span2::call_site()
}
24 changes: 0 additions & 24 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,30 +202,6 @@
//! }
//! }
//! ```
//!
//!
//! # The `nightly` feature gate
//!
//! By default, this crate compiles on stable. If you don't need stable support,
//! you can enable the `nightly` feature of this crate:
//!
//! ```toml
//! [dependencies]
//! auto_impl = { version = "*", features = ["nightly"] }
//! ```
//!
//! The nightly feature enables a few additional features that are not
//! available on stable yet. Currently, you get these advantages:
//! - All idents generated by auto_impl use the `def_site` hygiene and
//! therefore will never ever have name collisions with user written idents.
//! Note that `auto_impl` already (even without nightly feature) takes care
//! that idents never collide, if possible. But `def_site` hygiene is still
//! technically the more correct solution.
#![cfg_attr(
feature = "nightly",
feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)
)]
extern crate proc_macro;
#[macro_use]
Expand Down

0 comments on commit aac67de

Please sign in to comment.