profile
viewpoint

rust-lang/nomicon 434

The Dark Arts of Advanced and Unsafe Rust Programming

rust-lang/reference 291

The Rust Reference

matthewjasper/book 0

The Rust Programming Language

matthewjasper/cargo 0

The Rust package manager

matthewjasper/chalk 0

A PROLOG-ish interpreter written in Rust, intended eventually for use in the compiler

matthewjasper/compiler-explorer 0

Run compilers interactively from your web browser and interact with the assembly

matthewjasper/intellij-rust 0

Rust plugin for the IntelliJ Platform: https://intellij-rust.github.io/

matthewjasper/miri 0

An interpreter for Rust's mid-level intermediate representation

matthewjasper/nomicon 0

The Dark Arts of Advanced and Unsafe Rust Programming

matthewjasper/reference 0

The Rust Reference

pull request commentrust-lang/rust

Separate projection bounds and predicates

@craterbot abort

matthewjasper

comment created time in a day

pull request commentrust-lang/rust

Separate projection bounds and predicates

@craterbot cancel

matthewjasper

comment created time in a day

pull request commentrust-lang/rust

Validate built-in attribute placement

I can see link_name, target_feature and cold being used in incorrect places. I think those should be warnings for now.

calebzulawski

comment created time in a day

pull request commentrust-lang/rust

Provide more information on duplicate lang item error.

@bors r+

ehuss

comment created time in a day

pull request commentrust-lang/rust

Separate projection bounds and predicates

Actually, it looks like some of the of the perf creates failed to build, I'll cancel if that's the case locally.

matthewjasper

comment created time in a day

pull request commentrust-lang/rust

Separate projection bounds and predicates

@craterbot check

matthewjasper

comment created time in a day

pull request commentrust-lang/rust

Separate projection bounds and predicates

@bors try @rust-timer queue

matthewjasper

comment created time in 2 days

PR opened rust-lang/rust

Separate projection bounds and predicates

