Skip to content

Specifying a revision in an extern mod directive can lead to duplication #8673

New issue

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

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

Already on GitHub? Sign in to your account

Closed
catamorphism opened this issue Aug 21, 2013 · 3 comments
Closed

Comments

@catamorphism
Copy link
Contributor

@metajack pointed out that if we want to move away from using submodules, to using directives like extern mod foo = http://whatever/a/b/c#xxxxxx, where xxxxxx is a revision ID, the particular known-good revision being used has to appear in multiple locations in the code. That's suboptimal.

For rustpkg, we should think about whether there's a way to store all of the "known-good versions" for a project's dependencies in one place.

@catamorphism
Copy link
Contributor Author

Discussed a bit during the meeting: https://etherpad.mozilla.org/Meeting-weekly-2013-09-10

We didn't come to a solution; I think the plan is to just try it and see how bad it is.

@ghost ghost assigned catamorphism Sep 10, 2013
@emberian
Copy link
Member

Visiting for triage, nothing to add.

@thestinger
Copy link
Contributor

It doesn't appear that this is relevant anymore with the removal of rustpkg. This is now in the scope of the new cargo.

@catamorphism catamorphism removed their assignment Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 21, 2022
Fix `same_functions_in_if_condition` FP

fixes rust-lang#8139

changelog: Don't consider `Foo<{ SomeConstant }>` and `Foo<{ SomeOtherConstant }>` to be the same, even if the constants have the same value.
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 3, 2024
…, r=Veykril

feature: Add `destructure_struct_binding`

Adds an assist for destructuring a struct in a binding (rust-lang#8673). I saw that rust-lang#13997 has been abandoned for a while, so I thought I'd give it a go.

## Example

```rust
let foo = Foo { bar: 1, baz: 2 };
let bar2 = foo.bar;
let baz2 = foo.baz;
let foo2 = foo;

let fizz = Fizz(1, 2);
let buzz = fizz.0;
```
becomes
```rust
let Foo { bar, baz } = Foo { bar: 1, baz: 2 };
let bar2 = bar;
let baz2 = baz;
let foo2 = todo!();

let Fizz(_0, _1) = Fizz(1, 2);
let buzz = _0;
```

More examples in the tests.

## What is included?

- [x] Destructure record, tuple, and unit struct bindings
- [x] Edit field usages
- [x] Non-exhaustive structs in foreign crates and private fields get hidden behind `..`
- [x] Nested bindings
- [x] Carry over `mut` and `ref mut` in nested bindings to fields, i.e. `let Foo { ref mut bar } = ...` becomes `let Foo { bar: Bar { baz: ref mut baz } } = ...`
- [x] Attempt to resolve collisions with other names in the scope
- [x] If the binding is to a reference, field usages are dereferenced if required
- [x] Use shorthand notation if possible

## Known limitations

- `let foo = Foo { bar: 1 }; foo;` currently results in `let Foo { bar } = Foo { bar: 1 }; todo!();` instead of reassembling the struct. This requires user intervention.
- Unused fields are not currently omitted. I thought that this is more ergonomic, as there already is a quick fix action for adding `: _` to unused field patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants