GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Purity by pcwalton · Pull Request #5412 · rust-lang/rust

Conversation

@pcwalton

@pcwalton pcwalton commented Mar 16, 2013

Copy link
Copy Markdown
Contributor
librustc: Make the compiler ignore purity. …

For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.

There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of @mut. Per
discussions with Niko I think we want to allow partial borrows of
@mut but detect obvious footguns. We should also improve the error
message when @mut is erroneously reborrowed.

r? @nikomatsakis

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@graydon

graydon commented Mar 16, 2013

Copy link
Copy Markdown
Contributor

Can you explain partial borrows? I don't understand that (sub-) issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thestinger

thestinger commented Mar 16, 2013

Copy link
Copy Markdown
Contributor

@graydon: When you borrow anything in an @mut box as &, it freezes it with a dynamic write barrier and modifying anything inside it will fail. Forbidding partial borrows would mean forcing explicit borrows of the whole box.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@graydon

graydon commented Mar 16, 2013

Copy link
Copy Markdown
Contributor

This much I already knew; just wondering if there is anything more subtle about partial borrows than "they imply a full borrow of their owner"?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pcwalton

pcwalton commented Mar 18, 2013

Copy link
Copy Markdown
Contributor Author

@graydon: Not really; it just can lead to confusion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pcwalton added 3 commits March 18, 2013 11:45
@pcwalton
librustc: Convert all uses of old lifetime notation to new lifetime n…
299995c
…otation. rs=delifetiming
@pcwalton
libsyntax: Stop parsing old lifetimes, except for the ones on data ty…
fc8c808
…pe declarations.
@pcwalton
librustc: Make the compiler ignore purity.
dc69018
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.

There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
bors added a commit that referenced this pull request Mar 19, 2013
@bors
auto merge of #5412 : pcwalton/rust/purity, r=pcwalton
e67448d
 	librustc: Make the compiler ignore purity. …

For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.

There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.

r? @nikomatsakis
@bors bors closed this Mar 19, 2013
@bors
bors merged commit dc69018 into rust-lang:incoming Mar 19, 2013
oli-obk pushed a commit to oli-obk/rust that referenced this pull request May 2, 2020
@flip1995
Rollup merge of rust-lang#5412 - dtolnay:tostring, r=flip1995
5ea4771
Downgrade inefficient_to_string to pedantic

From the [documentation](https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string):

> ```diff
> - ["foo", "bar"].iter().map(|s| s.to_string());
>
> + ["foo", "bar"].iter().map(|&s| s.to_string());
> ```

I feel like saving 10 nanoseconds from the formatting machinery isn't worth asking the programmer to insert extra `&` / `*` noise in the *vast* majority of cases. This is a pedantic lint.

changelog: Remove inefficient_to_string from default set of enabled lints
oli-obk pushed a commit to oli-obk/rust that referenced this pull request May 2, 2020
@bors
Auto merge of rust-lang#5438 - flip1995:rollup-pi762oy, r=flip1995
f8308c8
Rollup of 11 pull requests

Successful merges:

 - rust-lang#5406 (Fix update_lints)
 - rust-lang#5409 (Downgrade let_unit_value to pedantic)
 - rust-lang#5410 (Downgrade trivially_copy_pass_by_ref to pedantic)
 - rust-lang#5412 (Downgrade inefficient_to_string to pedantic)
 - rust-lang#5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`)
 - rust-lang#5417 (Update doc links and mentioned names in docs)
 - rust-lang#5419 (Downgrade unreadable_literal to pedantic)
 - rust-lang#5420 (Downgrade new_ret_no_self to pedantic)
 - rust-lang#5422 (CONTRIBUTING.md: fix broken triage link)
 - rust-lang#5424 (Incorrect suspicious_op_assign_impl)
 - rust-lang#5425 (Ehance opt_as_ref_deref lint.)

Failed merges:

 - rust-lang#5345 (Add lint for float in array comparison)
 - rust-lang#5411 (Downgrade implicit_hasher to pedantic)
 - rust-lang#5428 (Move cognitive_complexity to nursery)

r? @ghost

changelog: rollup
RalfJung added a commit to RalfJung/rust that referenced this pull request Oct 18, 2026
@RalfJung
Merge pull request rust-lang#5412 from mejrs/reexports
692f4c8
remove some of miri's public re-exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@pcwalton @graydon @thestinger @bors
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.