Follow up to #72788.

  • Rename projection_predicates to item_bounds
  • Separate bounds on associated types (the things after the : in type X: ...) and opaque types (the things after impl) from predicates.
  • Projection candidates now have the correct nested obligations
  • Trait object candidates now check that the associated types on the trait object satisfy their bounds as nested obligations
  • Type alias impl trait types are now checked (#73035)
  • feature(generic_associated_types) no longer changes how we handle bounds (#73816)

Opening for a perf and crater runs.

r? @nikomatsakis

+2186 -1804

0 comment

209 changed files

pr created time in 2 days

push eventmatthewjasper/rust

Matthew Jasper

commit sha 4195513501ccdd30c377f54a589d2c292f3ae966

Separate bounds and predicates for associated/opaque types

view details

Matthew Jasper

commit sha e9e6ff598541f7861db94598b3570ac2d59a8c0c

Make projection wf check the predicates for the projection

view details

Matthew Jasper

commit sha 62f7c9d41543719c170abaf45998343aaa93576b

Check projections are well-formed when using projection candidates

view details

Matthew Jasper

commit sha eccc6d30106965c0bbdc66e33102c8a3a55ad216

Check opaque types satisfy their bounds

view details

Matthew Jasper

commit sha 60b9ba18812dc870a01947a87757c52f750db079

Check associated type bounds for object safety violations

view details

Matthew Jasper

commit sha 347317899708e02865ef9dc32e68b6c2e904cb99

Remove unused part of return value from `replace_bound_vars_with_placeholders`

view details

Matthew Jasper

commit sha f74d09c38c5f26f6e30ec722dfa7daf370b2a938

Move some code from rustc_typeck to rustc_trait_selection

view details

Matthew Jasper

commit sha ef256bef268f0a2c2073936c081e996b022c0a29

Ensure that associated types for trait objects satisfy their bounds

view details

Matthew Jasper

commit sha 9b7ee5c86a27e5daf6b0ebdff563819a240e9d2f

Fix tests and bootstrap

view details

Matthew Jasper

commit sha b90c0fc3abf884ef96b717f49991f6b226e1598b

Fix tools

view details

push time in 2 days

push eventmatthewjasper/rust

Nathan West

commit sha 358dc1d8c2e10eceaf3c04d532bbde73b0dd4bb7

Added io forwarding methods to the stdio structs

view details

Yoshua Wuyts

commit sha 8bc6b5b45c9f9710852e2b9c57eb3d44d08ad245

stabilize leading_trailing_ones

view details

Alexis Bourget

commit sha 93cbad6ed5f6a40bdd1e8cee6a9b1a39f17ab166

Add documentation to point to `!is_dir` instead of `is_file`

view details

Alexis Bourget

commit sha ec63f9d99b4faec04db0f924c24be9529f4febed

Added the note to Metadata too

view details

Alexis Bourget

commit sha c1243dbcd96f43d013e38f01efe91eb35b81fa18

Make a note about is_dir vs is_file in Path too

view details

Nathan West

commit sha b60cefee0addb02b5bd146893d358bb52bc829e2

Removed write_fmt forwarding, to fix recursive borrow issues

view details

Nathan West

commit sha 14d385bedeeec7fcb48f4c9bb881b1cdae011da0

Restore some write_fmts

view details

VillSnow

commit sha 4c8ce48a15c88715955e56c9c35959d9dffad5ec

Add partition_point

view details

VillSnow

commit sha c9b49157057a83a97801f9e726ed8051fb1d2231

fix: doc test

view details

Ralf Jung

commit sha 810f309ff30fe7a75917f9e5359074dc991b4590

MIR sanity check: validate types on assignment

view details

Ralf Jung

commit sha 50d7deac4de3bfde44a634ff4dabf3115f694c79

prepare visit_statement for checking more kinds of statements

view details

Ralf Jung

commit sha 93e3552d040edfa67cdedfe2fe4a44fe0c4ead59

also normalize constants when comparing types

view details

Ralf Jung

commit sha 9576e307a7b8ac0c812fac927d247761662e7d1a

also normalize_erasing_regions

view details

Ralf Jung

commit sha 8200771aa2cbd393a5beca819ac2462cf35e8d15

reveal_all when sanity-checking MIR assignment types

view details

Ralf Jung

commit sha 978470f711b3be3350a46d386a424e1dfb1ea148

no need to normalize mutability any more

view details

Ralf Jung

commit sha 91f73fbca488973169b4f4b927323f712ad3d776

use a TypeRelation to compare the types

view details

Ralf Jung

commit sha 7754322bcc2852814592c47c3b76c53fefe95a4f

fix typo Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>

view details

Ralf Jung

commit sha 7f8fe6a9851aaf493c8657fe7e98145539d466dd

also use relator in interpreter assignment sanity check

view details

Ralf Jung

commit sha 5e5ae8b0875ce70b1a729bef442e753bb3d2502f

expand a comment

view details

Ralf Jung

commit sha a593728fc753f85df575b54aadc64c3fd2c06d11

make layout check a mere sanity check

view details

push time in 2 days

issue commentrust-lang/rust

broken mir, trivial loop with -Zvalidate-mir

This is probably due to this line: https://github.com/rust-lang/rust/blob/665190b34609c5204a3bd57c571c1dff4d8bc5f2/src/librustc_mir_build/build/expr/into.rs#L395 Break, Continueand Return shouldn't have this, since they have type !, not ().

matthiaskrgr

comment created time in 2 days

push eventmatthewjasper/rust

Matthew Jasper

commit sha 35b2a6e6aaca7f19115924ca327ecaae370200d0

Fix tests

view details

push time in 3 days

create barnchmatthewjasper/rust

branch : projection-bounds-2

created branch time in 3 days

issue closedrust-lang/rust

Implement type- and const-generic associated types

The compiler errors for the following code:

#![feature(generic_associated_types)]

trait X {
    type Y<T>;
}

This is due to the compiler having no way to represent the implicit for<T: Sized> Y<T>: Sized bound on the trait. Some things that would need to be fixed before this can happen are:

  • The handling of bound and placeholder types and constants in the compiler needs to be reviewed.
  • There needs to be a way to represent traits bounds on bound types. I think the bound above is supposed to become for<T> if T: Sized { Y<T>: Sized }.
  • Maybe Chalk needs to progress further? Without Chalk we can at least get to the point of trait errors due to lack of (lazy) normalization.

cc @rust-lang/wg-traits

closed time in 3 days

matthewjasper

issue commentrust-lang/rust

Implement type- and const-generic associated types

So, #72788 ended up allowing this because of changes to how bounds are handled. Any issues with this can be tracked in other issues.

matthewjasper

comment created time in 3 days

Pull request review commentrust-lang/rust

Remove most specialization use in serialization

 pub trait Decoder {     fn error(&mut self, err: &str) -> Self::Error; } -pub trait Encodable {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>;-}--pub trait Decodable: Sized {-    fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;+/// Trait for types that can be serialized+///+/// This can be implemented using the `Encodable`, `TyEncodable` and+/// `MetadataEncodable` macros.+///+/// * `Encodable` should be used in crates that don't depend on+///   `librustc_middle`.+/// * `TyEncodable` should be used for types that are only serialized in crate+///   metadata or the incremental cache, except for simple enums.where+/// * `MetadataEncodable` is used in `rustc_metadata` for types that are only+///   serialized in crate metadata.+pub trait Encodable<S: Encoder> {+    fn encode(&self, s: &mut S) -> Result<(), S::Error>; } -impl Encodable for usize {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+/// Trait for types that can be deserialized+///+/// This can be implemented using the `Decodable`, `TyDecodable` and+/// `MetadataDecodable` macros.+///+/// * `Decodable` should be used in crates that don't depend on+///   `librustc_middle`.+/// * `TyDecodable` should be used for types that are only serialized in crate+///   metadata or the incremental cache, except for simple enums.where+/// * `MetadataDecodable` is used in `rustc_metadata` for types that are only+///   serialized in crate metadata.+pub trait Decodable<D: Decoder>: Sized {+    fn decode(d: &mut D) -> Result<Self, D::Error>;+}++impl<S: Encoder> Encodable<S> for usize {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_usize(*self)     } } -impl Decodable for usize {-    fn decode<D: Decoder>(d: &mut D) -> Result<usize, D::Error> {+impl<D: Decoder> Decodable<D> for usize {+    fn decode(d: &mut D) -> Result<usize, D::Error> {         d.read_usize()     } } -impl Encodable for u8 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for u8 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_u8(*self)     } } -impl Decodable for u8 {-    fn decode<D: Decoder>(d: &mut D) -> Result<u8, D::Error> {+impl<D: Decoder> Decodable<D> for u8 {+    fn decode(d: &mut D) -> Result<u8, D::Error> {         d.read_u8()     } } -impl Encodable for u16 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for u16 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_u16(*self)     } } -impl Decodable for u16 {-    fn decode<D: Decoder>(d: &mut D) -> Result<u16, D::Error> {+impl<D: Decoder> Decodable<D> for u16 {+    fn decode(d: &mut D) -> Result<u16, D::Error> {         d.read_u16()     } } -impl Encodable for u32 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for u32 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_u32(*self)     } } -impl Decodable for u32 {-    fn decode<D: Decoder>(d: &mut D) -> Result<u32, D::Error> {+impl<D: Decoder> Decodable<D> for u32 {+    fn decode(d: &mut D) -> Result<u32, D::Error> {         d.read_u32()     } } -impl Encodable for ::std::num::NonZeroU32 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for ::std::num::NonZeroU32 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_u32(self.get())     } } -impl Decodable for ::std::num::NonZeroU32 {-    fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {+impl<D: Decoder> Decodable<D> for ::std::num::NonZeroU32 {+    fn decode(d: &mut D) -> Result<Self, D::Error> {         d.read_u32().map(|d| ::std::num::NonZeroU32::new(d).unwrap())     } } -impl Encodable for u64 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for u64 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_u64(*self)     } } -impl Decodable for u64 {-    fn decode<D: Decoder>(d: &mut D) -> Result<u64, D::Error> {+impl<D: Decoder> Decodable<D> for u64 {+    fn decode(d: &mut D) -> Result<u64, D::Error> {         d.read_u64()     } } -impl Encodable for u128 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for u128 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_u128(*self)     } } -impl Decodable for u128 {-    fn decode<D: Decoder>(d: &mut D) -> Result<u128, D::Error> {+impl<D: Decoder> Decodable<D> for u128 {+    fn decode(d: &mut D) -> Result<u128, D::Error> {         d.read_u128()     } } -impl Encodable for isize {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for isize {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_isize(*self)     } } -impl Decodable for isize {-    fn decode<D: Decoder>(d: &mut D) -> Result<isize, D::Error> {+impl<D: Decoder> Decodable<D> for isize {+    fn decode(d: &mut D) -> Result<isize, D::Error> {         d.read_isize()     } } -impl Encodable for i8 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for i8 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_i8(*self)     } } -impl Decodable for i8 {-    fn decode<D: Decoder>(d: &mut D) -> Result<i8, D::Error> {+impl<D: Decoder> Decodable<D> for i8 {+    fn decode(d: &mut D) -> Result<i8, D::Error> {         d.read_i8()     } } -impl Encodable for i16 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for i16 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_i16(*self)     } } -impl Decodable for i16 {-    fn decode<D: Decoder>(d: &mut D) -> Result<i16, D::Error> {+impl<D: Decoder> Decodable<D> for i16 {+    fn decode(d: &mut D) -> Result<i16, D::Error> {         d.read_i16()     } } -impl Encodable for i32 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for i32 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_i32(*self)     } } -impl Decodable for i32 {-    fn decode<D: Decoder>(d: &mut D) -> Result<i32, D::Error> {+impl<D: Decoder> Decodable<D> for i32 {+    fn decode(d: &mut D) -> Result<i32, D::Error> {         d.read_i32()     } } -impl Encodable for i64 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for i64 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_i64(*self)     } } -impl Decodable for i64 {-    fn decode<D: Decoder>(d: &mut D) -> Result<i64, D::Error> {+impl<D: Decoder> Decodable<D> for i64 {+    fn decode(d: &mut D) -> Result<i64, D::Error> {         d.read_i64()     } } -impl Encodable for i128 {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for i128 {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_i128(*self)     } } -impl Decodable for i128 {-    fn decode<D: Decoder>(d: &mut D) -> Result<i128, D::Error> {+impl<D: Decoder> Decodable<D> for i128 {+    fn decode(d: &mut D) -> Result<i128, D::Error> {         d.read_i128()     } } -impl Encodable for str {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for str {+    fn encode(&self, s: &mut S) -> Result<(), S::Error> {         s.emit_str(self)     } } -impl Encodable for String {-    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {+impl<S: Encoder> Encodable<S> for &str {

It conflicts with the impl for Ty.

matthewjasper

comment created time in 3 days

pull request commentrust-lang/rust

Recover extra trailing angle brackets in struct definition

@bors r+

Aaron1011

comment created time in 3 days

issue commentrust-lang/rust

Type alias impl trait types do not check bounds apply to concrete type

The first example is UB so it may be target/optimization level dependent. This will be fixed once the ICE is gone.

matthewjasper

comment created time in 3 days

issue commentrust-lang/rust

Tracking issue for specialization (RFC 1210)

I think that the diff may be too large to show the change. It's pointing to this: https://github.com/rust-lang/rust/blob/fb818d4321dee29e1938c002c1ff79b0e7eaadff/src/librustc_span/def_id.rs#L124

Re: Blanket impls, they are breaking changes anyway:

  • They might partially overlap a downstream impl, which is not allowed
  • Coherence can assume their non-existence in more subtle ways (which is why reserveration impls were added internally)
  • Specializing impls have to be always applicable, which either means:
    • We break peoples impls (what min_specialization does).
    • We require them to somehow annotate their trait bounds as being always applicable where necessary.
    • We make the always applicable change for them implicitly and potentially introduce subtle runtime bugs when the default impl now applies.
nikomatsakis

comment created time in 3 days

issue commentrust-lang/rust

Tracking issue for specialization (RFC 1210)

I would like to second having some sort of marker on specializing impls. There have been quite a few cases of code in rustc and the standard library not doing what it looks like because there's no way to know that specialization is actually happening:

An unnecessary specialization of Copy: https://github.com/rust-lang/rust/pull/72707/files#diff-3afa644e1d09503658d661130df65f59L1955

A "Specialization" that isn't: https://github.com/rust-lang/rust/pull/71321/files#diff-da456bd3af6d94a9693e625ff7303113L1589

An implementation generated by a macro unless a flag is passed overriding a default impl: https://github.com/rust-lang/rust/pull/73851/files?file-filters%5B%5D=#diff-ebb36dd2ac01b28a3fff54a1382527ddR124

nikomatsakis

comment created time in 4 days

PR opened rust-lang/rust

Remove most specialization use in serialization

Switching from specialization to min_specialization in the compiler made the unsoundness of how we used these traits pretty clear. This changes how the Encodable and Decodable traits work to be more friendly for types need a TyCtxt to deserialize.

The alternative design of having both Encodable and TyEncodable traits was considered, but doesn't really work because the following impls would conflict:

impl<E: Ecodable> TyEncodable for Encodable
impl<E: TyEcodable> TyEncodable for [E]

How-to guide

  • Rustc(De|En)codable is now spelled Ty(De|En)coable in rustc_middle, Metadata(En|De)codable in rustc_metadata where needed, and (De|En)codable everywhere else.
  • Manual implementations of (De|En)codable shouldn't be much different.
  • If you're adding a new interned type that needs to be en/decodable then the simplest thing way to handle this is:
    • Have the type be a wrapper around a reference to the interned data (i.e. do what ty::Predicate does, and not what all of the other interned types do)
    • Derive Ty(En|De)codable on the inner type
    • Implement Encodable<impl TyEncoder> by forwarding to the inner type.
    • Implement Decodable<impl TyDecoder> by decoding the inner type and then creating the wrapper around that (using the tcx from the decoder as needed).

cc @rust-lang/compiler for opinions on this change r? @oli-obk

+1882 -1935

0 comment

114 changed files

pr created time in 4 days

push eventmatthewjasper/rust

Matthew Jasper

commit sha be8f5f0fac2fd72cea4cac2032ad1ee029d28b41

Rework `rustc_serialize` - Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.

view details

Matthew Jasper

commit sha 80b18eaf7d932b0fa8249e2ee8d09e8b27b0dc08

Simplify arena_types macros

view details

Matthew Jasper

commit sha fb818d4321dee29e1938c002c1ff79b0e7eaadff

Add some documentation for (De|En)codable

view details

push time in 4 days

push eventmatthewjasper/rust

Carsten Andrich

commit sha c88e6a75f5f681610142aaba351cdd6e30deed95

add Windows system error codes that map to io::ErrorKind::TimedOut

view details

Carsten Andrich

commit sha 86679967e3cc895d2b5ab4bb974664ff283fe043

use or pattern to match error codes that map to ErrorKind::TimedOut

view details

Carsten Andrich

commit sha c69d6c84c7042d767e55f69ff544de0098a6042f

fix formatting issues that fail tidy test

view details

Eduardo Sánchez Muñoz

commit sha f03cf9916a1932f47b788a9de9256269cc172fe9

Add a fast path for `std::thread::panicking`. This is done by adding a global atomic variable (non-TLS) that counts how many threads are panicking. In order to check if the current thread is panicking, this variable is read and, if it is zero, no thread (including the one where `panicking` is being called) is panicking and `panicking` can return `false` immediately without needing to access TLS. If the global counter is not zero, the local counter is accessed from TLS to check if the current thread is panicking.

view details

Tomasz Miąsko

commit sha e4b7d2c5071d1066159702d8176c6d87d843403e

Omit DW_AT_linkage_name when it is the same as DW_AT_name The DWARF standard suggests that it might be useful to include `DW_AT_linkage_name` when it is *distinct* from the identifier name.

view details

Nathan West

commit sha 358dc1d8c2e10eceaf3c04d532bbde73b0dd4bb7

Added io forwarding methods to the stdio structs

view details

Alexis Bourget

commit sha 2031e99d772091854d716df5bdf227f8be9b6397

Added implementations for TryFrom<{int}> for NonZero{int}

view details

Alexis Bourget

commit sha d8b51f180a9c6ced4397ce5568fa8ab553a7143e

Added tests for the implementations

view details

Guillaume Gomez

commit sha b97487bad8608afe05f34f07016aa6276c1a291d

Add check for doc alias attribute format

view details

Guillaume Gomez

commit sha 2d6267a7a8ae0399f2d363b6ac667fee0b53a1a0

Add test for doc alias attribute validation

view details

Vadim Petrochenkov

commit sha 69b2179afe695d1a93b792cfd7c4197ca63ce658

Print accessed env vars as special comments into depinfo files

view details

TrolledWoods

commit sha 0c5c644c91edf6ed949cfa5ffc524f43369df604

Mention that BTreeMap::new() doesn't allocate I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().

view details

Carol (Nichols || Goulding)

commit sha e85df08bdec792f512c1f92dbdb126c49ac57d0c

Don't move cursor in search box when using arrows to navigate search results

view details

Yoshua Wuyts

commit sha 2764e54c29d0f19242e794d5eecd00cc5470f530

impl ToSocketAddrs for (String, u16)

view details

Alexis Bourget

commit sha 0dcb392e9889ab6976973a2f7140d18a80178202

Added implementations for NonZero(U|I)size

view details

Alexis Bourget

commit sha 2b8e2f836f59db23630a06554b8e1a33f6c502f5

Correctly format the tests and import TryFrom

view details

Alexis Bourget

commit sha 6c8d8d6a6055d19dc33cc8b33b082d17583a0e47

Fix test call for error case

view details

Devin R

commit sha a4b8bb88f210de7fa2d82fe64b48331126eb7462

warn on macro_use attr cargo dev update lints use if_chain clean up alot, span_lint_and_sugg find imported macros for sugg

view details

Devin R

commit sha ede366be637657280ca506c5bad0f41f96c47340

collected all the imports and names how to compare macro to import path add more imports to test

view details

Devin R

commit sha 8ffbf6f94d9cc77ade0596ee104f3549b8db452d

use hashset not map for keeping track of seen macro refs remove stdout, fix clippy warnings, fmtcar

view details

push time in 4 days

pull request commentrust-lang/rust

Edit cursor.prev() method docs in lexer

@bors r+ rollup

pierwill

comment created time in 4 days

Pull request review commentrust-lang/rust

Edit cursor.prev() method docs in lexer

 impl<'a> Cursor<'a> {         }     } -    /// For debug assertions only-    /// Returns the last eaten symbol (or '\0' in release builds).+    /// Returns the last eaten symbol (or `\0` in release builds).

yes

pierwill

comment created time in 4 days

pull request commentrust-lang/rust

Provide more information on duplicate lang item error.

The use needs to be in src/librustc_middle/ty/query/mod.rs, not src/librustc_middle/query/mod.rs.

I couldn't find an explanation of what should be a query. Queries are used both for caching and tracking dependencies for incremental: queries are expected to be depend only on their inputs and the results of any queries that they call. For data that exists prior to the query system, the current approach is to make make the public method to access the data an eval_always query.

ehuss

comment created time in 4 days

pull request commentrust-lang/rust

Remove GlobalCtxt::enter_local

@bors r+ rollup

bjorn3

comment created time in 4 days

pull request commentrust-lang/rust

MIR sanity check: validate types on assignment

@bors r+

RalfJung

comment created time in 5 days

Pull request review commentrust-lang/rust

MIR sanity check: validate types on assignment

 impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {     }      fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {-        // The sides of an assignment must not alias. Currently this just checks whether the places-        // are identical.-        if let StatementKind::Assign(box (dest, rvalue)) = &statement.kind {-            match rvalue {-                Rvalue::Use(Operand::Copy(src) | Operand::Move(src)) => {-                    if dest == src {-                        self.fail(-                            location,-                            "encountered `Assign` statement with overlapping memory",-                        );+        match &statement.kind {+            StatementKind::Assign(box (dest, rvalue)) => {

As a follow up we should also check function calls and DropAndReplace

RalfJung

comment created time in 5 days

pull request commentrust-lang/rust

replace more `DefId`s with `LocalDefId`

@bors r+

lcnr

comment created time in 5 days

pull request commentrust-lang/rust

improper_ctypes: fix remaining `Reveal:All`

@bors r+

davidtwco

comment created time in 5 days

push eventmatthewjasper/rust

Dylan DPC

commit sha e6b5d88f6de81a6b8999cad6d4a49d5db17b2396

Rollup merge of #72990 - rust-lang:wesleywiser-patch-1, r=Dylan-DPC Fix missing word in RELEASES.md

view details

bors

commit sha 47c3158c3d797f75f0f7b2b2a977179668919dab

Auto merge of #72995 - Dylan-DPC:rollup-7gsyb8x, r=Dylan-DPC Rollup of 5 pull requests Successful merges: - #72946 (remove outdated fixme) - #72971 (Hexagon libstd: fix typo for c_ulonglong) - #72986 (Add more assert to Vec with_capacity docs) - #72987 (Add myself to mailmap) - #72990 (Fix missing word in RELEASES.md) Failed merges: r? @ghost

view details

marmeladema

commit sha d0fccb552b87fa88c4c15c912e5012ffbb54f98e

Remove unsused `NodeId` related APIs in hir map

view details

Aaron Hill

commit sha b541d3da5d9f89407c7072f4a6d65872cf30a577

Add `-Z span-debug` to allow for easier debugging of proc macros Currently, the `Debug` impl for `proc_macro::Span` just prints out the byte range. This can make debugging proc macros (either as a crate author or as a compiler developer) very frustrating, since neither the actual filename nor the `SyntaxContext` is displayed. This commit adds a perma-unstable flag `-Z span-debug`. When enabled, the `Debug` impl for `proc_macro::Span` simply forwards directly to `rustc_span::Span`. Once #72618 is merged, this will start displaying actual line numbers. While `Debug` impls are not subject to Rust's normal stability guarnatees, we probably shouldn't expose any additional information on stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise, we would be providing a 'backdoor' way to access information that's supposed be behind unstable APIs.

view details

Alexis Bourget

commit sha 817d6a078eb6b7ef1103781bd9114c6d9b811db9

Add a **Note**: comment in documentation when the type/method/function is not always available

view details

Eric Huss

commit sha e6582006e8e8959ba412a2117cdd5baec2638f6e

Enable lld for Cargo tests on Windows.

view details

bors

commit sha 219380d840877de97b0e17674be7212ebc929d51

Auto merge of #72901 - ehuss:update-cargo, r=Mark-Simulacrum Update cargo 9 commits in 9fcb8c1d20c17f51054f7aa4e08ff28d381fe096..40ebd52206e25c7a576ee42c137cc06a745a167a 2020-05-25 16:25:36 +0000 to 2020-06-01 22:35:00 +0000 - Warn if using hash in git URL, Fixes rust-lang/cargo#8241 (rust-lang/cargo#8297) - reset lockfile information between resolutions (rust-lang/cargo#8274) - Disable strip_works test on macos. (rust-lang/cargo#8301) - Fix typo in impl Display for Strip (rust-lang/cargo#8299) - Add support for rustdoc root URL mappings. (rust-lang/cargo#8287) - Fix tests with enoent error message on non-english systems. (rust-lang/cargo#8295) - Fix fingerprinting for lld on Windows with dylib. (rust-lang/cargo#8290) - Fix a typo (rust-lang/cargo#8289) - Fix several issues with close_output test. (rust-lang/cargo#8286)

view details

Aaron Hill

commit sha 7f7729d83be2ff8e9e933b94ff02f1bb77d688f8

Don't create impl candidates when obligation contains errors Fixes #72839 In PR #72621, trait selection was modified to no longer bail out early when an error type was encountered. This allowed us treat `ty::Error` as `Sized`, causing us to avoid emitting a spurious "not sized" error after a type error had already occured. However, this means that we may now try to match an impl candidate against the error type. Since the error type will unify with almost anything, this can cause us to infinitely recurse (eventually triggering an overflow) when trying to verify certain `where` clauses. This commit causes us to skip generating any impl candidates when an error type is involved.

view details

Tshepang Lekhonkhobe

commit sha e508db28405dddbee45c6727b0d59586b522fe80

Update RELEASES.md make catch_unwind line more readable

view details

Aaron Hill

commit sha 3295c262aea18f64b80734989ab522e1278a9d14

Treat selection error as ambiguous when error type is present

view details

Tshepang Lekhonkhobe

commit sha 3c237987181b47026dc07513a8532677b374a5a3

Update RELEASES.md try fix the f64 as u32 line

view details

Tshepang Lekhonkhobe

commit sha 9d6ed2960c302e87f7b01c75efb59fc0353da05a

address review comment

view details

Ivan Tham

commit sha b54a917b1420f709d74b80e99c819ffe3e403ffa

Use assert_eq for liballoc test

view details

Matthias Krüger

commit sha 254f61ae43a12a26ca7fc35bb221eba1186efd8e

add test for #72960 Fixes #72960

view details

Yoshua Wuyts

commit sha 2764e54c29d0f19242e794d5eecd00cc5470f530

impl ToSocketAddrs for (String, u16)

view details

Dylan DPC

commit sha 14dc34dd89604e68e33c38a237dbdeeaf50be33f

Rollup merge of #72260 - csmoe:issue-69276, r=estebank Spell out `Self` in async function return Closes #69276 r? @tmandry

view details

Dylan DPC

commit sha d01f7ae125c05d93ac8d1f70ad770c11c82a6d68

Rollup merge of #72996 - marmeladema:remove-hir-map-nodeid-apis, r=ecstatic-morse Remove unsused `NodeId` related APIs in hir map cc #50928 r? @ecstatic-morse

view details

Dylan DPC

commit sha 27376d57b60178eb65f625b2bdcdb56aa90709e1

Rollup merge of #73010 - tshepang:patch-2, r=Mark-Simulacrum Update RELEASES.md try fix the f64 as u32 line

view details

Dylan DPC

commit sha 10d9e3c9028b5a15c921df20f9c50de365f05339

Rollup merge of #73017 - pickfire:liballoc-assert, r=Xanewok Use assert_eq for liballoc test

view details

Dylan DPC

commit sha 14fd5950a54d47ed38494e2f2c4aec076752b5c7

Rollup merge of #73019 - matthiaskrgr:test_72960, r=Xanewok add test for #72960 Fixes #72960 r? @Xanewok

view details

push time in 7 days

delete branch matthewjasper/chalk

delete branch : copy-everything

delete time in 9 days

issue commentrust-lang/rust

Preallocate `DefId`s for lang items and use lang items in lowering

I don't have plans to finish that work any time soon.

oli-obk

comment created time in 9 days

push eventmatthewjasper/chalk

Mcat12

commit sha 14c5d18d0218e620ad12ad2d7a248961743fbb39

Support logs in lowering tests

view details

Wilco Kusee

commit sha a64289dc803b3c238cc916682e89b23edae54175

Document all public items in chalk-ir

view details

Wilco Kusee

commit sha 06c769ec12ca7068b934e635abc02aeeafc89818

Comment grammar and sentence endings

view details

Wilco Kusee

commit sha acc9f2518448c84803481f624e993893be52a9cb

More line endings in comments

view details

Github Action

commit sha 633755230306a546993c3db121223d6a8c0ccbbe

Release 0.14.0

view details

Github Action

commit sha 5d107bd01d88b5dacc5dc413e822c46b2ed37b89

Release 0.15.0-dev.0 chalk@0.15.0-dev.0 chalk-derive@0.15.0-dev.0 chalk-engine@0.15.0-dev.0 chalk-integration@0.15.0-dev.0 chalk-ir@0.15.0-dev.0 chalk-parse@0.15.0-dev.0 chalk-solve@0.15.0-dev.0 Generated by cargo-workspaces

view details

Mcat12

commit sha 2a89bcd0eae0b1e7d9c908520ed986e96d616a08

Move `with_tracing_logs` to chalk-solve

view details

Jack Huey

commit sha f93af43428431f60916cb1c2fd19913efebc9892

Merge pull request #535 from Mcat12/tweak/log-in-lowering-tests Support logs in lowering tests

view details

max_well

commit sha 78aceb67a55f91467f7071fa4d99b1fa1a4e9364

Update role_of_interner.md

view details

Nathan Whitaker

commit sha deebc2d1c5bec4493e2df1567ad4854910cd89d3

Merge pull request #537 from DustinByfuglien/master Typo in book

view details

Wilco Kusee

commit sha e7d53c0997f1770f4a37fec59e608ba4f7cd0a82

Remove some superfluous comments

view details

Wilco Kusee

commit sha ec45d51a142af0361c5b9743b2de1305d23ebc3e

Flip ToGenericArg tuple order to allow enumerating

view details

Jack Huey

commit sha b643b213014e7585db732a50730ff817d72e173c

Merge pull request #536 from detrumi/doc-comments Document all public items in chalk-ir

view details

Matthew Jasper

commit sha 5aa7c1e34e18814e5ec8808596b2f11b6fa11950

Add more Copy implementations This is mainly so that `QuantifiedWhereClause` can be put in a `rustc_middle::ty::List` (rustc's interned slice type), the other impls are added in case they're useful.

view details

push time in 9 days

issue commentrust-lang/rust

Preallocate `DefId`s for lang items and use lang items in lowering

see also #61019

I have an old branch for this here for anyone interested: https://github.com/matthewjasper/rust/commit/a227c706b7809ff07021baf3856b7540d5b57f8a#diff-c0f791ead38d2d02916faaad0f56f41d

Also see this comment: https://github.com/matthewjasper/rust/commit/a227c706b7809ff07021baf3856b7540d5b57f8a#r40107992

oli-obk

comment created time in 9 days

CommitCommentEvent

delete branch matthewjasper/rust

delete branch : remove-closurebound

delete time in 9 days

Pull request review commentrust-lang/rust

Implement a feature for a sound specialization subset

 impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {                     self.check_impl_trait(ty);                 }                 self.check_gat(generics, i.span);+                false             }-            _ => {}+            _ => false,+        };+        if let ast::Defaultness::Default(_) = i.kind.defaultness() {+            // Limit `min_specialization` to only specializing functions.+            gate_feature_fn!(+                &self,+                |x: &Features| x.specialization || (is_fn && x.min_specialization),

The reason to only for functions being a simpler than constants and types is that we only ever work out which impl to select for a (non-const) function when generating code. For constants we can evaluate them during type checking and during codegen and I wanted to avoid potential bugs with any mismatches there.

matthewjasper

comment created time in 9 days

pull request commentrust-lang/rust

Rollup of 9 pull requests

#72788 looks like it was a lot of the perf gains here from local testing

Manishearth

comment created time in 10 days

PR opened rust-lang/chalk

Add more Copy implementations

This is mainly so that QuantifiedWhereClause can be put in a rustc_middle::ty::List, the others are added in case they're useful.

+121 -2

0 comment

1 changed file

pr created time in 10 days

push eventmatthewjasper/rust

Matthew Jasper

commit sha 05b3466f8a5380ef5ce4965c488fb64d499dab1e

Add some documentation for (De|En)codable

view details

push time in 10 days

create barnchmatthewjasper/rust

branch : serialize-not-special

created branch time in 10 days

delete branch matthewjasper/rust

delete branch : predicate-cache

delete time in 11 days

pull request commentrust-lang/rust

Update hashbrown to 0.8.0

Specialization looks good now. Who would be a good reviewer for this?

Amanieu

comment created time in 11 days

Pull request review commentrust-lang/rust

Provide more information on duplicate lang item error.

 impl<'tcx> TyCtxt<'tcx> {         if cnum == LOCAL_CRATE { false } else { self.cstore.crate_is_private_dep_untracked(cnum) }     } +    pub fn crate_extern_paths(&self, cnum: CrateNum) -> Vec<PathBuf> {

This should be a query: you can declare it be copying this example and updating the signature and description https://github.com/rust-lang/rust/blob/7adbc0dfeffcb6c2ae489cc97d28f76612c7cdf3/src/librustc_middle/query/mod.rs#L1035-L1038

ehuss

comment created time in 11 days

Pull request review commentrust-lang/rust

Provide more information on duplicate lang item error.

 impl CrateStore for CStore {     fn allocator_kind(&self) -> Option<AllocatorKind> {         self.allocator_kind()     }++    fn crate_extern_paths(&self, cnum: CrateNum) -> Vec<PathBuf> {+        self.get_crate_data(cnum).source().paths().cloned().collect()

Move this into the provide macro above.

ehuss

comment created time in 11 days

Pull request review commentrust-lang/rust

Provide more information on duplicate lang item error.

 impl LanguageItemCollector<'tcx> {                             ));                         }                     }+                    let mut note_def = |which, def_id: DefId| {+                        let location = if def_id.is_local() {+                            "the local crate".to_string()+                        } else {+                            let paths: Vec<_> = self+                                .tcx+                                .crate_extern_paths(def_id.krate)+                                .iter()+                                .map(|p| p.display().to_string())+                                .collect();+                            paths.join(", ")+                        };+                        err.note(&format!(+                            "{} definition in `{}` loaded from {}",

For the local crate the note should be "{} definition in the local crate".

ehuss

comment created time in 11 days

Pull request review commentrust-lang/rust

Use min_specialization in libcore

 where { } +#[stable(feature = "rust1", since = "1.0.0")]+impl<A: Debug, B: Debug> Debug for Zip<A, B> {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        ZipFmt::fmt(self, f)+    }+}++trait ZipFmt<A, B> {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result;+}++impl<A: Debug, B: Debug> ZipFmt<A, B> for Zip<A, B> {+    default fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        f.debug_struct("Zip").field("a", &self.a).field("b", &self.b).finish()+    }+}++impl<A: Debug + TrustedRandomAccess, B: Debug + TrustedRandomAccess> ZipFmt<A, B> for Zip<A, B> {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        // It's *not safe* to call fmt on the contained iterators, since once+        // we start iterating they're in a strange potentially unsafe states.+        f.debug_struct("Zip").finish()+    }+}+ /// An iterator whose items are random-accessible efficiently /// /// # Safety ///-/// The iterator's .len() and size_hint() must be exact.-/// `.len()` must be cheap to call.+/// The iterator's `size_hint` must be exact and cheap to call.+///+/// `size` may not be overridden.+///+/// `<Self as Iterator>::get_unchecked` must be overridden. It must be safe to+/// call provided the following conditions are met ///-/// .get_unchecked() must return distinct mutable references for distinct-/// indices (if applicable), and must return a valid reference if index is in-/// 0..self.len().-pub(crate) unsafe trait TrustedRandomAccess: ExactSizeIterator {-    unsafe fn get_unchecked(&mut self, i: usize) -> Self::Item;+/// 1. `0 <= idx` and `idx < self.size()`.+/// 2. If `self: !Clone`, then `get_unchecked` is never called with the same+///    index on `self` more than once.+/// 3. After `self.get_unchecked(idx)` has been called then `next_back` will+///    only be called at most `self.size() - idx - 1` times.+/// 4. After `get_unchecked` is called, then only the following methods will be+///    called on `self`:+///     * `std::clone::Clone::clone`+///     * `std::iter::Iterator::size_hint()`+///     * `std::iter::Iterator::next_back()`+///     * `std::iter::Iterator::get_unchecked()`+///     * `std::iter::TrustedRandomAccess::size()`+///+/// Further, given that these conditions are met, it must guarantee that:+///+/// * It does not change the value returned from `size_hint`+/// * It must be safe to call the methods listed above on `self` after calling+///   `get_unchecked`, assuming that the required traits are implemented.+/// * It must also be safe to drop `self` after calling `get_unchecked`.+#[doc(hidden)]+#[unstable(feature = "trusted_random_access", issue = "none")]+#[rustc_specialization_trait]+pub unsafe trait TrustedRandomAccess: Sized {

It's now used in the interface of Iterator

matthewjasper

comment created time in 11 days

pull request commentrust-lang/rust

Provide suggestions for some moved value errors

@bors r+

estebank

comment created time in 11 days

pull request commentrust-lang/rust

Cache flags and escaping vars for predicates

@bors r=nikomatsakis

matthewjasper

comment created time in 11 days

pull request commentrust-lang/rust

Fix typo in error_codes doc

@bors r+ rollup

dario23

comment created time in 11 days

push eventmatthewjasper/rust

mibac138

commit sha d4fe9553f65df51a18999e956fd507e26271e74e

Implement partial error recovery for `let` with `BinOpEq` When parsing `let x: i8 += 1` the compiler interprets `i8` as a trait which makes it more complicated to do error recovery. More advanced error recovery is not implemented in this commit.

view details

mibac138

commit sha 48ff12acb184672393692e087927a66ff7907d71

Expand partial error recovery for `let` with `BinOpEq`

view details

mibac138

commit sha 05d653199871955eba90abdd3b176603f030ab60

Error recovery for `let` with `+=`

view details

mibac138

commit sha 6ad24baf06c687517f188e8c6e6ce848924d001c

Adjust according to estebank's review comments

view details

mibac138

commit sha 98532a30901d7544c49fe82f499db53699645de0

Adjust according to petrochenkov's review comments

view details

Rich Kadel

commit sha a6127e3fde9e8d24388847ad1b442a4337f19965

Merge pull request #1 from rust-lang/master update from upstream

view details

Benjamin Saunders

commit sha 730f7366bba5abdf5ae0c2f1222795e40d48f90c

Fix asinh of negative values When `x` has large magnitude, `x + ((x * x) + 1.0).sqrt()` approaches `x + x.abs()`. For negative values of `x`, this leads to catastrophic cancellation, resulting in large errors or even 0 being passed to `ln`, producing incorrect results including `-inf`. Becuase asinh is an odd function, i.e. -asinh(x) = asinh(-x) for all x, we can avoid the catastrophic cancellation and obtain correct results by taking the absolute value of `self` for the first term. `self * self` is always positive, so in effect this gives us `x.abs().asinh().copysign(x)` which as discussed above is algebraically equivalent, but is much more accurate.

view details

Aaron Hill

commit sha ebe5a916b08d5d58b03fe551a95038d9cf964781

Properly encode AnonConst into crate metadata Fixes #68104 Previous, we were encoding AnonConst as a regular Const, causing us to treat them differently after being deserialized in another compilation session.

view details

Mikail Bagishov

commit sha 591584e71f7d8a613d586066c8b01c1eecf08f35

Add tests for 'impl Default for [T; N]'

view details

Bastian Kauschke

commit sha b3aa5e38107df9e9b16a0a003afaa3d12d80bb86

add str to common types

view details

Mikail Bagishov

commit sha 3313bf62ac45fab2c39e49c788423153754087a9

Skip leak test on targets without panic=unwind

view details

Ralf Jung

commit sha f7d745f33d950c050e0a5a2ee2ee9f0e1269e956

tag/niche terminology cleanup

view details

Ralf Jung

commit sha 7a6d03c2699787644b44f7bc3e8252d1508880b8

miri errors: rename InvalidDiscriminant -> InvalidTag

view details

Vadim Petrochenkov

commit sha d1c275b350f9ae74be92114f4819d6afb55d6007

linker: MSVC supports linking static libraries as a whole archive

view details

Sam Elliott

commit sha 3da3d15f9f150dafd7d635859795c4c714e7b7ad

[RISC-V] Do not force frame pointers We have been seeing some very inefficient code that went away when using `-Cforce-frame-pointers=no`. For instance `core::ptr::drop_in_place` at `-Oz` was compiled into a function which consisted entirely of saving registers to the stack, then using the frame pointer to restore the same registers (without any instructions between the prolog and epilog). The RISC-V LLVM backend supports frame pointer elimination, so it makes sense to allow this to happen when using Rust. It's not clear to me that frame pointers have ever been required in the general case. In rust-lang/rust#61675 it was pointed out that this made reassembling stack traces easier, which is true, but there is a code generation option for forcing frame pointers, and I feel the default should not be to require frame pointers, given it demonstrably makes code size worse (around 10% in some embedded applications). The kinds of targets mentioned in rust-lang/rust#61675 are popular, but should not dictate that code generation should be worse for all RISC-V targets, especially as there is a way to use CFI information to reconstruct the stack when the frame pointer is eliminated. It is also a misconception that `fp` is always used for the frame pointer. `fp` is an ABI name for `x8` (aka `s0`), and if no frame pointer is required, `x8` may be used for other callee-saved values. This commit does ensure that the standard library is built with unwind tables, so that users do not need to rebuild the standard library in order to get a backtrace that includes standard library calls (which is the original reason for forcing frame pointers).

view details

Carol (Nichols || Goulding)

commit sha 1bc4e45b3fe3a0817908bd7cc21ec23798d38d63

Only highlight results via mouseover if mouse has moved

view details

Nathan Corbyn

commit sha df996e8e12b094e3aedfe0e35c2a8ded57f56890

Make `need_type_info_err` more conservative

view details

Nathan Corbyn

commit sha b4ddd9183103586ba1456241b9c117a420bb6d6b

Add FIXME to comment regarding local patterns Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>

view details

Amanieu d'Antras

commit sha e9b67d281a3a1e740217ded7df9fc292f5ba6559

Fix link error with #[thread_local] introduced by #71192

view details

Bastian Kauschke

commit sha af7fbecf7f2e1e3c8a9680b20b67e58ed34bf49f

store `ObligationCause` on the heap

view details

push time in 11 days

Pull request review commentrust-lang/rust

MIR sanity check: validate types on assignment

 impl<'a, 'tcx> TypeChecker<'a, 'tcx> {             &format!("broken MIR in {:?} ({}): {}", self.def_id, self.when, msg.as_ref()),         );     }++    /// Check if src can be assigned into dest.+    /// This is not precise, it will accept some incorrect assignments.+    fn mir_assign_valid_types(&self, src: Ty<'tcx>, dest: Ty<'tcx>) -> bool {+        if src == dest {+            // Equal types, all is good.+            return true;+        }+        // Normalize projections and things like that.+        let src = self.tcx.normalize_erasing_regions(self.param_env, src);+        let dest = self.tcx.normalize_erasing_regions(self.param_env, dest);+        // It's worth checking equality again.+        if src == dest {+            return true;+        }++        // Type-changing assignments can happen for (at least) two reasons:+        // 1. `&mut T` -> `&T` gets optimized from a reborrow to a mere assignment.+        // 2. Subtyping is used. While all normal lifetimes are erased, higher-ranked types+        //    with their late-bound lifetimes are still around and can lead to type differences.+        // Normalize both of them away.+        // Also see the related but slightly different post-monomorphization method in `interpret/eval_context.rs`.+        let normalize = |ty: Ty<'tcx>| {+            ty.fold_with(&mut BottomUpFolder {

For equality/subtyping relations Ok(a) is generally what's returned on success.

RalfJung

comment created time in 11 days

delete branch matthewjasper/rust

delete branch : projection-bound-validation

delete time in 11 days

delete branch matthewjasper/rust

delete branch : arena-not-special

delete time in 11 days

PR opened rust-lang/rust

Use min_specialization in libcore

Getting TrustedRandomAccess to work is the main interesting thing here.

  • get_unchecked is now an unstable, hidden method on Iterator
  • The contract for TrustedRandomAccess is made clearer in documentation
  • Fixed a bug where Debug would create aliasing references when using the specialized zip impl
  • Added tests for the side effects of next_back and nth.

closes #68536

+465 -163

0 comment

8 changed files

pr created time in 12 days

create barnchmatthewjasper/rust

branch : core-min-spec

created branch time in 12 days

Pull request review commentrust-lang/rust

Provide suggestions for some moved value errors

 impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {                             &mut err,                             format!("variable moved due to use{}", move_spans.describe()),                         );+                        if let UseSpans::PatUse(span) = move_spans {+                            err.span_suggestion_verbose(+                                span.shrink_to_lo(),+                                &format!(+                                    "borrow this field in the pattern to avoid moving {}",

Is this span in the right place when using the long field pattern syntax? (Variant { field: binding }') Does this suggestmut x=>ref mut x`?

estebank

comment created time in 12 days

Pull request review commentrust-lang/rust

Provide suggestions for some moved value errors

 impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {             }         } -        let normal_ret = OtherUse(stmt.source_info.span);+        let normal_ret = if let [ProjectionElem::Downcast(..), ProjectionElem::Field(_, _)] =+            moved_place.projection+        {+            PatUse(stmt.source_info.span)+        } else {+            OtherUse(stmt.source_info.span)+        };

The correct (or at least more correct) way to check if this is a pattern binding is to check that:

  • This location is an StatementKind::Assign of an Rvalue::Use
  • The assignment is to a user defined local (i.e. self.body.local_decls[target].is_user_variable() is true
  • The ever initialized flow is false at this point.

Unfortunately the flows aren't available here currently, and changing things so that they are would be a fairly large change (#73552).

I think that if this is going to use an imperfect heuristic that would be fine with a fixme referencing that issue. The condition should be moved_place.projection.iter().any(|p| matches!(p, ProjectionElem::Downcast).

estebank

comment created time in 12 days

issue openedrust-lang/rust

Use `dataflow::ResultsCursor` in borrowck

Having a ResultsCursor stored in MirBorrowckCtxt would allow accessing the flow state at arbitrary points in error reporting and make using the usual mir visitor possible.

created time in 12 days

Pull request review commentrust-lang/rust

MIR sanity check: validate types on assignment

 impl<'a, 'tcx> TypeChecker<'a, 'tcx> {             &format!("broken MIR in {:?} ({}): {}", self.def_id, self.when, msg.as_ref()),         );     }++    /// Check if src can be assigned into dest.+    /// This is not precise, it will accept some incorrect assignments.+    fn mir_assign_valid_types(&self, src: Ty<'tcx>, dest: Ty<'tcx>) -> bool {+        if src == dest {+            // Equal types, all is good.+            return true;+        }+        // Normalize projections and things like that.+        let src = self.tcx.normalize_erasing_regions(self.param_env, src);+        let dest = self.tcx.normalize_erasing_regions(self.param_env, dest);+        // It's worth checking equality again.+        if src == dest {+            return true;+        }++        // Type-changing assignments can happen for (at least) two reasons:+        // 1. `&mut T` -> `&T` gets optimized from a reborrow to a mere assignment.+        // 2. Subtyping is used. While all normal lifetimes are erased, higher-ranked types+        //    with their late-bound lifetimes are still around and can lead to type differences.+        // Normalize both of them away.+        // Also see the related but slightly different post-monomorphization method in `interpret/eval_context.rs`.+        let normalize = |ty: Ty<'tcx>| {+            ty.fold_with(&mut BottomUpFolder {

#72093 and #72820.

RalfJung

comment created time in 12 days

pull request commentrust-lang/rust

Validate built-in attribute placement

@craterbot check

calebzulawski

comment created time in 12 days

pull request commentrust-lang/rust

Projection bound validation

@bors r=nikomatsakis

matthewjasper

comment created time in 12 days

pull request commentrust-lang/rust

MIR sanity check: validate types on assignment

I think that's all that needs addressing.

RalfJung

comment created time in 12 days

Pull request review commentrust-lang/rust

MIR sanity check: validate types on assignment

 impl<'a, 'tcx> TypeChecker<'a, 'tcx> {             &format!("broken MIR in {:?} ({}): {}", self.def_id, self.when, msg.as_ref()),         );     }++    /// Check if src can be assigned into dest.+    /// This is not precise, it will accept some incorrect assignments.+    fn mir_assign_valid_types(&self, src: Ty<'tcx>, dest: Ty<'tcx>) -> bool {+        if src == dest {+            // Equal types, all is good.+            return true;+        }+        // Normalize projections and things like that.+        let src = self.tcx.normalize_erasing_regions(self.param_env, src);+        let dest = self.tcx.normalize_erasing_regions(self.param_env, dest);+        // It's worth checking equality again.+        if src == dest {+            return true;+        }++        // Type-changing assignments can happen for (at least) two reasons:+        // 1. `&mut T` -> `&T` gets optimized from a reborrow to a mere assignment.+        // 2. Subtyping is used. While all normal lifetimes are erased, higher-ranked types+        //    with their late-bound lifetimes are still around and can lead to type differences.+        // Normalize both of them away.+        // Also see the related but slightly different post-monomorphization method in `interpret/eval_context.rs`.+        let normalize = |ty: Ty<'tcx>| {+            ty.fold_with(&mut BottomUpFolder {

It could be faster than folding because it doesn't create any new types. They probably should both be changed. This PR can be landed without that change though. I think that the &mut to & transmute issue is fixed now, so the mk_imm_ref call below can be removed either way.

RalfJung

comment created time in 12 days

pull request commentrust-lang/rust

Update hashbrown to 0.7.2

I don't think that I'll get around to adding a new way of specializing on Copy any time soon. Adding only the Copy specialization seems OK.

Amanieu

comment created time in 12 days

pull request commentrust-lang/rust

remove leftover mentions of `skol` and `int` from the compiler

@bors r+

lcnr

comment created time in 12 days

pull request commentrust-lang/rust

Cleanup MinGW LLVM linkage workaround

@bors r+

mati865

comment created time in 12 days

push eventmatthewjasper/rust

Matthew Jasper

commit sha d660dbc630b1678fadfdd60c4d8e96d3de724b0d

Check associated type satisfy their bounds This was currently only happening due to eager normalization, which isn't possible if there's specialization or bound variables.

view details

Matthew Jasper

commit sha 9818bc08d314708da38d1f67b6de75c60a3a6ebf

Don't set STILL_FURTHER_SPECIALIZABLE for regions/bound variables

view details

Matthew Jasper

commit sha db4826dd6ca48663a0b4c5ab0681258999017c7d

Move bounds on associated types to the type Given `trait X { type U; }` the bound `<Self as X>::U` now lives on the type, rather than the trait. This is feature gated on `feature(generic_associated_types)` for now until more testing can be done. The also enabled type-generic associated types since we no longer need "implies bounds".

view details

Matthew Jasper

commit sha 5e8c9f4fae106d0ba836a0268ab4e44c19d63f2a

Explain what the substs we're creating are

view details

push time in 12 days

pull request commentrust-lang/rust

Validate built-in attribute placement

I think changes like this in the past have sometimes needed to be warnings because existing code has attributes in incorrect places. @bors try for a crate run

calebzulawski

comment created time in 12 days

Pull request review commentrust-lang/rust

Validate built-in attribute placement

 fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {         } else if attr.check_name(sym::thread_local) {             codegen_fn_attrs.flags |= CodegenFnAttrFlags::THREAD_LOCAL;         } else if attr.check_name(sym::track_caller) {-            if tcx.is_closure(id) || tcx.fn_sig(id).abi() != abi::Abi::Rust {+            if !tcx.is_closure(id) && tcx.fn_sig(id).abi() != abi::Abi::Rust {

Could these have comments stating that we error when using target feature on a closure in check_attr?

calebzulawski

comment created time in 12 days

push eventmatthewjasper/rust

Bastian Kauschke

commit sha b3aa5e38107df9e9b16a0a003afaa3d12d80bb86

add str to common types

view details

Nathan Corbyn

commit sha df996e8e12b094e3aedfe0e35c2a8ded57f56890

Make `need_type_info_err` more conservative

view details

Nathan Corbyn

commit sha b4ddd9183103586ba1456241b9c117a420bb6d6b

Add FIXME to comment regarding local patterns Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>

view details

Hanif Bin Ariffin

commit sha 7349f2c6a3a02885449c951852af4bc4a7678b8a

Added unsafety documentation to shift_head

view details

Hanif Bin Ariffin

commit sha 9e8b42c02bfa348b024ad07652e860b125345acf

Added unsafety documentation to shift_tail This is just the reverse of shift_head.

view details

Hanif Bin Ariffin

commit sha 9e1e989f7cfbc9bb35511acdeb51b3122bf717a2

Document unsafety in partial_insertion_sort We already implicitly (or explicitly??) do the bound checking for the indexing.

view details

Hanif Bin Ariffin

commit sha c471519b999265c45595750e5b98de6865325650

Added unsafety documentation with partition and partition equal These are simply indexing safety.

view details

Hanif Bin Ariffin

commit sha c710461b02660cef1d077420d5b486b1d8f1f28b

Added some unsafety documentation to partition_equal

view details

Ayaz Hafiz

commit sha afbbd383ccee8b91b1d1bbdcfb0f7a906bba71f7

Note numeric literals that can never fit in an expected type re https://github.com/rust-lang/rust/pull/72380#discussion_r438289385 Given the toy code ```rust fn is_positive(n: usize) { n > -1_isize; } ``` We currently get a type mismatch error like the following: ``` error[E0308]: mismatched types --> src/main.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | 2 | n > (-1_isize).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` But clearly, `-1` can never fit into a `usize`, so the suggestion will always panic. A more useful message would tell the user that the value can never fit in the expected type: ``` error[E0308]: mismatched types --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | note: `-1_isize` can never fit into `usize` --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ ``` Which is what this commit implements. I only added this check for negative literals because - Currently we can only perform such a check for literals (constant value propagation is outside the scope of the typechecker at this point) - A lint error for out-of-range numeric literals is already emitted IMO it makes more sense to put this check in librustc_lint, but as far as I can tell the typecheck pass happens before the lint pass, so I've added it here. r? @estebank

view details

Ayaz Hafiz

commit sha 2b936bb5a26f1f10daa5a6c5ed546dd274995942

fixup! Note numeric literals that can never fit in an expected type

view details

Tomasz Miąsko

commit sha 0a65f280c8eac844a74b758822ca52e8763a1d5d

Diagnose use of incompatible sanitizers Emit an error when incompatible sanitizer are configured through command line options. Previously the last one configured prevailed and others were silently ignored. Additionally use a set to represent configured sanitizers, making it possible to enable multiple sanitizers at once. At least in principle, since currently all of them are considered to be incompatible with others.

view details

Josh Triplett

commit sha 840176ab6f9fdda0878bd0ba1297437b506c6b7c

asm: Unify pseudo-keyword parsing using `eat`, rather than a final `expect` Currently, `asm!` parsing uses an `expect` for the last parsed pseudo-keyword (`sym`), which makes it difficult to extend without simultaneously refactoring. Use `eat` for the last pseudo-keyword, and then add an `else` that fails parsing. No change to error output.

view details

Jonas Schievink

commit sha 99d30da6a8668181185b24c59e71a521a3c5f388

Improve `Instance` docs

view details

Jonas Schievink

commit sha 9014df55c65fdb3d89d6273cf0ecdfbec2444cdb

validator: print MIR instance on failure

view details

Jonas Schievink

commit sha 26e17ae8892d0232e8f519e0c79cde44d5fd046b

Remove `Adjustment::DerefMove` It does the same thing as `Deref` now

view details

Jonas Schievink

commit sha 58062e1913248a2ad62072f51cc51db00bba66dc

shim.rs: improve docs a bit

view details

Jonas Schievink

commit sha af97a117e538c5945cb19a4d3a045e509274d9cf

shim.rs: call `FnPtr`, not `Self` The `Call` terminator only works with `FnDef` and `FnPtr` types. It happened to work with `Self` so far because it was always substituted with the real type before being used.

view details

Josh Triplett

commit sha 50d6d4de67d76f03f8a8b209881a924f2d69922f

asm: When pretty-printing, don't escape characters twice pprust uses `print_string` to write out the template string, and `print_string` already calls `escape_debug`, so `impl fmt::Display for InlineAsmTemplatePiece` shouldn't do an additional `escape_debug`. This fixes a pretty-printing bug that translated `asm!("...\n...")` to `asm!("...\\n...")`

view details

Vadim Petrochenkov

commit sha a4337ccc10db07f72566ad06f62662ab9b27e3bd

Use `LocalDefId` for import IDs in trait map

view details

Vadim Petrochenkov

commit sha fc13fd03ba0155915f72d0d1578f69c3998e73ad

typeck: Use `LocalDefId`s for the unused trait import set

view details

push time in 12 days

delete branch matthewjasper/rust

delete branch : auto-rec

delete time in 12 days

Pull request review commentrust-lang/rust

convert higher ranked `Predicate`s to `PredicateKind::ForAll`

 impl<'tcx> Predicate<'tcx> {         // from the substitution and the value being substituted into, and         // this trick achieves that). -        let substs = &trait_ref.skip_binder().substs;-        let kind = self.kind();-        let new = match kind {-            &PredicateKind::Trait(ref binder, constness) => {-                PredicateKind::Trait(binder.map_bound(|data| data.subst(tcx, substs)), constness)-            }-            PredicateKind::Subtype(binder) => {-                PredicateKind::Subtype(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            PredicateKind::RegionOutlives(binder) => {-                PredicateKind::RegionOutlives(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            PredicateKind::TypeOutlives(binder) => {-                PredicateKind::TypeOutlives(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            PredicateKind::Projection(binder) => {-                PredicateKind::Projection(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            &PredicateKind::WellFormed(data) => PredicateKind::WellFormed(data.subst(tcx, substs)),-            &PredicateKind::ObjectSafe(trait_def_id) => PredicateKind::ObjectSafe(trait_def_id),-            &PredicateKind::ClosureKind(closure_def_id, closure_substs, kind) => {-                PredicateKind::ClosureKind(closure_def_id, closure_substs.subst(tcx, substs), kind)-            }-            &PredicateKind::ConstEvaluatable(def_id, const_substs) => {-                PredicateKind::ConstEvaluatable(def_id, const_substs.subst(tcx, substs))-            }-            PredicateKind::ConstEquate(c1, c2) => {-                PredicateKind::ConstEquate(c1.subst(tcx, substs), c2.subst(tcx, substs))-            }+        let substs = trait_ref.skip_binder().substs;+        let kind = match self.kind() {+            PredicateKind::ForAll(binder) => binder.skip_binder().kind(),+            kind => kind,         }; -        if new != *kind { new.to_predicate(tcx) } else { self }+        let new = kind.subst(tcx, substs);

Call substs directly on the predicate

lcnr

comment created time in 13 days

Pull request review commentrust-lang/rust

convert higher ranked `Predicate`s to `PredicateKind::ForAll`

 impl<'tcx> Predicate<'tcx> {         // from the substitution and the value being substituted into, and         // this trick achieves that). -        let substs = &trait_ref.skip_binder().substs;-        let kind = self.kind();-        let new = match kind {-            &PredicateKind::Trait(ref binder, constness) => {-                PredicateKind::Trait(binder.map_bound(|data| data.subst(tcx, substs)), constness)-            }-            PredicateKind::Subtype(binder) => {-                PredicateKind::Subtype(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            PredicateKind::RegionOutlives(binder) => {-                PredicateKind::RegionOutlives(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            PredicateKind::TypeOutlives(binder) => {-                PredicateKind::TypeOutlives(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            PredicateKind::Projection(binder) => {-                PredicateKind::Projection(binder.map_bound(|data| data.subst(tcx, substs)))-            }-            &PredicateKind::WellFormed(data) => PredicateKind::WellFormed(data.subst(tcx, substs)),-            &PredicateKind::ObjectSafe(trait_def_id) => PredicateKind::ObjectSafe(trait_def_id),-            &PredicateKind::ClosureKind(closure_def_id, closure_substs, kind) => {-                PredicateKind::ClosureKind(closure_def_id, closure_substs.subst(tcx, substs), kind)-            }-            &PredicateKind::ConstEvaluatable(def_id, const_substs) => {-                PredicateKind::ConstEvaluatable(def_id, const_substs.subst(tcx, substs))-            }-            PredicateKind::ConstEquate(c1, c2) => {-                PredicateKind::ConstEquate(c1.subst(tcx, substs), c2.subst(tcx, substs))-            }+        let substs = trait_ref.skip_binder().substs;+        let kind = match self.kind() {

self.ignore_qualifiers().skip_binder()

lcnr

comment created time in 13 days

Pull request review commentrust-lang/rust

convert higher ranked `Predicate`s to `PredicateKind::ForAll`

 impl ToPredicate<'tcx> for PredicateKind<'tcx> {  impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {     fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {-        ty::PredicateKind::Trait(-            ty::Binder::dummy(ty::TraitPredicate { trait_ref: self.value }),

Where you've deleted a Binder::dummy and it's not obvious, can you add a debug-assertion that there are no escaping bound vars?

lcnr

comment created time in 13 days

Pull request review commentrust-lang/rust

convert higher ranked `Predicate`s to `PredicateKind::ForAll`

 pub fn anonymize_predicate<'tcx>( ) -> ty::Predicate<'tcx> {     let kind = pred.kind();     let new = match kind {-        &ty::PredicateKind::Trait(ref data, constness) => {-            ty::PredicateKind::Trait(tcx.anonymize_late_bound_regions(data), constness)+        ty::PredicateKind::ForAll(binder) => {+            ty::PredicateKind::ForAll(tcx.anonymize_late_bound_regions(binder))         }+        &ty::PredicateKind::Trait(data, constness) => ty::PredicateKind::Trait(data, constness),

The remaining branches can return pred immediately

lcnr

comment created time in 13 days

pull request commentrust-lang/rust

Projection bound validation

@bors r=nikomatsakis

matthewjasper

comment created time in 13 days

push eventmatthewjasper/rust

mibac138

commit sha d4fe9553f65df51a18999e956fd507e26271e74e

Implement partial error recovery for `let` with `BinOpEq` When parsing `let x: i8 += 1` the compiler interprets `i8` as a trait which makes it more complicated to do error recovery. More advanced error recovery is not implemented in this commit.

view details

mibac138

commit sha 48ff12acb184672393692e087927a66ff7907d71

Expand partial error recovery for `let` with `BinOpEq`

view details

mibac138

commit sha 05d653199871955eba90abdd3b176603f030ab60

Error recovery for `let` with `+=`

view details

mibac138

commit sha 6ad24baf06c687517f188e8c6e6ce848924d001c

Adjust according to estebank's review comments

view details

mibac138

commit sha 98532a30901d7544c49fe82f499db53699645de0

Adjust according to petrochenkov's review comments

view details

Rich Kadel

commit sha a6127e3fde9e8d24388847ad1b442a4337f19965

Merge pull request #1 from rust-lang/master update from upstream

view details

Benjamin Saunders

commit sha 730f7366bba5abdf5ae0c2f1222795e40d48f90c

Fix asinh of negative values When `x` has large magnitude, `x + ((x * x) + 1.0).sqrt()` approaches `x + x.abs()`. For negative values of `x`, this leads to catastrophic cancellation, resulting in large errors or even 0 being passed to `ln`, producing incorrect results including `-inf`. Becuase asinh is an odd function, i.e. -asinh(x) = asinh(-x) for all x, we can avoid the catastrophic cancellation and obtain correct results by taking the absolute value of `self` for the first term. `self * self` is always positive, so in effect this gives us `x.abs().asinh().copysign(x)` which as discussed above is algebraically equivalent, but is much more accurate.

view details

Mikail Bagishov

commit sha 591584e71f7d8a613d586066c8b01c1eecf08f35

Add tests for 'impl Default for [T; N]'

view details

Mikail Bagishov

commit sha 3313bf62ac45fab2c39e49c788423153754087a9

Skip leak test on targets without panic=unwind

view details

Ralf Jung

commit sha f7d745f33d950c050e0a5a2ee2ee9f0e1269e956

tag/niche terminology cleanup

view details

Ralf Jung

commit sha 7a6d03c2699787644b44f7bc3e8252d1508880b8

miri errors: rename InvalidDiscriminant -> InvalidTag

view details

Vadim Petrochenkov

commit sha d1c275b350f9ae74be92114f4819d6afb55d6007

linker: MSVC supports linking static libraries as a whole archive

view details

Sam Elliott

commit sha 3da3d15f9f150dafd7d635859795c4c714e7b7ad

[RISC-V] Do not force frame pointers We have been seeing some very inefficient code that went away when using `-Cforce-frame-pointers=no`. For instance `core::ptr::drop_in_place` at `-Oz` was compiled into a function which consisted entirely of saving registers to the stack, then using the frame pointer to restore the same registers (without any instructions between the prolog and epilog). The RISC-V LLVM backend supports frame pointer elimination, so it makes sense to allow this to happen when using Rust. It's not clear to me that frame pointers have ever been required in the general case. In rust-lang/rust#61675 it was pointed out that this made reassembling stack traces easier, which is true, but there is a code generation option for forcing frame pointers, and I feel the default should not be to require frame pointers, given it demonstrably makes code size worse (around 10% in some embedded applications). The kinds of targets mentioned in rust-lang/rust#61675 are popular, but should not dictate that code generation should be worse for all RISC-V targets, especially as there is a way to use CFI information to reconstruct the stack when the frame pointer is eliminated. It is also a misconception that `fp` is always used for the frame pointer. `fp` is an ABI name for `x8` (aka `s0`), and if no frame pointer is required, `x8` may be used for other callee-saved values. This commit does ensure that the standard library is built with unwind tables, so that users do not need to rebuild the standard library in order to get a backtrace that includes standard library calls (which is the original reason for forcing frame pointers).

view details

Carol (Nichols || Goulding)

commit sha 1bc4e45b3fe3a0817908bd7cc21ec23798d38d63

Only highlight results via mouseover if mouse has moved

view details

Amanieu d'Antras

commit sha e9b67d281a3a1e740217ded7df9fc292f5ba6559

Fix link error with #[thread_local] introduced by #71192

view details

Oliver Scherer

commit sha 20abc70e04eefa252e5a8bfe934cb54c51c1da37

Don't intern memory in const prop. This isn't sound without validation. We don't want to report errors in case of failure to intern and validate, we just don't want to const prop. Interning and const prop is not built for this, let's not do it until we have a clearer picture on aggregate propagation.

view details

Wesley Wiser

commit sha 1e88f130a347f8b223031eafe75c0772ccfec00c

Stop allowing `Indirect(..)` values to be propagated Closes #72679 Closes #72372 Closes #72285

view details

Rich Kadel

commit sha d139a720a2c0ad7066c43edad6ec6c2aa9613740

Merge pull request #2 from rust-lang/master update from origin 2020-06-10

view details

Amanieu d'Antras

commit sha 2af53e9a15aed1e9798867c9233a722530d03177

Add -O compile flag to test

view details

Mateusz Mikuła

commit sha 9ceb9bb20324630380153c1db5aeb56a433ab8d9

Move copying of self-contained objects to new function

view details

push time in 13 days

pull request commentrust-lang/rust

Use alloc::Layout in DroplessArena API

@bors r+ rollup

tmiasko

comment created time in 13 days

Pull request review commentrust-lang/rust

convert higher ranked `Predicate`s to `PredicateKind::ForAll`

 impl<'tcx> Eq for Predicate<'tcx> {} impl<'tcx> Predicate<'tcx> {     #[inline(always)]     pub fn kind(self) -> &'tcx PredicateKind<'tcx> {-        self.kind+        &self.inner.kind+    }++    /// Skips `PredicateKind::ForAll`.+    pub fn ignore_qualifiers(self) -> Binder<Predicate<'tcx>> {+        match self.kind() {+            &PredicateKind::ForAll(binder) => binder,+            ty::PredicateKind::Projection(..)+            | ty::PredicateKind::Trait(..)+            | ty::PredicateKind::Subtype(..)+            | ty::PredicateKind::WellFormed(..)+            | ty::PredicateKind::ObjectSafe(..)+            | ty::PredicateKind::ClosureKind(..)+            | ty::PredicateKind::TypeOutlives(..)+            | ty::PredicateKind::ConstEvaluatable(..)+            | ty::PredicateKind::ConstEquate(..)+            | ty::PredicateKind::RegionOutlives(..) => {+                // We can't use `Binder::dummy` here, as predicates can+                // contain unbound variables in rare cases, for example when+                // dealing with opaque types.+                Binder::bind(self)

You'll have to update the DeBruijn indices here, so that any escaping bound variables stay escaping:

if self.has_escaping_bound_vars() {
    Binder::bind(fold::shift_vars(tcx, &self, 1))
} else {
    Binder::dummy()
}
lcnr

comment created time in 13 days

CommitCommentEvent
CommitCommentEvent

pull request commentrust-lang/rust

Upgrade Chalk

@bors r- (bors got restarted)

jackh726

comment created time in 14 days

issue commentrust-lang/rust

Multiple defining uses of type alias impl trait in single function are not handled

Variants on this can cause ICEs and llvm errors instead, as one might expect.

matthewjasper

comment created time in 14 days

issue openedrust-lang/rust

Multiple defining uses of type alias impl trait in single function are not handled

I tried this code:

#![feature(type_alias_impl_trait)]

type X<A, B> = impl Into<&'static A>;

fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
    (a, a)
}

fn main() {
    println!("{}", <X<_, _> as Into<&String>>::into(f(&[1isize, 2, 3], String::new()).1));
}

I expected to see this happen: compiler error because X<A, B> is unified with A and also X<B, A> is unified with A.

Instead, this happened: program compiles, runs and segfaults.

Meta

rustc --version --verbose:

rustc 1.46.0-nightly (feb3536eb 2020-06-09)
binary: rustc
commit-hash: feb3536eba10c2e4585d066629598f03d5ddc7c6
commit-date: 2020-06-09
host: x86_64-unknown-linux-gnu
release: 1.46.0-nightly
LLVM version: 10.0

created time in 14 days

create barnchmatthewjasper/chalk

branch : copy-everything

created branch time in 14 days

pull request commentrust-lang/rust

Unify region variables when projecting associated types

@bors r=nikomatsakis

matthewjasper

comment created time in 14 days

push eventmatthewjasper/rust

Aaron Hill

commit sha e9b0ce8afa5635d3825b5e76e0b3593d9086778a

Add test for overflow when finding auto-trait impls in Rustdoc

view details

Matthew Jasper

commit sha aa117047f05bba9b6838a773a64aaa8f04f51208

Add helper method for reusing an existing interned region

view details

push time in 14 days

pull request commentrust-lang/rust

Add specialization of `ToString for char`

I'm fine with this specialization being added. We use min_specialization everywhere apart from core, so I think that "we have some checks in place" for this.

lzutao

comment created time in 14 days

pull request commentrust-lang/rust

Rollup of 15 pull requests

Build has failed without bors noticing @bors retry

RalfJung

comment created time in 14 days

pull request commentrust-lang/rust

Unify region variables when projecting associated types

@bors try @rust-timer queue

matthewjasper

comment created time in 15 days

PR opened rust-lang/rust

Unify region variables when projecting associated types

This is required to avoid cycles when evaluating auto trait predicates. Notably, this is required to be able add Chalk types to CtxtInterners for cfg(parallel_compiler).

r? @nikomatsakis

+133 -35

0 comment

29 changed files

pr created time in 15 days

push eventmatthewjasper/rust

Bastian Kauschke

commit sha af7fbecf7f2e1e3c8a9680b20b67e58ed34bf49f

store `ObligationCause` on the heap

view details

Bastian Kauschke

commit sha ea668d9c548d4490ae9e8ea9b4e8942bae02a8fe

use enum to represent ObligationCause::dummy without allocating

view details

Mark Rousskov

commit sha 51e11e310c36d3322335756fe2ea109c99d6ed50

Avoid prematurely recording toolstates When we're running with dry_run enabled (i.e. all builds do this initially), we're guaranteed to save of a toolstate of TestFail for tools that aren't tested. In practice, we do test tools as well, so for those tools we would initially record them as being TestPass, and then later on re-record the correct state after actually testing them. However, this would not work well if the build failed for whatever reason (e.g. panicking in bootstrap, or as was the case in 73097, clippy failing to test successfully), we would just go on believing that things passed when they in practice did not. This commit also adjusts saving toolstate to never record clippy explicitly (otherwise, it would be recorded when building it); eventually that'll likely move to other tools as well but not yet. This is deemed simpler than checking everywhere we generically save toolstate. We also move clippy out of the "toolstate" no-fail-fast build into a separate x.py invocation; this should no longer be technically required but provides the nice state of letting us check toolstate for all tools and only then check clippy (giving full results on every build).

view details

Mark Rousskov

commit sha 399bf383f4975fc874e81a2283098fd82ea7a7df

Disable clippy tests

view details

bors

commit sha c8a9c340de32cb70c8bad8af1a4474f805c5a969

Auto merge of #72962 - lcnr:ObligationCause-lrc, r=ecstatic-morse store `ObligationCause` on the heap Stores `ObligationCause` on the heap using an `Rc`. This PR trades off some transient memory allocations to reduce the size of–and thus the number of instructions required to memcpy–a few widely used data structures in trait solving.

view details

bors

commit sha 435f97cec1f0d7de95a0b80e95f295ab444b2fce

Auto merge of #73285 - Mark-Simulacrum:clippy-fail, r=RalfJung,oli-obk Avoid prematurely recording toolstates When we're running with dry_run enabled (i.e. all builds do this initially), we're guaranteed to save of a toolstate of TestFail for tools that aren't tested. In practice, we do test tools as well, so for those tools we would initially record them as being TestPass, and then later on re-record the correct state after actually testing them. However, this would not work well if the build failed for whatever reason (e.g. panicking in bootstrap, or as was the case in #73097, clippy failing to test successfully), we would just go on believing that things passed when they in practice did not. This commit also adjusts saving toolstate to never record clippy explicitly (otherwise, it would be recorded when building it); eventually that'll likely move to other tools as well but not yet. This is deemed simpler than checking everywhere we generically save toolstate. We also move clippy out of the "toolstate" no-fail-fast build into a separate x.py invocation; this should no longer be technically required but provides the nice state of letting us check toolstate for all tools and only then check clippy (giving full results on every build). r? @oli-obk Supercedes #73275, also fixes #73274

view details

matthewjasper

commit sha ba2ef58ae6c126ec0b87b307d45fef2da127be22

Unify region variables when projecting associated types This is required to avoid cycles when evaluating auto trait predicates.

view details

push time in 15 days

pull request commentrust-lang/rust

shim.rs: avoid creating `Call` terminators calling `Self`

@bors r+

jonas-schievink

comment created time in 15 days

Pull request review commentrust-lang/rust

shim.rs: avoid creating `Call` terminators calling `Self`

+// compile-flags: -Zmir-opt-level=0 -Zvalidate-mir++// Tests that the `<fn() as Fn>` shim does not create a `Call` terminator with a `Self` callee+// (as only `FnDef` and `FnPtr` callees are allowed in MIR).++// EMIT_MIR rustc.ops-function-Fn-call.AddMovesForPackedDrops.before.mir+fn main() {

As a follow up we should add tests for all of the shims.

jonas-schievink

comment created time in 15 days

pull request commentrust-lang/rust

Projection bound validation

@bors r=nikomatsakis

matthewjasper

comment created time in 16 days

pull request commentrust-lang/rust

Remove use of specialization from librustc_arena

@bors r=oli-obk

matthewjasper

comment created time in 16 days

push eventmatthewjasper/rust

Andy Russell

commit sha c379fb5b3a351cf26dc136ee8b8bc557aa904a75

remove extra space from crate-level doctest names

view details

Bastian Kauschke

commit sha 72a2d35f165a94e17cd17e56cb61e3dcbef7eb2d

fix is_const_context

view details

Bastian Kauschke

commit sha ecb593379c3ab075940a3fbf2e980ec5260b6ca4

refactor check_for_cast

view details

Bastian Kauschke

commit sha 6da17d244b08e5f14edd1645fbd07d1f042d00b7

`is_const_context` -> `is_inside_const_context`

view details

Matthew McAllister

commit sha 98eb29cbba66561cf184f2d7f4277b38bd6b2aad

Fix trait alias inherent impl resolution Fixes #60021 and #72415.

view details

CAD97

commit sha 738f8487fd78a7d860be4e65eee85c9a0e957c13

stabilize vec_drain_as_slice

view details

Aaron Hill

commit sha 9cee22c1a401ace6dd8633335b131c47a37d7bac

Display information about captured variable in `FnMut` error Fixes #69446 When we encounter a region error involving an `FnMut` closure, we display a specialized error message. However, we currently do not tell the user which upvar was captured. This makes it difficult to determine the cause of the error, especially when the closure is large. This commit records marks constraints involving closure upvars with `ConstraintCategory::ClosureUpvar`. When we decide to 'blame' a `ConstraintCategory::Return`, we additionall store the captured upvar if we found a `ConstraintCategory::ClosureUpvar` in the path. When generating an error message, we point to relevant spans if we have closure upvar information available. We further customize the message if an `async` closure is being returned, to make it clear that the captured variable is being returned indirectly.

view details

Santiago Pastorino

commit sha 474b16b00220da77cb811c646de0f05c8b9d80f8

Add windows group to triagebot

view details

Vadim Petrochenkov

commit sha 52f1847bca00890aaf424634f9c0f52960866ee0

resolve: Pass parent scope to the function providing import suggestions

view details

Vadim Petrochenkov

commit sha 21fca7aae7213b651399e95d3d83f85f00734036

resolve: Do not suggest imports from the same module in which we are resolving

view details

Bastian Kauschke

commit sha 29508ce3ad7cf5c886f475d00148b076857bf93c

normalize adt fields during structural match check

view details

Bastian Kauschke

commit sha 4725af38bc51760ad36180ebd7d128481b3d8ccc

remove assert

view details

Alexis Bourget

commit sha 4548eb8fcfa0a3d5dfd2766ee12736f67aca0234

Clarify the behaviour of Pattern when used with methods like str::contains

view details

Simonas Kazlauskas

commit sha 6b1ee675a43db1de297db43919bff6c2f28e1934

Ensure stack when building MIR for matches In particular matching on complex types such as strings will cause deep recursion to happen. Fixes #72933

view details

Guillaume Gomez

commit sha c183c3f4d167121fb6dc5bff7587647217a2ec75

Clean up E0642 explanation

view details

Aaron Hill

commit sha 7f7729d83be2ff8e9e933b94ff02f1bb77d688f8

Don't create impl candidates when obligation contains errors Fixes #72839 In PR #72621, trait selection was modified to no longer bail out early when an error type was encountered. This allowed us treat `ty::Error` as `Sized`, causing us to avoid emitting a spurious "not sized" error after a type error had already occured. However, this means that we may now try to match an impl candidate against the error type. Since the error type will unify with almost anything, this can cause us to infinitely recurse (eventually triggering an overflow) when trying to verify certain `where` clauses. This commit causes us to skip generating any impl candidates when an error type is involved.

view details

Aaron Hill

commit sha 3295c262aea18f64b80734989ab522e1278a9d14

Treat selection error as ambiguous when error type is present

view details

Alex Crichton

commit sha 05b2d3f7dc623fc5304fa0edc9efeaf08ea1db26

std: Enable atomic.fence emission on wasm32 This commit removes the `#[cfg]` guards in `atomic::fence` on wasm targets. Since these guards were originally added the upstream wasm specification for threads gained an `atomic.fence` instruction, so LLVM no longer panics on these intrinsics. Although there aren't a ton of tests in-repo for this right now I've tested locally and all of these fences generate `atomic.fence` instructions in wasm. Closes #72997

view details

Aaron Hill

commit sha ae42c91c6517517e831b12e0f4a98d538b4a19b5

Fix typo Co-authored-by: Randy Taylor <tehgecKozzz@gmail.com>

view details

Ayaz Hafiz

commit sha 568cc22c3d04338f3413af19332a1c31b44dbf77

Add regression test for const generic ICE in #72819 Closes #72819

view details

push time in 16 days

more