Skip to content

Commit 9872aad

Browse files
committed
---
yaml --- r: 152718 b: refs/heads/try2 c: ae06747 h: refs/heads/master v: v3
1 parent 3a756cf commit 9872aad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+811
-1228
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0ae4b97c09a5b5c230f5dee9bdcef85951b6e00d
8+
refs/heads/try2: ae067477fbc08e5998756d36b6ab0b82173e5c74
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/guide-unsafe.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ As an example, we give a reimplementation of owned boxes by wrapping
192192
reimplementation is as safe as the `Box` type.
193193

194194
```
195-
#![feature(unsafe_destructor)]
196-
197195
extern crate libc;
198196
use libc::{c_void, size_t, malloc, free};
199197
use std::mem;
@@ -244,12 +242,10 @@ impl<T: Send> Unique<T> {
244242
// A key ingredient for safety, we associate a destructor with
245243
// Unique<T>, making the struct manage the raw pointer: when the
246244
// struct goes out of scope, it will automatically free the raw pointer.
247-
//
248245
// NB: This is an unsafe destructor, because rustc will not normally
249-
// allow destructors to be associated with parameterized types, due to
246+
// allow destructors to be associated with parametrized types, due to
250247
// bad interaction with managed boxes. (With the Send restriction,
251-
// we don't have this problem.) Note that the `#[unsafe_destructor]`
252-
// feature gate is required to use unsafe destructors.
248+
// we don't have this problem.)
253249
#[unsafe_destructor]
254250
impl<T: Send> Drop for Unique<T> {
255251
fn drop(&mut self) {

branches/try2/src/doc/rust.md

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,13 +1940,12 @@ interpreted:
19401940
enum representation in C is undefined, and this may be incorrect when the C
19411941
code is compiled with certain flags.
19421942
- `simd` - on certain tuple structs, derive the arithmetic operators, which
1943-
lower to the target's SIMD instructions, if any; the `simd` feature gate
1944-
is necessary to use this attribute.
1943+
lower to the target's SIMD instructions, if any.
19451944
- `static_assert` - on statics whose type is `bool`, terminates compilation
19461945
with an error if it is not initialized to `true`.
19471946
- `unsafe_destructor` - allow implementations of the "drop" language item
19481947
where the type it is implemented for does not implement the "send" language
1949-
item; the `unsafe_destructor` feature gate is needed to use this attribute
1948+
item.
19501949
- `unsafe_no_drop_flag` - on structs, remove the flag that prevents
19511950
destructors from being run twice. Destructors might be run multiple times on
19521951
the same object with this attribute.
@@ -2301,43 +2300,28 @@ One can indicate the stability of an API using the following attributes:
23012300
These levels are directly inspired by
23022301
[Node.js' "stability index"](http://nodejs.org/api/documentation.html).
23032302

2304-
Stability levels are inherited, so an items's stability attribute is the
2305-
default stability for everything nested underneath it.
2306-
2307-
There are lints for disallowing items marked with certain levels: `deprecated`,
2308-
`experimental` and `unstable`. For now, only `deprecated` warns by default, but
2309-
this will change once the standard library has been stabilized.
2310-
Stability levels are meant to be promises at the crate
2311-
level, so these lints only apply when referencing
2312-
items from an _external_ crate, not to items defined within the
2313-
current crate. Items with no stability level are considered
2314-
to be unstable for the purposes of the lint. One can give an optional
2303+
There are lints for disallowing items marked with certain levels:
2304+
`deprecated`, `experimental` and `unstable`; the first two will warn
2305+
by default. Items with not marked with a stability are considered to
2306+
be unstable for the purposes of the lint. One can give an optional
23152307
string that will be displayed when the lint flags the use of an item.
23162308

2317-
For example, if we define one crate called `stability_levels`:
2318-
23192309
~~~~ {.ignore}
2310+
#![warn(unstable)]
2311+
23202312
#[deprecated="replaced by `best`"]
2321-
pub fn bad() {
2313+
fn bad() {
23222314
// delete everything
23232315
}
23242316
2325-
pub fn better() {
2317+
fn better() {
23262318
// delete fewer things
23272319
}
23282320
23292321
#[stable]
2330-
pub fn best() {
2322+
fn best() {
23312323
// delete nothing
23322324
}
2333-
~~~~
2334-
2335-
then the lints will work as follows for a client crate:
2336-
2337-
~~~~ {.ignore}
2338-
#![warn(unstable)]
2339-
extern crate stability_levels;
2340-
use stability_levels::{bad, better, best};
23412325
23422326
fn main() {
23432327
bad(); // "warning: use of deprecated item: replaced by `best`"

branches/try2/src/liballoc/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969
html_root_url = "http://doc.rust-lang.org/")]
7070

7171
#![no_std]
72-
#![feature(phase, unsafe_destructor)]
73-
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
72+
#![feature(phase)]
7473

7574
#[phase(plugin, link)]
7675
extern crate core;

branches/try2/src/libarena/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2828
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2929
html_root_url = "http://doc.rust-lang.org/")]
30-
31-
#![feature(unsafe_destructor)]
3230
#![allow(missing_doc)]
33-
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
3431

3532
use std::cell::{Cell, RefCell};
3633
use std::cmp;

branches/try2/src/libcollections/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
html_playground_url = "http://play.rust-lang.org/")]
2323

2424
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
25-
#![feature(unsafe_destructor)]
2625
#![no_std]
27-
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
2826

2927
#[phase(plugin, link)] extern crate core;
3028
extern crate alloc;

branches/try2/src/libcore/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@
5555
html_playground_url = "http://play.rust-lang.org/")]
5656

5757
#![no_std]
58-
#![feature(globs, macro_rules, managed_boxes, phase, simd, unsafe_destructor)]
58+
#![feature(globs, macro_rules, managed_boxes, phase, simd)]
5959
#![deny(missing_doc)]
60-
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
6160

6261
#[cfg(test)] extern crate realcore = "core";
6362
#[cfg(test)] extern crate libc;

branches/try2/src/libnative/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,15 @@
5252
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
5353
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
5454
html_root_url = "http://doc.rust-lang.org/")]
55-
5655
#![deny(unused_result, unused_must_use)]
5756
#![allow(non_camel_case_types)]
5857
#![allow(deprecated)]
59-
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
6058
#![feature(default_type_params)]
6159

6260
// NB this crate explicitly does *not* allow glob imports, please seriously
6361
// consider whether they're needed before adding that feature here (the
6462
// answer is that you don't need them)
65-
#![feature(macro_rules, unsafe_destructor)]
63+
#![feature(macro_rules)]
6664

6765
extern crate alloc;
6866
extern crate libc;

branches/try2/src/librustc/driver/driver.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use metadata::common::LinkMeta;
2020
use metadata::creader;
2121
use middle::cfg;
2222
use middle::cfg::graphviz::LabelledCFG;
23-
use middle::{trans, freevars, stability, kind, ty, typeck, lint, reachable};
23+
use middle::{trans, freevars, kind, ty, typeck, lint, reachable};
2424
use middle::dependency_format;
2525
use middle;
2626
use plugin::load::Plugins;
@@ -312,11 +312,8 @@ pub fn phase_3_run_analysis_passes(sess: Session,
312312
time(time_passes, "loop checking", (), |_|
313313
middle::check_loop::check_crate(&sess, krate));
314314

315-
let stability_index = time(time_passes, "stability index", (), |_|
316-
stability::Index::build(krate));
317-
318315
let ty_cx = ty::mk_ctxt(sess, def_map, named_region_map, ast_map,
319-
freevars, region_map, lang_items, stability_index);
316+
freevars, region_map, lang_items);
320317

321318
// passes are timed inside typeck
322319
typeck::check_crate(&ty_cx, trait_map, krate);

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
5050
("log_syntax", Active),
5151
("trace_macros", Active),
5252
("concat_idents", Active),
53-
("unsafe_destructor", Active),
5453

5554
("simd", Active),
5655
("default_type_params", Active),
@@ -221,17 +220,6 @@ impl<'a> Visitor<()> for Context<'a> {
221220
}
222221
}
223222

224-
ast::ItemImpl(..) => {
225-
if attr::contains_name(i.attrs.as_slice(),
226-
"unsafe_destructor") {
227-
self.gate_feature("unsafe_destructor",
228-
i.span,
229-
"`#[unsafe_destructor]` allows too \
230-
many unsafe patterns and may be \
231-
removed in the future");
232-
}
233-
}
234-
235223
_ => {}
236224
}
237225

branches/try2/src/librustc/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ This API is completely unstable and subject to change.
2929
html_root_url = "http://doc.rust-lang.org/")]
3030

3131
#![allow(deprecated)]
32-
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
33-
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote)]
34-
#![feature(default_type_params, phase, unsafe_destructor)]
32+
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
33+
default_type_params, phase)]
3534

3635
extern crate arena;
3736
extern crate debug;
@@ -81,7 +80,6 @@ pub mod middle {
8180
pub mod weak_lang_items;
8281
pub mod save;
8382
pub mod intrinsicck;
84-
pub mod stability;
8583
}
8684

8785
pub mod front {

branches/try2/src/librustc/metadata/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ pub static tag_method_argument_name: uint = 0x8f;
210210
pub static tag_reachable_extern_fns: uint = 0x90;
211211
pub static tag_reachable_extern_fn_id: uint = 0x91;
212212

213-
pub static tag_items_data_item_stability: uint = 0x92;
214-
215-
216213
#[deriving(Clone, Show)]
217214
pub struct LinkMeta {
218215
pub crateid: CrateId,

branches/try2/src/librustc/metadata/csearch.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use serialize::ebml::reader;
2525
use std::rc::Rc;
2626
use syntax::ast;
2727
use syntax::ast_map;
28-
use syntax::attr;
2928
use syntax::diagnostic::expect;
3029
use syntax::parse::token;
3130

@@ -329,10 +328,3 @@ pub fn is_typedef(cstore: &cstore::CStore, did: ast::DefId) -> bool {
329328
let cdata = cstore.get_crate_data(did.krate);
330329
decoder::is_typedef(&*cdata, did.node)
331330
}
332-
333-
pub fn get_stability(cstore: &cstore::CStore,
334-
def: ast::DefId)
335-
-> Option<attr::Stability> {
336-
let cdata = cstore.get_crate_data(def.krate);
337-
decoder::get_stability(&*cdata, def.node)
338-
}

branches/try2/src/librustc/metadata/decoder.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,6 @@ pub fn get_type(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
439439
}
440440
}
441441

442-
pub fn get_stability(cdata: Cmd, id: ast::NodeId) -> Option<attr::Stability> {
443-
let item = lookup_item(id, cdata.data());
444-
reader::maybe_get_doc(item, tag_items_data_item_stability).map(|doc| {
445-
let mut decoder = reader::Decoder::new(doc);
446-
Decodable::decode(&mut decoder).unwrap()
447-
})
448-
}
449-
450442
pub fn get_impl_trait(cdata: Cmd,
451443
id: ast::NodeId,
452444
tcx: &ty::ctxt) -> Option<Rc<ty::TraitRef>>

0 commit comments

Comments
 (0)