Skip to content

Fix incorrect return type error diagnostic #59403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d1add97
Auto merge of #57696 - rust-lang:beta-next, r=Mark-Simulacrum
bors Jan 17, 2019
79a942b
Update beta to released compiler
Mark-Simulacrum Jan 19, 2019
ad5d12b
beta: Update RLS version to 1.33
Xanewok Jan 19, 2019
5209162
Auto merge of #57763 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Jan 20, 2019
4df66ba
Auto merge of #57766 - Xanewok:beta-rls-version-bump, r=pietroalbini
bors Jan 21, 2019
f9b492f
make sure to accept all android licenses
pietroalbini Jan 23, 2019
dc52f0f
Fix issue 57762
tromey Jan 22, 2019
676ade5
Simplify the version check
tromey Jan 22, 2019
1652c7d
Fix typo bug in DepGraph::try_mark_green().
michaelwoerister Jan 17, 2019
635817b
Auto merge of #57878 - pietroalbini:beta-backports, r=pietroalbini
bors Jan 24, 2019
2cccf59
rustbuild: fix build with rust 1.33
Keruspe Jan 30, 2019
1045131
Auto merge of #57990 - Keruspe:beta, r=alexcrichton
bors Jan 31, 2019
b8527ab
Pass correct arguments to places_conflict
matthewjasper Jan 30, 2019
1983205
Don't panic when accessing enum variant ctor using `Self` in match
estebank Jan 30, 2019
872c966
Fix bug in integer range matching
varkor Feb 1, 2019
edb41d8
Build the standard library for thumbv7neon-unknown-linux-gnueabihf in CI
hsivonen Jan 28, 2019
13542d8
Fix release manifest generation
Jan 16, 2019
b203178
Auto merge of #58159 - pietroalbini:beta-backports, r=pietroalbini
bors Feb 5, 2019
81571bf
libpanic_unwind => 2018: fix ICEs.
Centril Feb 12, 2019
08f1073
Auto merge of #58501 - oli-obk:beta, r=eddyb
bors Feb 16, 2019
119335e
[BETA] Update cargo
ehuss Feb 16, 2019
94ca417
Make `intern_lazy_const` actually intern its argument.
nnethercote Feb 6, 2019
04d6d7b
Lower constant patterns with ascribed types.
davidtwco Feb 4, 2019
8a1b7da
#56411 do not suggest a fix for a import conflict in a macro
mockersf Dec 18, 2018
e4120ee
Address review comments and cleanup code
petrochenkov Jan 25, 2019
5f39bc7
Do not initiate nested probe within `assemble_probe`.
pnkfelix Jan 22, 2019
d820e21
unit test for issue 57673.
pnkfelix Jan 22, 2019
d30f5be
add some comments to method::probe::Candidate
arielb1 Jan 28, 2019
552e2fa
add tests to a few edge cases in method lookup
arielb1 Jan 28, 2019
062e817
avoid committing to autoderef in object method probing
arielb1 Jan 28, 2019
e583c62
Fixes text becoming invisible when element targetted
GuillaumeGomez Jan 15, 2019
bbe9e21
Rollup merge of #58522 - ehuss:update-beta-cargo, r=pietroalbini
pietroalbini Feb 17, 2019
1f84156
Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
bors Feb 20, 2019
f22755f
Fix #57979 by allowing a legitimate type error to take precedence ove…
pnkfelix Feb 22, 2019
687c449
make generalization code create new variables in correct universe
nikomatsakis Feb 1, 2019
f599ab6
s/skol_/placeholder_/
nikomatsakis Feb 20, 2019
4916c8f
reintroduce `commit_if_ok` call into `higher_ranked_sub`
nikomatsakis Feb 19, 2019
2a8c36c
reintroduce `commit_if_ok` calls to `subtype_predicate`
nikomatsakis Feb 19, 2019
3693f18
introduce a dummy leak check and invoke it in all the right places
nikomatsakis Feb 20, 2019
85a24b1
restore the actual leak-check
nikomatsakis Feb 20, 2019
542ad5e
update test files to reflect new output
nikomatsakis Feb 20, 2019
551aafc
partially revert 904a0bde93f0348f69914ee90b1f8b6e4e0d7cbc
nikomatsakis Feb 21, 2019
600ca1e
improve Pin documentation
RalfJung Feb 22, 2019
fdd5467
Updated RELEASES.md for 1.33.0
Feb 6, 2019
a63575c
Fix invalid background color
GuillaumeGomez Jan 23, 2019
5c6eb4e
Fix non-clickable urls
GuillaumeGomez Jan 17, 2019
bb2d0ea
Auto merge of #58656 - Mark-Simulacrum:beta-rollups, r=pietroalbini
bors Feb 23, 2019
ab4c12a
stable 1.33.0 release
pietroalbini Feb 25, 2019
b270e14
Auto merge of #58721 - pietroalbini:stable-1.33.0, r=pietroalbini
bors Feb 25, 2019
e48ffae
Fix release note problems noticed after merging.
Mark-Simulacrum Feb 28, 2019
bd1f032
Permit unwinding through FFI by default
Mark-Simulacrum Feb 28, 2019
2aa4c46
Auto merge of #58795 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
bors Feb 28, 2019
be89474
58982 fix incorrect error diagnostic
pmccarter Mar 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ dependencies = [

[[package]]
name = "rls"
version = "1.31.6"
version = "1.33.0"
dependencies = [
"cargo 0.34.0",
"cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down
154 changes: 152 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,153 @@
Version 1.33.0 (2019-02-28)
==========================

Language
--------
- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g.
`#[cfg(target_vendor="apple")] fn main() { println!("Hello Apple!"); }`
- [Integer patterns such as in a match expression can now be exhaustive.][56362]
E.g. You can have match statement on a `u8` that covers `0..=255` and
you would no longer be required to have a `_ => unreachable!()` case.
- [You can now have multiple patterns in `if let` and `while let`
expressions.][57532] You can do this with the same syntax as a `match`
expression. E.g.
```rust
enum Creature {
Crab(String),
Lobster(String),
Person(String),
}

fn main() {
let state = Creature::Crab("Ferris");

if let Creature::Crab(name) | Creature::Person(name) = state {
println!("This creature's name is: {}", name);
}
}
```
- [You can now have irrefutable `if let` and `while let` patterns.][57535] Using
this feature will by default produce a warning as this behaviour can be
unintuitive. E.g. `if let _ = 5 {}`
- [You can now use `let` bindings, assignments, expression statements,
and irrefutable pattern destructuring in const functions.][57175]
- [You can now call unsafe const functions.][57067] E.g.
```rust
const unsafe fn foo() -> i32 { 5 }
const fn bar() -> i32 {
unsafe { foo() }
}
```
- [You can now specify multiple attributes in a `cfg_attr` attribute.][57332]
E.g. `#[cfg_attr(all(), must_use, optimize)]`
- [You can now specify a specific alignment with the `#[repr(packed)]`
attribute.][57049] E.g. `#[repr(packed(2))] struct Foo(i16, i32);` is a struct
with an alignment of 2 bytes and a size of 6 bytes.
- [You can now import an item from a module as an `_`.][56303] This allows you to
import a trait's impls, and not have the name in the namespace. E.g.
```rust
use std::io::Read as _;

// Allowed as there is only one `Read` in the module.
pub trait Read {}
```
- [You may now use `Rc`, `Arc`, and `Pin` as method receivers][56805].

Compiler
--------
- [You can now set a linker flavor for `rustc` with the `-Clinker-flavor`
command line argument.][56351]
- [The mininum required LLVM version has been bumped to 6.0.][56642]
- [Added support for the PowerPC64 architecture on FreeBSD.][57615]
- [The `x86_64-fortanix-unknown-sgx` target support has been upgraded to
tier 2 support.][57130] Visit the [platform support][platform-support] page for
information on Rust's platform support.
- [Added support for the `thumbv7neon-linux-androideabi` and
`thumbv7neon-unknown-linux-gnueabihf` targets.][56947]
- [Added support for the `x86_64-unknown-uefi` target.][56769]

Libraries
---------
- [The methods `overflowing_{add, sub, mul, shl, shr}` are now `const`
functions for all numeric types.][57566]
- [The methods `rotate_left`, `rotate_right`, and `wrapping_{add, sub, mul, shl, shr}`
are now `const` functions for all numeric types.][57105]
- [The methods `is_positive` and `is_negative` are now `const` functions for
all signed numeric types.][57105]
- [The `get` method for all `NonZero` types is now `const`.][57167]
- [The methods `count_ones`, `count_zeros`, `leading_zeros`, `trailing_zeros`,
`swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now `const` for all
numeric types.][57234]
- [`Ipv4Addr::new` is now a `const` function][57234]

Stabilized APIs
---------------
- [`unix::FileExt::read_exact_at`]
- [`unix::FileExt::write_all_at`]
- [`Option::transpose`]
- [`Result::transpose`]
- [`convert::identity`]
- [`pin::Pin`]
- [`marker::Unpin`]
- [`marker::PhantomPinned`]
- [`Vec::resize_with`]
- [`VecDeque::resize_with`]
- [`Duration::as_millis`]
- [`Duration::as_micros`]
- [`Duration::as_nanos`]


Cargo
-----
- [Cargo should now rebuild a crate if a file was modified during the initial
build.][cargo/6484]

Compatibility Notes
-------------------
- The methods `str::{trim_left, trim_right, trim_left_matches, trim_right_matches}`
are now deprecated in the standard library, and their usage will now produce a warning.
Please use the `str::{trim_start, trim_end, trim_start_matches, trim_end_matches}`
methods instead.
- The `Error::cause` method has been deprecated in favor of `Error::source` which supports
downcasting.

[55982]: https://github.com/rust-lang/rust/pull/55982/
[56303]: https://github.com/rust-lang/rust/pull/56303/
[56351]: https://github.com/rust-lang/rust/pull/56351/
[56362]: https://github.com/rust-lang/rust/pull/56362
[56642]: https://github.com/rust-lang/rust/pull/56642/
[56769]: https://github.com/rust-lang/rust/pull/56769/
[56805]: https://github.com/rust-lang/rust/pull/56805
[56947]: https://github.com/rust-lang/rust/pull/56947/
[57049]: https://github.com/rust-lang/rust/pull/57049/
[57067]: https://github.com/rust-lang/rust/pull/57067/
[57105]: https://github.com/rust-lang/rust/pull/57105
[57130]: https://github.com/rust-lang/rust/pull/57130/
[57167]: https://github.com/rust-lang/rust/pull/57167/
[57175]: https://github.com/rust-lang/rust/pull/57175/
[57234]: https://github.com/rust-lang/rust/pull/57234/
[57332]: https://github.com/rust-lang/rust/pull/57332/
[57465]: https://github.com/rust-lang/rust/pull/57465/
[57532]: https://github.com/rust-lang/rust/pull/57532/
[57535]: https://github.com/rust-lang/rust/pull/57535/
[57566]: https://github.com/rust-lang/rust/pull/57566/
[57615]: https://github.com/rust-lang/rust/pull/57615/
[cargo/6484]: https://github.com/rust-lang/cargo/pull/6484/
[`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.read_exact_at
[`unix::FileExt::write_all_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_all_at
[`Option::transpose`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.transpose
[`Result::transpose`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.transpose
[`convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html
[`pin::Pin`]: https://doc.rust-lang.org/std/pin/struct.Pin.html
[`marker::Unpin`]: https://doc.rust-lang.org/stable/std/marker/trait.Unpin.html
[`marker::PhantomPinned`]: https://doc.rust-lang.org/nightly/std/marker/struct.PhantomPinned.html
[`Vec::resize_with`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.resize_with
[`VecDeque::resize_with`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.resize_with
[`Duration::as_millis`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_millis
[`Duration::as_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_micros
[`Duration::as_nanos`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_nanos
[platform-support]: https://forge.rust-lang.org/platform-support.html

Version 1.32.0 (2019-01-17)
==========================

Expand All @@ -22,7 +172,7 @@ Language
- [You can now match against literals in macros with the `literal`
specifier.][56072] This will match against a literal of any type.
E.g. `1`, `'A'`, `"Hello World"`
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
```rust
struct Point(i32, i32);

Expand Down Expand Up @@ -312,7 +462,7 @@ Version 1.31.0 (2018-12-06)

Language
--------
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
- [New lifetime elision rules now allow for eliding lifetimes in functions and
impl headers.][54778] E.g. `impl<'a> Reader for BufReader<'a> {}` can now be
`impl Reader for BufReader<'_> {}`. Lifetimes are still required to be defined
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn make_win_dist(
let trim_chars: &[_] = &[' ', '='];
let value =
line[(idx + 1)..]
.trim_left_matches(trim_chars)
.trim_start_matches(trim_chars)
.split(';')
.map(PathBuf::from);

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl Build {
Command::new(&build.initial_rustc).arg("--version").arg("--verbose"));
let local_release = local_version_verbose
.lines().filter(|x| x.starts_with("release:"))
.next().unwrap().trim_left_matches("release:").trim();
.next().unwrap().trim_start_matches("release:").trim();
let my_version = channel::CFG_RELEASE_NUM;
if local_release.split('.').take(2).eq(my_version.split('.').take(2)) {
build.verbose(&format!("auto-detected local-rebuild {}", local_release));
Expand Down
8 changes: 6 additions & 2 deletions src/ci/docker/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,17 @@ ENV TARGETS=$TARGETS,armebv7r-none-eabi
ENV TARGETS=$TARGETS,armebv7r-none-eabihf
ENV TARGETS=$TARGETS,armv7r-none-eabi
ENV TARGETS=$TARGETS,armv7r-none-eabihf
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf

ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \
CC_armebv7r_none_eabi=arm-none-eabi-gcc

CC_armebv7r_none_eabi=arm-none-eabi-gcc \
CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \
CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++

ENV RUST_CONFIGURE_ARGS \
--musl-root-armv5te=/musl-armv5te \
--musl-root-arm=/musl-arm \
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/android-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ download_sysimage() {
# The output from sdkmanager is so noisy that it will occupy all of the 4 MB
# log extremely quickly. Thus we must silence all output.
yes | sdkmanager --licenses > /dev/null
sdkmanager platform-tools emulator \
yes | sdkmanager platform-tools emulator \
"platforms;android-$api" \
"system-images;android-$api;default;$abi" > /dev/null
}
Expand Down
2 changes: 1 addition & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fi
#
# FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
# either automatically or manually.
export RUST_RELEASE_CHANNEL=beta
export RUST_RELEASE_CHANNEL=stable
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
Expand Down
27 changes: 18 additions & 9 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,34 +597,43 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}

/// Types which can be safely moved after being pinned.
///
/// Since Rust itself has no notion of immovable types, and will consider moves to always be safe,
/// Since Rust itself has no notion of immovable types, and considers moves
/// (e.g. through assignment or [`mem::replace`]) to always be safe,
/// this trait cannot prevent types from moving by itself.
///
/// Instead it can be used to prevent moves through the type system,
/// by controlling the behavior of pointers wrapped in the [`Pin`] wrapper,
/// Instead it is used to prevent moves through the type system,
/// by controlling the behavior of pointers `P` wrapped in the [`Pin<P>`] wrapper,
/// which "pin" the type in place by not allowing it to be moved out of them.
/// See the [`pin module`] documentation for more information on pinning.
///
/// Implementing this trait lifts the restrictions of pinning off a type,
/// which then allows it to move out with functions such as [`replace`].
/// which then allows it to move out with functions such as [`mem::replace`].
///
/// `Unpin` has no consequence at all for non-pinned data. In particular,
/// [`mem::replace`] happily moves `!Unpin` data (it works for any `&mut T`, not
/// just when `T: Unpin`). However, you cannot use
/// [`mem::replace`] on data wrapped inside a [`Pin<P>`] because you cannot get the
/// `&mut T` you need for that, and *that* is what makes this system work.
///
/// So this, for example, can only be done on types implementing `Unpin`:
///
/// ```rust
/// use std::mem::replace;
/// use std::mem;
/// use std::pin::Pin;
///
/// let mut string = "this".to_string();
/// let mut pinned_string = Pin::new(&mut string);
///
/// // dereferencing the pointer mutably is only possible because String implements Unpin
/// replace(&mut *pinned_string, "other".to_string());
/// // We need a mutable reference to call `mem::replace`.
/// // We can obtain such a reference by (implicitly) invoking `Pin::deref_mut`,
/// // but that is only possible because `String` implements `Unpin`.
/// mem::replace(&mut *pinned_string, "other".to_string());
/// ```
///
/// This trait is automatically implemented for almost every type.
///
/// [`replace`]: ../../std/mem/fn.replace.html
/// [`Pin`]: ../pin/struct.Pin.html
/// [`mem::replace`]: ../../std/mem/fn.replace.html
/// [`Pin<P>`]: ../pin/struct.Pin.html
/// [`pin module`]: ../../std/pin/index.html
#[stable(feature = "pin", since = "1.33.0")]
pub auto trait Unpin {}
Expand Down
Loading