rust/tests/ui/feature-gates/feature-gate-autodiff-use.rs
dianne d7d6238b23 use backticks instead of single quotes when reporting "use of unstable library feature"
This is consistent with all other diagnostics I could find containing
features and enables the use of `DiagSymbolList` for generalizing
diagnostics for unstable library features to multiple features.
2024-11-03 13:55:52 -08:00

18 lines
645 B
Rust

//@ 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() {}