about summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
AgeCommit message (Collapse)AuthorLines
2015-01-23Deprecated attributes don't take 'feature' names and are paired with ↵Brian Anderson-8/+3
stable/unstable Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-3/+3
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-1/+1
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21Remove unused stability levels from compilerBrian Anderson-8/+3
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-26/+26
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rustdoc: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-1/+1
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-26/+26
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-1/+1
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-0/+1
2015-01-14auto merge of #21061 : japaric/rust/range, r=nick29581bors-2/+2
2015-01-12cleanup: `&foo[0..a]` -> `&foo[..a]`Jorge Aparicio-2/+2
2015-01-12rustdoc: Remove traces of old closuresTom Jakubowski-55/+0
2015-01-12rustdoc: Fix where clauses on re-exportsTom Jakubowski-2/+2
Projection predicates on re-exports, for the time being, are rendered as equality predicates because that's easier. It would be nice to fix this in the future. Some gymnastics were needed to remove redundant bounds from the `types` and `lifetimes` fields, remove implicit `Sized` bounds, and re-create `?Sized` bounds. Fix #20203, fix #20924, fix #20911, fix #20534
2015-01-08Make rustdoc use the `[_; N]` syntax instead of `[_, ..N]`Ken Tossell-1/+1
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-2/+2
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-07rollup merge of #20725: tomjakubowski/rustdoc-miscAlex Crichton-2/+18
Conflicts: src/librustdoc/html/format.rs
2015-01-07rollup merge of #20722: alexcrichton/audit-showAlex Crichton-3/+18
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustdoc/html/format.rs
2015-01-07rustdoc: Render associated type bindingsTom Jakubowski-2/+25
e.g. `Foo<Output=A>` This does not work cross-crate unfortunately. Part of #20646
2015-01-07std: Tweak String implementationsAlex Crichton-3/+18
This commit performs a pass over the implementations of the new `String` trait in the formatting module. Some implementations were removed as a conservative move pending an upcoming convention about `String` implementations, and some were added in order to retain consistency across the libraries. Specifically: * All "smart pointers" implement `String` now, adding missing implementations for `Arc` and `Rc`. * The `Vec<T>` and `[T]` types no longer implement `String`. * The `*const T` and `*mut T` type no longer implement `String`. * The `()` type no longer implements `String`. * The `Path` type's `Show` implementation does not surround itself with `Path {}` (a minor tweak). All implementations of `String` in this PR were also marked `#[stable]` to indicate that the types will continue to implement the `String` trait regardless of what it looks like.
2015-01-07use slicing sugarJorge Aparicio-2/+2
2015-01-07register new snapshotsJorge Aparicio-193/+0
2015-01-07Register new snapshotsAlex Crichton-193/+0
2015-01-06rollup merge of #20481: seanmonstar/fmt-show-stringAlex Crichton-4/+197
Conflicts: src/compiletest/runtest.rs src/libcore/fmt/mod.rs src/libfmt_macros/lib.rs src/libregex/parse.rs src/librustc/middle/cfg/construct.rs src/librustc/middle/dataflow.rs src/librustc/middle/infer/higher_ranked/mod.rs src/librustc/middle/ty.rs src/librustc_back/archive.rs src/librustc_borrowck/borrowck/fragments.rs src/librustc_borrowck/borrowck/gather_loans/mod.rs src/librustc_resolve/lib.rs src/librustc_trans/back/link.rs src/librustc_trans/save/mod.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/callee.rs src/librustc_trans/trans/common.rs src/librustc_trans/trans/consts.rs src/librustc_trans/trans/controlflow.rs src/librustc_trans/trans/debuginfo.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/monomorphize.rs src/librustc_typeck/astconv.rs src/librustc_typeck/check/method/mod.rs src/librustc_typeck/check/mod.rs src/librustc_typeck/check/regionck.rs src/librustc_typeck/collect.rs src/libsyntax/ext/format.rs src/libsyntax/ext/source_util.rs src/libsyntax/ext/tt/transcribe.rs src/libsyntax/parse/mod.rs src/libsyntax/parse/token.rs src/test/run-pass/issue-8898.rs
2015-01-07falloutNick Cameron-3/+3
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-4/+197
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-07Replace full slice notation with index callsNick Cameron-2/+2
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-4/+4
2015-01-01std: Enforce Unicode in fmt::WriterAlex Crichton-29/+29
This commit is an implementation of [RFC 526][rfc] which is a change to alter the definition of the old `fmt::FormatWriter`. The new trait, renamed to `Writer`, now only exposes one method `write_str` in order to guarantee that all implementations of the formatting traits can only produce valid Unicode. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md One of the primary improvements of this patch is the performance of the `.to_string()` method by avoiding an almost-always redundant UTF-8 check. This is a breaking change due to the renaming of the trait as well as the loss of the `write` method, but migration paths should be relatively easy: * All usage of `write` should move to `write_str`. If truly binary data was being written in an implementation of `Show`, then it will need to use a different trait or an altogether different code path. * All usage of `write!` should continue to work as-is with no modifications. * All usage of `Show` where implementations just delegate to another should continue to work as-is. [breaking-change] Closes #20352
2014-12-30Fallout from stabilizationAaron Turon-1/+1
2014-12-30Remove the def-id from type parameters. Having this def-id was bad for ↵Niko Matsakis-3/+2
several reasons: 1. Produced more unique types than is necessary. This increases memory consumption. 2. Linking the type parameter to its definition *seems* like a good idea, but it encourages reliance on the bounds listing. 3. It made pretty-printing harder and in particular was causing bad error messages when errors occurred before the `TypeParameterDef` entries were fully stored.
2014-12-29rollup merge of #20269: dirk/indent-whereAlex Crichton-1/+2
* Add <span class=‘where’> around clause * CSS rule to format the span (for issue #20176)
2014-12-27Indent where clause in rustdocDirk Gadsden-1/+2
* Add <span class=‘where’> around clause * CSS rule to format the span (for #20176)
2014-12-26Changes to RustDocNick Cameron-6/+10
2014-12-25auto merge of #20180 : jroesch/rust/clean-where-predicate, r=alexcrichtonbors-2/+20
Add support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.
2014-12-24rustdoc: Use unboxed closure sugarTom Jakubowski-39/+58
This unfortunately leaves sugaring Fn/FnMut/FnOnce on cross-crate re-exports for future work. cc #19909
2014-12-24rustdoc: render higher-rank trait boundsTom Jakubowski-9/+25
Fix #19915
2014-12-24rustdoc: render `for<>` on old closure lifetimesTom Jakubowski-2/+2
2014-12-24Address code review nitsJared Roesch-3/+3
2014-12-23Support all variants of WherePredicateJared Roesch-2/+20
Adds support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.
2014-12-21Fallout of std::str stabilizationAlex Crichton-5/+5
2014-12-20Add parser support for generalized where clausesJared Roesch-1/+1
Implement support in the parser for generalized where clauses, as well as the conversion of ast::WherePredicates to ty::Predicate in `collect.rs`.
2014-12-19librustdoc: use `#[deriving(Copy)]`Jorge Aparicio-5/+4
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-1/+1
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-14Rename FnStyle trait to Unsafety.Niko Matsakis-11/+11
2014-12-14Patch rustdoc to include missing types, make the match exhaustiveNiko Matsakis-0/+10
to prevent such oversights in the future.
2014-12-13librustdoc: use tuple indexingJorge Aparicio-1/+1
2014-12-13librustdoc: use unboxed closuresJorge Aparicio-4/+8
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+5
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-06librustdoc: remove unnecessary `as_slice()` callsJorge Aparicio-3/+3
2014-12-04rustdoc: Refactored various uses of ItemType.Kang Seonghoon-2/+1
In particular, ItemType variants are no longer reexported. Since we already do namespace them via `item_type` mod, it's fine.