2020-02-11 22:39:02 +01:00
|
|
|
//! This crates defines the type inference engine.
|
2020-01-06 20:13:24 +01:00
|
|
|
//!
|
|
|
|
//! - **Type inference.** The type inference code can be found in the `infer` module;
|
|
|
|
//! this code handles low-level equality and subtyping operations. The
|
2021-04-07 14:47:01 -05:00
|
|
|
//! type check pass in the compiler is found in the `rustc_typeck` crate.
|
2020-01-06 20:13:24 +01:00
|
|
|
//!
|
2020-03-05 18:07:42 -03:00
|
|
|
//! For more information about how rustc works, see the [rustc dev guide].
|
2020-01-06 20:13:24 +01:00
|
|
|
//!
|
2020-03-09 18:33:04 -03:00
|
|
|
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/
|
2020-01-06 20:13:24 +01:00
|
|
|
//!
|
|
|
|
//! # Note
|
|
|
|
//!
|
|
|
|
//! This API is completely unstable and subject to change.
|
|
|
|
|
2020-09-23 21:51:56 +02:00
|
|
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
2020-01-06 20:13:24 +01:00
|
|
|
#![feature(bool_to_option)]
|
|
|
|
#![feature(box_patterns)]
|
|
|
|
#![feature(box_syntax)]
|
rewrite leak check to be based on universes
In the new leak check, instead of getting a list of placeholders to
track, we look for any placeholder that is part of a universe which
was created during the snapshot.
We are looking for the following error patterns:
* P1: P2, where P1 != P2
* P1: R, where R is in some universe that cannot name P1
This new leak check is more precise than before, in that it accepts
this patterns:
* R: P1, even if R cannot name P1, because R = 'static is a valid
sol'n
* R: P1, R: P2, as above
Note that this leak check, when running during subtyping, is less
efficient than before in some sense because it is going to check and
re-check all the universes created since the snapshot. We're going to
move when the leak check runs to try and correct that.
2020-05-19 01:09:40 +00:00
|
|
|
#![feature(const_panic)]
|
2020-05-12 20:09:55 -07:00
|
|
|
#![feature(extend_one)]
|
2021-03-08 15:32:41 -08:00
|
|
|
#![feature(iter_zip)]
|
2020-01-06 20:13:24 +01:00
|
|
|
#![feature(never_type)]
|
|
|
|
#![feature(in_band_lifetimes)]
|
2020-10-21 14:24:35 +02:00
|
|
|
#![feature(control_flow_enum)]
|
2020-02-11 22:39:02 +01:00
|
|
|
#![recursion_limit = "512"] // For rustdoc
|
2020-01-06 20:13:24 +01:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate rustc_macros;
|
2021-03-06 16:02:48 +00:00
|
|
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
|
2020-01-06 20:13:24 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rustc_data_structures;
|
|
|
|
#[macro_use]
|
2020-08-13 23:05:01 -07:00
|
|
|
extern crate tracing;
|
2020-01-06 20:13:24 +01:00
|
|
|
#[macro_use]
|
2020-03-29 15:24:45 +02:00
|
|
|
extern crate rustc_middle;
|
2020-01-06 20:13:24 +01:00
|
|
|
|
|
|
|
pub mod infer;
|
|
|
|
pub mod traits;
|