| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Using the wrong landing pad has obvious bad effects, like dropping a value
twice.
Testcase written by Alex Crichton.
Fixes #25089.
|
|
Use a struct called Hole that keeps track of an invalid location
in the vector and fills the hole on drop.
I include a run-pass test that the current BinaryHeap fails, and the new
one passes.
Fixes #25842
|
|
Debug overflow checks for arithmetic negation landed in #24500, at which time
the `abs` method on signed integers was changed to using `wrapping_neg` to
ensure that the function never panicked. This implied that `abs` of `INT_MIN`
would return `INT_MIN`, another negative value. When this change was back-ported
to beta, however, in #24708, the `wrapping_neg` function had not yet been
backported, so the implementation was changed in #24785 to `!self + 1`. This
change had the unintended side effect of enabling debug overflow checks for the
`abs` function. Consequently, the current state of affairs is that the beta
branch checks for overflow in debug mode for `abs` and the nightly branch does
not.
This commit alters the behavior of nightly to have `abs` always check for
overflow in debug mode. This change is more consistent with the way the standard
library treats overflow as well, and it is also not a breaking change as it's
what the beta branch currently does (albeit if by accident).
cc #25378
|
|
|
|
|
|
Also start factoring out an API for compiler tools to use and fix a bug that was preventing DXR indexing Rust properly.
r? @huonw
|
|
Stripping unconfigured items prior to collecting crate metadata means we
can say things like `#![cfg_attr(foo, crate_type="lib")]`.
Fixes #25347.
|
|
- Successful merges: #25354, #25381, #25391, #25395, #25397, #25398, #25401
- Failed merges:
|
|
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the
currently-unstable `Duration` type. The API of the type has been scaled back to
be more conservative and it also no longer supports negative durations.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md
The inner `duration` module of the `time` module has now been hidden (as
`Duration` is reexported) and the feature name for this type has changed from
`std_misc` to `duration`. All APIs accepting durations have also been audited to
take a more flavorful feature name instead of `std_misc`.
Closes #24874
|
|
Stripping unconfigured items prior to collecting crate metadata means we
can say things like `#![cfg_attr(foo, crate_type="lib")]`.
Fixes #25347.
|
|
Adds explanations for E0053, E0066, E0069, E0251, E0252, E0255, E0256, E0368.
cc #24407
|
|
|
|
|
|
We don't have any pending snapshot-requiring changes. Closes #20184.
Works toward #3965.
|
|
This also updates the error messages for both. For E0066, it removes mention
of "managed heap", which was removed in 8a91d33. For E0069, I just tweaked
the wording to make it a bit more explicit.
|
|
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the
currently-unstable `Duration` type. The API of the type has been scaled back to
be more conservative and it also no longer supports negative durations.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md
The inner `duration` module of the `time` module has now been hidden (as
`Duration` is reexported) and the feature name for this type has changed from
`std_misc` to `duration`. All APIs accepting durations have also been audited to
take a more flavorful feature name instead of `std_misc`.
Closes #24874
|
|
Also change several error messages to refer to "items" rather than
"methods", since associated items that require resolution during type
checking are not always methods.
|
|
We don't have any pending snapshot-requiring changes. Tests which
continue to be ignored are those that are broken by codegen changes.
|
|
|
|
|
|
There is no subtyping relationship between the types (or their non-freshened
variants), so they can not be merged.
Fixes #22645
Fixes #24352
Fixes #23825
Should fix #25235 (no test in issue).
Should fix #19976 (test is outdated).
|
|
r? @sfackler
|
|
|
|
|
|
|
|
|
|
|
|
* segfault due to not copying drop flag when coercing
* fat pointer casts
* segfault due to not checking drop flag properly
* debuginfo for DST smart pointers
* unreachable code in drop glue
|
|
+ lots of rebasing
|
|
There is no subtyping relationship between the types (or their non-freshened
variants), so they can not be merged.
Fixes #22645
Fixes #24352
Fixes #23825
Should fix #25235 (no test in issue).
Should fix #19976 (test is outdated).
|
|
|
|
core::slice was originally written to tolerate overflow (notably, with
slices of zero-sized elements), but it was never updated to use wrapping
arithmetic when overflow traps were added.
Also correctly handle the case of calling .nth() on an Iter with a
zero-sized element type. The iterator was assuming that the pointer
value of the returned reference was meaningful, but that's not true for
zero-sized elements.
Fixes #25016.
|
|
It is currently broken to use syntax such as `<T as Foo>::U::static_method()` where `<T as Foo>::U` is an associated type. I was able to fix this and simplify the parser a bit at the same time.
This also fixes the corresponding issue with associated types (#22139), but that's somewhat irrelevant because #22519 is still open, so this syntax still causes an error in type checking.
Similarly, although this fix applies to associated consts, #25046 forbids associated constants from using type parameters or `Self`, while #19559 means that associated types have to always have one of those two. Therefore, I think that you can't use an associated const from an associated type anyway.
|
|
Closes #20413.
|
|
Closes #18075.
|
|
This isn't quite right, but it's interesting.
|
|
r? @nikomatsakis
|
|
|
|
|
|
Rustdoc fixes for associated items
This is related to isssue #22442 and solves it partly.
This solves the search index links of associated types and constants,
so that they link to the trait page.
Also add an Associated Constants section if constants are present.
|
|
core::slice::Iter.ptr can be null when iterating a slice of zero-sized
elements, but the pointer value used for the slice itself cannot. Handle
this case by always returning a dummy pointer for slices of zero-sized
elements.
|
|
core::slice was originally written to tolerate overflow (notably, with
slices of zero-sized elements), but it was never updated to use wrapping
arithmetic when overflow traps were added.
Also correctly handle the case of calling .nth() on an Iter with a
zero-sized element type. The iterator was assuming that the pointer
value of the returned reference was meaningful, but that's not true for
zero-sized elements.
Fixes #25016.
|
|
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
|
|
Fixes the problem in #16974 with unhelpful error messages when accidentally using the wrong syntax for the `crate_type="lib"` attribute. The attribute syntax error now shows up instead of "main function not found".
|
|
If the user intended to set the crate_type to "lib" but accidentally used
incorrect syntax such as `#![crate_type(lib)]`, the compilation would fail with
"main function not found". This made it hard to locate the source of the
problem, since the failure would cause the warning about the incorrect
attribute not to be shown.
|
|
|
|
|
|
|
|
I've found that there are still huge amounts of occurrences of `task`s in the documentation. This PR tries to eliminate all of them in favor of `thread`.
|