rust/src/test/compile-fail/gated-unsafe-destructor.rs
Felix S. Klock II 5c3a0b191e Add tests checking that a number of feature gates are gating their features.
Namely:

 * `quote`
 * `link_args`
 * `link_llvm_intrinsics`
 * `thread_local`
 * `unsafe_destructor`

Also updates test for `plugin_registrar` to make it clear that
it is only testing the `plugin_registrar` feature gate.

Cc #22820.
2015-03-09 19:18:43 +01:00

24 lines
832 B
Rust

// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Test that `#[unsafe_destructor]` attribute is gated by `unsafe_destructor`
// feature gate.
struct D<'a>(&'a u32);
#[unsafe_destructor]
impl<'a> Drop for D<'a> {
//~^ ERROR `#[unsafe_destructor]` allows too many unsafe patterns
fn drop(&mut self) { }
}
//~^ HELP: add #![feature(unsafe_destructor)] to the crate attributes to enable
pub fn main() { }