rust/tests/ui/feature-gates/feature-gate-autodiff-use.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
645 B
Rust
Raw Normal View History

//@ revisions: has_support no_support
//@[no_support] ignore-enzyme
//@[has_support] needs-enzyme
// This checks that without enabling the autodiff feature, we can't import std::autodiff::autodiff;
#![crate_type = "lib"]
use std::autodiff::autodiff;
//[has_support]~^ ERROR use of unstable library feature `autodiff`
//[no_support]~^^ ERROR use of unstable library feature `autodiff`
#[autodiff(dfoo, Reverse)]
//[has_support]~^ ERROR use of unstable library feature `autodiff` [E0658]
//[no_support]~^^ ERROR use of unstable library feature `autodiff` [E0658]
//[no_support]~| ERROR this rustc version does not support autodiff
fn foo() {}