The Dark Arts of Advanced and Unsafe Rust Programming
The Rust Reference
The Rust Programming Language
The Rust package manager
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
Rust plugin for the IntelliJ Platform: https://intellij-rust.github.io/
An interpreter for Rust's mid-level intermediate representation
The Dark Arts of Advanced and Unsafe Rust Programming
The Rust Reference
push eventmatthewjasper/rust
commit sha 55ba9e4755eb47555417c311b867bce6196da462
Reorder benches const variable Move LEN so it is is read in order.
commit sha dbb058302388824b717816b42bbfbc00330fa36d
docs: Reword `str::strip_prefix` and `strip_suffix` a bit "Some is returned with <some value>" is an awkward construction. The use of the passive voice is a bit odd, and doesn't seem like the house style. So say instead "returns X, wrapped in `Some`", for which there is some other precedent in stdlib. Instead of repeating "with the prefix removed", say "after the prefix". This is a bit clearer that the original is not modified. Signed-off-by: Ian Jackson <[email protected]>
commit sha b7974bd3cd2df94d19dad467fa09a79f78067559
docs: Reword `slice::strip_prefix` and `strip_suffix` a bit The stabilisation issue, #73413, has an open item for documentation. I looked at the docs and it is all there, but I felt it could do with some minor wording improvement. I looked at the `str::strip_prefix` docs for a template. (That resulted in me slightly changing that doc too.) I de-linkified `None` and `Some`, as I felt that rather noisy.. I searched stdlib, and these don't seem to be usually linkified. Signed-off-by: Ian Jackson <[email protected]>
commit sha 4549c777e690c69552dea2f2ea04c56074430546
docs: Rewrap `str::strip_prefix` and `strip_suffix` back to 100 Requested-by: @LukasKalbertodt Signed-off-by: Ian Jackson <[email protected]>
commit sha 6f5e96fb5fcd7fb6c67c61027615abd96a9e5e69
docs: Rewrap `slice::strip_prefix` and `strip_suffix` back to 100 Requested-by: @LukasKalbertodt Signed-off-by: Ian Jackson <[email protected]>
commit sha 22358c650ba72e29a35076e243d84d47915ff35c
docs: `slice::strip_prefix` and `strip_suffix`, fold in sentence Roughly as requested by @LukasKalbertodt. I still prefer clearly making these two cases. Signed-off-by: Ian Jackson <[email protected]>
commit sha 096722ff7647c42fe221c0d99892a72e596b6a56
Refactor collapsible_if Signed-off-by: wcampbell <[email protected]>
commit sha fcec76bde4026afcb47ef814aeccfd8cc1f1b28f
Simplify a nested bool match Logically this first eliminates the innermost match by merging the patterns. Then, in a second step, turns the newly innermost match into a `matches!` call.
commit sha bb0ce32423aefcb8b9eb587881973f56a6a6b0ee
Lint unnecessary int-to-int and float-to-float casts
commit sha 915ce3608724e6c900d1b5eb4412cac2fcace33a
manual_unwrap_or / support Result::unwrap_or
commit sha 114cb218f3ab2a709e3017c380790dd6e407132c
Remove an extra blank line in doc examples
commit sha ec23db9496807f6c962b74fe0d6bf15be6c6d35b
Add linter for a single element for loop Signed-off-by: Patrick José Pereira <[email protected]>
commit sha ba1ca19c3bec20401a4cb13e5186c4c5952e94cc
tests: if_same_then_else2: Ignore single_element_loop lint Signed-off-by: Patrick José Pereira <[email protected]>
commit sha 65b52d84f83586752bff2834410e131290dc0155
needless-lifetime / multiple where clause predicates regression
commit sha 57bf80f77626b134faaf2cd95664403627fba0da
Add lint for holding RefCell Ref across an await
commit sha 8727169f7243c87e3708d99e9602562370f01a1a
fmt
commit sha 070a751d4cf350a71901f75bc99ca0e0922a3133
update_lints
commit sha 0f4abbf99a6f1ed783ea6935c83427c2aef95144
Better naming post copy/paste
commit sha b3a427d8733a549b11f9bc88eceb31c857851411
Add another test case
commit sha 3ed69cdb13e5953467f9d849d7ad480479ca01d6
Move existing lint into shared file
push time in 6 hours
Pull request review commentrust-lang/chalk
Add TypeFlags for TyKind in chalk-ir
pub struct Ty<I: Interner> { interned: I::InternedType, } +///compute type flags for Lifetime+fn compute_lifetime_flags<I: Interner>(lifetime: &Lifetime<I>, interner: &I) -> TypeFlags {+ match lifetime.data(&interner) {+ LifetimeData::InferenceVar(_) => {+ TypeFlags::HAS_RE_INFER+ | TypeFlags::HAS_FREE_LOCAL_REGIONS+ | TypeFlags::HAS_FREE_REGIONS+ }+ LifetimeData::Placeholder(_) => {+ TypeFlags::HAS_RE_PLACEHOLDER+ | TypeFlags::HAS_FREE_LOCAL_REGIONS+ | TypeFlags::HAS_FREE_REGIONS+ }+ LifetimeData::Static | LifetimeData::Phantom(_, _) | LifetimeData::BoundVar(_) => {+ TypeFlags::empty()+ }+ }+}++/// Compute type flags for Substitution<I>+fn compute_substitution_flags<I: Interner>(+ substitution: &Substitution<I>,+ interner: &I,+) -> TypeFlags {+ let mut flags = TypeFlags::empty();+ for generic_arg in substitution.iter(&interner) {+ flags |= compute_generic_arg_flags(generic_arg, &interner);+ }+ flags+}++/// Compute type flags for GenericArg<I>+fn compute_generic_arg_flags<I: Interner>(generic_arg: &GenericArg<I>, interner: &I) -> TypeFlags {+ match generic_arg.data(&interner) {+ GenericArgData::Ty(ty) => ty.data(interner).flags,+ GenericArgData::Lifetime(lifetime) => compute_lifetime_flags(lifetime, interner),+ GenericArgData::Const(constant) => {+ let data = constant.data(&interner);+ let flags = data.ty.data(interner).flags;+ match data.value {+ ConstValue::BoundVar(_) => flags,+ ConstValue::InferenceVar(_) => {+ flags | TypeFlags::HAS_CT_INFER | TypeFlags::STILL_FURTHER_SPECIALIZABLE+ }+ ConstValue::Placeholder(_) => {+ flags | TypeFlags::HAS_CT_PLACEHOLDER | TypeFlags::STILL_FURTHER_SPECIALIZABLE+ }+ ConstValue::Concrete(_) => flags,+ }+ }+ }+}++/// Compute type flags for aliases+fn compute_alias_flags<I: Interner>(alias_ty: &AliasTy<I>, interner: &I) -> TypeFlags {+ match alias_ty {+ AliasTy::Projection(projection_ty) => {+ TypeFlags::HAS_TY_PROJECTION+ | compute_substitution_flags(&(projection_ty.substitution), interner)+ }+ AliasTy::Opaque(opaque_ty) => {+ TypeFlags::HAS_TY_OPAQUE+ | compute_substitution_flags(&(opaque_ty.substitution), interner)+ }+ }+}++/// Compute type flags for a TyKind+fn compute_flags<I: Interner>(kind: &TyKind<I>, interner: &I) -> TypeFlags {+ match kind {+ TyKind::Adt(_, substitution)+ | TyKind::AssociatedType(_, substitution)+ | TyKind::Tuple(_, substitution)+ | TyKind::Closure(_, substitution)+ | TyKind::Generator(_, substitution)+ | TyKind::GeneratorWitness(_, substitution)+ | TyKind::FnDef(_, substitution) => compute_substitution_flags(substitution, interner),+ TyKind::Scalar(_) | TyKind::Str | TyKind::Never | TyKind::Foreign(_) => TypeFlags::empty(),+ TyKind::OpaqueType(_, substitution) => {+ TypeFlags::HAS_TY_OPAQUE | compute_substitution_flags(substitution, interner)
So, looking through how this is used in rustc I think that the majority of code would not expect this it to be set for TyKind::OpaqueType, only AliasTy::Opaque.
comment created time in a day
Pull request review commentrust-lang/chalk
Add TypeFlags for TyKind in chalk-ir
pub struct Ty<I: Interner> { interned: I::InternedType, } +///compute type flags for Lifetime+fn compute_lifetime_flags<I: Interner>(lifetime: &Lifetime<I>, interner: &I) -> TypeFlags {+ match lifetime.data(&interner) {+ LifetimeData::InferenceVar(_) => {+ TypeFlags::HAS_RE_INFER+ | TypeFlags::HAS_FREE_LOCAL_REGIONS+ | TypeFlags::HAS_FREE_REGIONS+ }+ LifetimeData::Placeholder(_) => {+ TypeFlags::HAS_RE_PLACEHOLDER+ | TypeFlags::HAS_FREE_LOCAL_REGIONS+ | TypeFlags::HAS_FREE_REGIONS+ }+ LifetimeData::Static | LifetimeData::Phantom(_, _) | LifetimeData::BoundVar(_) => {+ TypeFlags::empty()+ }+ }+}++/// Compute type flags for Substitution<I>+fn compute_substitution_flags<I: Interner>(+ substitution: &Substitution<I>,+ interner: &I,+) -> TypeFlags {+ let mut flags = TypeFlags::empty();+ for generic_arg in substitution.iter(&interner) {+ flags |= compute_generic_arg_flags(generic_arg, &interner);+ }+ flags+}++/// Compute type flags for GenericArg<I>+fn compute_generic_arg_flags<I: Interner>(generic_arg: &GenericArg<I>, interner: &I) -> TypeFlags {+ match generic_arg.data(&interner) {+ GenericArgData::Ty(ty) => ty.data(interner).flags,+ GenericArgData::Lifetime(lifetime) => compute_lifetime_flags(lifetime, interner),+ GenericArgData::Const(constant) => {+ let data = constant.data(&interner);+ let flags = data.ty.data(interner).flags;+ match data.value {+ ConstValue::BoundVar(_) => flags,+ ConstValue::InferenceVar(_) => {+ flags | TypeFlags::HAS_CT_INFER | TypeFlags::STILL_FURTHER_SPECIALIZABLE+ }+ ConstValue::Placeholder(_) => {+ flags | TypeFlags::HAS_CT_PLACEHOLDER | TypeFlags::STILL_FURTHER_SPECIALIZABLE+ }+ ConstValue::Concrete(_) => flags,+ }+ }+ }+}++/// Compute type flags for aliases+fn compute_alias_flags<I: Interner>(alias_ty: &AliasTy<I>, interner: &I) -> TypeFlags {+ match alias_ty {+ AliasTy::Projection(projection_ty) => {+ TypeFlags::HAS_TY_PROJECTION+ | compute_substitution_flags(&(projection_ty.substitution), interner)+ }+ AliasTy::Opaque(opaque_ty) => {+ TypeFlags::HAS_TY_OPAQUE+ | compute_substitution_flags(&(opaque_ty.substitution), interner)+ }+ }+}++/// Compute type flags for a TyKind+fn compute_flags<I: Interner>(kind: &TyKind<I>, interner: &I) -> TypeFlags {+ match kind {+ TyKind::Adt(_, substitution)+ | TyKind::AssociatedType(_, substitution)+ | TyKind::Tuple(_, substitution)+ | TyKind::Closure(_, substitution)+ | TyKind::Generator(_, substitution)+ | TyKind::GeneratorWitness(_, substitution)+ | TyKind::FnDef(_, substitution) => compute_substitution_flags(substitution, interner),+ TyKind::Scalar(_) | TyKind::Str | TyKind::Never | TyKind::Foreign(_) => TypeFlags::empty(),+ TyKind::OpaqueType(_, substitution) => {+ TypeFlags::HAS_TY_OPAQUE | compute_substitution_flags(substitution, interner)+ }+ TyKind::Error => TypeFlags::HAS_ERROR,+ TyKind::Slice(ty) | TyKind::Raw(_, ty) => ty.data(interner).flags,+ TyKind::Ref(_, lifetime, ty) => {+ compute_lifetime_flags(lifetime, interner) | ty.data(interner).flags+ }+ TyKind::Array(ty, const_ty) => {+ let flags = ty.data(interner).flags;+ let const_data = const_ty.data(interner);+ flags+ | const_data.ty.data(interner).flags+ | match const_data.value {+ ConstValue::BoundVar(_) | ConstValue::Concrete(_) => TypeFlags::empty(),+ ConstValue::InferenceVar(_) => {+ TypeFlags::HAS_CT_INFER | TypeFlags::STILL_FURTHER_SPECIALIZABLE+ }+ ConstValue::Placeholder(_) => {+ TypeFlags::HAS_CT_PLACEHOLDER | TypeFlags::STILL_FURTHER_SPECIALIZABLE+ }+ }+ }+ TyKind::Placeholder(_) => TypeFlags::HAS_TY_PLACEHOLDER,+ TyKind::Dyn(dyn_ty) => {+ let lifetime_flags = compute_lifetime_flags(&(dyn_ty.lifetime), &interner);+ let mut dyn_flags = TypeFlags::empty();+ for var_kind in dyn_ty.bounds.value.iter(&interner) {+ match &(var_kind.value) {+ WhereClause::Implemented(trait_ref) => {+ dyn_flags |= compute_substitution_flags(&(trait_ref.substitution), interner)+ }+ WhereClause::AliasEq(alias_eq) => {+ dyn_flags |= compute_alias_flags(&(alias_eq.alias), &interner);+ dyn_flags |= alias_eq.ty.data(&interner).flags;+ }+ WhereClause::LifetimeOutlives(lifetime_outlives) => {+ dyn_flags |= compute_lifetime_flags(&(lifetime_outlives.a), &interner)+ | compute_lifetime_flags(&(lifetime_outlives.b), &interner);+ }+ WhereClause::TypeOutlives(type_outlives) => {+ dyn_flags |= type_outlives.ty.data(&interner).flags;+ dyn_flags |= compute_lifetime_flags(&(type_outlives.lifetime), &interner);+ }+ }+ }+ lifetime_flags | dyn_flags+ }+ TyKind::Alias(alias_ty) => compute_alias_flags(&alias_ty, &interner),+ TyKind::BoundVar(_) => TypeFlags::empty(),+ TyKind::InferenceVar(_, _) => TypeFlags::HAS_TY_INFER,+ TyKind::Function(fn_pointer) => {+ compute_substitution_flags(&(fn_pointer.substitution), interner)+ }+ }+}+ impl<I: Interner> Ty<I> { /// Creates a type from `TyKind`. pub fn new(interner: &I, data: impl CastTo<TyKind<I>>) -> Self {+ let ty_kind = data.cast(&interner); let data = TyData {- kind: data.cast(interner),+ flags: compute_flags(&ty_kind, &interner),
This is probably a large enough change to be in another PR, but I would expect the interner to compute the flags, so that in the case it is actually interning it only has to compute flags when it's allocating.
comment created time in a day
Pull request review commentrust-lang/chalk
Add TypeFlags for TyKind in chalk-ir
pub struct Ty<I: Interner> { interned: I::InternedType, } +///compute type flags for Lifetime+fn compute_lifetime_flags<I: Interner>(lifetime: &Lifetime<I>, interner: &I) -> TypeFlags {+ match lifetime.data(&interner) {+ LifetimeData::InferenceVar(_) => {+ TypeFlags::HAS_RE_INFER+ | TypeFlags::HAS_FREE_LOCAL_REGIONS+ | TypeFlags::HAS_FREE_REGIONS+ }+ LifetimeData::Placeholder(_) => {+ TypeFlags::HAS_RE_PLACEHOLDER+ | TypeFlags::HAS_FREE_LOCAL_REGIONS+ | TypeFlags::HAS_FREE_REGIONS+ }+ LifetimeData::Static | LifetimeData::Phantom(_, _) | LifetimeData::BoundVar(_) => {
Static should add TypeFlags::HAS_FREE_REGIONS
comment created time in a day
Pull request review commentrust-lang/chalk
Add TypeFlags for TyKind in chalk-ir
macro_rules! lifetime { lifetime!($($b)*) }; }++#[macro_export]+macro_rules! empty_substitution {+ () => {+ chalk_ir::Substitution::from_iter(
There's a Substitution::empty method for this.
comment created time in a day
push eventmatthewjasper/rust
commit sha 6dabb704a6519374506cc540cf921d722fb45cd8
Address review comment and update chalk to 0.36.0
push time in a day
PR opened rust-lang/chalk
This fixes an issue that caused an ICE in rust-lang/rust#78502
r? @jackh726
pr created time in a day
Pull request review commentrust-lang/rust
impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t &self, opaque_ty_id: chalk_ir::OpaqueTyId<RustInterner<'tcx>>, ) -> Arc<chalk_solve::rust_ir::OpaqueTyDatum<RustInterner<'tcx>>> {- let bound_vars = bound_vars_for_item(self.interner.tcx, opaque_ty_id.0);- let binders = binders_for(&self.interner, bound_vars);+ let bound_vars = ty::fold::shift_vars(+ self.interner.tcx,+ &bound_vars_for_item(self.interner.tcx, opaque_ty_id.0),+ 1,+ ); let where_clauses = self.where_clauses_for(opaque_ty_id.0, bound_vars);- let bounds = self.bounds_for(opaque_ty_id.0, bound_vars);++ let identity_substs = InternalSubsts::identity_for_item(self.interner.tcx, opaque_ty_id.0);++ let bounds =+ self.interner+ .tcx+ .explicit_item_bounds(opaque_ty_id.0)+ .iter()+ .map(|(bound, _)| bound.subst(self.interner.tcx, &bound_vars))+ .map(|bound| {+ bound.fold_with(&mut ty::fold::BottomUpFolder {+ tcx: self.interner.tcx,+ ty_op: |ty| {+ if let ty::Opaque(def_id, substs) = *ty.kind() {+ if def_id == opaque_ty_id.0 && substs == identity_substs {+ return self.interner.tcx.mk_ty(ty::Bound(+ ty::INNERMOST,+ ty::BoundTy::from(ty::BoundVar::from_u32(0)),+ ));+ }+ }
yes
comment created time in a day
Pull request review commentrust-lang/rust
+// check-pass+// compile-flags: -Z chalk++use std::fmt::Display;++fn main() {+ let d: &dyn Display = &mut 3;+ // FIXME(chalk) should be able to call d.to_string() as well, but doing so
It should
comment created time in a day
push eventmatthewjasper/rust
commit sha 9d014d77813fd28b29d4c3fd166d429274fc94a2
[ci] Remove Travis CI This completes the switch to github actions
commit sha eb3d35834665a3c0459e24a4e42934fb4bd7eba5
Bump cranelift-codegen from `1c55eb1` to `c202a8e` Bumps [cranelift-codegen](https://github.com/bytecodealliance/wasmtime) from `1c55eb1` to `c202a8e`. - [Release notes](https://github.com/bytecodealliance/wasmtime/releases) - [Commits](https://github.com/bytecodealliance/wasmtime/compare/1c55eb1a8bba9e59df604a0df2b6552dd54e76a7...c202a8eeaf8f72a5e87d50ac2f0d58c9170b3488) Signed-off-by: dependabot-preview[bot] <[email protected]>
commit sha 228574db3602aa2abf69ef96a4809bb812071ea7
Merge pull request #928 from bjorn3/dependabot/cargo/cranelift-codegen-c202a8e
commit sha 3c9ebdb19401965913b2b1dd81de1381058c87ad
Rustup to rustc 1.44.0-nightly (1edd389cc 2020-03-23)
commit sha 5c9b9305b754065f6573d01fc27d1631b01a7abd
Update Cranelift and object
commit sha dc76cd0551d140f1455cb0969de070cc2cd3fdcc
Update dependencies
commit sha b113e88ddb399f92f0d044caa35e668d2499bdd9
Fix warnings
commit sha f288959c00f8f78df21a706c6e6188d4bfb909b4
Limit publicness to crate where possible and remove unused imports
commit sha 3f33fcbd30d6cf5151ed8185a566c6495e456bbd
Avoid using select in bool_to_zero_or_max_uint It legalizes to a branch
commit sha d2c5b4be68850b86621e66b80c244cbeb425953d
Use vector icmp in simd_cmp! when possible
commit sha 33fd4c47aaf5193c67366cc82a5c678ebeba8964
Use 16bit simd indices
commit sha f6d12440aab0d3566a8519205f40f0392739ce41
Update Cranelift
commit sha d2964f6a715d5efcb8521f1f7d0c3c4a65b4c049
Rustup to rustc 1.44.0-nightly (75208942f 2020-03-27)
commit sha 203b0b6b11842a2ff9281c797c1412011463aaf5
Update errno
commit sha 13fe779e1088f93dd97cff8a335d5829276926a5
Bump cranelift-codegen from `08e5484` to `cd900d7` Bumps [cranelift-codegen](https://github.com/bytecodealliance/wasmtime) from `08e5484` to `cd900d7`. - [Release notes](https://github.com/bytecodealliance/wasmtime/releases) - [Commits](https://github.com/bytecodealliance/wasmtime/compare/08e5484cdb158b7795587ff7ad0cb04beef6dcd3...cd900d72db7b0ab3e16cf41e63d13828e4c48712) Signed-off-by: dependabot-preview[bot] <[email protected]>
commit sha 017a9b7641d291c7b23ffdcb0d8f305d6e9cad23
Rustup to rustc 1.44.0-nightly (699f83f52 2020-03-29)
commit sha eefebeeb39d6bf58a0babd8dc363e4a83028fe98
Merge pull request #946 from bjorn3/dependabot/cargo/cranelift-codegen-cd900d7
commit sha 13e3a3c8b0001999e40efa58abd14ee61e6d53d8
Rustup to rustc 1.44.0-nightly (211365947 2020-03-30)
commit sha ab4328db4302f441538c5439e683cb10ab8cd855
Fix opt level names
commit sha c2e35604474aa25479dcca231fbc393a941234da
Update Cranelift
push time in 2 days
PR opened rust-lang/rust
This PR updates Chalk and fixes a number of bugs in the chalk integration code.
cc @rust-lang/wg-traits r? @nikomatsakis
pr created time in 2 days
push eventmatthewjasper/rust
commit sha 208cd0c701b39df5406dc2b5a55cbb85b5fe374e
Update chalk 0.32.0 -> 0.35.0
commit sha a718a88e9fdd1dd46c173231aadd0090f8d79c9e
Fix various Chalk lowering bugs - Add more well-known traits - Use the correct binders when lowering trait objects - Use correct substs when lowering trait objects - Use the correct binders for opaque_ty_data - Lower negative impls with the correct polarity - Supply associated type values - Use `predicates_defined_on` for where clauses
push time in 2 days
issue commentrust-lang/chalk
Impl auto traits for builtin types
#638 handles opaque types
comment created time in 3 days
PR opened rust-lang/chalk
- Add basic clauses for trait objects being wf
- Push clauses for auto traits on
TyKind::OpaqueType - Use a single match on the
TyKindfor Implemented goals - Normalize
TyKind::Aliasself types
pr created time in 3 days
push eventmatthewjasper/chalk
commit sha 575b0ec0374f7ef817629eec5b81d5635464d949
Clean up program_clauses_that_could_match - Use a single match on the TyKind for Implemented goals - Normalize TyKind::Alias self types
push time in 3 days
issue commentrust-lang/rust
🔬 Tracking issue for generic associated types (GAT)
https://github.com/rust-lang/rust/issues/44265#issuecomment-568247656 is a (somewhat terse) update. #67510 is the last major ICE/missing feature that needs implementing.
comment created time in 4 days
Pull request review commentrust-lang/chalk
impl<'t, I: Interner> Unifier<'t, I> { Ok(()) } - fn push_lifetime_eq_goals(&mut self, a: Lifetime<I>, b: Lifetime<I>) {- self.goals.push(InEnvironment::new(- self.environment,- WhereClause::LifetimeOutlives(LifetimeOutlives {- a: a.clone(),- b: b.clone(),- })- .cast(self.interner),- ));- self.goals.push(InEnvironment::new(- self.environment,- WhereClause::LifetimeOutlives(LifetimeOutlives { a: b, b: a }).cast(self.interner),- ));+ fn push_lifetime_eq_goals(&mut self, variance: Variance, a: Lifetime<I>, b: Lifetime<I>) {+ debug!(+ "pushing lifetime eq goals for a={:?} b={:?} with variance {:?}",+ a, b, variance+ );+ if matches!(variance, Variance::Invariant | Variance::Covariant) {
if matches!(variance, Variance::Invariant | Variance::Contravariant) {
'a <: 'b is taken to mean 'b: 'a (the other matches also needs changing)
comment created time in 4 days
Pull request review commentrust-lang/chalk
impl<'t, I: Interner> Unifier<'t, I> { Ok(()) } - fn push_lifetime_eq_goals(&mut self, a: Lifetime<I>, b: Lifetime<I>) {- self.goals.push(InEnvironment::new(- self.environment,- WhereClause::LifetimeOutlives(LifetimeOutlives {- a: a.clone(),- b: b.clone(),- })- .cast(self.interner),- ));- self.goals.push(InEnvironment::new(- self.environment,- WhereClause::LifetimeOutlives(LifetimeOutlives { a: b, b: a }).cast(self.interner),- ));+ fn push_lifetime_eq_goals(&mut self, variance: Variance, a: Lifetime<I>, b: Lifetime<I>) {
This could do with a different name now that it's not always equating lifetimes.
comment created time in 4 days
Pull request review commentrust-lang/chalk
fn quantified_types() { forall<'a> { fn(fn1<'a>): Foo } } yields { // Lifetime constraints are unsatisfiable- "Unique; substitution [], \- lifetime constraints [\- InEnvironment { environment: Env([]), goal: '!1_0: '!3_0 }, \- InEnvironment { environment: Env([]), goal: '!3_0: '!1_0 }\- ]"+ "Unique; substitution [], lifetime constraints [\+ InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, \+ InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }]"+ }+ }+}++#[test]+fn subtype() {+ test! {+ program {+ fn foo<'a>(a: &'a (), b: &'a ());+ fn bar<'a, 'b>(a: &'a (), b: &'b ());+ }++ goal {+ Subtype(for<'a> fn(&'a (), &'a ()), for<'a, 'b> fn(&'a (), &'b ()))
This should test that these types are equal.
There should also be a test that for<'a, 'b> fn(&'a (), &'b ()) -> &'a () is a subtype of for<'a, 'a> fn(&'a (), &'a ()) -> &'a () but is not equal.
comment created time in 4 days
Pull request review commentrust-lang/chalk
+use super::*;++#[test]+fn variance_lowering() {+ lowering_success! {+ program {+ #[variance(Invariant, Covariant)]+ struct Foo<T, U> {}+ struct Bar<T, U> {}+ #[variance(Invariant, Contravariant)]+ fn foo<T, U>(t: T, u: U);+ fn bar<T, U>(t: T, u: U);+ }+ }+}++#[test]+fn subtype_simple() {+ test! {+ program {+ struct Foo { }+ }++ goal {+ Subtype(Foo, Foo)+ } yields {+ "Unique"+ }+ }+}++/// Test that `Foo<'a>` and `Foo<'b>` can be subtypes+/// if we constrain the lifetimes `'a` and `'b` appropriately.+#[test]+fn struct_lifetime_variance() {+ test! {+ program {+ #[variance(Covariant)]+ struct Foo<'a> { }+ }++ goal {+ forall<'a, 'b> {+ Subtype(Foo<'a>, Foo<'b>)+ }+ } yields {+ "Unique; substitution [], lifetime constraints [\+ InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }\+ ]"+ }+ }+}++/// Test that `&'a u32 <: &'b u32` if `'a: 'b`+#[test]+fn ref_lifetime_variance() {+ test! {+ program {+ }++ goal {+ forall<'a, 'b> {+ Subtype(&'a u32, &'b u32)+ }+ } yields {+ // Seems good!+ "Unique; substitution [], lifetime constraints [\+ InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }\
This is 'b: 'a, which is the wrong way around.
comment created time in 4 days
pull request commentrust-lang/rust
Don't leak return value after panic in drop
@bors try @rust-timer queue
comment created time in 5 days
pull request commentrust-lang/rust
[WIP] Add const qualifier in FnSig (for const fn pointers)
cc @rust-lang/wg-const-eval
comment created time in 5 days
push eventmatthewjasper/rust
commit sha 78695bd4968d45ef6afd3433af4bf6f310128770
Do not lint float fractions in `mistyped_literal_suffixes` (fixes #4706)
commit sha 428ef362d6901029bbf945d5f440f4122ebcece6
Fix test formatting
commit sha b1ce6190ae4cb412c21207932924889e7201d4df
Add missing examples for MaybeUninit
commit sha 97beb074aff40cb1b6444e9eff734a1a5c17dfc7
BTreeMap: derive type-specific variants of node_as_mut and cast_unchecked
commit sha 9704911ecbea92f3a883d77f355af11be39626c0
Use matches! for core::char methods
commit sha a215151cd357945acdb2675010708cb2d10bb4c0
Allow ascii whitespace char for doc aliases
commit sha accc26abc0e53067d7a97d0fb19800c37a24f844
Add test for whitespace in doc alias
commit sha 554145609484d111f6ca3acaca644ae881c20a10
Hint doc use convert::identity relative link
commit sha f5aebad28fe69f53497ce0107103c6d5d37b25dc
Updates to experimental coverage counter injection This is a combination of 18 commits. Commit #2: Additional examples and some small improvements. Commit #3: fixed mir-opt non-mir extensions and spanview title elements Corrected a fairly recent assumption in runtest.rs that all MIR dump files end in .mir. (It was appending .mir to the graphviz .dot and spanview .html file names when generating blessed output files. That also left outdated files in the baseline alongside the files with the incorrect names, which I've now removed.) Updated spanview HTML title elements to match their content, replacing a hardcoded and incorrect name that was left in accidentally when originally submitted. Commit #4: added more test examples also improved Makefiles with support for non-zero exit status and to force validation of tests unless a specific test overrides it with a specific comment. Commit #5: Fixed rare issues after testing on real-world crate Commit #6: Addressed PR feedback, and removed temporary -Zexperimental-coverage -Zinstrument-coverage once again supports the latest capabilities of LLVM instrprof coverage instrumentation. Also fixed a bug in spanview. Commit #7: Fix closure handling, add tests for closures and inner items And cleaned up other tests for consistency, and to make it more clear where spans start/end by breaking up lines. Commit #8: renamed "typical" test results "expected" Now that the `llvm-cov show` tests are improved to normally expect matching actuals, and to allow individual tests to override that expectation. Commit #9: test coverage of inline generic struct function Commit #10: Addressed review feedback * Removed unnecessary Unreachable filter. * Replaced a match wildcard with remining variants. * Added more comments to help clarify the role of successors() in the CFG traversal Commit #11: refactoring based on feedback * refactored `fn coverage_spans()`. * changed the way I expand an empty coverage span to improve performance * fixed a typo that I had accidently left in, in visit.rs Commit #12: Optimized use of SourceMap and SourceFile Commit #13: Fixed a regression, and synched with upstream Some generated test file names changed due to some new change upstream. Commit #14: Stripping out crate disambiguators from demangled names These can vary depending on the test platform. Commit #15: Ignore llvm-cov show diff on test with generics, expand IO error message Tests with generics produce llvm-cov show results with demangled names that can include an unstable "crate disambiguator" (hex value). The value changes when run in the Rust CI Windows environment. I added a sed filter to strip them out (in a prior commit), but sed also appears to fail in the same environment. Until I can figure out a workaround, I'm just going to ignore this specific test result. I added a FIXME to follow up later, but it's not that critical. I also saw an error with Windows GNU, but the IO error did not specify a path for the directory or file that triggered the error. I updated the error messages to provide more info for next, time but also noticed some other tests with similar steps did not fail. Looks spurious. Commit #16: Modify rust-demangler to strip disambiguators by default Commit #17: Remove std::process::exit from coverage tests Due to Issue #77553, programs that call std::process::exit() do not generate coverage results on Windows MSVC. Commit #18: fix: test file paths exceeding Windows max path len
commit sha c5f17002e5eccd4e6c44b286cd85cdcd9f4e2a2d
Add changelog for 1.48 beta
commit sha cb881d36ae0060e1dc6815e7caefe4e8df79dc09
hint doc use intra-doc links Co-authored-by: Joshua Nelson <[email protected]>
commit sha 021fcbd90cebe83bb2f0298f2e7001605b5a97d7
rustc_target: Refactor away `TargetResult` Construction of a built-in target is always infallible now, so `TargetResult` is no longer necessary.
commit sha 1444ad7ba1c34685fecf7b0413403151aba51e9d
rustc_target: Further simplify loading of built-in targets using the fact that it is infallible. JSON roundtrip check on every rustc run is also removed, it's already performed by unit tests.
commit sha 6f627663a755fb1795a725c1b89d2d83be5096f9
Renamed tests to avoid exceeding Windows max path limit
commit sha 29e5e6e766a6aab504b01697f8670f72ec10e8ad
Use MIR dump interface for dataflow
commit sha 3b873987381cd8236b6f6e8129ad5c3570cbae68
Print to `stderr` when a graphviz file can't be written `warn` prints nothing by default
commit sha af4b13283f6632de73a2176371f4e381b396e1ec
Move `EarlyOtherwiseBranch` to mir-opt-level 2 This didn't have an effect in most cases, and is not trivially sound. Let it bake at `mir-opt-level=2` for a while.
commit sha 35192ff574c3706646e2f4be16d5c22c4f8b60b1
Fix span for unicode escape suggestion.
commit sha a1dfd2490a6cb456b92e469fa550dc217e20ad6d
Auto merge of #77080 - richkadel:llvm-coverage-counters-2, r=tmandry Working branch-level code coverage Add a generalized implementation for computing branch-level coverage spans. This iteration resolves some of the challenges I had identified a few weeks ago. I've tried to implement a solution that is general enough to work for a lot of different graphs/patterns. It's encouraging to see the results on fairly large and complex crates seem to meet my expectations. This may be a "functionally complete" implementation. Except for bug fixes or edge cases I haven't run into yet, the next and essentially final step, I think, is to replace some Counters with CounterExpressions (where their counter values can be computed by adding or subtracting other counters/expressions). Examples of branch-level coverage support enabled in this PR: * https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_drop_trait.txt * https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_if.txt * https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_if_else.txt * https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_simple_loop.txt * https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_simple_match.txt * ... _and others in the same directory_ Examples of coverage analysis results (MIR spanview files) used to inject counters in the right `BasicBlocks`: * https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_drop_trait/coverage_of_drop_trait.main.-------.InstrumentCoverage.0.html * https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if/coverage_of_if.main.-------.InstrumentCoverage.0.html * https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html * https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_simple_loop/coverage_of_simple_loop.main.-------.InstrumentCoverage.0.html * https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_simple_match/coverage_of_simple_match.main.-------.InstrumentCoverage.0.html * ... _and others in the same directory_ Here is some sample coverage output after compiling a few real-world crates with the new branch-level coverage features: <img width="801" alt="Screen Shot 2020-09-25 at 1 03 11 PM" src="https://user-images.githubusercontent.com/3827298/94316848-fd882c00-ff39-11ea-9cff-0402d3abd1e7.png"> <img width="721" alt="Screen Shot 2020-09-25 at 1 00 36 PM" src="https://user-images.githubusercontent.com/3827298/94316886-11cc2900-ff3a-11ea-9d03-80b26c8a5173.png"> <img width="889" alt="Screen Shot 2020-09-25 at 12 54 57 PM" src="https://user-images.githubusercontent.com/3827298/94316900-18f33700-ff3a-11ea-8a80-58f67d84b8de.png"> r? `@tmandry` FYI: `@wesleywiser`
commit sha 1b9c45bddc4cd90ba2d580dbec4a4a1c9a679cb6
Update RLS and Rustfmt
push time in 6 days
push eventmatthewjasper/rust
commit sha 04834139c43761efd2b14e37e819774033241ba2
replace usize with u32 to make it easier to bless
commit sha 0e06456ecbe244291f1feef7c24b7165f028e0d0
bless
commit sha 25302740231152bccebc391e893d48ef9f3ca50a
correct comment
commit sha 118aae2af1a8dfa9500b26f2542825291c9ae1f8
insert storageDead for not equal temp
commit sha 27068cbfdc15445cefc6a650355ff5c6bfe992c3
add cleanup of cfg
commit sha e25738f529b431d5b824eb8b7510fbe86cf0c9fa
enable on mir-opt-level=1 to test perf
commit sha b873fa6d42cf305131d2583d03b84686e5e40f2e
Auto merge of #76136 - CDirkx:const-result, r=dtolnay Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: #67520). I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463) and [PR#76135](https://github.com/rust-lang/rust/pull/76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: #76225
commit sha a334ae658ba7ab1a82230afe2248557f4ef74ea6
Auto merge of #76136 - CDirkx:const-result, r=dtolnay Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: #67520). I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463) and [PR#76135](https://github.com/rust-lang/rust/pull/76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: #76225
commit sha 5de2c95e6e8352d2e45111025a57bd1e67a43a79
Remove MMX from Rust
commit sha 3e08354fb0dc7a5f7733da9b308d483b9c1d2514
Correct file path after some restructures in compiler
commit sha 3f0f40904c18bce9915b5fe2a1d017f3906c0d26
Documented From impls in std/sync/mpsc/mod.rs
commit sha 39b9a25e60db0a3d22b115bdb3981607ea4c0737
Rollup merge of #76732 - camelid:mir-basic-block-docs, r=RalfJung Add docs for `BasicBlock` Fixes #76715. --- @rustbot modify labels: A-mir T-doc C-enhancement
commit sha c847eaa91dacf2a5b1f110142f930ea81a7ec2f3
Rollup merge of #76832 - khyperia:backend_target_override, r=eddyb Let backends define custom targets Add a target_override hook that takes priority over builtin targets.
commit sha bea0ae700e4e8e21c5a6d815c787310978d91d55
Rollup merge of #76866 - est31:master, r=lcnr Remove unused feature gates from library/ crates Removes some unused feature gates from library crates. It's likely not a complete list as I only tested a subset for which it's more likely that it is unused.
commit sha 61a754832e8f6a18aea4319f0ec2339c0230d7eb
Rollup merge of #76875 - denisvasilik:intra-doc-links-alloc-binary-heap, r=jyn514 Move to intra-doc links in library/alloc/src/collections/binary_heap.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links
commit sha 39412011a1d18686f7ae747df326e4fb687fac25
Rollup merge of #76876 - denisvasilik:intra-doc-links-alloc, r=jyn514 Move to intra-doc links in collections/btree/map.rs and collections/linked_list.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links
commit sha ad9ea71e7f955ca1d62c63834a87367f90dbc113
Rollup merge of #76877 - denisvasilik:intra-doc-links-alloc-vec-deque, r=jyn514 Move to intra-doc links in collections/vec_deque.rs and collections/vec_deque/drain.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links
commit sha 24980b7d8deba77963917c0e00d6f22cde7c9c70
Rollup merge of #76878 - pietroalbini:version, r=Mark-Simulacrum Move the version number to a plaintext file The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This PR moves the version number to a standalone plaintext file, which makes accessing or updating it trivial. r? @Mark-Simulacrum
commit sha 3ef093ba2dab113b1988836503c173b2e9c6efea
Rollup merge of #76883 - qlcom:master, r=Mark-Simulacrum README.md: Remove prompts from code blocks https://github.com/rust-lang/rust/issues/76863
commit sha f24d279084efa0467369b3578b0d1f4dcae8a687
Rollup merge of #76887 - GuillaumeGomez:hashset-iter-types-examples, r=Dylan-DPC Add missing examples on HashSet iter types
push time in 6 days
pull request commentrust-lang/rust
Turn quadratic time on number of impl blocks into linear time
@bors try @rust-timer queue
comment created time in 7 days
issue commentrust-lang/chalk
add flags to `InternedTy` and `InternedRegion` types
I don't think that a flags field makes much sense on lifetimes, because they're fairly fast to compute directly (just a match).
There are also flags on Predicate in rustc.
comment created time in 7 days
pull request commentrust-lang/rust
move `visit_predicate` into `TypeVisitor`
This was because I didn't want to add it directly to trait when it's only used twice.
@bors r+ rollup
comment created time in 7 days
pull request commentrust-lang/chalk
Remove TypeName and merge into TyKind
Let's see if bors will listen to me... @bors r+
comment created time in 8 days
pull request commentrust-lang/rust
Separate projection bounds and predicates
For whoever does the release notes this PR has two compatibility notes:
- Associated type bindings on trait objects are verified to meet the bounds declared on the trait when checking that they implement the trait. (#27675)
- When traits bounds on associated types or opaque types are ambiguous the compiler no longer makes an arbitrary choice on which bound to use. (#54121)
comment created time in 8 days
issue commentrust-lang/rust
ice with -Zmir-opt-level=2 issue-50865-private-impl-trait/auxiliary/lib.rs
#77306 has merged now
comment created time in 8 days
pull request commentrust-lang/rust
Hmm, merge was against 8f0fa9d51ff4ad2c0869e660856cd327e79915e9 but master is at 6b9fbf212a06944ff23325d2d63215805dc3c6c3 cc @rust-lang/infra
comment created time in 9 days
pull request commentrust-lang/rust
@bors r=nikomatsakis
comment created time in 9 days
push eventmatthewjasper/rust
commit sha 50dde2e4d842a65f4c04bd8e27626ba6f1656849
Normalize when finding trait object candidates
push time in 9 days
pull request commentrust-lang/rust
seeing if a force-push helps @bors r=nikomatsakis
comment created time in 9 days
push eventmatthewjasper/rust
commit sha fd22e87afc9082522bc7b52e32d25d43c64594e6
fix flag computation for `ExistentialPredicate::Projection`
commit sha 7652b4b1d9cec0ad22f529a4335d05f7d7792521
guard against `skip_binder` errors during FlagComputation
commit sha 64839ee00ab4076d797901ddea55f2613c5b75b5
Add Pin::new_static.
commit sha 390883e888c580d054ab4a2584c851aba50865e9
Make Pin::new_static const.
commit sha bd135674814d74ca6fca3ab79d778ecaaeb02cf5
Allow setting up git hooks from other worktrees
commit sha 0ec3ea9e697ea9c2ce225ba0b9f3715434fc773e
const keyword: brief paragraph on 'const fn'
commit sha c8405d2251ce78651f591ed8a2189c41593f5110
fix markdown reference Co-authored-by: Dariusz Niedoba <[email protected]>
commit sha 104c0f0194177442ff16cf14907a96d2f8d200dd
Rename Pin::new_static to Pin::static_ref.
commit sha 2c71f682d74d13ae6673dc701a9bb3a0562f57c0
Add Pin::static_mut.
commit sha 5573a163530f12a38a865b67eb7994414e9cd49c
Use `try{}` in `try_fold` to decouple library from `Try` details
commit sha f83446b836900ce9afbaa0816a5b4feda654b51e
Reword safety guarantee of Pin::static_{ref,mut}. Co-authored-by: Peter Todd <[email protected]>
commit sha 8374c1702c1d9858d8906051cd531757be63998d
Bump the version of rustfmt used in tidy To pick up https://github.com/rust-lang/rustfmt/pull/4461 So that rustfmt has the parsing fix from https://github.com/rust-lang/rust/pull/76274 ...and do a reformat that it wants.
commit sha 058699d0a2fca02127761f014d0ecfce1c5541ec
[net] clippy: needless_update warning: struct update has no effect, all the fields in the struct have already been specified --> library/std/src/net/addr.rs:367:19 | 367 | ..unsafe { mem::zeroed() } | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(clippy::needless_update)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
commit sha e6dc604e8b184b1224ae7acf58f06fa021ece82c
[net] clippy: match_like_matches_macro warning: match expression looks like `matches!` macro --> library/std/src/net/ip.rs:459:9 | 459 | / match self.octets() { 460 | | [169, 254, ..] => true, 461 | | _ => false, 462 | | } | |_________^ help: try this: `matches!(self.octets(), [169, 254, ..])` | = note: `#[warn(clippy::match_like_matches_macro)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro Signed-off-by: wcampbell <[email protected]>
commit sha 7a75f4418313da0173192ed4d2f198e505e11428
[net] clippy: identity_op warning: the operation is ineffective. Consider reducing it to `self.segments()[0]` --> library/std/src/net/ip.rs:1265:9 | 1265 | (self.segments()[0] & 0xffff) == 0xfe80 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(clippy::identity_op)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op warning: the operation is ineffective. Consider reducing it to `self.segments()[1]` --> library/std/src/net/ip.rs:1266:16 | 1266 | && (self.segments()[1] & 0xffff) == 0 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op warning: the operation is ineffective. Consider reducing it to `self.segments()[2]` --> library/std/src/net/ip.rs:1267:16 | 1267 | && (self.segments()[2] & 0xffff) == 0 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op warning: the operation is ineffective. Consider reducing it to `self.segments()[3]` --> library/std/src/net/ip.rs:1268:16 | 1268 | && (self.segments()[3] & 0xffff) == 0 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op Signed-off-by: wcampbell <[email protected]>
commit sha 39867f3c9fea0e01b5b199d8c2b6b0889284cc85
Fixed false positive for `unused_parens` lint
commit sha 7da0e58da4f1a4a7f102eb5478dbd4e7fa7edbaf
use matches! in library/std/src/net/ip.rs Apply suggestion from review Co-authored-by: LingMan <[email protected]>
commit sha ce04836327e6aebab6a834d89e7305d1b1be958b
fmt Signed-off-by: wcampbell <[email protected]>
commit sha 86e030391b2e81c44beed94e3070406994caaad5
Make sure cold code is as small as possible
commit sha 5f11e71721e038ebdd9b225eec3e86f1ee7f867b
Reuse memory for process_cycles
push time in 9 days
pull request commentrust-lang/rust
Mark inout asm! operands as used in liveness pass
@bors r+
comment created time in 11 days
pull request commentrust-lang/rust
@bors r=nikomatsakis
comment created time in 11 days
push eventmatthewjasper/rust
commit sha e023158145ece18176a2e93420600ccda0d0bc58
Permit uninhabited enums to cast into ints This essentially reverts part of #6204.
commit sha 990a39596cf3b33e550f2045f78a62970f8d78f8
Prevent ICE on uninhabited MIR interpretation
commit sha a02014280586b53997622c501db00398376967a8
Refactor io/buffered.rs into submodules
commit sha 96229f02402e82914ec6100b28ad2cbdd273a0d4
move buffered.rs to mod.rs
commit sha 6d75cdfc9ed9e6987bd23add6cf3954d2499dce2
Added updated compiler diagnostic
commit sha da700cba08a2b194d19e63d3c51ebadce96fe46b
Stabilize move_ref_pattern
commit sha afb9eeb1b9ea16ca65e38673a0ef3e7be81d7252
Disabled error `E0007` from rustc_error_codes
commit sha 05c9c0ee5dcd935f518db151bee2dc88380fb92f
Modify executable checking to be more universal This uses a dummy file to check if the filesystem being used supports the executable bit in general.
commit sha c4280af8285c61b367a87c8f6eef9876011a8150
Retry fix error reporting suggestions
commit sha 1ff7da6551a7cdf6ace2a9d00e92bbab550334ee
Move `slice::check_range` to `RangeBounds`
commit sha 1095dcab96d524e700b11edf366d45a0fd173fa0
Fix links
commit sha eb63168e007058dad4af758faf1dca449c049777
Fix doctests
commit sha f055b0bb0847ecf08fe452a270faae8324b55b05
Rename method to `assert_len`
commit sha 549f861f7d53811521cf929cf58fb6828a2a88d9
Use correct article in help message for conversion or cast Before it always used `an`; now it uses the correct article for the type.
commit sha 094f14c554c3a1f103a5d6778d4b4e131c297f11
Add article after "to" Also added missing backtick in "you can cast" message.
commit sha 8a6831a7fd3fc624643b50f494212e0ceaad3c28
Say "doesn't" instead of "wouldn't" in convert message
commit sha 13dfbb64d313137b7d3c33067910e90f27bc6345
Suggest imports of unresolved macros
commit sha 479298e05e8177b171c6d6bcd35fc7553b424bee
Re-run tests with --bless
commit sha ea7cf6106864ce7929eb9f3cfe580f05ee418ac8
Don't suggest macros that out of scope
commit sha 0b923d3ca0b7f5a1a611564ee48c1e92f896d79e
add `str::{Split,RSplit}::as_str` methods This commit introduses 2 methods under "str_split_as_str" gate with common signature of `&Split<'a, _> -> &'a str'`. Both of them work like `Chars::as_str` - return unyield part of the inner string.
push time in 11 days
issue commentrust-lang/rust
`rustfmt` no longer builds after rust-lang/rust#77306
.\x.py build .\src\tools\rustfmt\ with debug-assertions = true set in config.toml
comment created time in 12 days
pull request commentrust-lang/rust
[WIP] Refactor `Binder` to track bound vars
@bors try @rust-timer queue
comment created time in 12 days
issue commentrust-lang/rust
`rustfmt` no longer builds after rust-lang/rust#77306
thread 'rustc' panicked at 'assertion failed: `(left == right)`
left: `Binder(<smallvec::SmallVec<[u8; _]> as std::ops::Index<std::ops::RangeFull>>)`,
right: `Binder(<smallvec::SmallVec<[u8; 36]> as std::ops::Index<std::ops::RangeFull>>)`', compiler/rustc_trait_selection/src/traits/codegen/mod.rs:30:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (4d247ad7d 2020-10-18) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z macro-backtrace -Z binary-dep-depinfo -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C debug-assertions=on -C overflow-checks=off -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [codegen_fulfill_obligation] checking if `std::ops::Index` fulfills its obligations
#1 [resolve_instance] resolving instance `<smallvec::SmallVec<[u8; _]> as std::ops::Index<std::ops::RangeFull>>::index`
end of query stack
[RUSTC-TIMING] rustc_ap_rustc_data_structures test:false 1.603
error: could not compile **`rustc-ap-rustc_data_structures`**
comment created time in 12 days
Pull request review commentrust-lang/rust
Mark inout asm! operands as used in liveness pass
impl<'a, 'tcx> Liveness<'a, 'tcx> { } } hir::InlineAsmOperand::InOut { expr, .. } => {- succ = self.write_place(expr, succ, ACC_READ | ACC_WRITE);+ succ = self.write_place(expr, succ, ACC_READ | ACC_WRITE | ACC_USE);
I see. The original change is the only correct fix here then.
comment created time in 12 days
Pull request review commentrust-lang/rust
Mark inout asm! operands as used in liveness pass
impl<'a, 'tcx> Liveness<'a, 'tcx> { } } hir::InlineAsmOperand::InOut { expr, .. } => {- succ = self.write_place(expr, succ, ACC_READ | ACC_WRITE);+ succ = self.write_place(expr, succ, ACC_READ | ACC_WRITE | ACC_USE);
acc looks like it's specifically not overwriting in the WRITE then READ & USED case.
comment created time in 13 days
Pull request review commentrust-lang/rust
Mark inout asm! operands as used in liveness pass
impl<'a, 'tcx> Liveness<'a, 'tcx> { } } hir::InlineAsmOperand::InOut { expr, .. } => {- succ = self.write_place(expr, succ, ACC_READ | ACC_WRITE);+ succ = self.write_place(expr, succ, ACC_READ | ACC_WRITE | ACC_USE);
I think that I would prefer updating the match below.
comment created time in 13 days
pull request commentrust-lang/rust
After trying to find other options here there doesn't seem to be a much better solution without a much larger change here (e.g. making rustc more like chalk). I think that I slightly prefer this change, which simplifies how winnowing works in exchange for evaluating normalization cycles to Recur instead of Unknown. The patch here is against the head of this PR.
@@ -521,12 +521,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
result
}
Ok(Ok(None)) => Ok(EvaluatedToAmbig),
- // EvaluatedToRecur might also be acceptable here, but use
- // Unknown for now because it means that we won't dismiss a
- // selection candidate solely because it has a projection
- // cycle. This is closest to the previous behavior of
- // immediately erroring.
- Ok(Err(project::InProgress)) => Ok(EvaluatedToUnknown),
+ Ok(Err(project::InProgress)) => Ok(EvaluatedToRecur),
Err(_) => Ok(EvaluatedToErr),
}
}
@@ -1387,9 +1382,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
| (ObjectCandidate(i), ObjectCandidate(j)) => {
// Arbitrarily pick the lower numbered candidate for backwards
// compatibility reasons. Don't let this affect inference.
- other.evaluation.must_apply_modulo_regions()
- && !needs_infer
- && (i < j || !victim.evaluation.must_apply_modulo_regions())
+ i < j && !needs_infer
}
(ObjectCandidate(_), ProjectionCandidate(_))
| (ProjectionCandidate(_), ObjectCandidate(_)) => {
comment created time in 13 days
issue commentrust-lang/rust
#73905 regressed several tests around associated type defaults
They do, this was moved to a different test file because the error prevents further compilation
comment created time in 14 days
pull request commentrust-lang/rust
stabilize union with 'ManuallyDrop' fields and 'impl Drop for Union'
Yes @bors r+
comment created time in 14 days
issue commentrust-lang/rust
Associated type bounded on another associated type with a default fails
This compiles on nightly now
comment created time in 15 days
PR merged rust-lang/chalk
This is required for 1 + 2 to typeck correctly.
pr closed time in 16 days
push eventrust-lang/chalk
commit sha 424a76cc9ff9d2930f4de32c31fa578ba8416e09
Handle cached answers correctly in `any_future_answer`
commit sha d7c75db36d4c08f283a8ead2160efe3e9542ea32
Merge pull request #626 from matthewjasper/slg-ambiguity Handle cached answers correctly in any_future_answer
push time in 16 days
push eventmatthewjasper/rust
commit sha 0ad3da06843089c0bf10d6caa3fbbc72fa67787a
Enable ASLR for windows-gnu
commit sha 390a13b06c79d4177b829097b06453e38188081f
needless-lifetime - fix nested elision site FPs
commit sha a60e5de90c7370d4fb3e6561d3cb55495cda2e2a
needless-lifetime / nested elision sites / PR remarks
commit sha c8e9e52303da6dff4bc5cc4db3021d608fca6c70
needless-lifetime / add test cases for nested elision sites
commit sha 1778a1ec4615a42a8ba9497006b07859186c08a1
Restrict `same_item_push` to suppress false positives It emits a lint when the pushed item is a literal, a constant and an immutable binding that are initialized with those.
commit sha 0117ea2b016133145f9e02e27421ac3672b42f57
Refactoring: use inner function
commit sha b80576fba633e1fc214c9f6900d7ca3424bda6d0
Some refactoring
commit sha 14faebe20ea82392f393c3ff5efaab7250e51989
Add some tests to `same_item_push` Add tests in which the variable is initialized with a match expression and function call
commit sha 2972ad3ef661071531a61ec8999b668a6b734b74
Refactoring: tests in `same_item_push`
commit sha 730ca457f580247667ed0cd5965bc08752ebc0b3
Address `items_after_statement`
commit sha 72b402ed38f0c71461038aef8a49a02e49280788
Add pass names to some common dataflow analyses
commit sha cfe07cd42a92610219d6ffc1ae5eefef42f5254a
Use llvm::computeLTOCacheKey to determine post-ThinLTO CGU reuse During incremental ThinLTO compilation, we attempt to re-use the optimized (post-ThinLTO) bitcode file for a module if it is 'safe' to do so. Up until now, 'safe' has meant that the set of modules that our current modules imports from/exports to is unchanged from the previous compilation session. See PR #67020 and PR #71131 for more details. However, this turns out be insufficient to guarantee that it's safe to reuse the post-LTO module (i.e. that optimizing the pre-LTO module would produce the same result). When LLVM optimizes a module during ThinLTO, it may look at other information from the 'module index', such as whether a (non-imported!) global variable is used. If this information changes between compilation runs, we may end up re-using an optimized module that (for example) had dead-code elimination run on a function that is now used by another module. Fortunately, LLVM implements its own ThinLTO module cache, which is used when ThinLTO is performed by a linker plugin (e.g. when clang is used to compile a C proect). Using this cache directly would require extensive refactoring of our code - but fortunately for us, LLVM provides a function that does exactly what we need. The function `llvm::computeLTOCacheKey` is used to compute a SHA-1 hash from all data that might influence the result of ThinLTO on a module. In addition to the module imports/exports that we manually track, it also hashes information about global variables (e.g. their liveness) which might be used during optimization. By using this function, we shouldn't have to worry about new LLVM passes breaking our module re-use behavior. In LLVM, the output of this function forms part of the filename used to store the post-ThinLTO module. To keep our current filename structure intact, this PR just writes out the mapping 'CGU name -> Hash' to a file. To determine if a post-LTO module should be reused, we compare hashes from the previous session. This should unblock PR #75199 - by sheer chance, it seems to have hit this issue due to the particular CGU partitioning and optimization decisions that end up getting made.
commit sha 5e393c7747d081c45414060f81016e9ea3cb961f
Fix a FP in `explicit_counter_loop` Fix a false positive in `explicit_counter_loop` where the loop counter is used after incremented, adjust the test so that counters are incremented at the end of the loop and add the test for this false positive.
commit sha 3e294b22a43be349262405715cf4885296c284ba
Revert "or_fn_call: ignore nullary associated const fns" This reverts commit 7a66e6502dc3c7085b3f4078c01d4957d96175ed.
commit sha ce83d8d4d1b28e73888a616d3ffbf19c6a620588
Revert "Avoid or_fun_call for const_fn with no args" This reverts commit 5d66bd7bb3fd701d70ec11217e3f89fabe5cb0a7.
commit sha 9365660a2fc57210996df733efe468019c671b2f
unnecessary sort by: avoid dereferencing closure param
commit sha d1f9cad102b5686f2b827f3c62a02dfe419128a6
Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyup
commit sha 019c0d5f7f90f959ff92684a04b0d766b22527a5
Auto merge of #6076 - rail-rain:fix_fp_explicit_counter_loop, r=matthiaskrgr Fix a FP in `explicit_counter_loop` Fixes #4677 and #6074 Fix a false positive in `explicit_counter_loop` where the loop counter is used after incremented, adjust the test so that counters are incremented at the end of the loop and add the test for this false positive. --- changelog: Fix a false positive in `explicit_counter_loop` where the loop counter is used after incremented
commit sha cc1998f7b3cc04c891f92c62a52c0c45fa4c145a
Auto merge of #6077 - ebroto:revert_or_fun_call_const, r=matthiaskrgr Revert: or_fun_call should lint calls to `const fn`s with no args The changes in #5889 and #5984 were done under the incorrect assumption that a `const fn` with no args was guaranteed to be evaluated at compile time. A `const fn` is only guaranteed to be evaluated at compile time if it's inside a const context (the initializer of a `const` or a `static`). See this [zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Common.20misconception.3A.20.60const.20fn.60.20and.20its.20effect.20on.20codegen/near/208059113) for more details on this common misconception. Given that none of the linted methods by `or_fun_call` can be called in const contexts, the lint should make no exceptions. changelog: [`or_fun_call`] lints again calls to `const fn` with no args
commit sha 2892a2b0f578edd290b3be6f5e5c3280bc160f24
Fix FP in `print_stdout` This lint shouldn't be emitted in `build.rs` as `println!` and `print!` are used for the build script.
push time in 17 days
pull request commentrust-lang/rust
Moved the main `impl` for FnCtxt to its own file.
@bors r+
comment created time in 17 days
Pull request review commentrust-lang/rust
[WIP] Add const qualifier in FnSig (for const fn pointers)
impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ]) => { // A reborrow has no effect before a dereference. }+ (&[Adjustment { kind: Adjust::Pointer(PointerCast::ReifyFnPointer), .. }],+ &[Adjustment { kind: Adjust::Pointer(PointerCast::NotConstFnPointer), .. }]) => { }
This arm should extend *entry.get_mut() with adj instead of letting it be overriden below.
comment created time in 17 days
push eventmatthewjasper/chalk
commit sha 424a76cc9ff9d2930f4de32c31fa578ba8416e09
Handle cached answers correctly in `any_future_answer`
push time in 17 days
PR opened rust-lang/chalk
This is required for 1 + 2 to typeck correctly.
pr created time in 18 days
issue commentrust-lang/rust
ice with -Zmir-opt-level=2 issue-50865-private-impl-trait/auxiliary/lib.rs
I think that this is a missing normalize call here: https://github.com/rust-lang/rust/blob/8cc82ee340ed96099680ec1165cf5e192d658d0f/compiler/rustc_mir/src/transform/inline.rs#L204
comment created time in 19 days
pull request commentrust-lang/rust
Use tracing spans in rustc_trait_selection
@bors try @rust-timer queue
comment created time in 19 days
push eventmatthewjasper/rust
commit sha b8d2560dca40edf5584c8e23b81c3e89d19d68dc
Use tracing spans in rustc_trait_selection
push time in 19 days
pull request commentrust-lang/rust
require `Reveal::All` in `normalize_erasing_regions`
It ICEs if an associated type projection isn't well-formed (i.e. the self type doesn't implement the trait that's expected), but doesn't if it does but can't be normalized.
comment created time in 19 days
Pull request review commentrust-lang/chalk
impl<'t, I: Interner> Unifier<'t, I> { {
The above comment is not entirely correct with subtyping. It should be
for<'a...> T == for<'b...> U
if
for<'a...> exists<'b...> T :> U &&
for<'b...> exists<'a...> T <: U
and
for<'a...> T <: for<'b...> U
if
for<'b...> exists<'a...> T <: U
The code here should look like this
if let Variance::Invariant | Variance::Contavariant = variance {
let a_universal = self.table.instantiate_binders_universally(interner, a);
let b_existential = self.table.instantiate_binders_existentially(interner, b);
Zip::zip_with(self, Variance::Contavariant, &a_universal, &b_existential)?;
}
if let Variance::Invariant | Variance::Covariant = variance {
let b_universal = self.table.instantiate_binders_universally(interner, b);
let a_existential = self.table.instantiate_binders_existentially(interner, a);
Zip::zip_with(self, Variance::Covariant, &a_existential, &b_universal)
}
comment created time in 20 days
pull request commentrust-lang/rust
Use tracing spans in rustc_trait_selection
@bors try @rust-timer queue
comment created time in 20 days
push eventmatthewjasper/rust
commit sha a555e3e018d4bae90448e51f4ce34bad3da3376d
Use tracing spans in rustc_trait_selection
push time in 20 days
pull request commentrust-lang/rust
Use tracing spans in rustc_trait_selection
This is up to a 0.8% regression. I'll see if reducing the number of spans being used can help here.
comment created time in 20 days
issue commentrust-lang/rust
Panics in destructors can cause the return value to be leaked
The next step is for me to resurrect #72152 and see how a perf run looks.
comment created time in 20 days
pull request commentrust-lang/rust
Add TraitDef::find_map_relevant_impl
@bors r+ rollup=maybe
comment created time in 20 days
pull request commentrust-lang/rust
Replace run_compiler with RunCompiler builder pattern
@bors r+
comment created time in 20 days
pull request commentrust-lang/rust
Provide structured suggestions when finding structs when expecting a trait
@bors r+
comment created time in 20 days
pull request commentrust-lang/rust
require `Reveal::All` in `normalize_erasing_regions`
There are a few places that should (sometimes) be given user facing param envs: https://github.com/rust-lang/rust/blob/12187b7f860e8e823eb5e399946746c4d2c1b1a7/compiler/rustc_lint/src/types.rs#L818 https://github.com/rust-lang/rust/blob/3e14b684dd31794e8dbe6acd7a5f132997ee0c47/compiler/rustc_trait_selection/src/traits/structural_match.rs#L258 https://github.com/rust-lang/rust/blob/3e14b684dd31794e8dbe6acd7a5f132997ee0c47/compiler/rustc_ty/src/needs_drop.rs#L134-L137
comment created time in 20 days
pull request commentrust-lang/rust
require `Reveal::All` in `normalize_erasing_regions`
https://github.com/rust-lang/rust/blob/12187b7f860e8e823eb5e399946746c4d2c1b1a7/compiler/rustc_lint/src/types.rs#L818
comment created time in 20 days
pull request commentrust-lang/rust
Use tracing spans in rustc_trait_selection
@bors try @rust-timer queue
comment created time in 20 days
push eventmatthewjasper/rust
commit sha 33566e3c4d5c128db222179e0fd0ea4ac7deff27
Use tracing spans in rustc_trait_selection
push time in 20 days
PR opened rust-lang/rust
Spans are very helpful when debugging this code. It's also hot enough to make a good benchmark.
r? @oli-obk
pr created time in 20 days
issue commentrust-lang/rust
Type inference regression and ICE in nightly 2020-10-06
There should already be some tests in #73905, if you can find anything not covered by the tests added there then please add some.
comment created time in 21 days
issue commentrust-lang/rust
Type inference regression and ICE in nightly 2020-10-06
The uom issue is fallout from fixing #27675
The really minimal example of this is
use std::ops::Add;
trait A {
type U: Add<i64> + Add<u64>;
}
fn f<T: A>(t: T::U) {
let x = t + Default::default();
}
on stable the compiler will arbitrarily decide to use the Add<u64> impl for +. Some of the changes from #73905 meant that there wasn't a good way to keep this behaviour, so this is now reported as ambiguous (which it is).
comment created time in 21 days