Skip to content

Commit

Permalink
rustc: Remove some long deprecated features:
Browse files Browse the repository at this point in the history
* no_split_stack was renamed to no_stack_check
* deriving was renamed to derive
* `use foo::mod` was renamed to `use foo::self`;
* legacy lifetime definitions in closures have been replaced with `for` syntax
* `fn foo() -> &A + B` has been deprecated for some time (needs parens)
* Obsolete `for Sized?` syntax
* Obsolete `Sized? Foo` syntax
* Obsolete `|T| -> U` syntax
  • Loading branch information
alexcrichton committed Mar 19, 2015
1 parent 46f649c commit f945190
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 379 deletions.
5 changes: 0 additions & 5 deletions src/librustc_trans/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,6 @@ pub fn set_llvm_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: Val
let mut used = true;
match &attr.name()[..] {
"no_stack_check" => unset_split_stack(llfn),
"no_split_stack" => {
unset_split_stack(llfn);
ccx.sess().span_warn(attr.span,
"no_split_stack is a deprecated synonym for no_stack_check");
}
"cold" => unsafe {
llvm::LLVMAddFunctionAttribute(llfn,
llvm::FunctionIndex as c_uint,
Expand Down
10 changes: 0 additions & 10 deletions src/libsyntax/ext/deriving/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ pub mod totalord;

pub mod generic;

fn expand_deprecated_deriving(cx: &mut ExtCtxt,
span: Span,
_: &MetaItem,
_: &Item,
_: &mut FnMut(P<Item>)) {
cx.span_err(span, "`deriving` has been renamed to `derive`");
}

fn expand_derive(cx: &mut ExtCtxt,
_: Span,
mitem: &MetaItem,
Expand Down Expand Up @@ -151,8 +143,6 @@ macro_rules! derive_traits {

env.insert(intern("derive"),
Modifier(Box::new(expand_derive)));
env.insert(intern("deriving"),
Decorator(Box::new(expand_deprecated_deriving)));
}

fn is_builtin_trait(name: &str) -> bool {
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
("no_mangle", Normal),
("no_link", Normal),
("derive", Normal),
("deriving", Normal), // deprecation err in expansion
("should_fail", Normal),
("should_panic", Normal),
("ignore", Normal),
Expand Down Expand Up @@ -259,7 +258,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
("link_section", Whitelisted),
("no_builtins", Whitelisted),
("no_mangle", Whitelisted),
("no_split_stack", Whitelisted),
("no_stack_check", Whitelisted),
("packed", Whitelisted),
("static_assert", Gated("static_assert",
Expand Down
19 changes: 0 additions & 19 deletions src/libsyntax/parse/obsolete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ use ptr::P;
/// The specific types of unsupported syntax
#[derive(Copy, PartialEq, Eq, Hash)]
pub enum ObsoleteSyntax {
Sized,
ForSized,
ClosureType,
ClosureKind,
EmptyIndex,
}
Expand All @@ -49,27 +46,11 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
/// Reports an obsolete syntax non-fatal error.
fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
let (kind_str, desc, error) = match kind {
ObsoleteSyntax::ForSized => (
"for Sized?",
"no longer required. Traits (and their `Self` type) do not have the `Sized` bound \
by default",
true,
),
ObsoleteSyntax::ClosureType => (
"`|usize| -> bool` closure type",
"use unboxed closures instead, no type annotation needed",
true,
),
ObsoleteSyntax::ClosureKind => (
"`:`, `&mut:`, or `&:`",
"rely on inference instead",
true,
),
ObsoleteSyntax::Sized => (
"`Sized? T` for removing the `Sized` bound",
"write `T: ?Sized` instead",
true,
),
ObsoleteSyntax::EmptyIndex => (
"[]",
"write `[..]` instead",
Expand Down
Loading

0 comments on commit f945190

Please sign in to comment.