diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-11-06 15:16:04 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-11-11 10:40:34 -0800 |
| commit | 7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff (patch) | |
| tree | c00e95dee93195cb7744c4a37ea1d4d438db9456 /src/libsyntax | |
| parent | 4059b5c4b3b8a57a645982b0770d25f0283dfb06 (diff) | |
| download | rust-7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff.tar.gz rust-7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff.zip | |
Remove #[fixed_stack_segment] and #[rust_stack]
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 78 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 2 |
3 files changed, 2 insertions, 79 deletions
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 736f92910af..838ce4a6309 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -201,7 +201,6 @@ fn print_maybe_styled(msg: &str, color: term::attr::Attr) { let stderr = @mut io::stderr() as @mut io::Writer; fn is_stderr_screen() -> bool { - #[fixed_stack_segment]; use std::libc; unsafe { libc::isatty(libc::STDERR_FILENO) != 0 } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index b74349da2a9..f8155ae2e6b 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -959,84 +959,6 @@ pub fn std_macros() -> @str { pub static $name: ::std::local_data::Key<$ty> = &::std::local_data::Key; ) ) - - /// externfn! declares a wrapper for an external function. - /// It is intended to be used like: - /// - /// externfn!(#[nolink] - /// fn memcmp(cx: *u8, ct: *u8, n: u32) -> u32) - /// - /// Due to limitations in the macro parser, this pattern must be - /// implemented with 4 distinct patterns (with attrs / without - /// attrs CROSS with args / without ARGS). - /// - /// Also, this macro grammar allows for any number of return types - /// because I couldn't figure out the syntax to specify at most one. - macro_rules! externfn( - (fn $name:ident () $(-> $ret_ty:ty),*) => ( - pub unsafe fn $name() $(-> $ret_ty),* { - // Note: to avoid obscure bug in macros, keep these - // attributes *internal* to the fn - #[fixed_stack_segment]; - #[inline(never)]; - #[allow(missing_doc)]; - - return $name(); - - extern { - fn $name() $(-> $ret_ty),*; - } - } - ); - (fn $name:ident ($($arg_name:ident : $arg_ty:ty),*) $(-> $ret_ty:ty),*) => ( - pub unsafe fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),* { - // Note: to avoid obscure bug in macros, keep these - // attributes *internal* to the fn - #[fixed_stack_segment]; - #[inline(never)]; - #[allow(missing_doc)]; - - return $name($($arg_name),*); - - extern { - fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),*; - } - } - ); - ($($attrs:attr)* fn $name:ident () $(-> $ret_ty:ty),*) => ( - pub unsafe fn $name() $(-> $ret_ty),* { - // Note: to avoid obscure bug in macros, keep these - // attributes *internal* to the fn - #[fixed_stack_segment]; - #[inline(never)]; - #[allow(missing_doc)]; - - return $name(); - - $($attrs)* - extern { - fn $name() $(-> $ret_ty),*; - } - } - ); - ($($attrs:attr)* fn $name:ident ($($arg_name:ident : $arg_ty:ty),*) $(-> $ret_ty:ty),*) => ( - pub unsafe fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),* { - // Note: to avoid obscure bug in macros, keep these - // attributes *internal* to the fn - #[fixed_stack_segment]; - #[inline(never)]; - #[allow(missing_doc)]; - - return $name($($arg_name),*); - - $($attrs)* - extern { - fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),*; - } - } - ) - ) - }"# } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 3673d3719ad..247be194b90 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -22,6 +22,8 @@ #[crate_type = "lib"]; #[feature(macro_rules, globs, managed_boxes)]; +#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot +#[allow(cstack)]; // NOTE: remove after the next snapshot. extern mod extra; |
