summary refs log tree commit diff
path: root/src/librustc/plugin
AgeCommit message (Collapse)AuthorLines
2015-05-24Auto merge of #25168 - Manishearth:register_attr, r=eddybbors-0/+20
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks. cc @thepowersgang
2015-05-13address more review commentsManish Goregaokar-1/+1
2015-05-12Merge branch 'master' intoNick Cameron-1/+1
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-07address review commentsManish Goregaokar-8/+5
2015-05-07Add support for registering attributes with rustc in pluginsManish Goregaokar-0/+23
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks.
2015-04-25Rebasing and making MulitDecorators workNick Cameron-7/+2
2015-04-25Merge branch 'syntax' of https://github.com/aochagavia/rust into mulit-decorNick Cameron-0/+7
Conflicts: src/librustc/plugin/registry.rs src/libsyntax/ext/base.rs src/libsyntax/ext/cfg_attr.rs src/libsyntax/ext/deriving/mod.rs src/libsyntax/ext/expand.rs src/libsyntax/print/pprust.rs src/test/auxiliary/macro_crate_test.rs
2015-04-16Fix broken links in the docsFlorian Hartwig-1/+1
2015-04-08Allow plugins to register LLVM passesKeegan McAllister-0/+14
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-1/+1
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-27rollup merge of #23197: aatxe/masterAlex Crichton-5/+0
`std::dynamic_library` is currently using `std::old_io::Path` specifically. This change brings the API in alignment with `std::fs::File` by having it take `std::path::AsPath`. The Windows code should work, but I admittedly haven't tried it (I don't have a Windows machine readily available right now). r? @alexcrichton
2015-03-27Updated std::dynamic_lib to use std::path.Aaron Weiss-5/+0
2015-03-26Update docs to fix various 404sGary M. Josack-1/+1
Found a few 404s that seemed like simple fixes: The Result docs use old_io Writer as an example. Fix the link to old_io Writer. There's probably an effort to update the example away from a deprecated api but this was a simple fix. rustc/plugin was pointing at the old guide and it was a broken link anyways (plugin vs plugins). Point at the book instead. The main page of the API docs referenced c_{str,vec}. Looks like these were deleted in 25d5a3a19423fee01787de87a56d185dd4e0a4e7. Point at ffi docs instead.
2015-03-12Stabilize std::pathAaron Turon-0/+4
This commit stabilizes essentially all of the new `std::path` API. The API itself is changed in a couple of ways (which brings it in closer alignment with the RFC): * `.` components are now normalized away, unless they appear at the start of a path. This in turn effects the semantics of e.g. asking for the file name of `foo/` or `foo/.`, both of which yield `Some("foo")` now. This semantics is what the original RFC specified, and is also desirable given early experience rolling out the new API. * The `parent` function now succeeds if, and only if, the path has at least one non-root/prefix component. This change affects `pop` as well. * The `Prefix` component now involves a separate `PrefixComponent` struct, to better allow for keeping both parsed and unparsed prefix data. In addition, the `old_path` module is now deprecated. Closes #23264 [breaking-change]
2015-03-06Add #[allow_internal_unstable] to track stability for macros better.Huon Wilson-3/+8
Unstable items used in a macro expansion will now always trigger stability warnings, *unless* the unstable items are directly inside a macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns unless the span of the unstable item is a subspan of the definition of a macro marked with that attribute. E.g. #[allow_internal_unstable] macro_rules! foo { ($e: expr) => {{ $e; unstable(); // no warning only_called_by_foo!(); }} } macro_rules! only_called_by_foo { () => { unstable() } // warning } foo!(unstable()) // warning The unstable inside `foo` is fine, due to the attribute. But the `unstable` inside `only_called_by_foo` is not, since that macro doesn't have the attribute, and the `unstable` passed into `foo` is also not fine since it isn't contained in the macro itself (that is, even though it is only used directly in the macro). In the process this makes the stability tracking much more precise, e.g. previously `println!("{}", unstable())` got no warning, but now it does. As such, this is a bug fix that may cause [breaking-change]s. The attribute is definitely feature gated, since it explicitly allows side-stepping the feature gating system.
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-5/+8
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-03Switched to Box::new in many places.Felix S. Klock II-1/+1
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-24std: Move std::env to the new I/O APIsAlex Crichton-2/+2
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-3/+3
2015-02-12Separate macro and plugin loadingKeegan McAllister-167/+12
Now they just share a bit of code internal to creader. Resolves #22198 to my satisfaction.
2015-02-12creader: Clean up macro/plugin APIKeegan McAllister-27/+13
Step towards #22198.
2015-02-10Forbid undefined names in macro use / macro reexportKeegan McAllister-26/+41
Fixes #21062.
2015-02-09Add a help message for deprecated #[plugin] extern crateKeegan McAllister-0/+3
2015-02-09Use a crate attribute to load pluginsKeegan McAllister-53/+64
#[plugin] #[no_link] extern crate bleh; becomes a crate attribute #![plugin(bleh)] The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
2015-02-06librustc has been updatedGuillaumeGomez-1/+1
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-3/+3
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-7/+7
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-1/+1
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-6/+6
2015-02-01std: Add a new `env` moduleAlex Crichton-2/+2
This is an implementation of [RFC 578][rfc] which adds a new `std::env` module to replace most of the functionality in the current `std::os` module. More details can be found in the RFC itself, but as a summary the following methods have all been deprecated: [rfc]: https://github.com/rust-lang/rfcs/pull/578 * `os::args_as_bytes` => `env::args` * `os::args` => `env::args` * `os::consts` => `env::consts` * `os::dll_filename` => no replacement, use `env::consts` directly * `os::page_size` => `env::page_size` * `os::make_absolute` => use `env::current_dir` + `join` instead * `os::getcwd` => `env::current_dir` * `os::change_dir` => `env::set_current_dir` * `os::homedir` => `env::home_dir` * `os::tmpdir` => `env::temp_dir` * `os::join_paths` => `env::join_paths` * `os::split_paths` => `env::split_paths` * `os::self_exe_name` => `env::current_exe` * `os::self_exe_path` => use `env::current_exe` + `pop` * `os::set_exit_status` => `env::set_exit_status` * `os::get_exit_status` => `env::get_exit_status` * `os::env` => `env::vars` * `os::env_as_bytes` => `env::vars` * `os::getenv` => `env::var` or `env::var_string` * `os::getenv_as_bytes` => `env::var` * `os::setenv` => `env::set_var` * `os::unsetenv` => `env::remove_var` Many function signatures have also been tweaked for various purposes, but the main changes were: * `Vec`-returning APIs now all return iterators instead * All APIs are now centered around `OsString` instead of `Vec<u8>` or `String`. There is currently on convenience API, `env::var_string`, which can be used to get the value of an environment variable as a unicode `String`. All old APIs are `#[deprecated]` in-place and will remain for some time to allow for migrations. The semantics of the APIs have been tweaked slightly with regard to dealing with invalid unicode (panic instead of replacement). The new `std::env` module is all contained within the `env` feature, so crates must add the following to access the new APIs: #![feature(env)] [breaking-change]
2015-01-31Replace uses of Decorator and ModifierAdolfo Ochagavía-1/+3
2015-01-21rustc: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-8/+16
2015-01-15Syntax extensions on trait and impl items.Nick Cameron-2/+2
Allows modifiers to be used on methods, associated types, etc.
2015-01-08librustc_driver: Add support for loading plugins via command line (fixes #15446)Manish Goregaokar-19/+18
2015-01-08librustc::plugin : make PluginLoader usable for loading argument-specified ↵Manish Goregaokar-17/+39
plugins
2015-01-08librustc::metadata : Allow passing a string to read_plugin_metadataManish Goregaokar-2/+2
2015-01-07use slicing sugarJorge Aparicio-3/+3
2015-01-07Replace full slice notation with index callsNick Cameron-3/+3
2015-01-05Forbid '#[macro_use] extern crate' outside the crate rootKeegan McAllister-0/+16
2015-01-05Pass the #[plugin(...)] meta item to the registrarKeegan McAllister-7/+38
2015-01-05Allow selective macro importKeegan McAllister-5/+28
2015-01-05Move #[macro_reexport] to extern crateKeegan McAllister-1/+27
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-16/+26
2015-01-05creader: Load parts of plugin metadata on demandKeegan McAllister-32/+27
2015-01-05Reformat metadata for exported macrosKeegan McAllister-20/+13
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-05creader: Use a single structKeegan McAllister-3/+3
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-6/+15
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2014-12-21Fallout of std::str stabilizationAlex Crichton-3/+3