Commit Graph

36 Commits

Author SHA1 Message Date
Brian Anderson
aa48654740 Remove managed_box gate from tests
No longer does anything.
2014-07-26 21:05:29 -07:00
Patrick Walton
a5bb0a3a45 librustc: Remove the fallback to int for integers and f64 for
floating point numbers for real.

This will break code that looks like:

    let mut x = 0;
    while ... {
        x += 1;
    }
    println!("{}", x);

Change that code to:

    let mut x = 0i;
    while ... {
        x += 1;
    }
    println!("{}", x);

Closes #15201.

[breaking-change]
2014-06-29 11:47:58 -07:00
Patrick Walton
dcbf4ec2a1 librustc: Put #[unsafe_destructor] behind a feature gate.
Closes #8142.

This is not the semantics we want long-term. You can continue to use
`#[unsafe_destructor]`, but you'll need to add
`#![feature(unsafe_destructor)]` to the crate attributes.

[breaking-change]
2014-06-20 14:24:31 -07:00
Alex Crichton
ade807c6dc rustc: Obsolete the @ syntax entirely
This removes all remnants of `@` pointers from rustc. Additionally, this removes
the `GC` structure from the prelude as it seems odd exporting an experimental
type in the prelude by default.

Closes #14193
[breaking-change]
2014-06-14 10:45:37 -07:00
Alex Crichton
b53454e2e4 Move std::{reflect,repr,Poly} to a libdebug crate
This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]
2014-05-27 21:44:51 -07:00
Manish Goregaokar
713e87526e Use new attribute syntax in python files in src/etc too (#13478) 2014-04-14 21:00:31 +05:30
Alex Crichton
cc6ec8df95 log: Introduce liblog, the old std::logging
This commit moves all logging out of the standard library into an external
crate. This crate is the new crate which is responsible for all logging macros
and logging implementation. A few reasons for this change are:

* The crate map has always been a bit of a code smell among rust programs. It
  has difficulty being loaded on almost all platforms, and it's used almost
  exclusively for logging and only logging. Removing the crate map is one of the
  end goals of this movement.

* The compiler has a fair bit of special support for logging. It has the
  __log_level() expression as well as generating a global word per module
  specifying the log level. This is unfairly favoring the built-in logging
  system, and is much better done purely in libraries instead of the compiler
  itself.

* Initialization of logging is much easier to do if there is no reliance on a
  magical crate map being available to set module log levels.

* If the logging library can be written outside of the standard library, there's
  no reason that it shouldn't be. It's likely that we're not going to build the
  highest quality logging library of all time, so third-party libraries should
  be able to provide just as high-quality logging systems as the default one
  provided in the rust distribution.

With a migration such as this, the change does not come for free. There are some
subtle changes in the behavior of liblog vs the previous logging macros:

* The core change of this migration is that there is no longer a physical
  log-level per module. This concept is still emulated (it is quite useful), but
  there is now only a global log level, not a local one. This global log level
  is a reflection of the maximum of all log levels specified. The previously
  generated logging code looked like:

    if specified_level <= __module_log_level() {
        println!(...)
    }

  The newly generated code looks like:

    if specified_level <= ::log::LOG_LEVEL {
        if ::log::module_enabled(module_path!()) {
            println!(...)
        }
    }

  Notably, the first layer of checking is still intended to be "super fast" in
  that it's just a load of a global word and a compare. The second layer of
  checking is executed to determine if the current module does indeed have
  logging turned on.

  This means that if any module has a debug log level turned on, all modules
  with debug log levels get a little bit slower (they all do more expensive
  dynamic checks to determine if they're turned on or not).

  Semantically, this migration brings no change in this respect, but
  runtime-wise, this will have a perf impact on some code.

* A `RUST_LOG=::help` directive will no longer print out a list of all modules
  that can be logged. This is because the crate map will no longer specify the
  log levels of all modules, so the list of modules is not known. Additionally,
  warnings can no longer be provided if a malformed logging directive was
  supplied.

The new "hello world" for logging looks like:

    #[phase(syntax, link)]
    extern crate log;

    fn main() {
        debug!("Hello, world!");
    }
2014-03-15 22:26:36 -07:00
Patrick Walton
c3694d732e test: De-@mut the test suite 2014-01-03 14:02:01 -08:00
Daniel Micay
142672dca4 register snapshots 2013-10-23 18:06:12 -04:00
Alex Crichton
daf5f5a4d1 Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
2013-10-22 08:09:56 -07:00
Alex Crichton
630082ca89 rpass: Remove usage of fmt! 2013-09-30 23:21:19 -07:00
Daniel Micay
4e161a4d40 switch Drop to &mut self 2013-09-16 22:19:23 -04:00
Erick Tryzelaar
ad5c676853 Fix warnings it tests 2013-08-17 08:42:35 -07:00
Huon Wilson
e4f7561bcd Clean-up tests after debug!/std-macros change.
The entire testsuite is converted to using info! rather than debug!
because some depend on the code within the debug! being trans'd.
2013-07-17 03:10:13 +10:00
Luqman Aden
ca2966c6d0 Change finalize -> drop. 2013-06-25 21:14:39 -04:00
Corey Richardson
cc57ca012a Use assert_eq! rather than assert! where possible 2013-05-19 08:16:02 -04:00
Patrick Walton
1e91595520 librustc: Remove fail_unless! 2013-03-29 16:39:08 -07:00
Patrick Walton
d4fee24c7c librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis 2013-03-21 17:31:34 -07:00
Brian Anderson
82f190355b Remove uses of log 2013-03-11 23:19:42 -07:00
Patrick Walton
d7e74b5e91 librustc: Convert all uses of assert over to fail_unless! 2013-03-07 22:37:57 -08:00
Luqman Aden
178882c98f tests/tutorials: Get rid of move. 2013-02-15 02:49:55 -08:00
Patrick Walton
9143688197 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
Graydon Hoare
89c8ef792f check-fast fallout from removing export, r=burningtree 2013-02-01 19:43:17 -08:00
Graydon Hoare
d1affff623 Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
Patrick Walton
9e1c9be16f librustc: Make the Drop trait use explicit self 2012-11-29 11:06:15 -08:00
Ben Striegel
f4a5a76aa4 Convert the test suite to use the Drop trait 2012-11-14 19:26:37 -08:00
Tim Chevalier
3ebd878f4a Make moves explicit in rpass tests 2012-10-12 20:43:38 -07:00
Brian Anderson
2572e80355 Remove 'let' syntax for struct fields 2012-09-07 14:02:33 -07:00
Brian Anderson
b4e547d71a Remove struct ctors 2012-09-06 10:52:26 -07:00
Brian Anderson
3ab4b014cf Remove the class keyword 2012-08-17 10:13:45 -07:00
Tim Chevalier
7df7a9d8ac Start porting tests to use classes with dtors instead of resources 2012-05-15 20:35:57 -07:00
Graydon Hoare
6e6798c4e1 Bulk-edit mutable -> mut. 2012-03-26 18:35:18 -07:00
Graydon Hoare
f0dfbe7b1b Register new snapshots, purge log_err and log_full in favour of log(...). 2011-12-22 17:53:53 -08:00
Graydon Hoare
8b580954fe Register snapshots and switch logging over to use of log_full or #error / #debug. 2011-12-22 14:42:52 -08:00
Marijn Haverbeke
a7573af59d Add some tests for new kind system
Issue #1177
2011-11-18 16:15:46 +01:00
Brian Anderson
a96b16e8c3 Make it again possible to initialize resource locals via assignment
Some special cases allow both 'let a <- my_resource(x)' and
'let a = my_resource(x)' to work as expected despite ostensibly being
copies and moves.
2011-09-27 23:20:27 -07:00