Repository: brendanzab/gl-rs (language: rust)

Issue:
Update glutin requirement from 0.19.0 to 0.21.0
Updates the requirements on [glutin](https://github.com/tomaka/glutin) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [glutin's changelog](https://github.com/rust-windowing/glutin/blob/master/CHANGELOG.md).*

> # Unreleased
> 
> # Version 0.21.0-rc2 (2019-04-08)
> 
>  - **Breaking**: Removed `DisplayLost` variant to `ContextError`.
>  - **Breaking**: Renamed `NotCurrentContext` to `NotCurrent`.
>  - **Breaking**: Renamed `PossiblyCurrentContext` to `PossiblyCurrent`.
>  - Added `treat_as_current` function.
> 
> # Version 0.21.0-rc1 (2019-04-07)
> 
>  - **Breaking:** Replaced `CreationErrorPair` enum variant with `CreationErrors`.
>  - Added `Clone` to `ContextBuilder`.
>  - Added headless example.
>  - Removed internal code relating to libcaca.
>  - Implemented `Debug` on all public facing types.
>  - Dropping contexts on platforms using egl and/or glx no longer resets the
>  current context, if the context dropped wasn't the current context.
>  - Added context sharing support to MacOS.
>  - **Breaking**: Removed `ContextTrait`.
>  - **Breaking**: Renamed `OsMesaContextExt` to `HeadlessContextExt`. Added functions
>  for using egl-surfaceless.
>  - **Breaking**: Changed `WindowedContext` and `RawContext` into typedefs of
>  `ContextWrapper`.
>  - **Breaking**: Removed `new_windowed` and `new_headless` from `WindowedContext`
>  and `Context`, respectively.
>  - **Breaking**: Added two new types, `NotCurrentContext` and `PossiblyCurrentContext`,
>  which `RawContext`, `WindowedContext`, `ContextBuilder` and `Context` are now
>  generic over.
>  - Added `{make,treat_as}_not_current` function to `{Raw,Windowed,}Context`.
>  - We now load `libGL.so` instead of `libGLX.so`.
>  - **Breaking**: Added `DisplayLost` variant to `ContextError`.
>  - Fixed bug where we drop the hidden window belonging to a headless context on
>  on X11 and/or Wayland before the actual context.
>  - "Fixed" bug where we will close `EGLDisplay`s while they are still in use by
>  others. Angry and/or salty rant can be found in `glutin/src/api/egl/mod.rs`,
>  you can't miss it.
>  - **Breaking**: `WindowedContext`s now deref to `Context`, not `Window`. 
>  Please use `.window()` to access the window.
> 
> # Version 0.20.0 (2019-03-09)
> 
> - We no longer load `libEGL.so` and `libGL.so` multiple times.
> - Fixes `Context::is_current` incorrectly returning `false`.
> - Made `ContextBuilder`'s `pf_reqs` public.
> - **Breaking:** Renamed `GlContext{,Ext}` to `ContextTrait{,Ext}`.
> - **Breaking:** Renamed `GlWindow` to `WindowedContext`.
> - Implemented context sharing support for Windows and Linux.
> - Added support for contexts made from raw parts for Windows and Linux.
> - **Breaking:** Removed `shareable_with_windowed_contexts`. Now you must build
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/tomaka/glutin/commits)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
Dependabot will **not** automatically merge this PR because this dependency is pre-1.0.0.

[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>


Discussion / hints:

Fix patch:
diff --git a/gl/Cargo.toml b/gl/Cargo.toml
index 4532320c..f00ccea2 100644
--- a/gl/Cargo.toml
+++ b/gl/Cargo.toml
@@ -20,4 +20,4 @@ keywords = ["gl", "egl", "opengl", "khronos"]
 gl_generator = { version = "0.13.0", path = "../gl_generator" }
 
 [dev-dependencies]
-glutin = "0.19.0"
+glutin = "0.21.0"
diff --git a/gl/examples/basic.rs b/gl/examples/basic.rs
index b83377e8..f3bd74b1 100644
--- a/gl/examples/basic.rs
+++ b/gl/examples/basic.rs
@@ -16,15 +16,14 @@ extern crate gl;
 extern crate glutin;
 
 fn main() {
-    use glutin::GlContext;
-
     let mut events_loop = glutin::EventsLoop::new();
     let window = glutin::WindowBuilder::new();
-    let context = glutin::ContextBuilder::new();
-    let gl_window = glutin::GlWindow::new(window, context, &events_loop).unwrap();
+    let gl_window = glutin::ContextBuilder::new()
+        .build_windowed(window, &events_loop)
+        .unwrap();
 
     // It is essential to make the context current before calling `gl::load_with`.
-    unsafe { gl_window.make_current().unwrap() };
+    let gl_window = unsafe { gl_window.make_current().unwrap() };
 
     // Load the OpenGL function pointers
     // TODO: `as *const _` will not be needed once glutin is updated to the latest gl version
diff --git a/gl/examples/triangle.rs b/gl/examples/triangle.rs
index cd0d231b..5ea57a1f 100644
--- a/gl/examples/triangle.rs
+++ b/gl/examples/triangle.rs
@@ -111,15 +111,14 @@ fn link_program(vs: GLuint, fs: GLuint) -> GLuint {
 }
 
 fn main() {
-    use glutin::GlContext;
-
     let mut events_loop = glutin::EventsLoop::new();
     let window = glutin::WindowBuilder::new();
-    let context = glutin::ContextBuilder::new();
-    let gl_window = glutin::GlWindow::new(window, context, &events_loop).unwrap();
+    let gl_window = glutin::ContextBuilder::new()
+        .build_windowed(window, &events_loop)
+        .unwrap();
 
     // It is essential to make the context current before calling `gl::load_with`.
-    unsafe { gl_window.make_current() }.unwrap();
+    let gl_window = unsafe { gl_window.make_current() }.unwrap();
 
     // Load the OpenGL function pointers
     // TODO: `as *const _` will not be needed once glutin is updated to the latest gl version


Test patch: