Skip to content
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

Removed @self and @Trait. #12030

Merged
merged 1 commit into from
Feb 7, 2014
Merged

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Feb 4, 2014

No description provided.

@@ -136,10 +137,10 @@ pub fn build_configuration(sess: Session) ->
}

// Convert strings provided as --cfg [cfgspec] into a crate_cfg
fn parse_cfgspecs(cfgspecs: ~[~str], demitter: @diagnostic::Emitter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the emitter was removed from all of these functions?

You could imagine a compiler invocation to want a different emitter, but if it was too painful to pass around then removing @ is probably more pressing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no other implementation of Emitter at this moment, seems a bit ridiculous to go through a trait object.
I've left most of the framework in place, in case we need something generic later (and then we can implement it sanely).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'm fine with that.

@alexcrichton
Copy link
Member

Heroic effort, nice work!

@nikomatsakis
Copy link
Contributor

nice

@eddyb
Copy link
Member Author

eddyb commented Feb 5, 2014

As a side-effect, some trait operations produce cleaner IR (now that @Trait isn't a special case anymore):

fn foo(x: ~Clone) {
    let y: &Clone = x;
}
; before
define internal void @foo({ void (i8*)**, i8* }*) unnamed_addr #4 {
entry-block:
  %x = alloca { void (i8*)**, i8* }
  %y = alloca { void (i8*)**, i8* }
  %__auto_borrow_obj = alloca { void (i8*)**, i8* }
  %1 = bitcast { void (i8*)**, i8* }* %0 to i8*
  %2 = bitcast { void (i8*)**, i8* }* %x to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %1, i64 16, i32 8, i1 false)
  %3 = getelementptr inbounds { void (i8*)**, i8* }* %x, i32 0, i32 0
  %4 = load void (i8*)*** %3
  %5 = getelementptr inbounds { void (i8*)**, i8* }* %__auto_borrow_obj, i32 0, i32 0
  store void (i8*)** %4, void (i8*)*** %5
  %6 = getelementptr inbounds { void (i8*)**, i8* }* %x, i32 0, i32 1
  %7 = load i8** %6
  %8 = getelementptr inbounds { void (i8*)**, i8* }* %__auto_borrow_obj, i32 0, i32 1
  store i8* %7, i8** %8
  %9 = bitcast { void (i8*)**, i8* }* %__auto_borrow_obj to i8*
  %10 = bitcast { void (i8*)**, i8* }* %y to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %10, i8* %9, i64 16, i32 8, i1 false)
  call void @"~std::clone::Clone.Send::glue_drop"({ void (i8*)**, i8* }* %x)
  ret void
}
; after
define internal void @foo({ void (i8*)**, i8* }*) unnamed_addr #4 {
entry-block:
  %y = alloca { void (i8*)**, i8* }
  %1 = bitcast { void (i8*)**, i8* }* %0 to i8*
  %2 = bitcast { void (i8*)**, i8* }* %y to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %1, i64 16, i32 8, i1 false)
  call void @"~std::clone::Clone.Send::glue_drop"({ void (i8*)**, i8* }* %0)
  ret void
}

@bors bors closed this Feb 7, 2014
@bors bors merged commit b2d30b7 into rust-lang:master Feb 7, 2014
@eddyb eddyb deleted the kill-at-self-and-trait branch February 7, 2014 01:46
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 11, 2024
…uote-in-char-literal, r=llogiq

11973: Don't escape `"` in `'"'`

Fixes rust-lang#11973.

```
changelog: [`single_char_pattern`]: don't escape `"` in `'"'`
```
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

Successfully merging this pull request may close these issues.

5 participants