Skip to content
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

rustc: Fix a number of stability lint holes #22127

Merged
merged 1 commit into from
Feb 12, 2015

Conversation

alexcrichton
Copy link
Member

There are a number of holes that the stability lint did not previously cover,
including:

  • Types
  • Bounds on type parameters on functions and impls
  • Where clauses
  • Imports
  • Patterns (structs and enums)

These holes have all been fixed by overriding the visit_path function on the
AST visitor instead of a few specialized cases. This change also necessitated a
few stability changes:

  • The collections::fmt module is now stable (it was already supposed to be).
  • The thread_local::imp::Key type is now stable (it was already supposed to
    be).
  • The std::rt::{begin_unwind, begin_unwind_fmt} functions are now stable.
    These are required via the panic! macro.
  • The std::old_io::stdio::{println, println_args} functions are now stable.
    These are required by the print! and println! macros.
  • The ops::{FnOnce, FnMut, Fn} traits are now #[stable]. This is required to
    make bounds with these traits stable. Note that manual implementations of
    these traits are still gated by default, this stability only allows bounds
    such as F: FnOnce().

Closes #8962
Closes #16360
Closes #20327

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @aturon

@@ -1119,8 +1119,7 @@ impl<'a, T: ?Sized> DerefMut for &'a mut T {

/// A version of the call operator that takes an immutable receiver.
#[lang="fn"]
#[unstable(feature = "core",
reason = "uncertain about variadic generics, input versus associated types")]
#[stable(feature = "rust1", since = "1.0.0")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhoh. These are supposed to stay unstable, and only be usable via the -> sugar.

@aturon
Copy link
Member

aturon commented Feb 11, 2015

Nice! @alexcrichton answered my questions on IRC.

@bors: r+ 9bc0d47

@alexcrichton
Copy link
Member Author

@bors: r=aturon bbbb571

There are a number of holes that the stability lint did not previously cover,
including:

* Types
* Bounds on type parameters on functions and impls
* Where clauses
* Imports
* Patterns (structs and enums)

These holes have all been fixed by overriding the `visit_path` function on the
AST visitor instead of a few specialized cases. This change also necessitated a
few stability changes:

* The `collections::fmt` module is now stable (it was already supposed to be).
* The `thread_local::imp::Key` type is now stable (it was already supposed to
  be).
* The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable.
  These are required via the `panic!` macro.
* The `std::old_io::stdio::{println, println_args}` functions are now stable.
  These are required by the `print!` and `println!` macros.
* The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to
  make bounds with these traits stable. Note that manual implementations of
  these traits are still gated by default, this stability only allows bounds
  such as `F: FnOnce()`.

Additionally, the compiler now has special logic to ignore its own generated
`__test` module for the `--test` harness in terms of stability.

Closes rust-lang#8962
Closes rust-lang#16360
Closes rust-lang#20327

[breaking-change]
@bors
Copy link
Contributor

bors commented Feb 11, 2015

⌛ Testing commit bbbb571 with merge 9d02ab1...

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 11, 2015
There are a number of holes that the stability lint did not previously cover,
including:

* Types
* Bounds on type parameters on functions and impls
* Where clauses
* Imports
* Patterns (structs and enums)

These holes have all been fixed by overriding the `visit_path` function on the
AST visitor instead of a few specialized cases. This change also necessitated a
few stability changes:

* The `collections::fmt` module is now stable (it was already supposed to be).
* The `thread_local::imp::Key` type is now stable (it was already supposed to
  be).
* The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable.
  These are required via the `panic!` macro.
* The `std::old_io::stdio::{println, println_args}` functions are now stable.
  These are required by the `print!` and `println!` macros.
* The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to
  make bounds with these traits stable. Note that manual implementations of
  these traits are still gated by default, this stability only allows bounds
  such as `F: FnOnce()`.

Closes rust-lang#8962
Closes rust-lang#16360
Closes rust-lang#20327
@bors
Copy link
Contributor

bors commented Feb 11, 2015

💔 Test failed - auto-win-64-opt

@alexcrichton
Copy link
Member Author

@bors: retry

@bors
Copy link
Contributor

bors commented Feb 12, 2015

⌛ Testing commit bbbb571 with merge 7fd79f4...

@bors
Copy link
Contributor

bors commented Feb 12, 2015

💔 Test failed - auto-linux-64-x-android-t

@alexcrichton
Copy link
Member Author

@bors: retry

@bors bors merged commit bbbb571 into rust-lang:master Feb 12, 2015
@alexcrichton alexcrichton deleted the stability-holes branch February 12, 2015 02:55
@brson
Copy link
Contributor

brson commented Feb 17, 2015

Amazing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants