| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
The easy parts of RFC 1859. (Just the trait and the lowering, none of
the error message improvements nor the insta-stable impl for Option.)
|
|
Document drop more.
Adds two examples to Drop and describes the recursive drop on types that contain fields.
|
|
|
|
|
|
|
|
|
|
|
|
Not being an enum improves ergonomics, especially since NonEmpty could be Empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait.
Implements RFC 1980
|
|
Add lint for unused macros
Addresses parts of #34938, to add a lint for unused macros.
We now output warnings by default when we encounter a macro that we didn't use for expansion.
Issues to be resolved before this PR is ready for merge:
- [x] fix the NodeId issue described above
- [x] remove all unused macros from rustc and the libraries or set `#[allow(unused_macros)]` next to them if they should be kept for some reason. This is needed for successful boostrap and bors to accept the PR. -> #41934
- [x] ~~implement the full extent of #34938, that means the macro match arm checking as well.~~ *let's not do this for now*
|
|
Added generic example of std::ops::Add in doc comments
We discussed on IRC how the std::ops examples were potentially missing examples using generics. This PR adds an example to std::ops::Add that shows the use of a generic type T. I'm not sure this is ready for merge as I think the two examples now make the documentation a bit verbose, but I think it's a good starting point. I'd love to hear others thoughts on this. This is in relation to the last item in issue #29365.
|
|
|
|
Added blank lines around example
Added comment to Add example referencing the Output type
Removed whitespace from lines 272 and 273
Removed Debug derivation from Add examples
Added Debug derivation
|
|
Removes occurences of anonymous parameters from the
rustc codebase, as they are to be deprecated.
See issue #41686 and RFC 1685.
|
|
When trying to do a binary operation with missing implementation, for
example `1 + Some(2)`, provide an explicit help message:
```
note: no implementation for `{integer} + std::option::Option<{integer}>`
```
Use `rustc_on_unimplemented` for the suggestions. Move cfail test to ui.
|
|
|
|
This was never established as a convention we should follow in the 'More
API Documentation Conventions' RFC:
https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
|
|
|
|
This commit updates the version number to 1.17.0 as we're not on that version of
the nightly compiler, and at the same time this updates src/stage0.txt to
bootstrap from freshly minted beta compiler and beta Cargo.
|
|
Updates to src/libcore/ops.rs docs for RFC#1228 (Placement Left Arrow)
Also fixed a minor typo in docs for `core::ops::Place`.
|
|
Add more docs for CoerceUnsized and Unsize
here be dragons
r? @ubsan @steveklabnik
|
|
Also fixed a minor typo in docs for `core::ops::Place`.
|
|
|
|
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which
understands and supports 128-bit integers throughout.
The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to
iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported,
this strategy is good enough to get past the first bootstrap stages to end up with a fully working
128-bit capable compiler.
In order for this strategy to work, number of locations had to be changed to use associated
max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?)
had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works
(former not necessarily producing the right results in stage1).
This commit includes manual merge conflict resolution changes from a rebase by @est31.
|
|
Add impls for `&Wrapping`. Also `Sum`, `Product` impls for both `Wrapping` and `&Wrapping`.
There are two changes here (split into two commits):
- Ops for references to `&Wrapping` (`Add`, `Sub`, `Mul` etc.) similar to the way they are implemented for primitives.
- Impls for `iter::{Sum,Product}` for `Wrapping`.
As far as I know `impl` stability attributes don't really matter so I didn't bother breaking up the macro for two different kinds of stability. Happy to change if it does matter.
|
|
Elide lifetimes in DerefMut documentation
- Elide lifetimes to increase the readability of `DerefMut` examples
|
|
- Elide lifetimes to increase the readability
of `DerefMut` examples
|
|
Fix a few links in the docs
r? @steveklabnik
|
|
Fix typo in the BitAndAssign operator documentation
The name of the operator should be `&=` instead of `&`.
|
|
|
|
|
|
|
|
|
|
Add missing urls for ops module
Part of #29365.
r? @steveklabnik
|
|
|
|
Use examples and placeholder variable names with more meaning, to not
make it so abstract.
|
|
demonstrate `RHS != Self` use cases for `Add` and `Sub`
|
|
|
|
replace `BitAndAssign` example with something more evocative
This is the augmented-assignment version of PR #35809.
r? @GuillaumeGomez
|
|
add evocative examples for `BitOr` and `BitXor`
These are exactly equivalent to PR #35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`.
Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`. Let me know if you think one of those would be clearer.
r? @GuillaumeGomez
|
|
This is the augmented-assignment version of PR #35809.
r? @GuillaumeGomez
improved documentation a la PR #35993
|
|
These are exactly equivalent to PR #35809, with one caveat: I do not believe there is a non-bitwise binary "xor" operator in Rust, so here it's expressed as (a || b) && !(a && b).
r? @GuillaumeGomez
improved documentation a la PR #35993
|
|
improve `BitAnd` trait documentation
This pull request is based on the discussion in PR #35927.
Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable.
Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple.
Make `BooleanVector` a struct tuple.
Derive `PartialEq` for `BooleanVector` instead of implementing it.
Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
|
|
add evocative examples for `Shl` and `Shr`
r? @steveklabnik
|
|
improve documentation for `Fn*` traits
This PR is not yet a serious attempt at contribution. Rather, I'm opening this for discussion. I can think of a few things we may want to accomplish with the documentation of the `Fn`, `FnMut`, and `FnOnce` traits:
- the relationship between these traits and the closures that implement them
- examples of non-closure implementations
- the relationship between these traits and Rust's ownership semantics
|
|
r=steveklabnik
show how iterating over `RangeTo` and `RangeToInclusive` fails
Feedback on PR #35701 seems to be positive, so this does the same thing for `RangeTo` and `RangeToInclusive`.
|
|
remove extra `../`s
|
|
This pull request is based on the discussion in PR #35927.
Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable.
Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple.
Make `BooleanVector` a struct tuple.
Derive `PartialEq` for `BooleanVector` instead of implementing it.
Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
simplified bitand expression
add a comment explaining what "rhs" means
|
|
Use `#[prelude_import]` in `libcore` and `libstd`
r? @eddyb
|